summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--afms/README2
-rw-r--r--wizards/README3
-rw-r--r--xmlhelp/README2
-rw-r--r--xmlreader/README7
-rw-r--r--xpdf/README3
5 files changed, 15 insertions, 2 deletions
diff --git a/afms/README b/afms/README
index c149c1aa4e7b..78be83a38c46 100644
--- a/afms/README
+++ b/afms/README
@@ -1 +1 @@
-External package containing font metrics
+External package containing font metrics.
diff --git a/wizards/README b/wizards/README
index c36091ffeea5..332c53507af0 100644
--- a/wizards/README
+++ b/wizards/README
@@ -1 +1,4 @@
Java wizards for db setup, importing, tutorials, etc.
+
+There are also partially converted python copies of each wizard, which
+we are hoping to migrate to in order to remove the Java dependency here. \ No newline at end of file
diff --git a/xmlhelp/README b/xmlhelp/README
index b4c1f05107d7..3e54ddc51bb2 100644
--- a/xmlhelp/README
+++ b/xmlhelp/README
@@ -1 +1 @@
-Help reader and viewer for online help.
+Help reader and viewer for online help. \ No newline at end of file
diff --git a/xmlreader/README b/xmlreader/README
new file mode 100644
index 000000000000..92a624d969a3
--- /dev/null
+++ b/xmlreader/README
@@ -0,0 +1,7 @@
+fast/small XML pull parser.
+
+Implements a simple, fast pull parser, currently used by [[configmgr]] and
+[[stoc]]'s simpleregistry code (used to register UNO components in
+services.rdb files). It supports a subset of XML features, but is fast
+and small.
+
diff --git a/xpdf/README b/xpdf/README
index dffe1066f466..0c733659f932 100644
--- a/xpdf/README
+++ b/xpdf/README
@@ -1 +1,4 @@
PDF-viewer library from [http://www.foolabs.com/xpdf/].
+
+This code is -used by [[sdext/source/pdfimport]] to implement the PDF
+import functionality, that allows PDF's to be edited.
git/Thunderbird/Thunderbird_V115_Kevin/diff/devtools/client/aboutdebugging/src/modules/usb-runtimes.js?id=4c4bedbbf2a92ea078198072dd0a76453a4d6891'>devtools/client/aboutdebugging/src/modules/usb-runtimes.js122
-rw-r--r--devtools/client/aboutdebugging/src/moz.build17
-rw-r--r--devtools/client/aboutdebugging/src/reducers/debug-targets-state.js155
-rw-r--r--devtools/client/aboutdebugging/src/reducers/index.js24
-rw-r--r--devtools/client/aboutdebugging/src/reducers/moz.build10
-rw-r--r--devtools/client/aboutdebugging/src/reducers/runtimes-state.js178
-rw-r--r--devtools/client/aboutdebugging/src/reducers/ui-state.js115
-rw-r--r--devtools/client/aboutdebugging/src/types/debug-target.js71
-rw-r--r--devtools/client/aboutdebugging/src/types/index.js18
-rw-r--r--devtools/client/aboutdebugging/src/types/moz.build10
-rw-r--r--devtools/client/aboutdebugging/src/types/runtime.js164
-rw-r--r--devtools/client/aboutdebugging/src/types/ui.js85
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser.ini167
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js440
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js87
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js86
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js78
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js246
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_reload.js136
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_storage.js90
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_toolbox.js122
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_actions_and_status.js153
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_terminate_on_idle.js200
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js73
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_popup_picker.js99
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js145
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js116
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js70
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js89
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js65
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js68
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js49
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js103
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js81
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js70
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js62
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js40
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js83
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js72
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js51
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_breakpoint.js74
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js102
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js45
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js122
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js74
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js63
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js53
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js56
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js74
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js106
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js46
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js36
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js102
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_zoom.js65
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js141
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_node_picker.js83
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js106
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js82
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js112
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js91
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js53
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js87
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js44
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js238
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js62
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js34
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js114
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_rtl.js62
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js90
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js65
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js56
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js109
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js52
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js78
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js131
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js68
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js124
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js61
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js118
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js70
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js71
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js104
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js104
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js48
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js192
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js43
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js38
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js54
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js50
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js44
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js50
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js65
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js69
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js57
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_navigate.js31
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js108
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js46
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js274
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js67
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js67
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js97
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js69
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js154
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js111
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js90
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js121
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js54
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js68
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js160
-rw-r--r--devtools/client/aboutdebugging/test/browser/empty.html1
-rw-r--r--devtools/client/aboutdebugging/test/browser/head.js505
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-adb.js59
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-addons.js262
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js54
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-mocks.js262
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-real-usb.js54
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-serviceworker.js111
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-telemetry.js115
-rw-r--r--devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js137
-rw-r--r--devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js138
-rw-r--r--devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js76
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json1
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json23
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/doc_aboutdebugging_devtoolstoolbox_breakpoint.html9
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpibin0 -> 4580 bytes-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json14
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/script_aboutdebugging_devtoolstoolbox_breakpoint.js12
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html38
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js31
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html30
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js1
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html30
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js6
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html61
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js35
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpibin0 -> 495578 bytes-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpibin0 -> 824421 bytes-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpibin0 -> 782572 bytes-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpibin0 -> 713900 bytes-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json13
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js8
-rw-r--r--devtools/client/aboutdebugging/test/browser/test-tab-favicons.html8
-rw-r--r--devtools/client/aboutdebugging/test/node/.eslintrc.js10
-rw-r--r--devtools/client/aboutdebugging/test/node/README.md22
-rw-r--r--devtools/client/aboutdebugging/test/node/babel.config.js8
-rw-r--r--devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap91
-rw-r--r--devtools/client/aboutdebugging/test/node/components/shared-message.test.js69
-rw-r--r--devtools/client/aboutdebugging/test/node/jest.config.js14
-rw-r--r--devtools/client/aboutdebugging/test/node/package.json22
-rw-r--r--devtools/client/aboutdebugging/test/node/setup.js15
-rw-r--r--devtools/client/aboutdebugging/test/node/yarn.lock4133
-rw-r--r--devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js27
-rw-r--r--devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js203
-rw-r--r--devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js10
-rw-r--r--devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini8
-rw-r--r--devtools/client/accessibility/accessibility-proxy.js595
-rw-r--r--devtools/client/accessibility/accessibility-view.js260
-rw-r--r--devtools/client/accessibility/accessibility.css851
-rw-r--r--devtools/client/accessibility/actions/accessibles.js70
-rw-r--r--devtools/client/accessibility/actions/audit.js36
-rw-r--r--devtools/client/accessibility/actions/details.js40
-rw-r--r--devtools/client/accessibility/actions/moz.build5
-rw-r--r--devtools/client/accessibility/actions/simulation.js16
-rw-r--r--devtools/client/accessibility/actions/ui.js77
-rw-r--r--devtools/client/accessibility/components/AccessibilityPrefs.js109
-rw-r--r--devtools/client/accessibility/components/AccessibilityRow.js328
-rw-r--r--devtools/client/accessibility/components/AccessibilityRowValue.js58
-rw-r--r--devtools/client/accessibility/components/AccessibilityTree.js298
-rw-r--r--devtools/client/accessibility/components/AccessibilityTreeFilter.js171
-rw-r--r--devtools/client/accessibility/components/Accessible.js563
-rw-r--r--devtools/client/accessibility/components/AuditController.js90
-rw-r--r--devtools/client/accessibility/components/AuditFilter.js91
-rw-r--r--devtools/client/accessibility/components/AuditProgressOverlay.js95
-rw-r--r--devtools/client/accessibility/components/Badge.js40
-rw-r--r--devtools/client/accessibility/components/Badges.js88
-rw-r--r--devtools/client/accessibility/components/Button.js112
-rw-r--r--devtools/client/accessibility/components/Check.js157
-rw-r--r--devtools/client/accessibility/components/Checks.js117
-rw-r--r--devtools/client/accessibility/components/ColorContrastAccessibility.js229
-rw-r--r--devtools/client/accessibility/components/ContrastBadge.js55
-rw-r--r--devtools/client/accessibility/components/Description.js56
-rw-r--r--devtools/client/accessibility/components/DisplayTabbingOrder.js79
-rw-r--r--devtools/client/accessibility/components/KeyboardBadge.js56
-rw-r--r--devtools/client/accessibility/components/KeyboardCheck.js94
-rw-r--r--devtools/client/accessibility/components/LearnMoreLink.js76
-rw-r--r--devtools/client/accessibility/components/MainFrame.js245
-rw-r--r--devtools/client/accessibility/components/RightSidebar.js67
-rw-r--r--devtools/client/accessibility/components/SimulationMenuButton.js167
-rw-r--r--devtools/client/accessibility/components/TextLabelBadge.js57
-rw-r--r--devtools/client/accessibility/components/TextLabelCheck.js225
-rw-r--r--devtools/client/accessibility/components/Toolbar.js74
-rw-r--r--devtools/client/accessibility/components/moz.build33
-rw-r--r--devtools/client/accessibility/constants.js197
-rw-r--r--devtools/client/accessibility/index.html42
-rw-r--r--devtools/client/accessibility/main.js17
-rw-r--r--devtools/client/accessibility/moz.build20
-rw-r--r--devtools/client/accessibility/panel.js350
-rw-r--r--devtools/client/accessibility/picker.js189
-rw-r--r--devtools/client/accessibility/provider.js112
-rw-r--r--devtools/client/accessibility/reducers/accessibles.js158
-rw-r--r--devtools/client/accessibility/reducers/audit.js109
-rw-r--r--devtools/client/accessibility/reducers/details.js60
-rw-r--r--devtools/client/accessibility/reducers/index.js28
-rw-r--r--devtools/client/accessibility/reducers/moz.build7
-rw-r--r--devtools/client/accessibility/reducers/simulation.js52
-rw-r--r--devtools/client/accessibility/reducers/ui.js217
-rw-r--r--devtools/client/accessibility/test/browser/browser.ini49
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js74
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js104
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js58
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_mutations.js217
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js66
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js109
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js114
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js73
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js245
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js169
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_reload.js107
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js81
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js80
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js111
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_simulation.js99
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js140
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js195
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree.js75
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js137
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js104
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js109
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js112
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js62
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js121
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js186
-rw-r--r--devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js149
-rw-r--r--devtools/client/accessibility/test/browser/head.js823
-rw-r--r--devtools/client/accessibility/test/chrome/chrome.ini11
-rw-r--r--devtools/client/accessibility/test/chrome/contrast.snapshots.js262
-rw-r--r--devtools/client/accessibility/test/chrome/head.js32
-rw-r--r--devtools/client/accessibility/test/chrome/test_accessible_contrast.html84
-rw-r--r--devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html97
-rw-r--r--devtools/client/accessibility/test/chrome/test_accessible_openLink.html111
-rw-r--r--devtools/client/accessibility/test/chrome/test_accessible_relations.html103
-rw-r--r--devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html148
-rw-r--r--devtools/client/accessibility/test/node/.eslintrc.js11
-rw-r--r--devtools/client/accessibility/test/node/README.md22
-rw-r--r--devtools/client/accessibility/test/node/babel.config.js15
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap7
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap3
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap39
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap7
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap13
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap13
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap3
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap15
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap5
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap11
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap9
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap7
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap9
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap9
-rw-r--r--devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap13
-rw-r--r--devtools/client/accessibility/test/node/components/accessibility-prefs.test.js107
-rw-r--r--devtools/client/accessibility/test/node/components/accessibility-row-value.test.js56
-rw-r--r--devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js437
-rw-r--r--devtools/client/accessibility/test/node/components/audit-controller.test.js91
-rw-r--r--devtools/client/accessibility/test/node/components/audit-filter.test.js153
-rw-r--r--devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js126
-rw-r--r--devtools/client/accessibility/test/node/components/badge.test.js42
-rw-r--r--devtools/client/accessibility/test/node/components/badges.test.js114
-rw-r--r--devtools/client/accessibility/test/node/components/check.test.js50
-rw-r--r--devtools/client/accessibility/test/node/components/contrast-badge.test.js96
-rw-r--r--devtools/client/accessibility/test/node/components/display-tabbing-order.test.js91
-rw-r--r--devtools/client/accessibility/test/node/components/keyboard-badge.test.js73
-rw-r--r--devtools/client/accessibility/test/node/components/keyboard-check.test.js47
-rw-r--r--devtools/client/accessibility/test/node/components/text-label-badge.test.js86
-rw-r--r--devtools/client/accessibility/test/node/components/text-label-check.test.js52
-rw-r--r--devtools/client/accessibility/test/node/helpers.js134
-rw-r--r--devtools/client/accessibility/test/node/jest.config.js19
-rw-r--r--devtools/client/accessibility/test/node/package.json27
-rw-r--r--devtools/client/accessibility/test/node/setup.js15
-rw-r--r--devtools/client/accessibility/test/node/yarn.lock4316
-rw-r--r--devtools/client/accessibility/utils/audit.js45
-rw-r--r--devtools/client/accessibility/utils/l10n.js11
-rw-r--r--devtools/client/accessibility/utils/moz.build5
-rw-r--r--devtools/client/application/README.md334
-rw-r--r--devtools/client/application/application.css36
-rw-r--r--devtools/client/application/index.html22
-rw-r--r--devtools/client/application/initializer.js150
-rw-r--r--devtools/client/application/moz.build13
-rw-r--r--devtools/client/application/panel.js46
-rw-r--r--devtools/client/application/src/actions/index.js12
-rw-r--r--devtools/client/application/src/actions/manifest.js50
-rw-r--r--devtools/client/application/src/actions/moz.build11
-rw-r--r--devtools/client/application/src/actions/page.js20
-rw-r--r--devtools/client/application/src/actions/ui.js20
-rw-r--r--devtools/client/application/src/actions/workers.js51
-rw-r--r--devtools/client/application/src/base.css83
-rw-r--r--devtools/client/application/src/components/App.css34
-rw-r--r--devtools/client/application/src/components/App.js46
-rw-r--r--devtools/client/application/src/components/manifest/Manifest.js136
-rw-r--r--devtools/client/application/src/components/manifest/ManifestColorItem.css29
-rw-r--r--devtools/client/application/src/components/manifest/ManifestColorItem.js57
-rw-r--r--devtools/client/application/src/components/manifest/ManifestEmpty.js81
-rw-r--r--devtools/client/application/src/components/manifest/ManifestIconItem.css7
-rw-r--r--devtools/client/application/src/components/manifest/ManifestIconItem.js98
-rw-r--r--devtools/client/application/src/components/manifest/ManifestIssue.css17
-rw-r--r--devtools/client/application/src/components/manifest/ManifestIssue.js72
-rw-r--r--devtools/client/application/src/components/manifest/ManifestIssueList.css15
-rw-r--r--devtools/client/application/src/components/manifest/ManifestIssueList.js68
-rw-r--r--devtools/client/application/src/components/manifest/ManifestItem.css28
-rw-r--r--devtools/client/application/src/components/manifest/ManifestItem.js50
-rw-r--r--devtools/client/application/src/components/manifest/ManifestJsonLink.css9
-rw-r--r--devtools/client/application/src/components/manifest/ManifestJsonLink.js67
-rw-r--r--devtools/client/application/src/components/manifest/ManifestLoader.css14
-rw-r--r--devtools/client/application/src/components/manifest/ManifestLoader.js108
-rw-r--r--devtools/client/application/src/components/manifest/ManifestPage.js76
-rw-r--r--devtools/client/application/src/components/manifest/ManifestSection.css25
-rw-r--r--devtools/client/application/src/components/manifest/ManifestSection.js44
-rw-r--r--devtools/client/application/src/components/manifest/ManifestUrlItem.css8
-rw-r--r--devtools/client/application/src/components/manifest/ManifestUrlItem.js39
-rw-r--r--devtools/client/application/src/components/manifest/moz.build18
-rw-r--r--devtools/client/application/src/components/moz.build14
-rw-r--r--devtools/client/application/src/components/routing/PageSwitcher.css45
-rw-r--r--devtools/client/application/src/components/routing/PageSwitcher.js59
-rw-r--r--devtools/client/application/src/components/routing/Sidebar.css33
-rw-r--r--devtools/client/application/src/components/routing/Sidebar.js70
-rw-r--r--devtools/client/application/src/components/routing/SidebarItem.css33
-rw-r--r--devtools/client/application/src/components/routing/SidebarItem.js95
-rw-r--r--devtools/client/application/src/components/routing/moz.build5
-rw-r--r--devtools/client/application/src/components/service-workers/Registration.css73
-rw-r--r--devtools/client/application/src/components/service-workers/Registration.js153
-rw-r--r--devtools/client/application/src/components/service-workers/RegistrationList.css54
-rw-r--r--devtools/client/application/src/components/service-workers/RegistrationList.js92
-rw-r--r--devtools/client/application/src/components/service-workers/RegistrationListEmpty.js122
-rw-r--r--devtools/client/application/src/components/service-workers/Worker.css75
-rw-r--r--devtools/client/application/src/components/service-workers/Worker.js225
-rw-r--r--devtools/client/application/src/components/service-workers/WorkersPage.js71
-rw-r--r--devtools/client/application/src/components/service-workers/moz.build11
-rw-r--r--devtools/client/application/src/components/ui/UIButton.css75
-rw-r--r--devtools/client/application/src/components/ui/UIButton.js41
-rw-r--r--devtools/client/application/src/components/ui/moz.build7
-rw-r--r--devtools/client/application/src/constants.js61
-rw-r--r--devtools/client/application/src/create-store.js50
-rw-r--r--devtools/client/application/src/middleware/event-telemetry.js37
-rw-r--r--devtools/client/application/src/middleware/moz.build7
-rw-r--r--devtools/client/application/src/modules/application-services.js85
-rw-r--r--devtools/client/application/src/modules/l10n.js12
-rw-r--r--devtools/client/application/src/modules/moz.build8
-rw-r--r--devtools/client/application/src/moz.build17
-rw-r--r--devtools/client/application/src/reducers/index.js28
-rw-r--r--devtools/client/application/src/reducers/manifest-state.js158
-rw-r--r--devtools/client/application/src/reducers/moz.build11
-rw-r--r--devtools/client/application/src/reducers/page-state.js39
-rw-r--r--devtools/client/application/src/reducers/ui-state.js30
-rw-r--r--devtools/client/application/src/reducers/workers-state.js65
-rw-r--r--devtools/client/application/src/types/index.js18
-rw-r--r--devtools/client/application/src/types/manifest.js89
-rw-r--r--devtools/client/application/src/types/moz.build10
-rw-r--r--devtools/client/application/src/types/routing.js16
-rw-r--r--devtools/client/application/src/types/service-workers.js35
-rw-r--r--devtools/client/application/test/browser/browser.ini80
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_debug-service-worker.js61
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_list-domain-workers.js70
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_list-multiple-workers-same-registration.js64
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_list-several-workers.js54
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_list-single-worker.js64
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_list-unicode.js47
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_list-workers-empty.js29
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_manifest-display.js145
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_manifest-load.js67
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_manifest-open-json.js67
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_manifest-reload.js51
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_open-links.js48
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_sidebar.js82
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_start-service-worker.js54
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_target-switching.js68
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_telemetry-debug-worker.js49
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_telemetry-select-page.js26
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_telemetry-start-worker.js45
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_telemetry-unregister-worker.js37
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_unregister-worker.js36
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_viewsource-service-worker.js50
-rw-r--r--devtools/client/application/test/browser/browser_application_panel_worker-states.js62
-rw-r--r--devtools/client/application/test/browser/head.js134
-rw-r--r--devtools/client/application/test/browser/resources/manifest/icon.svg4
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-fail.html9
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-no-manifest.html8
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-ok-icons.html9
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-ok-json-error.html10
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-ok-manifest-link.html9
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-ok-warnings.html10
-rw-r--r--devtools/client/application/test/browser/resources/manifest/load-ok.html9
-rw-r--r--devtools/client/application/test/browser/resources/manifest/manifest.json3
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/controlled-install-sw.js29
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/controlled-install.html27
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/debug-sw.js18
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/debug.html25
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/dynamic-registration.html19
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/empty-sw.js4
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/empty.html11
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/scope-page.html19
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/simple-unicode.html15
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/simple.html32
-rw-r--r--devtools/client/application/test/node/.eslintrc.js10
-rw-r--r--devtools/client/application/test/node/actions/actions_application_panel-manifest.test.js83
-rw-r--r--devtools/client/application/test/node/babel.config.js8
-rw-r--r--devtools/client/application/test/node/components/__snapshots__/components_application_panel-App.test.js.snap12
-rw-r--r--devtools/client/application/test/node/components/components_application_panel-App.test.js26
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-Manifest.test.js.snap396
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestColorItem.test.js.snap58
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestEmpty.test.js.snap46
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIconItem.test.js.snap106
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssue.test.js.snap49
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssueList.test.js.snap89
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestItem.test.js.snap35
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestJsonLink.test.js.snap26
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestLoader.test.js.snap50
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestPage.test.js.snap80
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestSection.test.js.snap30
-rw-r--r--devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestUrlItem.test.js.snap21
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-Manifest.test.js73
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestColorItem.test.js48
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestEmpty.test.js23
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIconItem.test.js48
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssue.test.js30
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssueList.test.js59
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestItem.test.js28
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestJsonLink.test.js36
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestLoader.test.js82
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js59
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestSection.test.js34
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestUrlItem.test.js30
-rw-r--r--devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-PageSwitcher.test.js.snap9
-rw-r--r--devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-Sidebar.test.js.snap64
-rw-r--r--devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-SidebarItem.test.js.snap141
-rw-r--r--devtools/client/application/test/node/components/routing/components_application_panel-PageSwitcher.test.js73
-rw-r--r--devtools/client/application/test/node/components/routing/components_application_panel-Sidebar.test.js51
-rw-r--r--devtools/client/application/test/node/components/routing/components_application_panel-SidebarItem.test.js82
-rw-r--r--devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Registration.test.js.snap180
-rw-r--r--devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationList.test.js.snap159
-rw-r--r--devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationListEmpty.test.js.snap66
-rw-r--r--devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Worker.test.js.snap132
-rw-r--r--devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-WorkersPage.test.js.snap143
-rw-r--r--devtools/client/application/test/node/components/service-workers/components_application_panel-Registration.test.js88
-rw-r--r--devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationList.test.js43
-rw-r--r--devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationListEmpty.test.js23
-rw-r--r--devtools/client/application/test/node/components/service-workers/components_application_panel-Worker.test.js110
-rw-r--r--devtools/client/application/test/node/components/service-workers/components_application_panel-WorkersPage.test.js82
-rw-r--r--devtools/client/application/test/node/fixtures/data/constants.js312
-rw-r--r--devtools/client/application/test/node/helpers.js31
-rw-r--r--devtools/client/application/test/node/jest.config.js14
-rw-r--r--devtools/client/application/test/node/package.json25
-rw-r--r--devtools/client/application/test/node/setup.js15
-rw-r--r--devtools/client/application/test/node/yarn.lock3563
-rw-r--r--devtools/client/application/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/application/test/xpcshell/test_manifest_reducer.js201
-rw-r--r--devtools/client/application/test/xpcshell/test_page_reducer.js22
-rw-r--r--devtools/client/application/test/xpcshell/test_ui_reducer.js22
-rw-r--r--devtools/client/application/test/xpcshell/test_workers_reducer.js115
-rw-r--r--devtools/client/application/test/xpcshell/xpcshell-head.js10
-rw-r--r--devtools/client/application/test/xpcshell/xpcshell.ini10
-rw-r--r--devtools/client/bin/devtools-node-test-runner.js322
-rw-r--r--devtools/client/constants.js29
-rw-r--r--devtools/client/debugger/.remarkignore2
-rw-r--r--devtools/client/debugger/.remarkrc17
-rw-r--r--devtools/client/debugger/babel.config.js90
-rw-r--r--devtools/client/debugger/bin/bundle.js125
-rw-r--r--devtools/client/debugger/bin/module-manifest.json2565
-rw-r--r--devtools/client/debugger/bin/watch.js31
-rw-r--r--devtools/client/debugger/configs/mozilla-central-mappings.js19
-rw-r--r--devtools/client/debugger/dist/moz.build11
-rw-r--r--devtools/client/debugger/dist/parser-worker.js73552
-rw-r--r--devtools/client/debugger/dist/pretty-print-worker.js10534
-rw-r--r--devtools/client/debugger/dist/search-worker.js397
-rw-r--r--devtools/client/debugger/dist/vendors.css20
-rw-r--r--devtools/client/debugger/dist/vendors.js2496
-rw-r--r--devtools/client/debugger/images/arrow-down.svg6
-rw-r--r--devtools/client/debugger/images/arrow-up.svg6
-rw-r--r--devtools/client/debugger/images/arrow.svg6
-rw-r--r--devtools/client/debugger/images/blackBox.svg9
-rw-r--r--devtools/client/debugger/images/breadcrumbs-divider.svg18
-rw-r--r--devtools/client/debugger/images/breakpoint.svg6
-rw-r--r--devtools/client/debugger/images/case-match.svg6
-rw-r--r--devtools/client/debugger/images/column-marker.svg6
-rw-r--r--devtools/client/debugger/images/command-chevron.svg6
-rw-r--r--devtools/client/debugger/images/disable-pausing.svg15
-rw-r--r--devtools/client/debugger/images/enable-pausing.svg15
-rw-r--r--devtools/client/debugger/images/file-small.svg6
-rw-r--r--devtools/client/debugger/images/folder.svg6
-rw-r--r--devtools/client/debugger/images/globe-small.svg7
-rw-r--r--devtools/client/debugger/images/globe.svg9
-rw-r--r--devtools/client/debugger/images/help.svg7
-rw-r--r--devtools/client/debugger/images/home.svg6
-rw-r--r--devtools/client/debugger/images/loader.svg7
-rw-r--r--devtools/client/debugger/images/markup-breakpoint.svg7
-rw-r--r--devtools/client/debugger/images/next-circle.svg9
-rw-r--r--devtools/client/debugger/images/next.svg8
-rw-r--r--devtools/client/debugger/images/pane-collapse.svg7
-rw-r--r--devtools/client/debugger/images/pane-expand.svg7
-rw-r--r--devtools/client/debugger/images/pause.svg8
-rw-r--r--devtools/client/debugger/images/plus.svg6
-rw-r--r--devtools/client/debugger/images/prettyPrint.svg6
-rw-r--r--devtools/client/debugger/images/regex-match.svg9
-rw-r--r--devtools/client/debugger/images/reload.svg7
-rw-r--r--devtools/client/debugger/images/search.svg6
-rw-r--r--devtools/client/debugger/images/sources/aframe.svg6
-rw-r--r--devtools/client/debugger/images/sources/angular.svg8
-rw-r--r--devtools/client/debugger/images/sources/babel.svg6
-rw-r--r--devtools/client/debugger/images/sources/backbone.svg6
-rw-r--r--devtools/client/debugger/images/sources/choo.svg14
-rw-r--r--devtools/client/debugger/images/sources/coffeescript.svg6
-rw-r--r--devtools/client/debugger/images/sources/dojo.svg4
-rw-r--r--devtools/client/debugger/images/sources/ember.svg4
-rw-r--r--devtools/client/debugger/images/sources/express.svg7
-rw-r--r--devtools/client/debugger/images/sources/extension.svg6
-rw-r--r--devtools/client/debugger/images/sources/immutable.svg6
-rw-r--r--devtools/client/debugger/images/sources/javascript.svg6
-rw-r--r--devtools/client/debugger/images/sources/jquery.svg6
-rw-r--r--devtools/client/debugger/images/sources/lodash.svg7
-rw-r--r--devtools/client/debugger/images/sources/marko.svg64
-rw-r--r--devtools/client/debugger/images/sources/mobx.svg7
-rw-r--r--devtools/client/debugger/images/sources/nextjs.svg17
-rw-r--r--devtools/client/debugger/images/sources/node.svg6
-rw-r--r--devtools/client/debugger/images/sources/nuxtjs.svg4
-rw-r--r--devtools/client/debugger/images/sources/preact.svg11
-rw-r--r--devtools/client/debugger/images/sources/pug.svg118
-rw-r--r--devtools/client/debugger/images/sources/react.svg6
-rw-r--r--devtools/client/debugger/images/sources/redux.svg6
-rw-r--r--devtools/client/debugger/images/sources/rxjs.svg33
-rw-r--r--devtools/client/debugger/images/sources/sencha-extjs.svg13
-rw-r--r--devtools/client/debugger/images/sources/typescript.svg6
-rw-r--r--devtools/client/debugger/images/sources/underscore.svg8
-rw-r--r--devtools/client/debugger/images/sources/vuejs.svg7
-rw-r--r--devtools/client/debugger/images/sources/webpack.svg8
-rw-r--r--devtools/client/debugger/images/stepIn.svg8
-rw-r--r--devtools/client/debugger/images/stepOut.svg8
-rw-r--r--devtools/client/debugger/images/tab.svg6
-rw-r--r--devtools/client/debugger/images/trace.svg6
-rw-r--r--devtools/client/debugger/images/webconsole-logpoint.svg6
-rw-r--r--devtools/client/debugger/images/whole-word-match.svg13
-rw-r--r--devtools/client/debugger/images/window.svg6
-rw-r--r--devtools/client/debugger/images/worker.svg7
-rw-r--r--devtools/client/debugger/index.html73
-rw-r--r--devtools/client/debugger/jest-test.config.js50
-rw-r--r--devtools/client/debugger/jest.config.js15
-rw-r--r--devtools/client/debugger/moz.build24
-rw-r--r--devtools/client/debugger/package.json101
-rw-r--r--devtools/client/debugger/panel.js348
-rw-r--r--devtools/client/debugger/src/.eslintignore5
-rw-r--r--devtools/client/debugger/src/.eslintrc.js372
-rw-r--r--devtools/client/debugger/src/actions/README.md26
-rw-r--r--devtools/client/debugger/src/actions/ast/index.js5
-rw-r--r--devtools/client/debugger/src/actions/ast/moz.build11
-rw-r--r--devtools/client/debugger/src/actions/ast/setInScopeLines.js94
-rw-r--r--devtools/client/debugger/src/actions/ast/tests/__snapshots__/setInScopeLines.spec.js.snap16
-rw-r--r--devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js79
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js273
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/index.js426
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/modify.js382
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/moz.build13
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js138
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/tests/__snapshots__/breakpoints.spec.js.snap173
-rw-r--r--devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js521
-rw-r--r--devtools/client/debugger/src/actions/event-listeners.js77
-rw-r--r--devtools/client/debugger/src/actions/exceptions.js30
-rw-r--r--devtools/client/debugger/src/actions/expressions.js195
-rw-r--r--devtools/client/debugger/src/actions/file-search.js48
-rw-r--r--devtools/client/debugger/src/actions/index.js48
-rw-r--r--devtools/client/debugger/src/actions/moz.build31
-rw-r--r--devtools/client/debugger/src/actions/navigation.js61
-rw-r--r--devtools/client/debugger/src/actions/pause/breakOnNext.js18
-rw-r--r--devtools/client/debugger/src/actions/pause/commands.js157
-rw-r--r--devtools/client/debugger/src/actions/pause/continueToHere.js62
-rw-r--r--devtools/client/debugger/src/actions/pause/expandScopes.js17
-rw-r--r--devtools/client/debugger/src/actions/pause/fetchFrames.js23
-rw-r--r--devtools/client/debugger/src/actions/pause/fetchScopes.js30
-rw-r--r--devtools/client/debugger/src/actions/pause/highlightCalls.js89
-rw-r--r--devtools/client/debugger/src/actions/pause/index.js33
-rw-r--r--devtools/client/debugger/src/actions/pause/inlinePreview.js244
-rw-r--r--devtools/client/debugger/src/actions/pause/mapDisplayNames.js49
-rw-r--r--devtools/client/debugger/src/actions/pause/mapFrames.js157
-rw-r--r--devtools/client/debugger/src/actions/pause/mapScopes.js194
-rw-r--r--devtools/client/debugger/src/actions/pause/moz.build27
-rw-r--r--devtools/client/debugger/src/actions/pause/pauseOnExceptions.js34
-rw-r--r--devtools/client/debugger/src/actions/pause/paused.js73
-rw-r--r--devtools/client/debugger/src/actions/pause/resetBreakpointsPaneState.js18
-rw-r--r--devtools/client/debugger/src/actions/pause/resumed.js28
-rw-r--r--devtools/client/debugger/src/actions/pause/selectFrame.js39
-rw-r--r--devtools/client/debugger/src/actions/pause/skipPausing.js33
-rw-r--r--devtools/client/debugger/src/actions/pause/tests/__snapshots__/pauseOnExceptions.spec.js.snap10
-rw-r--r--devtools/client/debugger/src/actions/pause/tests/pause.spec.js413
-rw-r--r--devtools/client/debugger/src/actions/pause/tests/pauseOnExceptions.spec.js24
-rw-r--r--devtools/client/debugger/src/actions/pause/tests/skipPausing.spec.js18
-rw-r--r--devtools/client/debugger/src/actions/preview.js211
-rw-r--r--devtools/client/debugger/src/actions/project-text-search.js171
-rw-r--r--devtools/client/debugger/src/actions/quick-open.js21
-rw-r--r--devtools/client/debugger/src/actions/source-actors.js12
-rw-r--r--devtools/client/debugger/src/actions/sources-tree.js11
-rw-r--r--devtools/client/debugger/src/actions/sources/blackbox.js223
-rw-r--r--devtools/client/debugger/src/actions/sources/breakableLines.js73
-rw-r--r--devtools/client/debugger/src/actions/sources/index.js42
-rw-r--r--devtools/client/debugger/src/actions/sources/loadSourceText.js256
-rw-r--r--devtools/client/debugger/src/actions/sources/moz.build17
-rw-r--r--devtools/client/debugger/src/actions/sources/newSources.js367
-rw-r--r--devtools/client/debugger/src/actions/sources/prettyPrint.js339
-rw-r--r--devtools/client/debugger/src/actions/sources/select.js264
-rw-r--r--devtools/client/debugger/src/actions/sources/symbols.js44
-rw-r--r--devtools/client/debugger/src/actions/sources/tests/blackbox.spec.js249
-rw-r--r--devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js363
-rw-r--r--devtools/client/debugger/src/actions/sources/tests/newSources.spec.js172
-rw-r--r--devtools/client/debugger/src/actions/sources/tests/select.spec.js288
-rw-r--r--devtools/client/debugger/src/actions/tabs.js76
-rw-r--r--devtools/client/debugger/src/actions/tests/__snapshots__/expressions.spec.js.snap11
-rw-r--r--devtools/client/debugger/src/actions/tests/__snapshots__/pending-breakpoints.spec.js.snap44
-rw-r--r--devtools/client/debugger/src/actions/tests/__snapshots__/preview.spec.js.snap3
-rw-r--r--devtools/client/debugger/src/actions/tests/expressions.spec.js184
-rw-r--r--devtools/client/debugger/src/actions/tests/fixtures/immutable.js2
-rw-r--r--devtools/client/debugger/src/actions/tests/fixtures/reactComponent.js7
-rw-r--r--devtools/client/debugger/src/actions/tests/fixtures/reactFuncComponent.js5
-rw-r--r--devtools/client/debugger/src/actions/tests/fixtures/scopes.js11
-rw-r--r--devtools/client/debugger/src/actions/tests/helpers/breakpoints.js77
-rw-r--r--devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js49
-rw-r--r--devtools/client/debugger/src/actions/tests/helpers/readFixture.js14
-rw-r--r--devtools/client/debugger/src/actions/tests/navigation.spec.js29
-rw-r--r--devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js294
-rw-r--r--devtools/client/debugger/src/actions/tests/preview.spec.js217
-rw-r--r--devtools/client/debugger/src/actions/tests/sources-tree.spec.js17
-rw-r--r--devtools/client/debugger/src/actions/tests/tabs.spec.js187
-rw-r--r--devtools/client/debugger/src/actions/tests/ui.spec.js90
-rw-r--r--devtools/client/debugger/src/actions/threads.js44
-rw-r--r--devtools/client/debugger/src/actions/toolbox.js43
-rw-r--r--devtools/client/debugger/src/actions/tracing.js49
-rw-r--r--devtools/client/debugger/src/actions/ui.js290
-rw-r--r--devtools/client/debugger/src/actions/utils/create-store.js72
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/context.js33
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/log.js111
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/moz.build15
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/promise.js61
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/thunk.js22
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/timing.js26
-rw-r--r--devtools/client/debugger/src/actions/utils/middleware/wait-service.js62
-rw-r--r--devtools/client/debugger/src/actions/utils/moz.build12
-rw-r--r--devtools/client/debugger/src/client/README.md47
-rw-r--r--devtools/client/debugger/src/client/firefox.js215
-rw-r--r--devtools/client/debugger/src/client/firefox/commands.js537
-rw-r--r--devtools/client/debugger/src/client/firefox/create.js392
-rw-r--r--devtools/client/debugger/src/client/firefox/moz.build11
-rw-r--r--devtools/client/debugger/src/client/moz.build12
-rw-r--r--devtools/client/debugger/src/components/A11yIntention.css7
-rw-r--r--devtools/client/debugger/src/components/A11yIntention.js37
-rw-r--r--devtools/client/debugger/src/components/App.css130
-rw-r--r--devtools/client/debugger/src/components/App.js336
-rw-r--r--devtools/client/debugger/src/components/Editor/BlackboxLines.js138
-rw-r--r--devtools/client/debugger/src/components/Editor/Breakpoint.js183
-rw-r--r--devtools/client/debugger/src/components/Editor/Breakpoints.css153
-rw-r--r--devtools/client/debugger/src/components/Editor/Breakpoints.js96
-rw-r--r--devtools/client/debugger/src/components/Editor/ColumnBreakpoint.js140
-rw-r--r--devtools/client/debugger/src/components/Editor/ColumnBreakpoints.js75
-rw-r--r--devtools/client/debugger/src/components/Editor/ConditionalPanel.css39
-rw-r--r--devtools/client/debugger/src/components/Editor/ConditionalPanel.js274
-rw-r--r--devtools/client/debugger/src/components/Editor/DebugLine.js138
-rw-r--r--devtools/client/debugger/src/components/Editor/Editor.css220
-rw-r--r--devtools/client/debugger/src/components/Editor/EditorMenu.js111
-rw-r--r--devtools/client/debugger/src/components/Editor/EmptyLines.js88
-rw-r--r--devtools/client/debugger/src/components/Editor/Exception.js96
-rw-r--r--devtools/client/debugger/src/components/Editor/Exceptions.js67
-rw-r--r--devtools/client/debugger/src/components/Editor/Footer.css85
-rw-r--r--devtools/client/debugger/src/components/Editor/Footer.js302
-rw-r--r--devtools/client/debugger/src/components/Editor/HighlightCalls.css15
-rw-r--r--devtools/client/debugger/src/components/Editor/HighlightCalls.js110
-rw-r--r--devtools/client/debugger/src/components/Editor/HighlightLine.js183
-rw-r--r--devtools/client/debugger/src/components/Editor/HighlightLines.js74
-rw-r--r--devtools/client/debugger/src/components/Editor/InlinePreview.css29
-rw-r--r--devtools/client/debugger/src/components/Editor/InlinePreview.js66
-rw-r--r--devtools/client/debugger/src/components/Editor/InlinePreviewRow.js101
-rw-r--r--devtools/client/debugger/src/components/Editor/InlinePreviews.js83
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview.css111
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview/ExceptionPopup.js164
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview/Popup.css209
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview/Popup.js382
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview/index.js136
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview/moz.build12
-rw-r--r--devtools/client/debugger/src/components/Editor/Preview/tests/Popup.spec.js107
-rw-r--r--devtools/client/debugger/src/components/Editor/SearchInFileBar.css39
-rw-r--r--devtools/client/debugger/src/components/Editor/SearchInFileBar.js371
-rw-r--r--devtools/client/debugger/src/components/Editor/Tab.js282
-rw-r--r--devtools/client/debugger/src/components/Editor/Tabs.css125
-rw-r--r--devtools/client/debugger/src/components/Editor/Tabs.js332
-rw-r--r--devtools/client/debugger/src/components/Editor/index.js808
-rw-r--r--devtools/client/debugger/src/components/Editor/menus/breakpoints.js293
-rw-r--r--devtools/client/debugger/src/components/Editor/menus/editor.js403
-rw-r--r--devtools/client/debugger/src/components/Editor/menus/moz.build12
-rw-r--r--devtools/client/debugger/src/components/Editor/menus/source.js3
-rw-r--r--devtools/client/debugger/src/components/Editor/moz.build34
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/Breakpoints.spec.js54
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/ConditionalPanel.spec.js77
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js85
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/Footer.spec.js67
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/__snapshots__/Breakpoints.spec.js.snap35
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/__snapshots__/ConditionalPanel.spec.js.snap630
-rw-r--r--devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap105
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/Outline.css205
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/Outline.js372
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.css30
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.js63
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.css165
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js327
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/Sources.css219
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js510
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js457
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/index.js132
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/moz.build15
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/tests/ProjectSearch.spec.js326
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/ProjectSearch.spec.js.snap1111
-rw-r--r--devtools/client/debugger/src/components/QuickOpenModal.css28
-rw-r--r--devtools/client/debugger/src/components/QuickOpenModal.js524
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js219
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeading.js88
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeadingsContextMenu.js77
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoints.css249
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js365
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/ExceptionOption.js31
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/index.js152
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/moz.build15
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/Breakpoint.spec.js104
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/BreakpointsContextMenu.spec.js134
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/ExceptionOption.spec.js22
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/Breakpoint.spec.js.snap231
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/ExceptionOption.spec.js.snap19
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/CommandBar.css33
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js433
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.css76
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.js175
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/EventListeners.css154
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js295
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Expressions.css175
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Expressions.js395
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js197
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js13
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameMenu.js105
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css185
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.css38
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.js197
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/index.js231
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/moz.build14
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frame.spec.js155
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/FrameMenu.spec.js117
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frames.spec.js295
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Group.spec.js134
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frame.spec.js.snap1196
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frames.spec.js.snap1651
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Group.spec.js.snap2440
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Scopes.css104
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Scopes.js311
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/SecondaryPanes.css86
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Thread.js70
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Threads.css63
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/Threads.js38
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.css58
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.js183
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.css131
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js361
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/index.js537
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/moz.build22
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/CommandBar.spec.js77
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/EventListeners.spec.js134
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/Expressions.spec.js75
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/XHRBreakpoints.spec.js345
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/__snapshots__/EventListeners.spec.js.snap408
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/__snapshots__/Expressions.spec.js.snap199
-rw-r--r--devtools/client/debugger/src/components/SecondaryPanes/tests/__snapshots__/XHRBreakpoints.spec.js.snap621
-rw-r--r--devtools/client/debugger/src/components/ShortcutsModal.css47
-rw-r--r--devtools/client/debugger/src/components/ShortcutsModal.js135
-rw-r--r--devtools/client/debugger/src/components/WelcomeBox.css83
-rw-r--r--devtools/client/debugger/src/components/WelcomeBox.js94
-rw-r--r--devtools/client/debugger/src/components/moz.build19
-rw-r--r--devtools/client/debugger/src/components/shared/AccessibleImage.css194
-rw-r--r--devtools/client/debugger/src/components/shared/AccessibleImage.js24
-rw-r--r--devtools/client/debugger/src/components/shared/Accordion.css73
-rw-r--r--devtools/client/debugger/src/components/shared/Accordion.js74
-rw-r--r--devtools/client/debugger/src/components/shared/Badge.css16
-rw-r--r--devtools/client/debugger/src/components/shared/Badge.js17
-rw-r--r--devtools/client/debugger/src/components/shared/BracketArrow.css64
-rw-r--r--devtools/client/debugger/src/components/shared/BracketArrow.js28
-rw-r--r--devtools/client/debugger/src/components/shared/Button/CloseButton.js30
-rw-r--r--devtools/client/debugger/src/components/shared/Button/CommandBarButton.js56
-rw-r--r--devtools/client/debugger/src/components/shared/Button/PaneToggleButton.js61
-rw-r--r--devtools/client/debugger/src/components/shared/Button/index.js9
-rw-r--r--devtools/client/debugger/src/components/shared/Button/moz.build15
-rw-r--r--devtools/client/debugger/src/components/shared/Button/styles/CloseButton.css36
-rw-r--r--devtools/client/debugger/src/components/shared/Button/styles/CommandBarButton.css61
-rw-r--r--devtools/client/debugger/src/components/shared/Button/styles/PaneToggleButton.css29
-rw-r--r--devtools/client/debugger/src/components/shared/Button/styles/moz.build8
-rw-r--r--devtools/client/debugger/src/components/shared/Button/tests/CloseButton.spec.js24
-rw-r--r--devtools/client/debugger/src/components/shared/Button/tests/CommandBarButton.spec.js36
-rw-r--r--devtools/client/debugger/src/components/shared/Button/tests/PaneToggleButton.spec.js51
-rw-r--r--devtools/client/debugger/src/components/shared/Button/tests/__snapshots__/CloseButton.spec.js.snap13
-rw-r--r--devtools/client/debugger/src/components/shared/Button/tests/__snapshots__/CommandBarButton.spec.js.snap18
-rw-r--r--devtools/client/debugger/src/components/shared/Button/tests/__snapshots__/PaneToggleButton.spec.js.snap13
-rw-r--r--devtools/client/debugger/src/components/shared/Dropdown.css96
-rw-r--r--devtools/client/debugger/src/components/shared/Dropdown.js71
-rw-r--r--devtools/client/debugger/src/components/shared/Modal.css51
-rw-r--r--devtools/client/debugger/src/components/shared/Modal.js73
-rw-r--r--devtools/client/debugger/src/components/shared/Popover.css32
-rw-r--r--devtools/client/debugger/src/components/shared/Popover.js299
-rw-r--r--devtools/client/debugger/src/components/shared/PreviewFunction.css23
-rw-r--r--devtools/client/debugger/src/components/shared/PreviewFunction.js82
-rw-r--r--devtools/client/debugger/src/components/shared/ResultList.css131
-rw-r--r--devtools/client/debugger/src/components/shared/ResultList.js82
-rw-r--r--devtools/client/debugger/src/components/shared/SearchInput.css225
-rw-r--r--devtools/client/debugger/src/components/shared/SearchInput.js339
-rw-r--r--devtools/client/debugger/src/components/shared/SmartGap.js166
-rw-r--r--devtools/client/debugger/src/components/shared/SourceIcon.css176
-rw-r--r--devtools/client/debugger/src/components/shared/SourceIcon.js69
-rw-r--r--devtools/client/debugger/src/components/shared/menu.css55
-rw-r--r--devtools/client/debugger/src/components/shared/moz.build23
-rw-r--r--devtools/client/debugger/src/components/shared/tests/Accordion.spec.js40
-rw-r--r--devtools/client/debugger/src/components/shared/tests/Badge.spec.js12
-rw-r--r--devtools/client/debugger/src/components/shared/tests/BracketArrow.spec.js19
-rw-r--r--devtools/client/debugger/src/components/shared/tests/Dropdown.spec.js16
-rw-r--r--devtools/client/debugger/src/components/shared/tests/Modal.spec.js50
-rw-r--r--devtools/client/debugger/src/components/shared/tests/Popover.spec.js200
-rw-r--r--devtools/client/debugger/src/components/shared/tests/PreviewFunction.spec.js127
-rw-r--r--devtools/client/debugger/src/components/shared/tests/ResultList.spec.js49
-rw-r--r--devtools/client/debugger/src/components/shared/tests/SearchInput.spec.js126
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/Accordion.spec.js.snap84
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/Badge.spec.js.snap9
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/BracketArrow.spec.js.snap27
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/Dropdown.spec.js.snap34
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/Modal.spec.js.snap13
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/Popover.spec.js.snap549
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/PreviewFunction.spec.js.snap23
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/ResultList.spec.js.snap55
-rw-r--r--devtools/client/debugger/src/components/shared/tests/__snapshots__/SearchInput.spec.js.snap267
-rw-r--r--devtools/client/debugger/src/components/test/A11yIntention.spec.js33
-rw-r--r--devtools/client/debugger/src/components/test/Outline.spec.js304
-rw-r--r--devtools/client/debugger/src/components/test/OutlineFilter.spec.js45
-rw-r--r--devtools/client/debugger/src/components/test/QuickOpenModal.spec.js898
-rw-r--r--devtools/client/debugger/src/components/test/ShortcutsModal.spec.js32
-rw-r--r--devtools/client/debugger/src/components/test/WelcomeBox.spec.js59
-rw-r--r--devtools/client/debugger/src/components/test/WhyPaused.spec.js59
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/A11yIntention.spec.js.snap13
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/Outline.spec.js.snap505
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/OutlineFilter.spec.js.snap39
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/QuickOpenModal.spec.js.snap1694
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/ShortcutsModal.spec.js.snap190
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/WelcomeBox.spec.js.snap67
-rw-r--r--devtools/client/debugger/src/components/test/__snapshots__/WhyPaused.spec.js.snap103
-rw-r--r--devtools/client/debugger/src/components/variables.css45
-rw-r--r--devtools/client/debugger/src/constants.js15
-rw-r--r--devtools/client/debugger/src/context-menu/menu.js43
-rw-r--r--devtools/client/debugger/src/context-menu/moz.build8
-rw-r--r--devtools/client/debugger/src/debugger.css59
-rw-r--r--devtools/client/debugger/src/main.js137
-rw-r--r--devtools/client/debugger/src/moz.build21
-rw-r--r--devtools/client/debugger/src/reducers/ast.js92
-rw-r--r--devtools/client/debugger/src/reducers/breakpoints.js149
-rw-r--r--devtools/client/debugger/src/reducers/event-listeners.js38
-rw-r--r--devtools/client/debugger/src/reducers/exceptions.js78
-rw-r--r--devtools/client/debugger/src/reducers/expressions.js133
-rw-r--r--devtools/client/debugger/src/reducers/index.js84
-rw-r--r--devtools/client/debugger/src/reducers/moz.build28
-rw-r--r--devtools/client/debugger/src/reducers/pause.js409
-rw-r--r--devtools/client/debugger/src/reducers/pending-breakpoints.js135
-rw-r--r--devtools/client/debugger/src/reducers/preview.js30
-rw-r--r--devtools/client/debugger/src/reducers/project-text-search.js82
-rw-r--r--devtools/client/debugger/src/reducers/quick-open.js41
-rw-r--r--devtools/client/debugger/src/reducers/source-actors.js90
-rw-r--r--devtools/client/debugger/src/reducers/source-blackbox.js147
-rw-r--r--devtools/client/debugger/src/reducers/sources-content.js139
-rw-r--r--devtools/client/debugger/src/reducers/sources-tree.js585
-rw-r--r--devtools/client/debugger/src/reducers/sources.js361
-rw-r--r--devtools/client/debugger/src/reducers/tabs.js208
-rw-r--r--devtools/client/debugger/src/reducers/tests/breakpoints.spec.js74
-rw-r--r--devtools/client/debugger/src/reducers/tests/quick-open.spec.js59
-rw-r--r--devtools/client/debugger/src/reducers/tests/ui.spec.js30
-rw-r--r--devtools/client/debugger/src/reducers/threads.js69
-rw-r--r--devtools/client/debugger/src/reducers/ui.js197
-rw-r--r--devtools/client/debugger/src/selectors/ast.js32
-rw-r--r--devtools/client/debugger/src/selectors/breakpointAtLocation.js121
-rw-r--r--devtools/client/debugger/src/selectors/breakpointSources.js52
-rw-r--r--devtools/client/debugger/src/selectors/breakpoints.js86
-rw-r--r--devtools/client/debugger/src/selectors/event-listeners.js19
-rw-r--r--devtools/client/debugger/src/selectors/exceptions.js58
-rw-r--r--devtools/client/debugger/src/selectors/expressions.js34
-rw-r--r--devtools/client/debugger/src/selectors/getCallStackFrames.js53
-rw-r--r--devtools/client/debugger/src/selectors/index.js51
-rw-r--r--devtools/client/debugger/src/selectors/isLineInScope.js22
-rw-r--r--devtools/client/debugger/src/selectors/isSelectedFrameVisible.js40
-rw-r--r--devtools/client/debugger/src/selectors/moz.build35
-rw-r--r--devtools/client/debugger/src/selectors/pause.js267
-rw-r--r--devtools/client/debugger/src/selectors/pending-breakpoints.js20
-rw-r--r--devtools/client/debugger/src/selectors/preview.js11
-rw-r--r--devtools/client/debugger/src/selectors/project-text-search.js19
-rw-r--r--devtools/client/debugger/src/selectors/quick-open.js15
-rw-r--r--devtools/client/debugger/src/selectors/source-actors.js111
-rw-r--r--devtools/client/debugger/src/selectors/source-blackbox.js26
-rw-r--r--devtools/client/debugger/src/selectors/sources-content.js48
-rw-r--r--devtools/client/debugger/src/selectors/sources-tree.js151
-rw-r--r--devtools/client/debugger/src/selectors/sources.js358
-rw-r--r--devtools/client/debugger/src/selectors/tabs.js90
-rw-r--r--devtools/client/debugger/src/selectors/test/__snapshots__/visibleColumnBreakpoints.spec.js.snap165
-rw-r--r--devtools/client/debugger/src/selectors/test/getCallStackFrames.spec.js166
-rw-r--r--devtools/client/debugger/src/selectors/test/visibleColumnBreakpoints.spec.js145
-rw-r--r--devtools/client/debugger/src/selectors/threads.js56
-rw-r--r--devtools/client/debugger/src/selectors/ui.js85
-rw-r--r--devtools/client/debugger/src/selectors/visibleBreakpoints.js55
-rw-r--r--devtools/client/debugger/src/selectors/visibleColumnBreakpoints.js185
-rw-r--r--devtools/client/debugger/src/test/__mocks__/request-animation-frame.js8
-rw-r--r--devtools/client/debugger/src/test/fixtures/README.md3
-rw-r--r--devtools/client/debugger/src/test/fixtures/foobar.json56
-rw-r--r--devtools/client/debugger/src/test/fixtures/index.js3
-rw-r--r--devtools/client/debugger/src/test/shim.js31
-rw-r--r--devtools/client/debugger/src/test/tests-setup.js63
-rw-r--r--devtools/client/debugger/src/utils/DevToolsUtils.js16
-rw-r--r--devtools/client/debugger/src/utils/assert.js22
-rw-r--r--devtools/client/debugger/src/utils/ast.js97
-rw-r--r--devtools/client/debugger/src/utils/async-value.js27
-rw-r--r--devtools/client/debugger/src/utils/bootstrap.js135
-rw-r--r--devtools/client/debugger/src/utils/breakpoint/breakpointPositions.js20
-rw-r--r--devtools/client/debugger/src/utils/breakpoint/index.js72
-rw-r--r--devtools/client/debugger/src/utils/breakpoint/moz.build11
-rw-r--r--devtools/client/debugger/src/utils/breakpoint/tests/index.spec.js28
-rw-r--r--devtools/client/debugger/src/utils/build-query.js80
-rw-r--r--devtools/client/debugger/src/utils/clipboard.js19
-rw-r--r--devtools/client/debugger/src/utils/connect.js7
-rw-r--r--devtools/client/debugger/src/utils/context.js63
-rw-r--r--devtools/client/debugger/src/utils/dbg.js100
-rw-r--r--devtools/client/debugger/src/utils/editor/create-editor.js44
-rw-r--r--devtools/client/debugger/src/utils/editor/get-expression.js54
-rw-r--r--devtools/client/debugger/src/utils/editor/get-token-location.js16
-rw-r--r--devtools/client/debugger/src/utils/editor/index.js230
-rw-r--r--devtools/client/debugger/src/utils/editor/moz.build17
-rw-r--r--devtools/client/debugger/src/utils/editor/source-documents.js249
-rw-r--r--devtools/client/debugger/src/utils/editor/source-editor.css271
-rw-r--r--devtools/client/debugger/src/utils/editor/source-editor.js145
-rw-r--r--devtools/client/debugger/src/utils/editor/source-search.js327
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/__snapshots__/create-editor.spec.js.snap60
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/create-editor.spec.js25
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/editor.spec.js203
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/get-expression.spec.js160
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/get-token-location.spec.js31
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/source-documents.spec.js215
-rw-r--r--devtools/client/debugger/src/utils/editor/tests/source-search.spec.js182
-rw-r--r--devtools/client/debugger/src/utils/editor/token-events.js95
-rw-r--r--devtools/client/debugger/src/utils/environment.js15
-rw-r--r--devtools/client/debugger/src/utils/evaluation-result.js19
-rw-r--r--devtools/client/debugger/src/utils/expressions.js67
-rw-r--r--devtools/client/debugger/src/utils/function.js37
-rw-r--r--devtools/client/debugger/src/utils/indentation.js40
-rw-r--r--devtools/client/debugger/src/utils/isMinified.js58
-rw-r--r--devtools/client/debugger/src/utils/location.js134
-rw-r--r--devtools/client/debugger/src/utils/log.js30
-rw-r--r--devtools/client/debugger/src/utils/memoizableAction.js75
-rw-r--r--devtools/client/debugger/src/utils/memoize.js63
-rw-r--r--devtools/client/debugger/src/utils/memoizeLast.js27
-rw-r--r--devtools/client/debugger/src/utils/moz.build54
-rw-r--r--devtools/client/debugger/src/utils/path.js24
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/annotateFrames.js73
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/collapseFrames.js61
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/displayName.js97
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/getFrameUrl.js7
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/getLibraryFromUrl.js144
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/index.js9
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/moz.build15
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/tests/__snapshots__/collapseFrames.spec.js.snap57
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/tests/annotateFrames.spec.js22
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/tests/collapseFrames.spec.js37
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/tests/displayName.spec.js129
-rw-r--r--devtools/client/debugger/src/utils/pause/frames/tests/getLibraryFromUrl.spec.js127
-rw-r--r--devtools/client/debugger/src/utils/pause/index.js5
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/README.md191
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/buildGeneratedBindingList.js141
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/filtering.js45
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/findGeneratedBindingFromPosition.js305
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/getApplicableBindingsForOriginalPosition.js112
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/index.js583
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/locColumn.js13
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/mappingContains.js12
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/moz.build19
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/optimizedOut.js15
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/positionCmp.js24
-rw-r--r--devtools/client/debugger/src/utils/pause/mapScopes/rangeMetadata.js117
-rw-r--r--devtools/client/debugger/src/utils/pause/moz.build15
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/getScope.js101
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/getVariables.js32
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/index.js48
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/moz.build13
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/tests/getFramePopVariables.spec.js114
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/tests/scopes.spec.js134
-rw-r--r--devtools/client/debugger/src/utils/pause/scopes/utils.js55
-rw-r--r--devtools/client/debugger/src/utils/pause/why.js40
-rw-r--r--devtools/client/debugger/src/utils/prefs.js153
-rw-r--r--devtools/client/debugger/src/utils/preview.js7
-rw-r--r--devtools/client/debugger/src/utils/quick-open.js123
-rw-r--r--devtools/client/debugger/src/utils/result-list.js26
-rw-r--r--devtools/client/debugger/src/utils/selected-location.js16
-rw-r--r--devtools/client/debugger/src/utils/shallow-equal.js51
-rw-r--r--devtools/client/debugger/src/utils/source-maps.js122
-rw-r--r--devtools/client/debugger/src/utils/source-queue.js37
-rw-r--r--devtools/client/debugger/src/utils/source.js536
-rw-r--r--devtools/client/debugger/src/utils/sources-tree/getURL.js180
-rw-r--r--devtools/client/debugger/src/utils/sources-tree/moz.build9
-rw-r--r--devtools/client/debugger/src/utils/sources-tree/tests/getUrl.spec.js50
-rw-r--r--devtools/client/debugger/src/utils/sources-tree/utils.js44
-rw-r--r--devtools/client/debugger/src/utils/tabs.js121
-rw-r--r--devtools/client/debugger/src/utils/task.js44
-rw-r--r--devtools/client/debugger/src/utils/telemetry.js72
-rw-r--r--devtools/client/debugger/src/utils/test-head.js289
-rw-r--r--devtools/client/debugger/src/utils/test-mockup.js270
-rw-r--r--devtools/client/debugger/src/utils/tests/DevToolsUtils.spec.js41
-rw-r--r--devtools/client/debugger/src/utils/tests/__snapshots__/ast.spec.js.snap53
-rw-r--r--devtools/client/debugger/src/utils/tests/__snapshots__/expressions.spec.js.snap25
-rw-r--r--devtools/client/debugger/src/utils/tests/__snapshots__/function.spec.js.snap25
-rw-r--r--devtools/client/debugger/src/utils/tests/__snapshots__/indentation.spec.js.snap27
-rw-r--r--devtools/client/debugger/src/utils/tests/assert.spec.js30
-rw-r--r--devtools/client/debugger/src/utils/tests/ast.spec.js34
-rw-r--r--devtools/client/debugger/src/utils/tests/build-query.spec.js256
-rw-r--r--devtools/client/debugger/src/utils/tests/clipboard.spec.js45
-rw-r--r--devtools/client/debugger/src/utils/tests/expressions.spec.js67
-rw-r--r--devtools/client/debugger/src/utils/tests/function.spec.js61
-rw-r--r--devtools/client/debugger/src/utils/tests/indentation.spec.js61
-rw-r--r--devtools/client/debugger/src/utils/tests/isMinified.spec.js18
-rw-r--r--devtools/client/debugger/src/utils/tests/location.spec.js31
-rw-r--r--devtools/client/debugger/src/utils/tests/log.spec.js35
-rw-r--r--devtools/client/debugger/src/utils/tests/memoize.spec.js48
-rw-r--r--devtools/client/debugger/src/utils/tests/memoizeLast.spec.js31
-rw-r--r--devtools/client/debugger/src/utils/tests/path.spec.js49
-rw-r--r--devtools/client/debugger/src/utils/tests/quick-open.spec.js35
-rw-r--r--devtools/client/debugger/src/utils/tests/result-list.spec.js32
-rw-r--r--devtools/client/debugger/src/utils/tests/source.spec.js367
-rw-r--r--devtools/client/debugger/src/utils/tests/telemetry.spec.js13
-rw-r--r--devtools/client/debugger/src/utils/tests/text.spec.js20
-rw-r--r--devtools/client/debugger/src/utils/tests/ui.spec.js15
-rw-r--r--devtools/client/debugger/src/utils/tests/url.spec.js89
-rw-r--r--devtools/client/debugger/src/utils/tests/utils.spec.js87
-rw-r--r--devtools/client/debugger/src/utils/tests/wasm.spec.js96
-rw-r--r--devtools/client/debugger/src/utils/text.js58
-rw-r--r--devtools/client/debugger/src/utils/ui.js48
-rw-r--r--devtools/client/debugger/src/utils/url.js75
-rw-r--r--devtools/client/debugger/src/utils/utils.js59
-rw-r--r--devtools/client/debugger/src/utils/wasm.js168
-rw-r--r--devtools/client/debugger/src/utils/worker.js49
-rw-r--r--devtools/client/debugger/src/vendors.js29
-rw-r--r--devtools/client/debugger/src/workers/moz.build12
-rw-r--r--devtools/client/debugger/src/workers/parser/findOutOfScopeLocations.js132
-rw-r--r--devtools/client/debugger/src/workers/parser/frameworks.js77
-rw-r--r--devtools/client/debugger/src/workers/parser/getScopes/index.js63
-rw-r--r--devtools/client/debugger/src/workers/parser/getScopes/visitor.js869
-rw-r--r--devtools/client/debugger/src/workers/parser/getSymbols.js473
-rw-r--r--devtools/client/debugger/src/workers/parser/index.js53
-rw-r--r--devtools/client/debugger/src/workers/parser/mapAwaitExpression.js199
-rw-r--r--devtools/client/debugger/src/workers/parser/mapBindings.js120
-rw-r--r--devtools/client/debugger/src/workers/parser/mapExpression.js50
-rw-r--r--devtools/client/debugger/src/workers/parser/mapOriginalExpression.js106
-rw-r--r--devtools/client/debugger/src/workers/parser/moz.build10
-rw-r--r--devtools/client/debugger/src/workers/parser/sources.js22
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/__snapshots__/findOutOfScopeLocations.spec.js.snap47
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/__snapshots__/getScopes.spec.js.snap18767
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/__snapshots__/getSymbols.spec.js.snap1522
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/__snapshots__/validate.spec.js.snap3
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/contains.spec.js250
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/findOutOfScopeLocations.spec.js75
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/allSymbols.js33
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/async.js10
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/call-sites.js4
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/callExpressions.js7
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/calls.js21
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/class.js28
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/component.js84
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/computed-props.js8
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/control-flow.js39
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/decorators.js2
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/destructuring.js16
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/es6.js1
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js25
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/flow.js5
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/angular1FalsePositive.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/angular1Module.js4
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/plainJavascript.js8
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/reactComponent.js3
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/reactComponentEs5.js3
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/reactLibrary.js19
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/reduxLibrary.js39
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/vueFileComponent.js3
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/frameworks/vueFileDeclarative.js6
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/func.js50
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/functionNames.js50
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/generators.js4
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/jsx.js5
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/math.js15
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/modules.js10
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/object-expressions.js6
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/optional-chaining.js3
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/outOfScope.js62
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/outOfScopeComment.js4
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/parseScriptTags.html42
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/private-fields.js24
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/proto.js14
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/resolveToken.js40
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/arrow-function.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/binding-types.js24
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/block-statement.js13
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/class-declaration.js14
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/class-expression.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/class-property.js10
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/complex-nesting.js29
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/expressions.js6
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/flowtype-bindings.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/fn-body-lex-and-nonlex.js23
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/for-loops.js13
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/function-declaration.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/function-expression.js7
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/jsx-component.js6
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/out-of-order-declarations.js21
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/pattern-declarations.js2
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/simple-module.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/switch-statement.js22
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/try-catch.js9
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/ts-sample.ts41
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/tsx-sample.tsx41
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/scopes/vue-sample.vue26
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/statements.js40
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/thisExpression.js11
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/var.js21
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/framework.spec.js63
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/getScopes.spec.js227
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/getSymbols.spec.js49
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/helpers/index.js86
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/mapBindings.spec.js161
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/mapExpression.spec.js785
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/mapOriginalExpression.spec.js93
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/sources.spec.js14
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/validate.spec.js15
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/ast.js225
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/contains.js29
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/formatSymbols.js65
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/getFunctionName.js96
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/helpers.js230
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/inferClassName.js93
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/simple-path.js147
-rw-r--r--devtools/client/debugger/src/workers/parser/utils/tests/ast.spec.js41
-rw-r--r--devtools/client/debugger/src/workers/parser/validate.js14
-rw-r--r--devtools/client/debugger/src/workers/parser/worker.js30
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/LICENSE.md23
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/index.js30
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/moz.build10
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/pretty-fast.js1178
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/tests/__snapshots__/prettyFast.spec.js.snap1974
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/tests/prettyFast.spec.js434
-rw-r--r--devtools/client/debugger/src/workers/pretty-print/worker.js98
-rw-r--r--devtools/client/debugger/src/workers/search/get-matches.js45
-rw-r--r--devtools/client/debugger/src/workers/search/index.js17
-rw-r--r--devtools/client/debugger/src/workers/search/moz.build10
-rw-r--r--devtools/client/debugger/src/workers/search/project-search.js70
-rw-r--r--devtools/client/debugger/src/workers/search/tests/get-matches.spec.js99
-rw-r--r--devtools/client/debugger/src/workers/search/worker.js9
-rw-r--r--devtools/client/debugger/test/mochitest/browser.ini297
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-async-stepping.js23
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-asyncstacks.js21
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-audiocontext.js20
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-backgroundtask-debugging.js151
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-bfcache.js98
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-blackbox-all.js215
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js53
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-blackbox.js742
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breaking-from-console.js38
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breaking.js55
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoint-skipping-console.js20
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoint-skipping.js87
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-actions.js84
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-columns.js131
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-cond-shortcut.js147
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-cond-source-maps.js45
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-cond.js136
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-debugger-statement.js94
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-duplicate-functions.js38
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-in-evaled-sources.js92
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-list.js189
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-popup.js250
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-reloading-with-source-changes.js186
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-reloading.js124
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-same-file-per-target.js114
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-scroll-to-log.js61
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-sourcemap-with-sections.js27
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-breakpoints.js102
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-browser-toolbox-unselected-pause.js67
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-browser-toolbox-workers.js55
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-call-stack.js115
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-chrome-create.js61
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-command-click.js39
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-console-async.js50
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-console-eval.js37
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-console-link.js29
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-console-map-bindings.js47
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-console.js28
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-content-script-sources.js52
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-continue-to-here-click.js48
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-continue-to-here.js58
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-custom-formatters.js158
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js46
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-debugger-buttons.js97
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-dom-mutation-breakpoints-fission.js111
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-dom-mutation-breakpoints.js170
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-eager-eval-skip-pause.js19
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-editor-exception.js26
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-editor-gutter.js144
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-editor-highlight.js50
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-editor-mode.js18
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-editor-scroll.js48
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-editor-select.js53
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-ember-quickstart.js25
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-es-module-worker.js75
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-eval-throw.js18
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-event-breakpoints-fission.js81
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-event-breakpoints.js294
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-event-handler.js18
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-expressions-error.js51
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-expressions-focus.js30
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-expressions-thread.js97
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-expressions-watch.js91
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-expressions.js73
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-extension-inspectedWindow-debugger-statement.js88
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-asm.js92
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-breakable-lines.js92
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-breakable-positions.js284
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-breakpoints.js72
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-browser-toolbox-source-tree.js122
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-source-text-content.js565
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-source-tree.js554
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-tabs.js62
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-features-wasm.js168
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-fission-frame-breakpoint.js50
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-fission-frame-pause-exceptions.js54
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-fission-frame-sources.js47
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-fission-project-search.js52
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js32
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-gc-breakpoint-positions.js17
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-gc-sources.js29
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-go-to-line.js64
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-highlights-calls.js31
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-html-breakpoints.js54
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-idb-run-to-completion.js15
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-iframes.js60
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-inline-cache.js146
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-inline-exceptions.js28
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-inline-preview.js111
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-inline-script-offset.js40
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-inspector-integration.js140
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-integration-reloading-compressed-sourcemaps.js22
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-integration-reloading-uncompressed-sourcemaps.js22
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer.js226
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-keyboard-navigation.js41
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-keyboard-shortcuts-modal.js49
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-keyboard-shortcuts.js58
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-layout-changes.js94
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-link-reload.js65
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-log-events.js25
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js44
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-log-points-workers.js30
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-log-points.js41
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-many-breakpoints-same-line.js93
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-merge-scopes.js55
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-message-run-to-completion.js24
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-minified.js33
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-navigation-when-paused.js42
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-navigation.js73
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-no-duplicate-breakpoints-on-frame-reload.js101
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-old-breakpoint.js111
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-outline-filter.js82
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-outline-focus.js39
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-outline-pretty.js30
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-outline.js89
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-overrides.js128
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pause-exceptions.js139
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pause-on-next.js21
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pause-points.js97
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pause-ux.js52
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-iframe.js76
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js48
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay.js73
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-breakpoints-columns.js119
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-breakpoints-delete.js113
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-breakpoints.js126
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-console.js66
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-flow.js78
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-inline-scripts.js256
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-paused-anonymous.js148
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-paused.js35
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-sourcemap.js157
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-pretty-print.js134
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-preview-frame.js47
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-preview-getter.js56
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-preview-module.js36
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-preview-source-maps.js45
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-preview.js123
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-project-root.js119
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-project-search.js258
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-quick-open.js166
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-react-app.js34
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-react-jsx.js20
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-reducer-cleanup-on-target-removal.js174
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-reloading.js39
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-remember-expanded-scopes.js41
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-restart-frame.js34
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-returnvalues.js67
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-scopes-duplicated.js192
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-scopes-mutations.js93
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-scopes-xrays.js67
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-scopes.js34
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-scroll-run-to-completion.js25
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-search-file-paused.js71
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-search-file-retains-query.js40
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-search-file.js146
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-settings-disable-javascript.js49
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-slow-script.js91
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-source-pragma.js26
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourceURL-breakpoint.js18
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemapped-breakpoint-console.js86
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemapped-preview.js206
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemapped-scopes.js1646
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemapped-stepping.js158
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemapped-toggle.js48
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-bogus.js63
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-breakpoints.js35
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-disabled.js23
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-ignorelist.js75
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-indexed.js51
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-redirect.js54
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-reloading-quickly.js28
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-reloading.js62
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js124
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps2.js51
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps3.js65
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-sources-project-search.js134
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-state-based-panels.js164
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-step-in-navigate.js34
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-step-in-uninitialized.js47
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-stepping.js47
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-tabs-keyboard.js29
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-tabs-pretty-print.js46
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls-selected.js28
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls.js46
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-tabs.js46
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-toggling-tools.js19
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-ua-widgets.js47
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-unselected-pause.js203
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-watchpoints.js122
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js32
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers.js174
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js40
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers.js165
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-worker-exception.js26
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-worker-module.js19
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-worker-nested.js15
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-worker-scopes.js102
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-wrong-fetch.js27
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-xhr-breakpoints.js236
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-xhr-run-to-completion.js54
-rw-r--r--devtools/client/debugger/test/mochitest/examples/README.md14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/asm.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/async.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/big-sourcemap.html40
-rw-r--r--devtools/client/debugger/test/mochitest/examples/big-sourcemap_files/bundle.js53505
-rw-r--r--devtools/client/debugger/test/mochitest/examples/big-sourcemap_files/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/collected-bundle.js76
-rw-r--r--devtools/client/debugger/test/mochitest/examples/collected-bundle2.js75
-rw-r--r--devtools/client/debugger/test/mochitest/examples/collected-bundle2.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/collected-bundle2.js^headers^1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/different_html.sjs31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-all-workers.html32
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-asm.html20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-async.html16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-audiocontext.html49
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-bfcache1.html7
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-bfcache2.html6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-blackbox-all.html15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-command-click.html12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-content-script-sources.html13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-debugger-statements.html31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-dom-mutation.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-duplicate-functions.html27
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-early-xhr.html16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-editor-scroll.html17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-eval-throw.html9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-event-breakpoints-fission.html23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-event-breakpoints.html27
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-event-handler.html10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-exceptions.html10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-frames-async.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-frames.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-gc-breakpoint-positions.html23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-gc-sources.html26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-html-breakpoints.html25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-idb-run-to-completion.html30
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-iframes.html20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-inline-preview.html16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-inline-script-offset.html15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-merge-scopes.html29
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-message-run-to-completion-frame.html1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-message-run-to-completion.html19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-minified.html20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-minified2.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-module-worker.html10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-navigation-when-paused.html17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-nested-worker.html11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-on-load.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-pause-points.html16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-pretty-print-inline-scripts.html44
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-pretty.html14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-preview-getter.html11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-preview.html27
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-react-jsx.html111
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-react.html10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-reload-link.html5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-remember-expanded-scopes.html7
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-return-values.html50
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-scopes-xrays.html11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-script-mutate.html18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-script-switching.html19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-scripts-debugger.html20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-scripts.html35
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-scroll-run-to-completion.html27
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-service-workers.html39
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-slow-script.html18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-source-pragma.html7
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourceURL-breakpoint.html9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemap-bogus.html15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemapped.html574
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemaps-ignorelist.html14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemaps-indexed.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemaps.html15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemaps2.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sourcemaps3.html16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-sources.html25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-step-in-uninitialized.html11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-strict.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-wasm-sourcemaps.html23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-watchpoints.html31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-windowless-workers-early-breakpoint.html19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-windowless-workers.html25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-worker-exception.html10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-worker-scopes.html15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-xhr-run-to-completion.html41
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc-xhr.html14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-custom-formatters.html31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-fission-frame-pause-exceptions.html20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-fission-frame-sources-frame.html12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-fission-frame-sources.html13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-fission-pause-exceptions.html13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-same-source-distinct-threads-frame.html13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/doc_dbg-same-source-distinct-threads.html21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/dom-mutation.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/dom-mutation.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/.editorconfig20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/.ember-cli9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/.eslintrc.js38
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/.gitignore23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/.travis.yml26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/.watchmanconfig3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/quickstart.css0
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/quickstart.js277
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/quickstart.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/test-support.css471
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/test-support.js12050
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/test-support.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/tests.js62
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/tests.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/vendor.css97
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/vendor.js86407
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/assets/vendor.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/index.html26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/robots.txt3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/ember/quickstart/dist/testem.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/entry.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/event-breakpoints.js69
-rw-r--r--devtools/client/debugger/test/mochitest/examples/exceptions.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/fetch.js5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/frames.js24
-rw-r--r--devtools/client/debugger/test/mochitest/examples/html-breakpoints-slow.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/inline-preview.js60
-rw-r--r--devtools/client/debugger/test/mochitest/examples/inner-worker.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/long.js76
-rw-r--r--devtools/client/debugger/test/mochitest/examples/map-with-failed-original-request.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/map-with-failed-original-request.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/math.min.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/nested/nested-source.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/non-existant-map.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/opts.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/outer-worker.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/output.js5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/pause-points.js43
-rw-r--r--devtools/client/debugger/test/mochitest/examples/pretty.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/preview-getter.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/preview.js66
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/.gitignore20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/README.md4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/build/asset-manifest.json4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/build/index.html1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/build/main.js6762
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/build/main.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/build/service-worker.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/config-overrides.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/package.json21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/public/index.html25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/src/App.js25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/src/index.js5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/react/yarn.lock7090
-rw-r--r--devtools/client/debugger/test/mochitest/examples/reload/code_reload_1.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/same-script.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/scopes-worker.js13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/script-mutate.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/script-switching-01.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/script-switching-02.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/service-worker.sjs38
-rw-r--r--devtools/client/debugger/test/mochitest/examples/shared-worker.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/simple-worker.js11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/simple1.js63
-rw-r--r--devtools/client/debugger/test/mochitest/examples/simple2.js6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/simple3.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/simple4.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sjs_slow-load.sjs31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/source-pragma.js6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/source-pragma.js.map10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/.rpt2_cache/120bf459f95b8b447674b99c6fe5d040b99b6a97/types/cache/f67752e2d3a8fd18a75558156ccfd8c764b544a10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/README.md16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/build.js82
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/parcel/index.js69
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/parcel/package.json6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/parcel/yarn.lock4128
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup-babel6/index.js82
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup-babel6/package.json12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup-babel6/yarn.lock755
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup-babel7/index.js82
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup-babel7/package.json13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup-babel7/yarn.lock1115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup/index.js76
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup/package.json11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/rollup/yarn.lock337
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3-babel6/index.js81
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3-babel6/package.json12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3-babel6/yarn.lock2823
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3-babel7/index.js81
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3-babel7/package.json13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3-babel7/yarn.lock3089
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3/index.js65
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3/package.json10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack3/yarn.lock2202
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4-babel6/index.js82
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4-babel6/package.json12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4-babel6/yarn.lock2787
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4-babel7/index.js82
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4-babel7/package.json13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4-babel7/yarn.lock3047
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4/index.js66
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4/package.json10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/builds/webpack4/yarn.lock2194
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/babel-bindings-with-flow/input.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/babel-bindings-with-flow/src/mod.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/babel-classes/input.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/babel-flowtype-bindings/input.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/babel-flowtype-bindings/src/mod.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/classes/input.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/input.js41
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod1.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod10.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod11.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod12.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod2.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod3.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod4.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod5.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod6.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod7.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod8.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/mod9.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-cjs/src/optimized-out.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/input.js41
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod1.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod10.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod11.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod12.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod2.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod3.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod4.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod5.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod6.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod7.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod8.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/mod9.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules-es6/src/optimized-out.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/input.js41
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod1.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod10.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod11.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod12.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod2.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod3.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod4.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod5.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod6.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod7.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod8.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/mod9.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/esmodules/src/optimized-out.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/eval-maps/input.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/for-loops/input.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/for-of/input.js12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/functions/input.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/lex-and-nonlex/input.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/line-start-bindings-es6/input.js23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/modules-cjs/input.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/out-of-order-declarations-cjs/input.js17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/out-of-order-declarations-cjs/src/mod.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/shadowed-vars/input.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/step-over-for-of-array-closure/input.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/step-over-for-of-array/input.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/step-over-for-of-closure/input.js13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/step-over-for-of/input.js11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/step-over-function-params/input.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/step-over-regenerator-await/input.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/switches/input.js13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/this-arguments-bindings/input.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/try-catches/input.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/type-module/input.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/type-script-cjs/input.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/typescript-classes/input.ts51
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/typescript-classes/src/mod.ts8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/webpack-functions/input.js12
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/webpack-line-mappings/input.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/fixtures/webpack-line-mappings/src/mod1.js1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/babel-bindings-with-flow.js132
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/babel-bindings-with-flow.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/babel-classes.js132
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/babel-classes.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/babel-flowtype-bindings.js131
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/babel-flowtype-bindings.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/classes.js137
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/classes.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/esmodules-cjs.js259
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/esmodules-cjs.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/esmodules-es6.js259
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/esmodules-es6.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/esmodules.js259
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/esmodules.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/eval-maps.js130
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/eval-maps.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/for-loops.js130
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/for-loops.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/for-of.js127
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/for-of.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/functions.js129
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/functions.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/lex-and-nonlex.js124
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/lex-and-nonlex.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/line-start-bindings-es6.js137
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/line-start-bindings-es6.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/modules-cjs.js117
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/modules-cjs.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/out-of-order-declarations-cjs.js144
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/out-of-order-declarations-cjs.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/shadowed-vars.js136
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/shadowed-vars.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of-array-closure.js125
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of-array-closure.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of-array.js125
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of-array.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of-closure.js128
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of-closure.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of.js126
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-for-of.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-function-params.js123
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-function-params.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-regenerator-await.js130
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/step-over-regenerator-await.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/switches.js129
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/switches.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/this-arguments-bindings.js129
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/this-arguments-bindings.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/try-catches.js125
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/try-catches.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/type-module.js123
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/type-module.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/type-script-cjs.js119
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/type-script-cjs.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/typescript-classes.js221
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/typescript-classes.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/webpack-functions.js126
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/webpack-functions.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/webpack-line-mappings.js147
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/parcel/webpack-line-mappings.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/babel-bindings-with-flow.js17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/babel-bindings-with-flow.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/babel-classes.js37
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/babel-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/babel-flowtype-bindings.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/babel-flowtype-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/classes.js49
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/esmodules-es6.js57
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/esmodules.js57
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/eval-maps.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/for-loops.js23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/for-of.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/functions.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/lex-and-nonlex.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/line-start-bindings-es6.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/shadowed-vars.js17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of-array-closure.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of-array.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of-closure.js48
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of.js40
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-function-params.js25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-regenerator-await.js47
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/switches.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/this-arguments-bindings.js25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/try-catches.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/type-module.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/webpack-functions.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/webpack-line-mappings.js28
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel6/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/babel-bindings-with-flow.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/babel-bindings-with-flow.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/babel-classes.js71
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/babel-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/babel-flowtype-bindings.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/babel-flowtype-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/classes.js70
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/esmodules-es6.js55
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/esmodules.js55
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/eval-maps.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/for-loops.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/for-of.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/functions.js23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/lex-and-nonlex.js25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/line-start-bindings-es6.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/shadowed-vars.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of-array-closure.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of-array.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of-closure.js27
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-function-params.js30
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-regenerator-await.js81
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/switches.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/this-arguments-bindings.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/try-catches.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/type-module.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/webpack-functions.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/webpack-line-mappings.js30
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup-babel7/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/classes.js27
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/esmodules-es6.js57
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/esmodules.js57
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/eval-maps.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/for-loops.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/for-of.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/functions.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/lex-and-nonlex.js17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/line-start-bindings-es6.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/shadowed-vars.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of-array-closure.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of-array.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of-closure.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of.js19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-function-params.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-regenerator-await.js23
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/switches.js18
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/this-arguments-bindings.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/try-catches.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/type-module.js16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/typescript-classes.js97
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/typescript-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/webpack-functions.js20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/webpack-line-mappings.js26
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/rollup/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/babel-bindings-with-flow.js96
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/babel-bindings-with-flow.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/babel-classes.js107
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/babel-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/babel-flowtype-bindings.js95
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/babel-flowtype-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/classes.js121
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/esmodules-cjs.js280
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/esmodules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/esmodules-es6.js224
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/esmodules.js217
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/eval-maps.js93
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/for-loops.js94
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/for-of.js92
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/functions.js91
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/lex-and-nonlex.js90
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/line-start-bindings-es6.js100
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/modules-cjs.js85
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/modules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/out-of-order-declarations-cjs.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/out-of-order-declarations-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/shadowed-vars.js102
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array-closure.js95
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array.js89
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of-closure.js117
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of.js109
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-function-params.js95
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-regenerator-await.js116
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/switches.js91
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/this-arguments-bindings.js94
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/try-catches.js87
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/type-module.js84
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/type-script-cjs.js87
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/type-script-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/typescript-classes.js75
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/typescript-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/webpack-functions.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/webpack-line-mappings.js105
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel6/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/babel-bindings-with-flow.js94
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/babel-bindings-with-flow.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/babel-classes.js112
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/babel-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/babel-flowtype-bindings.js92
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/babel-flowtype-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/classes.js125
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/esmodules-cjs.js290
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/esmodules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/esmodules-es6.js217
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/esmodules.js210
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/eval-maps.js89
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/for-loops.js97
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/for-of.js91
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/functions.js92
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/lex-and-nonlex.js90
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/line-start-bindings-es6.js97
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/modules-cjs.js85
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/modules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/out-of-order-declarations-cjs.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/out-of-order-declarations-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/shadowed-vars.js101
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array-closure.js95
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array.js89
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of-closure.js96
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-function-params.js100
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-regenerator-await.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/switches.js92
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/this-arguments-bindings.js95
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/try-catches.js87
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/type-module.js84
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/type-script-cjs.js87
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/type-script-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/webpack-functions.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/webpack-line-mappings.js106
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3-babel7/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/classes.js100
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/esmodules-cjs.js236
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/esmodules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/esmodules-es6.js236
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/esmodules.js236
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/eval-maps.js94
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/for-loops.js93
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/for-of.js90
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/functions.js92
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/lex-and-nonlex.js87
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/line-start-bindings-es6.js101
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/modules-cjs.js83
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/modules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/out-of-order-declarations-cjs.js104
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/out-of-order-declarations-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/shadowed-vars.js98
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of-array-closure.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of-array.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of-closure.js91
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of.js89
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-function-params.js86
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-regenerator-await.js93
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/switches.js91
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/this-arguments-bindings.js92
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/try-catches.js88
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/type-module.js85
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/type-script-cjs.js85
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/type-script-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/typescript-classes.js179
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/typescript-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/webpack-functions.js90
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/webpack-line-mappings.js105
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack3/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/babel-bindings-with-flow.js129
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/babel-bindings-with-flow.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/babel-classes.js134
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/babel-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/babel-flowtype-bindings.js128
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/babel-flowtype-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/classes.js148
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/esmodules-cjs.js362
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/esmodules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/esmodules-es6.js309
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/esmodules.js309
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/eval-maps.js120
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/for-loops.js121
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/for-of.js119
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/functions.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/lex-and-nonlex.js117
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/line-start-bindings-es6.js127
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/modules-cjs.js112
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/modules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/out-of-order-declarations-cjs.js147
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/out-of-order-declarations-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/shadowed-vars.js129
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array-closure.js122
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array.js116
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of-closure.js144
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of.js136
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-function-params.js122
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-regenerator-await.js143
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/switches.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/this-arguments-bindings.js121
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/try-catches.js114
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/type-module.js111
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/type-script-cjs.js114
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/type-script-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/webpack-functions.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/webpack-line-mappings.js138
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel6/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/babel-bindings-with-flow.js127
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/babel-bindings-with-flow.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/babel-classes.js139
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/babel-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/babel-flowtype-bindings.js125
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/babel-flowtype-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/classes.js152
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/esmodules-cjs.js372
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/esmodules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/esmodules-es6.js302
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/esmodules.js302
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/eval-maps.js116
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/for-loops.js124
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/for-of.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/functions.js119
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/lex-and-nonlex.js117
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/line-start-bindings-es6.js124
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/modules-cjs.js112
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/modules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/out-of-order-declarations-cjs.js150
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/out-of-order-declarations-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/shadowed-vars.js128
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array-closure.js122
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array.js116
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of-closure.js123
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-function-params.js127
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-regenerator-await.js145
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/switches.js119
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/this-arguments-bindings.js122
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/try-catches.js114
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/type-module.js111
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/type-script-cjs.js114
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/type-script-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/webpack-functions.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/webpack-line-mappings.js139
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4-babel7/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/classes.js127
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/esmodules-cjs.js321
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/esmodules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/esmodules-es6.js321
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/esmodules-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/esmodules.js321
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/esmodules.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/eval-maps.js121
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/eval-maps.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/for-loops.js120
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/for-loops.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/for-of.js117
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/functions.js119
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/lex-and-nonlex.js114
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/lex-and-nonlex.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/line-start-bindings-es6.js128
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/line-start-bindings-es6.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/modules-cjs.js110
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/modules-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/out-of-order-declarations-cjs.js137
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/out-of-order-declarations-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/shadowed-vars.js125
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/shadowed-vars.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of-array-closure.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of-array-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of-array.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of-array.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of-closure.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of-closure.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of.js116
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-for-of.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-function-params.js113
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-function-params.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-regenerator-await.js120
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/step-over-regenerator-await.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/switches.js118
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/switches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/this-arguments-bindings.js119
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/this-arguments-bindings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/try-catches.js115
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/try-catches.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/type-module.js112
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/type-module.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/type-script-cjs.js112
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/type-script-cjs.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/typescript-classes.js211
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/typescript-classes.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/webpack-functions.js117
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/webpack-functions.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/webpack-line-mappings.js138
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/output/webpack4/webpack-line-mappings.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/package.json16
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/polyfill-bundle.js9037
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/tsconfig.json10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemapped/yarn.lock2177
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-indexed/main.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-indexed/main.js.map30
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-indexed/main.min.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/README.md6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/package.json20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/iframe.html29
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/index.html74
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/onload.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original-with-no-update.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query2.js.y=31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/removed-original.js5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/same-url.sjs20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/script.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/test-functions.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/webpack.config.js49
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/another-original.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/bundle-with-another-original.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/bundle-with-another-original.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/iframe.html29
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/index.html32
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/new-original.js6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/original-with-no-update.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/original.js13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/replaced-bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/replaced-bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/script.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v2/webpack.config.js54
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v3/bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v3/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v3/index.html17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v3/original.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v3/webpack.config.js31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/README.md11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/package.json19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/bundle-with-another-original.js89
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/bundle-with-another-original.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/bundle.js90
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/iframe.html29
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/index.html77
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/onload.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/original-with-no-update.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/original.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/query.js.x=11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/query.js.x=21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/query2.js.y=31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/react-component-module.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/removed-original.js5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/replaced-bundle.js85
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/replaced-bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/same-url.sjs20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/script.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/test-functions.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v1/webpack.config.js49
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/another-original.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/bundle-with-another-original.js110
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/bundle-with-another-original.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/bundle.js93
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/iframe.html29
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/index.html32
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/new-original.js6
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/original-with-no-update.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/original.js13
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/replaced-bundle.js86
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/replaced-bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/script.js22
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v2/webpack.config.js54
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v3/bundle.js83
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v3/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v3/index.html17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v3/original.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-uncompressed/v3/webpack.config.js31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/bundle.js35
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/package.json15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/rollup.config.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/src/index.js11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/src/original-1.js4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/src/original-2.js4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/src/original-3.js4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/src/original-4.js4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-ignorelist/src/original-5.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-sections/xbundle.js7
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-with-sections/xbundle.js.map25
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps/bundle.js96
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps/bundle.js.map21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps2/main.js15
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps2/main.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps2/main.min.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/.babelrc1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/.gitignore2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/package.json19
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/sorted.js43
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/test.js7
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps3/webpack.config.js31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sum/sum.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sum/sum.min.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sum/sum.min.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/times2.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/top-level.js3
-rw-r--r--devtools/client/debugger/test/mochitest/examples/trigger-gc.js4
-rw-r--r--devtools/client/debugger/test/mochitest/examples/wasm-sourcemaps/README.md20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/wasm-sourcemaps/fib.c17
-rw-r--r--devtools/client/debugger/test/mochitest/examples/wasm-sourcemaps/fib.debug.wasmbin0 -> 1333 bytes-rw-r--r--devtools/client/debugger/test/mochitest/examples/wasm-sourcemaps/fib.wasmbin0 -> 1516 bytes-rw-r--r--devtools/client/debugger/test/mochitest/examples/wasm-sourcemaps/fib.wasm.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/webpack.config.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/worker-exception.js4
-rw-r--r--devtools/client/debugger/test/mochitest/head.js255
-rw-r--r--devtools/client/debugger/test/mochitest/integration-tests/1-reload-same-original.js140
-rw-r--r--devtools/client/debugger/test/mochitest/integration-tests/2-reload-replaced-original.js128
-rw-r--r--devtools/client/debugger/test/mochitest/integration-tests/3-reload-changed-generated.js179
-rw-r--r--devtools/client/debugger/test/mochitest/integration-tests/README.md29
-rw-r--r--devtools/client/debugger/test/mochitest/shared-head.js2719
-rw-r--r--devtools/client/debugger/test/xpcshell/.eslintrc.js10
-rw-r--r--devtools/client/debugger/test/xpcshell/test_sourcetree_utils_getRelativePath.js70
-rw-r--r--devtools/client/debugger/test/xpcshell/xpcshell.ini6
-rw-r--r--devtools/client/debugger/webpack.config.js112
-rw-r--r--devtools/client/debugger/yarn.lock8696
-rw-r--r--devtools/client/definitions.js664
-rw-r--r--devtools/client/devtools-client.js849
-rw-r--r--devtools/client/devtools-experimental-prefs.js230
-rw-r--r--devtools/client/dom/.eslintrc.js17
-rw-r--r--devtools/client/dom/content/actions/filter.js19
-rw-r--r--devtools/client/dom/content/actions/grips.js54
-rw-r--r--devtools/client/dom/content/actions/moz.build9
-rw-r--r--devtools/client/dom/content/components/DomTree.js141
-rw-r--r--devtools/client/dom/content/components/MainFrame.js76
-rw-r--r--devtools/client/dom/content/components/MainToolbar.js76
-rw-r--r--devtools/client/dom/content/components/moz.build6
-rw-r--r--devtools/client/dom/content/constants.js7
-rw-r--r--devtools/client/dom/content/dom-decorator.js48
-rw-r--r--devtools/client/dom/content/dom-view.css109
-rw-r--r--devtools/client/dom/content/dom-view.js69
-rw-r--r--devtools/client/dom/content/grip-provider.js102
-rw-r--r--devtools/client/dom/content/moz.build18
-rw-r--r--devtools/client/dom/content/reducers/filter.js27
-rw-r--r--devtools/client/dom/content/reducers/grips.js123
-rw-r--r--devtools/client/dom/content/reducers/index.js16
-rw-r--r--devtools/client/dom/content/reducers/moz.build10
-rw-r--r--devtools/client/dom/content/utils.js25
-rw-r--r--devtools/client/dom/index.html29
-rw-r--r--devtools/client/dom/main.js26
-rw-r--r--devtools/client/dom/moz.build17
-rw-r--r--devtools/client/dom/panel.js278
-rw-r--r--devtools/client/dom/test/browser.ini18
-rw-r--r--devtools/client/dom/test/browser_dom_array.js66
-rw-r--r--devtools/client/dom/test/browser_dom_basic.js22
-rw-r--r--devtools/client/dom/test/browser_dom_fission_target_switching.js41
-rw-r--r--devtools/client/dom/test/browser_dom_iframe_picker.js80
-rw-r--r--devtools/client/dom/test/browser_dom_nodes_highlight.js73
-rw-r--r--devtools/client/dom/test/browser_dom_nodes_select.js43
-rw-r--r--devtools/client/dom/test/browser_dom_refresh.js30
-rw-r--r--devtools/client/dom/test/head.js201
-rw-r--r--devtools/client/dom/test/page_array.html19
-rw-r--r--devtools/client/dom/test/page_basic.html15
-rw-r--r--devtools/client/dom/test/page_dom_nodes.html18
-rw-r--r--devtools/client/framework/actions/dom-mutation-breakpoints.js140
-rw-r--r--devtools/client/framework/actions/index.js8
-rw-r--r--devtools/client/framework/actions/moz.build11
-rw-r--r--devtools/client/framework/browser-menus.js340
-rw-r--r--devtools/client/framework/browser-toolbox/Launcher.sys.mjs470
-rw-r--r--devtools/client/framework/browser-toolbox/README.md37
-rw-r--r--devtools/client/framework/browser-toolbox/moz.build13
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser.ini46
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js66
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_debugger.js222
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_evaluation_context.js199
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_fission_contentframe_inspector.js66
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_fission_inspector.js220
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_fission_inspector_webextension.js94
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_l10n_buttons.js88
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_navigate_tab.js85
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_netmonitor.js152
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_print_preview.js58
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_rtl.js29
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_ruleview_stylesheet.js80
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_shouldprocessupdates.js42
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_unavailable_children.js144
-rw-r--r--devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_watchedByDevTools.js122
-rw-r--r--devtools/client/framework/browser-toolbox/test/doc_browser_toolbox_fission_contentframe_inspector_frame.html14
-rw-r--r--devtools/client/framework/browser-toolbox/test/doc_browser_toolbox_fission_contentframe_inspector_page.html16
-rw-r--r--devtools/client/framework/browser-toolbox/test/doc_browser_toolbox_ruleview_stylesheet.html12
-rw-r--r--devtools/client/framework/browser-toolbox/test/head.js13
-rw-r--r--devtools/client/framework/browser-toolbox/test/helpers-browser-toolbox.js233
-rw-r--r--devtools/client/framework/browser-toolbox/test/style_browser_toolbox_ruleview_stylesheet.css3
-rw-r--r--devtools/client/framework/browser-toolbox/window.css41
-rw-r--r--devtools/client/framework/browser-toolbox/window.html29
-rw-r--r--devtools/client/framework/browser-toolbox/window.js336
-rw-r--r--devtools/client/framework/commands-from-url.js179
-rw-r--r--devtools/client/framework/components/ChromeDebugToolbar.css60
-rw-r--r--devtools/client/framework/components/ChromeDebugToolbar.js123
-rw-r--r--devtools/client/framework/components/DebugTargetErrorPage.css21
-rw-r--r--devtools/client/framework/components/DebugTargetErrorPage.js49
-rw-r--r--devtools/client/framework/components/DebugTargetInfo.js401
-rw-r--r--devtools/client/framework/components/MeatballMenu.js299
-rw-r--r--devtools/client/framework/components/ToolboxController.js231
-rw-r--r--devtools/client/framework/components/ToolboxTab.js106
-rw-r--r--devtools/client/framework/components/ToolboxTabs.js331
-rw-r--r--devtools/client/framework/components/ToolboxToolbar.js545
-rw-r--r--devtools/client/framework/components/moz.build17
-rw-r--r--devtools/client/framework/devtools-browser.js633
-rw-r--r--devtools/client/framework/devtools.js1035
-rw-r--r--devtools/client/framework/enable-devtools-popup.js40
-rw-r--r--devtools/client/framework/local-tab-commands-factory.js72
-rw-r--r--devtools/client/framework/menu-item.js79
-rw-r--r--devtools/client/framework/menu.js248
-rw-r--r--devtools/client/framework/moz.build51
-rw-r--r--devtools/client/framework/options-panel.css203
-rw-r--r--devtools/client/framework/reducers/dom-mutation-breakpoints.js115
-rw-r--r--devtools/client/framework/reducers/index.js10
-rw-r--r--devtools/client/framework/reducers/moz.build11
-rw-r--r--devtools/client/framework/selection.js367
-rw-r--r--devtools/client/framework/source-map-url-service.js495
-rw-r--r--devtools/client/framework/store-provider.js10
-rw-r--r--devtools/client/framework/store.js13
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_browser_console.ini11
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_browser_console.js69
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_debugger.ini14
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_debugger.js13
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_inspector.ini14
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_inspector.js13
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.ini14
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.js13
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_no_devtools.ini13
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_no_devtools.js42
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.ini14
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.js13
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_target.ini11
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_target.js51
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_toolbox.ini11
-rw-r--r--devtools/client/framework/test/allocations/browser_allocations_toolbox.js53
-rw-r--r--devtools/client/framework/test/allocations/docs/index.md241
-rw-r--r--devtools/client/framework/test/allocations/head.js250
-rw-r--r--devtools/client/framework/test/allocations/moz.build16
-rw-r--r--devtools/client/framework/test/allocations/reload-test.js81
-rw-r--r--devtools/client/framework/test/allocations/reloaded-page.html11
-rw-r--r--devtools/client/framework/test/allocations/reloaded.pngbin0 -> 580 bytes-rw-r--r--devtools/client/framework/test/browser-telemetry-startup.ini13
-rw-r--r--devtools/client/framework/test/browser.ini185
-rw-r--r--devtools/client/framework/test/browser_about-devtools-toolbox_load.js31
-rw-r--r--devtools/client/framework/test/browser_about-devtools-toolbox_reload.js73
-rw-r--r--devtools/client/framework/test/browser_commands_from_url.js161
-rw-r--r--devtools/client/framework/test/browser_devtools_api_destroy.js72
-rw-r--r--devtools/client/framework/test/browser_dynamic_tool_enabling.js44
-rw-r--r--devtools/client/framework/test/browser_front_parentFront.js39
-rw-r--r--devtools/client/framework/test/browser_ignore_toolbox_network_requests.js30
-rw-r--r--devtools/client/framework/test/browser_keybindings_01.js107
-rw-r--r--devtools/client/framework/test/browser_keybindings_02.js67
-rw-r--r--devtools/client/framework/test/browser_keybindings_03.js52
-rw-r--r--devtools/client/framework/test/browser_menu_api.js239
-rw-r--r--devtools/client/framework/test/browser_new_activation_workflow.js79
-rw-r--r--devtools/client/framework/test/browser_source_map-01.js71
-rw-r--r--devtools/client/framework/test/browser_source_map-absolute.js36
-rw-r--r--devtools/client/framework/test/browser_source_map-cross-domain.js41
-rw-r--r--devtools/client/framework/test/browser_source_map-init.js51
-rw-r--r--devtools/client/framework/test/browser_source_map-inline.js42
-rw-r--r--devtools/client/framework/test/browser_source_map-late-script.js52
-rw-r--r--devtools/client/framework/test/browser_source_map-no-race.js43
-rw-r--r--devtools/client/framework/test/browser_source_map-pub-sub.js97
-rw-r--r--devtools/client/framework/test/browser_source_map-reload.js56
-rw-r--r--devtools/client/framework/test/browser_tab_commands_factory.js52
-rw-r--r--devtools/client/framework/test/browser_tab_descriptor_fission.js67
-rw-r--r--devtools/client/framework/test/browser_target_cached-front.js23
-rw-r--r--devtools/client/framework/test/browser_target_cached-resource.js50
-rw-r--r--devtools/client/framework/test/browser_target_get-front.js112
-rw-r--r--devtools/client/framework/test/browser_target_listeners.js33
-rw-r--r--devtools/client/framework/test/browser_target_loading.js37
-rw-r--r--devtools/client/framework/test/browser_target_parents.js183
-rw-r--r--devtools/client/framework/test/browser_target_remote.js15
-rw-r--r--devtools/client/framework/test/browser_target_server_compartment.js126
-rw-r--r--devtools/client/framework/test/browser_target_support.js40
-rw-r--r--devtools/client/framework/test/browser_toolbox_backward_forward_navigation.js188
-rw-r--r--devtools/client/framework/test/browser_toolbox_browsertoolbox_host.js27
-rw-r--r--devtools/client/framework/test/browser_toolbox_contentpage_contextmenu.js83
-rw-r--r--devtools/client/framework/test/browser_toolbox_disable_f12.js106
-rw-r--r--devtools/client/framework/test/browser_toolbox_dynamic_registration.js87
-rw-r--r--devtools/client/framework/test/browser_toolbox_error_count.js183
-rw-r--r--devtools/client/framework/test/browser_toolbox_error_count_reset_on_navigation.js84
-rw-r--r--devtools/client/framework/test/browser_toolbox_fission_navigation.js56
-rw-r--r--devtools/client/framework/test/browser_toolbox_frames_list.js150
-rw-r--r--devtools/client/framework/test/browser_toolbox_getpanelwhenready.js39
-rw-r--r--devtools/client/framework/test/browser_toolbox_highlight.js122
-rw-r--r--devtools/client/framework/test/browser_toolbox_hosts.js226
-rw-r--r--devtools/client/framework/test/browser_toolbox_hosts_size.js134
-rw-r--r--devtools/client/framework/test/browser_toolbox_hosts_telemetry.js49
-rw-r--r--devtools/client/framework/test/browser_toolbox_keyboard_navigation.js136
-rw-r--r--devtools/client/framework/test/browser_toolbox_keyboard_navigation_notification_box.js49
-rw-r--r--devtools/client/framework/test/browser_toolbox_meatball.js134
-rw-r--r--devtools/client/framework/test/browser_toolbox_options.js557
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_buttons.js216
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js36
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js52
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_cache-03.js60
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_cache.css.sjs10
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_cache.sjs31
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_js.html48
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_js.js139
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_disable_js_iframe.html35
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html81
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js76
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_frames_button.js104
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js130
-rw-r--r--devtools/client/framework/test/browser_toolbox_options_panel_toggle.js82
-rw-r--r--devtools/client/framework/test/browser_toolbox_popups_debugging.js56
-rw-r--r--devtools/client/framework/test/browser_toolbox_races.js96
-rw-r--r--devtools/client/framework/test/browser_toolbox_raise.js68
-rw-r--r--devtools/client/framework/test/browser_toolbox_ready.js22
-rw-r--r--devtools/client/framework/test/browser_toolbox_remoteness_change.js52
-rw-r--r--devtools/client/framework/test/browser_toolbox_screenshot_tool.js126
-rw-r--r--devtools/client/framework/test/browser_toolbox_select_event.js98
-rw-r--r--devtools/client/framework/test/browser_toolbox_selected_tool_unavailable.js46
-rw-r--r--devtools/client/framework/test/browser_toolbox_selectionchanged_event.js40
-rw-r--r--devtools/client/framework/test/browser_toolbox_show_toolbox_tool_ready.js69
-rw-r--r--devtools/client/framework/test/browser_toolbox_split_console.js84
-rw-r--r--devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js77
-rw-r--r--devtools/client/framework/test/browser_toolbox_telemetry_activate_splitconsole.js108
-rw-r--r--devtools/client/framework/test/browser_toolbox_telemetry_close.js63
-rw-r--r--devtools/client/framework/test/browser_toolbox_telemetry_enter.js152
-rw-r--r--devtools/client/framework/test/browser_toolbox_telemetry_exit.js129
-rw-r--r--devtools/client/framework/test/browser_toolbox_telemetry_open_event.js38
-rw-r--r--devtools/client/framework/test/browser_toolbox_textbox_context_menu.js137
-rw-r--r--devtools/client/framework/test/browser_toolbox_theme.js33
-rw-r--r--devtools/client/framework/test/browser_toolbox_theme_registration.js166
-rw-r--r--devtools/client/framework/test/browser_toolbox_toggle.js111
-rw-r--r--devtools/client/framework/test/browser_toolbox_tool_ready.js33
-rw-r--r--devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js100
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js43
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_overflow.js83
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_overflow_button_visibility.js71
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_reorder_by_dnd.js188
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_reorder_by_width.js104
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js150
-rw-r--r--devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_hidden_extension.js248
-rw-r--r--devtools/client/framework/test/browser_toolbox_tools_per_toolbox_registration.js138
-rw-r--r--devtools/client/framework/test/browser_toolbox_view_source_01.js31
-rw-r--r--devtools/client/framework/test/browser_toolbox_view_source_02.js38
-rw-r--r--devtools/client/framework/test/browser_toolbox_view_source_03.js51
-rw-r--r--devtools/client/framework/test/browser_toolbox_view_source_style_editor_fallback.js38
-rw-r--r--devtools/client/framework/test/browser_toolbox_watchedByDevTools.js72
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_reload_target.js104
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_reload_target_force.js56
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_shortcuts.js104
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_title_changes.js98
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_title_changes_page.html10
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_title_frame_select.js172
-rw-r--r--devtools/client/framework/test/browser_toolbox_window_title_frame_select_page.html11
-rw-r--r--devtools/client/framework/test/browser_toolbox_zoom.js63
-rw-r--r--devtools/client/framework/test/browser_toolbox_zoom_popup.js204
-rw-r--r--devtools/client/framework/test/browser_webextension_descriptor.js31
-rw-r--r--devtools/client/framework/test/browser_webextension_dropdown.js135
-rw-r--r--devtools/client/framework/test/code_binary_search.coffee18
-rw-r--r--devtools/client/framework/test/code_binary_search.js29
-rw-r--r--devtools/client/framework/test/code_binary_search.map10
-rw-r--r--devtools/client/framework/test/code_binary_search_absolute.js29
-rw-r--r--devtools/client/framework/test/code_binary_search_absolute.map10
-rw-r--r--devtools/client/framework/test/code_bundle_cross_domain.js93
-rw-r--r--devtools/client/framework/test/code_bundle_cross_domain.js.map1
-rw-r--r--devtools/client/framework/test/code_bundle_late_script.js116
-rw-r--r--devtools/client/framework/test/code_bundle_late_script.js.map1
-rw-r--r--devtools/client/framework/test/code_bundle_no_race.js95
-rw-r--r--devtools/client/framework/test/code_bundle_no_race.js.map1
-rw-r--r--devtools/client/framework/test/code_cross_domain.js19
-rw-r--r--devtools/client/framework/test/code_inline_bundle.js92
-rw-r--r--devtools/client/framework/test/code_inline_original.js14
-rw-r--r--devtools/client/framework/test/code_late_script.js14
-rw-r--r--devtools/client/framework/test/code_math.js7
-rw-r--r--devtools/client/framework/test/code_no_race.js17
-rw-r--r--devtools/client/framework/test/doc_backward_forward_navigation.html40
-rw-r--r--devtools/client/framework/test/doc_cached-resource.html15
-rw-r--r--devtools/client/framework/test/doc_cached-resource_iframe.html14
-rw-r--r--devtools/client/framework/test/doc_empty-tab-01.html14
-rw-r--r--devtools/client/framework/test/doc_lazy_tool.html6
-rw-r--r--devtools/client/framework/test/doc_textbox_tool.html10
-rw-r--r--devtools/client/framework/test/doc_theme.css3
-rw-r--r--devtools/client/framework/test/doc_viewsource.html13
-rw-r--r--devtools/client/framework/test/head.js490
-rw-r--r--devtools/client/framework/test/helper_disable_cache.js144
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics.ini14
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_debugger.ini12
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_debugger.js61
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_inspector.ini12
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_inspector.js43
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_netmonitor.ini12
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_netmonitor.js89
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_pool.js118
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_webconsole.ini12
-rw-r--r--devtools/client/framework/test/metrics/browser_metrics_webconsole.js56
-rw-r--r--devtools/client/framework/test/metrics/head.js171
-rw-r--r--devtools/client/framework/test/node/.eslintrc.js22
-rw-r--r--devtools/client/framework/test/node/README.md22
-rw-r--r--devtools/client/framework/test/node/babel.config.js13
-rw-r--r--devtools/client/framework/test/node/components/__snapshots__/debug-target-info.test.js.snap586
-rw-r--r--devtools/client/framework/test/node/components/debug-target-info.test.js319
-rw-r--r--devtools/client/framework/test/node/jest.config.js13
-rw-r--r--devtools/client/framework/test/node/package.json22
-rw-r--r--devtools/client/framework/test/node/setup.js10
-rw-r--r--devtools/client/framework/test/node/store/targets.test.js142
-rw-r--r--devtools/client/framework/test/node/yarn.lock3144
-rw-r--r--devtools/client/framework/test/reload/.eslintrc.js18
-rw-r--r--devtools/client/framework/test/reload/README.md4
-rw-r--r--devtools/client/framework/test/reload/package.json12
-rw-r--r--devtools/client/framework/test/reload/v1/code_bundle_reload.js19
-rw-r--r--devtools/client/framework/test/reload/v1/code_bundle_reload.js.map1
-rw-r--r--devtools/client/framework/test/reload/v1/code_reload_1.js10
-rw-r--r--devtools/client/framework/test/reload/v1/doc_reload.html15
-rw-r--r--devtools/client/framework/test/reload/v2/code_bundle_reload.js19
-rw-r--r--devtools/client/framework/test/reload/v2/code_bundle_reload.js.map1
-rw-r--r--devtools/client/framework/test/reload/v2/code_reload_2.js10
-rw-r--r--devtools/client/framework/test/reload/v2/doc_reload.html15
-rw-r--r--devtools/client/framework/test/reload/webpack.config.js13
-rw-r--r--devtools/client/framework/test/serviceworker.js4
-rw-r--r--devtools/client/framework/test/sjs_cache_controle_header.sjs19
-rw-r--r--devtools/client/framework/test/test_chrome_page.html9
-rw-r--r--devtools/client/framework/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/framework/test/xpcshell/test_tabs_absolute_order.js81
-rw-r--r--devtools/client/framework/test/xpcshell/xpcshell.ini6
-rw-r--r--devtools/client/framework/toolbox-context-menu.js119
-rw-r--r--devtools/client/framework/toolbox-host-manager.js358
-rw-r--r--devtools/client/framework/toolbox-hosts.js460
-rw-r--r--devtools/client/framework/toolbox-init.js135
-rw-r--r--devtools/client/framework/toolbox-options.html264
-rw-r--r--devtools/client/framework/toolbox-options.js615
-rw-r--r--devtools/client/framework/toolbox-tabs-order-manager.js285
-rw-r--r--devtools/client/framework/toolbox-window.js20
-rw-r--r--devtools/client/framework/toolbox-window.xhtml20
-rw-r--r--devtools/client/framework/toolbox.js4716
-rw-r--r--devtools/client/framework/toolbox.xhtml47
-rw-r--r--devtools/client/fronts/accessibility.js583
-rw-r--r--devtools/client/fronts/addon/addons.js25
-rw-r--r--devtools/client/fronts/addon/moz.build10
-rw-r--r--devtools/client/fronts/addon/webextension-inspected-window.js31
-rw-r--r--devtools/client/fronts/animation.js214
-rw-r--r--devtools/client/fronts/array-buffer.js26
-rw-r--r--devtools/client/fronts/blackboxing.js17
-rw-r--r--devtools/client/fronts/breakpoint-list.js17
-rw-r--r--devtools/client/fronts/changes.js33
-rw-r--r--devtools/client/fronts/compatibility.js18
-rw-r--r--devtools/client/fronts/css-properties.js278
-rw-r--r--devtools/client/fronts/descriptors/descriptor-mixin.js60
-rw-r--r--devtools/client/fronts/descriptors/descriptor-types.js17
-rw-r--r--devtools/client/fronts/descriptors/moz.build14
-rw-r--r--devtools/client/fronts/descriptors/process.js142
-rw-r--r--devtools/client/fronts/descriptors/tab.js330
-rw-r--r--devtools/client/fronts/descriptors/webextension.js173
-rw-r--r--devtools/client/fronts/descriptors/worker.js146
-rw-r--r--devtools/client/fronts/device.js23
-rw-r--r--devtools/client/fronts/frame.js27
-rw-r--r--devtools/client/fronts/highlighters.js53
-rw-r--r--devtools/client/fronts/inspector.js282
-rw-r--r--devtools/client/fronts/inspector/moz.build9
-rw-r--r--devtools/client/fronts/inspector/rule-rewriter.js745
-rw-r--r--devtools/client/fronts/layout.js184
-rw-r--r--devtools/client/fronts/manifest.js25
-rw-r--r--devtools/client/fronts/memory.js116
-rw-r--r--devtools/client/fronts/moz.build58
-rw-r--r--devtools/client/fronts/network-content.js24
-rw-r--r--devtools/client/fronts/network-parent.js27
-rw-r--r--devtools/client/fronts/node.js629
-rw-r--r--devtools/client/fronts/object.js465
-rw-r--r--devtools/client/fronts/page-style.js123
-rw-r--r--devtools/client/fronts/perf.js22
-rw-r--r--devtools/client/fronts/preference.js33
-rw-r--r--devtools/client/fronts/private-properties-iterator.js60
-rw-r--r--devtools/client/fronts/property-iterator.js67
-rw-r--r--devtools/client/fronts/reflow.js31
-rw-r--r--devtools/client/fronts/responsive.js28
-rw-r--r--devtools/client/fronts/root.js332
-rw-r--r--devtools/client/fronts/screenshot-content.js25
-rw-r--r--devtools/client/fronts/screenshot.js25
-rw-r--r--devtools/client/fronts/source.js102
-rw-r--r--devtools/client/fronts/storage.js55
-rw-r--r--devtools/client/fronts/string.js62
-rw-r--r--devtools/client/fronts/style-rule.js281
-rw-r--r--devtools/client/fronts/style-sheets.js37
-rw-r--r--devtools/client/fronts/symbol-iterator.js56
-rw-r--r--devtools/client/fronts/target-configuration.js33
-rw-r--r--devtools/client/fronts/targets/content-process.js57
-rw-r--r--devtools/client/fronts/targets/moz.build12
-rw-r--r--devtools/client/fronts/targets/target-mixin.js630
-rw-r--r--devtools/client/fronts/targets/window-global.js172
-rw-r--r--devtools/client/fronts/targets/worker.js33
-rw-r--r--devtools/client/fronts/thread-configuration.js25
-rw-r--r--devtools/client/fronts/thread.js285
-rw-r--r--devtools/client/fronts/tracer.js22
-rw-r--r--devtools/client/fronts/walker.js461
-rw-r--r--devtools/client/fronts/watcher.js202
-rw-r--r--devtools/client/fronts/webconsole.js315
-rw-r--r--devtools/client/fronts/worker/moz.build11
-rw-r--r--devtools/client/fronts/worker/push-subscription.js30
-rw-r--r--devtools/client/fronts/worker/service-worker-registration.js79
-rw-r--r--devtools/client/fronts/worker/service-worker.js62
-rw-r--r--devtools/client/inspector/animation/actions/animations.js86
-rw-r--r--devtools/client/inspector/animation/actions/index.js33
-rw-r--r--devtools/client/inspector/animation/actions/moz.build8
-rw-r--r--devtools/client/inspector/animation/animation.js802
-rw-r--r--devtools/client/inspector/animation/components/AnimatedPropertyItem.js64
-rw-r--r--devtools/client/inspector/animation/components/AnimatedPropertyList.js140
-rw-r--r--devtools/client/inspector/animation/components/AnimatedPropertyListContainer.js90
-rw-r--r--devtools/client/inspector/animation/components/AnimatedPropertyName.js37
-rw-r--r--devtools/client/inspector/animation/components/AnimationDetailContainer.js90
-rw-r--r--devtools/client/inspector/animation/components/AnimationDetailHeader.js52
-rw-r--r--devtools/client/inspector/animation/components/AnimationItem.js121
-rw-r--r--devtools/client/inspector/animation/components/AnimationList.js72
-rw-r--r--devtools/client/inspector/animation/components/AnimationListContainer.js224
-rw-r--r--devtools/client/inspector/animation/components/AnimationTarget.js182
-rw-r--r--devtools/client/inspector/animation/components/AnimationToolbar.js75
-rw-r--r--devtools/client/inspector/animation/components/App.js164
-rw-r--r--devtools/client/inspector/animation/components/CurrentTimeLabel.js76
-rw-r--r--devtools/client/inspector/animation/components/CurrentTimeScrubber.js131
-rw-r--r--devtools/client/inspector/animation/components/KeyframesProgressBar.js108
-rw-r--r--devtools/client/inspector/animation/components/NoAnimationPanel.js61
-rw-r--r--devtools/client/inspector/animation/components/PauseResumeButton.js104
-rw-r--r--devtools/client/inspector/animation/components/PlaybackRateSelector.js108
-rw-r--r--devtools/client/inspector/animation/components/ProgressInspectionPanel.js49
-rw-r--r--devtools/client/inspector/animation/components/RewindButton.js38
-rw-r--r--devtools/client/inspector/animation/components/TickLabels.js46
-rw-r--r--devtools/client/inspector/animation/components/TickLines.js40
-rw-r--r--devtools/client/inspector/animation/components/graph/AnimationName.js38
-rw-r--r--devtools/client/inspector/animation/components/graph/ComputedTimingPath.js104
-rw-r--r--devtools/client/inspector/animation/components/graph/DelaySign.js42
-rw-r--r--devtools/client/inspector/animation/components/graph/EffectTimingPath.js84
-rw-r--r--devtools/client/inspector/animation/components/graph/EndDelaySign.js44
-rw-r--r--devtools/client/inspector/animation/components/graph/NegativeDelayPath.js27
-rw-r--r--devtools/client/inspector/animation/components/graph/NegativeEndDelayPath.js27
-rw-r--r--devtools/client/inspector/animation/components/graph/NegativePath.js101
-rw-r--r--devtools/client/inspector/animation/components/graph/SummaryGraph.js205
-rw-r--r--devtools/client/inspector/animation/components/graph/SummaryGraphPath.js282
-rw-r--r--devtools/client/inspector/animation/components/graph/TimingPath.js450
-rw-r--r--devtools/client/inspector/animation/components/graph/moz.build17
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/ColorPath.js209
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js245
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/DiscretePath.js67
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/DistancePath.js34
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/KeyframeMarkerItem.js33
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/KeyframeMarkerList.js37
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/KeyframesGraph.js52
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/KeyframesGraphPath.js111
-rw-r--r--devtools/client/inspector/animation/components/keyframes-graph/moz.build14
-rw-r--r--devtools/client/inspector/animation/components/moz.build30
-rw-r--r--devtools/client/inspector/animation/current-time-timer.js75
-rw-r--r--devtools/client/inspector/animation/moz.build12
-rw-r--r--devtools/client/inspector/animation/reducers/animations.js117
-rw-r--r--devtools/client/inspector/animation/reducers/moz.build7
-rw-r--r--devtools/client/inspector/animation/test/browser.ini118
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animated-property-list.js52
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animated-property-list_unchanged-items.js58
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animated-property-name.js113
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-detail_close-button.js27
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-detail_title.js44
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-detail_visibility.js52
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-list.js36
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-list_one-animation-select.js30
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-list_select.js38
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-target.js61
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-target_highlight.js118
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-target_select.js64
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_animation-timeline-tick.js109
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_css-transition-with-playstate-idle.js81
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_current-time-label.js73
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_current-time-scrubber-rtl.js18
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_current-time-scrubber-with-negative-delay.js48
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_current-time-scrubber.js14
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_current-time-scrubber_each-different-creation-time-animations.js34
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_empty_on_invalid_nodes.js49
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_fission_switch-target.js99
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_indication-bar.js42
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_infinity-duration_current-time-scrubber.js39
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_infinity-duration_summary-graph.js147
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_infinity-duration_tick-label.js29
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_computed-value-path-01.js164
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_computed-value-path-02.js90
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_computed-value-path-03.js190
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_computed-value-path_easing-hint.js380
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_keyframe-marker-rtl.js14
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_keyframe-marker.js13
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-graph_special-colors.js40
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar.js103
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar_after-resuming.js64
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_adjust-time-with-playback-rate.js50
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_adjust-time.js50
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_auto-stop.js94
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_avoid-updating-during-hiding.js92
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_created-time.js57
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_mutations.js113
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_mutations_add_remove_immediately.js29
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_mutations_fast.js24
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_mutations_properties.js103
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_overflowed_delay_end-delay.js29
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_logic_scroll-amount.js70
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_pause-resume-button.js41
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_pause-resume-button_end-time.js77
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_pause-resume-button_respectively.js96
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_pause-resume-button_spacebar.js49
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_playback-rate-selector.js81
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_pseudo-element.js129
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_rewind-button.js33
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_short-duration.js43
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_animation-name.js63
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js121
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_computed-timing-path_1.js208
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_computed-timing-path_2.js192
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_computed-timing-path_different-timescale.js43
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_delay-sign-rtl.js14
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_delay-sign.js13
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_effect-timing-path.js64
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_end-delay-sign-rtl.js15
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_end-delay-sign.js13
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_layout-by-seek.js150
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_negative-delay-path.js128
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_negative-end-delay-path.js56
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_summary-graph_tooltip.js294
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_timing_negative-playback-rate_current-time-scrubber.js46
-rw-r--r--devtools/client/inspector/animation/test/browser_animation_timing_negative-playback-rate_summary-graph.js235
-rw-r--r--devtools/client/inspector/animation/test/current-time-scrubber_head.js101
-rw-r--r--devtools/client/inspector/animation/test/doc_custom_playback_rate.html30
-rw-r--r--devtools/client/inspector/animation/test/doc_infinity_duration.html41
-rw-r--r--devtools/client/inspector/animation/test/doc_multi_easings.html121
-rw-r--r--devtools/client/inspector/animation/test/doc_multi_keyframes.html229
-rw-r--r--devtools/client/inspector/animation/test/doc_multi_timings.html169
-rw-r--r--devtools/client/inspector/animation/test/doc_mutations_add_remove_immediately.html22
-rw-r--r--devtools/client/inspector/animation/test/doc_mutations_fast.html53
-rw-r--r--devtools/client/inspector/animation/test/doc_negative_playback_rate.html38
-rw-r--r--devtools/client/inspector/animation/test/doc_overflowed_delay_end_delay.html75
-rw-r--r--devtools/client/inspector/animation/test/doc_pseudo.html91
-rw-r--r--devtools/client/inspector/animation/test/doc_short_duration.html26
-rw-r--r--devtools/client/inspector/animation/test/doc_simple_animation.html174
-rw-r--r--devtools/client/inspector/animation/test/doc_special_colors.html28
-rw-r--r--devtools/client/inspector/animation/test/head.js1038
-rw-r--r--devtools/client/inspector/animation/test/keyframes-graph_keyframe-marker_head.js237
-rw-r--r--devtools/client/inspector/animation/test/summary-graph_computed-timing-path_head.js103
-rw-r--r--devtools/client/inspector/animation/test/summary-graph_delay-sign_head.js105
-rw-r--r--devtools/client/inspector/animation/test/summary-graph_end-delay-sign_head.js99
-rw-r--r--devtools/client/inspector/animation/utils/graph-helper.js332
-rw-r--r--devtools/client/inspector/animation/utils/l10n.js46
-rw-r--r--devtools/client/inspector/animation/utils/moz.build10
-rw-r--r--devtools/client/inspector/animation/utils/timescale.js145
-rw-r--r--devtools/client/inspector/animation/utils/utils.js70
-rw-r--r--devtools/client/inspector/boxmodel/actions/box-model-highlighter.js86
-rw-r--r--devtools/client/inspector/boxmodel/actions/box-model.js46
-rw-r--r--devtools/client/inspector/boxmodel/actions/index.js21
-rw-r--r--devtools/client/inspector/boxmodel/actions/moz.build11
-rw-r--r--devtools/client/inspector/boxmodel/box-model.js446
-rw-r--r--devtools/client/inspector/boxmodel/components/BoxModel.js97
-rw-r--r--devtools/client/inspector/boxmodel/components/BoxModelEditable.js109
-rw-r--r--devtools/client/inspector/boxmodel/components/BoxModelInfo.js79
-rw-r--r--devtools/client/inspector/boxmodel/components/BoxModelMain.js774
-rw-r--r--devtools/client/inspector/boxmodel/components/BoxModelProperties.js142
-rw-r--r--devtools/client/inspector/boxmodel/components/ComputedProperty.js123
-rw-r--r--devtools/client/inspector/boxmodel/components/moz.build14
-rw-r--r--devtools/client/inspector/boxmodel/moz.build19
-rw-r--r--devtools/client/inspector/boxmodel/reducers/box-model.js45
-rw-r--r--devtools/client/inspector/boxmodel/reducers/moz.build9
-rw-r--r--devtools/client/inspector/boxmodel/test/browser.ini40
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel.js201
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js56
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel.js279
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_allproperties.js191
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_bluronclick.js97
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_border.js75
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_pseudo.js76
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_stylerules.js153
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_guides.js69
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_jump-to-rule-on-hover.js56
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_layout-accordion-state.js103
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_navigation.js200
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_offsetparent.js104
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_positions.js67
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_properties.js129
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_pseudo-element.js122
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_rotate-labels-on-sides.js54
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_show-tooltip-for-unassociated-rule.js50
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_sync.js39
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_tooltips.js166
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_update-after-navigation.js96
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_update-after-reload.js42
-rw-r--r--devtools/client/inspector/boxmodel/test/browser_boxmodel_update-in-iframes.js84
-rw-r--r--devtools/client/inspector/boxmodel/test/doc_boxmodel_iframe1.html3
-rw-r--r--devtools/client/inspector/boxmodel/test/doc_boxmodel_iframe2.html3
-rw-r--r--devtools/client/inspector/boxmodel/test/head.js122
-rw-r--r--devtools/client/inspector/boxmodel/types.js21
-rw-r--r--devtools/client/inspector/boxmodel/utils/editing-session.js188
-rw-r--r--devtools/client/inspector/boxmodel/utils/moz.build9
-rw-r--r--devtools/client/inspector/breadcrumbs.js973
-rw-r--r--devtools/client/inspector/changes/ChangesContextMenu.js110
-rw-r--r--devtools/client/inspector/changes/ChangesView.js284
-rw-r--r--devtools/client/inspector/changes/actions/changes.js25
-rw-r--r--devtools/client/inspector/changes/actions/index.js18
-rw-r--r--devtools/client/inspector/changes/actions/moz.build10
-rw-r--r--devtools/client/inspector/changes/components/CSSDeclaration.js47
-rw-r--r--devtools/client/inspector/changes/components/ChangesApp.js241
-rw-r--r--devtools/client/inspector/changes/components/moz.build10
-rw-r--r--devtools/client/inspector/changes/moz.build24
-rw-r--r--devtools/client/inspector/changes/reducers/changes.js381
-rw-r--r--devtools/client/inspector/changes/reducers/moz.build9
-rw-r--r--devtools/client/inspector/changes/selectors/changes.js261
-rw-r--r--devtools/client/inspector/changes/selectors/moz.build9
-rw-r--r--devtools/client/inspector/changes/test/browser.ini28
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_at_rules.js98
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_background_tracking.js46
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_copy_all_changes.js53
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_copy_declaration.js67
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_copy_rule.js64
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_add_special_character.js78
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_disable.js48
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_duplicate.js107
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_edit_value.js170
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_identical_rules.js71
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_remove.js43
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_remove_ahead.js53
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_remove_disabled.js106
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_declaration_rename.js68
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_rule_add.js64
-rw-r--r--devtools/client/inspector/changes/test/browser_changes_rule_selector.js60
-rw-r--r--devtools/client/inspector/changes/test/head.js93
-rw-r--r--devtools/client/inspector/changes/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/inspector/changes/test/xpcshell/head.js8
-rw-r--r--devtools/client/inspector/changes/test/xpcshell/mocks.js67
-rw-r--r--devtools/client/inspector/changes/test/xpcshell/test_changes_stylesheet.js60
-rw-r--r--devtools/client/inspector/changes/test/xpcshell/xpcshell.ini8
-rw-r--r--devtools/client/inspector/changes/utils/changes-utils.js44
-rw-r--r--devtools/client/inspector/changes/utils/l10n.js15
-rw-r--r--devtools/client/inspector/changes/utils/moz.build10
-rw-r--r--devtools/client/inspector/compatibility/CompatibilityView.js277
-rw-r--r--devtools/client/inspector/compatibility/README.md25
-rw-r--r--devtools/client/inspector/compatibility/actions/compatibility.js332
-rw-r--r--devtools/client/inspector/compatibility/actions/index.js81
-rw-r--r--devtools/client/inspector/compatibility/actions/moz.build10
-rw-r--r--devtools/client/inspector/compatibility/components/BrowserIcon.js82
-rw-r--r--devtools/client/inspector/compatibility/components/CompatibilityApp.js126
-rw-r--r--devtools/client/inspector/compatibility/components/Footer.js85
-rw-r--r--devtools/client/inspector/compatibility/components/IssueItem.js245
-rw-r--r--devtools/client/inspector/compatibility/components/IssueList.js45
-rw-r--r--devtools/client/inspector/compatibility/components/IssuePane.js55
-rw-r--r--devtools/client/inspector/compatibility/components/NodeItem.js59
-rw-r--r--devtools/client/inspector/compatibility/components/NodeList.js45
-rw-r--r--devtools/client/inspector/compatibility/components/NodePane.js55
-rw-r--r--devtools/client/inspector/compatibility/components/Settings.js197
-rw-r--r--devtools/client/inspector/compatibility/components/UnsupportedBrowserItem.js60
-rw-r--r--devtools/client/inspector/compatibility/components/UnsupportedBrowserList.js76
-rw-r--r--devtools/client/inspector/compatibility/components/moz.build20
-rw-r--r--devtools/client/inspector/compatibility/moz.build23
-rw-r--r--devtools/client/inspector/compatibility/reducers/compatibility.js262
-rw-r--r--devtools/client/inspector/compatibility/reducers/moz.build9
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser.ini27
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_css-property_issue.js91
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_dynamic_js-attribute-change.js127
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_dynamic_js-dom-change.js150
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_dynamic_markup-dom-change.js158
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_dynamic_ruleview-attribute-change.js117
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_document-reload.js95
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_panel-select.js173
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_rule-change.js179
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_selected-node-change.js86
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_event_top-level-target-change.js84
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_issue-node.js49
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_preference.js28
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_settings.js113
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_throbber.js69
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_unsupported-browsers_all.js33
-rw-r--r--devtools/client/inspector/compatibility/test/browser/browser_compatibility_unsupported-browsers_some.js47
-rw-r--r--devtools/client/inspector/compatibility/test/browser/head.js283
-rw-r--r--devtools/client/inspector/compatibility/test/node/.eslintrc.js10
-rw-r--r--devtools/client/inspector/compatibility/test/node/babel.config.js14
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-CompatibilityApp.test.js.snap84
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-Footer.test.js.snap36
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-IssueItem.test.js.snap348
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-IssueList.test.js.snap29
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-IssuePane.test.js.snap41
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-NodeItem.test.js.snap21
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-NodeList.test.js.snap45
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-NodePane.test.js.snap67
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-Settings.test.js.snap367
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-UnsupportedBrowserItem.test.js.snap30
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/__snapshots__/components-compatibility-UnsupportedBrowserList.test.js.snap118
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-CompatibilityApp.test.js54
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-Footer.test.js29
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-IssueItem.test.js167
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-IssueList.test.js47
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-IssuePane.test.js52
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-NodeItem.test.js31
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-NodeList.test.js57
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-NodePane.test.js57
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-Settings.test.js71
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-UnsupportedBrowserItem.test.js42
-rw-r--r--devtools/client/inspector/compatibility/test/node/components/components-compatibility-UnsupportedBrowserList.test.js56
-rw-r--r--devtools/client/inspector/compatibility/test/node/jest.config.js14
-rw-r--r--devtools/client/inspector/compatibility/test/node/package.json28
-rw-r--r--devtools/client/inspector/compatibility/test/node/setup.js15
-rw-r--r--devtools/client/inspector/compatibility/test/node/yarn.lock4334
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/head.js10
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/test_default-browsers.js27
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/xpcshell.ini7
-rw-r--r--devtools/client/inspector/compatibility/types.js52
-rw-r--r--devtools/client/inspector/compatibility/utils/cases.js22
-rw-r--r--devtools/client/inspector/compatibility/utils/moz.build9
-rw-r--r--devtools/client/inspector/components/InspectorTabPanel.css8
-rw-r--r--devtools/client/inspector/components/InspectorTabPanel.js73
-rw-r--r--devtools/client/inspector/components/moz.build9
-rw-r--r--devtools/client/inspector/computed/computed.js1663
-rw-r--r--devtools/client/inspector/computed/moz.build11
-rw-r--r--devtools/client/inspector/computed/test/browser.ini43
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_browser-styles.js59
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_cycle_color.js90
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_default_tab.js39
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_getNodeInfo.js176
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_keybindings_01.js92
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_keybindings_02.js69
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_matched-selectors-toggle.js127
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_matched-selectors_01.js49
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_matched-selectors_02.js40
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_media-queries.js43
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_no-results-placeholder.js69
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_original-source-link.js71
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_pseudo-element_01.js38
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_refresh-on-ruleview-change.js93
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_refresh-on-style-change_01.js32
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_search-filter.js67
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_search-filter_clear.js72
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_search-filter_context-menu.js101
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_search-filter_escape-keypress.js76
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_search-filter_noproperties.js68
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles-01.js67
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles-02.js35
-rw-r--r--devtools/client/inspector/computed/test/browser_computed_style-editor-link.js210
-rw-r--r--devtools/client/inspector/computed/test/doc_matched_selectors.html28
-rw-r--r--devtools/client/inspector/computed/test/doc_media_queries.html21
-rw-r--r--devtools/client/inspector/computed/test/doc_pseudoelement.html131
-rw-r--r--devtools/client/inspector/computed/test/doc_sourcemaps.css7
-rw-r--r--devtools/client/inspector/computed/test/doc_sourcemaps.css.map7
-rw-r--r--devtools/client/inspector/computed/test/doc_sourcemaps.html11
-rw-r--r--devtools/client/inspector/computed/test/doc_sourcemaps.scss10
-rw-r--r--devtools/client/inspector/computed/test/head.js267
-rw-r--r--devtools/client/inspector/configs/development.json21
-rw-r--r--devtools/client/inspector/extensions/actions/index.js24
-rw-r--r--devtools/client/inspector/extensions/actions/moz.build10
-rw-r--r--devtools/client/inspector/extensions/actions/sidebar.js58
-rw-r--r--devtools/client/inspector/extensions/components/ExpressionResultView.js110
-rw-r--r--devtools/client/inspector/extensions/components/ExtensionPage.js56
-rw-r--r--devtools/client/inspector/extensions/components/ExtensionSidebar.js106
-rw-r--r--devtools/client/inspector/extensions/components/ObjectTreeView.js67
-rw-r--r--devtools/client/inspector/extensions/components/moz.build12
-rw-r--r--devtools/client/inspector/extensions/extension-sidebar.js189
-rw-r--r--devtools/client/inspector/extensions/moz.build18
-rw-r--r--devtools/client/inspector/extensions/reducers/moz.build9
-rw-r--r--devtools/client/inspector/extensions/reducers/sidebar.js67
-rw-r--r--devtools/client/inspector/extensions/test/browser.ini13
-rw-r--r--devtools/client/inspector/extensions/test/browser_inspector_extension_sidebar.js451
-rw-r--r--devtools/client/inspector/extensions/test/head.js21
-rw-r--r--devtools/client/inspector/extensions/test/head_devtools_inspector_sidebar.js224
-rw-r--r--devtools/client/inspector/extensions/types.js15
-rw-r--r--devtools/client/inspector/flexbox/actions/flexbox-highlighter.js39
-rw-r--r--devtools/client/inspector/flexbox/actions/flexbox.js59
-rw-r--r--devtools/client/inspector/flexbox/actions/index.js24
-rw-r--r--devtools/client/inspector/flexbox/actions/moz.build11
-rw-r--r--devtools/client/inspector/flexbox/components/FlexContainer.js122
-rw-r--r--devtools/client/inspector/flexbox/components/FlexItem.js60
-rw-r--r--devtools/client/inspector/flexbox/components/FlexItemList.js62
-rw-r--r--devtools/client/inspector/flexbox/components/FlexItemSelector.js81
-rw-r--r--devtools/client/inspector/flexbox/components/FlexItemSizingOutline.js173
-rw-r--r--devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js326
-rw-r--r--devtools/client/inspector/flexbox/components/Flexbox.js128
-rw-r--r--devtools/client/inspector/flexbox/components/Header.js142
-rw-r--r--devtools/client/inspector/flexbox/components/moz.build16
-rw-r--r--devtools/client/inspector/flexbox/flexbox.js569
-rw-r--r--devtools/client/inspector/flexbox/moz.build18
-rw-r--r--devtools/client/inspector/flexbox/reducers/flexbox.js90
-rw-r--r--devtools/client/inspector/flexbox/reducers/index.js7
-rw-r--r--devtools/client/inspector/flexbox/reducers/moz.build10
-rw-r--r--devtools/client/inspector/flexbox/test/Ahem.ttfbin0 -> 12480 bytes-rw-r--r--devtools/client/inspector/flexbox/test/browser.ini54
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_accordion_state.js120
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_container_and_item.js43
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_container_and_item_accordion_state.js107
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_container_and_item_updates_on_change.js54
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_container_element_rep.js51
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_container_properties.js59
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_empty_state.js24
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_grand_parent_flex.js55
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_color_picker_on_ESC.js71
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_color_picker_on_RETURN.js92
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_opened_telemetry.js37
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_list_01.js49
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_list_02.js35
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_list_updates_on_change.js47
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_outline_exists.js30
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_outline_has_correct_layout.js67
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_outline_hidden_when_useless.js46
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_outline_renders_basisfinal_points_correctly.js40
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_outline_rotates_for_column.js49
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_item_outline_rotates_for_different_writing_modes.js42
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_non_flex_item_is_not_shown.js30
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_pseudo_elements_are_listed.js28
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_flexibility_not_displayed_when_useless.js48
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_do_not_show_unspecified_min_dimension.js45
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_exists.js36
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_for_different_writing_modes.js75
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_for_pseudos.js40
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_for_text_nodes.js40
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_has_correct_sections.js86
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_matches_properties_with_!important.js41
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_info_updates_on_change.js50
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_sizing_wanted_to_grow_but_was_clamped.js44
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_text_nodes_are_listed.js28
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_text_nodes_are_not_inlined.js52
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_toggle_flexbox_highlighter_01.js55
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_toggle_flexbox_highlighter_02.js102
-rw-r--r--devtools/client/inspector/flexbox/test/doc_flexbox_CSS_property_with_!important.html22
-rw-r--r--devtools/client/inspector/flexbox/test/doc_flexbox_pseudos.html27
-rw-r--r--devtools/client/inspector/flexbox/test/doc_flexbox_specific_cases.html121
-rw-r--r--devtools/client/inspector/flexbox/test/doc_flexbox_text_nodes.html20
-rw-r--r--devtools/client/inspector/flexbox/test/doc_flexbox_unauthored_min_dimension.html29
-rw-r--r--devtools/client/inspector/flexbox/test/doc_flexbox_writing_modes.html40
-rw-r--r--devtools/client/inspector/flexbox/test/head.js81
-rw-r--r--devtools/client/inspector/flexbox/types.js145
-rw-r--r--devtools/client/inspector/fonts/actions/font-editor.js70
-rw-r--r--devtools/client/inspector/fonts/actions/font-options.js21
-rw-r--r--devtools/client/inspector/fonts/actions/fonts.js21
-rw-r--r--devtools/client/inspector/fonts/actions/index.js42
-rw-r--r--devtools/client/inspector/fonts/actions/moz.build12
-rw-r--r--devtools/client/inspector/fonts/components/Font.js139
-rw-r--r--devtools/client/inspector/fonts/components/FontAxis.js75
-rw-r--r--devtools/client/inspector/fonts/components/FontEditor.js357
-rw-r--r--devtools/client/inspector/fonts/components/FontList.js82
-rw-r--r--devtools/client/inspector/fonts/components/FontName.js53
-rw-r--r--devtools/client/inspector/fonts/components/FontOrigin.js79
-rw-r--r--devtools/client/inspector/fonts/components/FontOverview.js80
-rw-r--r--devtools/client/inspector/fonts/components/FontPreview.js40
-rw-r--r--devtools/client/inspector/fonts/components/FontPreviewInput.js77
-rw-r--r--devtools/client/inspector/fonts/components/FontPropertyValue.js434
-rw-r--r--devtools/client/inspector/fonts/components/FontSize.js87
-rw-r--r--devtools/client/inspector/fonts/components/FontStyle.js69
-rw-r--r--devtools/client/inspector/fonts/components/FontWeight.js45
-rw-r--r--devtools/client/inspector/fonts/components/FontsApp.js71
-rw-r--r--devtools/client/inspector/fonts/components/LetterSpacing.js105
-rw-r--r--devtools/client/inspector/fonts/components/LineHeight.js101
-rw-r--r--devtools/client/inspector/fonts/components/moz.build24
-rw-r--r--devtools/client/inspector/fonts/fonts.js1112
-rw-r--r--devtools/client/inspector/fonts/moz.build19
-rw-r--r--devtools/client/inspector/fonts/reducers/font-editor.js157
-rw-r--r--devtools/client/inspector/fonts/reducers/font-options.js27
-rw-r--r--devtools/client/inspector/fonts/reducers/fonts.js28
-rw-r--r--devtools/client/inspector/fonts/reducers/moz.build11
-rw-r--r--devtools/client/inspector/fonts/test/OstrichLicense.txt41
-rw-r--r--devtools/client/inspector/fonts/test/browser.ini32
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector.js94
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_all-fonts.js82
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_copy-URL.js27
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_edit-previews.js70
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_editor-font-size-conversion.js85
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_editor-keywords.js44
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_editor-letter-spacing-conversion.js71
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_editor-values.js36
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_expand-css-code.js34
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_font-type-telemetry.js20
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_input-element-used-font.js22
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_no-fonts.js25
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_reveal-in-page.js100
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_text-node.js35
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_theme-change.js66
-rw-r--r--devtools/client/inspector/fonts/test/doc_browser_fontinspector.html67
-rw-r--r--devtools/client/inspector/fonts/test/doc_browser_fontinspector_iframe.html5
-rw-r--r--devtools/client/inspector/fonts/test/head.js277
-rw-r--r--devtools/client/inspector/fonts/test/ostrich-black.ttfbin0 -> 12872 bytes-rw-r--r--devtools/client/inspector/fonts/test/ostrich-regular.ttfbin0 -> 12476 bytes-rw-r--r--devtools/client/inspector/fonts/test/test_iframe.html11
-rw-r--r--devtools/client/inspector/fonts/types.js109
-rw-r--r--devtools/client/inspector/fonts/utils/font-utils.js111
-rw-r--r--devtools/client/inspector/fonts/utils/l10n.js14
-rw-r--r--devtools/client/inspector/fonts/utils/moz.build10
-rw-r--r--devtools/client/inspector/grids/actions/grid-highlighter.js39
-rw-r--r--devtools/client/inspector/grids/actions/grids.js55
-rw-r--r--devtools/client/inspector/grids/actions/highlighter-settings.js52
-rw-r--r--devtools/client/inspector/grids/actions/index.js30
-rw-r--r--devtools/client/inspector/grids/actions/moz.build12
-rw-r--r--devtools/client/inspector/grids/components/Grid.js106
-rw-r--r--devtools/client/inspector/grids/components/GridDisplaySettings.js116
-rw-r--r--devtools/client/inspector/grids/components/GridItem.js173
-rw-r--r--devtools/client/inspector/grids/components/GridList.js79
-rw-r--r--devtools/client/inspector/grids/components/GridOutline.js436
-rw-r--r--devtools/client/inspector/grids/components/moz.build13
-rw-r--r--devtools/client/inspector/grids/grid-inspector.js776
-rw-r--r--devtools/client/inspector/grids/moz.build20
-rw-r--r--devtools/client/inspector/grids/reducers/grids.js87
-rw-r--r--devtools/client/inspector/grids/reducers/highlighter-settings.js54
-rw-r--r--devtools/client/inspector/grids/reducers/moz.build10
-rw-r--r--devtools/client/inspector/grids/test/browser.ini49
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_accordion-state.js108
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_color-in-rules-grid-toggle.js93
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_display-setting-extend-grid-lines.js59
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_display-setting-show-grid-areas.js59
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_display-setting-show-grid-line-numbers.js65
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-color-picker-on-ESC.js75
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-color-picker-on-RETURN.js75
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-element-rep.js68
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-no-grids.js37
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-on-iframe-reloaded.js57
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-on-mutation-element-added.js100
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-on-mutation-element-removed.js63
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-on-target-added-removed.js203
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-subgrids-z-order.js83
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-subgrids_01.js138
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-subgrids_02.js72
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-toggle-grids_01.js63
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-toggle-grids_02.js96
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-list-toggle-multiple-grids.js243
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-cannot-show-outline.js57
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-highlight-area.js77
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-highlight-cell.js65
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-multiple-grids.js76
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-selected-grid.js51
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-updates-on-grid-change.js64
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_grid-outline-writing-mode.js156
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_highlighter-setting-rules-grid-toggle.js75
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_highlighter-toggle-telemetry.js63
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_number-of-css-grids-telemetry.js56
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_persist-color-palette.js58
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_restored-after-reload.js115
-rw-r--r--devtools/client/inspector/grids/test/browser_grids_restored-multiple-grids-after-reload.js156
-rw-r--r--devtools/client/inspector/grids/test/doc_iframe_reloaded.html9
-rw-r--r--devtools/client/inspector/grids/test/doc_subgrid.html56
-rw-r--r--devtools/client/inspector/grids/test/head.js40
-rw-r--r--devtools/client/inspector/grids/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/inspector/grids/test/xpcshell/head.js10
-rw-r--r--devtools/client/inspector/grids/test/xpcshell/test_compare_fragments_geometry.js129
-rw-r--r--devtools/client/inspector/grids/test/xpcshell/xpcshell.ini6
-rw-r--r--devtools/client/inspector/grids/types.js57
-rw-r--r--devtools/client/inspector/grids/utils/moz.build9
-rw-r--r--devtools/client/inspector/grids/utils/utils.js58
-rw-r--r--devtools/client/inspector/index.xhtml285
-rw-r--r--devtools/client/inspector/inspector-search.js534
-rw-r--r--devtools/client/inspector/inspector.js1997
-rw-r--r--devtools/client/inspector/layout/components/LayoutApp.js202
-rw-r--r--devtools/client/inspector/layout/components/moz.build9
-rw-r--r--devtools/client/inspector/layout/layout.js136
-rw-r--r--devtools/client/inspector/layout/moz.build17
-rw-r--r--devtools/client/inspector/layout/utils/l10n.js17
-rw-r--r--devtools/client/inspector/layout/utils/moz.build9
-rw-r--r--devtools/client/inspector/markup/components/TextNode.js88
-rw-r--r--devtools/client/inspector/markup/components/moz.build9
-rw-r--r--devtools/client/inspector/markup/markup-context-menu.js951
-rw-r--r--devtools/client/inspector/markup/markup.js2682
-rw-r--r--devtools/client/inspector/markup/markup.xhtml43
-rw-r--r--devtools/client/inspector/markup/moz.build19
-rw-r--r--devtools/client/inspector/markup/test/browser.ini249
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_accessibility_focus_blur.js77
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_accessibility_navigation.js277
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_accessibility_navigation_after_edit.js126
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_accessibility_new_selection.js34
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js146
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_anonymous_01.js46
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_anonymous_03.js41
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_anonymous_04.js38
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_copy_html.js93
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_copy_image_data.js81
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_01.js130
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_02.js103
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js52
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_display_node_01.js91
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_display_node_02.js165
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dom_mutation_breakpoints.js196
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_autoscroll_01.js48
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_autoscroll_02.js46
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_before_marker_pseudo.js78
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_distance.js48
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_dragRootNode.js21
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_draggable.js62
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_escapeKeyPress.js38
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_invalidNodes.js67
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_reorder.js111
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js36
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events-overflow.js104
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events-windowed-host.js80
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_01.js132
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_02.js123
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_03.js88
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_04.js124
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_chrome_blocked.js46
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_chrome_not_blocked.js53
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_click_to_close.js102
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.0.js224
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.1.js231
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.11.1.js160
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.2.js141
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.3.js150
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.4.js185
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.6.js351
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_1.7.js201
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_jquery_2.1.1.js160
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_object_listener.js43
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_react_development_15.4.1.js113
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_react_development_15.4.1_jsx.js116
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_react_production_15.3.1.js113
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_react_production_15.3.1_jsx.js116
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_react_production_16.2.0.js133
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_react_production_16.2.0_jsx.js114
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_source_map.js54
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_events_toggle.js295
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_flex_display_badge.js107
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_flex_display_badge_telemetry.js53
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_grid_display_badge_01.js91
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_grid_display_badge_02.js256
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_grid_display_badge_03.js82
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_grid_display_badge_telemetry.js45
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_html_edit_01.js111
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_html_edit_02.js157
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_html_edit_03.js305
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_html_edit_04.js101
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_html_edit_undo-redo.js88
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_iframe_blocked_by_csp.js53
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_image_tooltip.js63
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_image_tooltip_mutations.js95
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_keybindings_01.js48
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_keybindings_02.js31
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_keybindings_03.js64
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_keybindings_04.js71
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_keybindings_delete_attributes.js73
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_keybindings_scrolltonode.js100
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_01.js178
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_02.js40
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_03.js39
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_04.js150
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_05.js74
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_06.js60
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_links_07.js134
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_load_01.js74
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_mutation_01.js419
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_mutation_02.js191
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_navigation.js128
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_node_names.js34
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_node_names_namespaced.js52
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_node_not_displayed_01.js37
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_node_not_displayed_02.js147
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_overflow_badge.js101
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_pagesize_01.js91
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_pagesize_02.js48
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_pseudo_on_reload.js44
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js36
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_screenshot_node.js25
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_screenshot_node_about_page.js46
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_screenshot_node_iframe.js46
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_screenshot_node_shadowdom.js41
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_screenshot_node_warning.js38
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_scrollable_badge.js67
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_scrollable_badge_click.js155
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_search_01.js56
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom.js290
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_clickreveal.js108
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_clickreveal_scroll.js88
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_copy_paths.js80
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_delete.js105
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_dynamic.js155
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_hover.js78
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_marker_and_before_pseudos.js117
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_maxchildren.js122
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_mutations_shadow.js85
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_navigation.js97
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_nested_pick_inspect.js132
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_noslot.js107
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_open_debugger.js133
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_open_debugger_pretty_printed.js53
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_shadowroot_mode.js52
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_show_nodes_button.js51
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_slotted_keyboard_focus.js71
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_slotupdate.js68
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_ua_widgets.js104
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_shadowdom_ua_widgets_with_nac.js70
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_subgrid_display_badge.js78
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_delete_whitespace_node.js79
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_01.js73
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_02.js46
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_03.js68
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_04-backspace.js64
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_04-delete.js64
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_05.js85
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_06.js95
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js152
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_08.js140
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_09.js74
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_10.js39
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js37
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_12.js103
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_13-other.js39
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_avoid_refocus.js51
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_long-classname.js51
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_template.js55
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_textcontent_display.js123
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_textcontent_edit_01.js110
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_textcontent_edit_02.js121
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_toggle_01.js59
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_toggle_02.js61
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_toggle_03.js51
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_toggle_04.js40
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js54
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_update-on-navigtion.js57
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_view-original-source.js55
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_view-source.js126
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_void_elements_html.js51
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js33
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_whitespace.js106
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_anonymous.html32
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_dragdrop.html45
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_dragdrop_autoscroll_01.html87
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_dragdrop_autoscroll_02.html40
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_edit.html48
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events-overflow.html19
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events-source_map.html10
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_01.html118
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_02.html115
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_03.html103
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_04.html101
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_chrome_listeners.html9
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_jquery.html69
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_object_listener.html40
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_react_development_15.4.1.html73
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_react_development_15.4.1_jsx.html51
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_react_production_15.3.1.html73
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_react_production_15.3.1_jsx.html51
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_react_production_16.2.0.html80
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_react_production_16.2.0_jsx.html50
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_events_toggle.html25
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_flashing.html15
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_html_mixed_case.html12
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_image_and_canvas.html24
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_image_and_canvas_2.html25
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_links.html42
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_mutation.html42
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_navigation.html28
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_not_displayed.html18
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_pagesize_01.html32
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_pagesize_02.html33
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_pseudo.html11
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_search.html11
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_shadowdom_open_debugger_pretty_printed.html11
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_subgrid.html53
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_svg_attributes.html8
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_toggle.html28
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_tooltip.pngbin0 -> 1095 bytes-rw-r--r--devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_1.html1
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_2.html1
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_view-original-source.html9
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_void_elements.html18
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_void_elements.xhtml21
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_whitespace.html25
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_xul.xhtml9
-rw-r--r--devtools/client/inspector/markup/test/events_bundle.js94
-rw-r--r--devtools/client/inspector/markup/test/events_bundle.js.map1
-rw-r--r--devtools/client/inspector/markup/test/events_original.js15
-rw-r--r--devtools/client/inspector/markup/test/head.js670
-rw-r--r--devtools/client/inspector/markup/test/helper_attributes_test_runner.js161
-rw-r--r--devtools/client/inspector/markup/test/helper_diff.js286
-rw-r--r--devtools/client/inspector/markup/test/helper_events_test_runner.js229
-rw-r--r--devtools/client/inspector/markup/test/helper_markup_accessibility_navigation.js92
-rw-r--r--devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js99
-rw-r--r--devtools/client/inspector/markup/test/helper_style_attr_test_runner.js151
-rw-r--r--devtools/client/inspector/markup/test/lib_babel_6.21.0_min.js24
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.0.js1814
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.1.js2172
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.11.1_min.js4
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.2_min.js32
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.3_min.js19
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.4_min.js151
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.6_min.js16
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_1.7_min.js4
-rw-r--r--devtools/client/inspector/markup/test/lib_jquery_2.1.1_min.js4
-rw-r--r--devtools/client/inspector/markup/test/lib_react_16.2.0_min.js21
-rw-r--r--devtools/client/inspector/markup/test/lib_react_dom_15.3.1_min.js12
-rw-r--r--devtools/client/inspector/markup/test/lib_react_dom_15.4.1.js18239
-rw-r--r--devtools/client/inspector/markup/test/lib_react_dom_16.2.0_min.js193
-rw-r--r--devtools/client/inspector/markup/test/lib_react_with_addons_15.3.1_min.js16
-rw-r--r--devtools/client/inspector/markup/test/lib_react_with_addons_15.4.1.js5408
-rw-r--r--devtools/client/inspector/markup/test/react_external_listeners.js10
-rw-r--r--devtools/client/inspector/markup/test/shadowdom_open_debugger.min.js1
-rw-r--r--devtools/client/inspector/markup/utils.js136
-rw-r--r--devtools/client/inspector/markup/utils/l10n.js15
-rw-r--r--devtools/client/inspector/markup/utils/moz.build9
-rw-r--r--devtools/client/inspector/markup/views/element-container.js257
-rw-r--r--devtools/client/inspector/markup/views/element-editor.js1149
-rw-r--r--devtools/client/inspector/markup/views/html-editor.js177
-rw-r--r--devtools/client/inspector/markup/views/markup-container.js868
-rw-r--r--devtools/client/inspector/markup/views/moz.build19
-rw-r--r--devtools/client/inspector/markup/views/read-only-container.js36
-rw-r--r--devtools/client/inspector/markup/views/read-only-editor.js82
-rw-r--r--devtools/client/inspector/markup/views/root-container.js60
-rw-r--r--devtools/client/inspector/markup/views/slotted-node-container.js76
-rw-r--r--devtools/client/inspector/markup/views/slotted-node-editor.js63
-rw-r--r--devtools/client/inspector/markup/views/text-container.js44
-rw-r--r--devtools/client/inspector/markup/views/text-editor.js143
-rw-r--r--devtools/client/inspector/moz.build35
-rw-r--r--devtools/client/inspector/node-picker.js313
-rw-r--r--devtools/client/inspector/panel.js19
-rw-r--r--devtools/client/inspector/rules/constants.js19
-rw-r--r--devtools/client/inspector/rules/models/class-list.js271
-rw-r--r--devtools/client/inspector/rules/models/element-style.js818
-rw-r--r--devtools/client/inspector/rules/models/moz.build13
-rw-r--r--devtools/client/inspector/rules/models/rule.js831
-rw-r--r--devtools/client/inspector/rules/models/text-property.js400
-rw-r--r--devtools/client/inspector/rules/models/user-properties.js85
-rw-r--r--devtools/client/inspector/rules/moz.build25
-rw-r--r--devtools/client/inspector/rules/rules.js2199
-rw-r--r--devtools/client/inspector/rules/test/browser_part1.ini172
-rw-r--r--devtools/client/inspector/rules/test/browser_part2.ini223
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-and-reselect.js63
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-cancel_01.js54
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-cancel_02.js45
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-cancel_03.js51
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-commented.js50
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-invalid-identifier.js33
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property-svg.js24
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property_01.js31
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-property_02.js78
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-and-property.js31
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-and-remove-style-node.js43
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-button-state.js50
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-csp.js40
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-edit-selector.js54
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-iframes.js53
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-namespace-elements.js40
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-pseudo-class.js64
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-then-property-edit-selector.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule-with-menu.js44
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_add-rule.js46
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_authored.js73
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_authored_color.js78
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_authored_override.js56
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_blob_stylesheet.js26
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_add.js108
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_autocomplete.js266
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_content.js124
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_edit.js56
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_invalid_nodes.js51
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_mutation.js75
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_state_preserved.js41
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_class_panel_toggle.js53
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorUnit.js70
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_color_scheme_simulation.js159
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_color_scheme_simulation_bfcache.js103
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_color_scheme_simulation_meta.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_color_scheme_simulation_rdm.js90
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-and-image-tooltip_01.js73
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-and-image-tooltip_02.js66
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-appears-on-swatch-click-or-keyboard-activation.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-commit-on-ENTER.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-contrast-ratio.js232
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-edit-gradient.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-element-without-quads.js77
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-hides-element-picker.js31
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-hides-on-tooltip.js54
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-multiple-changes.js110
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-release-outside-frame.js79
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-revert-on-ESC.js67
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-swatch-displayed.js101
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-works-with-css-vars.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_colorpicker-wrap-focus.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js148
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js128
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js112
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js137
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-new-property_03.js49
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-new-property_04.js77
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-new-property_multiline.js140
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-on-empty.js60
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-popup-hidden-after-navigation.js41
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_completion-shortcut.js70
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_computed-lists_01.js60
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_computed-lists_02.js86
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_computed-lists_03.js42
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_conditional_import.js117
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_container-queries.js308
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_content_01.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_content_02.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_copy_styles.js359
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_css-compatibility-add-rename-rule.js125
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_css-compatibility-check-add-fix.js134
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_css-compatibility-learn-more-link.js66
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_css-compatibility-toggle-rules.js150
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_css-compatibility-tooltip-telemetry.js58
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_cssom.js32
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_cubicbezier-appears-on-swatch-click.js79
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_cubicbezier-commit-on-ENTER.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_cubicbezier-revert-on-ESC.js67
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_custom.js89
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_cycle-angle.js122
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_cycle-color.js225
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-display-grid-property.js53
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-cancel.js56
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-click.js60
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-commit.js101
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-computed.js108
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js820
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-order.js130
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-remove_01.js66
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-remove_02.js66
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-remove_03.js84
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property-remove_04.js45
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_01.js160
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_02.js143
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_03.js49
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_04.js83
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_05.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_06.js68
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_07.js79
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_08.js62
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_09.js80
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-property_10.js51
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector-click-on-scrollbar.js96
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector-click.js84
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector-commit.js136
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_01.js66
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_02.js92
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_03.js55
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_04.js70
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_05.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_06.js83
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_07.js67
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_08.js78
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_09.js120
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_10.js67
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_11.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-selector_12.js41
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js481
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-value-after-name_01.js119
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-value-after-name_02.js80
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-value-after-name_03.js86
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-value-after-name_04.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-variable-add.js40
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-variable-remove.js42
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_edit-variable.js47
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_editable-field-focus_01.js111
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_editable-field-focus_02.js120
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_eyedropper.js160
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_filtereditor-appears-on-swatch-click.js69
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_filtereditor-commit-on-ENTER.js51
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_filtereditor-revert-on-ESC.js74
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-highlighter-on-mutation.js55
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-highlighter-on-navigate.js46
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-highlighter-on-reload.js57
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-highlighter-restored-after-reload.js69
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-toggle-telemetry.js53
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-toggle_01.js89
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-toggle_01b.js89
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-toggle_02.js114
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-toggle_03.js133
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_flexbox-toggle_04.js89
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_font-family-parsing.js60
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-highlighter-on-mutation.js46
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-highlighter-on-navigate.js42
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-highlighter-on-reload.js55
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-highlighter-restored-after-reload.js83
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-template-areas.js178
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle-telemetry.js42
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle_01.js81
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle_01b.js81
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle_02.js95
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle_03.js137
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle_04.js81
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_grid-toggle_05.js139
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_gridline-names-are-shown-correctly.js146
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_gridline-names-autocomplete.js205
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_guessIndentation.js46
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_highlight-element-rule.js49
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_highlight-property.js94
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_highlight-used-fonts.js125
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_imported_stylesheet_edit.js46
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_display-justify.js47
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_flexbox.js161
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_grid.js267
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_inline.js75
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_split-condition.js31
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_visited.js67
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inactive_css_xul.js43
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inherited-properties_01.js53
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inherited-properties_02.js35
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inherited-properties_03.js49
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inherited-properties_04.js30
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inline-source-map.js25
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_inline-style-order.js86
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_invalid-source-map.js44
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_invalid.js32
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_keybindings.js48
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_keyframeLineNumbers.js24
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_keyframes-rule-shadowdom.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_keyframes-rule_01.js121
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_keyframes-rule_02.js95
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_large_base64_background_image.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_layer.js107
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_lineNumbers.js31
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_linear-easing-swatch.js487
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_livepreview.js76
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_01.js57
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_02.js48
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_03.js33
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_04.js34
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_05.js30
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_06.js65
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_07.js93
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mark_overridden_08.js51
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_mathml-element.js62
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_media-queries.js35
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_media-queries_reload.js67
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_multiple-properties-duplicates.js117
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_multiple-properties-priority.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_multiple-properties-unfinished_01.js99
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_multiple-properties-unfinished_02.js107
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_multiple_properties_01.js84
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_multiple_properties_02.js80
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_nested_at_rules.js85
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_non_ascii.js37
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_original-source-link.js93
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_original-source-link2.js89
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_preview-tooltips-sizes.js106
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_print_media_simulation.js96
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_pseudo-element_01.js395
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_pseudo-element_02.js54
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_pseudo-visited.js31
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_pseudo-visited_in_media-query.js23
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_pseudo-visited_with_style-attribute.js26
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_pseudo_lock_options.js159
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_refresh-no-flicker.js47
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_refresh-on-attribute-change_01.js71
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_refresh-on-style-change.js43
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_01.js180
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_02.js118
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_03.js55
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_04.js75
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_expander.js113
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-media-queries-layers.js195
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter-overridden-property.js89
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_01.js98
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_02.js36
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_03.js39
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_04.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_05.js37
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_06.js29
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_07.js66
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_08.js57
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_09.js79
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_10.js96
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_context-menu.js99
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_search-filter_escape-keypress.js71
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_select-and-copy-styles.js210
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter-iframe-picker.js60
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter-on-navigate.js35
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter_01.js32
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter_02.js48
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter_03.js64
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter_04.js35
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter_05.js46
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector-highlighter_order.js54
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_selector_highlight.js152
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shadowdom_slot_rules.js102
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_01.js82
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_02.js61
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_03.js128
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_04.js48
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_05.js43
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_06.js104
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_07.js99
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shapes-toggle_basic-shapes-default.js102
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shorthand-overridden-lists.js85
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_shorthand-overridden-lists_01.js35
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_strict-search-filter-computed-list_01.js208
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_strict-search-filter_01.js150
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_strict-search-filter_02.js38
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_strict-search-filter_03.js50
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_style-editor-link.js251
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_update_mask_image_cors.js60
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_url-click-opens-new-tab.js35
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_urls-clickable.js77
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_user-agent-styles-uneditable.js62
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_user-agent-styles.js216
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_user-property-reset.js117
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_variables-in-pseudo-element_01.js45
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_variables-in-pseudo-element_02.js44
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_variables_01.js72
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_variables_02.js321
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_variables_03-case-sensitive.js32
-rw-r--r--devtools/client/inspector/rules/test/browser_rules_variables_04-valid-chars.js58
-rw-r--r--devtools/client/inspector/rules/test/doc_author-sheet.html34
-rw-r--r--devtools/client/inspector/rules/test/doc_blob_stylesheet.html39
-rw-r--r--devtools/client/inspector/rules/test/doc_class_panel_autocomplete.html41
-rw-r--r--devtools/client/inspector/rules/test/doc_class_panel_autocomplete_stylesheet.css20
-rw-r--r--devtools/client/inspector/rules/test/doc_conditional_import.css3
-rw-r--r--devtools/client/inspector/rules/test/doc_content_stylesheet.html35
-rw-r--r--devtools/client/inspector/rules/test/doc_content_stylesheet_imported.css5
-rw-r--r--devtools/client/inspector/rules/test/doc_content_stylesheet_imported2.css3
-rw-r--r--devtools/client/inspector/rules/test/doc_content_stylesheet_linked.css3
-rw-r--r--devtools/client/inspector/rules/test/doc_content_stylesheet_script.css5
-rw-r--r--devtools/client/inspector/rules/test/doc_copystyles.css11
-rw-r--r--devtools/client/inspector/rules/test/doc_copystyles.html11
-rw-r--r--devtools/client/inspector/rules/test/doc_cssom.html25
-rw-r--r--devtools/client/inspector/rules/test/doc_custom.html33
-rw-r--r--devtools/client/inspector/rules/test/doc_edit_imported_selector.html13
-rw-r--r--devtools/client/inspector/rules/test/doc_filter.html13
-rw-r--r--devtools/client/inspector/rules/test/doc_grid_area_gridline_names.html59
-rw-r--r--devtools/client/inspector/rules/test/doc_grid_names.html17
-rw-r--r--devtools/client/inspector/rules/test/doc_imported_anonymous_layer.css4
-rw-r--r--devtools/client/inspector/rules/test/doc_imported_named_layer.css12
-rw-r--r--devtools/client/inspector/rules/test/doc_imported_no_layer.css3
-rw-r--r--devtools/client/inspector/rules/test/doc_inactive_css_xul.xhtml15
-rw-r--r--devtools/client/inspector/rules/test/doc_inline_sourcemap.html18
-rw-r--r--devtools/client/inspector/rules/test/doc_invalid_sourcemap.css3
-rw-r--r--devtools/client/inspector/rules/test/doc_invalid_sourcemap.html11
-rw-r--r--devtools/client/inspector/rules/test/doc_keyframeLineNumbers.html45
-rw-r--r--devtools/client/inspector/rules/test/doc_keyframeanimation.css84
-rw-r--r--devtools/client/inspector/rules/test/doc_keyframeanimation.html13
-rw-r--r--devtools/client/inspector/rules/test/doc_media_queries.html42
-rw-r--r--devtools/client/inspector/rules/test/doc_print_media_simulation.html27
-rw-r--r--devtools/client/inspector/rules/test/doc_pseudoelement.html149
-rw-r--r--devtools/client/inspector/rules/test/doc_ruleLineNumbers.html19
-rw-r--r--devtools/client/inspector/rules/test/doc_rules_imported_stylesheet_edit.html4
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps.css7
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps.css.map7
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps.html11
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps.scss10
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps2.css5
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps2.css^headers^1
-rw-r--r--devtools/client/inspector/rules/test/doc_sourcemaps2.html11
-rw-r--r--devtools/client/inspector/rules/test/doc_style_editor_link.css3
-rw-r--r--devtools/client/inspector/rules/test/doc_test_image.pngbin0 -> 580 bytes-rw-r--r--devtools/client/inspector/rules/test/doc_urls_clickable.css9
-rw-r--r--devtools/client/inspector/rules/test/doc_urls_clickable.html30
-rw-r--r--devtools/client/inspector/rules/test/doc_variables_1.html23
-rw-r--r--devtools/client/inspector/rules/test/doc_variables_2.html45
-rw-r--r--devtools/client/inspector/rules/test/doc_variables_3.html16
-rw-r--r--devtools/client/inspector/rules/test/doc_variables_4.html23
-rw-r--r--devtools/client/inspector/rules/test/doc_visited.html27
-rw-r--r--devtools/client/inspector/rules/test/doc_visited_in_media_query.html18
-rw-r--r--devtools/client/inspector/rules/test/doc_visited_with_style_attribute.html9
-rw-r--r--devtools/client/inspector/rules/test/head.js1284
-rw-r--r--devtools/client/inspector/rules/test/sjs_imported_stylesheet_edit.sjs53
-rw-r--r--devtools/client/inspector/rules/test/square_svg.sjs13
-rw-r--r--devtools/client/inspector/rules/types.js165
-rw-r--r--devtools/client/inspector/rules/utils/l10n.js15
-rw-r--r--devtools/client/inspector/rules/utils/moz.build10
-rw-r--r--devtools/client/inspector/rules/utils/utils.js357
-rw-r--r--devtools/client/inspector/rules/views/class-list-previewer.js310
-rw-r--r--devtools/client/inspector/rules/views/moz.build9
-rw-r--r--devtools/client/inspector/rules/views/rule-editor.js842
-rw-r--r--devtools/client/inspector/rules/views/text-property-editor.js1598
-rw-r--r--devtools/client/inspector/shared/highlighters-overlay.js2007
-rw-r--r--devtools/client/inspector/shared/moz.build18
-rw-r--r--devtools/client/inspector/shared/node-reps.js47
-rw-r--r--devtools/client/inspector/shared/node-types.js21
-rw-r--r--devtools/client/inspector/shared/style-change-tracker.js100
-rw-r--r--devtools/client/inspector/shared/style-inspector-menu.js502
-rw-r--r--devtools/client/inspector/shared/test/browser.ini28
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_context-menu-copy-color_01.js85
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_context-menu-copy-color_02.js112
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_context-menu-copy-urls.js160
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_output-parser.js351
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_refresh_when_active.js50
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_refresh_when_style_changes.js99
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_tooltip-background-image.js150
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_tooltip-closes-on-new-selection.js80
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_tooltip-longhand-fontfamily.js178
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_tooltip-multiple-background-images.js68
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_tooltip-shorthand-fontfamily.js73
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_tooltip-size.js86
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_transform-highlighter-01.js53
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_transform-highlighter-02.js63
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_transform-highlighter-03.js115
-rw-r--r--devtools/client/inspector/shared/test/browser_styleinspector_transform-highlighter-04.js63
-rw-r--r--devtools/client/inspector/shared/test/doc_content_style_changes.html28
-rw-r--r--devtools/client/inspector/shared/test/head.js218
-rw-r--r--devtools/client/inspector/shared/tooltips-overlay.js546
-rw-r--r--devtools/client/inspector/shared/utils.js239
-rw-r--r--devtools/client/inspector/shared/walker-event-listener.js86
-rw-r--r--devtools/client/inspector/store.js56
-rw-r--r--devtools/client/inspector/test/browser.ini255
-rw-r--r--devtools/client/inspector/test/browser_inspector_addNode_01.js22
-rw-r--r--devtools/client/inspector/test/browser_inspector_addNode_02.js76
-rw-r--r--devtools/client/inspector/test/browser_inspector_addNode_03.js93
-rw-r--r--devtools/client/inspector/test/browser_inspector_addSidebarTab.js63
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs.js191
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_highlight_hover.js69
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_keybinding.js82
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_keyboard_trap.js92
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_mutations.js282
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_namespaced.js70
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_shadowdom.js107
-rw-r--r--devtools/client/inspector/test/browser_inspector_breadcrumbs_visibility.js114
-rw-r--r--devtools/client/inspector/test/browser_inspector_delete-selected-node-01.js29
-rw-r--r--devtools/client/inspector/test/browser_inspector_delete-selected-node-02.js145
-rw-r--r--devtools/client/inspector/test/browser_inspector_delete-selected-node-03.js24
-rw-r--r--devtools/client/inspector/test/browser_inspector_delete_node_in_frame.js33
-rw-r--r--devtools/client/inspector/test/browser_inspector_destroy-after-navigation.js23
-rw-r--r--devtools/client/inspector/test/browser_inspector_destroy-before-ready.js26
-rw-r--r--devtools/client/inspector/test/browser_inspector_expand-collapse.js68
-rw-r--r--devtools/client/inspector/test/browser_inspector_eyedropper_ruleview.js50
-rw-r--r--devtools/client/inspector/test/browser_inspector_fission_frame.js38
-rw-r--r--devtools/client/inspector/test/browser_inspector_fission_frame_navigation.js163
-rw-r--r--devtools/client/inspector/test/browser_inspector_fission_switch_target.js31
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-01.js43
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-02.js49
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-03.js125
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-04.js55
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-05.js72
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-06.js39
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-07.js90
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-08.js67
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_01.js36
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_02.js45
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_03.js68
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-autohide.js76
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-by-type.js65
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cancel.js94
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-comments.js119
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssgrid_01.js91
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssgrid_02.js51
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_01.js95
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_02.js157
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_03.js116
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_04.js453
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_05.js158
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_06-scale.js187
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_06-translate.js127
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_07.js179
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-cssshape_iframe_01.js97
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-csstransform_01.js229
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-csstransform_02.js69
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-custom-element.js30
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-embed.js32
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js63
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-csp.js39
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-events.js184
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-frames.js94
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-image.js18
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-label.js145
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-show-hide.js41
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-xul.js74
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-zoom.js89
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_01.js96
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_02.js125
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_03.js72
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_04.js103
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_05.js140
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_06.js166
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_hide_on_interaction.js80
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-geometry_iframe.js48
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-hover_01.js34
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-hover_02.js44
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-hover_03.js60
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js90
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-iframes_02.js80
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-inline.js95
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-keybinding_01.js71
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-keybinding_02.js64
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-keybinding_03.js69
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-keybinding_04.js39
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-keybinding_separate-window.js120
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-measure_01.js92
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-measure_02.js138
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-measure_03.js114
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-measure_04.js208
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-options.js267
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-preview.js67
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-reduced-motion-message.js104
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-reduced-motion.js89
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-reload.js36
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-rulers_01.js116
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-rulers_02.js201
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-rulers_03.js117
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-selector_01.js80
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-selector_02.js84
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-zoom.js81
-rw-r--r--devtools/client/inspector/test/browser_inspector_iframe-navigation.js58
-rw-r--r--devtools/client/inspector/test/browser_inspector_iframe-picker-bfcache-navigation.js121
-rw-r--r--devtools/client/inspector/test/browser_inspector_iframe-picker.js131
-rw-r--r--devtools/client/inspector/test/browser_inspector_infobar_01.js113
-rw-r--r--devtools/client/inspector/test/browser_inspector_infobar_02.js53
-rw-r--r--devtools/client/inspector/test/browser_inspector_infobar_03.js59
-rw-r--r--devtools/client/inspector/test/browser_inspector_infobar_04.js45
-rw-r--r--devtools/client/inspector/test/browser_inspector_infobar_05.js119
-rw-r--r--devtools/client/inspector/test/browser_inspector_infobar_textnode.js53
-rw-r--r--devtools/client/inspector/test/browser_inspector_initialization.js114
-rw-r--r--devtools/client/inspector/test/browser_inspector_inspect-object-element.js18
-rw-r--r--devtools/client/inspector/test/browser_inspector_inspect_loading_document.js168
-rw-r--r--devtools/client/inspector/test/browser_inspector_inspect_mutated_node.js72
-rw-r--r--devtools/client/inspector/test/browser_inspector_inspect_node_contextmenu.js140
-rw-r--r--devtools/client/inspector/test/browser_inspector_inspect_node_contextmenu_nested.js152
-rw-r--r--devtools/client/inspector/test/browser_inspector_inspect_parent_process_page.js29
-rw-r--r--devtools/client/inspector/test/browser_inspector_invalidate.js44
-rw-r--r--devtools/client/inspector/test/browser_inspector_keyboard-shortcuts-copy-outerhtml.js53
-rw-r--r--devtools/client/inspector/test/browser_inspector_keyboard-shortcuts.js54
-rw-r--r--devtools/client/inspector/test/browser_inspector_menu-01-sensitivity.js388
-rw-r--r--devtools/client/inspector/test/browser_inspector_menu-03-paste-items-svg.js46
-rw-r--r--devtools/client/inspector/test/browser_inspector_menu-03-paste-items.js166
-rw-r--r--devtools/client/inspector/test/browser_inspector_menu-04-use-in-console.js57
-rw-r--r--devtools/client/inspector/test/browser_inspector_menu-05-attribute-items.js124
-rw-r--r--devtools/client/inspector/test/browser_inspector_menu-06-other.js160
-rw-r--r--devtools/client/inspector/test/browser_inspector_navigate_to_errors.js69
-rw-r--r--devtools/client/inspector/test/browser_inspector_navigation.js88
-rw-r--r--devtools/client/inspector/test/browser_inspector_open_on_neterror.js41
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-01.js36
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-02.js85
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-03.js60
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-04.js55
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-05.js106
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-layout-invariant.js32
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane_state_restore.js75
-rw-r--r--devtools/client/inspector/test/browser_inspector_picker-reset-reference.js69
-rw-r--r--devtools/client/inspector/test/browser_inspector_picker-shift-key.js94
-rw-r--r--devtools/client/inspector/test/browser_inspector_picker-stop-on-eyedropper.js46
-rw-r--r--devtools/client/inspector/test/browser_inspector_picker-stop-on-tool-change.js27
-rw-r--r--devtools/client/inspector/test/browser_inspector_picker-useragent-widget.js73
-rw-r--r--devtools/client/inspector/test/browser_inspector_portrait_mode.js82
-rw-r--r--devtools/client/inspector/test/browser_inspector_pseudoclass-lock.js235
-rw-r--r--devtools/client/inspector/test/browser_inspector_pseudoclass-menu.js60
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload-01.js30
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload-02.js47
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload_iframe.js48
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload_invalid_iframe.js63
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload_missing-iframe-node.js58
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload_nested_iframe.js50
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload_shadow_dom.js61
-rw-r--r--devtools/client/inspector/test/browser_inspector_reload_xul.js50
-rw-r--r--devtools/client/inspector/test/browser_inspector_remove-iframe-during-load.js83
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-01.js110
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-02.js155
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-03.js228
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-04.js115
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-05.js107
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-06.js103
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-07.js60
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-08.js75
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-09.js112
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-10.js51
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-clear.js59
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js109
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-label.js33
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-navigation.js73
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-reserved.js137
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-selection.js83
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-sidebar.js87
-rw-r--r--devtools/client/inspector/test/browser_inspector_search-suggests-ids-and-classes.js154
-rw-r--r--devtools/client/inspector/test/browser_inspector_search_keyboard_shortcut_conflict.js59
-rw-r--r--devtools/client/inspector/test/browser_inspector_search_keyboard_trap.js95
-rw-r--r--devtools/client/inspector/test/browser_inspector_select-last-selected.js75
-rw-r--r--devtools/client/inspector/test/browser_inspector_sidebarstate.js135
-rw-r--r--devtools/client/inspector/test/browser_inspector_startup.js84
-rw-r--r--devtools/client/inspector/test/browser_inspector_switch-to-inspector-on-pick.js123
-rw-r--r--devtools/client/inspector/test/browser_inspector_textbox-menu.js103
-rw-r--r--devtools/client/inspector/test/browser_inspector_textbox-menu_reopen_toolbox.js51
-rw-r--r--devtools/client/inspector/test/doc_inspector_add_node.html22
-rw-r--r--devtools/client/inspector/test/doc_inspector_breadcrumbs.html75
-rw-r--r--devtools/client/inspector/test/doc_inspector_breadcrumbs_visibility.html22
-rw-r--r--devtools/client/inspector/test/doc_inspector_csp.html9
-rw-r--r--devtools/client/inspector/test/doc_inspector_csp.html^headers^2
-rw-r--r--devtools/client/inspector/test/doc_inspector_delete-selected-node-01.html4
-rw-r--r--devtools/client/inspector/test/doc_inspector_delete-selected-node-02.html20
-rw-r--r--devtools/client/inspector/test/doc_inspector_embed.html6
-rw-r--r--devtools/client/inspector/test/doc_inspector_eyedropper_disabled.xhtml3
-rw-r--r--devtools/client/inspector/test/doc_inspector_fission_frame_navigation.html15
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlight_after_transition.html26
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter-comments.html19
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter-geometry_01.html90
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter-geometry_02.html120
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter.html40
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_cssshapes.html89
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_cssshapes_iframe.html11
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_csstransform.html25
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_custom_element.xhtml20
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_dom.html20
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_inline.html36
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_rect.html22
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_rect_iframe.html15
-rw-r--r--devtools/client/inspector/test/doc_inspector_highlighter_scroll.html15
-rw-r--r--devtools/client/inspector/test/doc_inspector_infobar.html43
-rw-r--r--devtools/client/inspector/test/doc_inspector_infobar_01.html44
-rw-r--r--devtools/client/inspector/test/doc_inspector_infobar_02.html34
-rw-r--r--devtools/client/inspector/test/doc_inspector_infobar_03.html14
-rw-r--r--devtools/client/inspector/test/doc_inspector_infobar_04.html41
-rw-r--r--devtools/client/inspector/test/doc_inspector_infobar_textnode.html14
-rw-r--r--devtools/client/inspector/test/doc_inspector_long-divs.html104
-rw-r--r--devtools/client/inspector/test/doc_inspector_menu.html38
-rw-r--r--devtools/client/inspector/test/doc_inspector_outerhtml.html11
-rw-r--r--devtools/client/inspector/test/doc_inspector_pane-toggle-layout-invariant.html27
-rw-r--r--devtools/client/inspector/test/doc_inspector_reload_xul.xhtml9
-rw-r--r--devtools/client/inspector/test/doc_inspector_remove-iframe-during-load.html44
-rw-r--r--devtools/client/inspector/test/doc_inspector_search-iframes.html13
-rw-r--r--devtools/client/inspector/test/doc_inspector_search-reserved.html11
-rw-r--r--devtools/client/inspector/test/doc_inspector_search-suggestions.html27
-rw-r--r--devtools/client/inspector/test/doc_inspector_search-svg.html16
-rw-r--r--devtools/client/inspector/test/doc_inspector_search.html26
-rw-r--r--devtools/client/inspector/test/doc_inspector_select-last-selected-01.html21
-rw-r--r--devtools/client/inspector/test/doc_inspector_select-last-selected-02.html10
-rw-r--r--devtools/client/inspector/test/doc_inspector_svg.svg3
-rw-r--r--devtools/client/inspector/test/head.js1459
-rw-r--r--devtools/client/inspector/test/img_browser_inspector_highlighter-eyedropper-image.pngbin0 -> 522 bytes-rw-r--r--devtools/client/inspector/test/shared-head.js1002
-rw-r--r--devtools/client/inspector/test/sjs_slow-loading-image.sjs33
-rw-r--r--devtools/client/inspector/test/style_inspector_csp.css3
-rw-r--r--devtools/client/inspector/test/style_inspector_eyedropper_ruleview.css3
-rw-r--r--devtools/client/inspector/toolsidebar.js326
-rw-r--r--devtools/client/jar.mn467
-rw-r--r--devtools/client/jsonview/.eslintrc.js15
-rw-r--r--devtools/client/jsonview/Converter.sys.mjs17
-rw-r--r--devtools/client/jsonview/Sniffer.sys.mjs64
-rw-r--r--devtools/client/jsonview/components.conf26
-rw-r--r--devtools/client/jsonview/components/Headers.js118
-rw-r--r--devtools/client/jsonview/components/HeadersPanel.js56
-rw-r--r--devtools/client/jsonview/components/HeadersToolbar.js51
-rw-r--r--devtools/client/jsonview/components/JsonPanel.js163
-rw-r--r--devtools/client/jsonview/components/JsonToolbar.js92
-rw-r--r--devtools/client/jsonview/components/LiveText.js43
-rw-r--r--devtools/client/jsonview/components/MainTabbedArea.js120
-rw-r--r--devtools/client/jsonview/components/SearchBox.js102
-rw-r--r--devtools/client/jsonview/components/TextPanel.js52
-rw-r--r--devtools/client/jsonview/components/TextToolbar.js80
-rw-r--r--devtools/client/jsonview/components/moz.build20
-rw-r--r--devtools/client/jsonview/components/reps/Toolbar.js48
-rw-r--r--devtools/client/jsonview/components/reps/moz.build9
-rw-r--r--devtools/client/jsonview/converter-child.js419
-rw-r--r--devtools/client/jsonview/css/general.css48
-rw-r--r--devtools/client/jsonview/css/headers-panel.css66
-rw-r--r--devtools/client/jsonview/css/json-panel.css18
-rw-r--r--devtools/client/jsonview/css/main.css44
-rw-r--r--devtools/client/jsonview/css/moz.build15
-rw-r--r--devtools/client/jsonview/css/search-box.css20
-rw-r--r--devtools/client/jsonview/css/text-panel.css18
-rw-r--r--devtools/client/jsonview/css/toolbar.css39
-rw-r--r--devtools/client/jsonview/json-viewer.js203
-rw-r--r--devtools/client/jsonview/lib/moz.build7
-rw-r--r--devtools/client/jsonview/lib/require.js2080
-rw-r--r--devtools/client/jsonview/moz.build24
-rw-r--r--devtools/client/jsonview/test/array_json.json1
-rw-r--r--devtools/client/jsonview/test/array_json.json^headers^1
-rw-r--r--devtools/client/jsonview/test/browser.ini59
-rw-r--r--devtools/client/jsonview/test/browser_json_refresh.js97
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_bug_1380828.js32
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_chunked_json.js121
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_content_type.js100
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_copy_headers.js38
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_copy_json.js34
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_copy_rawdata.js62
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_csp_json.js33
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_data_blocking.js174
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_empty_object.js48
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_encoding.js67
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_expand_collapse.js61
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_filter.js27
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_filter_clear.js85
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_ignore_charset.js18
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_initial_focus.js33
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_invalid_json.js18
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_manifest.js15
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_nojs.js26
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_nul.js15
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_object-type.js25
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_row_selection.js245
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_save_json.js159
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_serviceworker.js89
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_slash.js16
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_theme.js29
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_url_linkification.js88
-rw-r--r--devtools/client/jsonview/test/browser_jsonview_valid_json.js46
-rw-r--r--devtools/client/jsonview/test/chunked_json.sjs39
-rw-r--r--devtools/client/jsonview/test/csp_json.json1
-rw-r--r--devtools/client/jsonview/test/csp_json.json^headers^2
-rw-r--r--devtools/client/jsonview/test/empty.html1
-rw-r--r--devtools/client/jsonview/test/head.js278
-rw-r--r--devtools/client/jsonview/test/invalid_json.json1
-rw-r--r--devtools/client/jsonview/test/invalid_json.json^headers^1
-rw-r--r--devtools/client/jsonview/test/manifest_json.json49
-rw-r--r--devtools/client/jsonview/test/manifest_json.json^headers^1
-rw-r--r--devtools/client/jsonview/test/passthrough-sw.js5
-rw-r--r--devtools/client/jsonview/test/simple_json.json1
-rw-r--r--devtools/client/jsonview/test/simple_json.json^headers^1
-rw-r--r--devtools/client/jsonview/test/valid_json.json6
-rw-r--r--devtools/client/jsonview/test/valid_json.json^headers^1
-rw-r--r--devtools/client/jsonview/viewer-config.js46
-rw-r--r--devtools/client/locales/en-US/aboutdebugging.ftl405
-rw-r--r--devtools/client/locales/en-US/accessibility.ftl78
-rw-r--r--devtools/client/locales/en-US/accessibility.properties306
-rw-r--r--devtools/client/locales/en-US/animationinspector.properties182
-rw-r--r--devtools/client/locales/en-US/application.ftl151
-rw-r--r--devtools/client/locales/en-US/boxmodel.properties47
-rw-r--r--devtools/client/locales/en-US/changes.properties64
-rw-r--r--devtools/client/locales/en-US/compatibility.ftl52
-rw-r--r--devtools/client/locales/en-US/components.properties49
-rw-r--r--devtools/client/locales/en-US/debugger.properties1070
-rw-r--r--devtools/client/locales/en-US/device.properties21
-rw-r--r--devtools/client/locales/en-US/dom.properties19
-rw-r--r--devtools/client/locales/en-US/filterwidget.properties61
-rw-r--r--devtools/client/locales/en-US/font-inspector.properties69
-rw-r--r--devtools/client/locales/en-US/har.properties21
-rw-r--r--devtools/client/locales/en-US/inspector.properties575
-rw-r--r--devtools/client/locales/en-US/jsonview.properties45
-rw-r--r--devtools/client/locales/en-US/layout.properties129
-rw-r--r--devtools/client/locales/en-US/memory.properties426
-rw-r--r--devtools/client/locales/en-US/menus.properties29
-rw-r--r--devtools/client/locales/en-US/netmonitor.properties1631
-rw-r--r--devtools/client/locales/en-US/network-throttling.properties27
-rw-r--r--devtools/client/locales/en-US/perftools.ftl155
-rw-r--r--devtools/client/locales/en-US/responsive.properties173
-rw-r--r--devtools/client/locales/en-US/shared.properties26
-rw-r--r--devtools/client/locales/en-US/sourceeditor.properties107
-rw-r--r--devtools/client/locales/en-US/startup.properties247
-rw-r--r--devtools/client/locales/en-US/storage.ftl131
-rw-r--r--devtools/client/locales/en-US/styleeditor.ftl42
-rw-r--r--devtools/client/locales/en-US/styleeditor.properties74
-rw-r--r--devtools/client/locales/en-US/toolbox-options.ftl152
-rw-r--r--devtools/client/locales/en-US/toolbox.ftl50
-rw-r--r--devtools/client/locales/en-US/toolbox.properties266
-rw-r--r--devtools/client/locales/en-US/tooltips.ftl117
-rw-r--r--devtools/client/locales/en-US/webconsole.properties565
-rw-r--r--devtools/client/locales/jar.mn13
-rw-r--r--devtools/client/locales/l10n.ini12
-rw-r--r--devtools/client/locales/l10n.toml12
-rw-r--r--devtools/client/locales/moz.build7
-rw-r--r--devtools/client/memory/.eslintrc.js15
-rw-r--r--devtools/client/memory/actions/allocations.js32
-rw-r--r--devtools/client/memory/actions/census-display.js39
-rw-r--r--devtools/client/memory/actions/diffing.js221
-rw-r--r--devtools/client/memory/actions/filter.js33
-rw-r--r--devtools/client/memory/actions/front.js17
-rw-r--r--devtools/client/memory/actions/io.js103
-rw-r--r--devtools/client/memory/actions/label-display.js43
-rw-r--r--devtools/client/memory/actions/moz.build20
-rw-r--r--devtools/client/memory/actions/refresh.js49
-rw-r--r--devtools/client/memory/actions/sizes.js13
-rw-r--r--devtools/client/memory/actions/snapshot.js939
-rw-r--r--devtools/client/memory/actions/task-cache.js105
-rw-r--r--devtools/client/memory/actions/tree-map-display.js42
-rw-r--r--devtools/client/memory/actions/view.js69
-rw-r--r--devtools/client/memory/app.js441
-rw-r--r--devtools/client/memory/components/Census.js94
-rw-r--r--devtools/client/memory/components/CensusHeader.js79
-rw-r--r--devtools/client/memory/components/CensusTreeItem.js185
-rw-r--r--devtools/client/memory/components/DominatorTree.js250
-rw-r--r--devtools/client/memory/components/DominatorTreeHeader.js51
-rw-r--r--devtools/client/memory/components/DominatorTreeItem.js174
-rw-r--r--devtools/client/memory/components/Heap.js547
-rw-r--r--devtools/client/memory/components/Individuals.js70
-rw-r--r--devtools/client/memory/components/IndividualsHeader.js51
-rw-r--r--devtools/client/memory/components/List.js46
-rw-r--r--devtools/client/memory/components/ShortestPaths.js196
-rw-r--r--devtools/client/memory/components/SnapshotListItem.js142
-rw-r--r--devtools/client/memory/components/Toolbar.js309
-rw-r--r--devtools/client/memory/components/TreeMap.js77
-rw-r--r--devtools/client/memory/components/moz.build25
-rw-r--r--devtools/client/memory/components/tree-map/canvas-utils.js132
-rw-r--r--devtools/client/memory/components/tree-map/color-coarse-type.js70
-rw-r--r--devtools/client/memory/components/tree-map/drag-zoom.js337
-rw-r--r--devtools/client/memory/components/tree-map/draw.js317
-rw-r--r--devtools/client/memory/components/tree-map/moz.build12
-rw-r--r--devtools/client/memory/components/tree-map/start.js40
-rw-r--r--devtools/client/memory/constants.js360
-rw-r--r--devtools/client/memory/dominator-tree-lazy-children.js60
-rw-r--r--devtools/client/memory/index.xhtml49
-rw-r--r--devtools/client/memory/initializer.js85
-rw-r--r--devtools/client/memory/models.js546
-rw-r--r--devtools/client/memory/moz.build29
-rw-r--r--devtools/client/memory/panel.js74
-rw-r--r--devtools/client/memory/reducers.js17
-rw-r--r--devtools/client/memory/reducers/allocations.js54
-rw-r--r--devtools/client/memory/reducers/census-display.js24
-rw-r--r--devtools/client/memory/reducers/diffing.js175
-rw-r--r--devtools/client/memory/reducers/errors.js21
-rw-r--r--devtools/client/memory/reducers/filter.js14
-rw-r--r--devtools/client/memory/reducers/front.js11
-rw-r--r--devtools/client/memory/reducers/individuals.js84
-rw-r--r--devtools/client/memory/reducers/label-display.js22
-rw-r--r--devtools/client/memory/reducers/moz.build19
-rw-r--r--devtools/client/memory/reducers/sizes.js20
-rw-r--r--devtools/client/memory/reducers/snapshots.js517
-rw-r--r--devtools/client/memory/reducers/tree-map-display.js22
-rw-r--r--devtools/client/memory/reducers/view.js52
-rw-r--r--devtools/client/memory/store.js15
-rw-r--r--devtools/client/memory/test/browser/browser.ini37
-rw-r--r--devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_01.js52
-rw-r--r--devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js51
-rw-r--r--devtools/client/memory/test/browser/browser_memory_clear_snapshots.js78
-rw-r--r--devtools/client/memory/test/browser/browser_memory_diff_01.js86
-rw-r--r--devtools/client/memory/test/browser/browser_memory_displays_01.js49
-rw-r--r--devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js178
-rw-r--r--devtools/client/memory/test/browser/browser_memory_dominator_trees_02.js81
-rw-r--r--devtools/client/memory/test/browser/browser_memory_filter_01.js107
-rw-r--r--devtools/client/memory/test/browser/browser_memory_fission_switch_target.js79
-rw-r--r--devtools/client/memory/test/browser/browser_memory_individuals_01.js74
-rw-r--r--devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js112
-rw-r--r--devtools/client/memory/test/browser/browser_memory_keyboard.js111
-rw-r--r--devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js54
-rw-r--r--devtools/client/memory/test/browser/browser_memory_no_auto_expand.js49
-rw-r--r--devtools/client/memory/test/browser/browser_memory_percents_01.js62
-rw-r--r--devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js139
-rw-r--r--devtools/client/memory/test/browser/browser_memory_simple_01.js60
-rw-r--r--devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js34
-rw-r--r--devtools/client/memory/test/browser/browser_memory_tree_map-01.js136
-rw-r--r--devtools/client/memory/test/browser/browser_memory_tree_map-02.js199
-rw-r--r--devtools/client/memory/test/browser/doc_big_tree.html20
-rw-r--r--devtools/client/memory/test/browser/doc_empty.html9
-rw-r--r--devtools/client/memory/test/browser/doc_steady_allocation.html21
-rw-r--r--devtools/client/memory/test/browser/head.js269
-rw-r--r--devtools/client/memory/test/chrome/chrome.ini20
-rw-r--r--devtools/client/memory/test/chrome/head.js354
-rw-r--r--devtools/client/memory/test/chrome/test_CensusTreeItem_01.html65
-rw-r--r--devtools/client/memory/test/chrome/test_DominatorTreeItem_01.html46
-rw-r--r--devtools/client/memory/test/chrome/test_DominatorTree_01.html52
-rw-r--r--devtools/client/memory/test/chrome/test_DominatorTree_02.html52
-rw-r--r--devtools/client/memory/test/chrome/test_DominatorTree_03.html77
-rw-r--r--devtools/client/memory/test/chrome/test_Heap_01.html51
-rw-r--r--devtools/client/memory/test/chrome/test_Heap_02.html78
-rw-r--r--devtools/client/memory/test/chrome/test_Heap_03.html79
-rw-r--r--devtools/client/memory/test/chrome/test_Heap_04.html122
-rw-r--r--devtools/client/memory/test/chrome/test_Heap_05.html133
-rw-r--r--devtools/client/memory/test/chrome/test_List_01.html73
-rw-r--r--devtools/client/memory/test/chrome/test_ShortestPaths_01.html112
-rw-r--r--devtools/client/memory/test/chrome/test_ShortestPaths_02.html46
-rw-r--r--devtools/client/memory/test/chrome/test_SnapshotListItem_01.html53
-rw-r--r--devtools/client/memory/test/chrome/test_Toolbar_01.html48
-rw-r--r--devtools/client/memory/test/chrome/test_TreeMap_01.html44
-rw-r--r--devtools/client/memory/test/xpcshell/.eslintrc.js14
-rw-r--r--devtools/client/memory/test/xpcshell/head.js187
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-clear-snapshots_01.js41
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-clear-snapshots_02.js61
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-clear-snapshots_03.js52
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-clear-snapshots_04.js55
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-clear-snapshots_05.js53
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-clear-snapshots_06.js64
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-export-snapshot.js45
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-filter-01.js23
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-filter-02.js88
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-filter-03.js69
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-import-snapshot-and-census.js135
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-import-snapshot-dominator-tree.js100
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-select-snapshot.js46
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-set-display-and-refresh-01.js182
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-set-display-and-refresh-02.js74
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-set-display.js74
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-take-census.js70
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-take-snapshot-and-census.js65
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-take-snapshot.js61
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-toggle-inverted-and-refresh-01.js98
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-toggle-inverted-and-refresh-02.js82
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-toggle-inverted.js31
-rw-r--r--devtools/client/memory/test/xpcshell/test_action-toggle-recording-allocations.js53
-rw-r--r--devtools/client/memory/test/xpcshell/test_action_diffing_01.js29
-rw-r--r--devtools/client/memory/test/xpcshell/test_action_diffing_02.js59
-rw-r--r--devtools/client/memory/test/xpcshell/test_action_diffing_03.js147
-rw-r--r--devtools/client/memory/test/xpcshell/test_action_diffing_04.js101
-rw-r--r--devtools/client/memory/test/xpcshell/test_action_diffing_05.js134
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_01.js79
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_02.js80
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_03.js77
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_04.js91
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_05.js66
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_06.js152
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_07.js174
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_08.js100
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_09.js92
-rw-r--r--devtools/client/memory/test/xpcshell/test_dominator_trees_10.js95
-rw-r--r--devtools/client/memory/test/xpcshell/test_individuals_01.js77
-rw-r--r--devtools/client/memory/test/xpcshell/test_individuals_02.js91
-rw-r--r--devtools/client/memory/test/xpcshell/test_individuals_03.js114
-rw-r--r--devtools/client/memory/test/xpcshell/test_individuals_04.js93
-rw-r--r--devtools/client/memory/test/xpcshell/test_individuals_05.js84
-rw-r--r--devtools/client/memory/test/xpcshell/test_individuals_06.js85
-rw-r--r--devtools/client/memory/test/xpcshell/test_pop_view_01.js80
-rw-r--r--devtools/client/memory/test/xpcshell/test_tree-map-01.js76
-rw-r--r--devtools/client/memory/test/xpcshell/test_tree-map-02.js105
-rw-r--r--devtools/client/memory/test/xpcshell/test_utils-get-snapshot-totals.js103
-rw-r--r--devtools/client/memory/test/xpcshell/test_utils.js116
-rw-r--r--devtools/client/memory/test/xpcshell/xpcshell.ini58
-rw-r--r--devtools/client/memory/utils.js547
-rw-r--r--devtools/client/menus.js188
-rw-r--r--devtools/client/moz.build47
-rw-r--r--devtools/client/netmonitor/docs/architecture.md30
-rw-r--r--devtools/client/netmonitor/index.html17
-rw-r--r--devtools/client/netmonitor/initializer.js109
-rw-r--r--devtools/client/netmonitor/moz.build19
-rw-r--r--devtools/client/netmonitor/panel.js37
-rw-r--r--devtools/client/netmonitor/src/actions/batching.js50
-rw-r--r--devtools/client/netmonitor/src/actions/filters.js58
-rw-r--r--devtools/client/netmonitor/src/actions/http-custom-request.js128
-rw-r--r--devtools/client/netmonitor/src/actions/index.js32
-rw-r--r--devtools/client/netmonitor/src/actions/messages.js188
-rw-r--r--devtools/client/netmonitor/src/actions/moz.build18
-rw-r--r--devtools/client/netmonitor/src/actions/request-blocking.js155
-rw-r--r--devtools/client/netmonitor/src/actions/requests.js183
-rw-r--r--devtools/client/netmonitor/src/actions/search.js316
-rw-r--r--devtools/client/netmonitor/src/actions/selection.js80
-rw-r--r--devtools/client/netmonitor/src/actions/sort.js20
-rw-r--r--devtools/client/netmonitor/src/actions/timing-markers.js22
-rw-r--r--devtools/client/netmonitor/src/actions/ui.js257
-rw-r--r--devtools/client/netmonitor/src/api.js216
-rw-r--r--devtools/client/netmonitor/src/app.js135
-rw-r--r--devtools/client/netmonitor/src/assets/icons/arrow-up.svg6
-rw-r--r--devtools/client/netmonitor/src/assets/icons/play.svg8
-rw-r--r--devtools/client/netmonitor/src/assets/icons/shield.svg6
-rw-r--r--devtools/client/netmonitor/src/assets/icons/turtle.svg6
-rw-r--r--devtools/client/netmonitor/src/assets/styles/CustomRequestPanel.css181
-rw-r--r--devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css379
-rw-r--r--devtools/client/netmonitor/src/assets/styles/HeadersPanel.css210
-rw-r--r--devtools/client/netmonitor/src/assets/styles/NetworkActionBar.css11
-rw-r--r--devtools/client/netmonitor/src/assets/styles/NetworkDetailsBar.css574
-rw-r--r--devtools/client/netmonitor/src/assets/styles/RequestBlockingPanel.css184
-rw-r--r--devtools/client/netmonitor/src/assets/styles/RequestList.css653
-rw-r--r--devtools/client/netmonitor/src/assets/styles/StatisticsPanel.css171
-rw-r--r--devtools/client/netmonitor/src/assets/styles/StatusBar.css62
-rw-r--r--devtools/client/netmonitor/src/assets/styles/StatusCode.css100
-rw-r--r--devtools/client/netmonitor/src/assets/styles/Toolbar.css102
-rw-r--r--devtools/client/netmonitor/src/assets/styles/UrlPreview.css100
-rw-r--r--devtools/client/netmonitor/src/assets/styles/messages.css165
-rw-r--r--devtools/client/netmonitor/src/assets/styles/netmonitor.css84
-rw-r--r--devtools/client/netmonitor/src/assets/styles/search.css155
-rw-r--r--devtools/client/netmonitor/src/assets/styles/variables.css45
-rw-r--r--devtools/client/netmonitor/src/components/App.js119
-rw-r--r--devtools/client/netmonitor/src/components/CustomRequestPanel.js371
-rw-r--r--devtools/client/netmonitor/src/components/DropHarHandler.js141
-rw-r--r--devtools/client/netmonitor/src/components/MonitorPanel.js271
-rw-r--r--devtools/client/netmonitor/src/components/NetworkActionBar.js136
-rw-r--r--devtools/client/netmonitor/src/components/SecurityState.js78
-rw-r--r--devtools/client/netmonitor/src/components/SourceEditor.js137
-rw-r--r--devtools/client/netmonitor/src/components/StatisticsPanel.js413
-rw-r--r--devtools/client/netmonitor/src/components/StatusBar.js175
-rw-r--r--devtools/client/netmonitor/src/components/StatusCode.js129
-rw-r--r--devtools/client/netmonitor/src/components/TabboxPanel.js242
-rw-r--r--devtools/client/netmonitor/src/components/Toolbar.js688
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnData.js60
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnEventName.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnFinBit.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnLastEventId.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnMaskBit.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnOpCode.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnRetry.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnSize.js43
-rw-r--r--devtools/client/netmonitor/src/components/messages/ColumnTime.js56
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessageFilterMenu.js122
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessageListContent.js398
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessageListContextMenu.js62
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessageListHeader.js121
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessageListHeaderContextMenu.js61
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessageListItem.js127
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessagePayload.js403
-rw-r--r--devtools/client/netmonitor/src/components/messages/MessagesView.js173
-rw-r--r--devtools/client/netmonitor/src/components/messages/RawData.js34
-rw-r--r--devtools/client/netmonitor/src/components/messages/StatusBar.js130
-rw-r--r--devtools/client/netmonitor/src/components/messages/Toolbar.js152
-rw-r--r--devtools/client/netmonitor/src/components/messages/cbor.js270
-rw-r--r--devtools/client/netmonitor/src/components/messages/moz.build32
-rw-r--r--devtools/client/netmonitor/src/components/messages/msgpack.js365
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/moz.build11
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/HandshakeProtocol.js82
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/IHubProtocol.js33
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/JSONHubProtocol.js120
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/TextMessageFormat.js33
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/Utils.js25
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/index.js13
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/signalr/moz.build12
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/socket-io/binary.js48
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/socket-io/component-emitter.js84
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/socket-io/index.js292
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/socket-io/is-buffer.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/socket-io/moz.build10
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/sockjs/index.js56
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/sockjs/moz.build7
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/stomp/byte.js25
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/stomp/frame.js204
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/stomp/index.js40
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/stomp/moz.build10
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/stomp/parser.js230
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/wamp/arrayParser.js274
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/wamp/moz.build8
-rw-r--r--devtools/client/netmonitor/src/components/messages/parsers/wamp/serializers.js73
-rw-r--r--devtools/client/netmonitor/src/components/moz.build28
-rw-r--r--devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js511
-rw-r--r--devtools/client/netmonitor/src/components/new-request/InputMap.js211
-rw-r--r--devtools/client/netmonitor/src/components/new-request/moz.build8
-rw-r--r--devtools/client/netmonitor/src/components/previews/FontPreview.js135
-rw-r--r--devtools/client/netmonitor/src/components/previews/HtmlPreview.js75
-rw-r--r--devtools/client/netmonitor/src/components/previews/ImagePreview.js91
-rw-r--r--devtools/client/netmonitor/src/components/previews/SourcePreview.js178
-rw-r--r--devtools/client/netmonitor/src/components/previews/UrlPreview.js290
-rw-r--r--devtools/client/netmonitor/src/components/previews/moz.build11
-rw-r--r--devtools/client/netmonitor/src/components/request-blocking/RequestBlockingPanel.js350
-rw-r--r--devtools/client/netmonitor/src/components/request-blocking/moz.build7
-rw-r--r--devtools/client/netmonitor/src/components/request-details/CachePanel.js144
-rw-r--r--devtools/client/netmonitor/src/components/request-details/CookiesPanel.js225
-rw-r--r--devtools/client/netmonitor/src/components/request-details/HeadersPanel.js850
-rw-r--r--devtools/client/netmonitor/src/components/request-details/NetworkDetailsBar.js106
-rw-r--r--devtools/client/netmonitor/src/components/request-details/PropertiesView.js247
-rw-r--r--devtools/client/netmonitor/src/components/request-details/RequestPanel.js301
-rw-r--r--devtools/client/netmonitor/src/components/request-details/ResponsePanel.js496
-rw-r--r--devtools/client/netmonitor/src/components/request-details/SecurityPanel.js283
-rw-r--r--devtools/client/netmonitor/src/components/request-details/StackTracePanel.js81
-rw-r--r--devtools/client/netmonitor/src/components/request-details/TimingsPanel.js229
-rw-r--r--devtools/client/netmonitor/src/components/request-details/moz.build16
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestList.js50
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnContentSize.js38
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnCookies.js61
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnDomain.js66
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnFile.js91
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnInitiator.js65
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnMethod.js33
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnPriority.js36
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnProtocol.js43
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnRemoteIP.js43
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnResponseHeader.js59
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnScheme.js38
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnSetCookies.js61
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnStatus.js39
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnTime.js91
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnTransferredSize.js99
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnType.js45
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnUrl.js89
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListColumnWaterfall.js209
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListContent.js524
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListEmptyNotice.js107
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListHeader.js731
-rw-r--r--devtools/client/netmonitor/src/components/request-list/RequestListItem.js412
-rw-r--r--devtools/client/netmonitor/src/components/request-list/moz.build29
-rw-r--r--devtools/client/netmonitor/src/components/search/SearchPanel.js264
-rw-r--r--devtools/client/netmonitor/src/components/search/StatusBar.js97
-rw-r--r--devtools/client/netmonitor/src/components/search/Toolbar.js160
-rw-r--r--devtools/client/netmonitor/src/components/search/moz.build10
-rw-r--r--devtools/client/netmonitor/src/components/search/search-provider.js91
-rw-r--r--devtools/client/netmonitor/src/connector/firefox-data-provider.js832
-rw-r--r--devtools/client/netmonitor/src/connector/har-metadata-collector.js97
-rw-r--r--devtools/client/netmonitor/src/connector/index.js543
-rw-r--r--devtools/client/netmonitor/src/connector/moz.build9
-rw-r--r--devtools/client/netmonitor/src/constants.js597
-rw-r--r--devtools/client/netmonitor/src/create-store.js172
-rw-r--r--devtools/client/netmonitor/src/har/README.md42
-rw-r--r--devtools/client/netmonitor/src/har/har-automation.js253
-rw-r--r--devtools/client/netmonitor/src/har/har-builder-utils.js30
-rw-r--r--devtools/client/netmonitor/src/har/har-builder.js656
-rw-r--r--devtools/client/netmonitor/src/har/har-collector.js488
-rw-r--r--devtools/client/netmonitor/src/har/har-exporter.js230
-rw-r--r--devtools/client/netmonitor/src/har/har-importer.js166
-rw-r--r--devtools/client/netmonitor/src/har/har-menu-utils.js118
-rw-r--r--devtools/client/netmonitor/src/har/har-utils.js167
-rw-r--r--devtools/client/netmonitor/src/har/moz.build19
-rw-r--r--devtools/client/netmonitor/src/har/test/browser-harautomation.ini16
-rw-r--r--devtools/client/netmonitor/src/har/test/browser.ini29
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_harautomation_simple.js35
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js220
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_import.js149
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_import_no-mime.js78
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_multipage.js153
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_post_data.js51
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_post_data_on_get.js43
-rw-r--r--devtools/client/netmonitor/src/har/test/browser_net_har_throttle_upload.js69
-rw-r--r--devtools/client/netmonitor/src/har/test/head.js45
-rw-r--r--devtools/client/netmonitor/src/har/test/html_har_import-test-page.html51
-rw-r--r--devtools/client/netmonitor/src/har/test/html_har_multipage_iframe.html24
-rw-r--r--devtools/client/netmonitor/src/har/test/html_har_multipage_page.html30
-rw-r--r--devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html55
-rw-r--r--devtools/client/netmonitor/src/har/test/sjs_cache-test-server.sjs14
-rw-r--r--devtools/client/netmonitor/src/har/test/sjs_cookies-test-server.sjs10
-rw-r--r--devtools/client/netmonitor/src/middleware/batching.js146
-rw-r--r--devtools/client/netmonitor/src/middleware/event-telemetry.js192
-rw-r--r--devtools/client/netmonitor/src/middleware/moz.build11
-rw-r--r--devtools/client/netmonitor/src/middleware/prefs.js116
-rw-r--r--devtools/client/netmonitor/src/middleware/request-blocking.js58
-rw-r--r--devtools/client/netmonitor/src/middleware/throttling.js26
-rw-r--r--devtools/client/netmonitor/src/moz.build23
-rw-r--r--devtools/client/netmonitor/src/reducers/batching.js27
-rw-r--r--devtools/client/netmonitor/src/reducers/filters.js102
-rw-r--r--devtools/client/netmonitor/src/reducers/index.js47
-rw-r--r--devtools/client/netmonitor/src/reducers/messages.js335
-rw-r--r--devtools/client/netmonitor/src/reducers/moz.build16
-rw-r--r--devtools/client/netmonitor/src/reducers/request-blocking.js187
-rw-r--r--devtools/client/netmonitor/src/reducers/requests.js313
-rw-r--r--devtools/client/netmonitor/src/reducers/search.js118
-rw-r--r--devtools/client/netmonitor/src/reducers/sort.js48
-rw-r--r--devtools/client/netmonitor/src/reducers/timing-markers.js78
-rw-r--r--devtools/client/netmonitor/src/reducers/ui.js260
-rw-r--r--devtools/client/netmonitor/src/selectors/index.js13
-rw-r--r--devtools/client/netmonitor/src/selectors/messages.js162
-rw-r--r--devtools/client/netmonitor/src/selectors/moz.build12
-rw-r--r--devtools/client/netmonitor/src/selectors/requests.js198
-rw-r--r--devtools/client/netmonitor/src/selectors/search.js33
-rw-r--r--devtools/client/netmonitor/src/selectors/timing-markers.js18
-rw-r--r--devtools/client/netmonitor/src/selectors/ui.js81
-rw-r--r--devtools/client/netmonitor/src/utils/context-menu-utils.js32
-rw-r--r--devtools/client/netmonitor/src/utils/doc-utils.js224
-rw-r--r--devtools/client/netmonitor/src/utils/filter-autocomplete-provider.js209
-rw-r--r--devtools/client/netmonitor/src/utils/filter-predicates.js137
-rw-r--r--devtools/client/netmonitor/src/utils/filter-text-utils.js291
-rw-r--r--devtools/client/netmonitor/src/utils/firefox/moz.build8
-rw-r--r--devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js67
-rw-r--r--devtools/client/netmonitor/src/utils/format-utils.js132
-rw-r--r--devtools/client/netmonitor/src/utils/headers-provider.js90
-rw-r--r--devtools/client/netmonitor/src/utils/l10n.js11
-rw-r--r--devtools/client/netmonitor/src/utils/moz.build27
-rw-r--r--devtools/client/netmonitor/src/utils/open-request-in-tab.js63
-rw-r--r--devtools/client/netmonitor/src/utils/powershell.js142
-rw-r--r--devtools/client/netmonitor/src/utils/prefs.js18
-rw-r--r--devtools/client/netmonitor/src/utils/request-blocking.js13
-rw-r--r--devtools/client/netmonitor/src/utils/request-utils.js769
-rw-r--r--devtools/client/netmonitor/src/utils/sort-predicates.js319
-rw-r--r--devtools/client/netmonitor/src/utils/sort-utils.js42
-rw-r--r--devtools/client/netmonitor/src/utils/tooltips.js18
-rw-r--r--devtools/client/netmonitor/src/widgets/HeadersPanelContextMenu.js137
-rw-r--r--devtools/client/netmonitor/src/widgets/PropertiesViewContextMenu.js113
-rw-r--r--devtools/client/netmonitor/src/widgets/RequestBlockingContextMenu.js78
-rw-r--r--devtools/client/netmonitor/src/widgets/RequestListContextMenu.js793
-rw-r--r--devtools/client/netmonitor/src/widgets/RequestListHeaderContextMenu.js105
-rw-r--r--devtools/client/netmonitor/src/widgets/WaterfallBackground.js163
-rw-r--r--devtools/client/netmonitor/src/widgets/moz.build12
-rw-r--r--devtools/client/netmonitor/src/workers/moz.build8
-rw-r--r--devtools/client/netmonitor/src/workers/search/index.js25
-rw-r--r--devtools/client/netmonitor/src/workers/search/moz.build10
-rw-r--r--devtools/client/netmonitor/src/workers/search/search.js349
-rw-r--r--devtools/client/netmonitor/src/workers/search/worker.js17
-rw-r--r--devtools/client/netmonitor/test/.eslintrc.js7
-rw-r--r--devtools/client/netmonitor/test/OstrichLicense.txt41
-rw-r--r--devtools/client/netmonitor/test/browser.ini330
-rw-r--r--devtools/client/netmonitor/test/browser_http3.ini11
-rw-r--r--devtools/client/netmonitor/test/browser_net-ws-filter-freetext.js93
-rw-r--r--devtools/client/netmonitor/test/browser_net_accessibility-01.js87
-rw-r--r--devtools/client/netmonitor/test/browser_net_accessibility-02.js137
-rw-r--r--devtools/client/netmonitor/test/browser_net_api-calls.js47
-rw-r--r--devtools/client/netmonitor/test/browser_net_autoscroll.js114
-rw-r--r--devtools/client/netmonitor/test/browser_net_background_update.js57
-rw-r--r--devtools/client/netmonitor/test/browser_net_basic-search.js68
-rw-r--r--devtools/client/netmonitor/test/browser_net_block-context.js135
-rw-r--r--devtools/client/netmonitor/test/browser_net_block-csp.js111
-rw-r--r--devtools/client/netmonitor/test/browser_net_block-draganddrop.js159
-rw-r--r--devtools/client/netmonitor/test/browser_net_block-extensions.js103
-rw-r--r--devtools/client/netmonitor/test/browser_net_block-pattern.js106
-rw-r--r--devtools/client/netmonitor/test/browser_net_block-serviceworker.js58
-rw-r--r--devtools/client/netmonitor/test/browser_net_block.js169
-rw-r--r--devtools/client/netmonitor/test/browser_net_brotli.js81
-rw-r--r--devtools/client/netmonitor/test/browser_net_cache_details.js102
-rw-r--r--devtools/client/netmonitor/test/browser_net_cached-status.js130
-rw-r--r--devtools/client/netmonitor/test/browser_net_cause_redirect.js80
-rw-r--r--devtools/client/netmonitor/test/browser_net_cause_source_map.js60
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-01.js153
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-02.js72
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-03.js195
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-04.js117
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-05.js94
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-06.js62
-rw-r--r--devtools/client/netmonitor/test/browser_net_charts-07.js97
-rw-r--r--devtools/client/netmonitor/test/browser_net_clear.js145
-rw-r--r--devtools/client/netmonitor/test/browser_net_column-resize-fit.js95
-rw-r--r--devtools/client/netmonitor/test/browser_net_column_headers_tooltips.js30
-rw-r--r--devtools/client/netmonitor/test/browser_net_column_slow-request-indicator.js69
-rw-r--r--devtools/client/netmonitor/test/browser_net_columns_last_column.js64
-rw-r--r--devtools/client/netmonitor/test/browser_net_columns_pref.js59
-rw-r--r--devtools/client/netmonitor/test/browser_net_columns_reset.js43
-rw-r--r--devtools/client/netmonitor/test/browser_net_columns_showhide.js181
-rw-r--r--devtools/client/netmonitor/test/browser_net_columns_time.js61
-rw-r--r--devtools/client/netmonitor/test/browser_net_complex-params.js310
-rw-r--r--devtools/client/netmonitor/test/browser_net_content-type.js358
-rw-r--r--devtools/client/netmonitor/test/browser_net_cookies_sorted.js85
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_as_curl.js242
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_as_fetch.js92
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_as_powershell.js167
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_headers.js105
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_image_as_data_uri.js41
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_params.js167
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_response.js38
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_svg_image_as_data_uri.js48
-rw-r--r--devtools/client/netmonitor/test/browser_net_copy_url.js50
-rw-r--r--devtools/client/netmonitor/test/browser_net_cors_requests.js54
-rw-r--r--devtools/client/netmonitor/test/browser_net_curl-utils.js385
-rw-r--r--devtools/client/netmonitor/test/browser_net_cyrillic-01.js64
-rw-r--r--devtools/client/netmonitor/test/browser_net_cyrillic-02.js76
-rw-r--r--devtools/client/netmonitor/test/browser_net_decode-params.js35
-rw-r--r--devtools/client/netmonitor/test/browser_net_decode-url.js42
-rw-r--r--devtools/client/netmonitor/test/browser_net_details_copy.js295
-rw-r--r--devtools/client/netmonitor/test/browser_net_domain-not-found.js41
-rw-r--r--devtools/client/netmonitor/test/browser_net_edit_resend_cancel.js68
-rw-r--r--devtools/client/netmonitor/test/browser_net_edit_resend_caret.js102
-rw-r--r--devtools/client/netmonitor/test/browser_net_edit_resend_with_filtering.js153
-rw-r--r--devtools/client/netmonitor/test/browser_net_edit_resend_xhr.js135
-rw-r--r--devtools/client/netmonitor/test/browser_net_error-boundary-01.js31
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-01.js558
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-02.js307
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-03.js163
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-04.js80
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-autocomplete.js207
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-flags.js435
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-sts-search.js59
-rw-r--r--devtools/client/netmonitor/test/browser_net_filter-value-preserved.js55
-rw-r--r--devtools/client/netmonitor/test/browser_net_fission_switch_target.js54
-rw-r--r--devtools/client/netmonitor/test/browser_net_fonts.js84
-rw-r--r--devtools/client/netmonitor/test/browser_net_footer-summary.js114
-rw-r--r--devtools/client/netmonitor/test/browser_net_frame.js272
-rw-r--r--devtools/client/netmonitor/test/browser_net_header-docs.js74
-rw-r--r--devtools/client/netmonitor/test/browser_net_header-ref-policy.js62
-rw-r--r--devtools/client/netmonitor/test/browser_net_header-request-priority.js43
-rw-r--r--devtools/client/netmonitor/test/browser_net_headers-alignment.js65
-rw-r--r--devtools/client/netmonitor/test/browser_net_headers-link_clickable.js44
-rw-r--r--devtools/client/netmonitor/test/browser_net_headers-resize.js279
-rw-r--r--devtools/client/netmonitor/test/browser_net_headers_filter.js80
-rw-r--r--devtools/client/netmonitor/test/browser_net_headers_sorted.js194
-rw-r--r--devtools/client/netmonitor/test/browser_net_html-preview.js176
-rw-r--r--devtools/client/netmonitor/test/browser_net_http3_request_details.js153
-rw-r--r--devtools/client/netmonitor/test/browser_net_image-tooltip.js117
-rw-r--r--devtools/client/netmonitor/test/browser_net_image_cache.js76
-rw-r--r--devtools/client/netmonitor/test/browser_net_initiator.js291
-rw-r--r--devtools/client/netmonitor/test/browser_net_internal-stylesheet.js37
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-b64.js103
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-empty.js79
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-long.js174
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-malformed.js97
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-nogrip.js51
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-null.js114
-rw-r--r--devtools/client/netmonitor/test/browser_net_json-xssi-protection.js96
-rw-r--r--devtools/client/netmonitor/test/browser_net_json_custom_mime.js133
-rw-r--r--devtools/client/netmonitor/test/browser_net_json_text_mime.js136
-rw-r--r--devtools/client/netmonitor/test/browser_net_jsonp.js179
-rw-r--r--devtools/client/netmonitor/test/browser_net_large-response.js92
-rw-r--r--devtools/client/netmonitor/test/browser_net_leak_on_tab_close.js20
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel.js98
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel_clear_button.js87
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel_content-length.js94
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel_context_menu.js208
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel_persisted_content.js149
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel_send_request.js166
-rw-r--r--devtools/client/netmonitor/test/browser_net_new_request_panel_sync_url_params.js194
-rw-r--r--devtools/client/netmonitor/test/browser_net_open_in_debugger.js40
-rw-r--r--devtools/client/netmonitor/test/browser_net_open_in_style_editor.js44
-rw-r--r--devtools/client/netmonitor/test/browser_net_open_request_in_tab.js264
-rw-r--r--devtools/client/netmonitor/test/browser_net_pane-collapse.js68
-rw-r--r--devtools/client/netmonitor/test/browser_net_pane-network-details.js149
-rw-r--r--devtools/client/netmonitor/test/browser_net_pane-toggle.js107
-rw-r--r--devtools/client/netmonitor/test/browser_net_params_sorted.js83
-rw-r--r--devtools/client/netmonitor/test/browser_net_pause.js151
-rw-r--r--devtools/client/netmonitor/test/browser_net_persistent_logs.js77
-rw-r--r--devtools/client/netmonitor/test/browser_net_post-data-json-payloads.js105
-rw-r--r--devtools/client/netmonitor/test/browser_net_post-data-raw-payloads-with-upload-stream-headers.js202
-rw-r--r--devtools/client/netmonitor/test/browser_net_post-data-raw-payloads.js89
-rw-r--r--devtools/client/netmonitor/test/browser_net_post-data.js195
-rw-r--r--devtools/client/netmonitor/test/browser_net_prefs-and-l10n.js78
-rw-r--r--devtools/client/netmonitor/test/browser_net_prefs-reload.js327
-rw-r--r--devtools/client/netmonitor/test/browser_net_raw_headers.js132
-rw-r--r--devtools/client/netmonitor/test/browser_net_reload-button.js30
-rw-r--r--devtools/client/netmonitor/test/browser_net_reload-markers.js34
-rw-r--r--devtools/client/netmonitor/test/browser_net_req-resp-bodies.js83
-rw-r--r--devtools/client/netmonitor/test/browser_net_resend.js385
-rw-r--r--devtools/client/netmonitor/test/browser_net_resend_cors.js132
-rw-r--r--devtools/client/netmonitor/test/browser_net_resend_csp.js153
-rw-r--r--devtools/client/netmonitor/test/browser_net_resend_headers.js89
-rw-r--r--devtools/client/netmonitor/test/browser_net_resend_hidden_headers.js88
-rw-r--r--devtools/client/netmonitor/test/browser_net_resend_xhr.js57
-rw-r--r--devtools/client/netmonitor/test/browser_net_response_CORS_blocked.js117
-rw-r--r--devtools/client/netmonitor/test/browser_net_response_node-expanded.js57
-rw-r--r--devtools/client/netmonitor/test/browser_net_search-results.js233
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-details.js116
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-error.js38
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-icon-click.js75
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-redirect.js67
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-state.js109
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-tab-deselect.js67
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-tab-visibility.js142
-rw-r--r--devtools/client/netmonitor/test/browser_net_security-warnings.js66
-rw-r--r--devtools/client/netmonitor/test/browser_net_send-beacon-other-tab.js49
-rw-r--r--devtools/client/netmonitor/test/browser_net_send-beacon.js44
-rw-r--r--devtools/client/netmonitor/test/browser_net_server_timings.js74
-rw-r--r--devtools/client/netmonitor/test/browser_net_service-worker-status.js112
-rw-r--r--devtools/client/netmonitor/test/browser_net_set-cookie-same-site.js85
-rw-r--r--devtools/client/netmonitor/test/browser_net_simple-request-data.js488
-rw-r--r--devtools/client/netmonitor/test/browser_net_simple-request-details.js388
-rw-r--r--devtools/client/netmonitor/test/browser_net_simple-request.js99
-rw-r--r--devtools/client/netmonitor/test/browser_net_sort-01.js316
-rw-r--r--devtools/client/netmonitor/test/browser_net_sort-02.js460
-rw-r--r--devtools/client/netmonitor/test/browser_net_sort-reset.js284
-rw-r--r--devtools/client/netmonitor/test/browser_net_sse-basic.js119
-rw-r--r--devtools/client/netmonitor/test/browser_net_stacktraces-visibility.js86
-rw-r--r--devtools/client/netmonitor/test/browser_net_statistics-01.js65
-rw-r--r--devtools/client/netmonitor/test/browser_net_statistics-02.js74
-rw-r--r--devtools/client/netmonitor/test/browser_net_statistics-edge-case.js112
-rw-r--r--devtools/client/netmonitor/test/browser_net_status-bar-transferred-size.js77
-rw-r--r--devtools/client/netmonitor/test/browser_net_status-bar.js60
-rw-r--r--devtools/client/netmonitor/test/browser_net_status-codes.js213
-rw-r--r--devtools/client/netmonitor/test/browser_net_streaming-response.js89
-rw-r--r--devtools/client/netmonitor/test/browser_net_tabbar_focus.js90
-rw-r--r--devtools/client/netmonitor/test/browser_net_telemetry_edit_resend.js71
-rw-r--r--devtools/client/netmonitor/test/browser_net_telemetry_filters_changed.js100
-rw-r--r--devtools/client/netmonitor/test/browser_net_telemetry_persist_toggle_changed.js81
-rw-r--r--devtools/client/netmonitor/test/browser_net_telemetry_select_ws_frame.js83
-rw-r--r--devtools/client/netmonitor/test/browser_net_telemetry_sidepanel_changed.js61
-rw-r--r--devtools/client/netmonitor/test/browser_net_telemetry_throttle_changed.js50
-rw-r--r--devtools/client/netmonitor/test/browser_net_throttle.js60
-rw-r--r--devtools/client/netmonitor/test/browser_net_throttling_profiles.js67
-rw-r--r--devtools/client/netmonitor/test/browser_net_timeline_ticks.js208
-rw-r--r--devtools/client/netmonitor/test/browser_net_timing-division.js67
-rw-r--r--devtools/client/netmonitor/test/browser_net_tracking-resources.js50
-rw-r--r--devtools/client/netmonitor/test/browser_net_truncate-post-data.js78
-rw-r--r--devtools/client/netmonitor/test/browser_net_truncate.js59
-rw-r--r--devtools/client/netmonitor/test/browser_net_url-preview.js203
-rw-r--r--devtools/client/netmonitor/test/browser_net_use_as_fetch.js85
-rw-r--r--devtools/client/netmonitor/test/browser_net_view-source-debugger.js80
-rw-r--r--devtools/client/netmonitor/test/browser_net_waterfall-click.js36
-rw-r--r--devtools/client/netmonitor/test/browser_net_websocket_stacks.js94
-rw-r--r--devtools/client/netmonitor/test/browser_net_worker_stacks.js119
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-basic.js79
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-clear.js84
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-connection-closed.js54
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-early-connection.js62
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-filter-dropdown.js136
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-filter-regex.js76
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-json-action-cable-payload.js109
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-json-payload.js112
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-json-stomp-payload.js115
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-keep-future-frames.js87
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-limit-frames.js63
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-limit-payload.js80
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-messages-navigation.js106
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-sockjs-stomp-payload.js115
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-sse-persist-columns.js268
-rw-r--r--devtools/client/netmonitor/test/browser_net_ws-stomp-payload.js115
-rw-r--r--devtools/client/netmonitor/test/dropmarker.svg6
-rw-r--r--devtools/client/netmonitor/test/file_ws_backend_wsh.py13
-rw-r--r--devtools/client/netmonitor/test/head.js1493
-rw-r--r--devtools/client/netmonitor/test/html_api-calls-test-page.html45
-rw-r--r--devtools/client/netmonitor/test/html_brotli-test-page.html41
-rw-r--r--devtools/client/netmonitor/test/html_cache-test-page.html28
-rw-r--r--devtools/client/netmonitor/test/html_cause-test-page.html98
-rw-r--r--devtools/client/netmonitor/test/html_content-type-without-cache-test-page.html47
-rw-r--r--devtools/client/netmonitor/test/html_copy-as-curl.html33
-rw-r--r--devtools/client/netmonitor/test/html_cors-test-page.html34
-rw-r--r--devtools/client/netmonitor/test/html_csp-frame-test-page.html9
-rw-r--r--devtools/client/netmonitor/test/html_csp-resend-test-page.html25
-rw-r--r--devtools/client/netmonitor/test/html_csp-test-page.html18
-rw-r--r--devtools/client/netmonitor/test/html_curl-utils.html136
-rw-r--r--devtools/client/netmonitor/test/html_custom-get-page.html48
-rw-r--r--devtools/client/netmonitor/test/html_cyrillic-test-page.html42
-rw-r--r--devtools/client/netmonitor/test/html_filter-test-page.html58
-rw-r--r--devtools/client/netmonitor/test/html_fonts-test-page.html45
-rw-r--r--devtools/client/netmonitor/test/html_frame-subdocument.html50
-rw-r--r--devtools/client/netmonitor/test/html_frame-test-page.html51
-rw-r--r--devtools/client/netmonitor/test/html_header-test-page.html43
-rw-r--r--devtools/client/netmonitor/test/html_image-cache.html7
-rw-r--r--devtools/client/netmonitor/test/html_image-tooltip-test-page.html29
-rw-r--r--devtools/client/netmonitor/test/html_infinite-get-page.html50
-rw-r--r--devtools/client/netmonitor/test/html_internal-stylesheet.html15
-rw-r--r--devtools/client/netmonitor/test/html_json-b64.html41
-rw-r--r--devtools/client/netmonitor/test/html_json-basic.html43
-rw-r--r--devtools/client/netmonitor/test/html_json-custom-mime-test-page.html41
-rw-r--r--devtools/client/netmonitor/test/html_json-empty.html42
-rw-r--r--devtools/client/netmonitor/test/html_json-long-test-page.html41
-rw-r--r--devtools/client/netmonitor/test/html_json-malformed-test-page.html41
-rw-r--r--devtools/client/netmonitor/test/html_json-text-mime-test-page.html41
-rw-r--r--devtools/client/netmonitor/test/html_json-xssi-protection.html42
-rw-r--r--devtools/client/netmonitor/test/html_jsonp-test-page.html42
-rw-r--r--devtools/client/netmonitor/test/html_maps-test-page.html24
-rw-r--r--devtools/client/netmonitor/test/html_navigate-test-page.html18
-rw-r--r--devtools/client/netmonitor/test/html_open-request-in-tab.html33
-rw-r--r--devtools/client/netmonitor/test/html_params-test-page.html78
-rw-r--r--devtools/client/netmonitor/test/html_pause-test-page.html36
-rw-r--r--devtools/client/netmonitor/test/html_post-array-data-test-page.html34
-rw-r--r--devtools/client/netmonitor/test/html_post-data-test-page.html82
-rw-r--r--devtools/client/netmonitor/test/html_post-json-test-page.html48
-rw-r--r--devtools/client/netmonitor/test/html_post-raw-test-page.html43
-rw-r--r--devtools/client/netmonitor/test/html_post-raw-with-headers-test-page.html67
-rw-r--r--devtools/client/netmonitor/test/html_send-beacon.html26
-rw-r--r--devtools/client/netmonitor/test/html_simple-test-page.html18
-rw-r--r--devtools/client/netmonitor/test/html_single-get-page.html40
-rw-r--r--devtools/client/netmonitor/test/html_slow-requests-test-page.html15
-rw-r--r--devtools/client/netmonitor/test/html_sorting-test-page.html18
-rw-r--r--devtools/client/netmonitor/test/html_sse-test-page.html31
-rw-r--r--devtools/client/netmonitor/test/html_statistics-edge-case-page.html23
-rw-r--r--devtools/client/netmonitor/test/html_statistics-test-page.html42
-rw-r--r--devtools/client/netmonitor/test/html_status-codes-test-page.html55
-rw-r--r--devtools/client/netmonitor/test/html_tracking-protection.html21
-rw-r--r--devtools/client/netmonitor/test/html_websocket-test-page.html10
-rw-r--r--devtools/client/netmonitor/test/html_worker-test-page.html13
-rw-r--r--devtools/client/netmonitor/test/html_ws-early-connection-page.html24
-rw-r--r--devtools/client/netmonitor/test/html_ws-sse-test-page.html59
-rw-r--r--devtools/client/netmonitor/test/html_ws-test-page.html56
-rw-r--r--devtools/client/netmonitor/test/js_websocket-worker-test.js6
-rw-r--r--devtools/client/netmonitor/test/js_worker-test.js30
-rw-r--r--devtools/client/netmonitor/test/js_worker-test2.js3
-rw-r--r--devtools/client/netmonitor/test/node/jest.config.js12
-rw-r--r--devtools/client/netmonitor/test/node/package.json15
-rw-r--r--devtools/client/netmonitor/test/node/reducers/sort.spec.js28
-rw-r--r--devtools/client/netmonitor/test/node/yarn.lock3553
-rw-r--r--devtools/client/netmonitor/test/ostrich-black.ttfbin0 -> 12872 bytes-rw-r--r--devtools/client/netmonitor/test/ostrich-regular.ttfbin0 -> 12476 bytes-rw-r--r--devtools/client/netmonitor/test/service-workers/status-codes-service-worker.js16
-rw-r--r--devtools/client/netmonitor/test/service-workers/status-codes.html62
-rw-r--r--devtools/client/netmonitor/test/sjs_content-type-test-server.sjs421
-rw-r--r--devtools/client/netmonitor/test/sjs_cors-test-server.sjs18
-rw-r--r--devtools/client/netmonitor/test/sjs_hsts-test-server.sjs23
-rw-r--r--devtools/client/netmonitor/test/sjs_https-redirect-test-server.sjs19
-rw-r--r--devtools/client/netmonitor/test/sjs_json-test-server.sjs28
-rw-r--r--devtools/client/netmonitor/test/sjs_long-polling-server.sjs35
-rw-r--r--devtools/client/netmonitor/test/sjs_method-test-server.sjs35
-rw-r--r--devtools/client/netmonitor/test/sjs_search-test-server.sjs10
-rw-r--r--devtools/client/netmonitor/test/sjs_set-cookie-same-site.sjs11
-rw-r--r--devtools/client/netmonitor/test/sjs_simple-test-server.sjs22
-rw-r--r--devtools/client/netmonitor/test/sjs_simple-unsorted-cookies-test-server.sjs20
-rw-r--r--devtools/client/netmonitor/test/sjs_slow-script-server.sjs18
-rw-r--r--devtools/client/netmonitor/test/sjs_slow-test-server.sjs20
-rw-r--r--devtools/client/netmonitor/test/sjs_sorting-test-server.sjs36
-rw-r--r--devtools/client/netmonitor/test/sjs_sse-test-server.sjs7
-rw-r--r--devtools/client/netmonitor/test/sjs_status-codes-test-server.sjs71
-rw-r--r--devtools/client/netmonitor/test/sjs_timings-test-server.sjs45
-rw-r--r--devtools/client/netmonitor/test/sjs_truncate-test-server.sjs21
-rw-r--r--devtools/client/netmonitor/test/test-image.pngbin0 -> 580 bytes-rw-r--r--devtools/client/netmonitor/test/xhr_bundle.js91
-rw-r--r--devtools/client/netmonitor/test/xhr_bundle.js.map1
-rw-r--r--devtools/client/netmonitor/test/xhr_original.js13
-rw-r--r--devtools/client/netmonitor/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/netmonitor/test/xpcshell/test_doc-utils.js62
-rw-r--r--devtools/client/netmonitor/test/xpcshell/test_request-utils-fetchNetworkUpdatePacket.js54
-rw-r--r--devtools/client/netmonitor/test/xpcshell/test_request-utils-js-getFormattedProtocol.js235
-rw-r--r--devtools/client/netmonitor/test/xpcshell/test_request-utils-parseJSON.js78
-rw-r--r--devtools/client/netmonitor/test/xpcshell/xpcshell.ini10
-rw-r--r--devtools/client/performance-new/.eslintrc.js12
-rw-r--r--devtools/client/performance-new/@types/README.md5
-rw-r--r--devtools/client/performance-new/@types/gecko.d.ts457
-rw-r--r--devtools/client/performance-new/@types/perf.d.ts676
-rw-r--r--devtools/client/performance-new/README.md46
-rw-r--r--devtools/client/performance-new/aboutprofiling/README.md3
-rw-r--r--devtools/client/performance-new/aboutprofiling/index.xhtml36
-rw-r--r--devtools/client/performance-new/aboutprofiling/initializer.js152
-rw-r--r--devtools/client/performance-new/aboutprofiling/moz.build7
-rw-r--r--devtools/client/performance-new/components/README.md3
-rw-r--r--devtools/client/performance-new/components/aboutprofiling/AboutProfiling.js156
-rw-r--r--devtools/client/performance-new/components/aboutprofiling/DirectoryPicker.js119
-rw-r--r--devtools/client/performance-new/components/aboutprofiling/Presets.js167
-rw-r--r--devtools/client/performance-new/components/aboutprofiling/Range.js78
-rw-r--r--devtools/client/performance-new/components/aboutprofiling/Settings.js674
-rw-r--r--devtools/client/performance-new/components/aboutprofiling/moz.build12
-rw-r--r--devtools/client/performance-new/components/moz.build10
-rw-r--r--devtools/client/performance-new/components/panel/Description.js63
-rw-r--r--devtools/client/performance-new/components/panel/DevToolsPanel.js108
-rw-r--r--devtools/client/performance-new/components/panel/DevToolsPresetSelection.js219
-rw-r--r--devtools/client/performance-new/components/panel/OnboardingMessage.js138
-rw-r--r--devtools/client/performance-new/components/panel/ProfilerEventHandling.js128
-rw-r--r--devtools/client/performance-new/components/panel/RecordingButton.js265
-rw-r--r--devtools/client/performance-new/components/panel/ToolboxHighlightController.js61
-rw-r--r--devtools/client/performance-new/components/panel/moz.build14
-rw-r--r--devtools/client/performance-new/components/shared/ProfilerPreferenceObserver.js110
-rw-r--r--devtools/client/performance-new/components/shared/moz.build8
-rw-r--r--devtools/client/performance-new/moz.build19
-rw-r--r--devtools/client/performance-new/package.json15
-rw-r--r--devtools/client/performance-new/panel/README.md6
-rw-r--r--devtools/client/performance-new/panel/index.xhtml29
-rw-r--r--devtools/client/performance-new/panel/initializer.js189
-rw-r--r--devtools/client/performance-new/panel/moz.build12
-rw-r--r--devtools/client/performance-new/panel/panel.js107
-rw-r--r--devtools/client/performance-new/popup/README.md3
-rw-r--r--devtools/client/performance-new/popup/logic.jsm.js342
-rw-r--r--devtools/client/performance-new/popup/menu-button.jsm.js333
-rw-r--r--devtools/client/performance-new/popup/moz.build12
-rw-r--r--devtools/client/performance-new/shared/README.md5
-rw-r--r--devtools/client/performance-new/shared/background.jsm.js922
-rw-r--r--devtools/client/performance-new/shared/browser.js172
-rw-r--r--devtools/client/performance-new/shared/moz.build17
-rw-r--r--devtools/client/performance-new/shared/profiler_get_symbols.js498
-rw-r--r--devtools/client/performance-new/shared/symbolication-worker.js279
-rw-r--r--devtools/client/performance-new/shared/symbolication.jsm.js364
-rw-r--r--devtools/client/performance-new/shared/typescript-lazy-load.jsm.js55
-rw-r--r--devtools/client/performance-new/shared/utils.js566
-rw-r--r--devtools/client/performance-new/store/README.md3
-rw-r--r--devtools/client/performance-new/store/actions.js218
-rw-r--r--devtools/client/performance-new/store/moz.build10
-rw-r--r--devtools/client/performance-new/store/reducers.js332
-rw-r--r--devtools/client/performance-new/store/selectors.js104
-rw-r--r--devtools/client/performance-new/test/browser/browser.ini48
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-entries.js28
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-env-restart-button.js78
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-features-disabled.js63
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-features.js32
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-interval.js72
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-presets-custom.js128
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-presets.js54
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-rtl.js31
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-threads-behavior.js129
-rw-r--r--devtools/client/performance-new/test/browser/browser_aboutprofiling-threads.js31
-rw-r--r--devtools/client/performance-new/test/browser/browser_devtools-interrupted.js42
-rw-r--r--devtools/client/performance-new/test/browser/browser_devtools-onboarding.js95
-rw-r--r--devtools/client/performance-new/test/browser/browser_devtools-presets.js47
-rw-r--r--devtools/client/performance-new/test/browser/browser_devtools-previously-started.js61
-rw-r--r--devtools/client/performance-new/test/browser/browser_devtools-record-capture.js213
-rw-r--r--devtools/client/performance-new/test/browser/browser_devtools-record-discard.js36
-rw-r--r--devtools/client/performance-new/test/browser/browser_interaction-between-interfaces.js389
-rw-r--r--devtools/client/performance-new/test/browser/browser_popup-profiler-states.js91
-rw-r--r--devtools/client/performance-new/test/browser/browser_popup-record-capture-view.js143
-rw-r--r--devtools/client/performance-new/test/browser/browser_popup-record-capture.js41
-rw-r--r--devtools/client/performance-new/test/browser/browser_popup-record-discard.js35
-rw-r--r--devtools/client/performance-new/test/browser/browser_split-toolbar-button.js180
-rw-r--r--devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button-preset.js52
-rw-r--r--devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button.js16
-rw-r--r--devtools/client/performance-new/test/browser/fake-frontend.html126
-rw-r--r--devtools/client/performance-new/test/browser/head.js40
-rw-r--r--devtools/client/performance-new/test/browser/helpers.js836
-rw-r--r--devtools/client/performance-new/test/browser/webchannel.html26
-rw-r--r--devtools/client/performance-new/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/performance-new/test/xpcshell/head.js12
-rw-r--r--devtools/client/performance-new/test/xpcshell/test_popup_initial_state.js106
-rw-r--r--devtools/client/performance-new/test/xpcshell/test_remove_common_path_prefix.js121
-rw-r--r--devtools/client/performance-new/test/xpcshell/test_webchannel-urls.js63
-rw-r--r--devtools/client/performance-new/test/xpcshell/xpcshell.ini8
-rw-r--r--devtools/client/performance-new/tsconfig.json28
-rw-r--r--devtools/client/performance-new/typescript.md54
-rw-r--r--devtools/client/performance-new/yarn.lock95
-rw-r--r--devtools/client/preferences/debugger.js63
-rw-r--r--devtools/client/preferences/moz.build9
-rw-r--r--devtools/client/responsive/actions/devices.js254
-rw-r--r--devtools/client/responsive/actions/index.js109
-rw-r--r--devtools/client/responsive/actions/moz.build13
-rw-r--r--devtools/client/responsive/actions/screenshot.js36
-rw-r--r--devtools/client/responsive/actions/ui.js71
-rw-r--r--devtools/client/responsive/actions/viewports.js128
-rw-r--r--devtools/client/responsive/components/App.js447
-rw-r--r--devtools/client/responsive/components/Device.js139
-rw-r--r--devtools/client/responsive/components/DeviceAdder.js229
-rw-r--r--devtools/client/responsive/components/DeviceForm.js231
-rw-r--r--devtools/client/responsive/components/DeviceInfo.js52
-rw-r--r--devtools/client/responsive/components/DeviceList.js97
-rw-r--r--devtools/client/responsive/components/DeviceModal.js303
-rw-r--r--devtools/client/responsive/components/DevicePixelRatioMenu.js100
-rw-r--r--devtools/client/responsive/components/DeviceSelector.js173
-rw-r--r--devtools/client/responsive/components/SettingsMenu.js122
-rw-r--r--devtools/client/responsive/components/Toolbar.js216
-rw-r--r--devtools/client/responsive/components/UserAgentInput.js103
-rw-r--r--devtools/client/responsive/components/ViewportDimension.js251
-rw-r--r--devtools/client/responsive/components/moz.build20
-rw-r--r--devtools/client/responsive/constants.js14
-rw-r--r--devtools/client/responsive/docs/devices.md37
-rw-r--r--devtools/client/responsive/images/grippers.svg6
-rw-r--r--devtools/client/responsive/images/rotate-viewport.svg7
-rw-r--r--devtools/client/responsive/images/touch-events.svg6
-rw-r--r--devtools/client/responsive/index.css756
-rw-r--r--devtools/client/responsive/index.js224
-rw-r--r--devtools/client/responsive/manager.js299
-rw-r--r--devtools/client/responsive/moz.build30
-rw-r--r--devtools/client/responsive/reducers.js11
-rw-r--r--devtools/client/responsive/reducers/devices.js124
-rw-r--r--devtools/client/responsive/reducers/moz.build12
-rw-r--r--devtools/client/responsive/reducers/screenshot.js38
-rw-r--r--devtools/client/responsive/reducers/ui.js135
-rw-r--r--devtools/client/responsive/reducers/viewports.js212
-rw-r--r--devtools/client/responsive/responsive-browser.css132
-rw-r--r--devtools/client/responsive/store.js14
-rw-r--r--devtools/client/responsive/test/browser/browser.ini117
-rw-r--r--devtools/client/responsive/test/browser/browser_cmd_click.js33
-rw-r--r--devtools/client/responsive/test/browser/browser_container_tab.js30
-rw-r--r--devtools/client/responsive/test/browser/browser_contextmenu_inspect.js55
-rw-r--r--devtools/client/responsive/test/browser/browser_device_change.js129
-rw-r--r--devtools/client/responsive/test/browser/browser_device_custom.js238
-rw-r--r--devtools/client/responsive/test/browser/browser_device_custom_edit.js117
-rw-r--r--devtools/client/responsive/test/browser/browser_device_custom_remove.js139
-rw-r--r--devtools/client/responsive/test/browser/browser_device_modal_exit.js51
-rw-r--r--devtools/client/responsive/test/browser/browser_device_modal_items.js99
-rw-r--r--devtools/client/responsive/test/browser/browser_device_modal_submit.js203
-rw-r--r--devtools/client/responsive/test/browser/browser_device_pixel_ratio_change.js136
-rw-r--r--devtools/client/responsive/test/browser/browser_device_selector_items.js79
-rw-r--r--devtools/client/responsive/test/browser/browser_device_state_restore.js155
-rw-r--r--devtools/client/responsive/test/browser/browser_device_width.js168
-rw-r--r--devtools/client/responsive/test/browser/browser_exit_button.js81
-rw-r--r--devtools/client/responsive/test/browser/browser_ext_messaging.js231
-rw-r--r--devtools/client/responsive/test/browser/browser_in_rdm_pane.js31
-rw-r--r--devtools/client/responsive/test/browser/browser_max_touchpoints.js103
-rw-r--r--devtools/client/responsive/test/browser/browser_menu_item_01.js67
-rw-r--r--devtools/client/responsive/test/browser/browser_menu_item_02.js59
-rw-r--r--devtools/client/responsive/test/browser/browser_mouse_resize.js39
-rw-r--r--devtools/client/responsive/test/browser/browser_navigation.js102
-rw-r--r--devtools/client/responsive/test/browser/browser_network_throttling.js75
-rw-r--r--devtools/client/responsive/test/browser/browser_orientationchange_event.js244
-rw-r--r--devtools/client/responsive/test/browser/browser_page_redirection.js62
-rw-r--r--devtools/client/responsive/test/browser/browser_page_state.js91
-rw-r--r--devtools/client/responsive/test/browser/browser_page_style.js70
-rw-r--r--devtools/client/responsive/test/browser/browser_permission_doorhanger.js72
-rw-r--r--devtools/client/responsive/test/browser/browser_picker_link.js96
-rw-r--r--devtools/client/responsive/test/browser/browser_preloaded_newtab.js34
-rw-r--r--devtools/client/responsive/test/browser/browser_screenshot_button.js44
-rw-r--r--devtools/client/responsive/test/browser/browser_screenshot_button_warning.js59
-rw-r--r--devtools/client/responsive/test/browser/browser_scroll.js88
-rw-r--r--devtools/client/responsive/test/browser/browser_state_restore.js90
-rw-r--r--devtools/client/responsive/test/browser/browser_tab_close.js53
-rw-r--r--devtools/client/responsive/test/browser/browser_tab_not_selected.js43
-rw-r--r--devtools/client/responsive/test/browser/browser_tab_remoteness_change.js45
-rw-r--r--devtools/client/responsive/test/browser/browser_tab_remoteness_change_fission_switch_target.js42
-rw-r--r--devtools/client/responsive/test/browser/browser_target_blank.js25
-rw-r--r--devtools/client/responsive/test/browser/browser_telemetry_activate_rdm.js116
-rw-r--r--devtools/client/responsive/test/browser/browser_toolbox_computed_view.js64
-rw-r--r--devtools/client/responsive/test/browser/browser_toolbox_rule_view.js63
-rw-r--r--devtools/client/responsive/test/browser/browser_toolbox_rule_view_reload.js56
-rw-r--r--devtools/client/responsive/test/browser/browser_toolbox_swap_browsers.js175
-rw-r--r--devtools/client/responsive/test/browser/browser_toolbox_swap_inspector.js50
-rw-r--r--devtools/client/responsive/test/browser/browser_tooltip.js57
-rw-r--r--devtools/client/responsive/test/browser/browser_touch_device.js100
-rw-r--r--devtools/client/responsive/test/browser/browser_touch_does_not_trigger_hover_states.js78
-rw-r--r--devtools/client/responsive/test/browser/browser_touch_event_iframes.js312
-rw-r--r--devtools/client/responsive/test/browser/browser_touch_event_should_bubble.js51
-rw-r--r--devtools/client/responsive/test/browser/browser_touch_pointerevents.js73
-rw-r--r--devtools/client/responsive/test/browser/browser_touch_simulation.js341
-rw-r--r--devtools/client/responsive/test/browser/browser_typeahead_find.js70
-rw-r--r--devtools/client/responsive/test/browser/browser_user_agent_input.js24
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_basics.js30
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_changed_meta.js124
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_fallback_width.js53
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_resizing_after_reload.js88
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_resizing_fixed_width.js72
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_resizing_fixed_width_and_zoom.js89
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_resizing_minimum_scale.js76
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_resizing_scrollbar.js86
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_resolution_restore.js60
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_state_after_close.js51
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_zoom_resolution_invariant.js60
-rw-r--r--devtools/client/responsive/test/browser/browser_viewport_zoom_toggle.js101
-rw-r--r--devtools/client/responsive/test/browser/browser_window_close.js43
-rw-r--r--devtools/client/responsive/test/browser/browser_window_sizing.js87
-rw-r--r--devtools/client/responsive/test/browser/browser_zoom.js27
-rw-r--r--devtools/client/responsive/test/browser/contextual_identity.html6
-rw-r--r--devtools/client/responsive/test/browser/devices.json658
-rw-r--r--devtools/client/responsive/test/browser/doc_contextmenu_inspect.html3
-rw-r--r--devtools/client/responsive/test/browser/doc_page_state.html16
-rw-r--r--devtools/client/responsive/test/browser/doc_picker_link.html12
-rw-r--r--devtools/client/responsive/test/browser/doc_toolbox_rule_view.css10
-rw-r--r--devtools/client/responsive/test/browser/doc_toolbox_rule_view.html4
-rw-r--r--devtools/client/responsive/test/browser/doc_with_remote_iframe_and_isolated_cross_origin_capabilities.sjs52
-rw-r--r--devtools/client/responsive/test/browser/favicon.html8
-rw-r--r--devtools/client/responsive/test/browser/favicon.icobin0 -> 1406 bytes-rw-r--r--devtools/client/responsive/test/browser/geolocation.html13
-rw-r--r--devtools/client/responsive/test/browser/head.js1008
-rw-r--r--devtools/client/responsive/test/browser/hover.html37
-rw-r--r--devtools/client/responsive/test/browser/page_style.html7
-rw-r--r--devtools/client/responsive/test/browser/sjs_redirection.sjs35
-rw-r--r--devtools/client/responsive/test/browser/touch.html66
-rw-r--r--devtools/client/responsive/test/browser/touch_event_bubbles.html19
-rw-r--r--devtools/client/responsive/test/browser/touch_event_target.html18
-rw-r--r--devtools/client/responsive/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/responsive/test/xpcshell/head.js19
-rw-r--r--devtools/client/responsive/test/xpcshell/test_add_device.js36
-rw-r--r--devtools/client/responsive/test/xpcshell/test_add_device_type.js28
-rw-r--r--devtools/client/responsive/test/xpcshell/test_add_viewport.js24
-rw-r--r--devtools/client/responsive/test/xpcshell/test_change_device.js50
-rw-r--r--devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js26
-rw-r--r--devtools/client/responsive/test/xpcshell/test_change_network_throttling.js34
-rw-r--r--devtools/client/responsive/test/xpcshell/test_change_pixel_ratio.js27
-rw-r--r--devtools/client/responsive/test/xpcshell/test_change_user_agent.js28
-rw-r--r--devtools/client/responsive/test/xpcshell/test_resize_viewport.js37
-rw-r--r--devtools/client/responsive/test/xpcshell/test_rotate_viewport.js27
-rw-r--r--devtools/client/responsive/test/xpcshell/test_ua_parser.js129
-rw-r--r--devtools/client/responsive/test/xpcshell/test_update_device_displayed.js38
-rw-r--r--devtools/client/responsive/test/xpcshell/test_update_touch_simulation_enabled.js24
-rw-r--r--devtools/client/responsive/test/xpcshell/xpcshell.ini18
-rw-r--r--devtools/client/responsive/toolbar.xhtml20
-rw-r--r--devtools/client/responsive/types.js139
-rw-r--r--devtools/client/responsive/ui.js1075
-rw-r--r--devtools/client/responsive/utils/e10s.js99
-rw-r--r--devtools/client/responsive/utils/key.js25
-rw-r--r--devtools/client/responsive/utils/l10n.js16
-rw-r--r--devtools/client/responsive/utils/message.js55
-rw-r--r--devtools/client/responsive/utils/moz.build16
-rw-r--r--devtools/client/responsive/utils/notification.js60
-rw-r--r--devtools/client/responsive/utils/orientation.js76
-rw-r--r--devtools/client/responsive/utils/ua.js129
-rw-r--r--devtools/client/responsive/utils/window.js43
-rw-r--r--devtools/client/shared/WeakMapMap.js107
-rw-r--r--devtools/client/shared/async-store-helper.js57
-rw-r--r--devtools/client/shared/autocomplete-popup.js700
-rw-r--r--devtools/client/shared/build/babel.js1
-rw-r--r--devtools/client/shared/build/build-debugger.js196
-rw-r--r--devtools/client/shared/build/build.js78
-rw-r--r--devtools/client/shared/build/node-templates.mozbuild34
-rw-r--r--devtools/client/shared/classnames.js40
-rw-r--r--devtools/client/shared/components/.eslintrc.js11
-rw-r--r--devtools/client/shared/components/Accordion.css87
-rw-r--r--devtools/client/shared/components/Accordion.js257
-rw-r--r--devtools/client/shared/components/AppErrorBoundary.css85
-rw-r--r--devtools/client/shared/components/AppErrorBoundary.js161
-rw-r--r--devtools/client/shared/components/Frame.js401
-rw-r--r--devtools/client/shared/components/HSplitBox.js165
-rw-r--r--devtools/client/shared/components/List.css41
-rw-r--r--devtools/client/shared/components/List.js352
-rw-r--r--devtools/client/shared/components/MdnLink.css33
-rw-r--r--devtools/client/shared/components/MdnLink.js38
-rw-r--r--devtools/client/shared/components/NotificationBox.css130
-rw-r--r--devtools/client/shared/components/NotificationBox.js403
-rw-r--r--devtools/client/shared/components/SearchBox.js269
-rw-r--r--devtools/client/shared/components/SearchBoxAutocompletePopup.js150
-rw-r--r--devtools/client/shared/components/SearchModifiers.css64
-rw-r--r--devtools/client/shared/components/SearchModifiers.js84
-rw-r--r--devtools/client/shared/components/Sidebar.js98
-rw-r--r--devtools/client/shared/components/SidebarToggle.css39
-rw-r--r--devtools/client/shared/components/SidebarToggle.js89
-rw-r--r--devtools/client/shared/components/SmartTrace.css167
-rw-r--r--devtools/client/shared/components/SmartTrace.js308
-rw-r--r--devtools/client/shared/components/StackTrace.js96
-rw-r--r--devtools/client/shared/components/Tree.css86
-rw-r--r--devtools/client/shared/components/Tree.js1055
-rw-r--r--devtools/client/shared/components/VirtualizedTree.js1071
-rw-r--r--devtools/client/shared/components/VisibilityHandler.js57
-rw-r--r--devtools/client/shared/components/menu/MenuButton.js450
-rw-r--r--devtools/client/shared/components/menu/MenuItem.js211
-rw-r--r--devtools/client/shared/components/menu/MenuList.js164
-rw-r--r--devtools/client/shared/components/menu/moz.build12
-rw-r--r--devtools/client/shared/components/menu/utils.js62
-rw-r--r--devtools/client/shared/components/moz.build41
-rw-r--r--devtools/client/shared/components/object-inspector/actions.js225
-rw-r--r--devtools/client/shared/components/object-inspector/components/ObjectInspector.css99
-rw-r--r--devtools/client/shared/components/object-inspector/components/ObjectInspector.js371
-rw-r--r--devtools/client/shared/components/object-inspector/components/ObjectInspectorItem.js285
-rw-r--r--devtools/client/shared/components/object-inspector/components/moz.build10
-rw-r--r--devtools/client/shared/components/object-inspector/index.js10
-rw-r--r--devtools/client/shared/components/object-inspector/moz.build16
-rw-r--r--devtools/client/shared/components/object-inspector/reducer.js147
-rw-r--r--devtools/client/shared/components/object-inspector/utils/client.js124
-rw-r--r--devtools/client/shared/components/object-inspector/utils/index.js52
-rw-r--r--devtools/client/shared/components/object-inspector/utils/load-properties.js260
-rw-r--r--devtools/client/shared/components/object-inspector/utils/moz.build13
-rw-r--r--devtools/client/shared/components/object-inspector/utils/node.js1039
-rw-r--r--devtools/client/shared/components/object-inspector/utils/selection.js16
-rw-r--r--devtools/client/shared/components/reps/images/input.svg7
-rw-r--r--devtools/client/shared/components/reps/images/jump-definition.svg8
-rw-r--r--devtools/client/shared/components/reps/images/open-a11y.svg10
-rw-r--r--devtools/client/shared/components/reps/images/open-inspector.svg6
-rw-r--r--devtools/client/shared/components/reps/index.js32
-rw-r--r--devtools/client/shared/components/reps/moz.build14
-rw-r--r--devtools/client/shared/components/reps/reps.css394
-rw-r--r--devtools/client/shared/components/reps/reps/accessible.js197
-rw-r--r--devtools/client/shared/components/reps/reps/accessor.js106
-rw-r--r--devtools/client/shared/components/reps/reps/array.js170
-rw-r--r--devtools/client/shared/components/reps/reps/attribute.js74
-rw-r--r--devtools/client/shared/components/reps/reps/big-int.js57
-rw-r--r--devtools/client/shared/components/reps/reps/comment-node.js76
-rw-r--r--devtools/client/shared/components/reps/reps/constants.js16
-rw-r--r--devtools/client/shared/components/reps/reps/custom-formatter.js256
-rw-r--r--devtools/client/shared/components/reps/reps/date-time.js95
-rw-r--r--devtools/client/shared/components/reps/reps/document-type.js60
-rw-r--r--devtools/client/shared/components/reps/reps/document.js79
-rw-r--r--devtools/client/shared/components/reps/reps/element-node.js310
-rw-r--r--devtools/client/shared/components/reps/reps/error.js330
-rw-r--r--devtools/client/shared/components/reps/reps/event.js115
-rw-r--r--devtools/client/shared/components/reps/reps/function.js264
-rw-r--r--devtools/client/shared/components/reps/reps/grip-array.js255
-rw-r--r--devtools/client/shared/components/reps/reps/grip-entry.js77
-rw-r--r--devtools/client/shared/components/reps/reps/grip-map.js234
-rw-r--r--devtools/client/shared/components/reps/reps/grip.js396
-rw-r--r--devtools/client/shared/components/reps/reps/infinity.js52
-rw-r--r--devtools/client/shared/components/reps/reps/moz.build45
-rw-r--r--devtools/client/shared/components/reps/reps/nan.js51
-rw-r--r--devtools/client/shared/components/reps/reps/null.js59
-rw-r--r--devtools/client/shared/components/reps/reps/number.js63
-rw-r--r--devtools/client/shared/components/reps/reps/object-with-text.js70
-rw-r--r--devtools/client/shared/components/reps/reps/object-with-url.js73
-rw-r--r--devtools/client/shared/components/reps/reps/object.js207
-rw-r--r--devtools/client/shared/components/reps/reps/promise.js101
-rw-r--r--devtools/client/shared/components/reps/reps/prop-rep.js105
-rw-r--r--devtools/client/shared/components/reps/reps/regexp.js66
-rw-r--r--devtools/client/shared/components/reps/reps/rep-utils.js574
-rw-r--r--devtools/client/shared/components/reps/reps/rep.js210
-rw-r--r--devtools/client/shared/components/reps/reps/string.js407
-rw-r--r--devtools/client/shared/components/reps/reps/stylesheet.js78
-rw-r--r--devtools/client/shared/components/reps/reps/symbol.js82
-rw-r--r--devtools/client/shared/components/reps/reps/text-node.js136
-rw-r--r--devtools/client/shared/components/reps/reps/undefined.js59
-rw-r--r--devtools/client/shared/components/reps/reps/window.js102
-rw-r--r--devtools/client/shared/components/reps/shared/dom-node-constants.js31
-rw-r--r--devtools/client/shared/components/reps/shared/grip-length-bubble.js64
-rw-r--r--devtools/client/shared/components/reps/shared/moz.build10
-rw-r--r--devtools/client/shared/components/splitter/Draggable.js106
-rw-r--r--devtools/client/shared/components/splitter/GridElementResizer.css32
-rw-r--r--devtools/client/shared/components/splitter/GridElementWidthResizer.js138
-rw-r--r--devtools/client/shared/components/splitter/SplitBox.css93
-rw-r--r--devtools/client/shared/components/splitter/SplitBox.js351
-rw-r--r--devtools/client/shared/components/splitter/moz.build11
-rw-r--r--devtools/client/shared/components/tabs/TabBar.js378
-rw-r--r--devtools/client/shared/components/tabs/Tabs.css127
-rw-r--r--devtools/client/shared/components/tabs/Tabs.js468
-rw-r--r--devtools/client/shared/components/tabs/moz.build10
-rw-r--r--devtools/client/shared/components/test/browser/browser.ini9
-rw-r--r--devtools/client/shared/components/test/browser/browser_notification_box_basic.js34
-rw-r--r--devtools/client/shared/components/test/browser/browser_reps_stubs.js347
-rw-r--r--devtools/client/shared/components/test/chrome/accordion.snapshots.js176
-rw-r--r--devtools/client/shared/components/test/chrome/chrome.ini46
-rw-r--r--devtools/client/shared/components/test/chrome/head.js379
-rw-r--r--devtools/client/shared/components/test/chrome/test_GridElementWidthResizer.html209
-rw-r--r--devtools/client/shared/components/test/chrome/test_GridElementWidthResizer_RTL.html210
-rw-r--r--devtools/client/shared/components/test/chrome/test_HSplitBox_01.html140
-rw-r--r--devtools/client/shared/components/test/chrome/test_accordion.html141
-rw-r--r--devtools/client/shared/components/test/chrome/test_frame_01.html361
-rw-r--r--devtools/client/shared/components/test/chrome/test_frame_02.html103
-rw-r--r--devtools/client/shared/components/test/chrome/test_list.html127
-rw-r--r--devtools/client/shared/components/test/chrome/test_list_keyboard.html283
-rw-r--r--devtools/client/shared/components/test/chrome/test_notification_box_01.html136
-rw-r--r--devtools/client/shared/components/test/chrome/test_notification_box_02.html73
-rw-r--r--devtools/client/shared/components/test/chrome/test_notification_box_03.html87
-rw-r--r--devtools/client/shared/components/test/chrome/test_notification_box_04.html67
-rw-r--r--devtools/client/shared/components/test/chrome/test_notification_box_05.html63
-rw-r--r--devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html301
-rw-r--r--devtools/client/shared/components/test/chrome/test_searchbox.html74
-rw-r--r--devtools/client/shared/components/test/chrome/test_sidebar_toggle.html59
-rw-r--r--devtools/client/shared/components/test/chrome/test_smart-trace-grouping.html141
-rw-r--r--devtools/client/shared/components/test/chrome/test_smart-trace-source-maps.html290
-rw-r--r--devtools/client/shared/components/test/chrome/test_smart-trace.html172
-rw-r--r--devtools/client/shared/components/test/chrome/test_stack-trace-source-maps.html98
-rw-r--r--devtools/client/shared/components/test/chrome/test_stack-trace.html100
-rw-r--r--devtools/client/shared/components/test/chrome/test_tabs_accessibility.html82
-rw-r--r--devtools/client/shared/components/test/chrome/test_tabs_menu.html84
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree-view_01.html290
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree-view_02.html136
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_01.html68
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_02.html49
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_03.html50
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_04.html133
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_05.html195
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_06.html340
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_07.html69
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_08.html61
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_09.html85
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_10.html57
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_11.html100
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_12.html146
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_13.html88
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_14.html245
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_15.html99
-rw-r--r--devtools/client/shared/components/test/chrome/test_tree_16.html145
-rw-r--r--devtools/client/shared/components/test/node/.eslintrc.js10
-rw-r--r--devtools/client/shared/components/test/node/__mocks__/Services.js14
-rw-r--r--devtools/client/shared/components/test/node/__mocks__/object-front.js55
-rw-r--r--devtools/client/shared/components/test/node/__mocks__/string-front.js15
-rw-r--r--devtools/client/shared/components/test/node/babel.config.js13
-rw-r--r--devtools/client/shared/components/test/node/components/__snapshots__/tree.test.js.snap1171
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/basic.test.js.snap63
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/classnames.test.js.snap351
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/entries.test.js.snap94
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/expand.test.js.snap175
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/getter-setter.test.js.snap51
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/keyboard-navigation.test.js.snap55
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/properties.test.js.snap19
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/proxy.test.js.snap9
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/__snapshots__/window.test.js.snap2114
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/basic.test.js439
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/classnames.test.js53
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/create-long-string-front.test.js94
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/create-object-client.test.js114
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/entries.test.js137
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/events.test.js171
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/expand.test.js435
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/function.test.js90
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/getter-setter.test.js106
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/keyboard-navigation.test.js89
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/properties.test.js158
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/proxy.test.js133
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/should-item-update.test.js96
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/component/window.test.js96
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/test-utils.js231
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/__snapshots__/promises.test.js.snap49
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/create-node.test.js87
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/get-children.test.js278
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/get-closest-grip-node.test.js52
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/get-value.test.js91
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/make-node-for-properties.test.js295
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/make-numerical-buckets.test.js138
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/node-has-entries.test.js51
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/node-is-window.test.js20
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/node-supports-numerical-bucketing.test.js72
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/promises.test.js54
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-load-item-entries.test.js171
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-load-item-full-text.test.js56
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-load-item-indexed-properties.test.js259
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-load-item-non-indexed-properties.test.js222
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-load-item-prototype.test.js218
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-load-item-symbols.test.js218
-rw-r--r--devtools/client/shared/components/test/node/components/object-inspector/utils/should-render-roots-in-reps.test.js153
-rw-r--r--devtools/client/shared/components/test/node/components/reps/__snapshots__/accessor.test.js.snap3
-rw-r--r--devtools/client/shared/components/test/node/components/reps/__snapshots__/element-node.test.js.snap42
-rw-r--r--devtools/client/shared/components/test/node/components/reps/__snapshots__/error.test.js.snap1210
-rw-r--r--devtools/client/shared/components/test/node/components/reps/__snapshots__/nan.test.js.snap10
-rw-r--r--devtools/client/shared/components/test/node/components/reps/accessible.test.js321
-rw-r--r--devtools/client/shared/components/test/node/components/reps/accessor.test.js137
-rw-r--r--devtools/client/shared/components/test/node/components/reps/array.test.js117
-rw-r--r--devtools/client/shared/components/test/node/components/reps/attribute.test.js44
-rw-r--r--devtools/client/shared/components/test/node/components/reps/big-int.test.js106
-rw-r--r--devtools/client/shared/components/test/node/components/reps/comment-node.test.js74
-rw-r--r--devtools/client/shared/components/test/node/components/reps/date-time.test.js61
-rw-r--r--devtools/client/shared/components/test/node/components/reps/document-type.test.js51
-rw-r--r--devtools/client/shared/components/test/node/components/reps/document.test.js52
-rw-r--r--devtools/client/shared/components/test/node/components/reps/element-node.test.js654
-rw-r--r--devtools/client/shared/components/test/node/components/reps/error.test.js748
-rw-r--r--devtools/client/shared/components/test/node/components/reps/event.test.js160
-rw-r--r--devtools/client/shared/components/test/node/components/reps/failure.test.js66
-rw-r--r--devtools/client/shared/components/test/node/components/reps/function.test.js584
-rw-r--r--devtools/client/shared/components/test/node/components/reps/grip-array.test.js705
-rw-r--r--devtools/client/shared/components/test/node/components/reps/grip-entry.test.js191
-rw-r--r--devtools/client/shared/components/test/node/components/reps/grip-map.test.js377
-rw-r--r--devtools/client/shared/components/test/node/components/reps/grip.test.js705
-rw-r--r--devtools/client/shared/components/test/node/components/reps/helper-tests.test.js122
-rw-r--r--devtools/client/shared/components/test/node/components/reps/infinity.test.js70
-rw-r--r--devtools/client/shared/components/test/node/components/reps/long-string.test.js135
-rw-r--r--devtools/client/shared/components/test/node/components/reps/nan.test.js43
-rw-r--r--devtools/client/shared/components/test/node/components/reps/null.test.js47
-rw-r--r--devtools/client/shared/components/test/node/components/reps/number.test.js136
-rw-r--r--devtools/client/shared/components/test/node/components/reps/object-with-text.test.js66
-rw-r--r--devtools/client/shared/components/test/node/components/reps/object-with-url.test.js45
-rw-r--r--devtools/client/shared/components/test/node/components/reps/object.test.js356
-rw-r--r--devtools/client/shared/components/test/node/components/reps/promise.test.js216
-rw-r--r--devtools/client/shared/components/test/node/components/reps/regexp.test.js59
-rw-r--r--devtools/client/shared/components/test/node/components/reps/string-with-url.test.js630
-rw-r--r--devtools/client/shared/components/test/node/components/reps/string.test.js257
-rw-r--r--devtools/client/shared/components/test/node/components/reps/stylesheet.test.js41
-rw-r--r--devtools/client/shared/components/test/node/components/reps/symbol.test.js64
-rw-r--r--devtools/client/shared/components/test/node/components/reps/test-helpers.js116
-rw-r--r--devtools/client/shared/components/test/node/components/reps/text-node.test.js186
-rw-r--r--devtools/client/shared/components/test/node/components/reps/undefined.test.js58
-rw-r--r--devtools/client/shared/components/test/node/components/reps/window.test.js131
-rw-r--r--devtools/client/shared/components/test/node/components/tree.test.js911
-rw-r--r--devtools/client/shared/components/test/node/jest.config.js16
-rw-r--r--devtools/client/shared/components/test/node/package.json27
-rw-r--r--devtools/client/shared/components/test/node/setup.js15
-rw-r--r--devtools/client/shared/components/test/node/stubs/object-inspector/grip.js64
-rw-r--r--devtools/client/shared/components/test/node/stubs/object-inspector/map.js154
-rw-r--r--devtools/client/shared/components/test/node/stubs/object-inspector/performance.js784
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/accessible.js74
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/accessor.js85
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/attribute.js36
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/big-int.js196
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/browser_dummy.js11
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/comment-node.js36
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/date-time.js47
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/document-type.js40
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/document.js39
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/element-node.js292
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/error.js396
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/event.js269
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/failure.js21
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/function.js227
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/grip-array.js1087
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/grip-entry.js16
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/grip-map.js908
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/grip.js1057
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/infinity.js19
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/long-string.js39
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/nan.js15
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/null.js15
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/number.js21
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/object-with-text.js36
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/object-with-url.js22
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/promise.js244
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/regexp.js36
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/stubs.ini19
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/stylesheet.js29
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/symbol.js33
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/text-node.js141
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/undefined.js15
-rw-r--r--devtools/client/shared/components/test/node/stubs/reps/window.js29
-rw-r--r--devtools/client/shared/components/test/node/yarn.lock4209
-rw-r--r--devtools/client/shared/components/throttling/NetworkThrottlingMenu.js100
-rw-r--r--devtools/client/shared/components/throttling/actions.js22
-rw-r--r--devtools/client/shared/components/throttling/moz.build13
-rw-r--r--devtools/client/shared/components/throttling/profiles.js104
-rw-r--r--devtools/client/shared/components/throttling/reducer.js29
-rw-r--r--devtools/client/shared/components/throttling/types.js17
-rw-r--r--devtools/client/shared/components/tree/LabelCell.js76
-rw-r--r--devtools/client/shared/components/tree/ObjectProvider.js86
-rw-r--r--devtools/client/shared/components/tree/TreeCell.js139
-rw-r--r--devtools/client/shared/components/tree/TreeHeader.js120
-rw-r--r--devtools/client/shared/components/tree/TreeRow.js304
-rw-r--r--devtools/client/shared/components/tree/TreeView.css199
-rw-r--r--devtools/client/shared/components/tree/TreeView.js799
-rw-r--r--devtools/client/shared/components/tree/moz.build13
-rw-r--r--devtools/client/shared/css-angle.js349
-rw-r--r--devtools/client/shared/curl.js489
-rw-r--r--devtools/client/shared/devices.js182
-rw-r--r--devtools/client/shared/enum.js19
-rw-r--r--devtools/client/shared/events.js22
-rw-r--r--devtools/client/shared/fluent-l10n/fluent-l10n.js64
-rw-r--r--devtools/client/shared/fluent-l10n/moz.build9
-rw-r--r--devtools/client/shared/focus.js73
-rw-r--r--devtools/client/shared/inplace-editor.js1860
-rw-r--r--devtools/client/shared/key-shortcuts.js308
-rw-r--r--devtools/client/shared/keycodes.js139
-rw-r--r--devtools/client/shared/link.js86
-rw-r--r--devtools/client/shared/moz.build65
-rw-r--r--devtools/client/shared/node-attribute-parser.js394
-rw-r--r--devtools/client/shared/output-parser.js1968
-rw-r--r--devtools/client/shared/prefs.js238
-rw-r--r--devtools/client/shared/react-utils.js30
-rw-r--r--devtools/client/shared/redux/create-store.js90
-rw-r--r--devtools/client/shared/redux/middleware/debounce.js100
-rw-r--r--devtools/client/shared/redux/middleware/ignore.js38
-rw-r--r--devtools/client/shared/redux/middleware/log.js31
-rw-r--r--devtools/client/shared/redux/middleware/moz.build18
-rw-r--r--devtools/client/shared/redux/middleware/performance-marker.js68
-rw-r--r--devtools/client/shared/redux/middleware/promise.js69
-rw-r--r--devtools/client/shared/redux/middleware/task.js38
-rw-r--r--devtools/client/shared/redux/middleware/thunk.js23
-rw-r--r--devtools/client/shared/redux/middleware/wait-service.js64
-rw-r--r--devtools/client/shared/redux/middleware/xpcshell/.eslintrc.js10
-rw-r--r--devtools/client/shared/redux/middleware/xpcshell/head.js26
-rw-r--r--devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-01.js66
-rw-r--r--devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-02.js86
-rw-r--r--devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-03.js50
-rw-r--r--devtools/client/shared/redux/middleware/xpcshell/xpcshell.ini9
-rw-r--r--devtools/client/shared/redux/moz.build15
-rw-r--r--devtools/client/shared/redux/subscriber.js16
-rw-r--r--devtools/client/shared/redux/visibility-handler-connect.js35
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-addon.js186
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-binary.js244
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-client.js82
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-device.js53
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-process.js155
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-running-checker.js91
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-runtime.js129
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb-socket.js72
-rw-r--r--devtools/client/shared/remote-debugging/adb/adb.js176
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/index.js29
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/list-devices.js29
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/moz.build12
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/prepare-tcp-connection.js46
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/run-command.js66
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/shell.js107
-rw-r--r--devtools/client/shared/remote-debugging/adb/commands/track-devices.js163
-rw-r--r--devtools/client/shared/remote-debugging/adb/moz.build24
-rw-r--r--devtools/client/shared/remote-debugging/adb/xpcshell/.eslintrc.js9
-rw-r--r--devtools/client/shared/remote-debugging/adb/xpcshell/adb.py72
-rw-r--r--devtools/client/shared/remote-debugging/adb/xpcshell/test_adb.js245
-rw-r--r--devtools/client/shared/remote-debugging/adb/xpcshell/test_prepare-tcp-connection.js78
-rw-r--r--devtools/client/shared/remote-debugging/adb/xpcshell/xpcshell-head.js10
-rw-r--r--devtools/client/shared/remote-debugging/adb/xpcshell/xpcshell.ini11
-rw-r--r--devtools/client/shared/remote-debugging/constants.js24
-rw-r--r--devtools/client/shared/remote-debugging/moz.build20
-rw-r--r--devtools/client/shared/remote-debugging/remote-client-manager.js146
-rw-r--r--devtools/client/shared/remote-debugging/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/shared/remote-debugging/test/xpcshell/test_remote_client_manager.js153
-rw-r--r--devtools/client/shared/remote-debugging/test/xpcshell/test_version_checker.js159
-rw-r--r--devtools/client/shared/remote-debugging/test/xpcshell/xpcshell-head.js10
-rw-r--r--devtools/client/shared/remote-debugging/test/xpcshell/xpcshell.ini8
-rw-r--r--devtools/client/shared/remote-debugging/version-checker.js154
-rw-r--r--devtools/client/shared/screenshot.js424
-rw-r--r--devtools/client/shared/scroll.js144
-rw-r--r--devtools/client/shared/source-map-loader/index.js122
-rw-r--r--devtools/client/shared/source-map-loader/moz.build18
-rw-r--r--devtools/client/shared/source-map-loader/source-map.js521
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/browser.ini14
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/browser_getContentType.js32
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/browser_locations.js141
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/browser_source-map.js169
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/browser_wasm-source-map.js126
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/absolute.js2
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/absolute.js.map10
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/bundle.js94
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/bundle.js.map21
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/empty.js2
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/empty.js.map10
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/if.js12
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/if.out.js16
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/if.out.js.map7
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/intermingled-sources.js62
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/intermingled-sources.js.map8
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/missingmap.js2
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/noroot.js2
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/noroot.js.map9
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/noroot2.js2
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/noroot2.js.map10
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/fixtures/wasm.js.map7
-rw-r--r--devtools/client/shared/source-map-loader/test/browser/head.js27
-rw-r--r--devtools/client/shared/source-map-loader/utils/assert.js13
-rw-r--r--devtools/client/shared/source-map-loader/utils/fetchSourceMap.js137
-rw-r--r--devtools/client/shared/source-map-loader/utils/getOriginalStackFrames.js38
-rw-r--r--devtools/client/shared/source-map-loader/utils/index.js103
-rw-r--r--devtools/client/shared/source-map-loader/utils/moz.build15
-rw-r--r--devtools/client/shared/source-map-loader/utils/network-request.js43
-rw-r--r--devtools/client/shared/source-map-loader/utils/sourceMapRequests.js106
-rw-r--r--devtools/client/shared/source-map-loader/utils/wasmRemap.js107
-rw-r--r--devtools/client/shared/source-map-loader/wasm-dwarf/convertToJSON.js66
-rw-r--r--devtools/client/shared/source-map-loader/wasm-dwarf/dwarf_to_json.wasmbin0 -> 246995 bytes-rw-r--r--devtools/client/shared/source-map-loader/wasm-dwarf/moz.build12
-rw-r--r--devtools/client/shared/source-map-loader/wasm-dwarf/wasmAsset.js17
-rw-r--r--devtools/client/shared/source-map-loader/wasm-dwarf/wasmDwarfExpressions.js260
-rw-r--r--devtools/client/shared/source-map-loader/wasm-dwarf/wasmXScopes.js215
-rw-r--r--devtools/client/shared/source-map-loader/worker.js52
-rw-r--r--devtools/client/shared/source-utils.js359
-rw-r--r--devtools/client/shared/sourceeditor/README238
-rw-r--r--devtools/client/shared/sourceeditor/autocomplete.js358
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/LICENSE23
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/accessibleTextarea.js146
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/comment/comment.js209
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/comment/continuecomment.js78
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/dialog/dialog.css32
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/dialog/dialog.js161
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/display/placeholder.js63
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/edit/closebrackets.js191
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/edit/closetag.js184
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/edit/continuelist.js99
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/edit/matchbrackets.js150
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/edit/matchtags.js66
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/edit/trailingspace.js27
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/brace-fold.js105
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/comment-fold.js59
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/foldcode.js152
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/foldgutter.css20
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/foldgutter.js151
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/indent-fold.js48
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/markdown-fold.js49
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/fold/xml-fold.js184
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/runmode/runmode.js72
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/scroll/annotatescrollbar.js128
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/search/match-highlighter.js165
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/search/matchesonscrollbar.js97
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/search/search.js323
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/search/searchcursor.js293
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/selection/active-line.js72
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/addon/selection/mark-selection.js119
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/cmiframe.html25
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/codemirror.bundle.js1
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/keymap/emacs.js418
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/keymap/sublime.js691
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/keymap/vim.js5494
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/lib/codemirror.css350
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/lib/codemirror.js9788
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/clike/clike.js889
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/clojure/clojure.js292
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/coffeescript/coffeescript.js359
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/css/css.js831
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/elm/elm.js205
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/haxe/haxe.js515
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/htmlmixed/htmlmixed.js152
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/http/http.js113
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/javascript/javascript.js934
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/jsx/jsx.js148
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/rust/rust.js72
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/simple/simple.js216
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/wasm/wasm.js203
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mode/xml/xml.js413
-rw-r--r--devtools/client/shared/sourceeditor/codemirror/mozilla.css320
-rw-r--r--devtools/client/shared/sourceeditor/css-autocompleter.js1252
-rw-r--r--devtools/client/shared/sourceeditor/editor-commands-controller.js97
-rw-r--r--devtools/client/shared/sourceeditor/editor.js1670
-rw-r--r--devtools/client/shared/sourceeditor/moz.build18
-rw-r--r--devtools/client/shared/sourceeditor/package.json16
-rw-r--r--devtools/client/shared/sourceeditor/test/CodeMirrorTestActors.sys.mjs49
-rw-r--r--devtools/client/shared/sourceeditor/test/browser.ini51
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_codemirror.js33
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_css_autocompletion.js171
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_css_getInfo.js250
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_css_statemachine.js144
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_detectindent.js99
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_addons.js33
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_alt_b_f.js46
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_autocomplete_basic.js51
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_autocomplete_events.js157
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_basic.js75
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_cursor.js52
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_cursor_blink.js73
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_disableSearchAddon.js39
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_find_again.js218
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_goto_line.js91
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_history.js30
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_markers.js43
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_movelines.js61
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_editor_prefs.js139
-rw-r--r--devtools/client/shared/sourceeditor/test/browser_vimemacs.js13
-rw-r--r--devtools/client/shared/sourceeditor/test/cm_mode_ruby.js285
-rw-r--r--devtools/client/shared/sourceeditor/test/cm_script_injection_test.js10
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/codemirror.html213
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/comment_test.js114
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/doc_test.js371
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/driver.js142
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/emacs_test.js149
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/mode/javascript/test.js513
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/mode_test.css23
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/mode_test.js193
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/multi_test.js295
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/search_test.js85
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/sublime_test.js284
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/test.js2686
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/vim_test.js4729
-rw-r--r--devtools/client/shared/sourceeditor/test/codemirror/vimemacs.html215
-rw-r--r--devtools/client/shared/sourceeditor/test/css_autocompletion_tests.json106
-rw-r--r--devtools/client/shared/sourceeditor/test/css_statemachine_testcases.css121
-rw-r--r--devtools/client/shared/sourceeditor/test/css_statemachine_tests.json319
-rw-r--r--devtools/client/shared/sourceeditor/test/head.js198
-rw-r--r--devtools/client/shared/sourceeditor/test/head.xhtml5
-rw-r--r--devtools/client/shared/sourceeditor/wasm.js93
-rw-r--r--devtools/client/shared/sourceeditor/webpack.config.js62
-rw-r--r--devtools/client/shared/string-utils.js40
-rw-r--r--devtools/client/shared/stylesheet-utils.js60
-rw-r--r--devtools/client/shared/suggestion-picker.js176
-rw-r--r--devtools/client/shared/telemetry.js819
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/ChromeUtils.js12
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/Services.js563
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/devtools-utils.js13
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/empty-module.js7
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/fluent-l10n.js23
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/generate-uuid.js11
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/indexed-db.js15
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/plural-form.js11
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/promise.js7
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/svgMock.js7
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/telemetry.js13
-rw-r--r--devtools/client/shared/test-helpers/jest-fixtures/unicode-url.js23
-rw-r--r--devtools/client/shared/test-helpers/shared-jest.config.js43
-rw-r--r--devtools/client/shared/test-helpers/shared-node-helpers.js131
-rw-r--r--devtools/client/shared/test/addons/test-addon-1/manifest.json10
-rw-r--r--devtools/client/shared/test/addons/test-addon-2/manifest.json10
-rw-r--r--devtools/client/shared/test/browser.ini204
-rw-r--r--devtools/client/shared/test/browser_autocomplete_popup.js121
-rw-r--r--devtools/client/shared/test/browser_autocomplete_popup_consecutive-show.js57
-rw-r--r--devtools/client/shared/test/browser_autocomplete_popup_input.js251
-rw-r--r--devtools/client/shared/test/browser_browserloader_mocks.js161
-rw-r--r--devtools/client/shared/test/browser_css_angle.js204
-rw-r--r--devtools/client/shared/test/browser_css_color.js147
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-01.js38
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-02.js206
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-03.js70
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-04.js59
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-05.js69
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-06.js95
-rw-r--r--devtools/client/shared/test/browser_cubic-bezier-07.js69
-rw-r--r--devtools/client/shared/test/browser_dbg_globalactor.js71
-rw-r--r--devtools/client/shared/test/browser_dbg_listaddons.js137
-rw-r--r--devtools/client/shared/test/browser_dbg_listtabs-01.js84
-rw-r--r--devtools/client/shared/test/browser_dbg_listtabs-02.js248
-rw-r--r--devtools/client/shared/test/browser_dbg_listworkers.js75
-rw-r--r--devtools/client/shared/test/browser_dbg_multiple-windows.js122
-rw-r--r--devtools/client/shared/test/browser_dbg_target-scoped-actor-01.js43
-rw-r--r--devtools/client/shared/test/browser_dbg_target-scoped-actor-02.js58
-rw-r--r--devtools/client/shared/test/browser_devices.js76
-rw-r--r--devtools/client/shared/test/browser_filter-editor-01.js150
-rw-r--r--devtools/client/shared/test/browser_filter-editor-02.js113
-rw-r--r--devtools/client/shared/test/browser_filter-editor-03.js84
-rw-r--r--devtools/client/shared/test/browser_filter-editor-04.js104
-rw-r--r--devtools/client/shared/test/browser_filter-editor-05.js166
-rw-r--r--devtools/client/shared/test/browser_filter-editor-06.js78
-rw-r--r--devtools/client/shared/test/browser_filter-editor-07.js32
-rw-r--r--devtools/client/shared/test/browser_filter-editor-08.js103
-rw-r--r--devtools/client/shared/test/browser_filter-editor-09.js155
-rw-r--r--devtools/client/shared/test/browser_filter-editor-10.js100
-rw-r--r--devtools/client/shared/test/browser_filter-presets-01.js117
-rw-r--r--devtools/client/shared/test/browser_filter-presets-02.js47
-rw-r--r--devtools/client/shared/test/browser_filter-presets-03.js42
-rw-r--r--devtools/client/shared/test/browser_html_tooltip-01.js78
-rw-r--r--devtools/client/shared/test/browser_html_tooltip-02.js227
-rw-r--r--devtools/client/shared/test/browser_html_tooltip-03.js96
-rw-r--r--devtools/client/shared/test/browser_html_tooltip-04.js100
-rw-r--r--devtools/client/shared/test/browser_html_tooltip-05.js101
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_arrow-01.js86
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_arrow-02.js83
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_consecutive-show.js70
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_doorhanger-01.js77
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_doorhanger-02.js75
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_height-auto.js107
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_hover.js65
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_offset.js97
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_resize.js93
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_rtl.js224
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_screen_edge.js74
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_variable-height.js77
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_width-auto.js53
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_xul-wrapper.js79
-rw-r--r--devtools/client/shared/test/browser_html_tooltip_zoom.js76
-rw-r--r--devtools/client/shared/test/browser_inplace-editor-01.js164
-rw-r--r--devtools/client/shared/test/browser_inplace-editor-02.js80
-rw-r--r--devtools/client/shared/test/browser_inplace-editor_autoclose_parentheses.js77
-rw-r--r--devtools/client/shared/test/browser_inplace-editor_autocomplete_01.js79
-rw-r--r--devtools/client/shared/test/browser_inplace-editor_autocomplete_02.js79
-rw-r--r--devtools/client/shared/test/browser_inplace-editor_autocomplete_css_variable.js106
-rw-r--r--devtools/client/shared/test/browser_inplace-editor_autocomplete_offset.js118
-rw-r--r--devtools/client/shared/test/browser_inplace-editor_maxwidth.js135
-rw-r--r--devtools/client/shared/test/browser_key_shortcuts.js468
-rw-r--r--devtools/client/shared/test/browser_keycodes.js12
-rw-r--r--devtools/client/shared/test/browser_layoutHelpers.js130
-rw-r--r--devtools/client/shared/test/browser_layoutHelpers_getBoxQuads1.js345
-rw-r--r--devtools/client/shared/test/browser_layoutHelpers_getBoxQuads2.js185
-rw-r--r--devtools/client/shared/test/browser_link.js40
-rw-r--r--devtools/client/shared/test/browser_num-l10n.js72
-rw-r--r--devtools/client/shared/test/browser_outputparser.js771
-rw-r--r--devtools/client/shared/test/browser_prefs-01.js53
-rw-r--r--devtools/client/shared/test/browser_prefs-02.js67
-rw-r--r--devtools/client/shared/test/browser_require_raw.js23
-rw-r--r--devtools/client/shared/test/browser_spectrum.js502
-rw-r--r--devtools/client/shared/test/browser_tableWidget_basic.js448
-rw-r--r--devtools/client/shared/test/browser_tableWidget_keyboard_interaction.js202
-rw-r--r--devtools/client/shared/test/browser_tableWidget_mouse_interaction.js359
-rw-r--r--devtools/client/shared/test/browser_telemetry_button_eyedropper.js39
-rw-r--r--devtools/client/shared/test/browser_telemetry_button_responsive.js108
-rw-r--r--devtools/client/shared/test/browser_telemetry_misc.js51
-rw-r--r--devtools/client/shared/test/browser_telemetry_sidebar.js233
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolbox.js34
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_inspector.js39
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_jsdebugger.js39
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_jsprofiler.js39
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_netmonitor.js39
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_options.js34
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_storage.js34
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_styleeditor.js39
-rw-r--r--devtools/client/shared/test/browser_telemetry_toolboxtabs_webconsole.js39
-rw-r--r--devtools/client/shared/test/browser_theme.js145
-rw-r--r--devtools/client/shared/test/browser_theme_switching.js69
-rw-r--r--devtools/client/shared/test/browser_treeWidget_basic.js391
-rw-r--r--devtools/client/shared/test/browser_treeWidget_keyboard_interaction.js291
-rw-r--r--devtools/client/shared/test/browser_treeWidget_mouse_interaction.js185
-rw-r--r--devtools/client/shared/test/code_WorkerTargetActor.attachThread-worker.js18
-rw-r--r--devtools/client/shared/test/code_listworkers-worker1.js3
-rw-r--r--devtools/client/shared/test/code_listworkers-worker2.js3
-rw-r--r--devtools/client/shared/test/doc_WorkerTargetActor.attachThread-tab.html8
-rw-r--r--devtools/client/shared/test/doc_cubic-bezier-01.html1
-rw-r--r--devtools/client/shared/test/doc_cubic-bezier-02.html3
-rw-r--r--devtools/client/shared/test/doc_empty-tab-01.html14
-rw-r--r--devtools/client/shared/test/doc_empty-tab-02.html14
-rw-r--r--devtools/client/shared/test/doc_event-listeners-01.html45
-rw-r--r--devtools/client/shared/test/doc_event-listeners-03.html65
-rw-r--r--devtools/client/shared/test/doc_filter-editor-01.html1
-rw-r--r--devtools/client/shared/test/doc_html_tooltip-02.xhtml15
-rw-r--r--devtools/client/shared/test/doc_html_tooltip-03.xhtml19
-rw-r--r--devtools/client/shared/test/doc_html_tooltip-04.xhtml15
-rw-r--r--devtools/client/shared/test/doc_html_tooltip-05.xhtml12
-rw-r--r--devtools/client/shared/test/doc_html_tooltip.xhtml12
-rw-r--r--devtools/client/shared/test/doc_html_tooltip_arrow-01.xhtml90
-rw-r--r--devtools/client/shared/test/doc_html_tooltip_arrow-02.xhtml65
-rw-r--r--devtools/client/shared/test/doc_html_tooltip_doorhanger-01.xhtml73
-rw-r--r--devtools/client/shared/test/doc_html_tooltip_doorhanger-02.xhtml34
-rw-r--r--devtools/client/shared/test/doc_html_tooltip_hover.xhtml13
-rw-r--r--devtools/client/shared/test/doc_html_tooltip_rtl.xhtml14
-rw-r--r--devtools/client/shared/test/doc_inplace-editor_autocomplete_offset.xhtml7
-rw-r--r--devtools/client/shared/test/doc_layoutHelpers.html31
-rw-r--r--devtools/client/shared/test/doc_layoutHelpers_getBoxQuads1.html65
-rw-r--r--devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-a.html20
-rw-r--r--devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-b-and-d.html29
-rw-r--r--devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html27
-rw-r--r--devtools/client/shared/test/doc_listworkers-tab.html8
-rw-r--r--devtools/client/shared/test/doc_native-event-handler.html25
-rw-r--r--devtools/client/shared/test/doc_script-switching-01.html18
-rw-r--r--devtools/client/shared/test/doc_script-switching-02.html18
-rw-r--r--devtools/client/shared/test/doc_spectrum.html2
-rw-r--r--devtools/client/shared/test/doc_tableWidget_basic.html7
-rw-r--r--devtools/client/shared/test/doc_tableWidget_keyboard_interaction.xhtml8
-rw-r--r--devtools/client/shared/test/doc_tableWidget_mouse_interaction.xhtml7
-rw-r--r--devtools/client/shared/test/doc_templater_basic.html12
-rw-r--r--devtools/client/shared/test/dummy.html1
-rw-r--r--devtools/client/shared/test/head.js211
-rw-r--r--devtools/client/shared/test/helper_color_data.js1508
-rw-r--r--devtools/client/shared/test/helper_html_tooltip.js116
-rw-r--r--devtools/client/shared/test/helper_inplace_editor.js153
-rw-r--r--devtools/client/shared/test/highlighter-test-actor.js913
-rw-r--r--devtools/client/shared/test/leakhunt.js173
-rw-r--r--devtools/client/shared/test/shared-head.js2209
-rw-r--r--devtools/client/shared/test/telemetry-test-helpers.js273
-rw-r--r--devtools/client/shared/test/test-mocked-module.js11
-rw-r--r--devtools/client/shared/test/testactors.js27
-rw-r--r--devtools/client/shared/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/shared/test/xpcshell/head.js10
-rw-r--r--devtools/client/shared/test/xpcshell/test_VariablesView_filtering-without-controller.js37
-rw-r--r--devtools/client/shared/test/xpcshell/test_VariablesView_getString_promise.js81
-rw-r--r--devtools/client/shared/test/xpcshell/test_WeakMapMap.js69
-rw-r--r--devtools/client/shared/test/xpcshell/test_advanceValidate.js33
-rw-r--r--devtools/client/shared/test/xpcshell/test_attribute-parsing-01.js77
-rw-r--r--devtools/client/shared/test/xpcshell/test_attribute-parsing-02.js148
-rw-r--r--devtools/client/shared/test/xpcshell/test_bezierCanvas.js122
-rw-r--r--devtools/client/shared/test/xpcshell/test_classnames.js53
-rw-r--r--devtools/client/shared/test/xpcshell/test_cssAngle.js32
-rw-r--r--devtools/client/shared/test/xpcshell/test_cssColor-01.js66
-rw-r--r--devtools/client/shared/test/xpcshell/test_cssColor-02.js52
-rw-r--r--devtools/client/shared/test/xpcshell/test_cssColor-8-digit-hex.js22
-rw-r--r--devtools/client/shared/test/xpcshell/test_cssColorDatabase.js17
-rw-r--r--devtools/client/shared/test/xpcshell/test_cubicBezier.js152
-rw-r--r--devtools/client/shared/test/xpcshell/test_curl.js389
-rw-r--r--devtools/client/shared/test/xpcshell/test_escapeCSSComment.js41
-rw-r--r--devtools/client/shared/test/xpcshell/test_hasCSSVariable.js60
-rw-r--r--devtools/client/shared/test/xpcshell/test_linearEasing.js217
-rw-r--r--devtools/client/shared/test/xpcshell/test_parseDeclarations.js766
-rw-r--r--devtools/client/shared/test/xpcshell/test_parsePseudoClassesAndAttributes.js202
-rw-r--r--devtools/client/shared/test/xpcshell/test_parseSingleValue.js106
-rw-r--r--devtools/client/shared/test/xpcshell/test_rewriteDeclarations.js816
-rw-r--r--devtools/client/shared/test/xpcshell/test_source-utils.js247
-rw-r--r--devtools/client/shared/test/xpcshell/test_suggestion-picker.js147
-rw-r--r--devtools/client/shared/test/xpcshell/test_undoStack.js88
-rw-r--r--devtools/client/shared/test/xpcshell/test_unicode-url.js258
-rw-r--r--devtools/client/shared/test/xpcshell/xpcshell.ini35
-rw-r--r--devtools/client/shared/theme-switching.js143
-rw-r--r--devtools/client/shared/theme.js102
-rw-r--r--devtools/client/shared/thread-utils.js86
-rw-r--r--devtools/client/shared/toolbarbutton.css86
-rw-r--r--devtools/client/shared/undo.js190
-rw-r--r--devtools/client/shared/unicode-url.js106
-rw-r--r--devtools/client/shared/vendor/D3_LICENSE26
-rw-r--r--devtools/client/shared/vendor/DAGRE_D3_LICENSE19
-rw-r--r--devtools/client/shared/vendor/FLUENT_REACT_UPGRADING33
-rw-r--r--devtools/client/shared/vendor/MD5_LICENSE27
-rw-r--r--devtools/client/shared/vendor/MD5_UPGRADING.md29
-rw-r--r--devtools/client/shared/vendor/REACT_PROP_TYPES_UPGRADING.md37
-rw-r--r--devtools/client/shared/vendor/REACT_REDUX_LICENSE21
-rw-r--r--devtools/client/shared/vendor/REACT_REDUX_UPGRADING.md36
-rw-r--r--devtools/client/shared/vendor/REACT_ROUTER_DOM_LICENSE21
-rw-r--r--devtools/client/shared/vendor/REACT_ROUTER_DOM_UPGRADING.md23
-rw-r--r--devtools/client/shared/vendor/REACT_UPGRADING.md160
-rw-r--r--devtools/client/shared/vendor/REDUX_LICENSE21
-rw-r--r--devtools/client/shared/vendor/REDUX_UPGRADING.md32
-rw-r--r--devtools/client/shared/vendor/RESELECT_LICENSE21
-rw-r--r--devtools/client/shared/vendor/RESELECT_UPGRADING12
-rw-r--r--devtools/client/shared/vendor/WASMPARSER_UPGRADING14
-rw-r--r--devtools/client/shared/vendor/WHATWG_URL_LICENSE21
-rw-r--r--devtools/client/shared/vendor/WasmDis.js2020
-rw-r--r--devtools/client/shared/vendor/WasmParser.js3883
-rw-r--r--devtools/client/shared/vendor/dagre-d3.js4560
-rw-r--r--devtools/client/shared/vendor/fluent-react.js686
-rw-r--r--devtools/client/shared/vendor/immutable.js4997
-rw-r--r--devtools/client/shared/vendor/jszip.js11367
-rw-r--r--devtools/client/shared/vendor/md5.js7
-rwxr-xr-xdevtools/client/shared/vendor/micromatch/LICENSE21
-rw-r--r--devtools/client/shared/vendor/micromatch/UPGRADE.md17
-rw-r--r--devtools/client/shared/vendor/micromatch/micromatch.js5424
-rw-r--r--devtools/client/shared/vendor/micromatch/moz.build9
-rw-r--r--devtools/client/shared/vendor/micromatch/package-lock.json4497
-rw-r--r--devtools/client/shared/vendor/micromatch/package.json26
-rw-r--r--devtools/client/shared/vendor/micromatch/webpack.config.js20
-rw-r--r--devtools/client/shared/vendor/moz.build43
-rw-r--r--devtools/client/shared/vendor/react-dev.js3155
-rw-r--r--devtools/client/shared/vendor/react-dom-dev.js21413
-rw-r--r--devtools/client/shared/vendor/react-dom-factories.js195
-rw-r--r--devtools/client/shared/vendor/react-dom-server-dev.js3801
-rw-r--r--devtools/client/shared/vendor/react-dom-server.js2188
-rw-r--r--devtools/client/shared/vendor/react-dom-test-utils-dev.js1302
-rw-r--r--devtools/client/shared/vendor/react-dom-test-utils.js1150
-rw-r--r--devtools/client/shared/vendor/react-dom.js16370
-rw-r--r--devtools/client/shared/vendor/react-prop-types-dev.js1363
-rw-r--r--devtools/client/shared/vendor/react-prop-types.js1363
-rw-r--r--devtools/client/shared/vendor/react-redux.js2089
-rw-r--r--devtools/client/shared/vendor/react-router-dom.js3788
-rw-r--r--devtools/client/shared/vendor/react-test-renderer-shallow.js955
-rw-r--r--devtools/client/shared/vendor/react-test-renderer.js10580
-rw-r--r--devtools/client/shared/vendor/react.js2240
-rw-r--r--devtools/client/shared/vendor/redux.js715
-rw-r--r--devtools/client/shared/vendor/reselect.js291
-rw-r--r--devtools/client/shared/vendor/source-map/GITHUB_CHANGESET1
-rw-r--r--devtools/client/shared/vendor/source-map/LICENSE28
-rw-r--r--devtools/client/shared/vendor/source-map/lib/array-set.js100
-rw-r--r--devtools/client/shared/vendor/source-map/lib/base64-vlq.js94
-rw-r--r--devtools/client/shared/vendor/source-map/lib/base64.js19
-rw-r--r--devtools/client/shared/vendor/source-map/lib/binary-search.js113
-rw-r--r--devtools/client/shared/vendor/source-map/lib/mapping-list.js83
-rw-r--r--devtools/client/shared/vendor/source-map/lib/mappings.wasmbin0 -> 48526 bytes-rw-r--r--devtools/client/shared/vendor/source-map/lib/moz.build21
-rw-r--r--devtools/client/shared/vendor/source-map/lib/read-wasm.js46
-rw-r--r--devtools/client/shared/vendor/source-map/lib/source-map-consumer.js1078
-rw-r--r--devtools/client/shared/vendor/source-map/lib/source-map-generator.js439
-rw-r--r--devtools/client/shared/vendor/source-map/lib/source-node.js430
-rw-r--r--devtools/client/shared/vendor/source-map/lib/url.js21
-rw-r--r--devtools/client/shared/vendor/source-map/lib/util.js444
-rw-r--r--devtools/client/shared/vendor/source-map/lib/wasm.js138
-rw-r--r--devtools/client/shared/vendor/source-map/moz.build13
-rw-r--r--devtools/client/shared/vendor/source-map/source-map.js10
-rwxr-xr-xdevtools/client/shared/vendor/source-map/update.sh38
-rw-r--r--devtools/client/shared/vendor/whatwg-url.js8588
-rw-r--r--devtools/client/shared/view-source.js197
-rw-r--r--devtools/client/shared/webgl-utils.js53
-rw-r--r--devtools/client/shared/widgets/Chart.js532
-rw-r--r--devtools/client/shared/widgets/CubicBezierPresets.js64
-rw-r--r--devtools/client/shared/widgets/CubicBezierWidget.js986
-rw-r--r--devtools/client/shared/widgets/FilterWidget.js1131
-rw-r--r--devtools/client/shared/widgets/LinearEasingFunctionWidget.js731
-rw-r--r--devtools/client/shared/widgets/ShapesInContextEditor.js347
-rw-r--r--devtools/client/shared/widgets/Spectrum.js783
-rw-r--r--devtools/client/shared/widgets/TableWidget.js2031
-rw-r--r--devtools/client/shared/widgets/TreeWidget.js643
-rw-r--r--devtools/client/shared/widgets/cubic-bezier.css216
-rw-r--r--devtools/client/shared/widgets/filter-widget.css242
-rw-r--r--devtools/client/shared/widgets/linear-widget.css61
-rw-r--r--devtools/client/shared/widgets/moz.build22
-rw-r--r--devtools/client/shared/widgets/spectrum.css331
-rw-r--r--devtools/client/shared/widgets/tooltip/EventTooltipHelper.js384
-rw-r--r--devtools/client/shared/widgets/tooltip/HTMLTooltip.js1061
-rw-r--r--devtools/client/shared/widgets/tooltip/ImageTooltipHelper.js145
-rw-r--r--devtools/client/shared/widgets/tooltip/RulePreviewTooltip.js69
-rw-r--r--devtools/client/shared/widgets/tooltip/SwatchBasedEditorTooltip.js270
-rw-r--r--devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js357
-rw-r--r--devtools/client/shared/widgets/tooltip/SwatchCubicBezierTooltip.js95
-rw-r--r--devtools/client/shared/widgets/tooltip/SwatchFilterTooltip.js117
-rw-r--r--devtools/client/shared/widgets/tooltip/SwatchLinearEasingFunctionTooltip.js97
-rw-r--r--devtools/client/shared/widgets/tooltip/TooltipToggle.js203
-rw-r--r--devtools/client/shared/widgets/tooltip/VariableTooltipHelper.js31
-rw-r--r--devtools/client/shared/widgets/tooltip/css-compatibility-tooltip-helper.js292
-rw-r--r--devtools/client/shared/widgets/tooltip/css-query-container-tooltip-helper.js145
-rw-r--r--devtools/client/shared/widgets/tooltip/inactive-css-tooltip-helper.js127
-rw-r--r--devtools/client/shared/widgets/tooltip/moz.build22
-rw-r--r--devtools/client/shared/widgets/view-helpers.js430
-rw-r--r--devtools/client/shared/widgets/widgets.css79
-rw-r--r--devtools/client/shared/worker-utils.js157
-rw-r--r--devtools/client/shared/workers-listener.js145
-rw-r--r--devtools/client/shared/zoom-keys.js75
-rw-r--r--devtools/client/storage/VariablesView.sys.mjs4445
-rw-r--r--devtools/client/storage/index.xhtml106
-rw-r--r--devtools/client/storage/moz.build20
-rw-r--r--devtools/client/storage/panel.js57
-rw-r--r--devtools/client/storage/test/browser.ini122
-rw-r--r--devtools/client/storage/test/browser_storage_basic.js172
-rw-r--r--devtools/client/storage/test/browser_storage_basic_usercontextid_1.js162
-rw-r--r--devtools/client/storage/test/browser_storage_basic_usercontextid_2.js169
-rw-r--r--devtools/client/storage/test/browser_storage_basic_with_fragment.js177
-rw-r--r--devtools/client/storage/test/browser_storage_cache_delete.js53
-rw-r--r--devtools/client/storage/test/browser_storage_cache_error.js35
-rw-r--r--devtools/client/storage/test/browser_storage_cache_navigation.js84
-rw-r--r--devtools/client/storage/test/browser_storage_cache_overflow.js32
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_add.js30
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_delete_all.js185
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_domain.js25
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_domain_port.js25
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_edit.js27
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_edit_keyboard.js23
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_hostOnly.js27
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_navigation.js139
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_samesite.js42
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_sort.js64
-rw-r--r--devtools/client/storage/test/browser_storage_cookies_tab_navigation.js25
-rw-r--r--devtools/client/storage/test/browser_storage_delete.js79
-rw-r--r--devtools/client/storage/test/browser_storage_delete_all.js115
-rw-r--r--devtools/client/storage/test/browser_storage_delete_tree.js93
-rw-r--r--devtools/client/storage/test/browser_storage_delete_usercontextid.js238
-rw-r--r--devtools/client/storage/test/browser_storage_dfpi.js164
-rw-r--r--devtools/client/storage/test/browser_storage_dfpi_always_partition_storage.js70
-rw-r--r--devtools/client/storage/test/browser_storage_dom_cache_disabled.js42
-rw-r--r--devtools/client/storage/test/browser_storage_dynamic_updates_cookies.js239
-rw-r--r--devtools/client/storage/test/browser_storage_dynamic_updates_localStorage.js70
-rw-r--r--devtools/client/storage/test/browser_storage_dynamic_updates_sessionStorage.js90
-rw-r--r--devtools/client/storage/test/browser_storage_empty_objectstores.js90
-rw-r--r--devtools/client/storage/test/browser_storage_file_url.js64
-rw-r--r--devtools/client/storage/test/browser_storage_fission_cache.js44
-rw-r--r--devtools/client/storage/test/browser_storage_fission_cookies.js64
-rw-r--r--devtools/client/storage/test/browser_storage_fission_hide_aboutblank.js26
-rw-r--r--devtools/client/storage/test/browser_storage_fission_indexeddb.js62
-rw-r--r--devtools/client/storage/test/browser_storage_fission_local_storage.js45
-rw-r--r--devtools/client/storage/test/browser_storage_fission_session_storage.js45
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_add_button_hidden.js35
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_delete.js54
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_delete_blocked.js60
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_duplicate_names.js24
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_hide_internal_dbs.js62
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_navigation.js72
-rw-r--r--devtools/client/storage/test/browser_storage_indexeddb_overflow.js36
-rw-r--r--devtools/client/storage/test/browser_storage_keys.js164
-rw-r--r--devtools/client/storage/test/browser_storage_localstorage_add.js20
-rw-r--r--devtools/client/storage/test/browser_storage_localstorage_edit.js24
-rw-r--r--devtools/client/storage/test/browser_storage_localstorage_error.js25
-rw-r--r--devtools/client/storage/test/browser_storage_localstorage_navigation.js63
-rw-r--r--devtools/client/storage/test/browser_storage_localstorage_rapid_add_remove.js30
-rw-r--r--devtools/client/storage/test/browser_storage_overflow.js104
-rw-r--r--devtools/client/storage/test/browser_storage_search.js140
-rw-r--r--devtools/client/storage/test/browser_storage_search_keyboard_trap.js15
-rw-r--r--devtools/client/storage/test/browser_storage_sessionstorage_add.js20
-rw-r--r--devtools/client/storage/test/browser_storage_sessionstorage_edit.js24
-rw-r--r--devtools/client/storage/test/browser_storage_sessionstorage_navigation.js60
-rw-r--r--devtools/client/storage/test/browser_storage_sidebar.js136
-rw-r--r--devtools/client/storage/test/browser_storage_sidebar_parsetree.js115
-rw-r--r--devtools/client/storage/test/browser_storage_sidebar_toggle.js65
-rw-r--r--devtools/client/storage/test/browser_storage_sidebar_update.js45
-rw-r--r--devtools/client/storage/test/browser_storage_type_descriptions.js79
-rw-r--r--devtools/client/storage/test/browser_storage_values.js261
-rw-r--r--devtools/client/storage/test/browser_storage_webext_storage_local.js296
-rw-r--r--devtools/client/storage/test/head.js1177
-rw-r--r--devtools/client/storage/test/storage-blank.html9
-rw-r--r--devtools/client/storage/test/storage-cache-basic-iframe.html21
-rw-r--r--devtools/client/storage/test/storage-cache-basic.html22
-rw-r--r--devtools/client/storage/test/storage-cache-error.html11
-rw-r--r--devtools/client/storage/test/storage-cache-overflow.html23
-rw-r--r--devtools/client/storage/test/storage-complex-keys.html78
-rw-r--r--devtools/client/storage/test/storage-complex-values.html124
-rw-r--r--devtools/client/storage/test/storage-cookies-samesite.html17
-rw-r--r--devtools/client/storage/test/storage-cookies-sort.html26
-rw-r--r--devtools/client/storage/test/storage-cookies.html24
-rw-r--r--devtools/client/storage/test/storage-dfpi.html11
-rw-r--r--devtools/client/storage/test/storage-empty-objectstores.html62
-rw-r--r--devtools/client/storage/test/storage-file-url.html59
-rw-r--r--devtools/client/storage/test/storage-idb-delete-blocked.html47
-rw-r--r--devtools/client/storage/test/storage-indexeddb-duplicate-names.html43
-rw-r--r--devtools/client/storage/test/storage-indexeddb-iframe.html37
-rw-r--r--devtools/client/storage/test/storage-indexeddb-simple-alt.html38
-rw-r--r--devtools/client/storage/test/storage-indexeddb-simple.html38
-rw-r--r--devtools/client/storage/test/storage-listings-usercontextid.html131
-rw-r--r--devtools/client/storage/test/storage-listings-with-fragment.html134
-rw-r--r--devtools/client/storage/test/storage-listings.html145
-rw-r--r--devtools/client/storage/test/storage-localstorage.html23
-rw-r--r--devtools/client/storage/test/storage-overflow-indexeddb.html49
-rw-r--r--devtools/client/storage/test/storage-overflow.html19
-rw-r--r--devtools/client/storage/test/storage-search.html28
-rw-r--r--devtools/client/storage/test/storage-secured-iframe-usercontextid.html91
-rw-r--r--devtools/client/storage/test/storage-secured-iframe.html94
-rw-r--r--devtools/client/storage/test/storage-sessionstorage.html23
-rw-r--r--devtools/client/storage/test/storage-sidebar-parsetree.html40
-rw-r--r--devtools/client/storage/test/storage-unsecured-iframe-usercontextid.html19
-rw-r--r--devtools/client/storage/test/storage-unsecured-iframe.html22
-rw-r--r--devtools/client/storage/test/storage-updates.html68
-rw-r--r--devtools/client/storage/ui.js1769
-rw-r--r--devtools/client/storage/utils/doc-utils.js35
-rw-r--r--devtools/client/storage/utils/l10n.js12
-rw-r--r--devtools/client/storage/utils/moz.build8
-rw-r--r--devtools/client/styleeditor/StyleEditorUI.sys.mjs1761
-rw-r--r--devtools/client/styleeditor/StyleEditorUtil.sys.mjs213
-rw-r--r--devtools/client/styleeditor/StyleSheetEditor.sys.mjs1040
-rw-r--r--devtools/client/styleeditor/index.xhtml238
-rw-r--r--devtools/client/styleeditor/moz.build18
-rw-r--r--devtools/client/styleeditor/original-source.js103
-rw-r--r--devtools/client/styleeditor/panel.js171
-rw-r--r--devtools/client/styleeditor/test/autocomplete.html23
-rw-r--r--devtools/client/styleeditor/test/browser.ini141
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_add_stylesheet.js36
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_at_rules_sidebar.js312
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_autocomplete-disabled.js42
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_autocomplete.js284
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_bom.js37
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_bug_1247083_inline_stylesheet_numbering.js104
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_bug_1405342_serviceworker_iframes.js27
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_bug_740541_iframes.js107
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_bug_851132_middle_click.js63
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_bug_870339.js49
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_copyurl.js43
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_enabled.js129
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_fetch-from-netmonitor.js80
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_filesave.js91
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_filter.js343
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_fission_switch_target.js33
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_highlight-selector.js199
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_import.js54
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_import_rule.js32
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_init.js52
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_inline_friendly_names.js101
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_loading.js36
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js70
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_links.js158
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_sourcemaps.js62
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_missing_stylesheet.js37
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_navigate.js31
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_new.js97
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_nostyle.js56
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_opentab.js133
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_pretty.js82
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js76
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_reload.js42
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_resize_performance.js62
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_scroll.js96
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_selectstylesheet.js25
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sidebars.js67
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sourcemap_chrome.js47
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sourcemap_large.js34
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sourcemap_watching.js155
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sourcemaps.js152
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sourcemaps_inline.js89
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sv_keynav.js85
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sv_resize.js53
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_sync.js73
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_syncAddProperty.js52
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_syncAddRule.js30
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_syncAlreadyOpen.js50
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_syncEditSelector.js38
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_syncIntoRuleView.js41
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_transition_rule.js51
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_xul.js23
-rw-r--r--devtools/client/styleeditor/test/browser_toolbox_styleeditor.js100
-rw-r--r--devtools/client/styleeditor/test/bug_1405342_serviceworker_iframes.html10
-rw-r--r--devtools/client/styleeditor/test/doc_empty.html3
-rw-r--r--devtools/client/styleeditor/test/doc_fetch_from_netmonitor.html13
-rw-r--r--devtools/client/styleeditor/test/doc_long.css402
-rw-r--r--devtools/client/styleeditor/test/doc_long_string.css43
-rw-r--r--devtools/client/styleeditor/test/doc_short_string.css15
-rw-r--r--devtools/client/styleeditor/test/doc_sourcemap_chrome.html11
-rw-r--r--devtools/client/styleeditor/test/doc_xulpage.xhtml7
-rw-r--r--devtools/client/styleeditor/test/four.html25
-rw-r--r--devtools/client/styleeditor/test/head.js201
-rw-r--r--devtools/client/styleeditor/test/iframe_service_worker.js12
-rw-r--r--devtools/client/styleeditor/test/iframe_with_service_worker.html33
-rw-r--r--devtools/client/styleeditor/test/import.css8
-rw-r--r--devtools/client/styleeditor/test/import.html11
-rw-r--r--devtools/client/styleeditor/test/import2.css8
-rw-r--r--devtools/client/styleeditor/test/inline-1.html19
-rw-r--r--devtools/client/styleeditor/test/inline-2.html19
-rw-r--r--devtools/client/styleeditor/test/longload.html29
-rw-r--r--devtools/client/styleeditor/test/longname.html12
-rw-r--r--devtools/client/styleeditor/test/many-media-rules-sourcemaps/index.html11
-rw-r--r--devtools/client/styleeditor/test/many-media-rules-sourcemaps/sourcemap/sourcemap-css/sourcemaps.css201
-rw-r--r--devtools/client/styleeditor/test/many-media-rules-sourcemaps/sourcemap/sourcemap-css/sourcemaps.css.map10
-rw-r--r--devtools/client/styleeditor/test/many-media-rules-sourcemaps/sourcemap/sourcemap-sass/_partial.scss25
-rw-r--r--devtools/client/styleeditor/test/many-media-rules-sourcemaps/sourcemap/sourcemap-sass/sourcemaps.scss27
-rw-r--r--devtools/client/styleeditor/test/media-rules-sourcemaps.html12
-rw-r--r--devtools/client/styleeditor/test/media-rules.css29
-rw-r--r--devtools/client/styleeditor/test/media-rules.html37
-rw-r--r--devtools/client/styleeditor/test/media-small.css4
-rw-r--r--devtools/client/styleeditor/test/media.html10
-rw-r--r--devtools/client/styleeditor/test/minified.html15
-rw-r--r--devtools/client/styleeditor/test/missing.html11
-rw-r--r--devtools/client/styleeditor/test/nostyle.html5
-rw-r--r--devtools/client/styleeditor/test/pretty.css2
-rw-r--r--devtools/client/styleeditor/test/resources_inpage.jsi12
-rw-r--r--devtools/client/styleeditor/test/resources_inpage1.css11
-rw-r--r--devtools/client/styleeditor/test/resources_inpage2.css11
-rw-r--r--devtools/client/styleeditor/test/selector-highlighter.html1
-rw-r--r--devtools/client/styleeditor/test/simple.css7
-rw-r--r--devtools/client/styleeditor/test/simple.css.gzbin0 -> 166 bytes-rw-r--r--devtools/client/styleeditor/test/simple.css.gz^headers^4
-rw-r--r--devtools/client/styleeditor/test/simple.gz.html23
-rw-r--r--devtools/client/styleeditor/test/simple.html24
-rw-r--r--devtools/client/styleeditor/test/sjs_huge-css-server.sjs19
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/contained.css4
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/media-rules.css8
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/media-rules.css.map6
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/sourcemaps.css7
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/sourcemaps.css.map6
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/sourcemaps.css.map^headers^2
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/sourcemaps_chrome.css7
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/test-bootstrap-scss.css4513
-rw-r--r--devtools/client/styleeditor/test/sourcemap-css/test-stylus.css7
-rw-r--r--devtools/client/styleeditor/test/sourcemap-sass/media-rules.scss11
-rw-r--r--devtools/client/styleeditor/test/sourcemap-sass/sourcemaps.scss10
-rw-r--r--devtools/client/styleeditor/test/sourcemap-sass/sourcemaps.scss^headers^2
-rw-r--r--devtools/client/styleeditor/test/sourcemap-styl/test-stylus.styl7
-rw-r--r--devtools/client/styleeditor/test/sourcemaps-inline.html17
-rw-r--r--devtools/client/styleeditor/test/sourcemaps-large.html11
-rw-r--r--devtools/client/styleeditor/test/sourcemaps-watching.html11
-rw-r--r--devtools/client/styleeditor/test/sourcemaps.html13
-rw-r--r--devtools/client/styleeditor/test/sync.html20
-rw-r--r--devtools/client/styleeditor/test/sync_with_csp.css10
-rw-r--r--devtools/client/styleeditor/test/sync_with_csp.html12
-rw-r--r--devtools/client/styleeditor/test/test_private.css3
-rw-r--r--devtools/client/styleeditor/test/test_private.html7
-rw-r--r--devtools/client/styleeditor/test/utf-16.cssbin0 -> 156 bytes-rw-r--r--devtools/client/styleeditor/test/veryveryverylongnamethatcanbreakthestyleeditor.css7
-rw-r--r--devtools/client/themes/aboutprofiling.css185
-rw-r--r--devtools/client/themes/accessibility-color-contrast.css77
-rw-r--r--devtools/client/themes/animation.css754
-rw-r--r--devtools/client/themes/audio/moz.build9
-rw-r--r--devtools/client/themes/audio/shutter.wavbin0 -> 25744 bytes-rw-r--r--devtools/client/themes/badge.css108
-rw-r--r--devtools/client/themes/boxmodel.css431
-rw-r--r--devtools/client/themes/breadcrumbs.css135
-rw-r--r--devtools/client/themes/changes.css211
-rw-r--r--devtools/client/themes/chart.css135
-rw-r--r--devtools/client/themes/common.css770
-rw-r--r--devtools/client/themes/compatibility.css326
-rw-r--r--devtools/client/themes/components-frame.css68
-rw-r--r--devtools/client/themes/components-h-split-box.css23
-rw-r--r--devtools/client/themes/computed.css250
-rw-r--r--devtools/client/themes/dark-theme.css268
-rw-r--r--devtools/client/themes/devtools-browser.css14
-rw-r--r--devtools/client/themes/fonts.css477
-rw-r--r--devtools/client/themes/images/aboutdebugging-connect-icon.svg6
-rw-r--r--devtools/client/themes/images/aboutdebugging-error.svg11
-rw-r--r--devtools/client/themes/images/aboutdebugging-fenix-nightly.svg16
-rw-r--r--devtools/client/themes/images/aboutdebugging-fenix.svg15
-rw-r--r--devtools/client/themes/images/aboutdebugging-firefox-aurora.svg4
-rw-r--r--devtools/client/themes/images/aboutdebugging-firefox-beta.svg4
-rw-r--r--devtools/client/themes/images/aboutdebugging-firefox-logo.svg6
-rw-r--r--devtools/client/themes/images/aboutdebugging-firefox-nightly.svg4
-rw-r--r--devtools/client/themes/images/aboutdebugging-firefox-release.svg4
-rw-r--r--devtools/client/themes/images/aboutdebugging-globe-icon.svg10
-rw-r--r--devtools/client/themes/images/aboutdebugging-information.svg8
-rw-r--r--devtools/client/themes/images/aboutdebugging-process-icon.svg7
-rw-r--r--devtools/client/themes/images/aboutdebugging-usb-icon.svg6
-rw-r--r--devtools/client/themes/images/accessibility.svg9
-rw-r--r--devtools/client/themes/images/add.svg6
-rw-r--r--devtools/client/themes/images/alert-small.svg6
-rw-r--r--devtools/client/themes/images/alert-tiny.svg6
-rw-r--r--devtools/client/themes/images/alert.svg6
-rw-r--r--devtools/client/themes/images/angle-swatch.svg16
-rw-r--r--devtools/client/themes/images/animation-fast-track.svg6
-rw-r--r--devtools/client/themes/images/application-debug.svg6
-rw-r--r--devtools/client/themes/images/application-manifest.svg6
-rw-r--r--devtools/client/themes/images/arrow-big.svg6
-rw-r--r--devtools/client/themes/images/arrow-dropdown-12.svg6
-rw-r--r--devtools/client/themes/images/arrow-e.svg6
-rw-r--r--devtools/client/themes/images/arrow.svg6
-rw-r--r--devtools/client/themes/images/arrowhead-down.svg6
-rw-r--r--devtools/client/themes/images/arrowhead-left.svg6
-rw-r--r--devtools/client/themes/images/arrowhead-right.svg6
-rw-r--r--devtools/client/themes/images/arrowhead-up.svg6
-rw-r--r--devtools/client/themes/images/blocked.svg7
-rw-r--r--devtools/client/themes/images/breadcrumbs-divider.svg18
-rw-r--r--devtools/client/themes/images/breadcrumbs-scrollbutton.svg6
-rw-r--r--devtools/client/themes/images/browsers/chrome.svg8
-rw-r--r--devtools/client/themes/images/browsers/edge.svg8
-rw-r--r--devtools/client/themes/images/browsers/firefox.svg8
-rw-r--r--devtools/client/themes/images/browsers/ie.svg8
-rw-r--r--devtools/client/themes/images/browsers/mobile.svg8
-rw-r--r--devtools/client/themes/images/browsers/opera.svg8
-rw-r--r--devtools/client/themes/images/browsers/safari.svg8
-rw-r--r--devtools/client/themes/images/case-match.svg6
-rw-r--r--devtools/client/themes/images/check.svg6
-rw-r--r--devtools/client/themes/images/checkbox.svg7
-rw-r--r--devtools/client/themes/images/clear.svg6
-rw-r--r--devtools/client/themes/images/close-3-pane.svg10
-rw-r--r--devtools/client/themes/images/close.svg6
-rw-r--r--devtools/client/themes/images/command-accented.svg7
-rw-r--r--devtools/client/themes/images/command-always-on-top-window.svg14
-rw-r--r--devtools/client/themes/images/command-bidi.svg7
-rw-r--r--devtools/client/themes/images/command-chevron.svg6
-rw-r--r--devtools/client/themes/images/command-console.svg7
-rw-r--r--devtools/client/themes/images/command-eyedropper.svg6
-rw-r--r--devtools/client/themes/images/command-frames.svg7
-rw-r--r--devtools/client/themes/images/command-measure.svg7
-rw-r--r--devtools/client/themes/images/command-noautohide.svg6
-rw-r--r--devtools/client/themes/images/command-pick-accessibility.svg7
-rw-r--r--devtools/client/themes/images/command-responsivemode.svg8
-rw-r--r--devtools/client/themes/images/command-rulers.svg7
-rw-r--r--devtools/client/themes/images/command-screenshot.svg7
-rw-r--r--devtools/client/themes/images/copy.svg6
-rw-r--r--devtools/client/themes/images/cubic-bezier-swatch.svg7
-rw-r--r--devtools/client/themes/images/datastore.svg9
-rw-r--r--devtools/client/themes/images/debugging-addons.svg6
-rw-r--r--devtools/client/themes/images/debugging-tabs.svg6
-rw-r--r--devtools/client/themes/images/debugging-workers.svg11
-rw-r--r--devtools/client/themes/images/devtools-reps/jump-definition.svg8
-rw-r--r--devtools/client/themes/images/diff.svg9
-rw-r--r--devtools/client/themes/images/dock-bottom.svg10
-rw-r--r--devtools/client/themes/images/dock-side-left.svg10
-rw-r--r--devtools/client/themes/images/dock-side-right.svg10
-rw-r--r--devtools/client/themes/images/dock-undock.svg11
-rw-r--r--devtools/client/themes/images/dropmarker.svg6
-rw-r--r--devtools/client/themes/images/error-small.svg6
-rw-r--r--devtools/client/themes/images/error-tiny.svg6
-rw-r--r--devtools/client/themes/images/error.svg6
-rw-r--r--devtools/client/themes/images/eye-closed.svg10
-rw-r--r--devtools/client/themes/images/eye-opened.svg7
-rw-r--r--devtools/client/themes/images/eye.svg8
-rw-r--r--devtools/client/themes/images/filter-small.svg7
-rw-r--r--devtools/client/themes/images/filter-swatch.svg11
-rw-r--r--devtools/client/themes/images/flexbox-swatch.svg8
-rw-r--r--devtools/client/themes/images/folder.svg6
-rw-r--r--devtools/client/themes/images/fox-smiling.svg37
-rw-r--r--devtools/client/themes/images/geometry-editor.svg7
-rw-r--r--devtools/client/themes/images/globe.svg6
-rw-r--r--devtools/client/themes/images/grid.svg6
-rw-r--r--devtools/client/themes/images/help.svg7
-rw-r--r--devtools/client/themes/images/highlight-selector.svg6
-rw-r--r--devtools/client/themes/images/import.svg6
-rw-r--r--devtools/client/themes/images/info-small.svg7
-rw-r--r--devtools/client/themes/images/info-tiny.svg6
-rw-r--r--devtools/client/themes/images/info.svg6
-rw-r--r--devtools/client/themes/images/item-arrow-dark-ltr.svg7
-rw-r--r--devtools/client/themes/images/item-arrow-dark-rtl.svg7
-rw-r--r--devtools/client/themes/images/item-arrow-ltr.svg7
-rw-r--r--devtools/client/themes/images/item-arrow-rtl.svg7
-rw-r--r--devtools/client/themes/images/linear-easing-swatch.svg7
-rw-r--r--devtools/client/themes/images/lock.svg6
-rw-r--r--devtools/client/themes/images/mdn.svg11
-rw-r--r--devtools/client/themes/images/more.svg8
-rw-r--r--devtools/client/themes/images/next.svg7
-rw-r--r--devtools/client/themes/images/open-3-pane.svg10
-rw-r--r--devtools/client/themes/images/open-inspector.svg6
-rw-r--r--devtools/client/themes/images/pane-collapse.svg7
-rw-r--r--devtools/client/themes/images/pane-expand.svg7
-rw-r--r--devtools/client/themes/images/pause.svg6
-rw-r--r--devtools/client/themes/images/pencil-icon.svg6
-rw-r--r--devtools/client/themes/images/play.svg6
-rw-r--r--devtools/client/themes/images/profiler-stopwatch.svg6
-rw-r--r--devtools/client/themes/images/pseudo-class.svg7
-rw-r--r--devtools/client/themes/images/reload.svg6
-rw-r--r--devtools/client/themes/images/report.svg6
-rw-r--r--devtools/client/themes/images/reveal.svg10
-rw-r--r--devtools/client/themes/images/rewind.svg6
-rw-r--r--devtools/client/themes/images/rules-view-dark-mode-simulation.svg6
-rw-r--r--devtools/client/themes/images/rules-view-light-mode-simulation.svg7
-rw-r--r--devtools/client/themes/images/rules-view-print-simulation.svg7
-rw-r--r--devtools/client/themes/images/sad-face.svg9
-rw-r--r--devtools/client/themes/images/search-clear.svg6
-rw-r--r--devtools/client/themes/images/search.svg7
-rw-r--r--devtools/client/themes/images/security-state-insecure.svg7
-rw-r--r--devtools/client/themes/images/security-state-secure.svg6
-rw-r--r--devtools/client/themes/images/security-state-weak.svg7
-rw-r--r--devtools/client/themes/images/select-arrow.svg8
-rw-r--r--devtools/client/themes/images/settings.svg6
-rw-r--r--devtools/client/themes/images/shape-swatch.svg10
-rw-r--r--devtools/client/themes/images/sort-ascending-arrow.svg6
-rw-r--r--devtools/client/themes/images/sort-descending-arrow.svg6
-rw-r--r--devtools/client/themes/images/tool-accessibility.svg7
-rw-r--r--devtools/client/themes/images/tool-application.svg6
-rw-r--r--devtools/client/themes/images/tool-debugger.svg6
-rw-r--r--devtools/client/themes/images/tool-dom.svg6
-rw-r--r--devtools/client/themes/images/tool-inspector.svg6
-rw-r--r--devtools/client/themes/images/tool-memory.svg6
-rw-r--r--devtools/client/themes/images/tool-network.svg6
-rw-r--r--devtools/client/themes/images/tool-profiler.svg6
-rw-r--r--devtools/client/themes/images/tool-storage.svg6
-rw-r--r--devtools/client/themes/images/tool-styleeditor.svg6
-rw-r--r--devtools/client/themes/images/tool-webconsole.svg7
-rw-r--r--devtools/client/themes/images/vview-delete.svg6
-rw-r--r--devtools/client/themes/images/vview-edit.svg6
-rw-r--r--devtools/client/themes/images/vview-lock.svg6
-rw-r--r--devtools/client/themes/images/webconsole/editor.svg7
-rw-r--r--devtools/client/themes/images/webconsole/input.svg6
-rw-r--r--devtools/client/themes/images/webconsole/navigation.svg7
-rw-r--r--devtools/client/themes/images/webconsole/return.svg6
-rw-r--r--devtools/client/themes/images/webconsole/reverse-search.svg7
-rw-r--r--devtools/client/themes/images/webconsole/run.svg6
-rw-r--r--devtools/client/themes/inspector.css221
-rw-r--r--devtools/client/themes/layout.css736
-rw-r--r--devtools/client/themes/light-theme.css250
-rw-r--r--devtools/client/themes/markup.css449
-rw-r--r--devtools/client/themes/memory.css649
-rw-r--r--devtools/client/themes/moz.build9
-rw-r--r--devtools/client/themes/perf.css277
-rw-r--r--devtools/client/themes/rules.css839
-rw-r--r--devtools/client/themes/splitters.css101
-rw-r--r--devtools/client/themes/splitview.css145
-rw-r--r--devtools/client/themes/storage.css169
-rw-r--r--devtools/client/themes/styleeditor.css283
-rw-r--r--devtools/client/themes/toolbars.css197
-rw-r--r--devtools/client/themes/toolbox.css660
-rw-r--r--devtools/client/themes/tooltips.css912
-rw-r--r--devtools/client/themes/variables.css359
-rw-r--r--devtools/client/themes/webconsole.css1022
-rw-r--r--devtools/client/themes/widgets.css687
-rw-r--r--devtools/client/webconsole/README.md69
-rw-r--r--devtools/client/webconsole/actions/autocomplete.js376
-rw-r--r--devtools/client/webconsole/actions/filters.js59
-rw-r--r--devtools/client/webconsole/actions/history.js90
-rw-r--r--devtools/client/webconsole/actions/index.js21
-rw-r--r--devtools/client/webconsole/actions/input.js466
-rw-r--r--devtools/client/webconsole/actions/messages.js173
-rw-r--r--devtools/client/webconsole/actions/moz.build17
-rw-r--r--devtools/client/webconsole/actions/notifications.js48
-rw-r--r--devtools/client/webconsole/actions/object.js63
-rw-r--r--devtools/client/webconsole/actions/toolbox.js49
-rw-r--r--devtools/client/webconsole/actions/ui.js247
-rw-r--r--devtools/client/webconsole/browser-console-manager.js186
-rw-r--r--devtools/client/webconsole/browser-console.js137
-rw-r--r--devtools/client/webconsole/components/App.css502
-rw-r--r--devtools/client/webconsole/components/App.js508
-rw-r--r--devtools/client/webconsole/components/FilterBar/ConsoleSettings.js194
-rw-r--r--devtools/client/webconsole/components/FilterBar/FilterBar.js441
-rw-r--r--devtools/client/webconsole/components/FilterBar/FilterButton.js37
-rw-r--r--devtools/client/webconsole/components/FilterBar/FilterCheckbox.js31
-rw-r--r--devtools/client/webconsole/components/FilterBar/moz.build11
-rw-r--r--devtools/client/webconsole/components/Input/ConfirmDialog.js197
-rw-r--r--devtools/client/webconsole/components/Input/EagerEvaluation.css122
-rw-r--r--devtools/client/webconsole/components/Input/EagerEvaluation.js147
-rw-r--r--devtools/client/webconsole/components/Input/EditorToolbar.js162
-rw-r--r--devtools/client/webconsole/components/Input/EvaluationContextSelector.css33
-rw-r--r--devtools/client/webconsole/components/Input/EvaluationContextSelector.js290
-rw-r--r--devtools/client/webconsole/components/Input/JSTerm.js1605
-rw-r--r--devtools/client/webconsole/components/Input/ReverseSearchInput.css124
-rw-r--r--devtools/client/webconsole/components/Input/ReverseSearchInput.js285
-rw-r--r--devtools/client/webconsole/components/Input/moz.build13
-rw-r--r--devtools/client/webconsole/components/Output/CollapseButton.js33
-rw-r--r--devtools/client/webconsole/components/Output/ConsoleOutput.js378
-rw-r--r--devtools/client/webconsole/components/Output/ConsoleTable.js272
-rw-r--r--devtools/client/webconsole/components/Output/GripMessageBody.js114
-rw-r--r--devtools/client/webconsole/components/Output/LazyMessageList.js393
-rw-r--r--devtools/client/webconsole/components/Output/Message.js482
-rw-r--r--devtools/client/webconsole/components/Output/MessageContainer.js128
-rw-r--r--devtools/client/webconsole/components/Output/MessageIcon.js71
-rw-r--r--devtools/client/webconsole/components/Output/MessageIndent.js41
-rw-r--r--devtools/client/webconsole/components/Output/MessageRepeat.js35
-rw-r--r--devtools/client/webconsole/components/Output/message-types/CSSWarning.js173
-rw-r--r--devtools/client/webconsole/components/Output/message-types/ConsoleApiCall.js221
-rw-r--r--devtools/client/webconsole/components/Output/message-types/ConsoleCommand.js105
-rw-r--r--devtools/client/webconsole/components/Output/message-types/DefaultRenderer.js15
-rw-r--r--devtools/client/webconsole/components/Output/message-types/EvaluationResult.js124
-rw-r--r--devtools/client/webconsole/components/Output/message-types/NavigationMarker.js62
-rw-r--r--devtools/client/webconsole/components/Output/message-types/NetworkEventMessage.js243
-rw-r--r--devtools/client/webconsole/components/Output/message-types/PageError.js130
-rw-r--r--devtools/client/webconsole/components/Output/message-types/SimpleTable.js134
-rw-r--r--devtools/client/webconsole/components/Output/message-types/WarningGroup.js80
-rw-r--r--devtools/client/webconsole/components/Output/message-types/moz.build17
-rw-r--r--devtools/client/webconsole/components/Output/moz.build21
-rw-r--r--devtools/client/webconsole/components/SideBar.js128
-rw-r--r--devtools/client/webconsole/components/moz.build15
-rw-r--r--devtools/client/webconsole/constants.js213
-rw-r--r--devtools/client/webconsole/enhancers/actor-releaser.js62
-rw-r--r--devtools/client/webconsole/enhancers/batching.js34
-rw-r--r--devtools/client/webconsole/enhancers/css-error-reporting.js43
-rw-r--r--devtools/client/webconsole/enhancers/message-cache-clearing.js41
-rw-r--r--devtools/client/webconsole/enhancers/moz.build11
-rw-r--r--devtools/client/webconsole/index.html134
-rw-r--r--devtools/client/webconsole/middleware/event-telemetry.js129
-rw-r--r--devtools/client/webconsole/middleware/history-persistence.js71
-rw-r--r--devtools/client/webconsole/middleware/moz.build10
-rw-r--r--devtools/client/webconsole/middleware/performance-marker.js27
-rw-r--r--devtools/client/webconsole/moz.build44
-rw-r--r--devtools/client/webconsole/panel.js105
-rw-r--r--devtools/client/webconsole/reducers/autocomplete.js181
-rw-r--r--devtools/client/webconsole/reducers/filters.js32
-rw-r--r--devtools/client/webconsole/reducers/history.js244
-rw-r--r--devtools/client/webconsole/reducers/index.js34
-rw-r--r--devtools/client/webconsole/reducers/messages.js1707
-rw-r--r--devtools/client/webconsole/reducers/moz.build15
-rw-r--r--devtools/client/webconsole/reducers/notifications.js58
-rw-r--r--devtools/client/webconsole/reducers/prefs.js48
-rw-r--r--devtools/client/webconsole/reducers/ui.js130
-rw-r--r--devtools/client/webconsole/selectors/autocomplete.js13
-rw-r--r--devtools/client/webconsole/selectors/filters.js10
-rw-r--r--devtools/client/webconsole/selectors/history.js95
-rw-r--r--devtools/client/webconsole/selectors/messages.js93
-rw-r--r--devtools/client/webconsole/selectors/moz.build14
-rw-r--r--devtools/client/webconsole/selectors/notifications.js12
-rw-r--r--devtools/client/webconsole/selectors/prefs.js17
-rw-r--r--devtools/client/webconsole/selectors/ui.js13
-rw-r--r--devtools/client/webconsole/service-container.js72
-rw-r--r--devtools/client/webconsole/store.js160
-rw-r--r--devtools/client/webconsole/test/README.md61
-rw-r--r--devtools/client/webconsole/test/browser/_browser_console.ini69
-rw-r--r--devtools/client/webconsole/test/browser/_jsterm.ini162
-rw-r--r--devtools/client/webconsole/test/browser/_webconsole.ini480
-rw-r--r--devtools/client/webconsole/test/browser/browser_console.js315
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_and_breakpoints.js16
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_clear_cache.js48
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_clear_closed_tab.js39
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_clear_method.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_consolejsm_output.js140
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_content_getters.js629
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_content_longstring.js56
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_content_object.js85
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_content_object_context_menu.js73
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_content_object_in_sidebar.js162
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_context_menu_entries.js151
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_context_menu_export_console_output.js53
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_dead_objects.js45
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_devtools_loader_exception.js93
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_eager_eval.js49
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_enable_network_monitoring.js116
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_error_source_click.js57
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_evaluation_context_selector.js203
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_filters.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_ignore_debugger_statement.js34
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_jsterm_await.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_many_toggles.js54
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_microtask.js67
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_modes.js248
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_nsiconsolemessage.js86
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_open_or_focus.js52
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_restore.js42
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_screenshot.js107
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_webconsole_ctrlw_close_tab.js64
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_webconsole_iframe_messages.js61
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_webconsole_private_browsing.js181
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_webextension.js131
-rw-r--r--devtools/client/webconsole/test/browser/browser_console_window_object_inheritance.js64
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_add_edited_input_to_history.js84
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete-properties-with-non-alphanumeric-names.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_accept_no_scroll.js54
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_array_no_index.js39
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_arrow_keys.js237
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_await.js36
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_cached_results.js148
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_commands.js67
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_control_space.js58
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_crossdomain_iframe.js44
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_del_key.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_disabled.js65
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_eager_evaluation.js37
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_escape_key.js50
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_expression_variables.js51
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_extraneous_closing_brackets.js21
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_getters_cache.js130
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_getters_cancel.js89
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_getters_confirm.js147
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_getters_learn_more_link.js56
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_helpers.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_in_chrome_tab.js23
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_in_debugger_stackframe.js133
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_inside_text.js171
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_mapped_variables.js129
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_native_getters.js53
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_nav_and_tab_key.js134
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_null.js71
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_paste_undo.js67
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_race_on_enter.js170
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_return_key.js83
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_return_key_no_selection.js66
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_toggle.js77
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_width.js89
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_will_navigate.js48
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await.js83
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_assignments.js77
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_concurrent.js48
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_concurrent_same_result.js39
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_dynamic_import.js43
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_error.js215
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_helper_dollar_underscore.js83
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_await_paused.js86
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_block_command.js103
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion.js104
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion_bracket.js254
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion_bracket_cached_results.js130
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion_case_sensitivity.js113
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion_dollar_underscore.js57
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion_dollar_zero.js47
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_completion_perfect_match.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_content_defined_helpers.js58
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_context_menu_labels.js36
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_copy_command.js70
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_ctrl_a_select_all.js52
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_ctrl_key_nav.js335
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_document_no_xray.js18
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation.js371
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation_element_highlight.js75
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation_in_debugger_stackframe.js50
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation_warnings.js26
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor.js49
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_code_folding.js74
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_disabled_history_nav_with_keyboard.js97
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_enter.js84
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_execute.js21
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_execute_selection.js69
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_gutter.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_onboarding.js51
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_resize.js79
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_reverse_search_button.js53
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_reverse_search_keyboard_navigation.js123
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_toggle_keyboard_shortcut.js62
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_editor_toolbar.js181
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_error_docs.js50
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_error_outside_valid_range.js26
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector.js279
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_iframe_picker.js124
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_inspector.js180
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_pause_in_debugger.js124
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_targets_update.js242
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_file_load_save_keyboard_shortcut.js87
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_focus_reload.js29
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_helper_clear.js24
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_helper_dollar.js49
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_helper_dollar_dollar.js59
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_helper_dollar_x.js152
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_helper_help.js41
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_helper_keys_values.js28
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_hide_when_devtools_chrome_enabled_false.js161
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_history.js55
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_history_arrow_keys.js174
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_history_command.js43
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_history_nav.js58
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_history_persist.js169
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_insert_tab_when_overflows_no_scroll.js41
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_inspect.js80
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_inspect_panels.js101
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_instance_of.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_middle_click_paste.js39
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_multiline.js65
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_no_input_and_tab_key_pressed.js74
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_null_undefined.js18
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_popup_close_on_tab_switch.js27
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_clipboard.js182
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_file.js128
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_fixed_header.js68
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_selector.js142
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_user.js70
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_warnings.js98
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_selfxss.js63
-rw-r--r--devtools/client/webconsole/test/browser/browser_jsterm_syntax_highlight_output.js27
-rw-r--r--devtools/client/webconsole/test/browser/browser_toolbox_console_new_process.js69
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_allow_mixedcontent_securityerrors.js64
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_async_stack.js90
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_batching.js62
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_bidi_string_isolation.js96
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_block_mixedcontent_securityerrors.js106
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cached_messages.js185
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_cross_domain_iframe.js28
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_duplicate_after_target_switching.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cached_messages_no_duplicate.js39
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_certificate_messages.js42
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_checkloaduri_errors.js37
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_clear_cache.js86
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_click_function_to_mapped_source.js58
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_click_function_to_prettyprinted_source.js63
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_click_function_to_source.js50
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_clickable_urls.js101
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_close_groups_after_navigation.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_close_sidebar.js100
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_close_unfocused_window.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_closing_after_completion.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_api_iframe.js23
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_dir.js135
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_dir_uninspectable.js53
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_error_expand_object.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_group.js162
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_group_open_no_scroll.js67
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_logging_workers_api.js130
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_profile_unavailable.js26
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_table.js502
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_table_fallback.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_table_post_alterations.js68
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_timeStamp.js24
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js72
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_console_trace_duplicates.js101
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_entire_message.js244
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_link_location.js101
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_message_with_async_stacktrace.js91
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_message_with_framework_stacktrace.js132
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_object.js181
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_export_console_output.js197
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_object_in_sidebar.js182
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_open_url.js110
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_reveal_in_inspector.js143
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_context_menu_store_as_global.js121
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cors_errors.js260
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_csp_ignore_reflected_xss_message.js34
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_csp_violation.js141
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_cspro.js57
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_css_error_impacted_elements.js126
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_custom_formatters.js193
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_custom_formatters_errors.js199
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_deprecation_warning.js57
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_document_focus.js99
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_duplicate_errors.js34
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_enable_network_monitoring.js21
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_error_with_grouped_stack.js43
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_error_with_longstring_stack.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_error_with_unicode.js25
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_error_with_url.js62
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_errors_after_page_reload.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_eval_error.js102
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_eval_in_debugger_stackframe.js131
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_eval_in_debugger_stackframe2.js76
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_eval_sources.js74
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_execution_scope.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_external_script_errors.js31
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_file_uri.js77
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filter_buttons_overflow.js83
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filter_by_input.js294
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filter_by_regex_input.js106
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filter_groups.js272
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filter_navigation_marker.js77
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filter_scroll.js108
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filters.js85
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_filters_persist.js72
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_highlighter_console_helper.js64
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_hsts_invalid-headers.js104
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_iframe_wrong_hud.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_in_line_layout.js135
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_ineffective_iframe_sandbox_warning.js53
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_init.js37
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_input_field_focus_on_panel_select.js34
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_input_focus.js92
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_insecure_passwords_about_blank_web_console_warning.js22
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_insecure_passwords_web_console_warning.js59
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_inspect_cross_domain_object.js130
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_keyboard_accessibility.js119
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_lenient_this_warning.js68
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_limit_multiline.js77
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_location_debugger_link.js51
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_location_logpoint_debugger_link.js187
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_location_styleeditor_link.js82
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_logErrorInPage.js20
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_logWarningInPage.js20
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_logging_exceptions.js38
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_loglimit.js86
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_logs_exceptions_order.js41
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_longstring.js49
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_longstring_getter.js48
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_message_categories.js167
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_mime_css_blocked.js16
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_multiple_windows_and_tabs.js92
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_navigate_to_parse_error.js30
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_attach.js72
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_exceptions.js29
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_message_close_on_escape.js56
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_message_ctrl_click.js68
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_after_target_switching.js49
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_expand.js261
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_expand_before_updates.js316
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_html_preview.js192
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_openinnet.js111
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_resend_request.js48
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_stacktrace_console_initiated_request.js66
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_messages_status_code.js72
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_requests_from_chrome.js56
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_reset_filter.js81
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_network_unicode.js35
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_nodes_highlight.js81
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_nodes_select.js66
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_non_javascript_mime_warning.js20
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_non_javascript_mime_worker_error.js26
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_non_standard_doctype_errors.js126
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_ctrl_click.js125
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_in_sidebar_keyboard_nav.js105
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector.js157
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector__proto__.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_array_getters.js94
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_entries.js722
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_getters.js664
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_getters_prototype.js119
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_getters_shadowed.js80
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_key_sorting.js136
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_local_session_storage.js117
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_nested_promise.js90
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_nested_proxy.js54
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_private_properties.js306
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_scroll.js59
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_selected_text.js27
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_symbols.js74
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_while_debugging_and_inspecting.js70
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_observer_notifications.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_optimized_out_vars.js54
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_output_copy.js40
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_output_copy_newlines.js42
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_output_order.js49
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_output_trimmed.js109
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_persist.js290
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_promise_rejected_object.js126
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_record_tuple.js33
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_reopen_closed_tab.js52
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_repeat_different_objects.js42
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_requestStorageAccess_errors.js132
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_responsive_design_mode.js43
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_reverse_search.js177
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_reverse_search_initial_value.js98
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_reverse_search_keyboard_navigation.js144
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_reverse_search_mouse_navigation.js139
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_reverse_search_toggle.js55
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_same_origin_errors.js37
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sandbox_update_after_navigation.js59
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_script_errordoc_urls.js75
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_scroll.js407
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_select_all.js61
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_show_subresource_security_errors.js23
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_shows_reqs_from_netmonitor.js83
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_shows_reqs_in_netmonitor.js67
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sidebar_object_expand_when_message_pruned.js85
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sidebar_scroll.js54
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sourcemap_css.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sourcemap_error.js26
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sourcemap_invalid.js32
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_sourcemap_nosource.js60
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_split.js365
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_split_close_button.js61
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_split_escape_key.js56
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_split_focus.js46
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_split_persist.js143
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stacktrace_location_debugger_link.js63
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stacktrace_mapped_location_debugger_link.js65
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_strict_mode_errors.js48
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_string.js70
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stubs_console_api.js343
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stubs_css_message.js130
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stubs_evaluation_result.js185
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stubs_network_event.js233
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stubs_page_error.js254
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_stubs_platform_messages.js107
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_execute_js.js94
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_filters_changed.js86
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_js_errors.js62
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_jump_to_definition.js52
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_object_expanded.js72
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_persist_toggle_changed.js66
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_telemetry_reverse_search.js171
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_time_methods.js87
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_timestamps.js55
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_trackingprotection_errors.js268
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_uncaught_exception.js130
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_view_source.js37
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_visibility_messages.js137
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warn_about_replaced_api.js59
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_group_content_blocking.js256
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_group_cookies.js155
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_group_csp.js29
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_group_multiples.js326
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_group_storage_isolation.js102
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_groups.js286
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_filtering.js337
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_outside_console_group.js220
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_toggle.js284
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_wasm_errors.js51
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_webextension_promise_rejection.js37
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_websocket.js24
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_worker_error.js22
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_worker_evaluate.js30
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_worker_promise_error.js31
-rw-r--r--devtools/client/webconsole/test/browser/browser_webconsole_worklet_error.js29
-rw-r--r--devtools/client/webconsole/test/browser/code_bundle_invalidmap.js93
-rw-r--r--devtools/client/webconsole/test/browser/code_bundle_invalidmap.js.map1
-rw-r--r--devtools/client/webconsole/test/browser/code_bundle_nosource.js93
-rw-r--r--devtools/client/webconsole/test/browser/code_bundle_nosource.js.map1
-rw-r--r--devtools/client/webconsole/test/browser/code_nosource.js18
-rw-r--r--devtools/client/webconsole/test/browser/cookieSetter.html7
-rw-r--r--devtools/client/webconsole/test/browser/head.js1912
-rw-r--r--devtools/client/webconsole/test/browser/shared-head.js514
-rw-r--r--devtools/client/webconsole/test/browser/sjs_cors-test-server.sjs165
-rw-r--r--devtools/client/webconsole/test/browser/sjs_slow-response-test-server.sjs35
-rw-r--r--devtools/client/webconsole/test/browser/source-mapped.css6
-rw-r--r--devtools/client/webconsole/test/browser/source-mapped.css.map7
-rw-r--r--devtools/client/webconsole/test/browser/source-mapped.scss7
-rw-r--r--devtools/client/webconsole/test/browser/stub-generator-helpers.js437
-rw-r--r--devtools/client/webconsole/test/browser/test-autocomplete-in-stackframe.html59
-rw-r--r--devtools/client/webconsole/test/browser/test-autocomplete-mapped.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-autocomplete-mapped.js18
-rw-r--r--devtools/client/webconsole/test/browser/test-autocomplete-mapped.js.map1
-rw-r--r--devtools/client/webconsole/test/browser/test-autocomplete-mapped.src.js16
-rw-r--r--devtools/client/webconsole/test/browser/test-batching.html29
-rw-r--r--devtools/client/webconsole/test/browser/test-blank.html10
-rw-r--r--devtools/client/webconsole/test/browser/test-block-action-style.css3
-rw-r--r--devtools/client/webconsole/test/browser/test-block-action.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-bug_923281_console_log_filter.html12
-rw-r--r--devtools/client/webconsole/test/browser/test-bug_923281_test1.js7
-rw-r--r--devtools/client/webconsole/test/browser/test-bug_923281_test2.js6
-rw-r--r--devtools/client/webconsole/test/browser/test-certificate-messages.html23
-rw-r--r--devtools/client/webconsole/test/browser/test-checkloaduri-failure.html23
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-mapped-source.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-prettyprinted-source.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-source.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-source.js12
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-source.min.js3
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-source.min.js.map1
-rw-r--r--devtools/client/webconsole/test/browser/test-click-function-to-source.unmapped.min.js2
-rw-r--r--devtools/client/webconsole/test/browser/test-closure-optimized-out.html34
-rw-r--r--devtools/client/webconsole/test/browser/test-console-api-iframe.html22
-rw-r--r--devtools/client/webconsole/test/browser/test-console-api.html10
-rw-r--r--devtools/client/webconsole/test/browser/test-console-custom-formatters-errors.html185
-rw-r--r--devtools/client/webconsole/test/browser/test-console-custom-formatters.html112
-rw-r--r--devtools/client/webconsole/test/browser/test-console-evaluation-context-selector-child.html23
-rw-r--r--devtools/client/webconsole/test/browser/test-console-evaluation-context-selector.html16
-rw-r--r--devtools/client/webconsole/test/browser/test-console-filter-by-regex-input.html20
-rw-r--r--devtools/client/webconsole/test/browser/test-console-filter-groups.html49
-rw-r--r--devtools/client/webconsole/test/browser/test-console-filters.html24
-rw-r--r--devtools/client/webconsole/test/browser/test-console-group.html29
-rw-r--r--devtools/client/webconsole/test/browser/test-console-iframes.html16
-rw-r--r--devtools/client/webconsole/test/browser/test-console-logs-exceptions-order.html32
-rw-r--r--devtools/client/webconsole/test/browser/test-console-stacktrace-mapped.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-console-table.html22
-rw-r--r--devtools/client/webconsole/test/browser/test-console-trace-duplicates.html30
-rw-r--r--devtools/client/webconsole/test/browser/test-console-workers.html28
-rw-r--r--devtools/client/webconsole/test/browser/test-console.html36
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-base-uri.html18
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-base-uri.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-event-handler.html8
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-event-handler.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-form-action.html16
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-form-action.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-frame-ancestor-child.html9
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-frame-ancestor-child.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-frame-ancestor-parent.html21
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-frame-ancestor-parent.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-inline.html21
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation-inline.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-csp-violation.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-cspro.html20
-rw-r--r--devtools/client/webconsole/test/browser/test-cspro.html^headers^2
-rw-r--r--devtools/client/webconsole/test/browser/test-css-message.html10
-rw-r--r--devtools/client/webconsole/test/browser/test-data.json1
-rw-r--r--devtools/client/webconsole/test/browser/test-data.json^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-duplicate-error.html21
-rw-r--r--devtools/client/webconsole/test/browser/test-dynamic-import.html10
-rw-r--r--devtools/client/webconsole/test/browser/test-dynamic-import.mjs12
-rw-r--r--devtools/client/webconsole/test/browser/test-error-worker.html7
-rw-r--r--devtools/client/webconsole/test/browser/test-error-worker.js20
-rw-r--r--devtools/client/webconsole/test/browser/test-error-worker2.js7
-rw-r--r--devtools/client/webconsole/test/browser/test-error-worklet.html24
-rw-r--r--devtools/client/webconsole/test/browser/test-error-worklet.mjs21
-rw-r--r--devtools/client/webconsole/test/browser/test-error.html20
-rw-r--r--devtools/client/webconsole/test/browser/test-eval-error.html16
-rw-r--r--devtools/client/webconsole/test/browser/test-eval-in-stackframe.html53
-rw-r--r--devtools/client/webconsole/test/browser/test-eval-sources.html17
-rw-r--r--devtools/client/webconsole/test/browser/test-evaluate-worker.html9
-rw-r--r--devtools/client/webconsole/test/browser/test-evaluate-worker.js8
-rw-r--r--devtools/client/webconsole/test/browser/test-external-script-errors.html24
-rw-r--r--devtools/client/webconsole/test/browser/test-external-script-errors.js7
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe-child.html12
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe-insecure-form-action.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe-parent.html24
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe-wrong-hud-iframe.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe-wrong-hud.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe1.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe2.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-iframe3.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-image.pngbin0 -> 580 bytes-rw-r--r--devtools/client/webconsole/test/browser/test-image.png^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning-inner.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning-nested1.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning-nested2.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning0.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning1.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning2.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning3.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning4.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-ineffective-iframe-sandbox-warning5.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-insecure-frame.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-insecure-passwords-about-blank-web-console-warning.html29
-rw-r--r--devtools/client/webconsole/test/browser/test-insecure-passwords-web-console-warning.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-inspect-cross-domain-objects-frame.html23
-rw-r--r--devtools/client/webconsole/test/browser/test-inspect-cross-domain-objects-top.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-local-session-storage.html28
-rw-r--r--devtools/client/webconsole/test/browser/test-location-debugger-link-console-log.js10
-rw-r--r--devtools/client/webconsole/test/browser/test-location-debugger-link-errors.js8
-rw-r--r--devtools/client/webconsole/test/browser/test-location-debugger-link-logpoint-1.js13
-rw-r--r--devtools/client/webconsole/test/browser/test-location-debugger-link-logpoint-2.js13
-rw-r--r--devtools/client/webconsole/test/browser/test-location-debugger-link-logpoint.html24
-rw-r--r--devtools/client/webconsole/test/browser/test-location-debugger-link.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-location-styleeditor-link-1.css9
-rw-r--r--devtools/client/webconsole/test/browser/test-location-styleeditor-link-2.css9
-rw-r--r--devtools/client/webconsole/test/browser/test-location-styleeditor-link-minified.css5
-rw-r--r--devtools/client/webconsole/test/browser/test-location-styleeditor-link.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-mangled-function.js2
-rw-r--r--devtools/client/webconsole/test/browser/test-mangled-function.js.map1
-rw-r--r--devtools/client/webconsole/test/browser/test-mangled-function.src.js5
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-canvas-css.html17
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-canvas-css.js8
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-css-loader.css9
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-css-loader.css^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-css-loader.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-css-parser.css10
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-css-parser.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-empty-getelementbyid.html16
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-empty-getelementbyid.js6
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-html.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-image.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-image.jpgbin0 -> 2532 bytes-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-imagemap.html16
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-malformedxml-external.html20
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-malformedxml-external.xml8
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-malformedxml.xhtml10
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-svg.xhtml16
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-workers.html18
-rw-r--r--devtools/client/webconsole/test/browser/test-message-categories-workers.js11
-rw-r--r--devtools/client/webconsole/test/browser/test-mixedcontent-securityerrors.html21
-rw-r--r--devtools/client/webconsole/test/browser/test-navigate-to-parse-error.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-network-event.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-network-exceptions.html25
-rw-r--r--devtools/client/webconsole/test/browser/test-network-request.html50
-rw-r--r--devtools/client/webconsole/test/browser/test-network.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-non-javascript-mime-worker.html25
-rw-r--r--devtools/client/webconsole/test/browser/test-non-javascript-mime.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-non-javascript-mime.js1
-rw-r--r--devtools/client/webconsole/test/browser/test-non-javascript-mime.js^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-reopen-closed-tab.html19
-rw-r--r--devtools/client/webconsole/test/browser/test-same-origin-required-load.html26
-rw-r--r--devtools/client/webconsole/test/browser/test-simple-function.html10
-rw-r--r--devtools/client/webconsole/test/browser/test-simple-function.js11
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap-error-01.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap-error-01.js7
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap-error-02.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap-error-02.js7
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap-original.js18
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap.min.js3
-rw-r--r--devtools/client/webconsole/test/browser/test-sourcemap.min.js.map1
-rw-r--r--devtools/client/webconsole/test/browser/test-stacktrace-location-debugger-link.html26
-rw-r--r--devtools/client/webconsole/test/browser/test-subresource-security-error.html15
-rw-r--r--devtools/client/webconsole/test/browser/test-subresource-security-error.js2
-rw-r--r--devtools/client/webconsole/test/browser/test-subresource-security-error.js^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-syntaxerror-worklet.js6
-rw-r--r--devtools/client/webconsole/test/browser/test-time-methods.html24
-rw-r--r--devtools/client/webconsole/test/browser/test-trackingprotection-securityerrors-thirdpartyonly.html12
-rw-r--r--devtools/client/webconsole/test/browser/test-trackingprotection-securityerrors.html13
-rw-r--r--devtools/client/webconsole/test/browser/test-warning-group-csp.html11
-rw-r--r--devtools/client/webconsole/test/browser/test-warning-group-csp.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test-warning-groups.html32
-rw-r--r--devtools/client/webconsole/test/browser/test-websocket.html14
-rw-r--r--devtools/client/webconsole/test/browser/test-websocket.js18
-rw-r--r--devtools/client/webconsole/test/browser/test-worker-promise-error.html44
-rw-r--r--devtools/client/webconsole/test/browser/test-worker.js13
-rw-r--r--devtools/client/webconsole/test/browser/test_console_csp_ignore_reflected_xss_message.html10
-rw-r--r--devtools/client/webconsole/test/browser/test_console_csp_ignore_reflected_xss_message.html^headers^1
-rw-r--r--devtools/client/webconsole/test/browser/test_hsts-invalid-headers.sjs43
-rw-r--r--devtools/client/webconsole/test/browser/test_jsterm_screenshot_command.html87
-rw-r--r--devtools/client/webconsole/test/browser/testscript.js2
-rw-r--r--devtools/client/webconsole/test/chrome/chrome.ini7
-rw-r--r--devtools/client/webconsole/test/chrome/head.js14
-rw-r--r--devtools/client/webconsole/test/chrome/test_render_perf.html238
-rw-r--r--devtools/client/webconsole/test/node/.eslintrc.js7
-rw-r--r--devtools/client/webconsole/test/node/babel.config.js24
-rw-r--r--devtools/client/webconsole/test/node/components/console-api-call.log-messages.test.js60
-rw-r--r--devtools/client/webconsole/test/node/components/console-api-call.test.js695
-rw-r--r--devtools/client/webconsole/test/node/components/console-output.test.js52
-rw-r--r--devtools/client/webconsole/test/node/components/css-warning.test.js125
-rw-r--r--devtools/client/webconsole/test/node/components/eager-evaluation.test.js154
-rw-r--r--devtools/client/webconsole/test/node/components/evaluation-result.test.js505
-rw-r--r--devtools/client/webconsole/test/node/components/filter-bar.test.js226
-rw-r--r--devtools/client/webconsole/test/node/components/filter-button.test.js43
-rw-r--r--devtools/client/webconsole/test/node/components/filter-checkbox.test.js39
-rw-r--r--devtools/client/webconsole/test/node/components/message-container.test.js70
-rw-r--r--devtools/client/webconsole/test/node/components/message-icon.test.js47
-rw-r--r--devtools/client/webconsole/test/node/components/message-location.test.js72
-rw-r--r--devtools/client/webconsole/test/node/components/message-repeat.test.js20
-rw-r--r--devtools/client/webconsole/test/node/components/message-types-aria.test.js59
-rw-r--r--devtools/client/webconsole/test/node/components/network-event-message.test.js154
-rw-r--r--devtools/client/webconsole/test/node/components/page-error.test.js661
-rw-r--r--devtools/client/webconsole/test/node/components/warning-group.test.js107
-rw-r--r--devtools/client/webconsole/test/node/components/webconsole-wrapper.test.js143
-rw-r--r--devtools/client/webconsole/test/node/fixtures/DevToolsUtils.js8
-rw-r--r--devtools/client/webconsole/test/node/fixtures/WebConsoleUtils.js17
-rw-r--r--devtools/client/webconsole/test/node/fixtures/async-storage.js13
-rw-r--r--devtools/client/webconsole/test/node/fixtures/serviceContainer.js27
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/browser_dummy.js11
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js1489
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js87
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/evaluationResult.js1431
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/index.js37
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/networkEvent.js269
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/pageError.js2482
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/platformMessage.js56
-rw-r--r--devtools/client/webconsole/test/node/fixtures/stubs/stubs.ini14
-rw-r--r--devtools/client/webconsole/test/node/helpers.js174
-rw-r--r--devtools/client/webconsole/test/node/jest-setup.js54
-rw-r--r--devtools/client/webconsole/test/node/jest.config.js23
-rw-r--r--devtools/client/webconsole/test/node/middleware/debounce.test.js62
-rw-r--r--devtools/client/webconsole/test/node/package.json29
-rw-r--r--devtools/client/webconsole/test/node/store/filters.test.js345
-rw-r--r--devtools/client/webconsole/test/node/store/hidden-messages.test.js199
-rw-r--r--devtools/client/webconsole/test/node/store/messages.test.js1305
-rw-r--r--devtools/client/webconsole/test/node/store/network-messages.test.js133
-rw-r--r--devtools/client/webconsole/test/node/store/private-messages.test.js234
-rw-r--r--devtools/client/webconsole/test/node/store/release-actors.test.js172
-rw-r--r--devtools/client/webconsole/test/node/store/search.test.js115
-rw-r--r--devtools/client/webconsole/test/node/store/ui.test.js119
-rw-r--r--devtools/client/webconsole/test/node/utils/areMessagesSimilar.test.js50
-rw-r--r--devtools/client/webconsole/test/node/yarn.lock6057
-rw-r--r--devtools/client/webconsole/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/webconsole/test/xpcshell/test_webconsole_l10n.js31
-rw-r--r--devtools/client/webconsole/test/xpcshell/xpcshell.ini6
-rw-r--r--devtools/client/webconsole/test/yarn.lock2602
-rw-r--r--devtools/client/webconsole/types.js90
-rw-r--r--devtools/client/webconsole/utils.js53
-rw-r--r--devtools/client/webconsole/utils/clipboard.js57
-rw-r--r--devtools/client/webconsole/utils/context-menu.js368
-rw-r--r--devtools/client/webconsole/utils/id-generator.js15
-rw-r--r--devtools/client/webconsole/utils/l10n.js70
-rw-r--r--devtools/client/webconsole/utils/messages.js914
-rw-r--r--devtools/client/webconsole/utils/moz.build14
-rw-r--r--devtools/client/webconsole/utils/object-inspector.js158
-rw-r--r--devtools/client/webconsole/utils/prefs.js46
-rw-r--r--devtools/client/webconsole/webconsole-ui.js716
-rw-r--r--devtools/client/webconsole/webconsole-wrapper.js475
-rw-r--r--devtools/client/webconsole/webconsole.js469
7203 files changed, 1255985 insertions, 0 deletions
diff --git a/devtools/client/.eslintrc.js b/devtools/client/.eslintrc.js
new file mode 100644
index 0000000000..81eb6568ee
--- /dev/null
+++ b/devtools/client/.eslintrc.js
@@ -0,0 +1,17 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+module.exports = {
+ env: { browser: true },
+ globals: {
+ define: true,
+ },
+ rules: {
+ // See bug 1288147, the devtools front-end wants to be able to run in
+ // content privileged windows, where ownerGlobal doesn't exist.
+ "mozilla/use-ownerGlobal": "off",
+ },
+};
diff --git a/devtools/client/aboutdebugging/README.md b/devtools/client/aboutdebugging/README.md
new file mode 100644
index 0000000000..589b708c33
--- /dev/null
+++ b/devtools/client/aboutdebugging/README.md
@@ -0,0 +1,86 @@
+# about:debugging-new
+
+## What is about:debugging-new
+The purpose of about:debugging is to be a debugging hub to start inspecting your addons, processes, tabs and workers. This new version of about:debugging will also allow you to debug remote devices (Firefox for Android on a smartphone). The user should be able to connect either via USB or WiFi.
+
+To try out about:debugging, type `about:debugging` in the Firefox URL bar.
+
+## Technical overview
+
+The about:debugging-new UI is built using React and Redux. The various React/Redux files should be organized as follows:
+- devtools/client/aboutdebugging/src/actions
+- devtools/client/aboutdebugging/src/components
+- devtools/client/aboutdebugging/src/middleware
+- devtools/client/aboutdebugging/src/reducers
+
+The folder `devtools/client/aboutdebugging/src/modules` contains various helpers and classes that are not related to React/Redux. For instance modules/usb-runtimes.js provides an abstraction layer to enable USB runtimes scanning, to list USB runtimes etc...
+
+### Firefox Component Registration
+about:debugging-new is an "about" page registered via a component manifest that is located in `/devtools/startup/aboutdebugging.manifest`. The component registration code is at `/devtools/startup/aboutdebugging-registration.js`.
+
+### Actions
+Actions should cover all user or external events that change the UI.
+
+#### asynchronous actions
+For asynchronous actions, we will use the thunk middleware, similar to what it done in the webconsole and netmonitor. An asynchronous action should be split in three actions:
+- start
+- success
+- failure
+
+As we will implement asynchronous, we should aim to keep a consistent naming for those actions.
+
+A typical usecase for an asynchronous action here would be selecting a runtime. The selection will be immediate but should trigger actions to retrieve tabs, addons, workers etc… which will all be asynchronous.
+
+### Components
+Components should avoid dealing with specialized objects as much as possible.
+
+They should never use any of the lifecycle methods that will be deprecated in React 17 (`componentWillMount`, `componentWillReceiveProps`, and `componentWillUpdate`).
+
+When it comes to updating the state, components should do it via an action if the result of this action is something that should be preserved when reloading the UI.
+
+### Middlewares
+We use several middlewares in the application. The middlewares are required in the create-store module `devtools/client/aboutdebugging/src/create-store.js`.
+
+#### thunk
+This is a shared middleware used by other DevTools modules that allows to dispatch actions and allows to create multiple asynchronous actions.
+
+#### debug-target-listener
+This middleware is responsible for monitoring a client. It will add various listeners on the client when receiving the `WATCH_RUNTIME_SUCCESS` action and will remove the listeners when receiving `UNWATCH_RUNTIME_SUCCESS`. Could probably be ported to an action, no real added value as a middleware.
+
+#### error-logging
+This middleware will forward any error object dispatched by an action to the console. Typically, all the `FAILURE` actions of our asynchronous actions should dispatch an error object.
+
+#### extension/tab/worker-component-data
+This middleware takes the raw data of a debugging target returned by the devtools client and transforms it to presentation data that can be used by the debugtarget components. Could probably be ported to an action, no real added value as a middleware.
+
+#### waitUntilService
+This is a shared middleware used by other DevTools modules that allows to wait until a given action is dispatched. We use it in mochitests.
+
+### state
+The state represents the model for the UI of the application.
+
+##### ui
+Holds the global state of the application. This can contain generic preferences such as "is feature X enabled" or purely UI related "is category X collapsed".
+
+##### runtimes
+Holds the current list of runtimes known by the application as well as the currently selected runtime.
+
+##### debug-targets
+Holds all the debug targets (ie tabs, addons, workers etc...) for the currently monitored runtime. There is at most one monitored runtime at a given time.
+
+### Constants
+Constants can be found at `devtools/client/aboutdebugging/src/constants.js`. It contains all the actions available in about:debugging as well as several other "packages" of constants used in the application.
+
+If a constant (string, number, etc...) is only used in a single module it can be defined as a `const` in this module. However as soon as the constant is shared by several modules, it should move to `devtools/client/aboutdebugging/src/constants.js`.
+
+### Types
+Types can be found at `devtools/client/aboutdebugging/src/types.js`. They serve both as documentation as well as validation. We do not aim at having types for every single element of the state, but only for complex objects.
+
+## Contact
+If you have any questions about the code, features, planning, the active team is:
+- engineering: Belén Albeza (:ladybenko)
+- engineering: Daisuke Akatsuka (:daisuke)
+- engineering: Julian Descottes (:jdescottes)
+- product management: Harald Kischner (:digitarald)
+
+You can find us on [Matrix](https://chat.mozilla.org/#/room/#devtools:mozilla.org).
diff --git a/devtools/client/aboutdebugging/aboutdebugging.css b/devtools/client/aboutdebugging/aboutdebugging.css
new file mode 100644
index 0000000000..1ab9c2ad22
--- /dev/null
+++ b/devtools/client/aboutdebugging/aboutdebugging.css
@@ -0,0 +1,35 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+* Global styles
+*/
+@import "chrome://devtools/skin/variables.css";
+@import "chrome://devtools/content/aboutdebugging/src/base.css";
+
+/*
+* Components
+*/
+@import "chrome://devtools/content/aboutdebugging/src/components/App.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/ProfilerDialog.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/RuntimeActions.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/RuntimeInfo.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/connect/ConnectPage.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/connect/ConnectSection.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/connect/ConnectSteps.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/connect/NetworkLocationsForm.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/connect/NetworkLocationsList.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/DebugTargetItem.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/DebugTargetList.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/DebugTargetPane.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/ExtensionDetail.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/FieldPair.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/shared/IconLabel.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/shared/Message.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/sidebar/Sidebar.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/sidebar/SidebarFixedItem.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/sidebar/SidebarItem.css";
+@import "chrome://devtools/content/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.css";
diff --git a/devtools/client/aboutdebugging/aboutdebugging.js b/devtools/client/aboutdebugging/aboutdebugging.js
new file mode 100644
index 0000000000..7079ff7f7a
--- /dev/null
+++ b/devtools/client/aboutdebugging/aboutdebugging.js
@@ -0,0 +1,201 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ bindActionCreators,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ render,
+ unmountComponentAtNode,
+} = require("resource://devtools/client/shared/vendor/react-dom.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+const actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const {
+ configureStore,
+} = require("resource://devtools/client/aboutdebugging/src/create-store.js");
+const {
+ setDebugTargetCollapsibilities,
+} = require("resource://devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js");
+
+const {
+ l10n,
+} = require("resource://devtools/client/aboutdebugging/src/modules/l10n.js");
+
+const {
+ addNetworkLocationsObserver,
+ getNetworkLocations,
+ removeNetworkLocationsObserver,
+} = require("resource://devtools/client/aboutdebugging/src/modules/network-locations.js");
+const {
+ addUSBRuntimesObserver,
+ getUSBRuntimes,
+ removeUSBRuntimesObserver,
+} = require("resource://devtools/client/aboutdebugging/src/modules/usb-runtimes.js");
+
+loader.lazyRequireGetter(
+ this,
+ "adb",
+ "resource://devtools/client/shared/remote-debugging/adb/adb.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "adbAddon",
+ "resource://devtools/client/shared/remote-debugging/adb/adb-addon.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "adbProcess",
+ "resource://devtools/client/shared/remote-debugging/adb/adb-process.js",
+ true
+);
+
+const Router = createFactory(
+ require("resource://devtools/client/shared/vendor/react-router-dom.js")
+ .HashRouter
+);
+const App = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/App.js")
+);
+
+const AboutDebugging = {
+ async init() {
+ const direction = Services.locale.isAppLocaleRTL ? "rtl" : "ltr";
+ document.documentElement.setAttribute("dir", direction);
+
+ this.onAdbAddonUpdated = this.onAdbAddonUpdated.bind(this);
+ this.onAdbProcessReady = this.onAdbProcessReady.bind(this);
+ this.onNetworkLocationsUpdated = this.onNetworkLocationsUpdated.bind(this);
+ this.onUSBRuntimesUpdated = this.onUSBRuntimesUpdated.bind(this);
+
+ this.store = configureStore();
+ this.actions = bindActionCreators(actions, this.store.dispatch);
+
+ const width = this.getRoundedViewportWidth();
+ this.actions.recordTelemetryEvent("open_adbg", { width });
+
+ await l10n.init([
+ "branding/brand.ftl",
+ "devtools/client/aboutdebugging.ftl",
+ ]);
+
+ this.actions.createThisFirefoxRuntime();
+
+ // Listen to Network locations updates and retrieve the initial list of locations.
+ addNetworkLocationsObserver(this.onNetworkLocationsUpdated);
+ await this.onNetworkLocationsUpdated();
+
+ // Listen to USB runtime updates and retrieve the initial list of runtimes.
+
+ // If ADB is already started, wait for the initial runtime list to be able to restore
+ // already connected runtimes.
+ const isProcessStarted = await adb.isProcessStarted();
+ const onAdbRuntimesReady = isProcessStarted
+ ? adb.once("runtime-list-ready")
+ : null;
+ addUSBRuntimesObserver(this.onUSBRuntimesUpdated);
+ await onAdbRuntimesReady;
+
+ await this.onUSBRuntimesUpdated();
+
+ render(
+ Provider(
+ {
+ store: this.store,
+ },
+ LocalizationProvider(
+ { bundles: l10n.getBundles() },
+ Router({}, App({}))
+ )
+ ),
+ this.mount
+ );
+
+ adbAddon.on("update", this.onAdbAddonUpdated);
+ this.onAdbAddonUpdated();
+ adbProcess.on("adb-ready", this.onAdbProcessReady);
+ // get the initial status of adb process, in case it's already started
+ this.onAdbProcessReady();
+ },
+
+ onAdbAddonUpdated() {
+ this.actions.updateAdbAddonStatus(adbAddon.status);
+ },
+
+ onAdbProcessReady() {
+ this.actions.updateAdbReady(adbProcess.ready);
+ },
+
+ onNetworkLocationsUpdated() {
+ return this.actions.updateNetworkLocations(getNetworkLocations());
+ },
+
+ async onUSBRuntimesUpdated() {
+ const runtimes = await getUSBRuntimes();
+ return this.actions.updateUSBRuntimes(runtimes);
+ },
+
+ async destroy() {
+ const width = this.getRoundedViewportWidth();
+ this.actions.recordTelemetryEvent("close_adbg", { width });
+
+ const state = this.store.getState();
+ const currentRuntimeId = state.runtimes.selectedRuntimeId;
+ if (currentRuntimeId) {
+ await this.actions.unwatchRuntime(currentRuntimeId);
+ }
+
+ // Remove all client listeners.
+ this.actions.removeRuntimeListeners();
+
+ removeNetworkLocationsObserver(this.onNetworkLocationsUpdated);
+ removeUSBRuntimesObserver(this.onUSBRuntimesUpdated);
+ adbAddon.off("update", this.onAdbAddonUpdated);
+ adbProcess.off("adb-ready", this.onAdbProcessReady);
+ setDebugTargetCollapsibilities(state.ui.debugTargetCollapsibilities);
+ unmountComponentAtNode(this.mount);
+ },
+
+ get mount() {
+ return document.getElementById("mount");
+ },
+
+ /**
+ * Computed viewport width, rounded at 50px. Used for telemetry events.
+ */
+ getRoundedViewportWidth() {
+ return Math.ceil(window.outerWidth / 50) * 50;
+ },
+};
+
+window.addEventListener(
+ "DOMContentLoaded",
+ () => {
+ AboutDebugging.init();
+ },
+ { once: true }
+);
+
+window.addEventListener(
+ "unload",
+ () => {
+ AboutDebugging.destroy();
+ },
+ { once: true }
+);
+
+// Expose AboutDebugging to tests so that they can access to the store.
+window.AboutDebugging = AboutDebugging;
diff --git a/devtools/client/aboutdebugging/documentation/ANDROID_BUILD.md b/devtools/client/aboutdebugging/documentation/ANDROID_BUILD.md
new file mode 100644
index 0000000000..42d1a52520
--- /dev/null
+++ b/devtools/client/aboutdebugging/documentation/ANDROID_BUILD.md
@@ -0,0 +1,60 @@
+# Build Firefox for Android
+
+## When do you need to build Firefox for Android
+
+If a remote debugging change impacts the server (file located in `devtools/server` or in `devtools/shared`), you will not be able to test it with a device which runs the release version of Firefox for Android. For the purpose of remote debugging, your local build of Firefox Desktop where you will test about:debugging runs the content of `devtools/client` (including `devtools/client/aboutdebugging`). And `devtools/server` runs on the device. So as soon as you are developing or testing a patch that needs to update the server and is about USB debugging, you need to build Firefox for Android and deploy it on a test device.
+
+## Setup your environment
+
+This will be a short documentation focused on the typical patches you may write for about:debugging. For a more complete documentation, you can refer to https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build.
+
+The whole setup needs to download several gigabytes of dependencies so try to have a fast internet connection to follow those steps.
+
+### Clone mozilla-central
+
+It is recommended to create a new clone of mozilla-central for your Firefox for Android builds.
+
+```
+ hg clone https://hg.mozilla.org/mozilla-central mozilla-central-android
+ cd mozilla-central-android
+```
+
+### Run bootstrap
+
+Next simply run `mach bootstrap` and select the third option `3. Firefox for Android Artifact Mode`
+
+```
+ > ./mach bootstrap
+ Please choose the version of Firefox you want to build:
+ 1. Firefox for Desktop Artifact Mode
+ 2. Firefox for Desktop
+ 3. Firefox for Android Artifact Mode
+ 4. Firefox for Android
+ > 3
+```
+
+Follow the instructions, it will take some time as it needs to download a lot of dependencies. At the end it will provide you with a template you should use to create a `.mozconfig` file. You can use the proposed content without changing anything.
+
+### Enable USB debugging on your phone
+
+If you already used your device for USB debugging, this should already be enabled, but we will repeat the steps here.
+
+In the Settings menu, choose "About" and scroll down to the Build Number option. There's a hidden option there to activate "developer mode": tap the Build Number option seven times. You’ll see a countdown, and then a "Developer Options" menu will appear in your Settings. Don’t worry — you can turn this off whenever you like. The last step is to enable USB Debugging in the Developer Options menu.
+
+## Build and deploy to your phone
+
+Connect your phone to your computer with a USB cable. Then run:
+
+```
+ ./mach build
+ ./mach package
+ ./mach install
+```
+
+At this step if you go to the list of applications on your phone, you should be able to spot a "Fennec" application. The fullname will be slightly different, for instance for me it is called "Fennec jdescottes". You can then run the application from your desktop command-line:
+
+```
+ ./mach run
+```
+
+Sometimes this will fail with `WARNING: unable to launch Firefox for Android`. In that case you can simply start the application on your phone, as you would start any other application.
diff --git a/devtools/client/aboutdebugging/documentation/GECKOVIEW_EXAMPLE_BUILD.md b/devtools/client/aboutdebugging/documentation/GECKOVIEW_EXAMPLE_BUILD.md
new file mode 100644
index 0000000000..d34c9b2dfe
--- /dev/null
+++ b/devtools/client/aboutdebugging/documentation/GECKOVIEW_EXAMPLE_BUILD.md
@@ -0,0 +1,66 @@
+# Build GeckoView Example
+
+## When do you need to build GeckoView Example
+
+If a remote debugging change impacts the server (file located in `devtools/server` or in `devtools/shared`), you will not be able to test it without building your GeckoView Example. For the purpose of remote debugging, your local build of Firefox Desktop where you will test about:debugging runs the content of `devtools/client` (including `devtools/client/aboutdebugging`). And `devtools/server` runs on the device. So as soon as you are developing or testing a patch that needs to update the server and is about USB debugging, you need to build GeckoView Example and deploy it on a test device.
+
+## Setup your environment
+
+This will be a short documentation focused on the typical patches you may write for about:debugging. For a more complete documentation, you can refer to https://mozilla.github.io/geckoview/ and https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build.
+
+The whole setup needs to download several gigabytes of dependencies so try to have a fast internet connection to follow those steps.
+
+### Clone mozilla-central
+
+It is recommended to create a new clone of mozilla-central for your GeckoView Example builds.
+
+```
+ hg clone https://hg.mozilla.org/mozilla-central mozilla-central-gecko-view
+ cd mozilla-central-gecko-view
+```
+
+### Run bootstrap
+
+Next simply run `mach bootstrap` and select the third option `3. GeckoView/Firefox for Android Artifact Mode`
+
+```
+ > ./mach bootstrap
+ Please choose the version of Firefox you want to build:
+ 1. Firefox for Desktop Artifact Mode
+ 2. Firefox for Desktop
+ 3. GeckoView/Firefox for Android Artifact Mode
+ 4. GeckoView/Firefox for Android
+ > 3
+```
+
+Follow the instructions, it will take some time as it needs to download a lot of dependencies. At the end it will provide you with a template you should use to create a `.mozconfig` file. You can use the proposed content without changing anything.
+
+### Enable USB debugging on your phone
+
+If you already used your device for USB debugging, this should already be enabled, but we will repeat the steps here.
+
+In the Settings menu, choose "About" and scroll down to the Build Number option. There's a hidden option there to activate "developer mode": tap the Build Number option seven times. You’ll see a countdown, and then a "Developer Options" menu will appear in your Settings. Don’t worry — you can turn this off whenever you like. The last step is to enable USB Debugging in the Developer Options menu.
+
+## Build and deploy to your phone
+
+Connect your phone to your computer with a USB cable. Then run:
+
+```
+ ./mach build
+ ./mach package
+ ./mach android install-geckoview_example
+```
+
+At this step if you go to the list of applications on your phone, you should be able to spot a "GeckoView Example" application.
+
+## Reflect changes
+
+If you change server files that impact GeckoView, you need to build and install again. Reflect the changes by:
+
+```
+ ./mach build faster
+ ./mach package
+ ./mach android install-geckoview_example
+```
+
+Once you built all, the changes under `devtools/server` and `devtools/shared` can be built with `faster` option. This should be faster.
diff --git a/devtools/client/aboutdebugging/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md b/devtools/client/aboutdebugging/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md
new file mode 100644
index 0000000000..0036080a04
--- /dev/null
+++ b/devtools/client/aboutdebugging/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md
@@ -0,0 +1,152 @@
+# Build GeckoView Reference Browser
+
+## When do you need to build GeckoView Reference Browser
+
+If a remote debugging change impacts the server (file located in `devtools/server` or in `devtools/shared`), you will not be able to test it without building your GeckoView Reference Browser. For the purpose of remote debugging, your local build of Firefox Desktop where you will test about:debugging runs the content of `devtools/client` (including `devtools/client/aboutdebugging`). And `devtools/server` runs on the device. So as soon as you are developing or testing a patch that needs to update the server and is about USB debugging, you need to build GeckoView Reference Browser and deploy it on a test device. To build custom Reference Browser, need two modules of GeckoView and Reference Browser.
+
+## Setup your environment and build
+
+This will be a short documentation focused on the typical patches you may write for about:debugging. For a more complete documentation, you can refer to https://mozilla.github.io/geckoview/ and https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build.
+
+The whole setup needs to download several gigabytes of dependencies so try to have a fast internet connection to follow those steps.
+
+### Make empty directory
+
+It is recommended to create a new directory to build your GeckoView and Reference Browser.
+
+```
+ mkdir geckoview-reference-browser
+ cd geckoview-reference-browser
+```
+
+### Build GeckoView
+
+#### Clone mozilla-central
+
+It is recommended to create a new clone of mozilla-central for your GeckoView builds.
+
+```
+ hg clone https://hg.mozilla.org/mozilla-central mozilla-central-gecko-view
+ cd mozilla-central-gecko-view
+```
+
+#### Run bootstrap
+
+Next simply run `mach bootstrap` and select the third option `3. GeckoView/Firefox for Android Artifact Mode`
+
+```
+ > ./mach bootstrap
+ Please choose the version of Firefox you want to build:
+ 1. Firefox for Desktop Artifact Mode
+ 2. Firefox for Desktop
+ 3. GeckoView/Firefox for Android Artifact Mode
+ 4. GeckoView/Firefox for Android
+ > 3
+```
+
+Follow the instructions, it will take some time as it needs to download a lot of dependencies. At the end it will provide you with a template you should use to create a `.mozconfig` file. You can use the proposed content without changing anything.
+
+### Build
+
+Execute command below to build.
+
+```
+ ./mach build
+ ./mach package
+ ./mach android archive-geckoview
+```
+
+If the build has finished successfully, the GeckoView AAR file will be created in your build output directory. You can find this file with following command:
+
+```
+ > ls mozilla-central-gecko-view/<your-output-directory>/gradle/build/mobile/android/geckoview/outputs/aar
+ geckoview-withGeckoBinaries-debug.aar
+```
+
+
+### Build Reference Browser
+
+#### Clone reference-browser
+
+It is recommended to create a new clone of reference-browser for your Reference Browser builds.
+
+```
+ cd ../
+ git clone https://github.com/mozilla-mobile/reference-browser
+ cd reference-browser
+```
+
+#### Create `local.properties` file
+
+`local.properties` file is necessary to specify the location of the Android SDK. Please write the absolute path of Android SDK with `sdk.dir` key. If you did `./mach bootstrap` once, Android SDK should already installed. You can find the directory whose name is like `android-sdk-<os-name>` under `~/.mozconfig/`. Thus, in mac osx case, the content of `local.properties` should be like below:
+
+```
+sdk.dir=/Users/xxxxxx/.mozbuild/android-sdk-osx
+```
+
+#### Edit `app/build.gradle` to build Reference Browser with above GeckoView
+
+You need to edit two places in `app/build.gradle`.
+
+1. Add `repositories` block with following content to bottom of file. <absolute path to AAR> is the directory which was created by `./mach android archive-geckoview` to build GeckoView. This should be like `/User/xxxxxx/mozilla-central-gecko-view/<your-output-directory>/gradle/build/mobile/android/geckoview/outputs/aar`.
+
+```
+repositories {
+ flatDir(
+ name: "localBuild",
+ dirs: "<absolute path to AAR>"
+ )
+}
+```
+
+2. Edit `geckoNightlyArmImplementation`
+
+```
+dependencies {
+ // ...
+
+ //geckoNightlyArmImplementation Gecko.geckoview_nightly_arm
+ geckoNightlyArmImplementation(
+ name: 'geckoview-withGeckoBinaries-debug',
+ ext: 'aar'
+ )
+
+ // ...
+}
+```
+
+#### Build and deploy to your phone
+
+Connect your phone to your computer with a USB cable. Then run:
+
+```
+ ./gradlew build
+ ./gradlew installGeckoNightlyArmDebug
+```
+
+At this step if you go to the list of applications on your phone, you should be able to spot a "Reference Browser" application.
+
+### Enable USB debugging on your phone
+
+If you already used your device for USB debugging, this should already be enabled, but we will repeat the steps here.
+
+In the Settings menu, choose "About" and scroll down to the Build Number option. There's a hidden option there to activate "developer mode": tap the Build Number option seven times. You’ll see a countdown, and then a "Developer Options" menu will appear in your Settings. Don’t worry — you can turn this off whenever you like. The last step is to enable USB Debugging in the Developer Options menu on Reference Browser on your device.
+
+And, you can test with Reference Browser with custom GeckoView!
+
+## Reflect changes
+
+If you change codes in GeckoView, need to build and install again. Reflect the changes by:
+
+```
+ cd mozilla-central-gecko-view
+ ./mach build faster
+ ./mach package
+ ./mach android archive-geckoview
+ cd ../
+ cd reference-browser
+ ./gradlew build
+ ./gradlew installGeckoNightlyArmDebug
+```
+
+Once you built all, the changes under `devtools/server` and `devtools/shared` can build with `faster` option. This should be faster.
diff --git a/devtools/client/aboutdebugging/documentation/TESTS.md b/devtools/client/aboutdebugging/documentation/TESTS.md
new file mode 100644
index 0000000000..637e0cd18e
--- /dev/null
+++ b/devtools/client/aboutdebugging/documentation/TESTS.md
@@ -0,0 +1,124 @@
+# Running Tests for the new about:debugging
+
+## Tests overview
+
+Tests are located in `devtools/client/aboutdebugging/test`. There are two subfolders, `browser` and `xpcshell`. `browser` contains our [browser mochitests](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Mochitest). Most of our tests are browser mochitests. `xpcshell` contains our [xpc-shell unit tests](https://developer.mozilla.org/en-US/docs/Mozilla/QA/Writing_xpcshell-based_unit_tests). At the moment of writing we only have one.
+
+## Test coverage
+
+You can get some code coverage information at https://codecov.io/gh/mozilla/gecko-dev/tree/master/devtools/client/aboutdebugging/src . The service is sometimes very slow, be patient! You might have to reload the page several times to get a result.
+
+## Running tests
+
+To run tests, you can use `./mach test {path}`. The path argument can be:
+- relative/absolute path to a single test file: will run only this test
+- relative/absolute path to a folder: will run all tests in the folder
+- just a string: will match all the tests that contain this string
+
+A few examples below:
+
+```
+# Run browser_aboutdebugging_addons_manifest_url.js only
+
+./mach test devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js
+
+# or
+
+./mach test browser_aboutdebugging_addons_manifest_url.js
+```
+
+```
+# Run all aboutdebugging tests
+
+./mach test devtools/client/aboutdebugging/test/browser/
+
+# or (this works because all our tests start with "browser_aboutdebugging...")
+
+./mach test browser_aboutdebugging
+```
+
+Having consistent names for our tests can be very helpful to quickly run subset of tests:
+```
+# Run all sidebar tests (will just run all the tests that start with browser_aboutdebugging_sidebar)
+
+./mach test browser_aboutdebugging_sidebar
+```
+
+## Troubleshooting
+
+### Fix the error "ADB process is already running"
+
+Some tests for about:debugging rely on starting and stopping the ADB (android debug bridge) process. However if the process is already running on your machine, the tests have no way to proceed and will fail with the message:
+
+```
+Error: The ADB process is already running on this machine, it should be stopped before running this test
+```
+
+In this case try to kill the process named `adb` in your process manager. If the adb process keeps coming back up, there must be an application that spawns the process. It might be a Firefox instance. Stop all your Firefox instances, then kill the `adb` process again and restart Firefox. (Note that in theory we should always stop adb correctly, but it seems there are still scenarios where this doesn't happen).
+
+### Pause a test
+
+If a test is not behaving as expected, it can be helpful to pause it at a certain step to have the time to investigate. You can add an await such as:
+
+```
+await new Promise(r => setTimeout(r, TIME)); // eg, replace TIME by 60000 to wait for 1 minute
+```
+
+Note that if you really need to wait for a long time, tests will timeout after some time and shutdown automatically. To avoid that, call `requestLongerTimeout(N);` somewhere in your test. `requestLongerTimeout()` takes an integer factor that is a multiplier for the the default 45 seconds timeout. So a factor of 2 means: Wait for at last 90s.
+
+### Attach a JS debugger to mochitests
+
+You can set debug tests with the DevTools debugger by passing the `--jsdebugger` argument to your tests.
+
+At the moment, you need to use `./mach mochitest` instead of `./mach test`, because of [Bug 1519369](https://bugzilla.mozilla.org/show_bug.cgi?id=1519369). This command is less flexible than `./mach test` so you will need to absolutely pass a relative path here.
+
+```
+./mach mochitest relative/path/to/test.js --jsdebugger
+```
+
+This will open a browser toolbox, with the debugger selected, before starting your test. Feel free to browse the files in the debugger and to add breakpoints. However your file is most likely not loaded yet, so the best is usually to add `debugger` statements in your code directly.
+
+This time the tests will wait for you to click on the "Browser chrome test" window to start. Do not be fooled by the "Run all tests" button on this window, clicking anywhere in the window will actually start the tests.
+
+## Other Tips
+
+### Headless mode
+
+Headless mode allows to run tests without opening a Firefox window and therefore blocking your computer.
+
+```
+./mach test browser_aboutdebugging --headless
+```
+
+### Memory leaks and Debug mode
+
+Running tests in debug mode is simply done by using a debug build (build with `ac_add_options --enable-debug`). The added value of debug mode is that it will also assert leaks. It can be very useful to run tests in debug mode if you modified things related to event listeners for instance, and you are not sure if you are cleanly removing all the listeners.
+
+### Test verify mode
+
+The test-verify mode - shortened as "TV" on our continuous integration platforms - will run a single test in a loop with some different flavors. The intent is to make it easier to catch intermittents. If you added or modified a test significantly, it is usually a good idea, to run it in test-verify mode at least once.
+
+```
+# Keeping the --headless argument, because the tests can be pretty slow
+./mach test browser_aboutdebugging_addons_manifest_url.js --headless --test-verify
+```
+
+## Try server
+
+You can push your local changesets to our remote continuous integration server, try. This is useful if you made some significant changes and you would like to make sure nothing is broken in the whole DevTools tests suite, on any platform.
+
+There are many topics to cover here, but none are specific to about:debugging. Here are a few pointers:
+- [Try overview](https://firefox-source-docs.mozilla.org/tools/try/index.html)
+- [Selectors integrated with ./mach](https://firefox-source-docs.mozilla.org/tools/try/selectors/index.html)
+- [Try syntax selector](https://firefox-source-docs.mozilla.org/tools/try/selectors/syntax.html)
+- [Try fuzzy selector](https://firefox-source-docs.mozilla.org/tools/try/selectors/fuzzy.html)
+
+Below is an example of pushing to try using the try syntax selector. As the documentation says, this syntax is obscure and can be difficult to remember, but it is still widely used by developers in mozilla-central.
+
+```
+./mach try -b do -p linux64 -u xpcshell,mochitest-dt,mochitest-chrome --artifact
+```
+
+Refer to the [try syntax documentation](https://firefox-source-docs.mozilla.org/tools/try/selectors/syntax.html) to learn what the various parameters mean.
+
+Note that you need committer access level 1 in order to push to try.
diff --git a/devtools/client/aboutdebugging/documentation/TESTS_REAL_DEVICES.md b/devtools/client/aboutdebugging/documentation/TESTS_REAL_DEVICES.md
new file mode 100644
index 0000000000..f10709fb21
--- /dev/null
+++ b/devtools/client/aboutdebugging/documentation/TESTS_REAL_DEVICES.md
@@ -0,0 +1,67 @@
+# Running Tests with real USB connected devices for the new about:debugging
+
+This document explains how to test with real USB connected devices.
+
+## Tests overview
+
+The tests that use a real device are located in `devtools/client/aboutdebugging/test/browser/`and the name of tests starts with `browser_aboutdebugging_real`. These are normal mochitest, but we need to setup the environment before starting tests.
+
+## Setup environment
+### Real device side
+1. Enable USB debugging on your device
+2. Launch Firefox
+3. Enable USB debugging on your Firefox
+4. Connect to your PC via USB
+
+You can refer to https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/index.html#connecting-to-a-remote-device
+
+### PC side
+Setup the real device information to evaluate the validity in tests.
+
+1. Copy a sample file which is located at `devtools/client/aboutdebugging/test/browser/real/usb-runtimes-sample.json` and rename it for example to `devtools/client/aboutdebugging/test/browser/real/local-usb-runtimes.json`.
+2. Edit the file.
+
+ This is a JSON file like below, write your real device information in here. This example indicates that there should be one USB device and should be displayed `Pixel 2` as device name and `Firefox Nightly` as short name on the sidebar of about:debugging. Regarding the other information, please see `Detail of config file` section of this document.
+
+```
+[
+ {
+ "sidebarInfo": {
+ "deviceName": "Pixel 2",
+ "shortName": "Firefox Nightly"
+ },
+ ...
+ },
+ ...
+]
+```
+
+## Test
+Normally, although we do test `./mach mochitest <path>`, to load the real device information created, specify the path as `USB_RUNTIME` environment variable, then do test.
+For example, if the name of the saved file is `devtools/client/aboutdebugging/test/browser/real/local-usb-runtimes.json`, run all real device test with a command like the one below:
+
+```
+USB_RUNTIMES=devtools/client/aboutdebugging/test/browser/real/local-usb-runtimes.json ./mach mochitest devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real
+```
+
+If there is no `USB_RUNTIMES` environment variable, the tests will not run. This is also to avoid to run on try-server and so on.
+
+## Detail of config file
+
+```
+[
+ {
+ "sidebarInfo": {
+ "deviceName": "Pixel 2", // This should display as device name on the sidebar.
+ "shortName": "Firefox Nightly" // This should display as short name on the sidebar.
+ },
+ "runtimeDetails": {
+ "info": {
+ "name": "Mozilla Nightly", // This should display on the runtime info of runtime page.
+ "version": "64.0a1" // This should display on the runtime info of runtime page.
+ }
+ }
+ }
+ // Of course, you can append additional USB devices. Some tests can do with multiple devices.
+]
+```
diff --git a/devtools/client/aboutdebugging/index.html b/devtools/client/aboutdebugging/index.html
new file mode 100644
index 0000000000..e83bbf4a88
--- /dev/null
+++ b/devtools/client/aboutdebugging/index.html
@@ -0,0 +1,30 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE html>
+<!-- Use force-theme="auto" to force the performance panel UI to use the default
+ Firefox color scheme when loaded in a popup in about:debugging -->
+<html force-theme="auto">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="color-scheme" content="light dark" />
+ <title>Debugging</title>
+ <meta
+ http-equiv="Content-Security-Policy"
+ content="default-src chrome: resource:; img-src data: chrome: resource: https:; object-src 'none'"
+ />
+ <link
+ rel="icon"
+ type="image/png"
+ href="chrome://global/skin/icons/developer.svg"
+ />
+ <link
+ rel="stylesheet"
+ href="chrome://devtools/content/aboutdebugging/aboutdebugging.css"
+ />
+ <script src="resource://devtools/client/aboutdebugging/initializer.js"></script>
+ </head>
+ <body>
+ <div id="mount"></div>
+ </body>
+</html>
diff --git a/devtools/client/aboutdebugging/initializer.js b/devtools/client/aboutdebugging/initializer.js
new file mode 100644
index 0000000000..a541df46b9
--- /dev/null
+++ b/devtools/client/aboutdebugging/initializer.js
@@ -0,0 +1,23 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { BrowserLoader } = ChromeUtils.import(
+ "resource://devtools/shared/loader/browser-loader.js"
+);
+const { require } = BrowserLoader({
+ baseURI: "resource://devtools/client/aboutdebugging/",
+ window,
+});
+
+// The only purpose of this module is to load the real aboutdebugging module via the
+// BrowserLoader.
+// This cannot be done using an inline script tag in index.html because we are applying
+// CSP for about: pages in Bug 1492063.
+// And this module cannot be merged with aboutdebugging.js because modules loaded with
+// script tags are using Promises bound to the lifecycle of the document, while modules
+// loaded with a devtools loader use Promises that will still resolve if the document is
+// destroyed. This is particularly useful to ensure asynchronous destroy() calls succeed.
+require("resource://devtools/client/aboutdebugging/aboutdebugging.js");
diff --git a/devtools/client/aboutdebugging/moz.build b/devtools/client/aboutdebugging/moz.build
new file mode 100644
index 0000000000..0ab3b80613
--- /dev/null
+++ b/devtools/client/aboutdebugging/moz.build
@@ -0,0 +1,20 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "aboutdebugging.js",
+ "initializer.js",
+)
+
+DIRS += [
+ "src",
+]
+
+XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.ini"]
+
+BROWSER_CHROME_MANIFESTS += ["test/browser/browser.ini"]
+
+
+with Files("**"):
+ BUG_COMPONENT = ("DevTools", "about:debugging")
diff --git a/devtools/client/aboutdebugging/src/actions/debug-targets.js b/devtools/client/aboutdebugging/src/actions/debug-targets.js
new file mode 100644
index 0000000000..33b2f1cbea
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/actions/debug-targets.js
@@ -0,0 +1,356 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { AddonManager } = ChromeUtils.importESModule(
+ "resource://gre/modules/AddonManager.sys.mjs",
+ // AddonManager is a singleton, never create two instances of it.
+ { loadInDevToolsLoader: false }
+);
+const {
+ remoteClientManager,
+} = require("resource://devtools/client/shared/remote-debugging/remote-client-manager.js");
+
+const {
+ l10n,
+} = require("resource://devtools/client/aboutdebugging/src/modules/l10n.js");
+
+const {
+ isSupportedDebugTargetPane,
+} = require("resource://devtools/client/aboutdebugging/src/modules/debug-target-support.js");
+
+const {
+ openTemporaryExtension,
+} = require("resource://devtools/client/aboutdebugging/src/modules/extensions-helper.js");
+
+const {
+ getCurrentClient,
+ getCurrentRuntime,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+const {
+ gDevTools,
+} = require("resource://devtools/client/framework/devtools.js");
+
+const {
+ DEBUG_TARGETS,
+ DEBUG_TARGET_PANE,
+ REQUEST_EXTENSIONS_FAILURE,
+ REQUEST_EXTENSIONS_START,
+ REQUEST_EXTENSIONS_SUCCESS,
+ REQUEST_PROCESSES_FAILURE,
+ REQUEST_PROCESSES_START,
+ REQUEST_PROCESSES_SUCCESS,
+ REQUEST_TABS_FAILURE,
+ REQUEST_TABS_START,
+ REQUEST_TABS_SUCCESS,
+ REQUEST_WORKERS_FAILURE,
+ REQUEST_WORKERS_START,
+ REQUEST_WORKERS_SUCCESS,
+ TEMPORARY_EXTENSION_INSTALL_FAILURE,
+ TEMPORARY_EXTENSION_INSTALL_START,
+ TEMPORARY_EXTENSION_INSTALL_SUCCESS,
+ TEMPORARY_EXTENSION_RELOAD_FAILURE,
+ TEMPORARY_EXTENSION_RELOAD_START,
+ TEMPORARY_EXTENSION_RELOAD_SUCCESS,
+ TERMINATE_EXTENSION_BGSCRIPT_FAILURE,
+ TERMINATE_EXTENSION_BGSCRIPT_SUCCESS,
+ TERMINATE_EXTENSION_BGSCRIPT_START,
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+function getTabForUrl(url) {
+ for (const navigator of Services.wm.getEnumerator("navigator:browser")) {
+ for (const browser of navigator.gBrowser.browsers) {
+ if (
+ browser.contentWindow &&
+ browser.contentWindow.location.href === url
+ ) {
+ return navigator.gBrowser.getTabForBrowser(browser);
+ }
+ }
+ }
+
+ return null;
+}
+
+function inspectDebugTarget(type, id) {
+ return async ({ dispatch, getState }) => {
+ const runtime = getCurrentRuntime(getState().runtimes);
+
+ if (
+ type == DEBUG_TARGETS.EXTENSION &&
+ runtime.id === RUNTIMES.THIS_FIREFOX
+ ) {
+ // Bug 1780912: To avoid UX issues when debugging local web extensions,
+ // we are opening the toolbox in an independant window.
+ // Whereas all others are opened in new tabs.
+ gDevTools.showToolboxForWebExtension(id);
+ } else {
+ const urlParams = {
+ type,
+ };
+ // Main process may not provide any ID.
+ if (id) {
+ urlParams.id = id;
+ }
+
+ if (runtime.id !== RUNTIMES.THIS_FIREFOX) {
+ urlParams.remoteId = remoteClientManager.getRemoteId(
+ runtime.id,
+ runtime.type
+ );
+ }
+
+ const url = `about:devtools-toolbox?${new window.URLSearchParams(
+ urlParams
+ )}`;
+
+ const existingTab = getTabForUrl(url);
+ if (existingTab) {
+ const navigator = existingTab.ownerGlobal;
+ navigator.gBrowser.selectedTab = existingTab;
+ navigator.focus();
+ } else {
+ window.open(url);
+ }
+ }
+
+ dispatch(
+ Actions.recordTelemetryEvent("inspect", {
+ target_type: type.toUpperCase(),
+ runtime_type: runtime.type,
+ })
+ );
+ };
+}
+
+function installTemporaryExtension() {
+ const message = l10n.getString(
+ "about-debugging-tmp-extension-install-message"
+ );
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: TEMPORARY_EXTENSION_INSTALL_START });
+ const file = await openTemporaryExtension(window, message);
+ try {
+ await AddonManager.installTemporaryAddon(file);
+ dispatch({ type: TEMPORARY_EXTENSION_INSTALL_SUCCESS });
+ } catch (e) {
+ dispatch({ type: TEMPORARY_EXTENSION_INSTALL_FAILURE, error: e });
+ }
+ };
+}
+
+function pushServiceWorker(id, registrationFront) {
+ return async ({ dispatch, getState }) => {
+ try {
+ // The push button is only available if canDebugServiceWorkers is true.
+ // With this configuration, `push` should always be called on the
+ // registration front, and not on the (service) WorkerTargetActor.
+ await registrationFront.push();
+ } catch (e) {
+ console.error(e);
+ }
+ };
+}
+
+function reloadTemporaryExtension(id) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: TEMPORARY_EXTENSION_RELOAD_START, id });
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ const addonTargetFront = await clientWrapper.getAddon({ id });
+ await addonTargetFront.reload();
+ dispatch({ type: TEMPORARY_EXTENSION_RELOAD_SUCCESS, id });
+ } catch (e) {
+ const error = typeof e === "string" ? new Error(e) : e;
+ dispatch({ type: TEMPORARY_EXTENSION_RELOAD_FAILURE, id, error });
+ }
+ };
+}
+
+function removeTemporaryExtension(id) {
+ return async ({ getState }) => {
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ await clientWrapper.uninstallAddon({ id });
+ } catch (e) {
+ console.error(e);
+ }
+ };
+}
+
+function terminateExtensionBackgroundScript(id) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: TERMINATE_EXTENSION_BGSCRIPT_START, id });
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ const addonTargetFront = await clientWrapper.getAddon({ id });
+ await addonTargetFront.terminateBackgroundScript();
+ dispatch({ type: TERMINATE_EXTENSION_BGSCRIPT_SUCCESS, id });
+ } catch (e) {
+ const error = typeof e === "string" ? new Error(e) : e;
+ dispatch({ type: TERMINATE_EXTENSION_BGSCRIPT_FAILURE, id, error });
+ }
+ };
+}
+
+function requestTabs() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: REQUEST_TABS_START });
+
+ const runtime = getCurrentRuntime(getState().runtimes);
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ const isSupported = isSupportedDebugTargetPane(
+ runtime.runtimeDetails.info.type,
+ DEBUG_TARGET_PANE.TAB
+ );
+ const tabs = isSupported ? await clientWrapper.listTabs() : [];
+
+ // Fetch the favicon for all tabs.
+ await Promise.all(
+ tabs.map(descriptorFront => descriptorFront.retrieveFavicon())
+ );
+
+ dispatch({ type: REQUEST_TABS_SUCCESS, tabs });
+ } catch (e) {
+ dispatch({ type: REQUEST_TABS_FAILURE, error: e });
+ }
+ };
+}
+
+function requestExtensions() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: REQUEST_EXTENSIONS_START });
+
+ const runtime = getCurrentRuntime(getState().runtimes);
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ const isIconDataURLRequired = runtime.type !== RUNTIMES.THIS_FIREFOX;
+ const addons = await clientWrapper.listAddons({
+ iconDataURL: isIconDataURLRequired,
+ });
+
+ const showHiddenAddons = getState().ui.showHiddenAddons;
+
+ // Filter out non-debuggable addons as well as hidden ones, unless the dedicated
+ // preference is set to true.
+ const extensions = addons.filter(
+ a => a.debuggable && (!a.hidden || showHiddenAddons)
+ );
+
+ const installedExtensions = extensions.filter(
+ e => !e.temporarilyInstalled
+ );
+ const temporaryExtensions = extensions.filter(
+ e => e.temporarilyInstalled
+ );
+
+ dispatch({
+ type: REQUEST_EXTENSIONS_SUCCESS,
+ installedExtensions,
+ temporaryExtensions,
+ });
+ } catch (e) {
+ dispatch({ type: REQUEST_EXTENSIONS_FAILURE, error: e });
+ }
+ };
+}
+
+function requestProcesses() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: REQUEST_PROCESSES_START });
+
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ const mainProcessDescriptorFront = await clientWrapper.getMainProcess();
+ dispatch({
+ type: REQUEST_PROCESSES_SUCCESS,
+ mainProcess: {
+ id: 0,
+ processFront: mainProcessDescriptorFront,
+ },
+ });
+ } catch (e) {
+ dispatch({ type: REQUEST_PROCESSES_FAILURE, error: e });
+ }
+ };
+}
+
+function requestWorkers() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: REQUEST_WORKERS_START });
+
+ const clientWrapper = getCurrentClient(getState().runtimes);
+
+ try {
+ const { otherWorkers, serviceWorkers, sharedWorkers } =
+ await clientWrapper.listWorkers();
+
+ for (const serviceWorker of serviceWorkers) {
+ const { registrationFront } = serviceWorker;
+ if (!registrationFront) {
+ continue;
+ }
+
+ const subscription = await registrationFront.getPushSubscription();
+ serviceWorker.subscription = subscription;
+ }
+
+ dispatch({
+ type: REQUEST_WORKERS_SUCCESS,
+ otherWorkers,
+ serviceWorkers,
+ sharedWorkers,
+ });
+ } catch (e) {
+ dispatch({ type: REQUEST_WORKERS_FAILURE, error: e });
+ }
+ };
+}
+
+function startServiceWorker(registrationFront) {
+ return async () => {
+ try {
+ await registrationFront.start();
+ } catch (e) {
+ console.error(e);
+ }
+ };
+}
+
+function unregisterServiceWorker(registrationFront) {
+ return async () => {
+ try {
+ await registrationFront.unregister();
+ } catch (e) {
+ console.error(e);
+ }
+ };
+}
+
+module.exports = {
+ inspectDebugTarget,
+ installTemporaryExtension,
+ pushServiceWorker,
+ reloadTemporaryExtension,
+ removeTemporaryExtension,
+ requestTabs,
+ requestExtensions,
+ requestProcesses,
+ requestWorkers,
+ startServiceWorker,
+ terminateExtensionBackgroundScript,
+ unregisterServiceWorker,
+};
diff --git a/devtools/client/aboutdebugging/src/actions/index.js b/devtools/client/aboutdebugging/src/actions/index.js
new file mode 100644
index 0000000000..797d2c5831
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/actions/index.js
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const debugTargets = require("resource://devtools/client/aboutdebugging/src/actions/debug-targets.js");
+const runtimes = require("resource://devtools/client/aboutdebugging/src/actions/runtimes.js");
+const telemetry = require("resource://devtools/client/aboutdebugging/src/actions/telemetry.js");
+const ui = require("resource://devtools/client/aboutdebugging/src/actions/ui.js");
+
+Object.assign(exports, ui, runtimes, telemetry, debugTargets);
diff --git a/devtools/client/aboutdebugging/src/actions/moz.build b/devtools/client/aboutdebugging/src/actions/moz.build
new file mode 100644
index 0000000000..a750640d06
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/actions/moz.build
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "debug-targets.js",
+ "index.js",
+ "runtimes.js",
+ "telemetry.js",
+ "ui.js",
+)
diff --git a/devtools/client/aboutdebugging/src/actions/runtimes.js b/devtools/client/aboutdebugging/src/actions/runtimes.js
new file mode 100644
index 0000000000..fba620951e
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/actions/runtimes.js
@@ -0,0 +1,515 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+const {
+ getAllRuntimes,
+ getCurrentRuntime,
+ findRuntimeById,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+const {
+ l10n,
+} = require("resource://devtools/client/aboutdebugging/src/modules/l10n.js");
+const {
+ setDefaultPreferencesIfNeeded,
+ DEFAULT_PREFERENCES,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtime-default-preferences.js");
+const {
+ createClientForRuntime,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtime-client-factory.js");
+const {
+ isSupportedDebugTargetPane,
+} = require("resource://devtools/client/aboutdebugging/src/modules/debug-target-support.js");
+
+const {
+ remoteClientManager,
+} = require("resource://devtools/client/shared/remote-debugging/remote-client-manager.js");
+
+const {
+ CONNECT_RUNTIME_CANCEL,
+ CONNECT_RUNTIME_FAILURE,
+ CONNECT_RUNTIME_NOT_RESPONDING,
+ CONNECT_RUNTIME_START,
+ CONNECT_RUNTIME_SUCCESS,
+ DEBUG_TARGET_PANE,
+ DISCONNECT_RUNTIME_FAILURE,
+ DISCONNECT_RUNTIME_START,
+ DISCONNECT_RUNTIME_SUCCESS,
+ PAGE_TYPES,
+ REMOTE_RUNTIMES_UPDATED,
+ RUNTIME_PREFERENCE,
+ RUNTIMES,
+ THIS_FIREFOX_RUNTIME_CREATED,
+ UNWATCH_RUNTIME_FAILURE,
+ UNWATCH_RUNTIME_START,
+ UNWATCH_RUNTIME_SUCCESS,
+ UPDATE_CONNECTION_PROMPT_SETTING_FAILURE,
+ UPDATE_CONNECTION_PROMPT_SETTING_START,
+ UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
+ WATCH_RUNTIME_FAILURE,
+ WATCH_RUNTIME_START,
+ WATCH_RUNTIME_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const CONNECTION_TIMING_OUT_DELAY = 3000;
+const CONNECTION_CANCEL_DELAY = 13000;
+
+async function getRuntimeIcon(runtime, channel) {
+ if (runtime.isFenix) {
+ switch (channel) {
+ case "release":
+ case "beta":
+ return "chrome://devtools/skin/images/aboutdebugging-fenix.svg";
+ case "aurora":
+ default:
+ return "chrome://devtools/skin/images/aboutdebugging-fenix-nightly.svg";
+ }
+ }
+
+ return channel === "release" || channel === "beta" || channel === "aurora"
+ ? `chrome://devtools/skin/images/aboutdebugging-firefox-${channel}.svg`
+ : "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg";
+}
+
+function onRemoteDevToolsClientClosed() {
+ window.AboutDebugging.onNetworkLocationsUpdated();
+ window.AboutDebugging.onUSBRuntimesUpdated();
+}
+
+function connectRuntime(id) {
+ // Create a random connection id to track the connection attempt in telemetry.
+ const connectionId = (Math.random() * 100000) | 0;
+
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: CONNECT_RUNTIME_START, connectionId, id });
+
+ // The preferences test-connection-timing-out-delay and test-connection-cancel-delay
+ // don't have a default value but will be overridden during our tests.
+ const connectionTimingOutDelay = Services.prefs.getIntPref(
+ "devtools.aboutdebugging.test-connection-timing-out-delay",
+ CONNECTION_TIMING_OUT_DELAY
+ );
+ const connectionCancelDelay = Services.prefs.getIntPref(
+ "devtools.aboutdebugging.test-connection-cancel-delay",
+ CONNECTION_CANCEL_DELAY
+ );
+
+ const connectionNotRespondingTimer = setTimeout(() => {
+ // If connecting to the runtime takes time over CONNECTION_TIMING_OUT_DELAY,
+ // we assume the connection prompt is showing on the runtime, show a dialog
+ // to let user know that.
+ dispatch({ type: CONNECT_RUNTIME_NOT_RESPONDING, connectionId, id });
+ }, connectionTimingOutDelay);
+ const connectionCancelTimer = setTimeout(() => {
+ // Connect button of the runtime will be disabled during connection, but the status
+ // continues till the connection was either succeed or failed. This may have a
+ // possibility that the disabling continues unless page reloading, user will not be
+ // able to click again. To avoid this, revert the connect button status after
+ // CONNECTION_CANCEL_DELAY ms.
+ dispatch({ type: CONNECT_RUNTIME_CANCEL, connectionId, id });
+ }, connectionCancelDelay);
+
+ try {
+ const runtime = findRuntimeById(id, getState().runtimes);
+ const clientWrapper = await createClientForRuntime(runtime);
+
+ await setDefaultPreferencesIfNeeded(clientWrapper, DEFAULT_PREFERENCES);
+
+ const deviceDescription = await clientWrapper.getDeviceDescription();
+ const compatibilityReport =
+ await clientWrapper.checkVersionCompatibility();
+ const icon = await getRuntimeIcon(runtime, deviceDescription.channel);
+
+ const {
+ CONNECTION_PROMPT,
+ PERMANENT_PRIVATE_BROWSING,
+ SERVICE_WORKERS_ENABLED,
+ } = RUNTIME_PREFERENCE;
+ const connectionPromptEnabled = await clientWrapper.getPreference(
+ CONNECTION_PROMPT,
+ false
+ );
+ const privateBrowsing = await clientWrapper.getPreference(
+ PERMANENT_PRIVATE_BROWSING,
+ false
+ );
+ const serviceWorkersEnabled = await clientWrapper.getPreference(
+ SERVICE_WORKERS_ENABLED,
+ true
+ );
+ const serviceWorkersAvailable = serviceWorkersEnabled && !privateBrowsing;
+
+ // Fenix specific workarounds are needed until we can get proper server side APIs
+ // to detect Fenix and get the proper application names and versions.
+ // See https://github.com/mozilla-mobile/fenix/issues/2016.
+
+ // For Fenix runtimes, the ADB runtime name is more accurate than the one returned
+ // by the Device actor.
+ const runtimeName = runtime.isFenix
+ ? runtime.name
+ : deviceDescription.name;
+
+ // For Fenix runtimes, the version we should display is the application version
+ // retrieved from ADB, and not the Gecko version returned by the Device actor.
+ const version = runtime.isFenix
+ ? runtime.extra.adbPackageVersion
+ : deviceDescription.version;
+
+ const runtimeDetails = {
+ canDebugServiceWorkers: deviceDescription.canDebugServiceWorkers,
+ clientWrapper,
+ compatibilityReport,
+ connectionPromptEnabled,
+ info: {
+ deviceName: deviceDescription.deviceName,
+ icon,
+ isFenix: runtime.isFenix,
+ name: runtimeName,
+ os: deviceDescription.os,
+ type: runtime.type,
+ version,
+ },
+ serviceWorkersAvailable,
+ };
+
+ if (runtime.type !== RUNTIMES.THIS_FIREFOX) {
+ // `closed` event will be emitted when disabling remote debugging
+ // on the connected remote runtime.
+ clientWrapper.once("closed", onRemoteDevToolsClientClosed);
+ }
+
+ dispatch({
+ type: CONNECT_RUNTIME_SUCCESS,
+ connectionId,
+ runtime: {
+ id,
+ runtimeDetails,
+ type: runtime.type,
+ },
+ });
+ } catch (e) {
+ dispatch({ type: CONNECT_RUNTIME_FAILURE, connectionId, id, error: e });
+ } finally {
+ clearTimeout(connectionNotRespondingTimer);
+ clearTimeout(connectionCancelTimer);
+ }
+ };
+}
+
+function createThisFirefoxRuntime() {
+ return ({ dispatch, getState }) => {
+ const thisFirefoxRuntime = {
+ id: RUNTIMES.THIS_FIREFOX,
+ isConnecting: false,
+ isConnectionFailed: false,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: false,
+ isUnavailable: false,
+ isUnplugged: false,
+ name: l10n.getString("about-debugging-this-firefox-runtime-name"),
+ type: RUNTIMES.THIS_FIREFOX,
+ };
+ dispatch({
+ type: THIS_FIREFOX_RUNTIME_CREATED,
+ runtime: thisFirefoxRuntime,
+ });
+ };
+}
+
+function disconnectRuntime(id, shouldRedirect = false) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: DISCONNECT_RUNTIME_START });
+ try {
+ const runtime = findRuntimeById(id, getState().runtimes);
+ const { clientWrapper } = runtime.runtimeDetails;
+
+ if (runtime.type !== RUNTIMES.THIS_FIREFOX) {
+ clientWrapper.off("closed", onRemoteDevToolsClientClosed);
+ }
+ await clientWrapper.close();
+ if (shouldRedirect) {
+ await dispatch(
+ Actions.selectPage(PAGE_TYPES.RUNTIME, RUNTIMES.THIS_FIREFOX)
+ );
+ }
+
+ dispatch({
+ type: DISCONNECT_RUNTIME_SUCCESS,
+ runtime: {
+ id,
+ type: runtime.type,
+ },
+ });
+ } catch (e) {
+ dispatch({ type: DISCONNECT_RUNTIME_FAILURE, error: e });
+ }
+ };
+}
+
+function updateConnectionPromptSetting(connectionPromptEnabled) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: UPDATE_CONNECTION_PROMPT_SETTING_START });
+ try {
+ const runtime = getCurrentRuntime(getState().runtimes);
+ const { clientWrapper } = runtime.runtimeDetails;
+ const promptPrefName = RUNTIME_PREFERENCE.CONNECTION_PROMPT;
+ await clientWrapper.setPreference(
+ promptPrefName,
+ connectionPromptEnabled
+ );
+ // Re-get actual value from the runtime.
+ connectionPromptEnabled = await clientWrapper.getPreference(
+ promptPrefName,
+ connectionPromptEnabled
+ );
+
+ dispatch({
+ type: UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
+ connectionPromptEnabled,
+ runtime,
+ });
+ } catch (e) {
+ dispatch({ type: UPDATE_CONNECTION_PROMPT_SETTING_FAILURE, error: e });
+ }
+ };
+}
+
+function watchRuntime(id) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: WATCH_RUNTIME_START });
+
+ try {
+ if (id === RUNTIMES.THIS_FIREFOX) {
+ // THIS_FIREFOX connects and disconnects on the fly when opening the page.
+ await dispatch(connectRuntime(RUNTIMES.THIS_FIREFOX));
+ }
+
+ // The selected runtime should already have a connected client assigned.
+ const runtime = findRuntimeById(id, getState().runtimes);
+ await dispatch({ type: WATCH_RUNTIME_SUCCESS, runtime });
+
+ dispatch(Actions.requestExtensions());
+ // we have to wait for tabs, otherwise the requests to getTarget may interfer
+ // with listProcesses
+ await dispatch(Actions.requestTabs());
+ dispatch(Actions.requestWorkers());
+
+ if (
+ isSupportedDebugTargetPane(
+ runtime.runtimeDetails.info.type,
+ DEBUG_TARGET_PANE.PROCESSES
+ )
+ ) {
+ dispatch(Actions.requestProcesses());
+ }
+ } catch (e) {
+ dispatch({ type: WATCH_RUNTIME_FAILURE, error: e });
+ }
+ };
+}
+
+function unwatchRuntime(id) {
+ return async ({ dispatch, getState }) => {
+ const runtime = findRuntimeById(id, getState().runtimes);
+
+ dispatch({ type: UNWATCH_RUNTIME_START, runtime });
+
+ try {
+ if (id === RUNTIMES.THIS_FIREFOX) {
+ // THIS_FIREFOX connects and disconnects on the fly when opening the page.
+ await dispatch(disconnectRuntime(RUNTIMES.THIS_FIREFOX));
+ }
+
+ dispatch({ type: UNWATCH_RUNTIME_SUCCESS });
+ } catch (e) {
+ dispatch({ type: UNWATCH_RUNTIME_FAILURE, error: e });
+ }
+ };
+}
+
+function updateNetworkRuntimes(locations) {
+ const runtimes = locations.map(location => {
+ const [host, port] = location.split(":");
+ return {
+ id: location,
+ extra: {
+ connectionParameters: { host, port: parseInt(port, 10) },
+ },
+ isConnecting: false,
+ isConnectionFailed: false,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: false,
+ isFenix: false,
+ isUnavailable: false,
+ isUnplugged: false,
+ isUnknown: false,
+ name: location,
+ type: RUNTIMES.NETWORK,
+ };
+ });
+ return updateRemoteRuntimes(runtimes, RUNTIMES.NETWORK);
+}
+
+function updateUSBRuntimes(adbRuntimes) {
+ const runtimes = adbRuntimes.map(adbRuntime => {
+ // Set connectionParameters only for known runtimes.
+ const socketPath = adbRuntime.socketPath;
+ const deviceId = adbRuntime.deviceId;
+ const connectionParameters = socketPath ? { deviceId, socketPath } : null;
+ return {
+ id: adbRuntime.id,
+ extra: {
+ connectionParameters,
+ deviceName: adbRuntime.deviceName,
+ adbPackageVersion: adbRuntime.versionName,
+ },
+ isConnecting: false,
+ isConnectionFailed: false,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: false,
+ isFenix: adbRuntime.isFenix,
+ isUnavailable: adbRuntime.isUnavailable,
+ isUnplugged: adbRuntime.isUnplugged,
+ name: adbRuntime.shortName,
+ type: RUNTIMES.USB,
+ };
+ });
+ return updateRemoteRuntimes(runtimes, RUNTIMES.USB);
+}
+
+/**
+ * Check that a given runtime can still be found in the provided array of runtimes, and
+ * that the connection of the associated DevToolsClient is still valid.
+ * Note that this check is only valid for runtimes which match the type of the runtimes
+ * in the array.
+ */
+function _isRuntimeValid(runtime, runtimes) {
+ const isRuntimeAvailable = runtimes.some(r => r.id === runtime.id);
+ const isConnectionValid =
+ runtime.runtimeDetails && !runtime.runtimeDetails.clientWrapper.isClosed();
+ return isRuntimeAvailable && isConnectionValid;
+}
+
+function updateRemoteRuntimes(runtimes, type) {
+ return async ({ dispatch, getState }) => {
+ const currentRuntime = getCurrentRuntime(getState().runtimes);
+
+ // Check if the updated remote runtimes should trigger a navigation out of the current
+ // runtime page.
+ if (
+ currentRuntime &&
+ currentRuntime.type === type &&
+ !_isRuntimeValid(currentRuntime, runtimes)
+ ) {
+ // Since current remote runtime is invalid, move to this firefox page.
+ // This case is considered as followings and so on:
+ // * Remove ADB addon
+ // * (Physically) Disconnect USB runtime
+ //
+ // The reason we call selectPage before REMOTE_RUNTIMES_UPDATED is fired is below.
+ // Current runtime can not be retrieved after REMOTE_RUNTIMES_UPDATED action, since
+ // that updates runtime state. So, before that we fire selectPage action to execute
+ // `unwatchRuntime` correctly.
+ await dispatch(
+ Actions.selectPage(PAGE_TYPES.RUNTIME, RUNTIMES.THIS_FIREFOX)
+ );
+ }
+
+ // For existing runtimes, transfer all properties that are not available in the
+ // runtime objects passed to this method:
+ // - runtimeDetails (set by about:debugging after a successful connection)
+ // - isConnecting (set by about:debugging during the connection)
+ // - isConnectionFailed (set by about:debugging if connection was failed)
+ // - isConnectionNotResponding
+ // (set by about:debugging if connection is taking too much time)
+ // - isConnectionTimeout (set by about:debugging if connection was timeout)
+ runtimes.forEach(runtime => {
+ const existingRuntime = findRuntimeById(runtime.id, getState().runtimes);
+ const isConnectionValid =
+ existingRuntime?.runtimeDetails &&
+ !existingRuntime.runtimeDetails.clientWrapper.isClosed();
+ runtime.runtimeDetails = isConnectionValid
+ ? existingRuntime.runtimeDetails
+ : null;
+ runtime.isConnecting = existingRuntime
+ ? existingRuntime.isConnecting
+ : false;
+ runtime.isConnectionFailed = existingRuntime
+ ? existingRuntime.isConnectionFailed
+ : false;
+ runtime.isConnectionNotResponding = existingRuntime
+ ? existingRuntime.isConnectionNotResponding
+ : false;
+ runtime.isConnectionTimeout = existingRuntime
+ ? existingRuntime.isConnectionTimeout
+ : false;
+ });
+
+ const existingRuntimes = getAllRuntimes(getState().runtimes);
+ for (const runtime of existingRuntimes) {
+ // Runtime was connected before.
+ const isConnected = runtime.runtimeDetails;
+ // Runtime is of the same type as the updated runtimes array, so we should check it.
+ const isSameType = runtime.type === type;
+ if (isConnected && isSameType && !_isRuntimeValid(runtime, runtimes)) {
+ // Disconnect runtimes that were no longer valid.
+ await dispatch(disconnectRuntime(runtime.id));
+ }
+ }
+
+ dispatch({ type: REMOTE_RUNTIMES_UPDATED, runtimes, runtimeType: type });
+
+ for (const runtime of getAllRuntimes(getState().runtimes)) {
+ if (runtime.type !== type) {
+ continue;
+ }
+
+ // Reconnect clients already available in the RemoteClientManager.
+ const isConnected = !!runtime.runtimeDetails;
+ const hasConnectedClient = remoteClientManager.hasClient(
+ runtime.id,
+ runtime.type
+ );
+ if (!isConnected && hasConnectedClient) {
+ await dispatch(connectRuntime(runtime.id));
+ }
+ }
+ };
+}
+
+/**
+ * Remove all the listeners added on client objects. Since those objects are persisted
+ * regardless of the about:debugging lifecycle, all the added events should be removed
+ * before leaving about:debugging.
+ */
+function removeRuntimeListeners() {
+ return ({ dispatch, getState }) => {
+ const allRuntimes = getAllRuntimes(getState().runtimes);
+ const remoteRuntimes = allRuntimes.filter(
+ r => r.type !== RUNTIMES.THIS_FIREFOX
+ );
+ for (const runtime of remoteRuntimes) {
+ if (runtime.runtimeDetails) {
+ const { clientWrapper } = runtime.runtimeDetails;
+ clientWrapper.off("closed", onRemoteDevToolsClientClosed);
+ }
+ }
+ };
+}
+
+module.exports = {
+ connectRuntime,
+ createThisFirefoxRuntime,
+ disconnectRuntime,
+ removeRuntimeListeners,
+ unwatchRuntime,
+ updateConnectionPromptSetting,
+ updateNetworkRuntimes,
+ updateUSBRuntimes,
+ watchRuntime,
+};
diff --git a/devtools/client/aboutdebugging/src/actions/telemetry.js b/devtools/client/aboutdebugging/src/actions/telemetry.js
new file mode 100644
index 0000000000..b418c77a50
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/actions/telemetry.js
@@ -0,0 +1,23 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ TELEMETRY_RECORD,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * If a given event cannot be mapped to an existing action, use this action that will only
+ * be processed by the event recording middleware.
+ */
+function recordTelemetryEvent(method, details) {
+ return ({ dispatch, getState }) => {
+ dispatch({ type: TELEMETRY_RECORD, method, details });
+ };
+}
+
+module.exports = {
+ recordTelemetryEvent,
+};
diff --git a/devtools/client/aboutdebugging/src/actions/ui.js b/devtools/client/aboutdebugging/src/actions/ui.js
new file mode 100644
index 0000000000..fb676cefd6
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/actions/ui.js
@@ -0,0 +1,202 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ ADB_ADDON_INSTALL_START,
+ ADB_ADDON_INSTALL_SUCCESS,
+ ADB_ADDON_INSTALL_FAILURE,
+ ADB_ADDON_UNINSTALL_START,
+ ADB_ADDON_UNINSTALL_SUCCESS,
+ ADB_ADDON_UNINSTALL_FAILURE,
+ ADB_ADDON_STATUS_UPDATED,
+ ADB_READY_UPDATED,
+ DEBUG_TARGET_COLLAPSIBILITY_UPDATED,
+ HIDE_PROFILER_DIALOG,
+ NETWORK_LOCATIONS_UPDATE_FAILURE,
+ NETWORK_LOCATIONS_UPDATE_START,
+ NETWORK_LOCATIONS_UPDATE_SUCCESS,
+ PAGE_TYPES,
+ SELECT_PAGE_FAILURE,
+ SELECT_PAGE_START,
+ SELECT_PAGE_SUCCESS,
+ SELECTED_RUNTIME_ID_UPDATED,
+ SHOW_PROFILER_DIALOG,
+ SWITCH_PROFILER_CONTEXT,
+ USB_RUNTIMES_SCAN_START,
+ USB_RUNTIMES_SCAN_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const NetworkLocationsModule = require("resource://devtools/client/aboutdebugging/src/modules/network-locations.js");
+const {
+ adbAddon,
+} = require("resource://devtools/client/shared/remote-debugging/adb/adb-addon.js");
+const {
+ refreshUSBRuntimes,
+} = require("resource://devtools/client/aboutdebugging/src/modules/usb-runtimes.js");
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+function selectPage(page, runtimeId) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: SELECT_PAGE_START });
+
+ try {
+ const isSamePage = (oldPage, newPage) => {
+ if (newPage === PAGE_TYPES.RUNTIME && oldPage === PAGE_TYPES.RUNTIME) {
+ return runtimeId === getState().runtimes.selectedRuntimeId;
+ }
+ return newPage === oldPage;
+ };
+
+ if (!page) {
+ throw new Error("No page provided.");
+ }
+
+ const currentPage = getState().ui.selectedPage;
+ // Nothing to dispatch if the page is the same as the current page
+ if (isSamePage(currentPage, page)) {
+ return;
+ }
+
+ // Stop showing the profiler dialog if we are navigating to another page.
+ if (getState().ui.showProfilerDialog) {
+ await dispatch({ type: HIDE_PROFILER_DIALOG });
+ }
+
+ // Stop watching current runtime, if currently on a RUNTIME page.
+ if (currentPage === PAGE_TYPES.RUNTIME) {
+ const currentRuntimeId = getState().runtimes.selectedRuntimeId;
+ await dispatch(Actions.unwatchRuntime(currentRuntimeId));
+ }
+
+ // Always update the selected runtime id.
+ // If we are navigating to a non-runtime page, the Runtime page components are no
+ // longer rendered so it is safe to nullify the runtimeId.
+ // If we are navigating to a runtime page, the runtime corresponding to runtimeId
+ // is already connected, so components can safely get runtimeDetails on this new
+ // runtime.
+ dispatch({ type: SELECTED_RUNTIME_ID_UPDATED, runtimeId });
+
+ // Start watching current runtime, if moving to a RUNTIME page.
+ if (page === PAGE_TYPES.RUNTIME) {
+ await dispatch(Actions.watchRuntime(runtimeId));
+ }
+
+ dispatch({ type: SELECT_PAGE_SUCCESS, page });
+ } catch (e) {
+ dispatch({ type: SELECT_PAGE_FAILURE, error: e });
+ }
+ };
+}
+
+function updateDebugTargetCollapsibility(key, isCollapsed) {
+ return { type: DEBUG_TARGET_COLLAPSIBILITY_UPDATED, key, isCollapsed };
+}
+
+function addNetworkLocation(location) {
+ return ({ dispatch, getState }) => {
+ NetworkLocationsModule.addNetworkLocation(location);
+ };
+}
+
+function removeNetworkLocation(location) {
+ return ({ dispatch, getState }) => {
+ NetworkLocationsModule.removeNetworkLocation(location);
+ };
+}
+
+function showProfilerDialog() {
+ return { type: SHOW_PROFILER_DIALOG };
+}
+
+/**
+ * The profiler can switch between "devtools-remote" and "aboutprofiling-remote"
+ * page contexts.
+ */
+function switchProfilerContext(profilerContext) {
+ return { type: SWITCH_PROFILER_CONTEXT, profilerContext };
+}
+
+function hideProfilerDialog() {
+ return { type: HIDE_PROFILER_DIALOG };
+}
+
+function updateAdbAddonStatus(adbAddonStatus) {
+ return { type: ADB_ADDON_STATUS_UPDATED, adbAddonStatus };
+}
+
+function updateAdbReady(isAdbReady) {
+ return { type: ADB_READY_UPDATED, isAdbReady };
+}
+
+function updateNetworkLocations(locations) {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: NETWORK_LOCATIONS_UPDATE_START });
+ try {
+ await dispatch(Actions.updateNetworkRuntimes(locations));
+ dispatch({ type: NETWORK_LOCATIONS_UPDATE_SUCCESS, locations });
+ } catch (e) {
+ dispatch({ type: NETWORK_LOCATIONS_UPDATE_FAILURE, error: e });
+ }
+ };
+}
+
+function installAdbAddon() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: ADB_ADDON_INSTALL_START });
+
+ try {
+ // "aboutdebugging" will be forwarded to telemetry as the installation source
+ // for the addon.
+ await adbAddon.install("about:debugging");
+ dispatch({ type: ADB_ADDON_INSTALL_SUCCESS });
+ } catch (e) {
+ dispatch({ type: ADB_ADDON_INSTALL_FAILURE, error: e });
+ }
+ };
+}
+
+function uninstallAdbAddon() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: ADB_ADDON_UNINSTALL_START });
+
+ try {
+ await adbAddon.uninstall();
+ dispatch({ type: ADB_ADDON_UNINSTALL_SUCCESS });
+ } catch (e) {
+ dispatch({ type: ADB_ADDON_UNINSTALL_FAILURE, error: e });
+ }
+ };
+}
+
+function scanUSBRuntimes() {
+ return async ({ dispatch, getState }) => {
+ // do not re-scan if we are already doing it
+ if (getState().ui.isScanningUsb) {
+ return;
+ }
+
+ dispatch({ type: USB_RUNTIMES_SCAN_START });
+ await refreshUSBRuntimes();
+ dispatch({ type: USB_RUNTIMES_SCAN_SUCCESS });
+ };
+}
+
+module.exports = {
+ addNetworkLocation,
+ hideProfilerDialog,
+ installAdbAddon,
+ removeNetworkLocation,
+ scanUSBRuntimes,
+ selectPage,
+ showProfilerDialog,
+ switchProfilerContext,
+ uninstallAdbAddon,
+ updateAdbAddonStatus,
+ updateAdbReady,
+ updateDebugTargetCollapsibility,
+ updateNetworkLocations,
+};
diff --git a/devtools/client/aboutdebugging/src/base.css b/devtools/client/aboutdebugging/src/base.css
new file mode 100644
index 0000000000..728cbeed0c
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/base.css
@@ -0,0 +1,521 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+:root {
+ /* Colors from common.css */
+ --in-content-background-color: f9f9fa;
+ --in-content-border-color: #d7d7db;
+ --in-content-primary-button-background: rgb(0, 97, 224);
+ --in-content-primary-button-background-active: rgb(5, 62, 148);
+ --in-content-primary-button-background-hover: rgb(2, 80, 187);
+ --in-content-text-color: #0c0c0d;
+
+ --bg-color: var(--in-content-background-color);
+ --text-color: var(--in-content-text-color);
+ --secondary-text-color: var(--grey-50);
+
+ --border-color: var(--in-content-border-color);
+
+ --box-background: #fff;
+ --box-border-color: var(--in-content-border-color);
+
+ --button-background-color: var(--grey-90-a10); /* Note: this is from Photon Default button */
+ --button-color: var(--grey-90); /* Note: this is from Photon Default button */
+ --button-hover-background-color: var(--grey-90-a20); /* Note: this is from Photon Default button */
+ --button-active-background-color: var(--grey-90-a30); /* Note: this is from Photon Default button */
+
+ --category-background-hover: rgba(12,12,13,0.1);
+ --category-text: rgba(12,12,13);
+ --category-text-selected: var(--in-content-primary-button-background);
+
+ --fieldpair-text-color: var(--grey-50);
+
+ --sidebar-text-color: var(--category-text);
+ --sidebar-selected-color: var(--category-text-selected);
+ --sidebar-background-hover: var(--category-background-hover);
+
+ --card-background-color: var(--white-100);
+ --card-separator-color: var(--grey-20);
+
+ /* Dimensions from common.css #categories > .category */
+ /* TODO: Values are not based on photon's 4px base distance, see bug 1501638 */
+ --category-height: 48px;
+ --category-padding: 10px;
+ --category-transition-duration: 150ms;
+
+ --icon-ok-color: var(--green-70);
+ --icon-info-color: var(--grey-90);
+
+ --link-color: var(--in-content-primary-button-background);
+ --link-color-active: var(--in-content-primary-button-background-active);
+ --link-color-hover: var(--in-content-primary-button-background-hover);
+
+ --primary-button-background-color: var(--blue-60);
+ --primary-button-color: var(--white-100);
+ --primary-button-hover-background-color: var(--blue-70);
+ --primary-button-active-background-color: var(--blue-80);
+
+ --popup-header-background-color: var(--grey-20);
+ --popup-header-color: var(--grey-90);
+
+ /* Colors from Photon */
+ --success-background: #30e60b;
+ --warning-background: #fffbd6; /* from the Web Console */
+ --warning-border: rgba(164, 127, 0, 0.27); /* yellow-70(#a47f00) at 27% */
+ --warning-icon: var(--yellow-65); /* from the Web Console */
+ --warning-text: var(--yellow-80); /* from the Web Console */
+ --error-background: #fdf2f5; /* from the Web Console */
+ --error-border: rgba(90, 0, 2, 0.16); /* red-80(#5a0002) at 16% */
+ --error-icon: var(--red-60); /* from the Web Console */
+ --error-text: var(--red-70); /* from the Web Console */
+ --highlight-50: #0a84ff;
+ --grey-20: #ededf0; /* for ui, no special semantic */
+ --grey-30: #d7d7db; /* for ui, no special semantic */
+ --grey-50: #737373; /* for ui, no special semantic */
+ --grey-90: #0c0c0d; /* for ui, no special semantic */
+ --grey-90-a10: rgba(12, 12, 13, 0.1);
+ --grey-90-a20: rgba(12, 12, 13, 0.2);
+ --grey-90-a30: rgba(12, 12, 13, 0.3);
+ --grey-90-a60: rgba(12, 12, 13, 0.6);
+ --red-70: #a4000f; /* for ui, no special semantic */
+ --white-100: #fff; /* for ui, no special semantic */
+ --yellow-60: #d7b600; /* for ui, no special semantic */
+ --yellow-70: #a47f00; /* for ui, no special semantic */
+
+ /* Typography from Photon */
+ /* See https://firefox-dev.tools/photon/visuals/typography.html */
+ --body-10-font-size: 13px;
+ --body-10-font-weight: 400;
+ --body-20-font-size: 15px;
+ --body-20-font-weight: 400;
+ --body-20-font-weight-bold: 700;
+ --caption-10-font-size: 11px;
+ --caption-10-font-weight: 400;
+ --caption-20-font-size: 13px;
+ --caption-20-font-weight: 400;
+ --display-10-font-size: 28px;
+ --display-10-font-weight: 200;
+ --title-20-font-size: 17px;
+ --title-20-font-weight: 600;
+ --title-30-font-size: 22px;
+ --title-30-font-weight: 300;
+
+ /* Global layout vars */
+ --page-width: 664px;
+ --base-unit: 4px;
+
+ /* Global styles */
+ --base-font-style: message-box;
+ --base-font-size: var(--body-10-font-size);
+ --base-font-weight: var(--body-10-font-weight);
+ --base-line-height: 1.8;
+ --icon-label-font-size: var(--body-10-font-size);
+ --message-font-size: var(--body-10-font-size);
+ --button-font-size: var(--base-font-size);
+ --micro-font-size: 11px;
+ --monospace-font-family: monospace;
+
+ --card-shadow-blur-radius: var(--base-unit);
+
+
+ /*
+ * Variables particular to about:debugging
+ */
+ --alt-heading-icon-size: calc(var(--base-unit) * 6);
+ --alt-heading-icon-gap: var(--base-unit);
+ --main-heading-icon-size: calc(var(--base-unit) * 17); /* 4px * 17 = 68px */
+ --main-heading-icon-gap: calc(var(--base-unit) * 3);
+ --main-subheading-icon-size: calc(var(--base-unit) * 4);
+ --main-subheading-heading-icon-gap: calc(var(--base-unit) * 2);
+}
+
+/* Dark Theme variables */
+
+@media (prefers-color-scheme: dark) {
+ :root {
+ --in-content-background-color: rgb(28, 27, 34);
+ --in-content-border-color: rgba(249,249,250,0.2);
+ --in-content-primary-button-background: #00ddff;
+ --in-content-primary-button-background-active: rgb(170,242,255);
+ --in-content-primary-button-background-hover: rgb(128,235,255);
+ --in-content-text-color: #eee;
+
+ --secondary-text-color: rgb(168, 168, 168);
+
+ --box-background: rgb(35, 34, 43);
+
+ --button-background-color: rgb(72, 72, 84);
+ --button-color: var(--white-100);
+ --button-hover-background-color: rgb(92, 92, 106);
+
+ --category-background-hover: rgba(12,12,13,0.1);
+ --category-text: var(--text-color);
+
+ --fieldpair-text-color: var(--text-color);
+
+ --sidebar-text-color: var(--text-color);
+ --sidebar-background-hover: rgb(92, 92, 106);
+
+ --card-background-color: rgb(35, 34, 43);
+ --card-separator-color: var(--grey-50);
+
+ --icon-ok-color: var(--white-100);
+ --icon-info-color: var(--white-100);
+
+ --popup-header-background-color: var(--grey-50);
+ --popup-header-color: var(--white-100);
+
+ /*
+ * From common.inc.css
+ * https://searchfox.org/mozilla-central/rev/b52cf6bbe214bd9d93ed9333d0403f7d556ad7c8/toolkit/themes/shared/in-content/common.inc.css#165-168
+ */
+ --primary-button-background-color: #00ddff;
+ --primary-button-color: rgb(43,42,51);
+ --primary-button-active-background-color: rgb(170,242,255);
+ --primary-button-hover-background-color: rgb(128,235,255);
+ }
+}
+
+/*
+* Reset some tags
+*/
+
+html {
+ font: var(--base-font-style);
+}
+
+body {
+ margin: 0;
+ padding: 0;
+ color: var(--text-color);
+ font-size: var(--base-font-size);
+ font-weight: var(--base-font-weight);
+ line-height: var(--base-line-height);
+ background: var(--bg-color);
+}
+
+dd {
+ margin: 0;
+ padding: 0;
+}
+
+ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+a {
+ color: var(--link-color);
+}
+a:hover {
+ color: var(--link-color-hover);
+}
+a:active {
+ color: var(--link-color-active);
+}
+
+p, h1 {
+ margin: 0;
+}
+
+/*
+* Utils
+*/
+
+/* text that needs to be cut with … */
+.ellipsis-text {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* Technical text that should use a monospace font, such as code, error messages. */
+.technical-text {
+ font-family: var(--monospace-font-family);
+}
+
+/* Links that need to look like current text */
+.undecorated-link,
+.undecorated-link:hover {
+ text-decoration: none;
+ color: currentColor;
+}
+
+/* Text needs to wrap anywhere */
+.word-wrap-anywhere {
+ word-wrap: anywhere;
+}
+
+/*
+* Typography
+*/
+
+/* Main style for heading (i.e. h1) */
+.main-heading {
+ font-size: var(--display-10-font-size);
+ font-weight: var(--display-10-font-weight);
+ line-height: 1.2;
+}
+
+.main-heading__icon {
+ width: 100%;
+}
+
+.main-heading-subtitle {
+ font-size: var(--title-30-font-size);
+ font-weight: var(--title-30-font-weight);
+}
+
+/* Main style for a subheading (i.e. h2). It features an icon */
+/* +--------+-------------+
+* | [Icon] | Lorem ipsum |
+* +--------+-------------+
+*/
+.main-subheading {
+ margin-block: calc(var(--base-unit) * 4) 0;
+ font-size: var(--title-20-font-size); /* Note: this is from Photon Title 20 */
+ font-weight: var(--title-20-font-weight); /* Note: this is from Photon Title 20 */
+
+ display: grid;
+ grid-template-columns: var(--main-subheading-icon-size) 1fr;
+ grid-column-gap: var(--main-subheading-heading-icon-gap);
+ align-items: center;
+}
+
+.main-subheading__icon {
+ width: 100%;
+ fill: currentColor;
+ -moz-context-properties: fill;
+}
+
+/* Alternative style for a heading (i.e. h1) */
+.alt-heading {
+ font-weight: var(--title-20-font-weight);
+ font-size: var(--title-20-font-size);
+
+ margin-block-start: 0;
+ margin-block-end: calc(var(--base-unit) * 4);
+}
+
+.alt-heading--larger {
+ font-size: var(--title-30-font-size);
+ font-weight: var(--title-30-font-weight);
+}
+
+/* Alternative style for a subheading (i.e. h2). It features an icon */
+/* +--------+-------------+
+* | [Icon] | Lorem ipsum |
+* +--------+-------------+
+*/
+.alt-subheading {
+ margin-block-start: calc(var(--base-unit) * 4);
+ font-weight: 600;
+ font-size: 1.14em;
+ line-height: 1.4em; /* odd value - from common.inc.css */
+
+ display: grid;
+ grid-template-columns: var(--alt-heading-icon-size) 1fr;
+ grid-column-gap: var(--alt-heading-icon-gap);
+ align-items: center;
+}
+
+.alt-subheading__icon {
+ width: 100%;
+ fill: currentColor;
+ -moz-context-properties: fill;
+}
+
+/*
+* Layout elements
+*/
+
+/* for horizontal rules / separators */
+.separator {
+ border-style: solid none none none;
+ border-color: var(--border-color);
+}
+
+/* adds breathing space to the separator */
+.separator--breathe {
+ margin: calc(var(--base-unit) * 5) 0;
+}
+
+/* a series of button-like elements, layed out horizontally */
+.toolbar {
+ display: flex;
+ column-gap: calc(var(--base-unit) * 3);
+}
+
+.toolbar--right-align {
+ justify-content: end;
+}
+
+/*
+Form controls
+*/
+.default-button, .default-input {
+ box-sizing: border-box;
+ font-size: 1em;
+}
+
+/* Buttons from Photon */
+.default-button, .primary-button {
+ appearance: none;
+ margin: 0;
+ height: calc(var(--base-unit) * 8);
+ padding-inline-start: calc(var(--base-unit) * 5);
+ padding-inline-end: calc(var(--base-unit) * 5);
+
+ border: none;
+ border-radius: calc(var(--base-unit) / 2);
+
+ font-size: var(--button-font-size);
+}
+
+/* Disabled state for buttons from Photon */
+.default-button:disabled, .primary-button:disabled {
+ opacity: 0.4;
+}
+
+/* Smaller variant size for buttons, from Photon */
+.default-button--micro, .primary-button--micro {
+ padding-inline-start: calc(2 * var(--base-unit));
+ padding-inline-end: calc(2 * var(--base-unit));
+ font-size: var(--micro-font-size);
+ height: calc(var(--base-unit) * 6);
+}
+
+/* Photon button representing a primary action */
+.primary-button {
+ color: var(--primary-button-color);
+ background-color: var(--primary-button-background-color);
+}
+
+.primary-button:enabled:hover {
+ background: var(--primary-button-hover-background-color);
+}
+
+.primary-button:enabled:active {
+ background: var(--primary-button-active-background-color);
+}
+
+/* Photon standard button */
+.default-button {
+ color: var(--button-color);
+ background-color: var(--button-background-color);
+}
+
+.default-button:enabled:hover {
+ background: var(--button-hover-background-color);
+}
+
+.default-button:enabled:active {
+ background: var(--button-active-background-color);
+}
+
+@media (prefers-contrast) {
+ .default-button,
+ .ghost-button,
+ .primary-button {
+ background-color: ButtonFace;
+ /* Add a border to make buttons visible in high contrast */
+ border: 1px solid ButtonText;
+ color: ButtonText;
+ }
+
+ .ghost-button {
+ fill: ButtonText;
+ }
+
+ :is(
+ .default-button,
+ .ghost-button,
+ .primary-button
+ ):enabled:is(:hover, :active) {
+ background-color: ButtonText;
+ color: ButtonFace;
+ }
+}
+
+/* Photon ghost button. Icon button with no background */
+.ghost-button {
+ background: transparent;
+ border: none;
+ border-radius: calc(var(--base-unit) / 2);
+ fill: var(--button-color);
+ height: calc(var(--base-unit) * 6);
+ padding: calc(var(--base-unit));
+ width: calc(var(--base-unit) * 6);
+
+ -moz-context-properties: fill;
+}
+
+.ghost-button:hover {
+ background: var(--button-hover-background-color);
+}
+
+.ghost-button:active {
+ background: var(--button-active-background-color);
+}
+
+/* Standard inputs */
+.default-input {
+ line-height: unset;
+ padding: 0 calc(var(--base-unit) * 2);
+ height: 100%;
+
+ border: 1px solid var(--box-border-color);
+ border-radius: 2px;
+ color: var(--text-color);
+ background-color: var(--box-background);
+}
+
+/*
+* Other UI components
+*/
+
+/*
+* A small, colored badge.
+* NOTE: styles borrowed from Photon's micro buttons (there aren't badges)
+*/
+.badge {
+ background: var(--grey-30);
+ border-radius: calc(var(--base-unit) / 2);
+ font-size: var(--micro-font-size);
+ padding: var(--base-unit) calc(2 * var(--base-unit));
+}
+
+.badge--info {
+ background: var(--highlight-50);
+}
+
+.badge--success {
+ background: var(--success-background);
+}
+
+.badge--warning {
+ background: var(--warning-background);
+}
+
+.badge--error {
+ background: var(--error-background);
+}
+
+/*
+ * Card UI, from Photon
+ */
+.card {
+ background-color: var(--card-background-color); /* from common.inc.css */
+ border-radius: var(--card-shadow-blur-radius); /* from common.inc.css */
+ box-shadow: 0 1px 4px var(--grey-90-a10); /* from common.inc.css */
+ box-sizing: border-box;
+ min-width: min-content;
+ padding-block: calc(var(--base-unit) * 5);
+}
+
+.card__heading {
+ font-size: var(--title-20-font-size); /* Note: this is from Photon Title 20 */
+ font-weight: var(--title-20-font-weight); /* Note: this is from Photon Title 20 */
+}
diff --git a/devtools/client/aboutdebugging/src/components/App.css b/devtools/client/aboutdebugging/src/components/App.css
new file mode 100644
index 0000000000..5196ce8e2e
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/App.css
@@ -0,0 +1,71 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * The current layout of about:debugging is
+ *
+ * +-------------+-------------------------------+
+ * | Sidebar | Page (Runtime or Connect) |
+ * | (240px) | |
+ * | | |
+ * +-------------+-------------------------------+
+ *
+ * Some of the values (font sizes, widths, etc.) are the same as
+ * about:preferences, which uses the shared common.css
+ */
+
+.app {
+ /* from common */
+ --sidebar-width: 280px;
+ --app-top-padding: 70px;
+ --app-bottom-padding: 40px;
+ --app-left-padding: 32px;
+ --app-right-padding: 32px;
+
+ box-sizing: border-box;
+ width: 100vw;
+ height: 100vh;
+ overflow: hidden; /* we don't want the sidebar to scroll, only the main content */
+
+ display: grid;
+ grid-column-gap: 40px;
+ grid-template-columns: var(--sidebar-width) auto;
+
+ font-size: var(--base-font-size);
+ font-weight: var(--base-font-weight);
+ line-height: var(--base-line-height);
+}
+
+.app__sidebar {
+ padding-block-start: var(--app-top-padding);
+ padding-block-end: var(--app-bottom-padding);
+ padding-inline-start: var(--app-left-padding);
+}
+
+.app__content {
+ /* we want to scroll only the main content, not the sidebar */
+ overflow-y: auto;
+
+ /* padding will give space for card shadow to appear and
+ margin will correct the alignment */
+ margin-inline-start: calc(var(--card-shadow-blur-radius) * -1);
+ padding-inline: var(--card-shadow-blur-radius);
+ padding-block-start: var(--app-top-padding);
+}
+
+/* Workaround for Gecko clipping the padding-bottom of a scrollable container;
+ we create a block to act as the bottom padding instead. */
+.app__content::after {
+ content: "";
+ display: block;
+ height: var(--app-bottom-padding);
+}
+
+.page {
+ max-width: var(--page-width);
+ min-width: min-content;
+ font-size: var(--body-20-font-size);
+ font-weight: var(--body-20-font-weight);
+ padding-inline-end: var(--app-right-padding);
+}
diff --git a/devtools/client/aboutdebugging/src/components/App.js b/devtools/client/aboutdebugging/src/components/App.js
new file mode 100644
index 0000000000..7bdf3eb0c5
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/App.js
@@ -0,0 +1,213 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Route = createFactory(
+ require("resource://devtools/client/shared/vendor/react-router-dom.js").Route
+);
+const Switch = createFactory(
+ require("resource://devtools/client/shared/vendor/react-router-dom.js").Switch
+);
+const Redirect = createFactory(
+ require("resource://devtools/client/shared/vendor/react-router-dom.js")
+ .Redirect
+);
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+const {
+ PAGE_TYPES,
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const ConnectPage = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/connect/ConnectPage.js")
+);
+const RuntimePage = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/RuntimePage.js")
+);
+const Sidebar = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/Sidebar.js")
+);
+
+class App extends PureComponent {
+ static get propTypes() {
+ return {
+ adbAddonStatus: Types.adbAddonStatus,
+ // The "dispatch" helper is forwarded to the App component via connect.
+ // From that point, components are responsible for forwarding the dispatch
+ // property to all components who need to dispatch actions.
+ dispatch: PropTypes.func.isRequired,
+ // getString prop is injected by the withLocalization wrapper
+ getString: PropTypes.func.isRequired,
+ isAdbReady: PropTypes.bool.isRequired,
+ isScanningUsb: PropTypes.bool.isRequired,
+ networkLocations: PropTypes.arrayOf(Types.location).isRequired,
+ networkRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
+ selectedPage: Types.page,
+ selectedRuntimeId: PropTypes.string,
+ usbRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
+ };
+ }
+
+ componentDidUpdate() {
+ this.updateTitle();
+ }
+
+ updateTitle() {
+ const { getString, selectedPage, selectedRuntimeId } = this.props;
+
+ const pageTitle =
+ selectedPage === PAGE_TYPES.RUNTIME
+ ? getString("about-debugging-page-title-runtime-page", {
+ selectedRuntimeId,
+ })
+ : getString("about-debugging-page-title-setup-page");
+
+ document.title = pageTitle;
+ }
+
+ renderConnect() {
+ const { adbAddonStatus, dispatch, networkLocations } = this.props;
+
+ return ConnectPage({
+ adbAddonStatus,
+ dispatch,
+ networkLocations,
+ });
+ }
+
+ // The `match` object here is passed automatically by the Route object.
+ // We are using it to read the route path.
+ // See react-router docs:
+ // https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/match.md
+ renderRuntime({ match }) {
+ const isRuntimeAvailable = id => {
+ const runtimes = [
+ ...this.props.networkRuntimes,
+ ...this.props.usbRuntimes,
+ ];
+ const runtime = runtimes.find(x => x.id === id);
+ return runtime?.runtimeDetails;
+ };
+
+ const { dispatch } = this.props;
+
+ let runtimeId = match.params.runtimeId || RUNTIMES.THIS_FIREFOX;
+ if (match.params.runtimeId !== RUNTIMES.THIS_FIREFOX) {
+ const rawId = decodeURIComponent(match.params.runtimeId);
+ if (isRuntimeAvailable(rawId)) {
+ runtimeId = rawId;
+ } else {
+ // Also redirect to "This Firefox" if runtime is not found
+ return Redirect({ to: `/runtime/${RUNTIMES.THIS_FIREFOX}` });
+ }
+ }
+
+ // we need to pass a key so the component updates when we want to showcase
+ // a different runtime
+ return RuntimePage({ dispatch, key: runtimeId, runtimeId });
+ }
+
+ renderRoutes() {
+ return Switch(
+ {},
+ Route({
+ path: "/setup",
+ render: () => this.renderConnect(),
+ }),
+ Route({
+ path: "/runtime/:runtimeId",
+ render: routeProps => this.renderRuntime(routeProps),
+ }),
+ // default route when there's no match which includes "/"
+ // TODO: the url does not match "/" means invalid URL,
+ // in this case maybe we'd like to do something else than a redirect.
+ // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1509897
+ Route({
+ render: routeProps => {
+ const { pathname } = routeProps.location;
+ // The old about:debugging supported the following routes:
+ // about:debugging#workers, about:debugging#addons and about:debugging#tabs.
+ // Such links can still be found in external documentation pages.
+ // We redirect to This Firefox rather than the Setup Page here.
+ if (
+ pathname === "/workers" ||
+ pathname === "/addons" ||
+ pathname === "/tabs"
+ ) {
+ return Redirect({ to: `/runtime/${RUNTIMES.THIS_FIREFOX}` });
+ }
+ return Redirect({ to: "/setup" });
+ },
+ })
+ );
+ }
+
+ render() {
+ const {
+ adbAddonStatus,
+ dispatch,
+ isAdbReady,
+ isScanningUsb,
+ networkRuntimes,
+ selectedPage,
+ selectedRuntimeId,
+ usbRuntimes,
+ } = this.props;
+
+ return Localized(
+ {},
+ dom.div(
+ { className: "app" },
+ Sidebar({
+ adbAddonStatus,
+ className: "app__sidebar",
+ dispatch,
+ isAdbReady,
+ isScanningUsb,
+ networkRuntimes,
+ selectedPage,
+ selectedRuntimeId,
+ usbRuntimes,
+ }),
+ dom.main({ className: "app__content" }, this.renderRoutes())
+ )
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ adbAddonStatus: state.ui.adbAddonStatus,
+ isAdbReady: state.ui.isAdbReady,
+ isScanningUsb: state.ui.isScanningUsb,
+ networkLocations: state.ui.networkLocations,
+ networkRuntimes: state.runtimes.networkRuntimes,
+ selectedPage: state.ui.selectedPage,
+ selectedRuntimeId: state.runtimes.selectedRuntimeId,
+ usbRuntimes: state.runtimes.usbRuntimes,
+ };
+};
+
+const mapDispatchToProps = dispatch => ({
+ dispatch,
+});
+
+module.exports = FluentReact.withLocalization(
+ connect(mapStateToProps, mapDispatchToProps)(App)
+);
diff --git a/devtools/client/aboutdebugging/src/components/CompatibilityWarning.js b/devtools/client/aboutdebugging/src/components/CompatibilityWarning.js
new file mode 100644
index 0000000000..42284fa672
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/CompatibilityWarning.js
@@ -0,0 +1,110 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const {
+ COMPATIBILITY_STATUS,
+} = require("resource://devtools/client/shared/remote-debugging/version-checker.js");
+
+const TROUBLESHOOTING_URL =
+ "https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/";
+const FENNEC_TROUBLESHOOTING_URL =
+ "https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/index.html#connection-to-firefox-for-android-68";
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+class CompatibilityWarning extends PureComponent {
+ static get propTypes() {
+ return {
+ compatibilityReport: Types.compatibilityReport.isRequired,
+ };
+ }
+
+ render() {
+ const {
+ localID,
+ localVersion,
+ minVersion,
+ runtimeID,
+ runtimeVersion,
+ status,
+ } = this.props.compatibilityReport;
+
+ if (status === COMPATIBILITY_STATUS.COMPATIBLE) {
+ return null;
+ }
+
+ let localizationId, statusClassName;
+ switch (status) {
+ case COMPATIBILITY_STATUS.TOO_OLD:
+ statusClassName = "qa-compatibility-warning-too-old";
+ localizationId = "about-debugging-browser-version-too-old";
+ break;
+ case COMPATIBILITY_STATUS.TOO_RECENT:
+ statusClassName = "qa-compatibility-warning-too-recent";
+ localizationId = "about-debugging-browser-version-too-recent";
+ break;
+ case COMPATIBILITY_STATUS.TOO_OLD_FENNEC:
+ statusClassName = "qa-compatibility-warning-too-old-fennec";
+ localizationId = "about-debugging-browser-version-too-old-fennec";
+ break;
+ }
+
+ const troubleshootingUrl =
+ status === COMPATIBILITY_STATUS.TOO_OLD_FENNEC
+ ? FENNEC_TROUBLESHOOTING_URL
+ : TROUBLESHOOTING_URL;
+
+ const messageLevel =
+ status === COMPATIBILITY_STATUS.TOO_OLD_FENNEC
+ ? MESSAGE_LEVEL.ERROR
+ : MESSAGE_LEVEL.WARNING;
+
+ return Message(
+ {
+ level: messageLevel,
+ isCloseable: true,
+ },
+ Localized(
+ {
+ id: localizationId,
+ a: dom.a({
+ href: troubleshootingUrl,
+ target: "_blank",
+ }),
+ $localID: localID,
+ $localVersion: localVersion,
+ $minVersion: minVersion,
+ $runtimeID: runtimeID,
+ $runtimeVersion: runtimeVersion,
+ },
+ dom.p(
+ {
+ className: `qa-compatibility-warning ${statusClassName}`,
+ },
+ localizationId
+ )
+ )
+ );
+ }
+}
+
+module.exports = CompatibilityWarning;
diff --git a/devtools/client/aboutdebugging/src/components/ConnectionPromptSetting.js b/devtools/client/aboutdebugging/src/components/ConnectionPromptSetting.js
new file mode 100644
index 0000000000..d4773bb298
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/ConnectionPromptSetting.js
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+class ConnectionPromptSetting extends PureComponent {
+ static get propTypes() {
+ return {
+ className: PropTypes.string,
+ connectionPromptEnabled: PropTypes.bool.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ };
+ }
+
+ onToggleClick() {
+ const { connectionPromptEnabled, dispatch } = this.props;
+ dispatch(Actions.updateConnectionPromptSetting(!connectionPromptEnabled));
+ }
+
+ render() {
+ const { className, connectionPromptEnabled } = this.props;
+
+ const localizedState = connectionPromptEnabled
+ ? "about-debugging-connection-prompt-disable-button"
+ : "about-debugging-connection-prompt-enable-button";
+
+ return Localized(
+ {
+ id: localizedState,
+ },
+ dom.button(
+ {
+ className: `${className} default-button qa-connection-prompt-toggle-button`,
+ onClick: () => this.onToggleClick(),
+ },
+ localizedState
+ )
+ );
+ }
+}
+
+module.exports = ConnectionPromptSetting;
diff --git a/devtools/client/aboutdebugging/src/components/ProfilerDialog.css b/devtools/client/aboutdebugging/src/components/ProfilerDialog.css
new file mode 100644
index 0000000000..d5352bbea2
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/ProfilerDialog.css
@@ -0,0 +1,63 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.profiler-dialog__frame {
+ border: none;
+ height: 100%;
+ width: 100%;
+}
+
+/*
+ * The current layout of the dialog header is
+ *
+ * +-----------------------------+---+
+ * | dialog title (auto) | X |
+ * +-----------------------------+---+
+ */
+.profiler-dialog__header {
+ align-items: center;
+ background-color: var(--popup-header-background-color);
+ color: var(--popup-header-color);
+ display: grid;
+ grid-template-columns: 1fr max-content;
+ padding: var(--base-unit);
+}
+
+.profiler-dialog__header__title {
+ margin-inline-start: calc(var(--base-unit) * 2);
+
+ /* Reset <h1> styles */
+ font-size: 15px;
+ font-weight: normal;
+}
+
+.profiler-dialog__inner {
+ background-color: var(--box-background);
+ display: grid;
+ grid-template-rows: max-content auto;
+ max-height: calc(100% - calc(var(--base-unit) * 25)); /* 100% - 100px */
+ position: fixed;
+}
+
+.profiler-dialog__inner--medium {
+ width: calc(var(--base-unit) * 150); /* 600px */
+ height: calc(var(--base-unit) * 150); /* 600px */
+}
+
+.profiler-dialog__inner--large {
+ width: calc(var(--base-unit) * 200); /* 800px */
+ height: calc(var(--base-unit) * 175); /* 700px */
+}
+
+.profiler-dialog__mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: var(--grey-90-a60);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
diff --git a/devtools/client/aboutdebugging/src/components/ProfilerDialog.js b/devtools/client/aboutdebugging/src/components/ProfilerDialog.js
new file mode 100644
index 0000000000..f4bb583464
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/ProfilerDialog.js
@@ -0,0 +1,168 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+const {
+ PROFILER_PAGE_CONTEXT,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component is a modal dialog containing the performance profiler UI. It uses
+ * the simplified DevTools panel located in devtools/client/performance-new. When
+ * using a custom preset, and editing the settings, the page context switches
+ * to about:profiling, which receives the PerfFront of the remote debuggee.
+ */
+class ProfilerDialog extends PureComponent {
+ static get propTypes() {
+ return {
+ runtimeDetails: Types.runtimeDetails.isRequired,
+ profilerContext: PropTypes.string.isRequired,
+ hideProfilerDialog: PropTypes.func.isRequired,
+ switchProfilerContext: PropTypes.func.isRequired,
+ };
+ }
+
+ hide() {
+ this.props.hideProfilerDialog();
+ }
+
+ setProfilerIframeDirection(frameWindow) {
+ // Set iframe direction according to the parent document direction.
+ const { documentElement } = document;
+ const dir = window.getComputedStyle(documentElement).direction;
+ frameWindow.document.documentElement.setAttribute("dir", dir);
+ }
+
+ /**
+ * The profiler iframe can either be the simplified devtools recording panel,
+ * or the more detailed about:profiling settings page.
+ */
+ renderProfilerIframe() {
+ const {
+ runtimeDetails: { clientWrapper },
+ switchProfilerContext,
+ profilerContext,
+ } = this.props;
+
+ let src, onLoad;
+
+ switch (profilerContext) {
+ case PROFILER_PAGE_CONTEXT.DEVTOOLS_REMOTE:
+ src = clientWrapper.getPerformancePanelUrl();
+ onLoad = e => {
+ const frameWindow = e.target.contentWindow;
+ this.setProfilerIframeDirection(frameWindow);
+
+ clientWrapper.loadPerformanceProfiler(frameWindow, () => {
+ switchProfilerContext(PROFILER_PAGE_CONTEXT.ABOUTPROFILING_REMOTE);
+ });
+ };
+ break;
+
+ case PROFILER_PAGE_CONTEXT.ABOUTPROFILING_REMOTE:
+ src = "about:profiling#remote";
+ onLoad = e => {
+ const frameWindow = e.target.contentWindow;
+ this.setProfilerIframeDirection(frameWindow);
+
+ clientWrapper.loadAboutProfiling(frameWindow, () => {
+ switchProfilerContext(PROFILER_PAGE_CONTEXT.DEVTOOLS_REMOTE);
+ });
+ };
+ break;
+
+ default:
+ throw new Error(`Unhandled profiler context: "${profilerContext}"`);
+ }
+
+ return dom.iframe({
+ key: profilerContext,
+ className: "profiler-dialog__frame",
+ src,
+ onLoad,
+ });
+ }
+
+ render() {
+ const { profilerContext, switchProfilerContext } = this.props;
+ const dialogSizeClassName =
+ profilerContext === PROFILER_PAGE_CONTEXT.DEVTOOLS_REMOTE
+ ? "profiler-dialog__inner--medium"
+ : "profiler-dialog__inner--large";
+
+ return dom.div(
+ {
+ className: "profiler-dialog__mask qa-profiler-dialog-mask",
+ onClick: () => this.hide(),
+ },
+ dom.article(
+ {
+ className: `profiler-dialog__inner ${dialogSizeClassName} qa-profiler-dialog`,
+ onClick: e => e.stopPropagation(),
+ },
+ dom.header(
+ {
+ className: "profiler-dialog__header",
+ },
+ Localized(
+ {
+ id: "about-debugging-profiler-dialog-title2",
+ },
+ dom.h1(
+ {
+ className: "profiler-dialog__header__title",
+ },
+ "about-debugging-profiler-dialog-title2"
+ )
+ ),
+ dom.button(
+ {
+ className: "ghost-button qa-profiler-dialog-close",
+ onClick: () => {
+ if (profilerContext === PROFILER_PAGE_CONTEXT.DEVTOOLS_REMOTE) {
+ this.hide();
+ } else {
+ switchProfilerContext(PROFILER_PAGE_CONTEXT.DEVTOOLS_REMOTE);
+ }
+ },
+ },
+ dom.img({
+ src: "chrome://devtools/skin/images/close.svg",
+ })
+ )
+ ),
+ this.renderProfilerIframe()
+ )
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ profilerContext: state.ui.profilerContext,
+ };
+};
+
+const mapDispatchToProps = {
+ hideProfilerDialog: Actions.hideProfilerDialog,
+ switchProfilerContext: Actions.switchProfilerContext,
+};
+
+module.exports = connect(mapStateToProps, mapDispatchToProps)(ProfilerDialog);
diff --git a/devtools/client/aboutdebugging/src/components/RuntimeActions.css b/devtools/client/aboutdebugging/src/components/RuntimeActions.css
new file mode 100644
index 0000000000..6333560d4b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/RuntimeActions.css
@@ -0,0 +1,9 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.runtime-actions__toolbar {
+ column-gap: var(--base-unit);
+ display: flex;
+ justify-content: end;
+}
diff --git a/devtools/client/aboutdebugging/src/components/RuntimeActions.js b/devtools/client/aboutdebugging/src/components/RuntimeActions.js
new file mode 100644
index 0000000000..eefa8b500b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/RuntimeActions.js
@@ -0,0 +1,82 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const ConnectionPromptSetting = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/ConnectionPromptSetting.js")
+);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const {
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+class RuntimeActions extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ runtimeDetails: Types.runtimeDetails,
+ runtimeId: PropTypes.string.isRequired,
+ };
+ }
+
+ onProfilerButtonClick() {
+ this.props.dispatch(Actions.showProfilerDialog());
+ }
+
+ renderConnectionPromptSetting() {
+ const { dispatch, runtimeDetails, runtimeId } = this.props;
+ const { connectionPromptEnabled } = runtimeDetails;
+ // do not show the connection prompt setting in 'This Firefox'
+ return runtimeId !== RUNTIMES.THIS_FIREFOX
+ ? ConnectionPromptSetting({
+ connectionPromptEnabled,
+ dispatch,
+ })
+ : null;
+ }
+
+ renderProfileButton() {
+ const { runtimeId } = this.props;
+
+ return runtimeId !== RUNTIMES.THIS_FIREFOX
+ ? Localized(
+ {
+ id: "about-debugging-runtime-profile-button2",
+ },
+ dom.button(
+ {
+ className: "default-button qa-profile-runtime-button",
+ onClick: () => this.onProfilerButtonClick(),
+ },
+ "about-debugging-runtime-profile-button2"
+ )
+ )
+ : null;
+ }
+
+ render() {
+ return dom.div(
+ {
+ className: "runtime-actions__toolbar",
+ },
+ this.renderProfileButton(),
+ this.renderConnectionPromptSetting()
+ );
+ }
+}
+
+module.exports = RuntimeActions;
diff --git a/devtools/client/aboutdebugging/src/components/RuntimeInfo.css b/devtools/client/aboutdebugging/src/components/RuntimeInfo.css
new file mode 100644
index 0000000000..e6fcd9dd7e
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/RuntimeInfo.css
@@ -0,0 +1,42 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * Layout for the runtime info container is:
+ *
+ * <- 68px --x--------- 1fr ----------><---- max ---->
+ * ∧ +---------+------------------------+--------------+
+ * 1fr | | Runtime Info | [Action] |
+ * | | Icon | eg "Firefox (70.0a1)" | |
+ * x | +------------------------+ |
+ * max | | Device Name (optional) | |
+ * ∨ +---------+------------------------+--------------+
+ */
+.runtime-info {
+ align-items: center;
+ display: grid;
+
+ grid-column-gap: var(--main-heading-icon-gap);
+ grid-template-areas:
+ "icon title action"
+ "icon subtitle .";
+ grid-template-columns: var(--main-heading-icon-size) 1fr max-content;
+ grid-template-rows: 1fr max-content;
+
+ margin-block-end: calc(var(--base-unit) * 5);
+}
+
+.runtime-info__icon {
+ grid-area: icon;
+}
+.runtime-info__title {
+ grid-area: title;
+}
+.runtime-info__subtitle {
+ grid-area: subtitle;
+}
+.runtime-info__action {
+ grid-area: action;
+}
diff --git a/devtools/client/aboutdebugging/src/components/RuntimeInfo.js b/devtools/client/aboutdebugging/src/components/RuntimeInfo.js
new file mode 100644
index 0000000000..6a8c67dd33
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/RuntimeInfo.js
@@ -0,0 +1,89 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component displays runtime information.
+ */
+class RuntimeInfo extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ icon: PropTypes.string.isRequired,
+ deviceName: PropTypes.string,
+ name: PropTypes.string.isRequired,
+ version: PropTypes.string.isRequired,
+ runtimeId: PropTypes.string.isRequired,
+ };
+ }
+ render() {
+ const { icon, deviceName, name, version, runtimeId, dispatch } = this.props;
+
+ return dom.h1(
+ {
+ className: "main-heading runtime-info",
+ },
+ dom.img({
+ className: "main-heading__icon runtime-info__icon qa-runtime-icon",
+ src: icon,
+ }),
+ Localized(
+ {
+ id: "about-debugging-runtime-name",
+ $name: name,
+ $version: version,
+ },
+ dom.label(
+ {
+ className: "qa-runtime-name runtime-info__title",
+ },
+ `${name} (${version})`
+ )
+ ),
+ deviceName
+ ? dom.label(
+ {
+ className: "main-heading-subtitle runtime-info__subtitle",
+ },
+ deviceName
+ )
+ : null,
+ runtimeId !== RUNTIMES.THIS_FIREFOX
+ ? Localized(
+ {
+ id: "about-debugging-runtime-disconnect-button",
+ },
+ dom.button(
+ {
+ className:
+ "default-button runtime-info__action qa-runtime-info__action",
+ onClick() {
+ dispatch(Actions.disconnectRuntime(runtimeId, true));
+ },
+ },
+ "Disconnect"
+ )
+ )
+ : null
+ );
+ }
+}
+
+module.exports = RuntimeInfo;
diff --git a/devtools/client/aboutdebugging/src/components/RuntimePage.js b/devtools/client/aboutdebugging/src/components/RuntimePage.js
new file mode 100644
index 0000000000..e2dae9b0cd
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/RuntimePage.js
@@ -0,0 +1,306 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const CompatibilityWarning = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/CompatibilityWarning.js")
+);
+const DebugTargetPane = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js")
+);
+const ExtensionDetail = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.js")
+);
+const InspectAction = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js")
+);
+const ProfilerDialog = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/ProfilerDialog.js")
+);
+const RuntimeActions = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/RuntimeActions.js")
+);
+const RuntimeInfo = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/RuntimeInfo.js")
+);
+const ServiceWorkerAction = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.js")
+);
+const ServiceWorkerAdditionalActions = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js")
+);
+const ServiceWorkersWarning = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/ServiceWorkersWarning.js")
+);
+const ProcessDetail = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/ProcessDetail.js")
+);
+const TabAction = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/TabAction.js")
+);
+const TabDetail = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/TabDetail.js")
+);
+const TemporaryExtensionAdditionalActions = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js")
+);
+const TemporaryExtensionDetail = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionDetail.js")
+);
+const TemporaryExtensionInstallSection = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.js")
+);
+const WorkerDetail = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/WorkerDetail.js")
+);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const {
+ DEBUG_TARGETS,
+ DEBUG_TARGET_PANE,
+ PAGE_TYPES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+const {
+ getCurrentRuntimeDetails,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+const {
+ isSupportedDebugTargetPane,
+ supportsTemporaryExtensionInstaller,
+} = require("resource://devtools/client/aboutdebugging/src/modules/debug-target-support.js");
+
+class RuntimePage extends PureComponent {
+ static get propTypes() {
+ return {
+ collapsibilities: Types.collapsibilities.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ installedExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
+ otherWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
+ runtimeDetails: Types.runtimeDetails,
+ runtimeId: PropTypes.string.isRequired,
+ processes: PropTypes.arrayOf(PropTypes.object).isRequired,
+ serviceWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
+ sharedWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
+ showProfilerDialog: PropTypes.bool.isRequired,
+ tabs: PropTypes.arrayOf(PropTypes.object).isRequired,
+ temporaryExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
+ temporaryInstallError: PropTypes.object,
+ };
+ }
+
+ // TODO: avoid the use of this method
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ const { dispatch, runtimeId } = this.props;
+ dispatch(Actions.selectPage(PAGE_TYPES.RUNTIME, runtimeId));
+ }
+
+ getIconByType(type) {
+ switch (type) {
+ case DEBUG_TARGETS.EXTENSION:
+ return "chrome://devtools/skin/images/debugging-addons.svg";
+ case DEBUG_TARGETS.PROCESS:
+ return "chrome://devtools/skin/images/aboutdebugging-process-icon.svg";
+ case DEBUG_TARGETS.TAB:
+ return "chrome://devtools/skin/images/debugging-tabs.svg";
+ case DEBUG_TARGETS.WORKER:
+ return "chrome://devtools/skin/images/debugging-workers.svg";
+ }
+
+ throw new Error(`Unsupported type [${type}]`);
+ }
+
+ renderDebugTargetPane({
+ actionComponent,
+ additionalActionsComponent,
+ children,
+ detailComponent,
+ icon,
+ localizationId,
+ name,
+ paneKey,
+ targets,
+ }) {
+ const { collapsibilities, dispatch, runtimeDetails } = this.props;
+
+ if (!isSupportedDebugTargetPane(runtimeDetails.info.type, paneKey)) {
+ return null;
+ }
+
+ return Localized(
+ {
+ id: localizationId,
+ attrs: { name: true },
+ },
+ DebugTargetPane(
+ {
+ actionComponent,
+ additionalActionsComponent,
+ collapsibilityKey: paneKey,
+ detailComponent,
+ dispatch,
+ icon,
+ isCollapsed: collapsibilities.get(paneKey),
+ name,
+ targets,
+ },
+ children
+ )
+ );
+ }
+
+ renderTemporaryExtensionInstallSection() {
+ const runtimeType = this.props.runtimeDetails.info.type;
+ if (
+ !isSupportedDebugTargetPane(
+ runtimeType,
+ DEBUG_TARGET_PANE.TEMPORARY_EXTENSION
+ ) ||
+ !supportsTemporaryExtensionInstaller(runtimeType)
+ ) {
+ return null;
+ }
+
+ const { dispatch, temporaryInstallError } = this.props;
+ return TemporaryExtensionInstallSection({
+ dispatch,
+ temporaryInstallError,
+ });
+ }
+
+ render() {
+ const {
+ dispatch,
+ installedExtensions,
+ otherWorkers,
+ processes,
+ runtimeDetails,
+ runtimeId,
+ serviceWorkers,
+ sharedWorkers,
+ showProfilerDialog,
+ tabs,
+ temporaryExtensions,
+ } = this.props;
+
+ if (!runtimeDetails) {
+ // runtimeInfo can be null when the selectPage action navigates from a runtime A
+ // to a runtime B (between unwatchRuntime and watchRuntime).
+ return null;
+ }
+
+ const { compatibilityReport } = runtimeDetails;
+
+ return dom.article(
+ {
+ className: "page qa-runtime-page",
+ },
+ RuntimeInfo({ ...runtimeDetails.info, runtimeId, dispatch }),
+ RuntimeActions({ dispatch, runtimeId, runtimeDetails }),
+ runtimeDetails.serviceWorkersAvailable ? null : ServiceWorkersWarning(),
+ CompatibilityWarning({ compatibilityReport }),
+ this.renderDebugTargetPane({
+ actionComponent: TabAction,
+ detailComponent: TabDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.TAB),
+ localizationId: "about-debugging-runtime-tabs",
+ name: "Tabs",
+ paneKey: DEBUG_TARGET_PANE.TAB,
+ targets: tabs,
+ }),
+ this.renderDebugTargetPane({
+ actionComponent: InspectAction,
+ additionalActionsComponent: TemporaryExtensionAdditionalActions,
+ children: this.renderTemporaryExtensionInstallSection(),
+ detailComponent: TemporaryExtensionDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.EXTENSION),
+ localizationId: "about-debugging-runtime-temporary-extensions",
+ name: "Temporary Extensions",
+ paneKey: DEBUG_TARGET_PANE.TEMPORARY_EXTENSION,
+ targets: temporaryExtensions,
+ }),
+ this.renderDebugTargetPane({
+ actionComponent: InspectAction,
+ detailComponent: ExtensionDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.EXTENSION),
+ localizationId: "about-debugging-runtime-extensions",
+ name: "Extensions",
+ paneKey: DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
+ targets: installedExtensions,
+ }),
+ this.renderDebugTargetPane({
+ actionComponent: ServiceWorkerAction,
+ additionalActionsComponent: ServiceWorkerAdditionalActions,
+ detailComponent: WorkerDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.WORKER),
+ localizationId: "about-debugging-runtime-service-workers",
+ name: "Service Workers",
+ paneKey: DEBUG_TARGET_PANE.SERVICE_WORKER,
+ targets: serviceWorkers,
+ }),
+ this.renderDebugTargetPane({
+ actionComponent: InspectAction,
+ detailComponent: WorkerDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.WORKER),
+ localizationId: "about-debugging-runtime-shared-workers",
+ name: "Shared Workers",
+ paneKey: DEBUG_TARGET_PANE.SHARED_WORKER,
+ targets: sharedWorkers,
+ }),
+ this.renderDebugTargetPane({
+ actionComponent: InspectAction,
+ detailComponent: WorkerDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.WORKER),
+ localizationId: "about-debugging-runtime-other-workers",
+ name: "Other Workers",
+ paneKey: DEBUG_TARGET_PANE.OTHER_WORKER,
+ targets: otherWorkers,
+ }),
+ this.renderDebugTargetPane({
+ actionComponent: InspectAction,
+ detailComponent: ProcessDetail,
+ icon: this.getIconByType(DEBUG_TARGETS.PROCESS),
+ localizationId: "about-debugging-runtime-processes",
+ name: "Processes",
+ paneKey: DEBUG_TARGET_PANE.PROCESSES,
+ targets: processes,
+ }),
+
+ showProfilerDialog ? ProfilerDialog({ dispatch, runtimeDetails }) : null
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ collapsibilities: state.ui.debugTargetCollapsibilities,
+ installedExtensions: state.debugTargets.installedExtensions,
+ processes: state.debugTargets.processes,
+ otherWorkers: state.debugTargets.otherWorkers,
+ runtimeDetails: getCurrentRuntimeDetails(state.runtimes),
+ serviceWorkers: state.debugTargets.serviceWorkers,
+ sharedWorkers: state.debugTargets.sharedWorkers,
+ showProfilerDialog: state.ui.showProfilerDialog,
+ tabs: state.debugTargets.tabs,
+ temporaryExtensions: state.debugTargets.temporaryExtensions,
+ temporaryInstallError: state.ui.temporaryInstallError,
+ };
+};
+
+module.exports = connect(mapStateToProps)(RuntimePage);
diff --git a/devtools/client/aboutdebugging/src/components/ServiceWorkersWarning.js b/devtools/client/aboutdebugging/src/components/ServiceWorkersWarning.js
new file mode 100644
index 0000000000..4f9dc93d7f
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/ServiceWorkersWarning.js
@@ -0,0 +1,52 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const DOC_URL =
+ "https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/index.html#service-workers-not-compatible";
+
+class ServiceWorkersWarning extends PureComponent {
+ render() {
+ return Message(
+ {
+ level: MESSAGE_LEVEL.WARNING,
+ isCloseable: true,
+ },
+ Localized(
+ {
+ id: "about-debugging-runtime-service-workers-not-compatible",
+ a: dom.a({
+ href: DOC_URL,
+ target: "_blank",
+ }),
+ },
+ dom.p(
+ {
+ className: "qa-service-workers-warning",
+ },
+ "about-debugging-runtime-service-workers-not-compatible"
+ )
+ )
+ );
+ }
+}
+
+module.exports = ServiceWorkersWarning;
diff --git a/devtools/client/aboutdebugging/src/components/connect/ConnectPage.css b/devtools/client/aboutdebugging/src/components/connect/ConnectPage.css
new file mode 100644
index 0000000000..a693bf4113
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/ConnectPage.css
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.connect-page__breather {
+ margin-block-start: calc(var(--base-unit) * 6);
+}
+
+/*
+ * +--------+----------------------+
+ * | USB | |<button> |
+ * +--------+ | |
+ * | status | | |
+ * +--------+----------------------+
+ */
+.connect-page__usb-section__heading {
+ display: grid;
+ align-items: center;
+ grid-template-areas: "title . toggle"
+ "status . toggle";
+ grid-template-columns: auto 1fr auto;
+ grid-column-gap: calc(var(--base-unit) * 2);
+ grid-row-gap: var(--base-unit);
+}
+
+.connect-page__usb-section__heading__toggle {
+ grid-area: toggle;
+}
+
+.connect-page__usb-section__heading__title {
+ grid-area: title;
+ line-height: 1;
+}
+.connect-page__usb-section__heading__status {
+ grid-area: status;
+ line-height: 1;
+ font-size: var(--caption-20-font-size);
+ font-weight: var(--caption-20-font-weight);
+ color: var(--secondary-text-color);
+}
+
+.connect-page__troubleshoot {
+ font-size: var(--body-10-font-size);
+ font-weight: var(--body-10-font-weight);
+ margin-block-start: calc(var(--base-unit) * 2);
+}
+
+.connect-page__troubleshoot--network {
+ padding-inline: calc(var(--base-unit) * 6);
+}
diff --git a/devtools/client/aboutdebugging/src/components/connect/ConnectPage.js b/devtools/client/aboutdebugging/src/components/connect/ConnectPage.js
new file mode 100644
index 0000000000..97b1b01df7
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/ConnectPage.js
@@ -0,0 +1,315 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ USB_STATES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+loader.lazyRequireGetter(
+ this,
+ "ADB_ADDON_STATES",
+ "resource://devtools/client/shared/remote-debugging/adb/adb-addon.js",
+ true
+);
+
+const Link = createFactory(
+ require("resource://devtools/client/shared/vendor/react-router-dom.js").Link
+);
+const ConnectSection = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/connect/ConnectSection.js")
+);
+const ConnectSteps = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/connect/ConnectSteps.js")
+);
+const NetworkLocationsForm = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.js")
+);
+const NetworkLocationsList = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.js")
+);
+
+const {
+ PAGE_TYPES,
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+const USB_ICON_SRC =
+ "chrome://devtools/skin/images/aboutdebugging-usb-icon.svg";
+const GLOBE_ICON_SRC =
+ "chrome://devtools/skin/images/aboutdebugging-globe-icon.svg";
+
+const TROUBLESHOOT_USB_URL =
+ "https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/index.html#connecting-to-a-remote-device";
+const TROUBLESHOOT_NETWORK_URL =
+ "https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/index.html#connecting-over-the-network";
+
+class ConnectPage extends PureComponent {
+ static get propTypes() {
+ return {
+ adbAddonStatus: Types.adbAddonStatus,
+ dispatch: PropTypes.func.isRequired,
+ networkLocations: PropTypes.arrayOf(Types.location).isRequired,
+ };
+ }
+
+ // TODO: avoid the use of this method
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ this.props.dispatch(Actions.selectPage(PAGE_TYPES.CONNECT));
+ }
+
+ onToggleUSBClick() {
+ const { adbAddonStatus } = this.props;
+ const isAddonInstalled = adbAddonStatus === ADB_ADDON_STATES.INSTALLED;
+ if (isAddonInstalled) {
+ this.props.dispatch(Actions.uninstallAdbAddon());
+ } else {
+ this.props.dispatch(Actions.installAdbAddon());
+ }
+ }
+
+ getUsbStatus() {
+ switch (this.props.adbAddonStatus) {
+ case ADB_ADDON_STATES.INSTALLED:
+ return USB_STATES.ENABLED_USB;
+ case ADB_ADDON_STATES.UNINSTALLED:
+ return USB_STATES.DISABLED_USB;
+ default:
+ return USB_STATES.UPDATING_USB;
+ }
+ }
+
+ renderUsbStatus() {
+ const statusTextId = {
+ [USB_STATES.ENABLED_USB]: "about-debugging-setup-usb-status-enabled",
+ [USB_STATES.DISABLED_USB]: "about-debugging-setup-usb-status-disabled",
+ [USB_STATES.UPDATING_USB]: "about-debugging-setup-usb-status-updating",
+ }[this.getUsbStatus()];
+
+ return Localized(
+ {
+ id: statusTextId,
+ },
+ dom.span(
+ {
+ className: "connect-page__usb-section__heading__status",
+ },
+ statusTextId
+ )
+ );
+ }
+
+ renderUsbToggleButton() {
+ const usbStatus = this.getUsbStatus();
+
+ const localizedStates = {
+ [USB_STATES.ENABLED_USB]: "about-debugging-setup-usb-disable-button",
+ [USB_STATES.DISABLED_USB]: "about-debugging-setup-usb-enable-button",
+ [USB_STATES.UPDATING_USB]: "about-debugging-setup-usb-updating-button",
+ };
+ const localizedState = localizedStates[usbStatus];
+
+ // Disable the button while the USB status is updating.
+ const disabled = usbStatus === USB_STATES.UPDATING_USB;
+
+ return Localized(
+ {
+ id: localizedState,
+ },
+ dom.button(
+ {
+ className:
+ "default-button connect-page__usb-section__heading__toggle " +
+ "qa-connect-usb-toggle-button",
+ disabled,
+ onClick: () => this.onToggleUSBClick(),
+ },
+ localizedState
+ )
+ );
+ }
+
+ renderUsb() {
+ const { adbAddonStatus } = this.props;
+ const isAddonInstalled = adbAddonStatus === ADB_ADDON_STATES.INSTALLED;
+ return ConnectSection(
+ {
+ icon: USB_ICON_SRC,
+ title: dom.div(
+ {
+ className: "connect-page__usb-section__heading",
+ },
+ Localized(
+ { id: "about-debugging-setup-usb-title" },
+ dom.span(
+ {
+ className: "connect-page__usb-section__heading__title",
+ },
+ "USB"
+ )
+ ),
+ this.renderUsbStatus(),
+ this.renderUsbToggleButton()
+ ),
+ },
+ isAddonInstalled
+ ? ConnectSteps({
+ steps: [
+ {
+ localizationId:
+ "about-debugging-setup-usb-step-enable-dev-menu2",
+ },
+ {
+ localizationId: "about-debugging-setup-usb-step-enable-debug2",
+ },
+ {
+ localizationId:
+ "about-debugging-setup-usb-step-enable-debug-firefox2",
+ },
+ {
+ localizationId: "about-debugging-setup-usb-step-plug-device",
+ },
+ ],
+ })
+ : Localized(
+ {
+ id: "about-debugging-setup-usb-disabled",
+ },
+ dom.aside(
+ {
+ className: "qa-connect-usb-disabled-message",
+ },
+ "Enabling this will download and add the required Android USB debugging " +
+ "components to Firefox."
+ )
+ ),
+ this.renderTroubleshootText(RUNTIMES.USB)
+ );
+ }
+
+ renderNetwork() {
+ const { dispatch, networkLocations } = this.props;
+
+ return Localized(
+ {
+ id: "about-debugging-setup-network",
+ attrs: { title: true },
+ },
+ ConnectSection({
+ icon: GLOBE_ICON_SRC,
+ title: "Network Location",
+ extraContent: dom.div(
+ {},
+ NetworkLocationsList({ dispatch, networkLocations }),
+ NetworkLocationsForm({ dispatch, networkLocations }),
+ this.renderTroubleshootText(RUNTIMES.NETWORK)
+ ),
+ })
+ );
+ }
+
+ renderTroubleshootText(connectionType) {
+ const localizationId =
+ connectionType === RUNTIMES.USB
+ ? "about-debugging-setup-usb-troubleshoot"
+ : "about-debugging-setup-network-troubleshoot";
+
+ const className =
+ "connect-page__troubleshoot connect-page__troubleshoot--" +
+ `${connectionType === RUNTIMES.USB ? "usb" : "network"}`;
+
+ const url =
+ connectionType === RUNTIMES.USB
+ ? TROUBLESHOOT_USB_URL
+ : TROUBLESHOOT_NETWORK_URL;
+
+ return dom.aside(
+ {
+ className,
+ },
+ Localized(
+ {
+ id: localizationId,
+ a: dom.a({
+ href: url,
+ target: "_blank",
+ }),
+ },
+ dom.p({}, localizationId)
+ )
+ );
+ }
+
+ render() {
+ return dom.article(
+ {
+ className: "page connect-page qa-connect-page",
+ },
+ Localized(
+ {
+ id: "about-debugging-setup-title",
+ },
+ dom.h1(
+ {
+ className: "alt-heading alt-heading--larger",
+ },
+ "Setup"
+ )
+ ),
+ Localized(
+ {
+ id: "about-debugging-setup-intro",
+ },
+ dom.p(
+ {},
+ "Configure the connection method you wish to remotely debug your device with."
+ )
+ ),
+ Localized(
+ {
+ id: "about-debugging-setup-this-firefox2",
+ a: Link({
+ to: `/runtime/${RUNTIMES.THIS_FIREFOX}`,
+ }),
+ },
+ dom.p({}, "about-debugging-setup-this-firefox")
+ ),
+ dom.section(
+ {
+ className: "connect-page__breather",
+ },
+ Localized(
+ {
+ id: "about-debugging-setup-connect-heading",
+ },
+ dom.h2(
+ {
+ className: "alt-heading",
+ },
+ "Connect a device"
+ )
+ ),
+ this.renderUsb(),
+ this.renderNetwork()
+ )
+ );
+ }
+}
+
+module.exports = FluentReact.withLocalization(ConnectPage);
diff --git a/devtools/client/aboutdebugging/src/components/connect/ConnectSection.css b/devtools/client/aboutdebugging/src/components/connect/ConnectSection.css
new file mode 100644
index 0000000000..4349b147b0
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/ConnectSection.css
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.connect-section {
+ --icon-size: calc(var(--base-unit) * 9);
+ --header-col-gap: calc(var(--base-unit) * 2);
+ margin-block-end: calc(var(--base-unit) * 4);
+}
+
+/*
+ * +--------+----------------+
+ * | <icon> | <heading> 1fr |
+ * +--------+----------------+
+ */
+.connect-section__header {
+ display: grid;
+ grid-template-areas: "icon heading";
+ grid-template-columns: auto 1fr;
+ grid-template-rows: var(--icon-size);
+ grid-column-gap: var(--header-col-gap);
+ align-items: center;
+
+ padding-block-end: calc(var(--base-unit) * 4);
+ padding-inline: calc(var(--base-unit) * 5);
+}
+
+.connect-section__header__title {
+ grid-area: heading;
+}
+
+.connect-section__header__icon {
+ grid-area: icon;
+ width: var(--icon-size);
+ height: var(--icon-size);
+
+ -moz-context-properties: fill;
+ fill: currentColor;
+}
+
+.connect-section__content {
+ line-height: 1.5;
+ padding-inline-start: calc(var(--base-unit) * 5
+ + var(--header-col-gap) + var(--icon-size));
+ padding-inline-end: calc(var(--base-unit) * 5);
+}
+
+.connect-section__extra {
+ border-block-start: 1px solid var(--card-separator-color);
+}
diff --git a/devtools/client/aboutdebugging/src/components/connect/ConnectSection.js b/devtools/client/aboutdebugging/src/components/connect/ConnectSection.js
new file mode 100644
index 0000000000..55f8eb4e78
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/ConnectSection.js
@@ -0,0 +1,69 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+class ConnectSection extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node,
+ className: PropTypes.string,
+ extraContent: PropTypes.node,
+ icon: PropTypes.string.isRequired,
+ title: PropTypes.node.isRequired,
+ };
+ }
+
+ renderExtraContent() {
+ const { extraContent } = this.props;
+ return dom.section(
+ {
+ className: "connect-section__extra",
+ },
+ extraContent
+ );
+ }
+
+ render() {
+ const { extraContent } = this.props;
+
+ return dom.section(
+ {
+ className: `card connect-section ${this.props.className || ""}`,
+ },
+ dom.header(
+ {
+ className: "connect-section__header",
+ },
+ dom.img({
+ className: "connect-section__header__icon",
+ src: this.props.icon,
+ }),
+ dom.h1(
+ {
+ className: "card__heading connect-section__header__title",
+ },
+ this.props.title
+ )
+ ),
+ this.props.children
+ ? dom.div(
+ {
+ className: "connect-section__content",
+ },
+ this.props.children
+ )
+ : null,
+ extraContent ? this.renderExtraContent() : null
+ );
+ }
+}
+
+module.exports = ConnectSection;
diff --git a/devtools/client/aboutdebugging/src/components/connect/ConnectSteps.css b/devtools/client/aboutdebugging/src/components/connect/ConnectSteps.css
new file mode 100644
index 0000000000..bddd513aa7
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/ConnectSteps.css
@@ -0,0 +1,13 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.connect-page__step-list {
+ list-style-type: decimal;
+ list-style-position: outside;
+ margin-inline-start: calc(var(--base-unit) * 4);
+}
+
+.connect-page__step {
+ padding-inline-start: var(--base-unit);
+}
diff --git a/devtools/client/aboutdebugging/src/components/connect/ConnectSteps.js b/devtools/client/aboutdebugging/src/components/connect/ConnectSteps.js
new file mode 100644
index 0000000000..0e8d304108
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/ConnectSteps.js
@@ -0,0 +1,51 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+class ConnectSteps extends PureComponent {
+ static get propTypes() {
+ return {
+ steps: PropTypes.arrayOf(
+ PropTypes.shape({
+ localizationId: PropTypes.string.isRequired,
+ }).isRequired
+ ),
+ };
+ }
+
+ render() {
+ return dom.ul(
+ {
+ className: "connect-page__step-list",
+ },
+ ...this.props.steps.map(step =>
+ Localized(
+ {
+ id: step.localizationId,
+ },
+ dom.li(
+ {
+ className: "connect-page__step",
+ key: step.localizationId,
+ },
+ step.localizationId
+ )
+ )
+ )
+ );
+ }
+}
+
+module.exports = ConnectSteps;
diff --git a/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.css b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.css
new file mode 100644
index 0000000000..5694bcf216
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.css
@@ -0,0 +1,23 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * Layout of a network location form
+ *
+ * +-------------+--------------------+------------+
+ * | "Host:port" | Input | Add button |
+ * +-------------+--------------------+------------+
+ */
+.connect-page__network-form {
+ display: grid;
+ grid-column-gap: calc(var(--base-unit) * 2);
+ grid-template-columns: auto 1fr auto;
+ align-items: center;
+ padding-block-start: calc(var(--base-unit) * 4);
+ padding-inline: calc(var(--base-unit) * 6);
+}
+
+.connect-page__network-form__error-message {
+ grid-column: 1 / -1;
+}
diff --git a/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.js b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.js
new file mode 100644
index 0000000000..347167921b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsForm.js
@@ -0,0 +1,148 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+class NetworkLocationsForm extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ networkLocations: PropTypes.arrayOf(Types.location).isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ errorHostValue: null,
+ errorMessageId: null,
+ value: "",
+ };
+ }
+
+ onSubmit(e) {
+ const { networkLocations } = this.props;
+ const { value } = this.state;
+
+ e.preventDefault();
+
+ if (!value) {
+ return;
+ }
+
+ if (!value.match(/[^:]+:\d+/)) {
+ this.setState({
+ errorHostValue: value,
+ errorMessageId: "about-debugging-network-location-form-invalid",
+ });
+ return;
+ }
+
+ if (networkLocations.includes(value)) {
+ this.setState({
+ errorHostValue: value,
+ errorMessageId: "about-debugging-network-location-form-duplicate",
+ });
+ return;
+ }
+
+ this.props.dispatch(Actions.addNetworkLocation(value));
+ this.setState({ errorHostValue: null, errorMessageId: null, value: "" });
+ }
+
+ renderError() {
+ const { errorHostValue, errorMessageId } = this.state;
+
+ if (!errorMessageId) {
+ return null;
+ }
+
+ return Message(
+ {
+ className:
+ "connect-page__network-form__error-message " +
+ "qa-connect-page__network-form__error-message",
+ level: MESSAGE_LEVEL.ERROR,
+ isCloseable: true,
+ },
+ Localized(
+ {
+ id: errorMessageId,
+ "$host-value": errorHostValue,
+ },
+ dom.p(
+ {
+ className: "technical-text",
+ },
+ errorMessageId
+ )
+ )
+ );
+ }
+
+ render() {
+ return dom.form(
+ {
+ className: "connect-page__network-form",
+ onSubmit: e => this.onSubmit(e),
+ },
+ this.renderError(),
+ Localized(
+ {
+ id: "about-debugging-network-locations-host-input-label",
+ },
+ dom.label(
+ {
+ htmlFor: "about-debugging-network-locations-host-input",
+ },
+ "Host"
+ )
+ ),
+ dom.input({
+ id: "about-debugging-network-locations-host-input",
+ className: "default-input qa-network-form-input",
+ placeholder: "localhost:6080",
+ type: "text",
+ value: this.state.value,
+ onChange: e => {
+ const value = e.target.value;
+ this.setState({ value });
+ },
+ }),
+ Localized(
+ {
+ id: "about-debugging-network-locations-add-button",
+ },
+ dom.button(
+ {
+ className: "primary-button qa-network-form-submit-button",
+ },
+ "Add"
+ )
+ )
+ );
+ }
+}
+
+module.exports = NetworkLocationsForm;
diff --git a/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.css b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.css
new file mode 100644
index 0000000000..e5676b784a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.css
@@ -0,0 +1,20 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * Layout of a network location item
+ *
+ * +-------------------------------------+---------------+
+ * | Location (eg localhost:8080) | Remove button |
+ * +-------------------------------------+---------------+
+ */
+.network-location {
+ display: grid;
+ grid-template-columns: auto max-content;
+ align-items: center;
+
+ padding-block: calc(var(--base-unit) * 2);
+ padding-inline: calc(var(--base-unit) * 6);
+ border-bottom: 1px solid var(--card-separator-color);
+}
diff --git a/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.js b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.js
new file mode 100644
index 0000000000..e680fe525f
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/NetworkLocationsList.js
@@ -0,0 +1,67 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+class NetworkLocationsList extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ networkLocations: PropTypes.arrayOf(Types.location).isRequired,
+ };
+ }
+
+ renderList() {
+ return dom.ul(
+ {},
+ this.props.networkLocations.map(location =>
+ dom.li(
+ {
+ className: "network-location qa-network-location",
+ key: location,
+ },
+ dom.span(
+ {
+ className: "ellipsis-text qa-network-location-value",
+ },
+ location
+ ),
+ Localized(
+ {
+ id: "about-debugging-network-locations-remove-button",
+ },
+ dom.button(
+ {
+ className: "default-button qa-network-location-remove-button",
+ onClick: () => {
+ this.props.dispatch(Actions.removeNetworkLocation(location));
+ },
+ },
+ "Remove"
+ )
+ )
+ )
+ )
+ );
+ }
+
+ render() {
+ return this.props.networkLocations.length ? this.renderList() : null;
+ }
+}
+
+module.exports = NetworkLocationsList;
diff --git a/devtools/client/aboutdebugging/src/components/connect/moz.build b/devtools/client/aboutdebugging/src/components/connect/moz.build
new file mode 100644
index 0000000000..9228e80125
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/connect/moz.build
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "ConnectPage.js",
+ "ConnectSection.js",
+ "ConnectSteps.js",
+ "NetworkLocationsForm.js",
+ "NetworkLocationsList.js",
+)
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.css b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.css
new file mode 100644
index 0000000000..f049f33b23
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.css
@@ -0,0 +1,97 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * The current layout of debug target item is
+ *
+ * +--------+-----------------------------+----------------+
+ * | | Name | |
+ * | [Icon] |-----------------------------| Action button |
+ * | | Subname | |
+ * +--------+-----------------------------+----------------+
+ * | Detail |
+ * | |
+ * +-------------------------------------------------------+
+ * | Additional actions |
+ * | |
+ * +-------------------------------------------------------+
+ */
+.debug-target-item {
+ display: grid;
+ grid-template-columns: calc(var(--base-unit) * 8) 1fr max-content;
+ grid-template-rows: 1fr minmax(0, auto) auto;
+ grid-column-gap: calc(var(--base-unit) * 2);
+ grid-template-areas: "icon name action"
+ "icon subname action"
+ "detail detail detail"
+ "additional_actions additional_actions additional_actions";
+ margin-block-end: calc(var(--base-unit) * 4);
+
+ padding-block: calc(var(--base-unit) * 3) calc(var(--base-unit) * 2);
+ padding-inline: calc(var(--base-unit) * 3) calc(var(--base-unit) * 2);
+}
+
+.debug-target-item__icon {
+ align-self: center;
+ grid-area: icon;
+ margin-inline-start: calc(var(--base-unit) * 3);
+ width: 100%;
+
+ -moz-context-properties: fill;
+ fill: currentColor;
+}
+
+.debug-target-item__name {
+ align-self: center;
+ grid-area: name;
+ font-size: var(--body-20-font-size);
+ font-weight: var(--body-20-font-weight-bold);
+ line-height: 1.5;
+ margin-inline-start: calc(var(--base-unit) * 3);
+}
+
+.debug-target-item__action {
+ grid-area: action;
+ align-self: center;
+ margin-inline-end: calc(var(--base-unit) * 2);
+}
+
+.debug-target-item__additional_actions {
+ grid-area: additional_actions;
+ border-top: 1px solid var(--card-separator-color);
+ margin-block-start: calc(var(--base-unit) * 2);
+ padding-block-start: calc(var(--base-unit) * 2);
+ padding-inline-end: calc(var(--base-unit) * 2);
+}
+
+.debug-target-item__detail {
+ grid-area: detail;
+ margin-block-start: calc(var(--base-unit) * 3);
+}
+
+.debug-target-item__detail--empty {
+ margin-block-start: var(--base-unit);
+}
+
+.debug-target-item__messages {
+ margin-inline: calc(var(--base-unit) * 3) calc(var(--base-unit) * 2);
+}
+
+.debug-target-item__subname {
+ grid-area: subname;
+ color: var(--secondary-text-color);
+ font-size: var(--caption-20-font-size);
+ font-weight: var(--caption-20-font-weight);
+ line-height: 1.5;
+}
+
+/* The subname is always LTR under the Tabs section,
+ so check its parent's direction to set the correct margin. */
+.debug-target-item:dir(ltr) > .debug-target-item__subname {
+ margin-left: calc(var(--base-unit) * 3);
+}
+
+.debug-target-item:dir(rtl) > .debug-target-item__subname {
+ margin-right: calc(var(--base-unit) * 3);
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.js b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.js
new file mode 100644
index 0000000000..6f19d7be02
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.js
@@ -0,0 +1,91 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays debug target.
+ */
+class DebugTargetItem extends PureComponent {
+ static get propTypes() {
+ return {
+ actionComponent: PropTypes.any.isRequired,
+ additionalActionsComponent: PropTypes.any,
+ detailComponent: PropTypes.any.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ renderAction() {
+ const { actionComponent, dispatch, target } = this.props;
+ return dom.div(
+ {
+ className: "debug-target-item__action",
+ },
+ actionComponent({ dispatch, target })
+ );
+ }
+
+ renderAdditionalActions() {
+ const { additionalActionsComponent, dispatch, target } = this.props;
+
+ if (!additionalActionsComponent) {
+ return null;
+ }
+
+ return dom.section(
+ {
+ className: "debug-target-item__additional_actions",
+ },
+ additionalActionsComponent({ dispatch, target })
+ );
+ }
+
+ renderDetail() {
+ const { detailComponent, target } = this.props;
+ return detailComponent({ target });
+ }
+
+ renderIcon() {
+ return dom.img({
+ className: "debug-target-item__icon qa-debug-target-item-icon",
+ src: this.props.target.icon,
+ });
+ }
+
+ renderName() {
+ return dom.span(
+ {
+ className: "debug-target-item__name ellipsis-text",
+ title: this.props.target.name,
+ },
+ this.props.target.name
+ );
+ }
+
+ render() {
+ return dom.li(
+ {
+ className: "card debug-target-item qa-debug-target-item",
+ "data-qa-target-type": this.props.target.type,
+ },
+ this.renderIcon(),
+ this.renderName(),
+ this.renderAction(),
+ this.renderDetail(),
+ this.renderAdditionalActions()
+ );
+ }
+}
+
+module.exports = DebugTargetItem;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.css b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.css
new file mode 100644
index 0000000000..827983e2bf
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.css
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.debug-target-list {
+ margin-block-start: calc(var(--base-unit) * 4);
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.js b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.js
new file mode 100644
index 0000000000..ce1e7ff12c
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.js
@@ -0,0 +1,80 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const DebugTargetItem = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetItem.js")
+);
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays list of debug target.
+ */
+class DebugTargetList extends PureComponent {
+ static get propTypes() {
+ return {
+ actionComponent: PropTypes.any.isRequired,
+ additionalActionsComponent: PropTypes.any,
+ detailComponent: PropTypes.any.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ targets: PropTypes.arrayOf(Types.debugTarget).isRequired,
+ };
+ }
+
+ renderEmptyList() {
+ return Localized(
+ {
+ id: "about-debugging-debug-target-list-empty",
+ },
+ dom.p(
+ {
+ className: "qa-debug-target-list-empty",
+ },
+ "Nothing yet."
+ )
+ );
+ }
+
+ render() {
+ const {
+ actionComponent,
+ additionalActionsComponent,
+ detailComponent,
+ dispatch,
+ targets,
+ } = this.props;
+
+ return targets.length === 0
+ ? this.renderEmptyList()
+ : dom.ul(
+ {
+ className: "debug-target-list qa-debug-target-list",
+ },
+ targets.map((target, key) =>
+ DebugTargetItem({
+ actionComponent,
+ additionalActionsComponent,
+ detailComponent,
+ dispatch,
+ key,
+ target,
+ })
+ )
+ );
+ }
+}
+
+module.exports = DebugTargetList;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.css b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.css
new file mode 100644
index 0000000000..616b4ac28c
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.css
@@ -0,0 +1,43 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * Style for the heading of a debug target pane
+ * +-----------------+---------------+-----------------+
+ * | [Category icon] | Category name | [Collapse icon] |
+ * +-----------------+---------------+-----------------+
+ */
+.debug-target-pane__heading {
+ grid-template-columns: var(--main-subheading-icon-size) max-content calc(var(--base-unit) * 3);
+ user-select: none;
+}
+
+.debug-target-pane__icon {
+ transition: transform 150ms cubic-bezier(.07, .95, 0, 1);
+ transform: rotate(90deg);
+}
+
+.debug-target-pane__icon--collapsed {
+ transform: rotate(0deg);
+}
+
+.debug-target-pane__icon--collapsed:dir(rtl) {
+ transform: rotate(180deg);
+}
+
+.debug-target-pane__title {
+ cursor: pointer;
+}
+
+.debug-target-pane__collapsable {
+ overflow: hidden;
+ /* padding will give space for card shadow to appear and
+ margin will correct the alignment */
+ margin-inline: calc(var(--card-shadow-blur-radius) * -1);
+ padding-inline: var(--card-shadow-blur-radius);
+}
+
+.debug-target-pane__collapsable--collapsed {
+ max-height: 0;
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js
new file mode 100644
index 0000000000..abfa1042b8
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js
@@ -0,0 +1,147 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ createRef,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+
+const DebugTargetList = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetList.js")
+);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component provides list for debug target and name area.
+ */
+class DebugTargetPane extends PureComponent {
+ static get propTypes() {
+ return {
+ actionComponent: PropTypes.any.isRequired,
+ additionalActionsComponent: PropTypes.any,
+ children: PropTypes.node,
+ collapsibilityKey: PropTypes.string.isRequired,
+ detailComponent: PropTypes.any.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ // Provided by wrapping the component with FluentReact.withLocalization.
+ getString: PropTypes.func.isRequired,
+ icon: PropTypes.string.isRequired,
+ isCollapsed: PropTypes.bool.isRequired,
+ name: PropTypes.string.isRequired,
+ targets: PropTypes.arrayOf(Types.debugTarget).isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+ this.collapsableRef = createRef();
+ }
+
+ componentDidUpdate(prevProps, prevState, snapshot) {
+ if (snapshot === null) {
+ return;
+ }
+
+ const el = this.collapsableRef.current;
+
+ // Cancel existing animation which is collapsing/expanding.
+ for (const animation of el.getAnimations()) {
+ animation.cancel();
+ }
+
+ el.animate(
+ { maxHeight: [`${snapshot}px`, `${el.clientHeight}px`] },
+ { duration: 150, easing: "cubic-bezier(.07, .95, 0, 1)" }
+ );
+ }
+
+ getSnapshotBeforeUpdate(prevProps) {
+ if (this.props.isCollapsed !== prevProps.isCollapsed) {
+ return this.collapsableRef.current.clientHeight;
+ }
+
+ return null;
+ }
+
+ toggleCollapsibility() {
+ const { collapsibilityKey, dispatch, isCollapsed } = this.props;
+ dispatch(
+ Actions.updateDebugTargetCollapsibility(collapsibilityKey, !isCollapsed)
+ );
+ }
+
+ render() {
+ const {
+ actionComponent,
+ additionalActionsComponent,
+ children,
+ detailComponent,
+ dispatch,
+ getString,
+ icon,
+ isCollapsed,
+ name,
+ targets,
+ } = this.props;
+
+ const title = getString("about-debugging-collapse-expand-debug-targets");
+
+ return dom.section(
+ {
+ className: "qa-debug-target-pane",
+ },
+ dom.a(
+ {
+ className:
+ "undecorated-link debug-target-pane__title " +
+ "qa-debug-target-pane-title",
+ title,
+ onClick: e => this.toggleCollapsibility(),
+ },
+ dom.h2(
+ { className: "main-subheading debug-target-pane__heading" },
+ dom.img({
+ className: "main-subheading__icon",
+ src: icon,
+ }),
+ `${name} (${targets.length})`,
+ dom.img({
+ className:
+ "main-subheading__icon debug-target-pane__icon" +
+ (isCollapsed ? " debug-target-pane__icon--collapsed" : ""),
+ src: "chrome://devtools/skin/images/arrow-e.svg",
+ })
+ )
+ ),
+ dom.div(
+ {
+ className:
+ "debug-target-pane__collapsable qa-debug-target-pane__collapsable" +
+ (isCollapsed ? " debug-target-pane__collapsable--collapsed" : ""),
+ ref: this.collapsableRef,
+ },
+ children,
+ DebugTargetList({
+ actionComponent,
+ additionalActionsComponent,
+ detailComponent,
+ dispatch,
+ isCollapsed,
+ targets,
+ })
+ )
+ );
+ }
+}
+
+module.exports = FluentReact.withLocalization(DebugTargetPane);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.css b/devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.css
new file mode 100644
index 0000000000..6a4befa76a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.css
@@ -0,0 +1,27 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.extension-backgroundscript {
+ display: flex;
+ column-gap: calc(var(--base-unit) * 2);
+}
+
+.extension-backgroundscript__status {
+ display: flex;
+ align-items: center;
+ float: inline-end;
+}
+
+.extension-backgroundscript__status::before {
+ background-color: var(--grey-50);
+ border-radius: 100%;
+ content: "";
+ height: calc(var(--base-unit) * 2);
+ margin-inline-end: var(--base-unit);
+ width: calc(var(--base-unit) * 2);
+}
+
+.extension-backgroundscript__status--running::before {
+ background-color: var(--success-background);
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.js b/devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.js
new file mode 100644
index 0000000000..ef14483723
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.js
@@ -0,0 +1,243 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ getCurrentRuntimeDetails,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+const DetailsLog = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/DetailsLog.js")
+);
+const FieldPair = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.js")
+);
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+
+const {
+ EXTENSION_BGSCRIPT_STATUSES,
+ MESSAGE_LEVEL,
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays detail information for extension.
+ */
+class ExtensionDetail extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node,
+ // Provided by wrapping the component with FluentReact.withLocalization.
+ getString: PropTypes.func.isRequired,
+ // Provided by redux state
+ runtimeDetails: Types.runtimeDetails.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ renderWarnings() {
+ const { warnings } = this.props.target.details;
+
+ if (!warnings.length) {
+ return null;
+ }
+
+ return dom.section(
+ {
+ className: "debug-target-item__messages",
+ },
+ warnings.map((warning, index) => {
+ return Message(
+ {
+ level: MESSAGE_LEVEL.WARNING,
+ isCloseable: true,
+ key: `warning-${index}`,
+ },
+ DetailsLog(
+ {
+ type: MESSAGE_LEVEL.WARNING,
+ },
+ dom.p(
+ {
+ className: "technical-text",
+ },
+ warning
+ )
+ )
+ );
+ })
+ );
+ }
+
+ renderUUID() {
+ const { uuid } = this.props.target.details;
+ if (!uuid) {
+ return null;
+ }
+
+ return Localized(
+ {
+ id: "about-debugging-extension-uuid",
+ attrs: { label: true },
+ },
+ FieldPair({
+ label: "Internal UUID",
+ value: uuid,
+ })
+ );
+ }
+
+ renderExtensionId() {
+ const { id } = this.props.target;
+
+ return Localized(
+ {
+ id: "about-debugging-extension-id",
+ attrs: { label: true },
+ },
+ FieldPair({
+ label: "Extension ID",
+ value: id,
+ })
+ );
+ }
+
+ renderLocation() {
+ const { location } = this.props.target.details;
+ if (!location) {
+ return null;
+ }
+
+ return Localized(
+ {
+ id: "about-debugging-extension-location",
+ attrs: { label: true },
+ },
+ FieldPair({
+ label: "Location",
+ value: location,
+ })
+ );
+ }
+
+ renderManifest() {
+ // Manifest links are only relevant when debugging the current Firefox
+ // instance.
+ if (this.props.runtimeDetails.info.type !== RUNTIMES.THIS_FIREFOX) {
+ return null;
+ }
+
+ const { manifestURL } = this.props.target.details;
+ const link = dom.a(
+ {
+ className: "qa-manifest-url",
+ href: manifestURL,
+ target: "_blank",
+ },
+ manifestURL
+ );
+
+ return Localized(
+ {
+ id: "about-debugging-extension-manifest-url",
+ attrs: { label: true },
+ },
+ FieldPair({
+ label: "Manifest URL",
+ value: link,
+ })
+ );
+ }
+
+ renderBackgroundScriptStatus() {
+ // The status of the background script is only relevant if it is
+ // not persistent.
+ const { persistentBackgroundScript } = this.props.target.details;
+ if (!(persistentBackgroundScript === false)) {
+ return null;
+ }
+
+ const { backgroundScriptStatus } = this.props.target.details;
+
+ let status;
+ let statusLocalizationId;
+ let statusClassName;
+
+ if (backgroundScriptStatus === EXTENSION_BGSCRIPT_STATUSES.RUNNING) {
+ status = `extension-backgroundscript__status--running`;
+ statusLocalizationId = `about-debugging-extension-backgroundscript-status-running`;
+ statusClassName = `extension-backgroundscript__status--running`;
+ } else {
+ status = `extension-backgroundscript__status--stopped`;
+ statusLocalizationId = `about-debugging-extension-backgroundscript-status-stopped`;
+ statusClassName = `extension-backgroundscript__status--stopped`;
+ }
+
+ return Localized(
+ {
+ id: "about-debugging-extension-backgroundscript",
+ attrs: { label: true },
+ },
+ FieldPair({
+ label: "Background Script",
+ value: Localized(
+ {
+ id: statusLocalizationId,
+ },
+ dom.span(
+ {
+ className: `extension-backgroundscript__status qa-extension-backgroundscript-status ${statusClassName}`,
+ },
+ status
+ )
+ ),
+ })
+ );
+ }
+
+ render() {
+ return dom.section(
+ {
+ className: "debug-target-item__detail",
+ },
+ this.renderWarnings(),
+ dom.dl(
+ {},
+ this.renderLocation(),
+ this.renderExtensionId(),
+ this.renderUUID(),
+ this.renderManifest(),
+ this.renderBackgroundScriptStatus(),
+ this.props.children
+ )
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ runtimeDetails: getCurrentRuntimeDetails(state.runtimes),
+ };
+};
+
+module.exports = FluentReact.withLocalization(
+ connect(mapStateToProps)(ExtensionDetail)
+);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.css b/devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.css
new file mode 100644
index 0000000000..a0b290d2a3
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.css
@@ -0,0 +1,29 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.fieldpair {
+ display: grid;
+ grid-template-columns: auto auto;
+ border-top: 1px solid var(--card-separator-color);
+ padding-block: calc(var(--base-unit) * 2);
+ padding-inline: calc(var(--base-unit) * 4) calc(var(--base-unit) * 2);
+}
+
+.fieldpair:last-child {
+ padding-block-end: 0;
+}
+
+.fieldpair__title {
+ margin-inline-end: var(--base-unit);
+ font-size: var(--caption-20-font-size);
+ font-weight: var(--caption-20-font-weight);
+}
+
+.fieldpair__description {
+ color: var(--fieldpair-text-color);
+ flex: 1;
+ font-size: var(--caption-20-font-size);
+ font-weight: var(--caption-20-font-weight);
+ text-align: end;
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.js b/devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.js
new file mode 100644
index 0000000000..5e7ae53c65
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.js
@@ -0,0 +1,49 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+/* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+/* Renders a pair of `<dt>` (label) + `<dd>` (value) field. */
+class FieldPair extends PureComponent {
+ static get propTypes() {
+ return {
+ className: PropTypes.string,
+ label: PropTypes.node.isRequired,
+ value: PropTypes.node,
+ };
+ }
+
+ render() {
+ const { label, value } = this.props;
+ return dom.div(
+ {
+ className: "fieldpair",
+ },
+ dom.dt(
+ {
+ className:
+ "fieldpair__title " +
+ (this.props.className ? this.props.className : ""),
+ },
+ label
+ ),
+ value
+ ? dom.dd(
+ {
+ className: "fieldpair__description ellipsis-text",
+ },
+ value
+ )
+ : null
+ );
+ }
+}
+
+module.exports = FieldPair;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js b/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js
new file mode 100644
index 0000000000..f7aff438a4
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component provides inspect button.
+ */
+class InspectAction extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ disabled: PropTypes.bool,
+ target: Types.debugTarget.isRequired,
+ title: PropTypes.string,
+ };
+ }
+
+ inspect() {
+ const { dispatch, target } = this.props;
+ dispatch(Actions.inspectDebugTarget(target.type, target.id));
+ }
+
+ render() {
+ const { disabled, title } = this.props;
+
+ return Localized(
+ {
+ id: "about-debugging-debug-target-inspect-button",
+ },
+ dom.button(
+ {
+ onClick: e => this.inspect(),
+ className: "default-button qa-debug-target-inspect-button",
+ disabled,
+ title,
+ },
+ "Inspect"
+ )
+ );
+ }
+}
+
+module.exports = InspectAction;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ProcessDetail.js b/devtools/client/aboutdebugging/src/components/debugtarget/ProcessDetail.js
new file mode 100644
index 0000000000..a9973e90e3
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/ProcessDetail.js
@@ -0,0 +1,32 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays detail information for a process.
+ */
+class ProcessDetail extends PureComponent {
+ static get propTypes() {
+ return {
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ render() {
+ const { description } = this.props.target.details;
+ return dom.p(
+ { className: "debug-target-item__subname ellipsis-text" },
+ description
+ );
+ }
+}
+
+module.exports = ProcessDetail;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.css b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.css
new file mode 100644
index 0000000000..c3ac2dc872
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.css
@@ -0,0 +1,26 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.service-worker-action {
+ display: flex;
+ column-gap: calc(var(--base-unit) * 2);
+}
+
+.service-worker-action__status {
+ display: flex;
+ align-items: center;
+}
+
+.service-worker-action__status::before {
+ background-color: var(--grey-50);
+ border-radius: 100%;
+ content: "";
+ height: calc(var(--base-unit) * 2);
+ margin-inline-end: var(--base-unit);
+ width: calc(var(--base-unit) * 2);
+}
+
+.service-worker-action__status--running::before {
+ background-color: var(--success-background);
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.js b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.js
new file mode 100644
index 0000000000..38aede94f4
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAction.js
@@ -0,0 +1,124 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ getCurrentRuntimeDetails,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+const InspectAction = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js")
+);
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+const {
+ SERVICE_WORKER_STATUSES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component displays buttons for service worker.
+ */
+class ServiceWorkerAction extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ // Provided by redux state
+ runtimeDetails: Types.runtimeDetails.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ _renderInspectAction() {
+ const { status } = this.props.target.details;
+ const shallRenderInspectAction =
+ status === SERVICE_WORKER_STATUSES.RUNNING ||
+ status === SERVICE_WORKER_STATUSES.REGISTERING;
+
+ if (!shallRenderInspectAction) {
+ return null;
+ }
+
+ const { canDebugServiceWorkers } = this.props.runtimeDetails;
+ return Localized(
+ {
+ id: "about-debugging-worker-inspect-action-disabled",
+ attrs: {
+ // Show an explanatory title only if the action is disabled.
+ title: !canDebugServiceWorkers,
+ },
+ },
+ InspectAction({
+ disabled: !canDebugServiceWorkers,
+ dispatch: this.props.dispatch,
+ target: this.props.target,
+ })
+ );
+ }
+
+ _getStatusLocalizationId(status) {
+ switch (status) {
+ case SERVICE_WORKER_STATUSES.REGISTERING.toLowerCase():
+ return "about-debugging-worker-status-registering";
+ case SERVICE_WORKER_STATUSES.RUNNING.toLowerCase():
+ return "about-debugging-worker-status-running";
+ case SERVICE_WORKER_STATUSES.STOPPED.toLowerCase():
+ return "about-debugging-worker-status-stopped";
+ default:
+ // Assume status is stopped for unknown status value.
+ return "about-debugging-worker-status-stopped";
+ }
+ }
+
+ _renderStatus() {
+ const status = this.props.target.details.status.toLowerCase();
+ const statusClassName =
+ status === SERVICE_WORKER_STATUSES.RUNNING.toLowerCase()
+ ? "service-worker-action__status--running"
+ : "";
+
+ return Localized(
+ {
+ id: this._getStatusLocalizationId(status),
+ },
+ dom.span(
+ {
+ className: `service-worker-action__status qa-worker-status ${statusClassName}`,
+ },
+ status
+ )
+ );
+ }
+
+ render() {
+ return dom.div(
+ {
+ className: "service-worker-action",
+ },
+ this._renderStatus(),
+ this._renderInspectAction()
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ runtimeDetails: getCurrentRuntimeDetails(state.runtimes),
+ };
+};
+
+module.exports = connect(mapStateToProps)(ServiceWorkerAction);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js
new file mode 100644
index 0000000000..38262ad511
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js
@@ -0,0 +1,176 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ getCurrentRuntimeDetails,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+const {
+ SERVICE_WORKER_STATUSES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * The main purpose of this component is to expose a meaningful prop
+ * disabledTitle that can be used with fluent localization.
+ */
+class _ActionButton extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node,
+ className: PropTypes.string.isRequired,
+ disabled: PropTypes.bool,
+ disabledTitle: PropTypes.string,
+ onClick: PropTypes.func.isRequired,
+ };
+ }
+
+ render() {
+ const { className, disabled, disabledTitle, onClick } = this.props;
+ return dom.button(
+ {
+ className,
+ disabled,
+ onClick: e => onClick(),
+ title: disabled && disabledTitle ? disabledTitle : undefined,
+ },
+ this.props.children
+ );
+ }
+}
+const ActionButtonFactory = createFactory(_ActionButton);
+
+/**
+ * This component displays buttons for service worker.
+ */
+class ServiceWorkerAdditionalActions extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ // Provided by wrapping the component with FluentReact.withLocalization.
+ getString: PropTypes.func.isRequired,
+ // Provided by redux state
+ runtimeDetails: Types.runtimeDetails.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ push() {
+ const { dispatch, target } = this.props;
+ dispatch(
+ Actions.pushServiceWorker(target.id, target.details.registrationFront)
+ );
+ }
+
+ start() {
+ const { dispatch, target } = this.props;
+ dispatch(Actions.startServiceWorker(target.details.registrationFront));
+ }
+
+ unregister() {
+ const { dispatch, target } = this.props;
+ dispatch(Actions.unregisterServiceWorker(target.details.registrationFront));
+ }
+
+ _renderButton({ className, disabled, key, labelId, onClick }) {
+ return Localized(
+ {
+ id: labelId,
+ attrs: {
+ disabledTitle: !!disabled,
+ },
+ key,
+ },
+ ActionButtonFactory(
+ {
+ className,
+ disabled,
+ onClick: e => onClick(),
+ },
+ labelId
+ )
+ );
+ }
+
+ _renderPushButton() {
+ return this._renderButton({
+ className: "default-button default-button--micro qa-push-button",
+ disabled: !this.props.runtimeDetails.canDebugServiceWorkers,
+ key: "service-worker-push-button",
+ labelId: "about-debugging-worker-action-push2",
+ onClick: this.push.bind(this),
+ });
+ }
+
+ _renderStartButton() {
+ return this._renderButton({
+ className: "default-button default-button--micro qa-start-button",
+ disabled: !this.props.runtimeDetails.canDebugServiceWorkers,
+ key: "service-worker-start-button",
+ labelId: "about-debugging-worker-action-start2",
+ onClick: this.start.bind(this),
+ });
+ }
+
+ _renderUnregisterButton() {
+ return this._renderButton({
+ className: "default-button default-button--micro qa-unregister-button",
+ key: "service-worker-unregister-button",
+ labelId: "about-debugging-worker-action-unregister",
+ disabled: false,
+ onClick: this.unregister.bind(this),
+ });
+ }
+
+ _renderActionButtons() {
+ const { status } = this.props.target.details;
+
+ switch (status) {
+ case SERVICE_WORKER_STATUSES.RUNNING:
+ return [this._renderUnregisterButton(), this._renderPushButton()];
+ case SERVICE_WORKER_STATUSES.REGISTERING:
+ return null;
+ case SERVICE_WORKER_STATUSES.STOPPED:
+ return [this._renderUnregisterButton(), this._renderStartButton()];
+ default:
+ console.error("Unexpected service worker status: " + status);
+ return null;
+ }
+ }
+
+ render() {
+ return dom.div(
+ {
+ className: "toolbar toolbar--right-align",
+ },
+ this._renderActionButtons()
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ runtimeDetails: getCurrentRuntimeDetails(state.runtimes),
+ };
+};
+
+module.exports = FluentReact.withLocalization(
+ connect(mapStateToProps)(ServiceWorkerAdditionalActions)
+);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TabAction.js b/devtools/client/aboutdebugging/src/components/debugtarget/TabAction.js
new file mode 100644
index 0000000000..132f1e5f44
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TabAction.js
@@ -0,0 +1,52 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const InspectAction = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js")
+);
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays the inspect button for tabs.
+ */
+class TabAction extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ render() {
+ const isZombieTab = this.props.target.details.isZombieTab;
+ return Localized(
+ {
+ id: "about-debugging-zombie-tab-inspect-action-disabled",
+ attrs: {
+ // Show an explanatory title only if the action is disabled.
+ title: isZombieTab,
+ },
+ },
+ InspectAction({
+ disabled: isZombieTab,
+ dispatch: this.props.dispatch,
+ target: this.props.target,
+ })
+ );
+ }
+}
+
+module.exports = FluentReact.withLocalization(TabAction);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TabDetail.js b/devtools/client/aboutdebugging/src/components/debugtarget/TabDetail.js
new file mode 100644
index 0000000000..dcbd3f0a4d
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TabDetail.js
@@ -0,0 +1,34 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays detail information for tab.
+ */
+class TabDetail extends PureComponent {
+ static get propTypes() {
+ return {
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ render() {
+ return dom.div(
+ {
+ className: "debug-target-item__subname ellipsis-text",
+ dir: "ltr",
+ },
+ this.props.target.details.url
+ );
+ }
+}
+
+module.exports = TabDetail;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js
new file mode 100644
index 0000000000..44b7d3e167
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js
@@ -0,0 +1,182 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+const DetailsLog = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/DetailsLog.js")
+);
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component provides components that reload/remove temporary extension.
+ */
+class TemporaryExtensionAdditionalActions extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ reload() {
+ const { dispatch, target } = this.props;
+ dispatch(Actions.reloadTemporaryExtension(target.id));
+ }
+
+ terminateBackgroundScript() {
+ const { dispatch, target } = this.props;
+ dispatch(Actions.terminateExtensionBackgroundScript(target.id));
+ }
+
+ remove() {
+ const { dispatch, target } = this.props;
+ dispatch(Actions.removeTemporaryExtension(target.id));
+ }
+
+ renderReloadError() {
+ const { reloadError } = this.props.target.details;
+
+ if (!reloadError) {
+ return null;
+ }
+
+ return Message(
+ {
+ className: "qa-temporary-extension-reload-error",
+ level: MESSAGE_LEVEL.ERROR,
+ key: "reload-error",
+ },
+ DetailsLog(
+ {
+ type: MESSAGE_LEVEL.ERROR,
+ },
+ dom.p(
+ {
+ className: "technical-text",
+ },
+ reloadError
+ )
+ )
+ );
+ }
+
+ renderTerminateBackgroundScriptError() {
+ const { lastTerminateBackgroundScriptError } = this.props.target.details;
+
+ if (!lastTerminateBackgroundScriptError) {
+ return null;
+ }
+
+ return Message(
+ {
+ className: "qa-temporary-extension-terminate-backgroundscript-error",
+ level: MESSAGE_LEVEL.ERROR,
+ key: "terminate-backgroundscript-error",
+ },
+ DetailsLog(
+ {
+ type: MESSAGE_LEVEL.ERROR,
+ },
+ dom.p(
+ {
+ className: "technical-text",
+ },
+ lastTerminateBackgroundScriptError
+ )
+ )
+ );
+ }
+
+ renderTerminateBackgroundScriptButton() {
+ const { persistentBackgroundScript } = this.props.target.details;
+
+ // For extensions with a non persistent background script
+ // also include a "terminate background script" action.
+ if (persistentBackgroundScript !== false) {
+ return null;
+ }
+
+ return Localized(
+ {
+ id: "about-debugging-tmp-extension-terminate-bgscript-button",
+ },
+ dom.button(
+ {
+ className:
+ "default-button default-button--micro " +
+ "qa-temporary-extension-terminate-bgscript-button",
+ onClick: e => this.terminateBackgroundScript(),
+ },
+ "Terminate Background Script"
+ )
+ );
+ }
+
+ renderRemoveButton() {
+ return Localized(
+ {
+ id: "about-debugging-tmp-extension-remove-button",
+ },
+ dom.button(
+ {
+ className:
+ "default-button default-button--micro " +
+ "qa-temporary-extension-remove-button",
+ onClick: e => this.remove(),
+ },
+ "Remove"
+ )
+ );
+ }
+
+ render() {
+ return [
+ dom.div(
+ {
+ className: "toolbar toolbar--right-align",
+ key: "actions",
+ },
+ this.renderTerminateBackgroundScriptButton(),
+ Localized(
+ {
+ id: "about-debugging-tmp-extension-reload-button",
+ },
+ dom.button(
+ {
+ className:
+ "default-button default-button--micro " +
+ "qa-temporary-extension-reload-button",
+ onClick: e => this.reload(),
+ },
+ "Reload"
+ )
+ ),
+ this.renderRemoveButton()
+ ),
+ this.renderReloadError(),
+ this.renderTerminateBackgroundScriptError(),
+ ];
+ }
+}
+
+module.exports = TemporaryExtensionAdditionalActions;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionDetail.js b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionDetail.js
new file mode 100644
index 0000000000..6c589472d6
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionDetail.js
@@ -0,0 +1,67 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const ExtensionDetail = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/ExtensionDetail.js")
+);
+const FieldPair = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.js")
+);
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+const TEMP_ID_DOC_URL =
+ "https://developer.mozilla.org/Add-ons/WebExtensions/WebExtensions_and_the_Add-on_ID";
+
+/**
+ * This component displays detail information for a temporary extension.
+ */
+class TemporaryExtensionDetail extends PureComponent {
+ static get propTypes() {
+ return {
+ // Provided by wrapping the component with FluentReact.withLocalization.
+ getString: PropTypes.func.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ renderTemporaryIdMessage() {
+ return Localized(
+ {
+ id: "about-debugging-tmp-extension-temporary-id",
+ a: dom.a({
+ className: "qa-temporary-id-link",
+ href: TEMP_ID_DOC_URL,
+ target: "_blank",
+ }),
+ },
+ dom.div({
+ className: "qa-temporary-id-message",
+ })
+ );
+ }
+
+ render() {
+ return ExtensionDetail(
+ {
+ target: this.props.target,
+ },
+ FieldPair({ label: this.renderTemporaryIdMessage() })
+ );
+ }
+}
+
+module.exports = FluentReact.withLocalization(TemporaryExtensionDetail);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.css b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.css
new file mode 100644
index 0000000000..9166a3b615
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.css
@@ -0,0 +1,8 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.temporary-extension-install-section__toolbar {
+ display: flex;
+ justify-content: end;
+}
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.js b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.js
new file mode 100644
index 0000000000..f85618f73d
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstallSection.js
@@ -0,0 +1,101 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const DetailsLog = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/DetailsLog.js")
+);
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+const TemporaryExtensionInstaller = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js")
+);
+
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component provides an installer and error message area for temporary extension.
+ */
+class TemporaryExtensionInstallSection extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ temporaryInstallError: PropTypes.object,
+ };
+ }
+
+ renderError() {
+ const { temporaryInstallError } = this.props;
+
+ if (!temporaryInstallError) {
+ return null;
+ }
+
+ const errorMessages = [
+ temporaryInstallError.message,
+ ...(temporaryInstallError.additionalErrors || []),
+ ];
+
+ const errors = errorMessages.map((message, index) => {
+ return dom.p(
+ {
+ className: "technical-text",
+ key: "tmp-extension-install-error-" + index,
+ },
+ message
+ );
+ });
+
+ return Message(
+ {
+ level: MESSAGE_LEVEL.ERROR,
+ className: "qa-tmp-extension-install-error",
+ isCloseable: true,
+ },
+ Localized(
+ {
+ id: "about-debugging-tmp-extension-install-error",
+ },
+ dom.p({}, "about-debugging-tmp-extension-install-error")
+ ),
+ DetailsLog(
+ {
+ type: MESSAGE_LEVEL.ERROR,
+ },
+ errors
+ )
+ );
+ }
+
+ render() {
+ const { dispatch } = this.props;
+
+ return dom.section(
+ {},
+ dom.div(
+ {
+ className: "temporary-extension-install-section__toolbar",
+ },
+ TemporaryExtensionInstaller({ dispatch })
+ ),
+ this.renderError()
+ );
+ }
+}
+
+module.exports = TemporaryExtensionInstallSection;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js
new file mode 100644
index 0000000000..e515c647ec
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js
@@ -0,0 +1,52 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+/**
+ * This component provides an installer for temporary extension.
+ */
+class TemporaryExtensionInstaller extends PureComponent {
+ static get propTypes() {
+ return {
+ className: PropTypes.string,
+ dispatch: PropTypes.func.isRequired,
+ };
+ }
+
+ install() {
+ this.props.dispatch(Actions.installTemporaryExtension());
+ }
+
+ render() {
+ const { className } = this.props;
+
+ return Localized(
+ {
+ id: "about-debugging-tmp-extension-install-button",
+ },
+ dom.button(
+ {
+ className: `${className} default-button qa-temporary-extension-install-button`,
+ onClick: e => this.install(),
+ },
+ "Load Temporary Add-on…"
+ )
+ );
+ }
+}
+
+module.exports = TemporaryExtensionInstaller;
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/WorkerDetail.js b/devtools/client/aboutdebugging/src/components/debugtarget/WorkerDetail.js
new file mode 100644
index 0000000000..b69252c430
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/WorkerDetail.js
@@ -0,0 +1,120 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ SERVICE_WORKER_FETCH_STATES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const FieldPair = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/debugtarget/FieldPair.js")
+);
+
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+
+/**
+ * This component displays detail information for worker.
+ */
+class WorkerDetail extends PureComponent {
+ static get propTypes() {
+ return {
+ // Provided by wrapping the component with FluentReact.withLocalization.
+ getString: PropTypes.func.isRequired,
+ target: Types.debugTarget.isRequired,
+ };
+ }
+
+ renderFetch() {
+ const { fetch } = this.props.target.details;
+ const isListening = fetch === SERVICE_WORKER_FETCH_STATES.LISTENING;
+ const localizationId = isListening
+ ? "about-debugging-worker-fetch-listening"
+ : "about-debugging-worker-fetch-not-listening";
+
+ return Localized(
+ {
+ id: localizationId,
+ attrs: {
+ label: true,
+ value: true,
+ },
+ },
+ FieldPair({
+ className: isListening
+ ? "qa-worker-fetch-listening"
+ : "qa-worker-fetch-not-listening",
+ label: "Fetch",
+ slug: "fetch",
+ value: "about-debugging-worker-fetch-value",
+ })
+ );
+ }
+
+ renderPushService() {
+ const { pushServiceEndpoint } = this.props.target.details;
+
+ return Localized(
+ {
+ id: "about-debugging-worker-push-service",
+ attrs: { label: true },
+ },
+ FieldPair({
+ slug: "push-service",
+ label: "Push Service",
+ value: dom.span(
+ {
+ className: "qa-worker-push-service-value",
+ },
+ pushServiceEndpoint
+ ),
+ })
+ );
+ }
+
+ renderScope() {
+ const { scope } = this.props.target.details;
+
+ return Localized(
+ {
+ id: "about-debugging-worker-scope",
+ attrs: { label: true },
+ },
+ FieldPair({
+ slug: "scope",
+ label: "Scope",
+ value: scope,
+ })
+ );
+ }
+
+ render() {
+ const { fetch, pushServiceEndpoint, scope } = this.props.target.details;
+
+ const isEmptyList = !pushServiceEndpoint && !fetch && !scope && !status;
+
+ return dom.dl(
+ {
+ className:
+ "debug-target-item__detail" +
+ (isEmptyList ? " debug-target-item__detail--empty" : ""),
+ },
+ pushServiceEndpoint ? this.renderPushService() : null,
+ fetch ? this.renderFetch() : null,
+ scope ? this.renderScope() : null
+ );
+ }
+}
+
+module.exports = FluentReact.withLocalization(WorkerDetail);
diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/moz.build b/devtools/client/aboutdebugging/src/components/debugtarget/moz.build
new file mode 100644
index 0000000000..981e6887a2
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/debugtarget/moz.build
@@ -0,0 +1,22 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "DebugTargetItem.js",
+ "DebugTargetList.js",
+ "DebugTargetPane.js",
+ "ExtensionDetail.js",
+ "FieldPair.js",
+ "InspectAction.js",
+ "ProcessDetail.js",
+ "ServiceWorkerAction.js",
+ "ServiceWorkerAdditionalActions.js",
+ "TabAction.js",
+ "TabDetail.js",
+ "TemporaryExtensionAdditionalActions.js",
+ "TemporaryExtensionDetail.js",
+ "TemporaryExtensionInstaller.js",
+ "TemporaryExtensionInstallSection.js",
+ "WorkerDetail.js",
+)
diff --git a/devtools/client/aboutdebugging/src/components/moz.build b/devtools/client/aboutdebugging/src/components/moz.build
new file mode 100644
index 0000000000..c48d384b3d
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/moz.build
@@ -0,0 +1,21 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "connect",
+ "debugtarget",
+ "shared",
+ "sidebar",
+]
+
+DevToolsModules(
+ "App.js",
+ "CompatibilityWarning.js",
+ "ConnectionPromptSetting.js",
+ "ProfilerDialog.js",
+ "RuntimeActions.js",
+ "RuntimeInfo.js",
+ "RuntimePage.js",
+ "ServiceWorkersWarning.js",
+)
diff --git a/devtools/client/aboutdebugging/src/components/shared/DetailsLog.js b/devtools/client/aboutdebugging/src/components/shared/DetailsLog.js
new file mode 100644
index 0000000000..f10c8a487d
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/shared/DetailsLog.js
@@ -0,0 +1,64 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component is designed to wrap a warning / error log message
+ * in the details tag to hide long texts and make the message expendable
+ * out of the box.
+ */
+class DetailsLog extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node.isRequired,
+ type: PropTypes.string,
+ };
+ }
+ getLocalizationString() {
+ const { type } = this.props;
+
+ switch (type) {
+ case MESSAGE_LEVEL.WARNING:
+ return "about-debugging-message-details-label-warning";
+ case MESSAGE_LEVEL.ERROR:
+ return "about-debugging-message-details-label-error";
+ default:
+ return "about-debugging-message-details-label";
+ }
+ }
+
+ render() {
+ const { children } = this.props;
+
+ return dom.details(
+ {
+ className: "details--log",
+ },
+ Localized(
+ {
+ id: this.getLocalizationString(),
+ },
+ dom.summary({}, this.getLocalizationString())
+ ),
+ children
+ );
+ }
+}
+
+module.exports = DetailsLog;
diff --git a/devtools/client/aboutdebugging/src/components/shared/IconLabel.css b/devtools/client/aboutdebugging/src/components/shared/IconLabel.css
new file mode 100644
index 0000000000..ddb7c3929a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/shared/IconLabel.css
@@ -0,0 +1,27 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.icon-label {
+ display: flex;
+ column-gap: var(--base-unit);
+ align-items: center;
+ margin: calc(var(--base-unit) * 2) 0;
+ -moz-context-properties: fill;
+
+ font-size: var(--icon-label-font-size);
+}
+
+.icon-label--ok {
+ --icon-color: var(--icon-ok-color);
+}
+.icon-label--info {
+ --icon-color: var(--icon-info-color);
+}
+
+.icon-label__icon {
+ padding: var(--base-unit);
+ fill: var(--icon-color);
+ width: calc(var(--base-unit) * 4);
+ height: calc(var(--base-unit) * 4);
+}
diff --git a/devtools/client/aboutdebugging/src/components/shared/IconLabel.js b/devtools/client/aboutdebugging/src/components/shared/IconLabel.js
new file mode 100644
index 0000000000..3141e75640
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/shared/IconLabel.js
@@ -0,0 +1,48 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ ICON_LABEL_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const ICONS = {
+ [ICON_LABEL_LEVEL.INFO]: "chrome://devtools/skin/images/info.svg",
+ [ICON_LABEL_LEVEL.OK]: "chrome://devtools/skin/images/check.svg",
+};
+
+/* This component displays an icon accompanied by some content. It's similar
+ to a message, but it's not interactive */
+class IconLabel extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ level: PropTypes.oneOf(Object.values(ICON_LABEL_LEVEL)).isRequired,
+ };
+ }
+
+ render() {
+ const { children, className, level } = this.props;
+ return dom.span(
+ {
+ className: `icon-label icon-label--${level} ${className || ""}`,
+ },
+ dom.img({
+ className: "icon-label__icon",
+ src: ICONS[level],
+ }),
+ children
+ );
+ }
+}
+
+module.exports = IconLabel;
diff --git a/devtools/client/aboutdebugging/src/components/shared/Message.css b/devtools/client/aboutdebugging/src/components/shared/Message.css
new file mode 100644
index 0000000000..e2c71c50b4
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/shared/Message.css
@@ -0,0 +1,79 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.message--level-error {
+ --message-background-color: var(--error-background);
+ --message-border-color: var(--error-border);
+ --message-color: var(--error-text);
+ --message-icon-color: var(--error-icon);
+}
+
+.message--level-info {
+ --message-background-color: var(--grey-20);
+ --message-border-color: transparent;
+ --message-color: var(--grey-90);
+ --message-icon-color: var(--grey-90);
+}
+
+.message--level-warning {
+ --message-background-color: var(--warning-background);
+ --message-border-color: var(--warning-border);
+ --message-color: var(--warning-text);
+ --message-icon-color: var(--warning-icon);
+}
+
+/*
+ * Layout of the message
+ *
+ * +--------+-----------------+----------+
+ * | Icon | Message content | closing |
+ * | | (several lines) | button |
+ * | | ( ... ) |(optional)|
+ * +--------+-----------------+----------+
+ */
+.message {
+ background-color: var(--message-background-color);
+ border: 1px solid var(--message-border-color);
+ border-radius: var(--base-unit);
+ color: var(--message-color);
+ display: grid;
+ grid-column-gap: var(--base-unit);
+ grid-template-columns: calc(var(--base-unit) * 6) 1fr auto;
+ grid-template-areas:
+ "icon body button";
+ margin: calc(var(--base-unit) * 2) 0;
+ padding: var(--base-unit);
+ -moz-context-properties: fill;
+}
+
+.message__icon {
+ margin: var(--base-unit);
+ fill: var(--message-icon-color);
+ grid-area: icon;
+}
+
+.message__body {
+ align-self: center;
+ font-size: var(--message-font-size);
+ font-weight: 400;
+ grid-area: body;
+ line-height: 1.6;
+}
+
+.message__button {
+ grid-area: button;
+ fill: var(--message-icon-color);
+}
+
+.message__button:hover {
+ /* reverse colors with icon when hover state */
+ background-color: var(--message-icon-color);
+ fill: var(--message-background-color);
+}
+
+.message__button:active {
+ /* reverse colors with text when active state */
+ background-color: var(--message-color);
+ fill: var(--message-background-color);
+}
diff --git a/devtools/client/aboutdebugging/src/components/shared/Message.js b/devtools/client/aboutdebugging/src/components/shared/Message.js
new file mode 100644
index 0000000000..248db58dd3
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/shared/Message.js
@@ -0,0 +1,109 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const ICONS = {
+ [MESSAGE_LEVEL.ERROR]:
+ "chrome://devtools/skin/images/aboutdebugging-error.svg",
+ [MESSAGE_LEVEL.INFO]:
+ "chrome://devtools/skin/images/aboutdebugging-information.svg",
+ [MESSAGE_LEVEL.WARNING]: "chrome://devtools/skin/images/alert.svg",
+};
+const CLOSE_ICON_SRC = "chrome://devtools/skin/images/close.svg";
+
+/**
+ * This component is designed to display a photon-style message bar. The component is
+ * responsible for displaying the message container with the appropriate icon. The content
+ * of the message should be passed as the children of this component.
+ */
+class Message extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ isCloseable: PropTypes.bool,
+ level: PropTypes.oneOf(Object.values(MESSAGE_LEVEL)).isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ isClosed: false,
+ };
+ }
+
+ closeMessage() {
+ this.setState({ isClosed: true });
+ }
+
+ renderButton(level) {
+ return dom.button(
+ {
+ className:
+ `ghost-button message__button message__button--${level} ` +
+ `qa-message-button-close-button`,
+ onClick: () => this.closeMessage(),
+ },
+ Localized(
+ {
+ id: "about-debugging-message-close-icon",
+ attrs: {
+ alt: true,
+ },
+ },
+ dom.img({
+ className: "qa-message-button-close-icon",
+ src: CLOSE_ICON_SRC,
+ })
+ )
+ );
+ }
+
+ render() {
+ const { children, className, level, isCloseable } = this.props;
+ const { isClosed } = this.state;
+
+ if (isClosed) {
+ return null;
+ }
+
+ return dom.aside(
+ {
+ className:
+ `message message--level-${level} qa-message` +
+ (className ? ` ${className}` : ""),
+ },
+ dom.img({
+ className: "message__icon",
+ src: ICONS[level],
+ }),
+ dom.div(
+ {
+ className: "message__body",
+ },
+ children
+ ),
+ // if the message is closeable, render a closing button
+ isCloseable ? this.renderButton(level) : null
+ );
+ }
+}
+
+module.exports = Message;
diff --git a/devtools/client/aboutdebugging/src/components/shared/moz.build b/devtools/client/aboutdebugging/src/components/shared/moz.build
new file mode 100644
index 0000000000..7e0e89f2a0
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/shared/moz.build
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "DetailsLog.js",
+ "IconLabel.js",
+ "Message.js",
+)
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/RefreshDevicesButton.js b/devtools/client/aboutdebugging/src/components/sidebar/RefreshDevicesButton.js
new file mode 100644
index 0000000000..78ebb61661
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/RefreshDevicesButton.js
@@ -0,0 +1,46 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+class RefreshDevicesButton extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ isScanning: PropTypes.bool.isRequired,
+ };
+ }
+
+ refreshDevices() {
+ this.props.dispatch(Actions.scanUSBRuntimes());
+ }
+
+ render() {
+ return Localized(
+ { id: "about-debugging-refresh-usb-devices-button" },
+ dom.button(
+ {
+ className: "default-button qa-refresh-devices-button",
+ disabled: this.props.isScanning,
+ onClick: () => this.refreshDevices(),
+ },
+ "Refresh devices"
+ )
+ );
+ }
+}
+
+module.exports = RefreshDevicesButton;
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/Sidebar.css b/devtools/client/aboutdebugging/src/components/sidebar/Sidebar.css
new file mode 100644
index 0000000000..afad630f6e
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/Sidebar.css
@@ -0,0 +1,43 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.sidebar {
+ display: grid;
+ grid-template-rows: auto auto;
+}
+
+.sidebar__label {
+ color: var(--secondary-text-color);
+ display: block;
+ padding: 12px 0;
+ text-align: center;
+ font-size: var(--message-font-size);
+}
+
+.sidebar__adb-status {
+ margin-block-end: calc(var(--base-unit) * 2);
+}
+
+.sidebar__refresh-usb {
+ text-align: center;
+}
+
+.sidebar__footer {
+ align-self: flex-end;
+}
+
+.sidebar__footer__support-help {
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ column-gap: calc(var(--base-unit) * 4);
+ height: 100%;
+}
+
+.sidebar__footer__icon {
+ width: calc(var(--base-unit) * 4);
+ height: calc(var(--base-unit) * 4);
+ -moz-context-properties: fill;
+ fill: currentColor;
+}
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/Sidebar.js b/devtools/client/aboutdebugging/src/components/sidebar/Sidebar.js
new file mode 100644
index 0000000000..3213b8141c
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/Sidebar.js
@@ -0,0 +1,259 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ ICON_LABEL_LEVEL,
+ PAGE_TYPES,
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const Types = require("resource://devtools/client/aboutdebugging/src/types/index.js");
+loader.lazyRequireGetter(
+ this,
+ "ADB_ADDON_STATES",
+ "resource://devtools/client/shared/remote-debugging/adb/adb-addon.js",
+ true
+);
+
+const IconLabel = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/IconLabel.js")
+);
+const SidebarItem = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.js")
+);
+const SidebarFixedItem = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.js")
+);
+const SidebarRuntimeItem = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.js")
+);
+const RefreshDevicesButton = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/RefreshDevicesButton.js")
+);
+const FIREFOX_ICON =
+ "chrome://devtools/skin/images/aboutdebugging-firefox-logo.svg";
+const CONNECT_ICON = "chrome://devtools/skin/images/settings.svg";
+const GLOBE_ICON =
+ "chrome://devtools/skin/images/aboutdebugging-globe-icon.svg";
+const USB_ICON =
+ "chrome://devtools/skin/images/aboutdebugging-connect-icon.svg";
+
+class Sidebar extends PureComponent {
+ static get propTypes() {
+ return {
+ adbAddonStatus: Types.adbAddonStatus,
+ className: PropTypes.string,
+ dispatch: PropTypes.func.isRequired,
+ isAdbReady: PropTypes.bool.isRequired,
+ isScanningUsb: PropTypes.bool.isRequired,
+ networkRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
+ selectedPage: Types.page,
+ selectedRuntimeId: PropTypes.string,
+ usbRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
+ };
+ }
+
+ renderAdbStatus() {
+ const isUsbEnabled =
+ this.props.isAdbReady &&
+ this.props.adbAddonStatus === ADB_ADDON_STATES.INSTALLED;
+ const localizationId = isUsbEnabled
+ ? "about-debugging-sidebar-usb-enabled"
+ : "about-debugging-sidebar-usb-disabled";
+ return IconLabel(
+ {
+ level: isUsbEnabled ? ICON_LABEL_LEVEL.OK : ICON_LABEL_LEVEL.INFO,
+ },
+ Localized(
+ {
+ id: localizationId,
+ },
+ dom.span(
+ {
+ className: "qa-sidebar-usb-status",
+ },
+ localizationId
+ )
+ )
+ );
+ }
+
+ renderDevicesEmpty() {
+ return SidebarItem(
+ {},
+ Localized(
+ {
+ id: "about-debugging-sidebar-no-devices",
+ },
+ dom.aside(
+ {
+ className: "sidebar__label qa-sidebar-no-devices",
+ },
+ "No devices discovered"
+ )
+ )
+ );
+ }
+
+ renderDevices() {
+ const { networkRuntimes, usbRuntimes } = this.props;
+
+ // render a "no devices" messages when the lists are empty
+ if (!networkRuntimes.length && !usbRuntimes.length) {
+ return this.renderDevicesEmpty();
+ }
+ // render all devices otherwise
+ return [
+ ...this.renderRuntimeItems(GLOBE_ICON, networkRuntimes),
+ ...this.renderRuntimeItems(USB_ICON, usbRuntimes),
+ ];
+ }
+
+ renderRuntimeItems(icon, runtimes) {
+ const { dispatch, selectedPage, selectedRuntimeId } = this.props;
+
+ return runtimes.map(runtime => {
+ const keyId = `${runtime.type}-${runtime.id}`;
+ const runtimeHasDetails = !!runtime.runtimeDetails;
+ const isSelected =
+ selectedPage === PAGE_TYPES.RUNTIME && runtime.id === selectedRuntimeId;
+
+ let name = runtime.name;
+ if (runtime.type === RUNTIMES.USB && runtimeHasDetails) {
+ // Update the name to be same to the runtime page.
+ name = runtime.runtimeDetails.info.name;
+ }
+
+ return SidebarRuntimeItem({
+ deviceName: runtime.extra.deviceName,
+ dispatch,
+ icon,
+ key: keyId,
+ isConnected: runtimeHasDetails,
+ isConnecting: runtime.isConnecting,
+ isConnectionFailed: runtime.isConnectionFailed,
+ isConnectionNotResponding: runtime.isConnectionNotResponding,
+ isConnectionTimeout: runtime.isConnectionTimeout,
+ isSelected,
+ isUnavailable: runtime.isUnavailable,
+ isUnplugged: runtime.isUnplugged,
+ name,
+ runtimeId: runtime.id,
+ });
+ });
+ }
+
+ renderFooter() {
+ const HELP_ICON_SRC = "chrome://global/skin/icons/help.svg";
+ const SUPPORT_URL =
+ "https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/";
+
+ return dom.footer(
+ {
+ className: "sidebar__footer",
+ },
+ dom.ul(
+ {},
+ SidebarItem(
+ {
+ className: "sidebar-item--condensed",
+ to: SUPPORT_URL,
+ },
+ dom.span(
+ {
+ className: "sidebar__footer__support-help",
+ },
+ Localized(
+ {
+ id: "about-debugging-sidebar-support-icon",
+ attrs: {
+ alt: true,
+ },
+ },
+ dom.img({
+ className: "sidebar__footer__icon",
+ src: HELP_ICON_SRC,
+ })
+ ),
+ Localized(
+ {
+ id: "about-debugging-sidebar-support",
+ },
+ dom.span({}, "about-debugging-sidebar-support")
+ )
+ )
+ )
+ )
+ );
+ }
+
+ render() {
+ const { dispatch, selectedPage, selectedRuntimeId, isScanningUsb } =
+ this.props;
+
+ return dom.aside(
+ {
+ className: `sidebar ${this.props.className || ""}`,
+ },
+ dom.ul(
+ {},
+ Localized(
+ { id: "about-debugging-sidebar-setup", attrs: { name: true } },
+ SidebarFixedItem({
+ dispatch,
+ icon: CONNECT_ICON,
+ isSelected: PAGE_TYPES.CONNECT === selectedPage,
+ key: PAGE_TYPES.CONNECT,
+ name: "Setup",
+ to: "/setup",
+ })
+ ),
+ Localized(
+ { id: "about-debugging-sidebar-this-firefox", attrs: { name: true } },
+ SidebarFixedItem({
+ icon: FIREFOX_ICON,
+ isSelected:
+ PAGE_TYPES.RUNTIME === selectedPage &&
+ selectedRuntimeId === RUNTIMES.THIS_FIREFOX,
+ key: RUNTIMES.THIS_FIREFOX,
+ name: "This Firefox",
+ to: `/runtime/${RUNTIMES.THIS_FIREFOX}`,
+ })
+ ),
+ SidebarItem(
+ {
+ className: "sidebar__adb-status",
+ },
+ dom.hr({ className: "separator separator--breathe" }),
+ this.renderAdbStatus()
+ ),
+ this.renderDevices(),
+ SidebarItem(
+ {
+ className: "sidebar-item--breathe sidebar__refresh-usb",
+ key: "refresh-devices",
+ },
+ RefreshDevicesButton({
+ dispatch,
+ isScanning: isScanningUsb,
+ })
+ )
+ ),
+ this.renderFooter()
+ );
+ }
+}
+
+module.exports = Sidebar;
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.css b/devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.css
new file mode 100644
index 0000000000..7345b8e80f
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.css
@@ -0,0 +1,29 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * Layout of a fixed sidebar item
+ *
+ * +--------+----------------+
+ * | Icon | Name |
+ * +--------+----------------+
+ */
+
+.sidebar-fixed-item__container {
+ align-items: center;
+ border-radius: 2px;
+ display: grid;
+ grid-template-columns: 34px 1fr;
+ height: 100%;
+ font-size: var(--body-20-font-size);
+ font-weight: var(--body-20-font-weight);
+}
+
+.sidebar-fixed-item__icon {
+ fill: currentColor;
+ height: 24px;
+ margin-inline-end: 9px;
+ width: 24px;
+ -moz-context-properties: fill;
+}
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.js b/devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.js
new file mode 100644
index 0000000000..cf5dbab31a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/SidebarFixedItem.js
@@ -0,0 +1,60 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const SidebarItem = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.js")
+);
+
+/**
+ * This component displays a fixed item in the Sidebar component.
+ */
+class SidebarFixedItem extends PureComponent {
+ static get propTypes() {
+ return {
+ icon: PropTypes.string.isRequired,
+ isSelected: PropTypes.bool.isRequired,
+ name: PropTypes.string.isRequired,
+ to: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { icon, isSelected, name, to } = this.props;
+
+ return SidebarItem(
+ {
+ className: "sidebar-item--tall",
+ isSelected,
+ to,
+ },
+ dom.div(
+ {
+ className: "sidebar-fixed-item__container",
+ },
+ dom.img({
+ className: "sidebar-fixed-item__icon",
+ src: icon,
+ }),
+ dom.span(
+ {
+ className: "ellipsis-text",
+ title: name,
+ },
+ name
+ )
+ )
+ );
+ }
+}
+
+module.exports = SidebarFixedItem;
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.css b/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.css
new file mode 100644
index 0000000000..3f12964012
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.css
@@ -0,0 +1,71 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.sidebar-item {
+ color: var(--sidebar-text-color);
+ border-radius: 2px;
+ padding-inline-end: var(--category-padding);
+ padding-inline-start: var(--category-padding);
+ transition: background-color var(--category-transition-duration);
+ user-select: none;
+}
+
+.sidebar-item--tall {
+ height: var(--category-height);
+}
+
+.sidebar-item--condensed {
+ height: calc(var(--base-unit) * 9);
+}
+
+.sidebar-item__link {
+ display: block;
+ height: 100%;
+}
+
+.sidebar-item__link,
+.sidebar-item__link:hover {
+ color: inherit; /* do not apply usual link colors, but grab this element parent's */
+}
+
+.sidebar-item:not(.sidebar-item--selectable) {
+ color: var(--secondary-text-color);
+}
+
+.sidebar-item--selectable:hover {
+ background-color: var(--sidebar-background-hover);
+}
+
+.sidebar-item--selected {
+ color: var(--sidebar-selected-color);
+}
+
+.sidebar-item--breathe {
+ margin-block-start: calc(6 * var(--base-unit));
+ margin-block-end: calc(2 * var(--base-unit));
+}
+
+@media (prefers-contrast) {
+ /* Color transitions (black <-> white) look bad in high contrast */
+ .sidebar-item {
+ transition: background 0s;
+ }
+
+ .sidebar-item--selected,
+ .sidebar-item--selected:hover {
+ background-color: ButtonText;
+ }
+
+ /* `color: inherit` should not be used in high contrast mode
+ otherwise the link inherits the <a> color from ua.css */
+ .sidebar-item__link,
+ .sidebar-item__link:hover {
+ color: ButtonText;
+ }
+
+ .sidebar-item--selected .sidebar-item__link,
+ .sidebar-item--selected .sidebar-item__link:hover {
+ color: ButtonFace;
+ }
+}
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.js b/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.js
new file mode 100644
index 0000000000..cd17d8e6bc
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.js
@@ -0,0 +1,81 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const Link = createFactory(
+ require("resource://devtools/client/shared/vendor/react-router-dom.js").Link
+);
+
+/**
+ * This component is used as a wrapper by items in the sidebar.
+ */
+class SidebarItem extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ isSelected: PropTypes.bool.isRequired,
+ to: PropTypes.string,
+ };
+ }
+
+ static get defaultProps() {
+ return {
+ isSelected: false,
+ };
+ }
+
+ renderContent() {
+ const { children, to } = this.props;
+
+ if (to) {
+ const isExternalUrl = /^http/.test(to);
+
+ return isExternalUrl
+ ? dom.a(
+ {
+ className: "sidebar-item__link undecorated-link",
+ href: to,
+ target: "_blank",
+ },
+ children
+ )
+ : Link(
+ {
+ className: "sidebar-item__link qa-sidebar-link undecorated-link",
+ to,
+ },
+ children
+ );
+ }
+
+ return children;
+ }
+
+ render() {
+ const { className, isSelected, to } = this.props;
+
+ return dom.li(
+ {
+ className:
+ "sidebar-item qa-sidebar-item" +
+ (className ? ` ${className}` : "") +
+ (isSelected
+ ? " sidebar-item--selected qa-sidebar-item-selected"
+ : "") +
+ (to ? " sidebar-item--selectable" : ""),
+ },
+ this.renderContent()
+ );
+ }
+}
+
+module.exports = SidebarItem;
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.css b/devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.css
new file mode 100644
index 0000000000..423723a27f
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.css
@@ -0,0 +1,41 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * Layout of a runtime sidebar item
+ *
+ * +--------+----------------+---------------------------+
+ * | Icon | Runtime name | Connect button |
+ * +--------+----------------+---------------------------+
+ */
+
+.sidebar-runtime-item__container {
+ box-sizing: border-box;
+ height: var(--category-height);
+ align-items: center;
+ display: grid;
+ grid-column-gap: var(--base-unit);
+ grid-template-columns: calc(var(--base-unit) * 6) 1fr auto;
+ font-size: var(--body-20-font-size);
+ font-weight: var(--body-20-font-weight);
+}
+
+.sidebar-runtime-item__icon {
+ fill: currentColor;
+ -moz-context-properties: fill;
+}
+
+.sidebar-runtime-item__runtime {
+ line-height: 1;
+}
+
+.sidebar-runtime-item__runtime__details {
+ font-size: var(--caption-10-font-size);
+ font-weight: var(--caption-10-font-weight);
+ line-height: 1.2;
+}
+
+.sidebar-runtime-item__message:first-of-type {
+ margin-block-start: calc(var(--base-unit) * -1);
+}
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.js b/devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.js
new file mode 100644
index 0000000000..a5c5fe6d55
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/SidebarRuntimeItem.js
@@ -0,0 +1,216 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Message = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+const SidebarItem = createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.js")
+);
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This component displays a runtime item of the Sidebar component.
+ */
+class SidebarRuntimeItem extends PureComponent {
+ static get propTypes() {
+ return {
+ deviceName: PropTypes.string,
+ dispatch: PropTypes.func.isRequired,
+ // Provided by wrapping the component with FluentReact.withLocalization.
+ getString: PropTypes.func.isRequired,
+ icon: PropTypes.string.isRequired,
+ isConnected: PropTypes.bool.isRequired,
+ isConnecting: PropTypes.bool.isRequired,
+ isConnectionFailed: PropTypes.bool.isRequired,
+ isConnectionNotResponding: PropTypes.bool.isRequired,
+ isConnectionTimeout: PropTypes.bool.isRequired,
+ isSelected: PropTypes.bool.isRequired,
+ isUnavailable: PropTypes.bool.isRequired,
+ isUnplugged: PropTypes.bool.isRequired,
+ name: PropTypes.string.isRequired,
+ runtimeId: PropTypes.string.isRequired,
+ };
+ }
+
+ renderConnectButton() {
+ const { isConnecting } = this.props;
+ const localizationId = isConnecting
+ ? "about-debugging-sidebar-item-connect-button-connecting"
+ : "about-debugging-sidebar-item-connect-button";
+ return Localized(
+ {
+ id: localizationId,
+ },
+ dom.button(
+ {
+ className: "default-button default-button--micro qa-connect-button",
+ disabled: isConnecting,
+ onClick: () => {
+ const { dispatch, runtimeId } = this.props;
+ dispatch(Actions.connectRuntime(runtimeId));
+ },
+ },
+ localizationId
+ )
+ );
+ }
+
+ renderMessage(flag, level, localizationId, className) {
+ if (!flag) {
+ return null;
+ }
+
+ return Message(
+ {
+ level,
+ className: `${className} sidebar-runtime-item__message`,
+ isCloseable: true,
+ },
+ Localized(
+ {
+ id: localizationId,
+ },
+ dom.p({ className: "word-wrap-anywhere" }, localizationId)
+ )
+ );
+ }
+
+ renderName() {
+ const { deviceName, getString, isUnavailable, isUnplugged, name } =
+ this.props;
+
+ let displayName, qaClassName;
+ if (isUnplugged) {
+ displayName = getString("about-debugging-sidebar-runtime-item-unplugged");
+ qaClassName = "qa-runtime-item-unplugged";
+ } else if (isUnavailable) {
+ displayName = getString(
+ "about-debugging-sidebar-runtime-item-waiting-for-browser"
+ );
+ qaClassName = "qa-runtime-item-waiting-for-browser";
+ } else {
+ displayName = name;
+ qaClassName = "qa-runtime-item-standard";
+ }
+
+ const localizationId = deviceName
+ ? "about-debugging-sidebar-runtime-item-name"
+ : "about-debugging-sidebar-runtime-item-name-no-device";
+
+ const className = "ellipsis-text sidebar-runtime-item__runtime";
+
+ function renderWithDevice() {
+ return dom.span(
+ {
+ className,
+ title: localizationId,
+ },
+ deviceName,
+ dom.br({}),
+ dom.span(
+ {
+ className: `sidebar-runtime-item__runtime__details ${qaClassName}`,
+ },
+ displayName
+ )
+ );
+ }
+
+ function renderNoDevice() {
+ return dom.span(
+ {
+ className,
+ title: localizationId,
+ },
+ displayName
+ );
+ }
+
+ return Localized(
+ {
+ id: localizationId,
+ attrs: { title: true },
+ $deviceName: deviceName,
+ $displayName: displayName,
+ },
+ deviceName ? renderWithDevice() : renderNoDevice()
+ );
+ }
+
+ render() {
+ const {
+ getString,
+ icon,
+ isConnected,
+ isConnectionFailed,
+ isConnectionTimeout,
+ isConnectionNotResponding,
+ isSelected,
+ isUnavailable,
+ runtimeId,
+ } = this.props;
+
+ const connectionStatus = isConnected
+ ? getString("aboutdebugging-sidebar-runtime-connection-status-connected")
+ : getString(
+ "aboutdebugging-sidebar-runtime-connection-status-disconnected"
+ );
+
+ return SidebarItem(
+ {
+ isSelected,
+ to: isConnected ? `/runtime/${encodeURIComponent(runtimeId)}` : null,
+ },
+ dom.section(
+ {
+ className: "sidebar-runtime-item__container",
+ },
+ dom.img({
+ className: "sidebar-runtime-item__icon ",
+ src: icon,
+ alt: connectionStatus,
+ title: connectionStatus,
+ }),
+ this.renderName(),
+ !isUnavailable && !isConnected ? this.renderConnectButton() : null
+ ),
+ this.renderMessage(
+ isConnectionFailed,
+ MESSAGE_LEVEL.ERROR,
+ "about-debugging-sidebar-item-connect-button-connection-failed",
+ "qa-connection-error"
+ ),
+ this.renderMessage(
+ isConnectionTimeout,
+ MESSAGE_LEVEL.ERROR,
+ "about-debugging-sidebar-item-connect-button-connection-timeout",
+ "qa-connection-timeout"
+ ),
+ this.renderMessage(
+ isConnectionNotResponding,
+ MESSAGE_LEVEL.WARNING,
+ "about-debugging-sidebar-item-connect-button-connection-not-responding",
+ "qa-connection-not-responding"
+ )
+ );
+ }
+}
+
+module.exports = FluentReact.withLocalization(SidebarRuntimeItem);
diff --git a/devtools/client/aboutdebugging/src/components/sidebar/moz.build b/devtools/client/aboutdebugging/src/components/sidebar/moz.build
new file mode 100644
index 0000000000..081ea2a848
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/components/sidebar/moz.build
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "RefreshDevicesButton.js",
+ "Sidebar.js",
+ "SidebarFixedItem.js",
+ "SidebarItem.js",
+ "SidebarRuntimeItem.js",
+)
diff --git a/devtools/client/aboutdebugging/src/constants.js b/devtools/client/aboutdebugging/src/constants.js
new file mode 100644
index 0000000000..fa0b847a32
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/constants.js
@@ -0,0 +1,185 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ CONNECTION_TYPES,
+ DEBUG_TARGET_TYPES,
+} = require("resource://devtools/client/shared/remote-debugging/constants.js");
+
+const actionTypes = {
+ ADB_ADDON_INSTALL_START: "ADB_ADDON_INSTALL_START",
+ ADB_ADDON_INSTALL_SUCCESS: "ADB_ADDON_INSTALL_SUCCESS",
+ ADB_ADDON_INSTALL_FAILURE: "ADB_ADDON_INSTALL_FAILURE",
+ ADB_ADDON_UNINSTALL_START: "ADB_ADDON_UNINSTALL_START",
+ ADB_ADDON_UNINSTALL_SUCCESS: "ADB_ADDON_UNINSTALL_SUCCESS",
+ ADB_ADDON_UNINSTALL_FAILURE: "ADB_ADDON_UNINSTALL_FAILURE",
+ ADB_ADDON_STATUS_UPDATED: "ADB_ADDON_STATUS_UPDATED",
+ ADB_READY_UPDATED: "ADB_READY_UPDATED",
+ CONNECT_RUNTIME_CANCEL: "CONNECT_RUNTIME_CANCEL",
+ CONNECT_RUNTIME_FAILURE: "CONNECT_RUNTIME_FAILURE",
+ CONNECT_RUNTIME_NOT_RESPONDING: "CONNECT_RUNTIME_NOT_RESPONDING",
+ CONNECT_RUNTIME_START: "CONNECT_RUNTIME_START",
+ CONNECT_RUNTIME_SUCCESS: "CONNECT_RUNTIME_SUCCESS",
+ DEBUG_TARGET_COLLAPSIBILITY_UPDATED: "DEBUG_TARGET_COLLAPSIBILITY_UPDATED",
+ DISCONNECT_RUNTIME_FAILURE: "DISCONNECT_RUNTIME_FAILURE",
+ DISCONNECT_RUNTIME_START: "DISCONNECT_RUNTIME_START",
+ DISCONNECT_RUNTIME_SUCCESS: "DISCONNECT_RUNTIME_SUCCESS",
+ EXTENSION_BGSCRIPT_STATUS_UPDATED: "EXTENSION_BGSCRIPT_STATUS_UPDATED",
+ HIDE_PROFILER_DIALOG: "HIDE_PROFILER_DIALOG",
+ SWITCH_PROFILER_CONTEXT: "SWITCH_PROFILER_CONTEXT",
+ NETWORK_LOCATIONS_UPDATE_FAILURE: "NETWORK_LOCATIONS_UPDATE_FAILURE",
+ NETWORK_LOCATIONS_UPDATE_START: "NETWORK_LOCATIONS_UPDATE_START",
+ NETWORK_LOCATIONS_UPDATE_SUCCESS: "NETWORK_LOCATIONS_UPDATE_SUCCESS",
+ REMOTE_RUNTIMES_UPDATED: "REMOTE_RUNTIMES_UPDATED",
+ REQUEST_EXTENSIONS_FAILURE: "REQUEST_EXTENSIONS_FAILURE",
+ REQUEST_EXTENSIONS_START: "REQUEST_EXTENSIONS_START",
+ REQUEST_EXTENSIONS_SUCCESS: "REQUEST_EXTENSIONS_SUCCESS",
+ REQUEST_PROCESSES_FAILURE: "REQUEST_PROCESSES_FAILURE",
+ REQUEST_PROCESSES_START: "REQUEST_PROCESSES_START",
+ REQUEST_PROCESSES_SUCCESS: "REQUEST_PROCESSES_SUCCESS",
+ REQUEST_TABS_FAILURE: "REQUEST_TABS_FAILURE",
+ REQUEST_TABS_START: "REQUEST_TABS_START",
+ REQUEST_TABS_SUCCESS: "REQUEST_TABS_SUCCESS",
+ REQUEST_WORKERS_FAILURE: "REQUEST_WORKERS_FAILURE",
+ REQUEST_WORKERS_START: "REQUEST_WORKERS_START",
+ REQUEST_WORKERS_SUCCESS: "REQUEST_WORKERS_SUCCESS",
+ SELECT_PAGE_FAILURE: "SELECT_PAGE_FAILURE",
+ SELECT_PAGE_START: "SELECT_PAGE_START",
+ SELECT_PAGE_SUCCESS: "SELECT_PAGE_SUCCESS",
+ SELECTED_RUNTIME_ID_UPDATED: "SELECTED_RUNTIME_ID_UPDATED",
+ SHOW_PROFILER_DIALOG: "SHOW_PROFILER_DIALOG",
+ TELEMETRY_RECORD: "TELEMETRY_RECORD",
+ TEMPORARY_EXTENSION_INSTALL_FAILURE: "TEMPORARY_EXTENSION_INSTALL_FAILURE",
+ TEMPORARY_EXTENSION_INSTALL_START: "TEMPORARY_EXTENSION_INSTALL_START",
+ TEMPORARY_EXTENSION_INSTALL_SUCCESS: "TEMPORARY_EXTENSION_INSTALL_SUCCESS",
+ TEMPORARY_EXTENSION_RELOAD_FAILURE: "TEMPORARY_EXTENSION_RELOAD_FAILURE",
+ TEMPORARY_EXTENSION_RELOAD_START: "TEMPORARY_EXTENSION_RELOAD_START",
+ TEMPORARY_EXTENSION_RELOAD_SUCCESS: "TEMPORARY_EXTENSION_RELOAD_SUCCESS",
+ TERMINATE_EXTENSION_BGSCRIPT_FAILURE: "TERMINATE_EXTENSION_BGSCRIPT_FAILURE",
+ TERMINATE_EXTENSION_BGSCRIPT_START: "TERMINATE_EXTENSION_BGSCRIPT_START",
+ TERMINATE_EXTENSION_BGSCRIPT_SUCCESS: "TERMINATE_EXTENSION_BGSCRIPT_SUCCESS",
+ THIS_FIREFOX_RUNTIME_CREATED: "THIS_FIREFOX_RUNTIME_CREATED",
+ UNWATCH_RUNTIME_FAILURE: "UNWATCH_RUNTIME_FAILURE",
+ UNWATCH_RUNTIME_START: "UNWATCH_RUNTIME_START",
+ UNWATCH_RUNTIME_SUCCESS: "UNWATCH_RUNTIME_SUCCESS",
+ UPDATE_CONNECTION_PROMPT_SETTING_FAILURE:
+ "UPDATE_CONNECTION_PROMPT_SETTING_FAILURE",
+ UPDATE_CONNECTION_PROMPT_SETTING_START:
+ "UPDATE_CONNECTION_PROMPT_SETTING_START",
+ UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS:
+ "UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS",
+ USB_RUNTIMES_SCAN_START: "USB_RUNTIMES_SCAN_START",
+ USB_RUNTIMES_SCAN_SUCCESS: "USB_RUNTIMES_SCAN_SUCCESS",
+ WATCH_RUNTIME_FAILURE: "WATCH_RUNTIME_FAILURE",
+ WATCH_RUNTIME_START: "WATCH_RUNTIME_START",
+ WATCH_RUNTIME_SUCCESS: "WATCH_RUNTIME_SUCCESS",
+};
+
+const DEBUG_TARGETS = DEBUG_TARGET_TYPES;
+
+const DEBUG_TARGET_PANE = {
+ INSTALLED_EXTENSION: "installedExtension",
+ PROCESSES: "processes",
+ OTHER_WORKER: "otherWorker",
+ SERVICE_WORKER: "serviceWorker",
+ SHARED_WORKER: "sharedWorker",
+ TAB: "tab",
+ TEMPORARY_EXTENSION: "temporaryExtension",
+};
+
+const ICON_LABEL_LEVEL = {
+ INFO: "info",
+ OK: "ok",
+};
+
+const MESSAGE_LEVEL = {
+ ERROR: "error",
+ INFO: "info",
+ WARNING: "warning",
+};
+
+const PAGE_TYPES = {
+ RUNTIME: "runtime",
+ CONNECT: "connect",
+};
+
+const PREFERENCES = {
+ // Preference that drives the display of the "Tabs" category on This Firefox.
+ LOCAL_TAB_DEBUGGING_ENABLED: "devtools.aboutdebugging.local-tab-debugging",
+ // Preference that drives the display of the "Processes" debug target category.
+ PROCESS_DEBUGGING_ENABLED: "devtools.aboutdebugging.process-debugging",
+ // Preference that drives the display of hidden & system addons in about:debugging.
+ SHOW_HIDDEN_ADDONS: "devtools.aboutdebugging.showHiddenAddons",
+ // Preference to store the last path used for loading a temporary extension.
+ TEMPORARY_EXTENSION_PATH: "devtools.aboutdebugging.tmpExtDirPath",
+ // Preference that disables installing extensions when set to false.
+ XPINSTALL_ENABLED: "xpinstall.enabled",
+};
+
+const RUNTIME_PREFERENCE = {
+ CONNECTION_PROMPT: "devtools.debugger.prompt-connection",
+ PERMANENT_PRIVATE_BROWSING: "browser.privatebrowsing.autostart",
+ SERVICE_WORKERS_ENABLED: "dom.serviceWorkers.enabled",
+};
+
+const RUNTIMES = {
+ NETWORK: CONNECTION_TYPES.NETWORK,
+ THIS_FIREFOX: CONNECTION_TYPES.THIS_FIREFOX,
+ USB: CONNECTION_TYPES.USB,
+};
+
+const SERVICE_WORKER_FETCH_STATES = {
+ LISTENING: "LISTENING",
+ NOT_LISTENING: "NOT_LISTENING",
+};
+
+const SERVICE_WORKER_STATUSES = {
+ RUNNING: "RUNNING",
+ REGISTERING: "REGISTERING",
+ STOPPED: "STOPPED",
+};
+
+const USB_STATES = {
+ DISABLED_USB: "DISABLED_USB",
+ ENABLED_USB: "ENABLED_USB",
+ UPDATING_USB: "UPDATING_USB",
+};
+
+const EXTENSION_BGSCRIPT_STATUSES = {
+ RUNNING: "RUNNING",
+ STOPPED: "STOPPED",
+};
+
+/**
+ * These constants reference the performance-new's concept of a PageContext.
+ * These are defined in devtools/client/performance-new/@types/perf.d.ts
+ * about:debugging only uses the remote variants of the PageContexts.
+ */
+const PROFILER_PAGE_CONTEXT = {
+ DEVTOOLS_REMOTE: "devtools-remote",
+ ABOUTPROFILING_REMOTE: "aboutprofiling-remote",
+};
+
+// flatten constants
+module.exports = Object.assign(
+ {},
+ {
+ DEBUG_TARGETS,
+ DEBUG_TARGET_PANE,
+ EXTENSION_BGSCRIPT_STATUSES,
+ ICON_LABEL_LEVEL,
+ MESSAGE_LEVEL,
+ PAGE_TYPES,
+ PREFERENCES,
+ RUNTIME_PREFERENCE,
+ RUNTIMES,
+ SERVICE_WORKER_FETCH_STATES,
+ SERVICE_WORKER_STATUSES,
+ USB_STATES,
+ PROFILER_PAGE_CONTEXT,
+ },
+ actionTypes
+);
diff --git a/devtools/client/aboutdebugging/src/create-store.js b/devtools/client/aboutdebugging/src/create-store.js
new file mode 100644
index 0000000000..93fd240b00
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/create-store.js
@@ -0,0 +1,78 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ applyMiddleware,
+ createStore,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+const {
+ thunk,
+} = require("resource://devtools/client/shared/redux/middleware/thunk.js");
+const {
+ waitUntilService,
+} = require("resource://devtools/client/shared/redux/middleware/wait-service.js");
+
+const rootReducer = require("resource://devtools/client/aboutdebugging/src/reducers/index.js");
+const {
+ DebugTargetsState,
+} = require("resource://devtools/client/aboutdebugging/src/reducers/debug-targets-state.js");
+const {
+ RuntimesState,
+} = require("resource://devtools/client/aboutdebugging/src/reducers/runtimes-state.js");
+const {
+ UiState,
+} = require("resource://devtools/client/aboutdebugging/src/reducers/ui-state.js");
+const debugTargetListenerMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/debug-target-listener.js");
+const errorLoggingMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/error-logging.js");
+const eventRecordingMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/event-recording.js");
+const extensionComponentDataMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/extension-component-data.js");
+const processComponentDataMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/process-component-data.js");
+const tabComponentDataMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/tab-component-data.js");
+const workerComponentDataMiddleware = require("resource://devtools/client/aboutdebugging/src/middleware/worker-component-data.js");
+const {
+ getDebugTargetCollapsibilities,
+} = require("resource://devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js");
+const {
+ getNetworkLocations,
+} = require("resource://devtools/client/aboutdebugging/src/modules/network-locations.js");
+
+const {
+ PREFERENCES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+function configureStore() {
+ const initialState = {
+ debugTargets: new DebugTargetsState(),
+ runtimes: new RuntimesState(),
+ ui: getUiState(),
+ };
+
+ const middleware = applyMiddleware(
+ thunk(),
+ debugTargetListenerMiddleware,
+ errorLoggingMiddleware,
+ eventRecordingMiddleware,
+ extensionComponentDataMiddleware,
+ processComponentDataMiddleware,
+ tabComponentDataMiddleware,
+ workerComponentDataMiddleware,
+ waitUntilService
+ );
+
+ return createStore(rootReducer, initialState, middleware);
+}
+
+function getUiState() {
+ const collapsibilities = getDebugTargetCollapsibilities();
+ const locations = getNetworkLocations();
+ const showHiddenAddons = Services.prefs.getBoolPref(
+ PREFERENCES.SHOW_HIDDEN_ADDONS,
+ false
+ );
+ return new UiState(locations, collapsibilities, showHiddenAddons);
+}
+
+exports.configureStore = configureStore;
diff --git a/devtools/client/aboutdebugging/src/middleware/debug-target-listener.js b/devtools/client/aboutdebugging/src/middleware/debug-target-listener.js
new file mode 100644
index 0000000000..655e667a6d
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/debug-target-listener.js
@@ -0,0 +1,111 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ EXTENSION_BGSCRIPT_STATUSES,
+ EXTENSION_BGSCRIPT_STATUS_UPDATED,
+ UNWATCH_RUNTIME_START,
+ WATCH_RUNTIME_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const Actions = require("resource://devtools/client/aboutdebugging/src/actions/index.js");
+
+const RootResourceCommand = require("resource://devtools/shared/commands/root-resource/root-resource-command.js");
+
+function debugTargetListenerMiddleware(store) {
+ const onExtensionsUpdated = () => {
+ store.dispatch(Actions.requestExtensions());
+ };
+
+ const onTabsUpdated = () => {
+ store.dispatch(Actions.requestTabs());
+ };
+
+ const onWorkersUpdated = () => {
+ store.dispatch(Actions.requestWorkers());
+ };
+
+ let rootResourceCommand;
+
+ function onExtensionsBackgroundScriptStatusAvailable(resources) {
+ for (const resource of resources) {
+ const backgroundScriptStatus = resource.payload.isRunning
+ ? EXTENSION_BGSCRIPT_STATUSES.RUNNING
+ : EXTENSION_BGSCRIPT_STATUSES.STOPPED;
+
+ store.dispatch({
+ type: EXTENSION_BGSCRIPT_STATUS_UPDATED,
+ id: resource.payload.addonId,
+ backgroundScriptStatus,
+ });
+ }
+ }
+
+ return next => async action => {
+ switch (action.type) {
+ case WATCH_RUNTIME_SUCCESS: {
+ const { runtime } = action;
+ const { clientWrapper } = runtime.runtimeDetails;
+
+ rootResourceCommand = clientWrapper.createRootResourceCommand();
+
+ // Watch extensions background script status updates.
+ await rootResourceCommand
+ .watchResources(
+ [RootResourceCommand.TYPES.EXTENSIONS_BGSCRIPT_STATUS],
+ { onAvailable: onExtensionsBackgroundScriptStatusAvailable }
+ )
+ .catch(e => {
+ // Log an error if watching this resource rejects (e.g. if
+ // the promise was not resolved yet when about:debugging tab
+ // or the RDP connection to a remote target has been closed).
+ console.error(e);
+ });
+
+ // Tabs
+ clientWrapper.on("tabListChanged", onTabsUpdated);
+
+ // Addons
+ clientWrapper.on("addonListChanged", onExtensionsUpdated);
+
+ // Workers
+ clientWrapper.on("workersUpdated", onWorkersUpdated);
+ break;
+ }
+ case UNWATCH_RUNTIME_START: {
+ const { runtime } = action;
+ const { clientWrapper } = runtime.runtimeDetails;
+
+ // Stop watching extensions background script status updates.
+ try {
+ rootResourceCommand?.unwatchResources(
+ [RootResourceCommand.TYPES.EXTENSIONS_BGSCRIPT_STATUS],
+ { onAvailable: onExtensionsBackgroundScriptStatusAvailable }
+ );
+ } catch (e) {
+ // Log an error if watching this resource rejects (e.g. if
+ // the promise was not resolved yet when about:debugging tab
+ // or the RDP connection to a remote target has been closed).
+ console.error(e);
+ }
+
+ // Tabs
+ clientWrapper.off("tabListChanged", onTabsUpdated);
+
+ // Addons
+ clientWrapper.off("addonListChanged", onExtensionsUpdated);
+
+ // Workers
+ clientWrapper.off("workersUpdated", onWorkersUpdated);
+ break;
+ }
+ }
+
+ return next(action);
+ };
+}
+
+module.exports = debugTargetListenerMiddleware;
diff --git a/devtools/client/aboutdebugging/src/middleware/error-logging.js b/devtools/client/aboutdebugging/src/middleware/error-logging.js
new file mode 100644
index 0000000000..fd04f34b76
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/error-logging.js
@@ -0,0 +1,35 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/**
+ * Error logging middleware that will forward all actions that contain an error property
+ * to the console.
+ */
+function errorLoggingMiddleware() {
+ return next => action => {
+ if (action.error) {
+ const { error } = action;
+ if (error.message) {
+ console.error(`[ACTION FAILED] ${action.type}: ${error.message}`);
+ } else if (typeof error === "string") {
+ // All failure actions should dispatch an error object instead of a message.
+ // We allow some flexibility to still provide some error logging.
+ console.error(`[ACTION FAILED] ${action.type}: ${error}`);
+ console.error(
+ `[ACTION FAILED] ${action.type} should dispatch the error object!`
+ );
+ }
+
+ if (error.stack) {
+ console.error(error.stack);
+ }
+ }
+
+ return next(action);
+ };
+}
+
+module.exports = errorLoggingMiddleware;
diff --git a/devtools/client/aboutdebugging/src/middleware/event-recording.js b/devtools/client/aboutdebugging/src/middleware/event-recording.js
new file mode 100644
index 0000000000..f926100b8b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/event-recording.js
@@ -0,0 +1,268 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const Telemetry = require("resource://devtools/client/shared/telemetry.js");
+loader.lazyGetter(
+ this,
+ "telemetry",
+ () => new Telemetry({ useSessionId: true })
+);
+
+const {
+ CONNECT_RUNTIME_CANCEL,
+ CONNECT_RUNTIME_FAILURE,
+ CONNECT_RUNTIME_NOT_RESPONDING,
+ CONNECT_RUNTIME_START,
+ CONNECT_RUNTIME_SUCCESS,
+ DISCONNECT_RUNTIME_SUCCESS,
+ REMOTE_RUNTIMES_UPDATED,
+ RUNTIMES,
+ SELECT_PAGE_SUCCESS,
+ SHOW_PROFILER_DIALOG,
+ TELEMETRY_RECORD,
+ UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const {
+ findRuntimeById,
+ getAllRuntimes,
+ getCurrentRuntime,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+function recordEvent(method, details) {
+ telemetry.recordEvent(method, "aboutdebugging", null, details);
+
+ // For close and open events, also ping the regular telemetry helpers used
+ // for all DevTools UIs.
+ if (method === "open_adbg") {
+ telemetry.toolOpened("aboutdebugging", window.AboutDebugging);
+ } else if (method === "close_adbg") {
+ // XXX: Note that aboutdebugging has no histogram created for
+ // TIME_ACTIVE_SECOND, so calling toolClosed will not actually
+ // record anything.
+ telemetry.toolClosed("aboutdebugging", window.AboutDebugging);
+ }
+}
+
+const telemetryRuntimeIds = new Map();
+// Create an anonymous id that will allow to track all events related to a runtime without
+// leaking personal data related to this runtime.
+function getTelemetryRuntimeId(id) {
+ if (!telemetryRuntimeIds.has(id)) {
+ const randomId = (Math.random() * 100000) | 0;
+ telemetryRuntimeIds.set(id, "runtime-" + randomId);
+ }
+ return telemetryRuntimeIds.get(id);
+}
+
+function getCurrentRuntimeIdForTelemetry(store) {
+ const id = getCurrentRuntime(store.getState().runtimes).id;
+ return getTelemetryRuntimeId(id);
+}
+
+function getRuntimeEventExtras(runtime) {
+ const { extra, runtimeDetails } = runtime;
+
+ // deviceName can be undefined for non-usb devices, but we should not log "undefined".
+ const deviceName = extra?.deviceName || "";
+ const runtimeShortName = runtime.type === RUNTIMES.USB ? runtime.name : "";
+ const runtimeName = runtimeDetails?.info.name || "";
+ return {
+ connection_type: runtime.type,
+ device_name: deviceName,
+ runtime_id: getTelemetryRuntimeId(runtime.id),
+ runtime_name: runtimeName || runtimeShortName,
+ };
+}
+
+function onConnectRuntimeSuccess(action, store) {
+ if (action.runtime.type === RUNTIMES.THIS_FIREFOX) {
+ // Only record connection and disconnection events for remote runtimes.
+ return;
+ }
+ // When we just connected to a runtime, the runtimeDetails are not in the store yet,
+ // so we merge it here to retrieve the expected telemetry data.
+ const storeRuntime = findRuntimeById(
+ action.runtime.id,
+ store.getState().runtimes
+ );
+ const runtime = Object.assign({}, storeRuntime, {
+ runtimeDetails: action.runtime.runtimeDetails,
+ });
+ const extras = Object.assign({}, getRuntimeEventExtras(runtime), {
+ runtime_os: action.runtime.runtimeDetails.info.os,
+ runtime_version: action.runtime.runtimeDetails.info.version,
+ });
+ recordEvent("runtime_connected", extras);
+}
+
+function onDisconnectRuntimeSuccess(action, store) {
+ const runtime = findRuntimeById(action.runtime.id, store.getState().runtimes);
+ if (runtime.type === RUNTIMES.THIS_FIREFOX) {
+ // Only record connection and disconnection events for remote runtimes.
+ return;
+ }
+
+ recordEvent("runtime_disconnected", getRuntimeEventExtras(runtime));
+}
+
+function onRemoteRuntimesUpdated(action, store) {
+ // Compare new runtimes with the existing runtimes to detect if runtimes, devices
+ // have been added or removed.
+ const newRuntimes = action.runtimes;
+ const allRuntimes = getAllRuntimes(store.getState().runtimes);
+ const oldRuntimes = allRuntimes.filter(r => r.type === action.runtimeType);
+
+ // Check if all the old runtimes and devices are still available in the updated
+ // array.
+ for (const oldRuntime of oldRuntimes) {
+ const runtimeRemoved = newRuntimes.every(r => r.id !== oldRuntime.id);
+ if (runtimeRemoved && !oldRuntime.isUnplugged) {
+ recordEvent("runtime_removed", getRuntimeEventExtras(oldRuntime));
+ }
+ }
+
+ // Using device names as unique IDs is inaccurate. See Bug 1544582.
+ const oldDeviceNames = new Set(oldRuntimes.map(r => r.extra.deviceName));
+ for (const oldDeviceName of oldDeviceNames) {
+ const newRuntime = newRuntimes.find(
+ r => r.extra.deviceName === oldDeviceName
+ );
+ const oldRuntime = oldRuntimes.find(
+ r => r.extra.deviceName === oldDeviceName
+ );
+ const isUnplugged = newRuntime?.isUnplugged && !oldRuntime.isUnplugged;
+ if (oldDeviceName && (!newRuntime || isUnplugged)) {
+ recordEvent("device_removed", {
+ connection_type: action.runtimeType,
+ device_name: oldDeviceName,
+ });
+ }
+ }
+
+ // Check if the new runtimes and devices were already available in the existing
+ // array.
+ for (const newRuntime of newRuntimes) {
+ const runtimeAdded = oldRuntimes.every(r => r.id !== newRuntime.id);
+ if (runtimeAdded && !newRuntime.isUnplugged) {
+ recordEvent("runtime_added", getRuntimeEventExtras(newRuntime));
+ }
+ }
+
+ // Using device names as unique IDs is inaccurate. See Bug 1544582.
+ const newDeviceNames = new Set(newRuntimes.map(r => r.extra.deviceName));
+ for (const newDeviceName of newDeviceNames) {
+ const newRuntime = newRuntimes.find(
+ r => r.extra.deviceName === newDeviceName
+ );
+ const oldRuntime = oldRuntimes.find(
+ r => r.extra.deviceName === newDeviceName
+ );
+ const isPlugged = oldRuntime?.isUnplugged && !newRuntime.isUnplugged;
+
+ if (newDeviceName && (!oldRuntime || isPlugged)) {
+ recordEvent("device_added", {
+ connection_type: action.runtimeType,
+ device_name: newDeviceName,
+ });
+ }
+ }
+}
+
+function recordConnectionAttempt(connectionId, runtimeId, status, store) {
+ const runtime = findRuntimeById(runtimeId, store.getState().runtimes);
+ if (runtime.type === RUNTIMES.THIS_FIREFOX) {
+ // Only record connection_attempt events for remote runtimes.
+ return;
+ }
+
+ recordEvent("connection_attempt", {
+ connection_id: connectionId,
+ connection_type: runtime.type,
+ runtime_id: getTelemetryRuntimeId(runtimeId),
+ status,
+ });
+}
+
+/**
+ * This middleware will record events to telemetry for some specific actions.
+ */
+function eventRecordingMiddleware(store) {
+ return next => action => {
+ switch (action.type) {
+ case CONNECT_RUNTIME_CANCEL:
+ recordConnectionAttempt(
+ action.connectionId,
+ action.id,
+ "cancelled",
+ store
+ );
+ break;
+ case CONNECT_RUNTIME_FAILURE:
+ recordConnectionAttempt(
+ action.connectionId,
+ action.id,
+ "failed",
+ store
+ );
+ break;
+ case CONNECT_RUNTIME_NOT_RESPONDING:
+ recordConnectionAttempt(
+ action.connectionId,
+ action.id,
+ "not responding",
+ store
+ );
+ break;
+ case CONNECT_RUNTIME_START:
+ recordConnectionAttempt(action.connectionId, action.id, "start", store);
+ break;
+ case CONNECT_RUNTIME_SUCCESS:
+ recordConnectionAttempt(
+ action.connectionId,
+ action.runtime.id,
+ "success",
+ store
+ );
+ onConnectRuntimeSuccess(action, store);
+ break;
+ case DISCONNECT_RUNTIME_SUCCESS:
+ onDisconnectRuntimeSuccess(action, store);
+ break;
+ case REMOTE_RUNTIMES_UPDATED:
+ onRemoteRuntimesUpdated(action, store);
+ break;
+ case SELECT_PAGE_SUCCESS:
+ recordEvent("select_page", { page_type: action.page });
+ break;
+ case SHOW_PROFILER_DIALOG:
+ recordEvent("show_profiler", {
+ runtime_id: getCurrentRuntimeIdForTelemetry(store),
+ });
+ break;
+ case TELEMETRY_RECORD:
+ const { method, details } = action;
+ if (method) {
+ recordEvent(method, details);
+ } else {
+ console.error(
+ `[RECORD EVENT FAILED] ${action.type}: no "method" property`
+ );
+ }
+ break;
+ case UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS:
+ recordEvent("update_conn_prompt", {
+ prompt_enabled: `${action.connectionPromptEnabled}`,
+ runtime_id: getCurrentRuntimeIdForTelemetry(store),
+ });
+ break;
+ }
+
+ return next(action);
+ };
+}
+
+module.exports = eventRecordingMiddleware;
diff --git a/devtools/client/aboutdebugging/src/middleware/extension-component-data.js b/devtools/client/aboutdebugging/src/middleware/extension-component-data.js
new file mode 100644
index 0000000000..5987f36398
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/extension-component-data.js
@@ -0,0 +1,84 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ DEBUG_TARGETS,
+ REQUEST_EXTENSIONS_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const {
+ getExtensionUuid,
+ parseFileUri,
+} = require("resource://devtools/client/aboutdebugging/src/modules/extensions-helper.js");
+
+/**
+ * This middleware converts extensions object that get from DevToolsClient.listAddons()
+ * to data which is used in DebugTargetItem.
+ */
+const extensionComponentDataMiddleware = store => next => action => {
+ switch (action.type) {
+ case REQUEST_EXTENSIONS_SUCCESS: {
+ action.installedExtensions = toComponentData(action.installedExtensions);
+ action.temporaryExtensions = toComponentData(action.temporaryExtensions);
+ break;
+ }
+ }
+
+ return next(action);
+};
+
+function getFilePath(extension) {
+ // Only show file system paths, and only for temporarily installed add-ons.
+ if (
+ !extension.temporarilyInstalled ||
+ !extension.url ||
+ !extension.url.startsWith("file://")
+ ) {
+ return null;
+ }
+
+ return parseFileUri(extension.url);
+}
+
+function toComponentData(extensions) {
+ return extensions.map(extension => {
+ const type = DEBUG_TARGETS.EXTENSION;
+ const {
+ actor,
+ backgroundScriptStatus,
+ iconDataURL,
+ iconURL,
+ id,
+ manifestURL,
+ name,
+ persistentBackgroundScript,
+ warnings,
+ } = extension;
+ const icon =
+ iconDataURL ||
+ iconURL ||
+ "chrome://mozapps/skin/extensions/extensionGeneric.svg";
+ const location = getFilePath(extension);
+ const uuid = getExtensionUuid(extension);
+ return {
+ name,
+ icon,
+ id,
+ type,
+ details: {
+ actor,
+ backgroundScriptStatus,
+ location,
+ manifestURL,
+ persistentBackgroundScript,
+ uuid,
+ warnings: warnings || [],
+ },
+ };
+ });
+}
+
+module.exports = extensionComponentDataMiddleware;
diff --git a/devtools/client/aboutdebugging/src/middleware/moz.build b/devtools/client/aboutdebugging/src/middleware/moz.build
new file mode 100644
index 0000000000..f50150f569
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/moz.build
@@ -0,0 +1,13 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "debug-target-listener.js",
+ "error-logging.js",
+ "event-recording.js",
+ "extension-component-data.js",
+ "process-component-data.js",
+ "tab-component-data.js",
+ "worker-component-data.js",
+)
diff --git a/devtools/client/aboutdebugging/src/middleware/process-component-data.js b/devtools/client/aboutdebugging/src/middleware/process-component-data.js
new file mode 100644
index 0000000000..d5cdc6365b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/process-component-data.js
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ l10n,
+} = require("resource://devtools/client/aboutdebugging/src/modules/l10n.js");
+
+const {
+ DEBUG_TARGETS,
+ REQUEST_PROCESSES_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This middleware converts tabs object that get from DevToolsClient.listProcesses() to
+ * data which is used in DebugTargetItem.
+ */
+const processComponentDataMiddleware = store => next => action => {
+ switch (action.type) {
+ case REQUEST_PROCESSES_SUCCESS: {
+ const mainProcessComponentData = toMainProcessComponentData(
+ action.mainProcess
+ );
+ action.processes = [mainProcessComponentData];
+ break;
+ }
+ }
+
+ return next(action);
+};
+
+function toMainProcessComponentData(process) {
+ const type = DEBUG_TARGETS.PROCESS;
+ const icon = "chrome://devtools/skin/images/aboutdebugging-process-icon.svg";
+
+ // For now, we assume there is only one process and this is the main process
+ // So the name and title are for a remote (multiprocess) browser toolbox.
+ const name = l10n.getString("about-debugging-multiprocess-toolbox-name");
+ const description = l10n.getString(
+ "about-debugging-multiprocess-toolbox-description"
+ );
+
+ return {
+ name,
+ icon,
+ type,
+ details: {
+ description,
+ },
+ };
+}
+
+module.exports = processComponentDataMiddleware;
diff --git a/devtools/client/aboutdebugging/src/middleware/tab-component-data.js b/devtools/client/aboutdebugging/src/middleware/tab-component-data.js
new file mode 100644
index 0000000000..f468926f81
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/tab-component-data.js
@@ -0,0 +1,51 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ DEBUG_TARGETS,
+ REQUEST_TABS_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This middleware converts tabs object that get from DevToolsClient.listTabs() to data
+ * which is used in DebugTargetItem.
+ */
+const tabComponentDataMiddleware = store => next => action => {
+ switch (action.type) {
+ case REQUEST_TABS_SUCCESS: {
+ action.tabs = toComponentData(action.tabs);
+ break;
+ }
+ }
+
+ return next(action);
+};
+
+function toComponentData(tabs) {
+ return tabs.map(tab => {
+ const type = DEBUG_TARGETS.TAB;
+ const id = tab.browserId;
+ const icon = tab.favicon
+ ? `data:image/png;base64,${btoa(
+ String.fromCharCode.apply(String, tab.favicon)
+ )}`
+ : "chrome://devtools/skin/images/globe.svg";
+ const name = tab.title || tab.url;
+ const { url, isZombieTab } = tab;
+ return {
+ name,
+ icon,
+ id,
+ type,
+ details: {
+ isZombieTab,
+ url,
+ },
+ };
+ });
+}
+
+module.exports = tabComponentDataMiddleware;
diff --git a/devtools/client/aboutdebugging/src/middleware/worker-component-data.js b/devtools/client/aboutdebugging/src/middleware/worker-component-data.js
new file mode 100644
index 0000000000..178c99e322
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/middleware/worker-component-data.js
@@ -0,0 +1,82 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ DEBUG_TARGETS,
+ REQUEST_WORKERS_SUCCESS,
+ SERVICE_WORKER_FETCH_STATES,
+ SERVICE_WORKER_STATUSES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This middleware converts workers object that get from DevToolsClient.listAllWorkers()
+ * to data which is used in DebugTargetItem.
+ */
+const workerComponentDataMiddleware = store => next => action => {
+ switch (action.type) {
+ case REQUEST_WORKERS_SUCCESS: {
+ action.otherWorkers = toComponentData(action.otherWorkers);
+ action.serviceWorkers = toComponentData(action.serviceWorkers, true);
+ action.sharedWorkers = toComponentData(action.sharedWorkers);
+ break;
+ }
+ }
+
+ return next(action);
+};
+
+function getServiceWorkerStatus(worker) {
+ const isActive = worker.state === Ci.nsIServiceWorkerInfo.STATE_ACTIVATED;
+ const isRunning = !!worker.workerDescriptorFront;
+
+ if (isActive && isRunning) {
+ return SERVICE_WORKER_STATUSES.RUNNING;
+ } else if (isActive) {
+ return SERVICE_WORKER_STATUSES.STOPPED;
+ }
+
+ // We cannot get service worker registrations unless the registration is in
+ // ACTIVE state. Unable to know the actual state ("installing", "waiting"), we
+ // display a custom state "registering" for now. See Bug 1153292.
+ return SERVICE_WORKER_STATUSES.REGISTERING;
+}
+
+function toComponentData(workers, isServiceWorker) {
+ return workers.map(worker => {
+ // Here `worker` is the worker object created by RootFront.listAllWorkers
+ const type = DEBUG_TARGETS.WORKER;
+ const icon = "chrome://devtools/skin/images/debugging-workers.svg";
+ let { fetch } = worker;
+ const { id, name, registrationFront, scope, subscription } = worker;
+
+ let pushServiceEndpoint = null;
+ let status = null;
+
+ if (isServiceWorker) {
+ fetch = fetch
+ ? SERVICE_WORKER_FETCH_STATES.LISTENING
+ : SERVICE_WORKER_FETCH_STATES.NOT_LISTENING;
+ status = getServiceWorkerStatus(worker);
+ pushServiceEndpoint = subscription ? subscription.endpoint : null;
+ }
+
+ return {
+ details: {
+ fetch,
+ pushServiceEndpoint,
+ registrationFront,
+ scope,
+ status,
+ },
+ icon,
+ id,
+ name,
+ type,
+ };
+ });
+}
+
+module.exports = workerComponentDataMiddleware;
diff --git a/devtools/client/aboutdebugging/src/modules/client-wrapper.js b/devtools/client/aboutdebugging/src/modules/client-wrapper.js
new file mode 100644
index 0000000000..6d537b60a4
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/client-wrapper.js
@@ -0,0 +1,217 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ checkVersionCompatibility,
+} = require("resource://devtools/client/shared/remote-debugging/version-checker.js");
+
+const {
+ RUNTIME_PREFERENCE,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+const {
+ WorkersListener,
+} = require("resource://devtools/client/shared/workers-listener.js");
+const RootResourceCommand = require("resource://devtools/shared/commands/root-resource/root-resource-command.js");
+
+const PREF_TYPES = {
+ BOOL: "BOOL",
+};
+
+// Map of preference to preference type.
+const PREF_TO_TYPE = {
+ [RUNTIME_PREFERENCE.CHROME_DEBUG_ENABLED]: PREF_TYPES.BOOL,
+ [RUNTIME_PREFERENCE.CONNECTION_PROMPT]: PREF_TYPES.BOOL,
+ [RUNTIME_PREFERENCE.PERMANENT_PRIVATE_BROWSING]: PREF_TYPES.BOOL,
+ [RUNTIME_PREFERENCE.REMOTE_DEBUG_ENABLED]: PREF_TYPES.BOOL,
+ [RUNTIME_PREFERENCE.SERVICE_WORKERS_ENABLED]: PREF_TYPES.BOOL,
+};
+
+// Some events are fired by mainRoot rather than client.
+const MAIN_ROOT_EVENTS = ["addonListChanged", "tabListChanged"];
+
+/**
+ * The ClientWrapper class is used to isolate aboutdebugging from the DevTools client API
+ * The modules of about:debugging should never call DevTools client APIs directly.
+ */
+class ClientWrapper {
+ constructor(client) {
+ this.client = client;
+ this.workersListener = new WorkersListener(client.mainRoot);
+ }
+
+ once(evt, listener) {
+ if (MAIN_ROOT_EVENTS.includes(evt)) {
+ this.client.mainRoot.once(evt, listener);
+ } else {
+ this.client.once(evt, listener);
+ }
+ }
+
+ on(evt, listener) {
+ if (evt === "workersUpdated") {
+ this.workersListener.addListener(listener);
+ } else if (MAIN_ROOT_EVENTS.includes(evt)) {
+ this.client.mainRoot.on(evt, listener);
+ } else {
+ this.client.on(evt, listener);
+ }
+ }
+
+ off(evt, listener) {
+ if (evt === "workersUpdated") {
+ this.workersListener.removeListener(listener);
+ } else if (MAIN_ROOT_EVENTS.includes(evt)) {
+ this.client.mainRoot.off(evt, listener);
+ } else {
+ this.client.off(evt, listener);
+ }
+ }
+
+ async getFront(typeName) {
+ return this.client.mainRoot.getFront(typeName);
+ }
+
+ async getDeviceDescription() {
+ const deviceFront = await this.getFront("device");
+ const description = await deviceFront.getDescription();
+
+ // Only expose a specific set of properties.
+ return {
+ canDebugServiceWorkers: description.canDebugServiceWorkers,
+ channel: description.channel,
+ deviceName: description.deviceName,
+ name: description.brandName,
+ os: description.os,
+ version: description.version,
+ };
+ }
+
+ createRootResourceCommand() {
+ return new RootResourceCommand({ rootFront: this.client.mainRoot });
+ }
+
+ async checkVersionCompatibility() {
+ return checkVersionCompatibility(this.client);
+ }
+
+ async setPreference(prefName, value) {
+ const prefType = PREF_TO_TYPE[prefName];
+ const preferenceFront = await this.client.mainRoot.getFront("preference");
+ switch (prefType) {
+ case PREF_TYPES.BOOL:
+ return preferenceFront.setBoolPref(prefName, value);
+ default:
+ throw new Error("Unsupported preference" + prefName);
+ }
+ }
+
+ async getPreference(prefName, defaultValue) {
+ if (typeof defaultValue === "undefined") {
+ throw new Error(
+ "Default value is mandatory for getPreference, the actor will " +
+ "throw if the preference is not set on the target runtime"
+ );
+ }
+
+ const prefType = PREF_TO_TYPE[prefName];
+ const preferenceFront = await this.client.mainRoot.getFront("preference");
+ switch (prefType) {
+ case PREF_TYPES.BOOL:
+ // TODO: Add server-side trait and methods to pass a default value to getBoolPref.
+ // See Bug 1522588.
+ let prefValue;
+ try {
+ prefValue = await preferenceFront.getBoolPref(prefName);
+ } catch (e) {
+ prefValue = defaultValue;
+ }
+ return prefValue;
+ default:
+ throw new Error("Unsupported preference:" + prefName);
+ }
+ }
+
+ async listTabs() {
+ return this.client.mainRoot.listTabs();
+ }
+
+ async listAddons(options) {
+ return this.client.mainRoot.listAddons(options);
+ }
+
+ async getAddon({ id }) {
+ return this.client.mainRoot.getAddon({ id });
+ }
+
+ async uninstallAddon({ id }) {
+ const addonsFront = await this.getFront("addons");
+ return addonsFront.uninstallAddon(id);
+ }
+
+ async getMainProcess() {
+ return this.client.mainRoot.getMainProcess();
+ }
+
+ async getServiceWorkerFront({ id }) {
+ return this.client.mainRoot.getWorker(id);
+ }
+
+ async listWorkers() {
+ const { other, service, shared } =
+ await this.client.mainRoot.listAllWorkers();
+
+ return {
+ otherWorkers: other,
+ serviceWorkers: service,
+ sharedWorkers: shared,
+ };
+ }
+
+ async close() {
+ return this.client.close();
+ }
+
+ isClosed() {
+ return this.client._transportClosed;
+ }
+
+ // This method will be mocked to return a dummy URL during mochitests
+ getPerformancePanelUrl() {
+ return "chrome://devtools/content/performance-new/panel/index.xhtml";
+ }
+
+ /**
+ * @param {Window} win - The window of the dialog window.
+ * @param {Function} openAboutProfiling
+ */
+ async loadPerformanceProfiler(win, openAboutProfiling) {
+ const perfFront = await this.getFront("perf");
+ const { traits } = this.client;
+ await win.gInit(perfFront, traits, "devtools-remote", openAboutProfiling);
+ }
+
+ /**
+ * @param {Window} win - The window of the dialog window.
+ * @param {Function} openRemoteDevTools
+ */
+ async loadAboutProfiling(win, openRemoteDevTools) {
+ const perfFront = await this.getFront("perf");
+ const isSupportedPlatform = await perfFront.isSupportedPlatform();
+ const supportedFeatures = await perfFront.getSupportedFeatures();
+ await win.gInit(
+ "aboutprofiling-remote",
+ isSupportedPlatform,
+ supportedFeatures,
+ openRemoteDevTools
+ );
+ }
+
+ get traits() {
+ return { ...this.client.mainRoot.traits };
+ }
+}
+
+exports.ClientWrapper = ClientWrapper;
diff --git a/devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js b/devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js
new file mode 100644
index 0000000000..efba47e03a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js
@@ -0,0 +1,46 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PREF_PREFIX = "devtools.aboutdebugging.collapsibilities.";
+const {
+ DEBUG_TARGET_PANE,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This module provides a collection of helper methods to read and update the debug
+ * target pane's collapsibilities.
+ */
+
+/**
+ * @return {Object}
+ * {
+ * key: constants.DEBUG_TARGET_PANE
+ * value: true - collapsed
+ * false - expanded
+ * }
+ */
+function getDebugTargetCollapsibilities() {
+ const map = new Map();
+
+ for (const key of Object.values(DEBUG_TARGET_PANE)) {
+ const pref = Services.prefs.getBoolPref(PREF_PREFIX + key, false);
+ map.set(key, pref);
+ }
+
+ return map;
+}
+exports.getDebugTargetCollapsibilities = getDebugTargetCollapsibilities;
+
+/**
+ * @param collapsibilities - Same format to getDebugTargetCollapsibilities.
+ */
+function setDebugTargetCollapsibilities(collapsibilities) {
+ for (const key of Object.values(DEBUG_TARGET_PANE)) {
+ const isCollapsed = collapsibilities.get(key);
+ Services.prefs.setBoolPref(PREF_PREFIX + key, isCollapsed);
+ }
+}
+exports.setDebugTargetCollapsibilities = setDebugTargetCollapsibilities;
diff --git a/devtools/client/aboutdebugging/src/modules/debug-target-support.js b/devtools/client/aboutdebugging/src/modules/debug-target-support.js
new file mode 100644
index 0000000000..2b8d4afa5b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/debug-target-support.js
@@ -0,0 +1,98 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ DEBUG_TARGET_PANE,
+ PREFERENCES,
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+// Process target debugging is disabled by default.
+function isProcessDebuggingSupported() {
+ return Services.prefs.getBoolPref(
+ PREFERENCES.PROCESS_DEBUGGING_ENABLED,
+ false
+ );
+}
+
+// Local tab debugging is disabled by default.
+function isLocalTabDebuggingSupported() {
+ return Services.prefs.getBoolPref(
+ PREFERENCES.LOCAL_TAB_DEBUGGING_ENABLED,
+ false
+ );
+}
+
+// Local process debugging is disabled by default.
+// This preference has no default value in
+// devtools/client/preferences/devtools-client.js
+// because it is only intended for tests.
+function isLocalProcessDebuggingSupported() {
+ return Services.prefs.getBoolPref(
+ "devtools.aboutdebugging.test-local-process-debugging",
+ false
+ );
+}
+
+// Installing extensions can be disabled in enterprise policy.
+// Note: Temporary Extensions are only supported when debugging This Firefox, so checking
+// the local preference is acceptable here. If we enable Temporary extensions for remote
+// runtimes, we should retrieve the preference from the target runtime instead.
+function isTemporaryExtensionSupported() {
+ return Services.prefs.getBoolPref(PREFERENCES.XPINSTALL_ENABLED, true);
+}
+
+const ALL_DEBUG_TARGET_PANES = [
+ DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
+ ...(isProcessDebuggingSupported() ? [DEBUG_TARGET_PANE.PROCESSES] : []),
+ DEBUG_TARGET_PANE.OTHER_WORKER,
+ DEBUG_TARGET_PANE.SERVICE_WORKER,
+ DEBUG_TARGET_PANE.SHARED_WORKER,
+ DEBUG_TARGET_PANE.TAB,
+ ...(isTemporaryExtensionSupported()
+ ? [DEBUG_TARGET_PANE.TEMPORARY_EXTENSION]
+ : []),
+];
+
+// All debug target panes (to filter out if any of the panels should be excluded).
+const REMOTE_DEBUG_TARGET_PANES = [...ALL_DEBUG_TARGET_PANES];
+
+const THIS_FIREFOX_DEBUG_TARGET_PANES = ALL_DEBUG_TARGET_PANES
+ // Main process debugging is not available for This Firefox.
+ // At the moment only the main process is listed under processes, so remove the category
+ // for this runtime.
+ .filter(
+ p => p !== DEBUG_TARGET_PANE.PROCESSES || isLocalProcessDebuggingSupported()
+ )
+ // Showing tab targets for This Firefox is behind a preference.
+ .filter(p => p !== DEBUG_TARGET_PANE.TAB || isLocalTabDebuggingSupported());
+
+const SUPPORTED_TARGET_PANE_BY_RUNTIME = {
+ [RUNTIMES.THIS_FIREFOX]: THIS_FIREFOX_DEBUG_TARGET_PANES,
+ [RUNTIMES.USB]: REMOTE_DEBUG_TARGET_PANES,
+ [RUNTIMES.NETWORK]: REMOTE_DEBUG_TARGET_PANES,
+};
+
+/**
+ * A debug target pane is more specialized than a debug target. For instance EXTENSION is
+ * a DEBUG_TARGET but INSTALLED_EXTENSION and TEMPORARY_EXTENSION are DEBUG_TARGET_PANES.
+ */
+function isSupportedDebugTargetPane(runtimeType, debugTargetPaneKey) {
+ return SUPPORTED_TARGET_PANE_BY_RUNTIME[runtimeType].includes(
+ debugTargetPaneKey
+ );
+}
+exports.isSupportedDebugTargetPane = isSupportedDebugTargetPane;
+
+/**
+ * Check if the given runtimeType supports temporary extension installation
+ * from about:debugging (currently disallowed on non-local runtimes).
+ */
+function supportsTemporaryExtensionInstaller(runtimeType) {
+ return runtimeType === RUNTIMES.THIS_FIREFOX;
+}
+exports.supportsTemporaryExtensionInstaller =
+ supportsTemporaryExtensionInstaller;
diff --git a/devtools/client/aboutdebugging/src/modules/extensions-helper.js b/devtools/client/aboutdebugging/src/modules/extensions-helper.js
new file mode 100644
index 0000000000..ec0d7c2661
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/extensions-helper.js
@@ -0,0 +1,92 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const lazy = {};
+
+ChromeUtils.defineESModuleGetters(lazy, {
+ FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
+});
+
+const {
+ PREFERENCES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+exports.parseFileUri = function (url) {
+ // Strip a leading slash from Windows drive letter URIs.
+ // file:///home/foo ~> /home/foo
+ // file:///C:/foo ~> C:/foo
+ const windowsRegex = /^file:\/\/\/([a-zA-Z]:\/.*)/;
+ if (windowsRegex.test(url)) {
+ return windowsRegex.exec(url)[1];
+ }
+ return url.slice("file://".length);
+};
+
+exports.getExtensionUuid = function (extension) {
+ const { manifestURL } = extension;
+ // Strip off the protocol and rest, leaving us with just the UUID.
+ return manifestURL ? /moz-extension:\/\/([^/]*)/.exec(manifestURL)[1] : null;
+};
+
+/**
+ * Open a file picker to allow the user to locate a temporary extension. A temporary
+ * extension can either be:
+ * - a folder
+ * - a .xpi file
+ * - a .zip file
+ *
+ * @param {Window} win
+ * The window object where the filepicker should be opened.
+ * Note: We cannot use the global window object here because it is undefined if
+ * this module is loaded from a file outside of devtools/client/aboutdebugging/.
+ * See browser-loader.js `uri.startsWith(baseURI)` for more details.
+ * @param {String} message
+ * The help message that should be displayed to the user in the filepicker.
+ * @return {Promise} returns a promise that resolves a File object corresponding to the
+ * file selected by the user.
+ */
+exports.openTemporaryExtension = function (win, message) {
+ return new Promise(resolve => {
+ const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
+ fp.init(win, message, Ci.nsIFilePicker.modeOpen);
+
+ // Try to set the last directory used as "displayDirectory".
+ try {
+ const lastDirPath = Services.prefs.getCharPref(
+ PREFERENCES.TEMPORARY_EXTENSION_PATH,
+ ""
+ );
+ const lastDir = new lazy.FileUtils.File(lastDirPath);
+ fp.displayDirectory = lastDir;
+ } catch (e) {
+ // Empty or invalid value, nothing to handle.
+ }
+
+ fp.open(res => {
+ if (res == Ci.nsIFilePicker.returnCancel || !fp.file) {
+ return;
+ }
+ let file = fp.file;
+ // AddonManager.installTemporaryAddon accepts either
+ // addon directory or final xpi file.
+ if (
+ !file.isDirectory() &&
+ !file.leafName.endsWith(".xpi") &&
+ !file.leafName.endsWith(".zip")
+ ) {
+ file = file.parent;
+ }
+
+ // We are about to resolve, store the path to the file for the next call.
+ Services.prefs.setCharPref(
+ PREFERENCES.TEMPORARY_EXTENSION_PATH,
+ file.path
+ );
+
+ resolve(file);
+ });
+ });
+};
diff --git a/devtools/client/aboutdebugging/src/modules/l10n.js b/devtools/client/aboutdebugging/src/modules/l10n.js
new file mode 100644
index 0000000000..88c7ae8bb1
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/l10n.js
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ FluentL10n,
+} = require("resource://devtools/client/shared/fluent-l10n/fluent-l10n.js");
+
+// exports a singleton, which will be used across all aboutdebugging modules
+exports.l10n = new FluentL10n();
diff --git a/devtools/client/aboutdebugging/src/modules/moz.build b/devtools/client/aboutdebugging/src/modules/moz.build
new file mode 100644
index 0000000000..909e181714
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/moz.build
@@ -0,0 +1,16 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "client-wrapper.js",
+ "debug-target-collapsibilities.js",
+ "debug-target-support.js",
+ "extensions-helper.js",
+ "l10n.js",
+ "network-locations.js",
+ "runtime-client-factory.js",
+ "runtime-default-preferences.js",
+ "runtimes-state-helper.js",
+ "usb-runtimes.js",
+)
diff --git a/devtools/client/aboutdebugging/src/modules/network-locations.js b/devtools/client/aboutdebugging/src/modules/network-locations.js
new file mode 100644
index 0000000000..cbae436df7
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/network-locations.js
@@ -0,0 +1,69 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const NETWORK_LOCATIONS_PREF = "devtools.aboutdebugging.network-locations";
+
+/**
+ * This module provides a collection of helper methods to read and update network
+ * locations monitored by about-debugging.
+ */
+
+function addNetworkLocationsObserver(listener) {
+ Services.prefs.addObserver(NETWORK_LOCATIONS_PREF, listener);
+}
+exports.addNetworkLocationsObserver = addNetworkLocationsObserver;
+
+function removeNetworkLocationsObserver(listener) {
+ Services.prefs.removeObserver(NETWORK_LOCATIONS_PREF, listener);
+}
+exports.removeNetworkLocationsObserver = removeNetworkLocationsObserver;
+
+/**
+ * Read the current preference value for aboutdebugging network locations.
+ * Will throw if the value cannot be parsed or is not an array.
+ */
+function _parsePreferenceAsArray() {
+ const pref = Services.prefs.getStringPref(NETWORK_LOCATIONS_PREF, "[]");
+ const parsedValue = JSON.parse(pref);
+ if (!Array.isArray(parsedValue)) {
+ throw new Error("Expected array value in " + NETWORK_LOCATIONS_PREF);
+ }
+ return parsedValue;
+}
+
+function getNetworkLocations() {
+ try {
+ return _parsePreferenceAsArray();
+ } catch (e) {
+ Services.prefs.clearUserPref(NETWORK_LOCATIONS_PREF);
+ return [];
+ }
+}
+exports.getNetworkLocations = getNetworkLocations;
+
+function addNetworkLocation(location) {
+ const locations = getNetworkLocations();
+ const locationsSet = new Set(locations);
+ locationsSet.add(location);
+
+ Services.prefs.setStringPref(
+ NETWORK_LOCATIONS_PREF,
+ JSON.stringify([...locationsSet])
+ );
+}
+exports.addNetworkLocation = addNetworkLocation;
+
+function removeNetworkLocation(location) {
+ const locations = getNetworkLocations();
+ const locationsSet = new Set(locations);
+ locationsSet.delete(location);
+
+ Services.prefs.setStringPref(
+ NETWORK_LOCATIONS_PREF,
+ JSON.stringify([...locationsSet])
+ );
+}
+exports.removeNetworkLocation = removeNetworkLocation;
diff --git a/devtools/client/aboutdebugging/src/modules/runtime-client-factory.js b/devtools/client/aboutdebugging/src/modules/runtime-client-factory.js
new file mode 100644
index 0000000000..e553416c18
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/runtime-client-factory.js
@@ -0,0 +1,68 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ prepareTCPConnection,
+} = require("resource://devtools/client/shared/remote-debugging/adb/commands/index.js");
+const {
+ DevToolsClient,
+} = require("resource://devtools/client/devtools-client.js");
+const {
+ DevToolsServer,
+} = require("resource://devtools/server/devtools-server.js");
+const {
+ ClientWrapper,
+} = require("resource://devtools/client/aboutdebugging/src/modules/client-wrapper.js");
+const {
+ remoteClientManager,
+} = require("resource://devtools/client/shared/remote-debugging/remote-client-manager.js");
+
+const {
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+async function createLocalClient() {
+ DevToolsServer.init();
+ DevToolsServer.registerAllActors();
+ DevToolsServer.allowChromeProcess = true;
+
+ const client = new DevToolsClient(DevToolsServer.connectPipe());
+ await client.connect();
+ return new ClientWrapper(client);
+}
+
+async function createNetworkClient(host, port) {
+ const transport = await DevToolsClient.socketConnect({ host, port });
+ const client = new DevToolsClient(transport);
+ await client.connect();
+ return new ClientWrapper(client);
+}
+
+async function createUSBClient(deviceId, socketPath) {
+ const port = await prepareTCPConnection(deviceId, socketPath);
+ return createNetworkClient("localhost", port);
+}
+
+async function createClientForRuntime(runtime) {
+ const { extra, id, type } = runtime;
+
+ if (type === RUNTIMES.THIS_FIREFOX) {
+ return createLocalClient();
+ } else if (remoteClientManager.hasClient(id, type)) {
+ const client = remoteClientManager.getClient(id, type);
+ return new ClientWrapper(client);
+ } else if (type === RUNTIMES.NETWORK) {
+ const { host, port } = extra.connectionParameters;
+ return createNetworkClient(host, port);
+ } else if (type === RUNTIMES.USB) {
+ const { deviceId, socketPath } = extra.connectionParameters;
+ return createUSBClient(deviceId, socketPath);
+ }
+
+ return null;
+}
+
+exports.createClientForRuntime = createClientForRuntime;
diff --git a/devtools/client/aboutdebugging/src/modules/runtime-default-preferences.js b/devtools/client/aboutdebugging/src/modules/runtime-default-preferences.js
new file mode 100644
index 0000000000..02c06334f7
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/runtime-default-preferences.js
@@ -0,0 +1,101 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/**
+ * This module provides a workaround for remote debugging when a preference is
+ * defined in the firefox preference file (browser/app/profile/firefox.js) but
+ * still read from the server, without any default value.
+ *
+ * This causes the server to crash and can't easily be recovered.
+ *
+ * While we work on better linting to prevent such issues (Bug 1660182), this
+ * module will be able to set default values for all missing preferences.
+ */
+
+const PREFERENCE_TYPES = {
+ BOOL: "BOOL",
+ CHAR: "CHAR",
+ INT: "INT",
+};
+exports.PREFERENCE_TYPES = PREFERENCE_TYPES;
+
+/**
+ * Expected properties for the preference descriptors:
+ * - prefName {String}: the name of the preference.
+ * - defaultValue {String|Bool|Number}: the value to set if the preference is
+ * missing.
+ * - trait {String}: the name of the trait corresponding to this pref on the
+ * PreferenceFront.
+ * - type {String}: the preference type (either BOOL, CHAR or INT).
+ */
+const DEFAULT_PREFERENCES = [];
+exports.DEFAULT_PREFERENCES = DEFAULT_PREFERENCES;
+
+const METHODS = {
+ [PREFERENCE_TYPES.BOOL]: {
+ setPref: "setBoolPref",
+ getPref: "getBoolPref",
+ },
+ [PREFERENCE_TYPES.CHAR]: {
+ setPref: "setCharPref",
+ getPref: "getCharPref",
+ },
+ [PREFERENCE_TYPES.INT]: {
+ setPref: "setIntPref",
+ getPref: "getIntPref",
+ },
+};
+
+/**
+ * Set default values for all the provided preferences on the runtime
+ * corresponding to the provided clientWrapper, if needed.
+ *
+ * Note: prefDescriptors will most likely be DEFAULT_PREFERENCES when
+ * used in production code, but can be parameterized for tests.
+ *
+ * @param {ClientWrapper} clientWrapper
+ * @param {Array} prefDescriptors
+ * Array of preference descriptors, see DEFAULT_PREFERENCES.
+ */
+async function setDefaultPreferencesIfNeeded(clientWrapper, prefDescriptors) {
+ if (!prefDescriptors || prefDescriptors.length === 0) {
+ return;
+ }
+
+ const preferenceFront = await clientWrapper.getFront("preference");
+ const preferenceTraits = await preferenceFront.getTraits();
+
+ // Note: using Promise.all here fails because the request/responses get mixed.
+ for (const prefDescriptor of prefDescriptors) {
+ // If the fix for this preference is already on this server, skip it.
+ if (preferenceTraits[prefDescriptor.trait]) {
+ continue;
+ }
+
+ await setDefaultPreference(preferenceFront, prefDescriptor);
+ }
+}
+exports.setDefaultPreferencesIfNeeded = setDefaultPreferencesIfNeeded;
+
+async function setDefaultPreference(preferenceFront, prefDescriptor) {
+ const { prefName, type, defaultValue } = prefDescriptor;
+
+ if (!Object.values(PREFERENCE_TYPES).includes(type)) {
+ throw new Error(`Unsupported type for setDefaultPreference "${type}"`);
+ }
+
+ const prefMethods = METHODS[type];
+ try {
+ // Try to read the preference only to check if the call is successful.
+ // If not, this means the preference is missing and should be initialized.
+ await preferenceFront[prefMethods.getPref](prefName);
+ } catch (e) {
+ console.warn(
+ `Preference "${prefName}"" is not set on the remote runtime. Setting default value.`
+ );
+ await preferenceFront[prefMethods.setPref](prefName, defaultValue);
+ }
+}
diff --git a/devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js b/devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js
new file mode 100644
index 0000000000..1864ef8341
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+function getCurrentRuntime(runtimesState) {
+ const selectedRuntimeId = runtimesState.selectedRuntimeId;
+ return findRuntimeById(selectedRuntimeId, runtimesState);
+}
+exports.getCurrentRuntime = getCurrentRuntime;
+
+function getCurrentClient(runtimesState) {
+ const runtimeDetails = getCurrentRuntimeDetails(runtimesState);
+ return runtimeDetails ? runtimeDetails.clientWrapper : null;
+}
+exports.getCurrentClient = getCurrentClient;
+
+function findRuntimeById(id, runtimesState) {
+ return getAllRuntimes(runtimesState).find(r => r.id === id);
+}
+exports.findRuntimeById = findRuntimeById;
+
+function getAllRuntimes(runtimesState) {
+ return [
+ ...runtimesState.networkRuntimes,
+ ...runtimesState.thisFirefoxRuntimes,
+ ...runtimesState.usbRuntimes,
+ ];
+}
+exports.getAllRuntimes = getAllRuntimes;
+
+function getCurrentRuntimeDetails(runtimesState) {
+ const runtime = getCurrentRuntime(runtimesState);
+ return runtime ? runtime.runtimeDetails : null;
+}
+exports.getCurrentRuntimeDetails = getCurrentRuntimeDetails;
diff --git a/devtools/client/aboutdebugging/src/modules/usb-runtimes.js b/devtools/client/aboutdebugging/src/modules/usb-runtimes.js
new file mode 100644
index 0000000000..887dc6788e
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/modules/usb-runtimes.js
@@ -0,0 +1,122 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+loader.lazyRequireGetter(
+ this,
+ "adb",
+ "resource://devtools/client/shared/remote-debugging/adb/adb.js",
+ true
+);
+
+/**
+ * Used to represent a regular runtime returned by ADB.
+ */
+class UsbRuntime {
+ constructor(adbRuntime) {
+ this.id = adbRuntime.id;
+ this.deviceId = adbRuntime.deviceId;
+ this.deviceName = adbRuntime.deviceName;
+ this.shortName = adbRuntime.shortName;
+ this.socketPath = adbRuntime.socketPath;
+ this.isFenix = adbRuntime.isFenix;
+ this.isUnavailable = false;
+ this.isUnplugged = false;
+ this.versionName = adbRuntime.versionName;
+ }
+}
+
+/**
+ * Used when a device was detected, meaning USB debugging is enabled on the device, but no
+ * runtime/browser is available for connection.
+ */
+class UnavailableUsbRuntime {
+ constructor(adbDevice) {
+ this.id = adbDevice.id + "|unavailable";
+ this.deviceId = adbDevice.id;
+ this.deviceName = adbDevice.name;
+ this.shortName = "Unavailable runtime";
+ this.socketPath = null;
+ this.isFenix = false;
+ this.isUnavailable = true;
+ this.isUnplugged = false;
+ this.versionName = null;
+ }
+}
+
+/**
+ * Used to represent USB devices that were previously connected but are now missing
+ * (presumably after being unplugged/disconnected from the computer).
+ */
+class UnpluggedUsbRuntime {
+ constructor(deviceId, deviceName) {
+ this.id = deviceId + "|unplugged";
+ this.deviceId = deviceId;
+ this.deviceName = deviceName;
+ this.shortName = "Unplugged runtime";
+ this.socketPath = null;
+ this.isFenix = false;
+ this.isUnavailable = true;
+ this.isUnplugged = true;
+ this.versionName = null;
+ }
+}
+
+/**
+ * Map used to keep track of discovered usb devices. Will be used to create the unplugged
+ * usb runtimes.
+ */
+const devices = new Map();
+
+/**
+ * This module provides a collection of helper methods to detect USB runtimes whom Firefox
+ * is running on.
+ */
+function addUSBRuntimesObserver(listener) {
+ adb.registerListener(listener);
+}
+exports.addUSBRuntimesObserver = addUSBRuntimesObserver;
+
+async function getUSBRuntimes() {
+ // Get the available runtimes
+ const runtimes = adb.getRuntimes().map(r => new UsbRuntime(r));
+
+ // Get devices found by ADB, but without any available runtime.
+ const runtimeDevices = runtimes.map(r => r.deviceId);
+ const unavailableRuntimes = adb
+ .getDevices()
+ .filter(d => !runtimeDevices.includes(d.id))
+ .map(d => new UnavailableUsbRuntime(d));
+
+ // Add all devices to the map detected devices.
+ const allRuntimes = runtimes.concat(unavailableRuntimes);
+ for (const runtime of allRuntimes) {
+ devices.set(runtime.deviceId, runtime.deviceName);
+ }
+
+ // Get devices previously found by ADB but no longer available.
+ const currentDevices = allRuntimes.map(r => r.deviceId);
+ const detectedDevices = [...devices.keys()];
+ const unpluggedDevices = detectedDevices.filter(
+ id => !currentDevices.includes(id)
+ );
+ const unpluggedRuntimes = unpluggedDevices.map(deviceId => {
+ const deviceName = devices.get(deviceId);
+ return new UnpluggedUsbRuntime(deviceId, deviceName);
+ });
+
+ return allRuntimes.concat(unpluggedRuntimes);
+}
+exports.getUSBRuntimes = getUSBRuntimes;
+
+function removeUSBRuntimesObserver(listener) {
+ adb.unregisterListener(listener);
+}
+exports.removeUSBRuntimesObserver = removeUSBRuntimesObserver;
+
+function refreshUSBRuntimes() {
+ return adb.updateRuntimes();
+}
+exports.refreshUSBRuntimes = refreshUSBRuntimes;
diff --git a/devtools/client/aboutdebugging/src/moz.build b/devtools/client/aboutdebugging/src/moz.build
new file mode 100644
index 0000000000..58e6f92857
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/moz.build
@@ -0,0 +1,17 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "actions",
+ "components",
+ "middleware",
+ "modules",
+ "reducers",
+ "types",
+]
+
+DevToolsModules(
+ "constants.js",
+ "create-store.js",
+)
diff --git a/devtools/client/aboutdebugging/src/reducers/debug-targets-state.js b/devtools/client/aboutdebugging/src/reducers/debug-targets-state.js
new file mode 100644
index 0000000000..8ee0473e3c
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/reducers/debug-targets-state.js
@@ -0,0 +1,155 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ EXTENSION_BGSCRIPT_STATUS_UPDATED,
+ REQUEST_EXTENSIONS_SUCCESS,
+ REQUEST_PROCESSES_SUCCESS,
+ REQUEST_TABS_SUCCESS,
+ REQUEST_WORKERS_SUCCESS,
+ TEMPORARY_EXTENSION_RELOAD_FAILURE,
+ TEMPORARY_EXTENSION_RELOAD_START,
+ TERMINATE_EXTENSION_BGSCRIPT_FAILURE,
+ TERMINATE_EXTENSION_BGSCRIPT_START,
+ UNWATCH_RUNTIME_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+function DebugTargetsState() {
+ return {
+ installedExtensions: [],
+ otherWorkers: [],
+ processes: [],
+ serviceWorkers: [],
+ sharedWorkers: [],
+ tabs: [],
+ temporaryExtensions: [],
+ };
+}
+
+function updateExtensionDetails(extensions, id, updatedDetails) {
+ // extensions is meant to be either state.installExtensions or state.temporaryExtensions.
+ return extensions.map(extension => {
+ if (extension.id === id) {
+ extension = Object.assign({}, extension);
+
+ extension.details = Object.assign({}, extension.details, updatedDetails);
+ }
+ return extension;
+ });
+}
+
+function updateTemporaryExtension(state, id, updatedDetails) {
+ return updateExtensionDetails(state.temporaryExtensions, id, updatedDetails);
+}
+
+function updateInstalledExtension(state, id, updatedDetails) {
+ return updateExtensionDetails(state.installedExtensions, id, updatedDetails);
+}
+
+function updateExtension(state, id, updatedDetails) {
+ return {
+ installedExtensions: updateInstalledExtension(state, id, updatedDetails),
+ temporaryExtensions: updateTemporaryExtension(state, id, updatedDetails),
+ };
+}
+
+function debugTargetsReducer(state = DebugTargetsState(), action) {
+ switch (action.type) {
+ case UNWATCH_RUNTIME_SUCCESS: {
+ return DebugTargetsState();
+ }
+ case REQUEST_EXTENSIONS_SUCCESS: {
+ const { installedExtensions, temporaryExtensions } = action;
+ return Object.assign({}, state, {
+ installedExtensions,
+ temporaryExtensions,
+ });
+ }
+ case REQUEST_PROCESSES_SUCCESS: {
+ const { processes } = action;
+ return Object.assign({}, state, { processes });
+ }
+ case REQUEST_TABS_SUCCESS: {
+ const { tabs } = action;
+ return Object.assign({}, state, { tabs });
+ }
+ case REQUEST_WORKERS_SUCCESS: {
+ const { otherWorkers, serviceWorkers, sharedWorkers } = action;
+ return Object.assign({}, state, {
+ otherWorkers,
+ serviceWorkers,
+ sharedWorkers,
+ });
+ }
+ case TEMPORARY_EXTENSION_RELOAD_FAILURE: {
+ const { id, error } = action;
+ const temporaryExtensions = updateTemporaryExtension(state, id, {
+ reloadError: error.message,
+ });
+ return Object.assign({}, state, { temporaryExtensions });
+ }
+ case TEMPORARY_EXTENSION_RELOAD_START: {
+ const { id } = action;
+ const temporaryExtensions = updateTemporaryExtension(state, id, {
+ reloadError: null,
+ });
+ return Object.assign({}, state, { temporaryExtensions });
+ }
+ case TERMINATE_EXTENSION_BGSCRIPT_START: {
+ const { id } = action;
+ const { installedExtensions, temporaryExtensions } = updateExtension(
+ state,
+ id,
+ {
+ // Clear the last error if one was still set.
+ lastTerminateBackgroundScriptError: null,
+ }
+ );
+ return Object.assign({}, state, {
+ installedExtensions,
+ temporaryExtensions,
+ });
+ }
+ case TERMINATE_EXTENSION_BGSCRIPT_FAILURE: {
+ const { id, error } = action;
+ const { installedExtensions, temporaryExtensions } = updateExtension(
+ state,
+ id,
+ {
+ lastTerminateBackgroundScriptError: error.message,
+ }
+ );
+ return Object.assign({}, state, {
+ installedExtensions,
+ temporaryExtensions,
+ });
+ }
+ case EXTENSION_BGSCRIPT_STATUS_UPDATED: {
+ const { id, backgroundScriptStatus } = action;
+ const { installedExtensions, temporaryExtensions } = updateExtension(
+ state,
+ id,
+ {
+ backgroundScriptStatus,
+ // Clear the last error if one was still set.
+ lastTerminateBackgroundScriptError: null,
+ }
+ );
+ return Object.assign({}, state, {
+ installedExtensions,
+ temporaryExtensions,
+ });
+ }
+
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ DebugTargetsState,
+ debugTargetsReducer,
+};
diff --git a/devtools/client/aboutdebugging/src/reducers/index.js b/devtools/client/aboutdebugging/src/reducers/index.js
new file mode 100644
index 0000000000..8f104a4ff7
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/reducers/index.js
@@ -0,0 +1,24 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ combineReducers,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+const {
+ debugTargetsReducer,
+} = require("resource://devtools/client/aboutdebugging/src/reducers/debug-targets-state.js");
+const {
+ runtimesReducer,
+} = require("resource://devtools/client/aboutdebugging/src/reducers/runtimes-state.js");
+const {
+ uiReducer,
+} = require("resource://devtools/client/aboutdebugging/src/reducers/ui-state.js");
+
+module.exports = combineReducers({
+ debugTargets: debugTargetsReducer,
+ runtimes: runtimesReducer,
+ ui: uiReducer,
+});
diff --git a/devtools/client/aboutdebugging/src/reducers/moz.build b/devtools/client/aboutdebugging/src/reducers/moz.build
new file mode 100644
index 0000000000..24d3382f5b
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/reducers/moz.build
@@ -0,0 +1,10 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "debug-targets-state.js",
+ "index.js",
+ "runtimes-state.js",
+ "ui-state.js",
+)
diff --git a/devtools/client/aboutdebugging/src/reducers/runtimes-state.js b/devtools/client/aboutdebugging/src/reducers/runtimes-state.js
new file mode 100644
index 0000000000..5acf35390a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/reducers/runtimes-state.js
@@ -0,0 +1,178 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ CONNECT_RUNTIME_CANCEL,
+ CONNECT_RUNTIME_FAILURE,
+ CONNECT_RUNTIME_NOT_RESPONDING,
+ CONNECT_RUNTIME_START,
+ CONNECT_RUNTIME_SUCCESS,
+ DISCONNECT_RUNTIME_SUCCESS,
+ RUNTIMES,
+ UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
+ REMOTE_RUNTIMES_UPDATED,
+ SELECTED_RUNTIME_ID_UPDATED,
+ THIS_FIREFOX_RUNTIME_CREATED,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const {
+ findRuntimeById,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtimes-state-helper.js");
+
+const {
+ remoteClientManager,
+} = require("resource://devtools/client/shared/remote-debugging/remote-client-manager.js");
+
+// Map between known runtime types and nodes in the runtimes state.
+const TYPE_TO_RUNTIMES_KEY = {
+ [RUNTIMES.THIS_FIREFOX]: "thisFirefoxRuntimes",
+ [RUNTIMES.NETWORK]: "networkRuntimes",
+ [RUNTIMES.USB]: "usbRuntimes",
+};
+
+function RuntimesState() {
+ return {
+ networkRuntimes: [],
+ selectedRuntimeId: null,
+ // "This Firefox" runtimes is an array for consistency, but it should only contain one
+ // runtime. This runtime will be added after initializing the application via
+ // THIS_FIREFOX_RUNTIME_CREATED.
+ thisFirefoxRuntimes: [],
+ usbRuntimes: [],
+ };
+}
+
+/**
+ * Update the runtime matching the provided runtimeId with the content of updatedRuntime,
+ * and return the new state.
+ *
+ * @param {String} runtimeId
+ * The id of the runtime to update
+ * @param {Object} updatedRuntime
+ * Object used to update the runtime matching the idea using Object.assign.
+ * @param {Object} state
+ * Current runtimes state.
+ * @return {Object} The updated state
+ */
+function _updateRuntimeById(runtimeId, updatedRuntime, state) {
+ // Find the array of runtimes that contains the updated runtime.
+ const runtime = findRuntimeById(runtimeId, state);
+ const key = TYPE_TO_RUNTIMES_KEY[runtime.type];
+ const runtimesToUpdate = state[key];
+
+ // Update the runtime with the provided updatedRuntime.
+ const updatedRuntimes = runtimesToUpdate.map(r => {
+ if (r.id === runtimeId) {
+ return Object.assign({}, r, updatedRuntime);
+ }
+ return r;
+ });
+ return Object.assign({}, state, { [key]: updatedRuntimes });
+}
+
+function runtimesReducer(state = RuntimesState(), action) {
+ switch (action.type) {
+ case CONNECT_RUNTIME_START: {
+ const { id } = action;
+ const updatedState = {
+ isConnecting: true,
+ isConnectionFailed: false,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: false,
+ };
+ return _updateRuntimeById(id, updatedState, state);
+ }
+
+ case CONNECT_RUNTIME_NOT_RESPONDING: {
+ const { id } = action;
+ return _updateRuntimeById(id, { isConnectionNotResponding: true }, state);
+ }
+
+ case CONNECT_RUNTIME_CANCEL: {
+ const { id } = action;
+ const updatedState = {
+ isConnecting: false,
+ isConnectionFailed: false,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: true,
+ };
+ return _updateRuntimeById(id, updatedState, state);
+ }
+
+ case CONNECT_RUNTIME_SUCCESS: {
+ const { id, runtimeDetails, type } = action.runtime;
+
+ // Update the remoteClientManager with the connected runtime.
+ const client = runtimeDetails.clientWrapper.client;
+ const runtimeInfo = runtimeDetails.info;
+ remoteClientManager.setClient(id, type, client, runtimeInfo);
+
+ const updatedState = {
+ isConnecting: false,
+ isConnectionFailed: false,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: false,
+ runtimeDetails,
+ };
+ return _updateRuntimeById(id, updatedState, state);
+ }
+
+ case CONNECT_RUNTIME_FAILURE: {
+ const { id } = action;
+ const updatedState = {
+ isConnecting: false,
+ isConnectionFailed: true,
+ isConnectionNotResponding: false,
+ isConnectionTimeout: false,
+ };
+ return _updateRuntimeById(id, updatedState, state);
+ }
+
+ case DISCONNECT_RUNTIME_SUCCESS: {
+ const { id, type } = action.runtime;
+ remoteClientManager.removeClient(id, type);
+ return _updateRuntimeById(id, { runtimeDetails: null }, state);
+ }
+
+ case SELECTED_RUNTIME_ID_UPDATED: {
+ const selectedRuntimeId = action.runtimeId || null;
+ return Object.assign({}, state, { selectedRuntimeId });
+ }
+
+ case UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS: {
+ const { connectionPromptEnabled } = action;
+ const { id: runtimeId } = action.runtime;
+ const runtime = findRuntimeById(runtimeId, state);
+ const runtimeDetails = Object.assign({}, runtime.runtimeDetails, {
+ connectionPromptEnabled,
+ });
+ return _updateRuntimeById(runtimeId, { runtimeDetails }, state);
+ }
+
+ case REMOTE_RUNTIMES_UPDATED: {
+ const { runtimes, runtimeType } = action;
+ const key = TYPE_TO_RUNTIMES_KEY[runtimeType];
+ return Object.assign({}, state, {
+ [key]: runtimes,
+ });
+ }
+
+ case THIS_FIREFOX_RUNTIME_CREATED: {
+ const { runtime } = action;
+ return Object.assign({}, state, {
+ thisFirefoxRuntimes: [runtime],
+ });
+ }
+
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ RuntimesState,
+ runtimesReducer,
+};
diff --git a/devtools/client/aboutdebugging/src/reducers/ui-state.js b/devtools/client/aboutdebugging/src/reducers/ui-state.js
new file mode 100644
index 0000000000..771358eaac
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/reducers/ui-state.js
@@ -0,0 +1,115 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ ADB_ADDON_STATUS_UPDATED,
+ ADB_READY_UPDATED,
+ DEBUG_TARGET_COLLAPSIBILITY_UPDATED,
+ HIDE_PROFILER_DIALOG,
+ NETWORK_LOCATIONS_UPDATE_SUCCESS,
+ PROFILER_PAGE_CONTEXT,
+ SELECT_PAGE_SUCCESS,
+ SHOW_PROFILER_DIALOG,
+ SWITCH_PROFILER_CONTEXT,
+ TEMPORARY_EXTENSION_INSTALL_FAILURE,
+ TEMPORARY_EXTENSION_INSTALL_SUCCESS,
+ USB_RUNTIMES_SCAN_START,
+ USB_RUNTIMES_SCAN_SUCCESS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+function UiState(
+ locations = [],
+ debugTargetCollapsibilities = {},
+ showHiddenAddons = false
+) {
+ return {
+ adbAddonStatus: null,
+ debugTargetCollapsibilities,
+ isAdbReady: false,
+ isScanningUsb: false,
+ networkLocations: locations,
+ profilerContext: PROFILER_PAGE_CONTEXT.DEVTOOLS_REMOTE,
+ selectedPage: null,
+ showProfilerDialog: false,
+ showHiddenAddons,
+ temporaryInstallError: null,
+ };
+}
+
+function uiReducer(state = UiState(), action) {
+ switch (action.type) {
+ case ADB_ADDON_STATUS_UPDATED: {
+ const { adbAddonStatus } = action;
+ return Object.assign({}, state, { adbAddonStatus });
+ }
+
+ case ADB_READY_UPDATED: {
+ const { isAdbReady } = action;
+ return Object.assign({}, state, { isAdbReady });
+ }
+
+ case DEBUG_TARGET_COLLAPSIBILITY_UPDATED: {
+ const { isCollapsed, key } = action;
+ const debugTargetCollapsibilities = new Map(
+ state.debugTargetCollapsibilities
+ );
+ debugTargetCollapsibilities.set(key, isCollapsed);
+ return Object.assign({}, state, { debugTargetCollapsibilities });
+ }
+
+ case NETWORK_LOCATIONS_UPDATE_SUCCESS: {
+ const { locations } = action;
+ return Object.assign({}, state, { networkLocations: locations });
+ }
+
+ case SELECT_PAGE_SUCCESS: {
+ const { page } = action;
+ return Object.assign({}, state, { selectedPage: page });
+ }
+
+ case SHOW_PROFILER_DIALOG: {
+ return Object.assign({}, state, {
+ showProfilerDialog: true,
+ // Always start in the devtools-remote view.
+ profilerContext: "devtools-remote",
+ });
+ }
+
+ case HIDE_PROFILER_DIALOG: {
+ return Object.assign({}, state, { showProfilerDialog: false });
+ }
+
+ case SWITCH_PROFILER_CONTEXT: {
+ const { profilerContext } = action;
+ return Object.assign({}, state, { profilerContext });
+ }
+
+ case USB_RUNTIMES_SCAN_START: {
+ return Object.assign({}, state, { isScanningUsb: true });
+ }
+
+ case USB_RUNTIMES_SCAN_SUCCESS: {
+ return Object.assign({}, state, { isScanningUsb: false });
+ }
+
+ case TEMPORARY_EXTENSION_INSTALL_SUCCESS: {
+ return Object.assign({}, state, { temporaryInstallError: null });
+ }
+
+ case TEMPORARY_EXTENSION_INSTALL_FAILURE: {
+ const { error } = action;
+ return Object.assign({}, state, { temporaryInstallError: error });
+ }
+
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ UiState,
+ uiReducer,
+};
diff --git a/devtools/client/aboutdebugging/src/types/debug-target.js b/devtools/client/aboutdebugging/src/types/debug-target.js
new file mode 100644
index 0000000000..c2f419082a
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/types/debug-target.js
@@ -0,0 +1,71 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ DEBUG_TARGETS,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const extensionTargetDetails = {
+ // actor ID for this extention.
+ actor: PropTypes.string.isRequired,
+ location: PropTypes.string.isRequired,
+ // error message forwarded from the WebExtensions internals if terminating the background script failed.
+ lastTerminateBackgroundScriptError: PropTypes.string,
+ // manifestURL points to the manifest.json file. This URL is only valid when debugging
+ // local extensions so it might be null.
+ manifestURL: PropTypes.string,
+ // error message forwarded from the addon manager during reloading temporary extension.
+ reloadError: PropTypes.string,
+ // unique extension id.
+ uuid: PropTypes.string.isRequired,
+ // warning messages forwarded from the addon manager.
+ warnings: PropTypes.arrayOf(PropTypes.string).isRequired,
+};
+
+const processTargetDetails = {
+ // Description for the process.
+ description: PropTypes.string.isRequired,
+};
+
+const tabTargetDetails = {
+ // the url of the tab.
+ url: PropTypes.string.isRequired,
+};
+
+const workerTargetDetails = {
+ // (service worker specific) one of "LISTENING", "NOT_LISTENING". undefined otherwise.
+ fetch: PropTypes.string,
+ // front for the ServiceWorkerRegistration related to this service worker.
+ registrationFront: PropTypes.object,
+ // (service worker specific) scope of the service worker registration.
+ scope: PropTypes.string,
+ // (service worker specific) one of "RUNNING", "REGISTERING", "STOPPED".
+ status: PropTypes.string,
+};
+
+const debugTarget = {
+ // details property will contain a type-specific object.
+ details: PropTypes.oneOfType([
+ PropTypes.shape(extensionTargetDetails),
+ PropTypes.shape(processTargetDetails),
+ PropTypes.shape(tabTargetDetails),
+ PropTypes.shape(workerTargetDetails),
+ ]).isRequired,
+ // icon to display for the debug target.
+ icon: PropTypes.string.isRequired,
+ // unique id for the target (unique in the scope of the application lifecycle).
+ // - extensions: {String} extension id (for instance "someextension@mozilla.org")
+ // - tabs: {Number} browserId
+ // - workers: {String} id for the WorkerTargetActor corresponding to the worker
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
+ // display name for the debug target.
+ name: PropTypes.string.isRequired,
+ // one of "extension", "tab", "worker", "process".
+ type: PropTypes.oneOf(Object.values(DEBUG_TARGETS)).isRequired,
+};
+
+exports.debugTarget = PropTypes.shape(debugTarget);
diff --git a/devtools/client/aboutdebugging/src/types/index.js b/devtools/client/aboutdebugging/src/types/index.js
new file mode 100644
index 0000000000..288a063be1
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/types/index.js
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const debugTargetTypes = require("resource://devtools/client/aboutdebugging/src/types/debug-target.js");
+const runtimeTypes = require("resource://devtools/client/aboutdebugging/src/types/runtime.js");
+const uiTypes = require("resource://devtools/client/aboutdebugging/src/types/ui.js");
+
+module.exports = Object.assign(
+ {},
+ {
+ ...debugTargetTypes,
+ ...runtimeTypes,
+ ...uiTypes,
+ }
+);
diff --git a/devtools/client/aboutdebugging/src/types/moz.build b/devtools/client/aboutdebugging/src/types/moz.build
new file mode 100644
index 0000000000..a58a6e0e28
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/types/moz.build
@@ -0,0 +1,10 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "debug-target.js",
+ "index.js",
+ "runtime.js",
+ "ui.js",
+)
diff --git a/devtools/client/aboutdebugging/src/types/runtime.js b/devtools/client/aboutdebugging/src/types/runtime.js
new file mode 100644
index 0000000000..cef9ace204
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/types/runtime.js
@@ -0,0 +1,164 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ ClientWrapper,
+} = require("resource://devtools/client/aboutdebugging/src/modules/client-wrapper.js");
+const {
+ COMPATIBILITY_STATUS,
+} = require("resource://devtools/client/shared/remote-debugging/version-checker.js");
+
+const runtimeInfo = {
+ // device name which is running the runtime,
+ // unavailable on this-firefox runtime
+ deviceName: PropTypes.string,
+
+ // icon which represents the kind of runtime
+ icon: PropTypes.string.isRequired,
+
+ // name of runtime such as "Firefox Nightly"
+ name: PropTypes.string.isRequired,
+
+ // operating system on which the runtime runs such as "Android", "Linux"
+ os: PropTypes.string.isRequired,
+
+ // runtime type, for instance "network", "usb" ...
+ type: PropTypes.string.isRequired,
+
+ // version of runtime
+ version: PropTypes.string.isRequired,
+};
+
+const compatibilityReport = {
+ // build ID for the current runtime (date formatted as yyyyMMdd eg "20193101")
+ localID: PropTypes.string.isRequired,
+
+ // "platform" version for the current runtime (eg "67.0a1")
+ localVersion: PropTypes.string.isRequired,
+
+ // minimum "platform" version supported for remote debugging by the current runtime
+ minVersion: PropTypes.string.isRequired,
+
+ // build ID for the target runtime (date formatted as yyyyMMdd eg "20193101")
+ runtimeID: PropTypes.string.isRequired,
+
+ // "platform" version for the target runtime (eg "67.0a1")
+ runtimeVersion: PropTypes.string.isRequired,
+
+ // report result, either COMPATIBLE, TOO_OLD or TOO_RECENT
+ status: PropTypes.oneOf(Object.values(COMPATIBILITY_STATUS)).isRequired,
+};
+exports.compatibilityReport = PropTypes.shape(compatibilityReport);
+
+const runtimeDetails = {
+ // True if this runtime supports debugging service workers.
+ // This might be undefined when connecting to runtimes older than Fx 66
+ canDebugServiceWorkers: PropTypes.bool,
+
+ // ClientWrapper built using a DevToolsClient for the runtime
+ clientWrapper: PropTypes.instanceOf(ClientWrapper).isRequired,
+
+ // compatibility report to check if the target runtime is in range of the backward
+ // compatibility policy for DevTools remote debugging.
+ compatibilityReport: PropTypes.shape(compatibilityReport).isRequired,
+
+ // reflect devtools.debugger.prompt-connection preference of this runtime
+ connectionPromptEnabled: PropTypes.bool.isRequired,
+
+ // runtime information
+ info: PropTypes.shape(runtimeInfo).isRequired,
+
+ // True if service workers should be available in the target runtime. Service workers
+ // can be disabled via preferences or if the runtime runs in fully private browsing
+ // mode.
+ serviceWorkersAvailable: PropTypes.bool.isRequired,
+};
+exports.runtimeDetails = PropTypes.shape(runtimeDetails);
+
+const networkRuntimeConnectionParameter = {
+ // host name of devtools server to connect
+ host: PropTypes.string.isRequired,
+
+ // port number of devtools server to connect
+ port: PropTypes.number.isRequired,
+};
+
+const usbRuntimeConnectionParameter = {
+ // device id
+ deviceId: PropTypes.string.isRequired,
+ // socket path to connect devtools server
+ socketPath: PropTypes.string.isRequired,
+};
+
+const runtimeExtra = {
+ // parameter to connect to devtools server
+ // unavailable on unavailable/unplugged runtimes
+ connectionParameters: PropTypes.oneOfType([
+ PropTypes.shape(networkRuntimeConnectionParameter),
+ PropTypes.shape(usbRuntimeConnectionParameter),
+ ]),
+
+ // device name
+ // unavailable on this-firefox and network-location runtimes
+ deviceName: PropTypes.string,
+
+ // version of the application coming from ADB, only available via USB. Useful for Fenix
+ // runtimes, because the version can't be retrieved from Service.appInfo.
+ adbPackageVersion: PropTypes.string,
+};
+
+const runtime = {
+ // unique id for the runtime
+ id: PropTypes.string.isRequired,
+
+ // object containing non standard properties that depend on the runtime type,
+ // unavailable on this-firefox runtime
+ extra: PropTypes.shape(runtimeExtra),
+
+ // this flag will be true when start to connect to the runtime, will be false after
+ // connected or has failures.
+ isConnecting: PropTypes.bool.isRequired,
+
+ // this flag will be true when the connection failed.
+ isConnectionFailed: PropTypes.bool.isRequired,
+
+ // will be true if connecting to runtime is taking time, will be false after connecting
+ // or failing.
+ isConnectionNotResponding: PropTypes.bool.isRequired,
+
+ // this flag will be true when the connection was timeout.
+ isConnectionTimeout: PropTypes.bool.isRequired,
+
+ // this flag will be true when the detected runtime is Fenix (Firefox Preview).
+ // Fenix need specific logic to get their display name, version and logos.
+ // Discussion ongoing in https://github.com/mozilla-mobile/fenix/issues/2016
+ isFenix: PropTypes.bool.isRequired,
+
+ // unavailable runtimes are placeholders for devices where the runtime has not been
+ // started yet. For instance an ADB device connected without a compatible runtime
+ // running.
+ isUnavailable: PropTypes.bool.isRequired,
+
+ // unplugged runtimes are placeholders for devices that are no longer available. For
+ // instance a USB device that was unplugged from the computer.
+ isUnplugged: PropTypes.bool.isRequired,
+
+ // display name of the runtime
+ name: PropTypes.string.isRequired,
+
+ // available after the connection to the runtime is established
+ // unavailable on disconnected runtimes
+ runtimeDetails: PropTypes.shape(runtimeDetails),
+
+ // runtime type, for instance "network", "usb" ...
+ type: PropTypes.string.isRequired,
+};
+
+/**
+ * Export type of runtime
+ */
+exports.runtime = PropTypes.shape(runtime);
diff --git a/devtools/client/aboutdebugging/src/types/ui.js b/devtools/client/aboutdebugging/src/types/ui.js
new file mode 100644
index 0000000000..68daaaa5d2
--- /dev/null
+++ b/devtools/client/aboutdebugging/src/types/ui.js
@@ -0,0 +1,85 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ ADB_ADDON_STATES,
+} = require("resource://devtools/client/shared/remote-debugging/adb/adb-addon.js");
+const {
+ DEBUG_TARGET_PANE,
+ PAGE_TYPES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+function makeCollapsibilitiesType(isRequired) {
+ return (props, propName, componentName, _, propFullName) => {
+ if (isRequired && props[propName] === null) {
+ return new Error(
+ `Missing prop ${propFullName} marked as required in ${componentName}`
+ );
+ }
+
+ const error = new Error(
+ `Invalid prop ${propFullName} (${props[propName]}) supplied to ` +
+ `${componentName}. Collapsibilities needs to be a Map<DEBUG_TARGET_PANE, bool>`
+ );
+
+ const map = props[propName];
+
+ // check that the prop is a Map
+ if (!(map instanceof Map)) {
+ return error;
+ }
+
+ // check that the keys refer to debug target panes
+ const areKeysValid = [...map.keys()].every(x =>
+ Object.values(DEBUG_TARGET_PANE).includes(x)
+ );
+ // check that the values are boolean
+ const areValuesValid = [...map.values()].every(x => typeof x === "boolean");
+ // error if values or keys fail their checks
+ if (!areKeysValid || !areValuesValid) {
+ return error;
+ }
+
+ return null;
+ };
+}
+
+function makeLocationType(isRequired) {
+ return (props, propName, componentName, _, propFullName) => {
+ if (isRequired && props[propName] === null) {
+ return new Error(
+ `Missing prop ${propFullName} marked as required in ${componentName}`
+ );
+ }
+
+ // check that location is a string with a semicolon in it
+ if (!/\:/.test(props[propName])) {
+ return new Error(
+ `Invalid prop ${propFullName} (${props[propName]}) supplied to ` +
+ `${componentName}. Location needs to be a string with a host:port format`
+ );
+ }
+
+ return null;
+ };
+}
+
+const collapsibilities = makeCollapsibilitiesType(false);
+collapsibilities.isRequired = makeCollapsibilitiesType(true);
+
+const location = makeLocationType(false);
+location.isRequired = makeLocationType(true);
+
+module.exports = {
+ adbAddonStatus: PropTypes.oneOf(Object.values(ADB_ADDON_STATES)),
+ // a Map<DEBUG_TARGET_PANE, bool>, to flag collapsed/expanded status of the
+ // debug target panes
+ collapsibilities,
+ // a string with "host:port" format, used for network locations
+ location,
+ page: PropTypes.oneOf(Object.values(PAGE_TYPES)),
+};
diff --git a/devtools/client/aboutdebugging/test/browser/browser.ini b/devtools/client/aboutdebugging/test/browser/browser.ini
new file mode 100644
index 0000000000..4b471537bc
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser.ini
@@ -0,0 +1,167 @@
+[DEFAULT]
+tags = devtools
+subsuite = devtools
+prefs =
+ # showHiddenAddons has different values depending on the build flags, ensure consistent
+ # test behavior by always setting it to false.
+ devtools.aboutdebugging.showHiddenAddons=false
+support-files =
+ empty.html
+ head.js
+ helper-adb.js
+ helper-addons.js
+ helper-collapsibilities.js
+ helper-mocks.js
+ helper-real-usb.js
+ helper-serviceworker.js
+ helper-telemetry.js
+ mocks/*
+ resources/bad-extensions/*
+ resources/packaged-extension/*
+ resources/service-workers/*
+ resources/test-adb-extension/*
+ resources/test-temporary-extension/*
+ resources/doc_aboutdebugging_devtoolstoolbox_breakpoint.html
+ resources/script_aboutdebugging_devtoolstoolbox_breakpoint.js
+ test-tab-favicons.html
+ !/devtools/client/debugger/test/mochitest/shared-head.js
+ !/devtools/client/shared/test/shared-head.js
+ !/devtools/client/shared/test/telemetry-test-helpers.js
+ !/devtools/client/webconsole/test/browser/shared-head.js
+
+[browser_aboutdebugging_addons_debug_console.js]
+tags = webextensions
+[browser_aboutdebugging_addons_debug_debugger.js]
+tags = webextensions
+[browser_aboutdebugging_addons_debug_inspector.js]
+tags = webextensions
+[browser_aboutdebugging_addons_debug_nobg.js]
+tags = webextensions
+[browser_aboutdebugging_addons_debug_popup.js]
+skip-if =
+ verify && debug # verify: crashes on shutdown, timeouts
+ os == "linux" && debug # linux debug Bug 1299001
+ win10_2004 && !debug # Bug 1744778
+tags = webextensions
+[browser_aboutdebugging_addons_debug_reload.js]
+tags = webextensions
+[browser_aboutdebugging_addons_debug_storage.js]
+tags = webextensions
+[browser_aboutdebugging_addons_debug_toolbox.js]
+tags = webextensions
+[browser_aboutdebugging_addons_eventpage_actions_and_status.js]
+tags = webextensions
+[browser_aboutdebugging_addons_eventpage_terminate_on_idle.js]
+tags = webextensions
+[browser_aboutdebugging_addons_manifest_url.js]
+skip-if =
+ os == "mac" && debug # ADB start() fails on linux 32, see Bug 1499638, macosx1014 debug due to 1514751
+[browser_aboutdebugging_addons_remote_runtime.js]
+[browser_aboutdebugging_addons_temporary_addon_buttons.js]
+skip-if =
+ os == "win" # On windows the AddonManager locks the XPI file loaded as a temporary extension and we can not test the reload of the extension.
+[browser_aboutdebugging_addons_temporary_id_message.js]
+[browser_aboutdebugging_addons_temporary_install_error.js]
+[browser_aboutdebugging_addons_temporary_install_path.js]
+[browser_aboutdebugging_addons_temporary_reload_error.js]
+skip-if =
+ os == "win" # On windows the AddonManager locks the XPI file loaded as a temporary extension and we can not test the reload of the extension.
+[browser_aboutdebugging_addons_warnings.js]
+[browser_aboutdebugging_connect_networklocations.js]
+[browser_aboutdebugging_connect_toggle_usb_devices.js]
+[browser_aboutdebugging_connection_prompt_setting.js]
+[browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js]
+[browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js]
+[browser_aboutdebugging_debug-target-pane_empty.js]
+[browser_aboutdebugging_debug-target-pane_usb_runtime.js]
+[browser_aboutdebugging_devtools.js]
+[browser_aboutdebugging_devtoolstoolbox_breakpoint.js]
+[browser_aboutdebugging_devtoolstoolbox_contextmenu.js]
+[browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js]
+[browser_aboutdebugging_devtoolstoolbox_focus.js]
+[browser_aboutdebugging_devtoolstoolbox_menubar.js]
+[browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js]
+[browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js]
+[browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js]
+[browser_aboutdebugging_devtoolstoolbox_reload.js]
+skip-if =
+ verify
+ ccov
+ os == "linux" && debug #bug 1544828, test loads the toolbox 2 times for each panel, might timeout or OOM
+[browser_aboutdebugging_devtoolstoolbox_shortcuts.js]
+skip-if =
+ ccov
+ os == "linux" # Bug 1521349, Bug 1548015, Bug 1544828
+[browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js]
+[browser_aboutdebugging_devtoolstoolbox_target_destroyed.js]
+skip-if =
+ debug
+ asan # This test leaks. See bug 1529005
+[browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js]
+[browser_aboutdebugging_devtoolstoolbox_zoom.js]
+[browser_aboutdebugging_fenix_runtime_display.js]
+[browser_aboutdebugging_fenix_runtime_node_picker.js]
+[browser_aboutdebugging_message_close.js]
+[browser_aboutdebugging_navigate.js]
+[browser_aboutdebugging_persist_connection.js]
+[browser_aboutdebugging_addons_popup_picker.js]
+[browser_aboutdebugging_process_category.js]
+[browser_aboutdebugging_process_main.js]
+[browser_aboutdebugging_process_main_local.js]
+skip-if = debug
+[browser_aboutdebugging_profiler_dialog.js]
+support-files =
+ !/devtools/client/performance-new/test/browser/helpers.js
+[browser_aboutdebugging_real_usb_runtime_page_runtime_info.js]
+[browser_aboutdebugging_real_usb_sidebar.js]
+[browser_aboutdebugging_routes.js]
+[browser_aboutdebugging_rtl.js]
+[browser_aboutdebugging_runtime_compatibility_warning.js]
+[browser_aboutdebugging_runtime_disconnect_remote_runtime.js]
+[browser_aboutdebugging_runtime_remote_runtime_buttons.js]
+[browser_aboutdebugging_runtime_usbclient_closed.js]
+[browser_aboutdebugging_select_network_runtime.js]
+[browser_aboutdebugging_select_page_with_serviceworker.js]
+[browser_aboutdebugging_serviceworker_console.js]
+[browser_aboutdebugging_serviceworker_fetch_flag.js]
+skip-if =
+ os == "win" && debug
+ os == "mac"
+ os == "linux" #Bug 1529824
+[browser_aboutdebugging_serviceworker_not_compatible.js]
+[browser_aboutdebugging_serviceworker_push.js]
+[browser_aboutdebugging_serviceworker_pushservice_url.js]
+[browser_aboutdebugging_serviceworker_runtime-page.js]
+[browser_aboutdebugging_serviceworker_start.js]
+[browser_aboutdebugging_serviceworker_status.js]
+[browser_aboutdebugging_serviceworker_timeout.js]
+skip-if =
+ debug
+ asan # Frequent intermittent failures, Bug 1522800
+[browser_aboutdebugging_serviceworker_unregister.js]
+[browser_aboutdebugging_sidebar_connection_state.js]
+[browser_aboutdebugging_sidebar_network_runtimes.js]
+[browser_aboutdebugging_sidebar_usb_runtime.js]
+[browser_aboutdebugging_sidebar_usb_runtime_connect.js]
+[browser_aboutdebugging_sidebar_usb_runtime_refresh.js]
+[browser_aboutdebugging_sidebar_usb_runtime_select.js]
+[browser_aboutdebugging_sidebar_usb_status.js]
+[browser_aboutdebugging_sidebar_usb_unavailable_runtime.js]
+[browser_aboutdebugging_sidebar_usb_unplugged_device.js]
+[browser_aboutdebugging_hidden_addons.js]
+[browser_aboutdebugging_tab_favicons.js]
+[browser_aboutdebugging_tab_navigate.js]
+[browser_aboutdebugging_tab_zombietab.js]
+[browser_aboutdebugging_telemetry_basic.js]
+[browser_aboutdebugging_telemetry_connection_attempt.js]
+[browser_aboutdebugging_telemetry_inspect.js]
+[browser_aboutdebugging_telemetry_navigate.js]
+[browser_aboutdebugging_telemetry_runtime_actions.js]
+[browser_aboutdebugging_telemetry_runtime_connected_details.js]
+[browser_aboutdebugging_telemetry_runtime_updates.js]
+[browser_aboutdebugging_telemetry_runtime_updates_multi.js]
+[browser_aboutdebugging_telemetry_runtime_updates_network.js]
+[browser_aboutdebugging_thisfirefox.js]
+[browser_aboutdebugging_thisfirefox_runtime_info.js]
+[browser_aboutdebugging_thisfirefox_worker_inspection.js]
+[browser_aboutdebugging_workers_remote_runtime.js]
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js
new file mode 100644
index 0000000000..1ed16dd1b0
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js
@@ -0,0 +1,440 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
+requestLongerTimeout(2);
+
+const ADDON_ID = "test-devtools-webextension@mozilla.org";
+const ADDON_NAME = "test-devtools-webextension";
+
+const OTHER_ADDON_ID = "other-test-devtools-webextension@mozilla.org";
+const OTHER_ADDON_NAME = "other-test-devtools-webextension";
+
+const POPUPONLY_ADDON_ID = "popuponly-test-devtools-webextension@mozilla.org";
+const POPUPONLY_ADDON_NAME = "popuponly-test-devtools-webextension";
+
+const BACKGROUND_ADDON_ID = "background-test-devtools-webextension@mozilla.org";
+const BACKGROUND_ADDON_NAME = "background-test-devtools-webextension";
+
+/**
+ * This test file ensures that the webextension addon developer toolbox:
+ * - when the debug button is clicked on a webextension, the opened toolbox
+ * has a working webconsole with the background page as default target;
+ */
+add_task(async function testWebExtensionsToolboxWebConsole() {
+ await pushPref("devtools.webconsole.filter.css", true);
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ window.myWebExtensionAddonFunction = function () {
+ console.log(
+ "Background page function called",
+ this.browser.runtime.getManifest()
+ );
+ };
+
+ const style = document.createElement("style");
+ style.textContent = "* { color: error; }";
+ document.documentElement.appendChild(style);
+
+ throw new Error("Background page exception");
+ },
+ extraProperties: {
+ browser_action: {
+ default_title: "WebExtension Popup Debugging",
+ default_popup: "popup.html",
+ default_area: "navbar",
+ },
+ },
+ files: {
+ "popup.html": `<!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="utf-8">
+ <script src="popup.js"></script>
+ </head>
+ <body>
+ Popup
+ </body>
+ </html>
+ `,
+ "popup.js": function () {
+ console.log("Popup log");
+
+ const style = document.createElement("style");
+ style.textContent = "* { color: popup-error; }";
+ document.documentElement.appendChild(style);
+
+ throw new Error("Popup exception");
+ },
+ },
+ id: ADDON_ID,
+ name: ADDON_NAME,
+ },
+ document
+ );
+
+ // Install another addon in order to ensure we don't get its logs
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ console.log("Other addon log");
+
+ const style = document.createElement("style");
+ style.textContent = "* { background-color: error; }";
+ document.documentElement.appendChild(style);
+
+ throw new Error("Other addon exception");
+ },
+ extraProperties: {
+ browser_action: {
+ default_title: "Other addon popup",
+ default_popup: "other-popup.html",
+ default_area: "navbar",
+ },
+ },
+ files: {
+ "other-popup.html": `<!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="utf-8">
+ <script src="other-popup.js"></script>
+ </head>
+ <body>
+ Other popup
+ </body>
+ </html>
+ `,
+ "other-popup.js": function () {
+ console.log("Other popup log");
+
+ const style = document.createElement("style");
+ style.textContent = "* { background-color: popup-error; }";
+ document.documentElement.appendChild(style);
+
+ throw new Error("Other popup exception");
+ },
+ },
+ id: OTHER_ADDON_ID,
+ name: OTHER_ADDON_NAME,
+ },
+ document
+ );
+
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ADDON_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+ const webconsole = await toolbox.selectTool("webconsole");
+ const { hud } = webconsole;
+
+ info("Trigger some code in the background page logging some stuff");
+ const onMessage = waitUntil(() => {
+ return !!findMessagesByType(hud, "Background page exception", ".error")
+ .length;
+ });
+ hud.ui.wrapper.dispatchEvaluateExpression("myWebExtensionAddonFunction()");
+ await onMessage;
+
+ info("Open the two add-ons popups to cover popups messages");
+ const onPopupMessage = waitUntil(() => {
+ return !!findMessagesByType(hud, "Popup exception", ".error").length;
+ });
+ clickOnAddonWidget(OTHER_ADDON_ID);
+ clickOnAddonWidget(ADDON_ID);
+ await onPopupMessage;
+
+ info("Wait a bit to catch unexpected duplicates or mixed up messages");
+ await wait(1000);
+
+ is(
+ findMessagesByType(hud, "Background page exception", ".error").length,
+ 1,
+ "We get the background page exception"
+ );
+ is(
+ findMessagesByType(hud, "Popup exception", ".error").length,
+ 1,
+ "We get the popup exception"
+ );
+ is(
+ findMessagesByType(
+ hud,
+ "Expected color but found ‘error’. Error in parsing value for ‘color’. Declaration dropped.",
+ ".warn"
+ ).length,
+ 1,
+ "We get the addon's background page CSS error message"
+ );
+ is(
+ findMessagesByType(
+ hud,
+ "Expected color but found ‘popup-error’. Error in parsing value for ‘color’. Declaration dropped.",
+ ".warn"
+ ).length,
+ 1,
+ "We get the addon's popup CSS error message"
+ );
+
+ // Verify that we don't get the other addon log and errors
+ ok(
+ !findMessageByType(hud, "Other addon log", ".console-api"),
+ "We don't get the other addon log"
+ );
+ ok(
+ !findMessageByType(hud, "Other addon exception", ".console-api"),
+ "We don't get the other addon exception"
+ );
+ ok(
+ !findMessageByType(hud, "Other popup log", ".console-api"),
+ "We don't get the other addon popup log"
+ );
+ ok(
+ !findMessageByType(hud, "Other popup exception", ".error"),
+ "We don't get the other addon popup exception"
+ );
+ ok(
+ !findMessageByType(
+ hud,
+ "Expected color but found ‘error’. Error in parsing value for ‘background-color’. Declaration dropped.",
+ ".warn"
+ ),
+ "We don't get the other addon's background page CSS error message"
+ );
+ ok(
+ !findMessageByType(
+ hud,
+ "Expected color but found ‘popup-error’. Error in parsing value for ‘background-color’. Declaration dropped.",
+ ".warn"
+ ),
+ "We don't get the other addon's popup CSS error message"
+ );
+
+ // Verify that console evaluations still work after reloading the page
+ info("Reload the webextension document");
+ const { onDomCompleteResource } =
+ await waitForNextTopLevelDomCompleteResource(toolbox.commands);
+ hud.ui.wrapper.dispatchEvaluateExpression("location.reload()");
+ await onDomCompleteResource;
+
+ info("Try to evaluate something after reload");
+
+ const onEvaluationResultAfterReload = waitUntil(() =>
+ findMessageByType(hud, "result:2", ".result")
+ );
+ const onMessageAfterReload = waitUntil(() =>
+ findMessageByType(hud, "message after reload", ".console-api")
+ );
+ hud.ui.wrapper.dispatchEvaluateExpression(
+ "console.log('message after reload'); 'result:' + (1 + 1)"
+ );
+ // Both cover that the console.log worked
+ await onMessageAfterReload;
+ // And we received the evaluation result
+ await onEvaluationResultAfterReload;
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+
+ // Note that it seems to be important to remove the addons in the reverse order
+ // from which they were installed...
+ await removeTemporaryExtension(OTHER_ADDON_NAME, document);
+ await removeTemporaryExtension(ADDON_NAME, document);
+ await removeTab(tab);
+});
+
+add_task(async function testWebExtensionNoBgScript() {
+ await pushPref("devtools.webconsole.filter.css", true);
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ extraProperties: {
+ browser_action: {
+ default_title: "WebExtension Popup Only",
+ default_popup: "popup.html",
+ default_area: "navbar",
+ },
+ },
+ files: {
+ "popup.html": `<!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="utf-8">
+ <script src="popup.js"></script>
+ </head>
+ <body>
+ Popup
+ </body>
+ </html>
+ `,
+ "popup.js": function () {
+ console.log("Popup-only log");
+
+ const style = document.createElement("style");
+ style.textContent = "* { color: popup-only-error; }";
+ document.documentElement.appendChild(style);
+
+ throw new Error("Popup-only exception");
+ },
+ },
+ id: POPUPONLY_ADDON_ID,
+ name: POPUPONLY_ADDON_NAME,
+ },
+ document
+ );
+
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ POPUPONLY_ADDON_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+ const webconsole = await toolbox.selectTool("webconsole");
+ const { hud } = webconsole;
+
+ info("Open the add-on popup");
+ const onPopupMessage = waitUntil(() => {
+ return !!findMessagesByType(hud, "Popup-only exception", ".error").length;
+ });
+ clickOnAddonWidget(POPUPONLY_ADDON_ID);
+ await onPopupMessage;
+
+ info("Wait a bit to catch unexpected duplicates or mixed up messages");
+ await wait(1000);
+ is(
+ findMessagesByType(hud, "Popup-only exception", ".error").length,
+ 1,
+ "We get the popup exception"
+ );
+ is(
+ findMessagesByType(hud, "Popup-only log", ".console-api").length,
+ 1,
+ "We get the addon's popup log"
+ );
+ is(
+ findMessagesByType(
+ hud,
+ "Expected color but found ‘popup-only-error’. Error in parsing value for ‘color’. Declaration dropped.",
+ ".warn"
+ ).length,
+ 1,
+ "We get the addon's popup CSS error message"
+ );
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(POPUPONLY_ADDON_NAME, document);
+ await removeTab(tab);
+});
+
+// Check that reloading the addon several times does not break the console,
+// see Bug 1778951.
+add_task(async function testWebExtensionTwoReloads() {
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ console.log("Background page log");
+ },
+ extraProperties: {
+ browser_action: {
+ default_title: "WebExtension with background script",
+ default_popup: "popup.html",
+ default_area: "navbar",
+ },
+ },
+ files: {
+ "popup.html": `<!DOCTYPE html>
+ <html>
+ <body>
+ Popup
+ </body>
+ </html>
+ `,
+ },
+ id: BACKGROUND_ADDON_ID,
+ name: BACKGROUND_ADDON_NAME,
+ },
+ document
+ );
+
+ // Retrieve the addonTarget element before calling `openAboutDevtoolsToolbox`,
+ // otherwise it will pick the about:devtools-toolbox tab with the same name
+ // instead.
+ const addonTarget = findDebugTargetByText(BACKGROUND_ADDON_NAME, document);
+
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ BACKGROUND_ADDON_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+ const webconsole = await toolbox.selectTool("webconsole");
+ const { hud } = webconsole;
+
+ // Verify that console evaluations still work after reloading the addon
+ info("Reload the webextension itself");
+ let { onDomCompleteResource } = await waitForNextTopLevelDomCompleteResource(
+ toolbox.commands
+ );
+ const reloadButton = addonTarget.querySelector(
+ ".qa-temporary-extension-reload-button"
+ );
+ reloadButton.click();
+ await onDomCompleteResource;
+
+ info("Try to evaluate something after 1st addon reload");
+ // Wait before evaluating the message, otherwise they might be cleaned up by
+ // the console UI.
+ info("Wait until the background script log is visible");
+ await waitUntil(() =>
+ findMessageByType(hud, "Background page log", ".message")
+ );
+
+ hud.ui.wrapper.dispatchEvaluateExpression("40+1");
+ await waitUntil(() => findMessageByType(hud, "41", ".result"));
+
+ info("Reload the extension a second time");
+ ({ onDomCompleteResource } = await waitForNextTopLevelDomCompleteResource(
+ toolbox.commands
+ ));
+ reloadButton.click();
+ await onDomCompleteResource;
+
+ info("Wait until the background script log is visible - after reload");
+ await waitUntil(() =>
+ findMessageByType(hud, "Background page log", ".message")
+ );
+
+ info("Try to evaluate something after 2nd addon reload");
+ hud.ui.wrapper.dispatchEvaluateExpression("40+2");
+ await waitUntil(() => findMessageByType(hud, "42", ".result"));
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(BACKGROUND_ADDON_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js
new file mode 100644
index 0000000000..0e100931a7
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js
@@ -0,0 +1,87 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+const { LocalizationHelper } = require("resource://devtools/shared/l10n.js");
+const L10N = new LocalizationHelper(
+ "devtools/client/locales/toolbox.properties"
+);
+
+add_task(async () => {
+ const EXTENSION_NAME = "temporary-web-extension";
+ const EXTENSION_ID = "test-devtools@mozilla.org";
+
+ await enableExtensionDebugging();
+
+ info(
+ "The debugger should show the source codes of extension even if " +
+ "devtools.chrome.enabled and devtools.debugger.remote-enabled are off"
+ );
+ await pushPref("devtools.chrome.enabled", false);
+ await pushPref("devtools.debugger.remote-enabled", false);
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ window.someRandomMethodName = () => {
+ // This will not be referred from anywhere.
+ // However this is necessary to show as the source code in the debugger.
+ };
+ },
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ },
+ document
+ );
+
+ // Select the debugger right away to avoid any noise coming from the inspector.
+ await pushPref("devtools.toolbox.selectedTool", "jsdebugger");
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ EXTENSION_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+ const { panelWin } = toolbox.getCurrentPanel();
+
+ info("Check the state of redux");
+ ok(
+ panelWin.dbg.store.getState().sourcesTree.isWebExtension,
+ "isWebExtension flag in sourcesTree is true"
+ );
+
+ info("Check whether the element displays correctly");
+ let sourceList = panelWin.document.querySelector(".sources-list");
+ ok(sourceList, "Source list element displays correctly");
+ ok(
+ sourceList.textContent.includes("temporary-web-extension"),
+ "Extension name displays correctly"
+ );
+
+ const waitForLoadedPanelsReload = await watchForLoadedPanelsReload(toolbox);
+
+ info("Reload the addon using a toolbox reload shortcut");
+ toolbox.win.focus();
+ synthesizeKeyShortcut(L10N.getStr("toolbox.reload.key"), toolbox.win);
+
+ await waitForLoadedPanelsReload();
+
+ info("Wait until a new background log message is logged");
+ await waitFor(() => {
+ // As React may re-create a new sources-list element,
+ // fetch the latest instance
+ sourceList = panelWin.document.querySelector(".sources-list");
+ return sourceList?.textContent.includes("temporary-web-extension");
+ }, "Wait for the source to re-appear");
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js
new file mode 100644
index 0000000000..a652ab41a8
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js
@@ -0,0 +1,86 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
+requestLongerTimeout(2);
+
+const ADDON_ID = "test-devtools-webextension@mozilla.org";
+const ADDON_NAME = "test-devtools-webextension";
+
+/**
+ * This test file ensures that the webextension addon developer toolbox:
+ * - the webextension developer toolbox has a working Inspector panel, with the
+ * background page as default target;
+ */
+add_task(async function testWebExtensionsToolboxWebConsole() {
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ document.body.innerText = "Background Page Body Test Content";
+ },
+ id: ADDON_ID,
+ name: ADDON_NAME,
+ },
+ document
+ );
+
+ info("Open a toolbox to debug the addon");
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ADDON_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+
+ const inspector = await toolbox.selectTool("inspector");
+ const nodeActor = await inspector.walker.querySelector(
+ inspector.walker.rootNode,
+ "body"
+ );
+ ok(nodeActor, "Got a nodeActor");
+ ok(nodeActor.inlineTextChild, "Got a nodeActor with an inline text child");
+
+ const actualValue = nodeActor.inlineTextChild._form.nodeValue;
+
+ is(
+ String(actualValue).trim(),
+ "Background Page Body Test Content",
+ "nodeActor has the expected inlineTextChild value"
+ );
+
+ info("Check that the color scheme simulation buttons are hidden");
+ const lightButtonIsHidden = inspector.panelDoc
+ .querySelector("#color-scheme-simulation-light-toggle")
+ ?.hasAttribute("hidden");
+ const darkButtonIsHidded = inspector.panelDoc
+ .querySelector("#color-scheme-simulation-dark-toggle")
+ ?.hasAttribute("hidden");
+ ok(
+ lightButtonIsHidden,
+ "The light color scheme simulation button exists and is hidden"
+ );
+ ok(
+ darkButtonIsHidded,
+ "The dark color scheme simulation button exists and is hidden"
+ );
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(ADDON_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js
new file mode 100644
index 0000000000..4f8f35acd2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js
@@ -0,0 +1,78 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+const ADDON_NOBG_ID = "test-devtools-webextension-nobg@mozilla.org";
+const ADDON_NOBG_NAME = "test-devtools-webextension-nobg";
+
+/**
+ * This test file ensures that the webextension addon developer toolbox:
+ * - the webextension developer toolbox is connected to a fallback page when the
+ * background page is not available (and in the fallback page document body contains
+ * the expected message, which warns the user that the current page is not a real
+ * webextension context);
+ */
+add_task(async function testWebExtensionsToolboxNoBackgroundPage() {
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ // Do not pass any `background` script.
+ id: ADDON_NOBG_ID,
+ name: ADDON_NOBG_NAME,
+ },
+ document
+ );
+
+ info("Open a toolbox to debug the addon");
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ADDON_NOBG_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+
+ ok(
+ toolbox.commands.descriptorFront.isWebExtensionDescriptor,
+ "Toolbox is debugging an addon"
+ );
+ const targetName = toolbox.target.name;
+ is(targetName, ADDON_NOBG_NAME, "Toolbox has the expected target");
+
+ const inspector = await toolbox.selectTool("inspector");
+
+ let nodeActor;
+ info(`Wait the fallback window to be fully loaded`);
+ await asyncWaitUntil(async () => {
+ nodeActor = await inspector.walker.querySelector(
+ inspector.walker.rootNode,
+ "h1"
+ );
+ return nodeActor && nodeActor.inlineTextChild;
+ });
+
+ info("Got a nodeActor with an inline text child");
+ const actualValue = nodeActor.inlineTextChild._form.nodeValue;
+ is(
+ actualValue,
+ "Your addon does not have any document opened yet.",
+ "nodeActor has the expected inlineTextChild value"
+ );
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(ADDON_NOBG_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js
new file mode 100644
index 0000000000..c205ecbfe3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js
@@ -0,0 +1,246 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
+requestLongerTimeout(2);
+
+const ADDON_ID = "test-devtools-webextension@mozilla.org";
+const ADDON_NAME = "test-devtools-webextension";
+
+/**
+ * This test file ensures that the webextension addon developer toolbox:
+ * - has a frame list menu and the noautohide toolbar toggle button, and they
+ * can be used to switch the current target to the extension popup page.
+ */
+add_task(async function testWebExtensionsToolboxWebConsole() {
+ await enableExtensionDebugging();
+
+ // Bug 1686922: Disable the error count button to avoid intermittent failures.
+ await pushPref("devtools.command-button-errorcount.enabled", false);
+
+ is(
+ Services.prefs.getBoolPref("ui.popup.disable_autohide"),
+ false,
+ "disable_autohide should be initially false"
+ );
+
+ const {
+ document,
+ tab,
+ window: aboutDebuggingWindow,
+ } = await openAboutDebugging();
+ await selectThisFirefoxPage(
+ document,
+ aboutDebuggingWindow.AboutDebugging.store
+ );
+
+ const extension = await installTestAddon(document);
+
+ const onBackgroundFunctionCalled = waitForExtensionTestMessage(
+ extension,
+ "onBackgroundFunctionCalled"
+ );
+ const onPopupPageFunctionCalled = waitForExtensionTestMessage(
+ extension,
+ "onPopupPageFunctionCalled"
+ );
+
+ info("Open a toolbox to debug the addon");
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ aboutDebuggingWindow,
+ ADDON_NAME
+ );
+
+ const toolbox = getToolbox(devtoolsWindow);
+ const webconsole = await toolbox.selectTool("webconsole");
+
+ info("Clicking the menu button to disable autohide");
+ await disablePopupAutohide(toolbox);
+
+ info("Check that console messages are evaluated in the background context");
+ const consoleWrapper = webconsole.hud.ui.wrapper;
+ consoleWrapper.dispatchEvaluateExpression("backgroundFunction()");
+ await onBackgroundFunctionCalled;
+
+ clickOnAddonWidget(ADDON_ID);
+
+ info("Wait until the frames list button is displayed");
+ const btn = await waitFor(() =>
+ toolbox.doc.getElementById("command-button-frames")
+ );
+
+ info("Clicking the frame list button");
+ btn.click();
+
+ const menuList = toolbox.doc.getElementById("toolbox-frame-menu");
+ const frames = Array.from(menuList.querySelectorAll(".command"));
+ is(frames.length, 2, "Has the expected number of frames");
+
+ const popupFrameBtn = frames
+ .filter(frame => {
+ return frame.querySelector(".label").textContent.endsWith("popup.html");
+ })
+ .pop();
+
+ ok(popupFrameBtn, "Extension Popup frame found in the listed frames");
+
+ info(
+ "Click on the extension popup frame and wait for a `dom-complete` resource"
+ );
+ const { onDomCompleteResource } =
+ await waitForNextTopLevelDomCompleteResource(toolbox.commands);
+ popupFrameBtn.click();
+ await onDomCompleteResource;
+
+ info("Execute `popupPageFunction()`");
+ consoleWrapper.dispatchEvaluateExpression("popupPageFunction()");
+
+ const args = await onPopupPageFunctionCalled;
+ ok(true, "Received console message from the popup page function as expected");
+ is(args[0], "onPopupPageFunctionCalled", "Got the expected console message");
+ is(
+ args[1] && args[1].name,
+ ADDON_NAME,
+ "Got the expected manifest from WebExtension API"
+ );
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, aboutDebuggingWindow);
+
+ is(
+ Services.prefs.getBoolPref("ui.popup.disable_autohide"),
+ false,
+ "disable_autohide should be reset to false when the toolbox is closed"
+ );
+
+ await removeTemporaryExtension(ADDON_NAME, document);
+ await removeTab(tab);
+});
+
+/**
+ * Helper to wait for a specific message on an Extension instance.
+ */
+function waitForExtensionTestMessage(extension, expectedMessage) {
+ return new Promise(done => {
+ extension.on("test-message", function testLogListener(evt, ...args) {
+ const [message] = args;
+
+ if (message !== expectedMessage) {
+ return;
+ }
+
+ extension.off("test-message", testLogListener);
+ done(args);
+ });
+ });
+}
+
+/**
+ * Install the addon used for this test.
+ * Returns a Promise that resolve the Extension instance that was just
+ * installed.
+ */
+async function installTestAddon(doc) {
+ // Start watching for the extension on the Extension Management before we
+ // install it.
+ const onExtensionReady = waitForExtension(ADDON_NAME);
+
+ // Install the extension.
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ const { browser } = this;
+ window.backgroundFunction = function () {
+ browser.test.sendMessage("onBackgroundFunctionCalled");
+ };
+ },
+ extraProperties: {
+ browser_action: {
+ default_title: "WebExtension Popup Debugging",
+ default_popup: "popup.html",
+ },
+ },
+ files: {
+ "popup.html": `<!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="utf-8">
+ <script src="popup.js"></script>
+ </head>
+ <body>
+ Background Page Body Test Content
+ </body>
+ </html>
+ `,
+ "popup.js": function () {
+ const { browser } = this;
+ window.popupPageFunction = function () {
+ browser.test.sendMessage(
+ "onPopupPageFunctionCalled",
+ browser.runtime.getManifest()
+ );
+ };
+ },
+ },
+ id: ADDON_ID,
+ name: ADDON_NAME,
+ },
+ doc
+ );
+
+ // The onExtensionReady promise will resolve the extension instance.
+ return onExtensionReady;
+}
+
+/**
+ * Helper to retrieve the Extension instance.
+ */
+async function waitForExtension(addonName) {
+ const { Management } = ChromeUtils.importESModule(
+ "resource://gre/modules/Extension.sys.mjs"
+ );
+
+ return new Promise(resolve => {
+ Management.on("startup", function listener(event, extension) {
+ if (extension.name != addonName) {
+ return;
+ }
+
+ Management.off("startup", listener);
+ resolve(extension);
+ });
+ });
+}
+
+/**
+ * Disables the popup autohide feature, which is mandatory to debug webextension
+ * popups.
+ */
+function disablePopupAutohide(toolbox) {
+ return new Promise(resolve => {
+ toolbox.doc.addEventListener(
+ "popupshown",
+ () => {
+ const menuItem = toolbox.doc.getElementById(
+ "toolbox-meatball-menu-noautohide"
+ );
+ menuItem.click();
+ resolve();
+ },
+ { once: true }
+ );
+ toolbox.doc.getElementById("toolbox-meatball-menu-button").click();
+ });
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_reload.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_reload.js
new file mode 100644
index 0000000000..2293eaca0e
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_reload.js
@@ -0,0 +1,136 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
+requestLongerTimeout(2);
+
+const ADDON_ID = "test-devtools-webextension@mozilla.org";
+const ADDON_NAME = "test-devtools-webextension";
+
+const { LocalizationHelper } = require("resource://devtools/shared/l10n.js");
+const L10N = new LocalizationHelper(
+ "devtools/client/locales/toolbox.properties"
+);
+
+// Check that addon browsers can be reloaded via the toolbox reload shortcuts
+add_task(async function testWebExtensionToolboxReload() {
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ console.log("background script executed " + Math.random());
+ },
+ id: ADDON_ID,
+ name: ADDON_NAME,
+ },
+ document
+ );
+
+ // Select the debugger right away to avoid any noise coming from the inspector.
+ await pushPref("devtools.toolbox.selectedTool", "webconsole");
+ const { devtoolsDocument, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ADDON_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+
+ ok(
+ devtoolsDocument.querySelector(".qa-reload-button"),
+ "Reload button is visible"
+ );
+ ok(
+ !devtoolsDocument.querySelector(".qa-back-button"),
+ "Back button is hidden"
+ );
+ ok(
+ !devtoolsDocument.querySelector(".qa-forward-button"),
+ "Forward button is hidden"
+ );
+ ok(
+ !devtoolsDocument.querySelector(".debug-target-url-form"),
+ "URL form is hidden"
+ );
+ ok(
+ devtoolsDocument.getElementById("toolbox-meatball-menu-noautohide"),
+ "Disable popup autohide button is displayed"
+ );
+ ok(
+ !devtoolsDocument.getElementById(
+ "toolbox-meatball-menu-pseudo-locale-accented"
+ ),
+ "Accented locale is not displayed (only on browser toolbox)"
+ );
+
+ const webconsole = await toolbox.selectTool("webconsole");
+ const { hud } = webconsole;
+
+ info("Wait for the initial background message to appear in the console");
+ const initialMessage = await waitFor(() =>
+ findMessagesByType(hud, "background script executed", ".console-api")
+ );
+ ok(initialMessage, "Found the expected message from the background script");
+
+ const waitForLoadedPanelsReload = await watchForLoadedPanelsReload(toolbox);
+
+ info("Reload the addon using a toolbox reload shortcut");
+ toolbox.win.focus();
+ synthesizeKeyShortcut(L10N.getStr("toolbox.reload.key"), toolbox.win);
+
+ info("Wait until a new background log message is logged");
+ const secondMessage = await waitFor(() => {
+ const newMessage = findMessagesByType(
+ hud,
+ "background script executed",
+ ".console-api"
+ );
+ if (newMessage && newMessage !== initialMessage) {
+ return newMessage;
+ }
+ return false;
+ });
+
+ await waitForLoadedPanelsReload();
+
+ info("Reload via the debug target info bar button");
+ clickReload(devtoolsDocument);
+
+ info("Wait until yet another background log message is logged");
+ await waitFor(() => {
+ const newMessage = findMessagesByType(
+ hud,
+ "background script executed",
+ ".console-api"
+ );
+ return (
+ newMessage &&
+ newMessage !== initialMessage &&
+ newMessage !== secondMessage
+ );
+ });
+
+ await waitForLoadedPanelsReload();
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(ADDON_NAME, document);
+ await removeTab(tab);
+});
+
+function clickReload(devtoolsDocument) {
+ devtoolsDocument.querySelector(".qa-reload-button").click();
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_storage.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_storage.js
new file mode 100644
index 0000000000..56f1b0befb
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_storage.js
@@ -0,0 +1,90 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+add_task(async () => {
+ const EXTENSION_NAME = "temporary-web-extension";
+ const EXTENSION_ID = "test-devtools@mozilla.org";
+
+ await enableExtensionDebugging();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const { extension } = await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ const open = indexedDB.open("TestDatabase", 1);
+
+ open.onupgradeneeded = function () {
+ const db = open.result;
+ db.createObjectStore("TestStore", { keyPath: "id" });
+ };
+
+ open.onsuccess = function () {
+ const db = open.result;
+ const tx = db.transaction("TestStore", "readwrite");
+ const store = tx.objectStore("TestStore");
+
+ store.put({ id: 1, name: "John", age: 12 });
+ store.put({ id: 2, name: "Bob", age: 24 });
+ tx.oncomplete = () => db.close();
+ };
+ },
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ },
+ document
+ );
+
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ EXTENSION_NAME
+ );
+
+ info("Select the storage panel");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("storage");
+ const storage = toolbox.getCurrentPanel();
+
+ info("Check the content of the storage panel treeview");
+ const ids = [
+ "indexedDB",
+ `moz-extension://${extension.uuid}`,
+ "TestDatabase (default)",
+ "TestStore",
+ ];
+ ok(
+ !!storage.panelWindow.document.querySelector(
+ `[data-id='${JSON.stringify(ids)}']`
+ ),
+ "The indexedDB database for the extension is visible"
+ );
+
+ info("Select the indexedDB database for the extension");
+ const updated = storage.UI.once("store-objects-updated");
+ storage.UI.tree.selectedItem = ids;
+ await updated;
+
+ info("Wait until table populated");
+ await waitUntil(() => storage.UI.table.items.size === 2);
+ const items = storage.UI.table.items;
+
+ info("Check the content of the storage panel table");
+ is(items.size, 2);
+ const user1 = JSON.parse(items.get(1).value);
+ const user2 = JSON.parse(items.get(2).value);
+ is(user1.name, "John", "user 1 has the expected name");
+ is(user1.age, 12, "user 1 has the expected age");
+ is(user2.name, "Bob", "user 2 has the expected name");
+ is(user2.age, 24, "user 2 has the expected age");
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_toolbox.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_toolbox.js
new file mode 100644
index 0000000000..f21e7d9c4a
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_toolbox.js
@@ -0,0 +1,122 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+const ADDON_ID = "test-devtools-webextension@mozilla.org";
+const ADDON_NAME = "test-devtools-webextension";
+
+/**
+ * This test file ensures that the webextension addon developer toolbox:
+ * - always on top is enabled by default and can be toggled off
+ */
+add_task(async function testWebExtensionsToolbox() {
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ background() {
+ document.body.innerText = "Background Page Body Test Content";
+ },
+ id: ADDON_ID,
+ name: ADDON_NAME,
+ },
+ document
+ );
+
+ info("Open a toolbox to debug the addon");
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ADDON_NAME
+ );
+
+ const toolbox = getToolbox(devtoolsWindow);
+
+ ok(
+ isWindowAlwaysOnTop(devtoolsWindow),
+ "The toolbox window is always on top"
+ );
+ const toggleButton = toolbox.doc.querySelector(".toolbox-always-on-top");
+ ok(!!toggleButton, "The always on top toggle button is visible");
+ ok(
+ toggleButton.classList.contains("checked"),
+ "The button is highlighted to report that always on top is enabled"
+ );
+
+ // When running the test, the devtools window might not be focused, while it does IRL.
+ // Force it to be focused to better reflect the default behavior.
+ info("Force focusing the devtools window");
+ devtoolsWindow.focus();
+
+ // As we update the button with a debounce, we have to wait for it to updates
+ await waitFor(
+ () => toggleButton.classList.contains("toolbox-is-focused"),
+ "Wait for the button to be highlighting that the toolbox is focused (the button isn't highlighted)"
+ );
+ ok(true, "Expected class is added when toolbox is focused");
+
+ info("Focus the browser window");
+ window.focus();
+
+ await waitFor(
+ () => !toggleButton.classList.contains("toolbox-is-focused"),
+ "Wait for the button to be highlighting that the toolbox is no longer focused (the button is highlighted)"
+ );
+ ok(true, "Focused class is removed when browser window gets focused");
+
+ info("Re-focus the DevTools window");
+ devtoolsWindow.focus();
+
+ await waitFor(
+ () => toggleButton.classList.contains("toolbox-is-focused"),
+ "Wait for the button to be re-highlighting that the toolbox is focused"
+ );
+
+ const onToolboxReady = gDevTools.once("toolbox-ready");
+ info("Click on the button");
+ toggleButton.click();
+
+ info("Wait for a new toolbox to be created");
+ const secondToolbox = await onToolboxReady;
+
+ ok(
+ !isWindowAlwaysOnTop(secondToolbox.win),
+ "The toolbox window is no longer always on top"
+ );
+ const secondToggleButton = secondToolbox.doc.querySelector(
+ ".toolbox-always-on-top"
+ );
+ ok(!!secondToggleButton, "The always on top toggle button is still visible");
+
+ ok(
+ !secondToggleButton.classList.contains("checked"),
+ "The button is no longer highlighted to report that always on top is disabled"
+ );
+
+ await closeWebExtAboutDevtoolsToolbox(secondToolbox.win, window);
+ await removeTemporaryExtension(ADDON_NAME, document);
+ await removeTab(tab);
+});
+
+// Check if the window has the "alwaysontop" chrome flag
+function isWindowAlwaysOnTop(window) {
+ return (
+ window.docShell.treeOwner
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIAppWindow).chromeFlags &
+ Ci.nsIWebBrowserChrome.CHROME_ALWAYS_ON_TOP
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_actions_and_status.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_actions_and_status.js
new file mode 100644
index 0000000000..0e395704f2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_actions_and_status.js
@@ -0,0 +1,153 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+add_setup(async function () {
+ await SpecialPowers.pushPrefEnv({
+ set: [["extensions.eventPages.enabled", true]],
+ });
+});
+
+// Test that the terminate button is shutting down the background script as expected
+// and the background script status is updated occordingly.
+add_task(async function test_eventpage_terminate_and_status_updates() {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const EXTENSION_ID = "test-devtools-eventpage@mozilla.org";
+ const EXTENSION_NAME = "Temporary EventPage-based web extension";
+
+ const EXTENSION2_ID = "test-devtools-persistentbg@mozilla.org";
+ const EXTENSION2_NAME =
+ "Temporary PersistentBackgroundPage-based web extension";
+
+ const promiseBackgroundLoaded = promiseBackgroundContextLoaded(EXTENSION_ID);
+ const promiseBackgroundUnloaded =
+ promiseBackgroundContextUnloaded(EXTENSION_ID);
+
+ let waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+
+ // Install the extension using an event page (non persistent background page).
+ await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ // The extension is expected to have a non persistent background script.
+ extraProperties: {
+ background: {
+ scripts: ["bgpage.js"],
+ persistent: false,
+ },
+ },
+ files: {
+ "bgpage.js": function () {
+ // Emit a dump when the script is loaded to make it easier
+ // to investigate intermittents.
+ dump(`Background script loaded: ${window.location}\n`);
+ },
+ },
+ },
+ document
+ );
+
+ // Install the extension using a persistent background page.
+ await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION2_ID,
+ name: EXTENSION2_NAME,
+ // The extension is expected to have a persistent background script.
+ extraProperties: {
+ background: {
+ page: "bppage.html",
+ persistent: true,
+ },
+ },
+ files: { "bgpage.html": "" },
+ },
+ document
+ );
+
+ const target = findDebugTargetByText(EXTENSION_NAME, document);
+ ok(
+ !!target,
+ "The EventPage-based extension is installed with the expected name"
+ );
+
+ const target2 = findDebugTargetByText(EXTENSION2_NAME, document);
+ ok(
+ !!target2,
+ "The PersistentBackgroundScript-based extension is installed with the expected name"
+ );
+
+ const terminateButton = target.querySelector(
+ ".qa-temporary-extension-terminate-bgscript-button"
+ );
+ ok(
+ !!terminateButton,
+ `${EXTENSION_NAME} is expected to have a terminate button`
+ );
+
+ const terminateButton2 = target2.querySelector(
+ ".qa-temporary-extension-terminate-bgscript-button"
+ );
+ ok(
+ !terminateButton2,
+ `${EXTENSION2_NAME} is expected to not have a terminate button`
+ );
+
+ info("Wait for the test extension background script to be loaded");
+ await promiseBackgroundLoaded;
+
+ info("Wait for the test extension background script status update");
+ await waitForBGStatusUpdate;
+
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "running",
+ });
+
+ // Verify in the card related to extensions with a persistent background page
+ // the background script status is not being rendered at all.
+ const backgroundStatus2 = target2.querySelector(
+ ".extension-backgroundscript__status"
+ );
+ ok(
+ !backgroundStatus2,
+ `${EXTENSION2_NAME} should not be showing background script status`
+ );
+
+ info(`Click on the terminate button for ${EXTENSION_NAME}`);
+ const waitForTerminateSuccess = waitForDispatch(
+ window.AboutDebugging.store,
+ "TERMINATE_EXTENSION_BGSCRIPT_SUCCESS"
+ );
+ waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+ terminateButton.click();
+ await waitForTerminateSuccess;
+
+ info("Wait for the extension background script to be unloaded");
+ await promiseBackgroundUnloaded;
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "stopped",
+ });
+
+ // Uninstall the test extensions.
+ await Promise.all([
+ AddonManager.getAddonByID(EXTENSION_ID).then(addon => addon.uninstall()),
+ AddonManager.getAddonByID(EXTENSION2_ID).then(addon => addon.uninstall()),
+ ]);
+
+ info("Wait until the debug targets with test extensions disappears");
+ await waitUntil(
+ () =>
+ !findDebugTargetByText(EXTENSION_NAME, document) &&
+ !findDebugTargetByText(EXTENSION2_NAME, document)
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_terminate_on_idle.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_terminate_on_idle.js
new file mode 100644
index 0000000000..1b43808fa2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_eventpage_terminate_on_idle.js
@@ -0,0 +1,200 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+add_setup(async function () {
+ await SpecialPowers.pushPrefEnv({
+ set: [["extensions.eventPages.enabled", true]],
+ });
+});
+
+// Test that an extension event page isn't terminated on idle when a DevTools
+// Toolbox is attached to the extension.
+add_task(
+ async function test_eventpage_no_idle_shutdown_with_toolbox_attached() {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const EXTENSION_ID = "test-devtools-eventpage@mozilla.org";
+ const EXTENSION_NAME = "Temporary EventPage-based web extension";
+
+ const promiseBackgroundLoaded =
+ promiseBackgroundContextLoaded(EXTENSION_ID);
+
+ let waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+
+ // Install the extension using an event page (non persistent background page).
+ await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ // The extension is expected to have a non persistent background script.
+ extraProperties: {
+ background: {
+ scripts: ["bgpage.js"],
+ persistent: false,
+ },
+ },
+ files: {
+ "bgpage.js": function () {
+ // Emit a dump when the script is loaded to make it easier
+ // to investigate intermittents.
+ dump(`Background script loaded: ${window.location}\n`);
+ },
+ },
+ },
+ document
+ );
+
+ const target = findDebugTargetByText(EXTENSION_NAME, document);
+ ok(
+ !!target,
+ "The EventPage-based extension is installed with the expected name"
+ );
+
+ info("Wait for the test extension background script to be loaded");
+ await promiseBackgroundLoaded;
+
+ info("Wait for the test extension background script status update");
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "running",
+ });
+
+ waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+ await triggerExtensionEventPageIdleTimeout(EXTENSION_ID);
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "stopped",
+ });
+
+ info(
+ "Respawn the extension background script on new WebExtension API event"
+ );
+ waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+ await wakeupExtensionEventPage(EXTENSION_ID);
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "running",
+ });
+
+ info("Open a DevTools toolbox on the target extension");
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ EXTENSION_NAME
+ );
+
+ info(
+ "Verify event page terminated on terminate button clicked while the DevTools toolbox is open"
+ );
+ const terminateButton = target.querySelector(
+ ".qa-temporary-extension-terminate-bgscript-button"
+ );
+ ok(
+ !!terminateButton,
+ `${EXTENSION_NAME} is expected to have a terminate button`
+ );
+
+ info(`Click on the terminate button for ${EXTENSION_NAME}`);
+ const promiseBackgroundUnloaded =
+ promiseBackgroundContextUnloaded(EXTENSION_ID);
+ const waitForTerminateSuccess = waitForDispatch(
+ window.AboutDebugging.store,
+ "TERMINATE_EXTENSION_BGSCRIPT_SUCCESS"
+ );
+ waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+ terminateButton.click();
+ await waitForTerminateSuccess;
+
+ info("Wait for the extension background script to be unloaded");
+ await promiseBackgroundUnloaded;
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "stopped",
+ targetElement: target,
+ });
+
+ info(
+ "Verify event page isn't terminated on idle while the DevTools toolbox is open"
+ );
+
+ // Make sure the event page is running again.
+ waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+ await wakeupExtensionEventPage(EXTENSION_ID);
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "running",
+ targetElement: target,
+ });
+
+ const waitForBGSuspendIgnored =
+ promiseTerminateBackgroundScriptIgnored(EXTENSION_ID);
+ waitForBGStatusUpdate = promiseBackgroundStatusUpdate(window);
+ await triggerExtensionEventPageIdleTimeout(EXTENSION_ID);
+ await Promise.race([waitForBGStatusUpdate, waitForBGSuspendIgnored]);
+
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "running",
+ // After opening the toolbox there will be an additional target listed
+ // for the devtools toolbox tab, its card includes the extension name
+ // and so while the toolbox is open we should make sure to look for
+ // the background status inside the extension target card instead of
+ // the one associated to the devtools toolbox tab.
+ targetElement: target,
+ });
+
+ info(
+ "Wait for warning message expected to be logged for the event page not terminated on idle"
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+ const webconsole = await toolbox.selectTool("webconsole");
+ const { hud } = webconsole;
+ const expectedWarning =
+ "Background event page was not terminated on idle because a DevTools toolbox is attached to the extension.";
+ let consoleElements;
+ await waitUntil(() => {
+ consoleElements = findMessagesByType(hud, expectedWarning, ".warn");
+ return !!consoleElements.length;
+ });
+
+ const locationElement = consoleElements[0].querySelector(
+ ".frame-link-filename"
+ );
+ ok(
+ locationElement.textContent.endsWith("_generated_background_page.html"),
+ "The warning message is associated to the event page url"
+ );
+
+ info(
+ "Verify event page is terminated on idle after closing the DevTools toolbox"
+ );
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await triggerExtensionEventPageIdleTimeout(EXTENSION_ID);
+ await waitForBGStatusUpdate;
+ await assertBackgroundStatus(EXTENSION_NAME, {
+ document,
+ expectedStatus: "stopped",
+ });
+
+ // Uninstall the test extensions.
+ info("Unload extension and remove about:debugging tab");
+ await AddonManager.getAddonByID(EXTENSION_ID).then(addon =>
+ addon.uninstall()
+ );
+ info("Wait until the debug targets with test extensions disappears");
+ await waitUntil(() => !findDebugTargetByText(EXTENSION_NAME, document));
+ await removeTab(tab);
+ }
+);
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js
new file mode 100644
index 0000000000..6420a076b0
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js
@@ -0,0 +1,73 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ adbAddon,
+} = require("resource://devtools/client/shared/remote-debugging/adb/adb-addon.js");
+
+const ABD_ADDON_NAME = "ADB binary provider";
+
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
+
+// Test that manifest URLs for addon targets show the manifest correctly in a new tab.
+// This test reuses the ADB extension to be sure to have a valid manifest URL to open.
+add_task(async function () {
+ await pushPref(
+ "devtools.remote.adb.extensionURL",
+ CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi"
+ );
+ await checkAdbNotRunning();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const usbStatusElement = document.querySelector(".qa-sidebar-usb-status");
+
+ info("Install ADB");
+ adbAddon.install("internal");
+ await waitUntil(() => usbStatusElement.textContent.includes("USB enabled"));
+ await waitForAdbStart();
+
+ info("Wait until the debug target for ADB appears");
+ await waitUntil(() => findDebugTargetByText(ABD_ADDON_NAME, document));
+ const adbExtensionItem = findDebugTargetByText(ABD_ADDON_NAME, document);
+
+ const manifestUrlElement = adbExtensionItem.querySelector(".qa-manifest-url");
+ ok(manifestUrlElement, "A link to the manifest is displayed");
+
+ info("Click on the manifest URL and wait for the new tab to open");
+ const onTabOpened = once(gBrowser.tabContainer, "TabOpen");
+ manifestUrlElement.click();
+ const { target } = await onTabOpened;
+ await BrowserTestUtils.browserLoaded(target.linkedBrowser);
+
+ info("Retrieve the text content of the new tab");
+ const textContent = await SpecialPowers.spawn(
+ target.linkedBrowser,
+ [],
+ function () {
+ return content.wrappedJSObject.document.body.textContent;
+ }
+ );
+
+ const manifestObject = JSON.parse(textContent);
+ ok(manifestObject, "The displayed content is a valid JSON object");
+ is(
+ manifestObject.name,
+ ABD_ADDON_NAME,
+ "Manifest tab shows the expected content"
+ );
+
+ info("Close the manifest.json tab");
+ await removeTab(target);
+
+ info("Uninstall the adb extension and wait for the message to udpate");
+ adbAddon.uninstall();
+ await waitUntil(() => usbStatusElement.textContent.includes("USB disabled"));
+ await stopAdbProcess();
+
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_popup_picker.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_popup_picker.js
new file mode 100644
index 0000000000..fc67bc7f7c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_popup_picker.js
@@ -0,0 +1,99 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
+
+const ADDON_ID = "test-devtools-webextension@mozilla.org";
+const ADDON_NAME = "test-devtools-webextension";
+
+/**
+ * Check that the node picker can be used when dynamically navigating to a
+ * webextension popup.
+ */
+add_task(async function testNodePickerInExtensionPopup() {
+ await enableExtensionDebugging();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Note that this extension should not define a background script in order to
+ // reproduce the issue. Otherwise opening the popup does not trigger an auto
+ // navigation from DevTools and you have to use the "Disable Popup Auto Hide"
+ // feature which works around the bug tested here.
+ await installTemporaryExtensionFromXPI(
+ {
+ extraProperties: {
+ browser_action: {
+ default_title: "WebExtension with popup",
+ default_popup: "popup.html",
+ },
+ },
+ files: {
+ "popup.html": `<!DOCTYPE html>
+ <html>
+ <body>
+ <div id="pick-me"
+ style="width:100px; height: 60px; background-color: #f5e8fc">
+ Pick me!
+ </div>
+ </body>
+ </html>
+ `,
+ },
+ id: ADDON_ID,
+ name: ADDON_NAME,
+ },
+ document
+ );
+
+ const { devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ADDON_NAME
+ );
+ const toolbox = getToolbox(devtoolsWindow);
+ const inspector = await toolbox.getPanel("inspector");
+
+ info("Start the node picker");
+ await toolbox.nodePicker.start();
+
+ info("Open the webextension popup");
+ // Clicking on the addon popup will trigger a navigation between the DevTools
+ // fallback document and the popup document.
+ // Wait until the inspector was fully reloaded and for the node-picker to be
+ // restarted.
+ const nodePickerRestarted = toolbox.nodePicker.once(
+ "node-picker-webextension-target-restarted"
+ );
+ const reloaded = inspector.once("reloaded");
+ clickOnAddonWidget(ADDON_ID);
+ await reloaded;
+ await nodePickerRestarted;
+
+ const popup = await waitFor(() =>
+ gBrowser.ownerDocument.querySelector(".webextension-popup-browser")
+ );
+
+ info("Pick an element inside the webextension popup");
+ const onNewNodeFront = inspector.selection.once("new-node-front");
+ BrowserTestUtils.synthesizeMouseAtCenter(
+ "#pick-me",
+ {},
+ popup.browsingContext
+ );
+ const nodeFront = await onNewNodeFront;
+ is(nodeFront.id, "pick-me", "The expected node front was selected");
+
+ await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
+ await removeTemporaryExtension(ADDON_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js
new file mode 100644
index 0000000000..607b8e15b4
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js
@@ -0,0 +1,145 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NETWORK_RUNTIME_HOST = "localhost:6080";
+const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const USB_RUNTIME_ID = "test-runtime-id";
+const USB_RUNTIME_DEVICE_NAME = "test device name";
+const USB_RUNTIME_APP_NAME = "TestUsbApp";
+
+// Test that addons are displayed and updated for USB runtimes when expected.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Prepare USB client mock");
+ const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_RUNTIME_DEVICE_NAME,
+ name: USB_RUNTIME_APP_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Test addons in runtime page for USB client");
+ await connectToRuntime(USB_RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(USB_RUNTIME_DEVICE_NAME, USB_RUNTIME_APP_NAME, document);
+ await testAddonsOnMockedRemoteClient(
+ usbClient,
+ mocks.thisFirefoxClient,
+ document
+ );
+
+ info("Prepare Network client mock");
+ const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
+ name: NETWORK_RUNTIME_APP_NAME,
+ });
+
+ info("Test addons in runtime page for Network client");
+ await connectToRuntime(NETWORK_RUNTIME_HOST, document);
+ await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
+ await testAddonsOnMockedRemoteClient(
+ networkClient,
+ mocks.thisFirefoxClient,
+ document
+ );
+
+ await removeTab(tab);
+});
+
+/**
+ * Check that addons are visible in the runtime page for a remote client (USB or network).
+ */
+async function testAddonsOnMockedRemoteClient(
+ remoteClient,
+ firefoxClient,
+ document
+) {
+ const extensionPane = getDebugTargetPane("Extensions", document);
+ info("Check an empty target pane message is displayed");
+ ok(
+ extensionPane.querySelector(".qa-debug-target-list-empty"),
+ "Extensions list is empty"
+ );
+
+ info("Add an extension to the remote client");
+ const addon = { name: "Test extension name", debuggable: true };
+ const temporaryAddon = {
+ name: "Test temporary extension",
+ debuggable: true,
+ temporarilyInstalled: true,
+ };
+ remoteClient.listAddons = () => [addon, temporaryAddon];
+ remoteClient._eventEmitter.emit("addonListChanged");
+
+ info("Wait until the extension appears");
+ await waitUntil(
+ () => !extensionPane.querySelector(".qa-debug-target-list-empty")
+ );
+
+ const extensionTarget = findDebugTargetByText(
+ "Test extension name",
+ document
+ );
+ ok(extensionTarget, "Extension target appeared for the remote runtime");
+
+ const temporaryExtensionTarget = findDebugTargetByText(
+ "Test temporary extension",
+ document
+ );
+ ok(
+ temporaryExtensionTarget,
+ "Temporary Extension target appeared for the remote runtime"
+ );
+
+ const removeButton = temporaryExtensionTarget.querySelector(
+ ".qa-temporary-extension-remove-button"
+ );
+ ok(removeButton, "Remove button expected for the temporary extension");
+
+ const reloadButton = temporaryExtensionTarget.querySelector(
+ ".qa-temporary-extension-reload-button"
+ );
+ ok(reloadButton, "Reload button expected for the temporary extension");
+
+ // The goal here is to check that runtimes addons are only updated when the remote
+ // runtime is sending addonListChanged events. The reason for this test is because the
+ // previous implementation was updating the remote runtime extensions list when the
+ // _local_ AddonManager was updated.
+ info("Remove the extension from the remote client WITHOUT sending an event");
+ remoteClient.listAddons = () => [];
+
+ info("Simulate an addon update on the ThisFirefox client");
+ firefoxClient._eventEmitter.emit("addonListChanged");
+
+ // To avoid wait for a set period of time we trigger another async update, adding a new
+ // tab. We assume that if the addon update mechanism had started, it would also be done
+ // when the new tab was processed.
+ info("Wait until the tab target for 'http://some.random/url.com' appears");
+ const testTab = {
+ retrieveFavicon: () => {},
+ outerWindowID: 0,
+ traits: {},
+ url: "http://some.random/url.com",
+ };
+ remoteClient.listTabs = () => [testTab];
+ remoteClient._eventEmitter.emit("tabListChanged");
+ await waitUntil(() =>
+ findDebugTargetByText("http://some.random/url.com", document)
+ );
+
+ ok(
+ findDebugTargetByText("Test extension name", document),
+ "The test extension is still visible"
+ );
+
+ info(
+ "Emit `addonListChanged` on remoteClient and wait for the target list to update"
+ );
+ remoteClient._eventEmitter.emit("addonListChanged");
+ await waitUntil(
+ () => !findDebugTargetByText("Test extension name", document)
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js
new file mode 100644
index 0000000000..26b558ff37
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js
@@ -0,0 +1,116 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// Test that the reload button updates the addon list with the correct metadata.
+add_task(async function () {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const ORIGINAL_EXTENSION_NAME = "Temporary web extension (original)";
+ const UPDATED_EXTENSION_NAME = "Temporary web extension (updated)";
+ const EXTENSION_ID = "test-devtools@mozilla.org";
+
+ const { xpiFile: addonFile } = await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: ORIGINAL_EXTENSION_NAME,
+ },
+ document
+ );
+
+ const originalTarget = findDebugTargetByText(
+ ORIGINAL_EXTENSION_NAME,
+ document
+ );
+ ok(
+ !!originalTarget,
+ "The temporary extension isinstalled with the expected name"
+ );
+
+ info("Update the name of the temporary extension in the manifest");
+ updateTemporaryXPI(
+ { id: EXTENSION_ID, name: UPDATED_EXTENSION_NAME },
+ addonFile
+ );
+
+ info("Click on the reload button for the temporary extension");
+ const reloadButton = originalTarget.querySelector(
+ ".qa-temporary-extension-reload-button"
+ );
+ reloadButton.click();
+
+ info(
+ "Wait until the debug target with the original extension name disappears"
+ );
+ await waitUntil(
+ () => !findDebugTargetByText(ORIGINAL_EXTENSION_NAME, document)
+ );
+
+ info("Wait until the debug target with the updated extension name appears");
+ await waitUntil(() =>
+ findDebugTargetByText(UPDATED_EXTENSION_NAME, document)
+ );
+
+ const updatedTarget = findDebugTargetByText(UPDATED_EXTENSION_NAME, document);
+ ok(!!updatedTarget, "The temporary extension name has been updated");
+
+ info("Click on the remove button for the temporary extension");
+ const removeButton = updatedTarget.querySelector(
+ ".qa-temporary-extension-remove-button"
+ );
+ removeButton.click();
+
+ info(
+ "Wait until the debug target with the updated extension name disappears"
+ );
+ await waitUntil(
+ () => !findDebugTargetByText(UPDATED_EXTENSION_NAME, document)
+ );
+
+ await removeTab(tab);
+});
+
+add_task(async function () {
+ const PACKAGED_EXTENSION_ID = "packaged-extension@tests";
+ const PACKAGED_EXTENSION_NAME = "Packaged extension";
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installRegularExtension(
+ "resources/packaged-extension/packaged-extension.xpi"
+ );
+
+ info("Wait until extension appears in about:debugging");
+ await waitUntil(() =>
+ findDebugTargetByText(PACKAGED_EXTENSION_NAME, document)
+ );
+ const target = findDebugTargetByText(PACKAGED_EXTENSION_NAME, document);
+
+ const reloadButton = target.querySelector(
+ ".qa-temporary-extension-reload-button"
+ );
+ ok(
+ !reloadButton,
+ "No reload button displayed for a regularly installed extension"
+ );
+
+ const removeButton = target.querySelector(
+ ".qa-temporary-extension-remove-button"
+ );
+ ok(
+ !removeButton,
+ "No remove button displayed for a regularly installed extension"
+ );
+
+ await removeExtension(
+ PACKAGED_EXTENSION_ID,
+ PACKAGED_EXTENSION_NAME,
+ document
+ );
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js
new file mode 100644
index 0000000000..6e0b21fb20
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js
@@ -0,0 +1,70 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// Test that temporary extensions show a message about temporary ids, with a learn more
+// link.
+add_task(async function () {
+ const EXTENSION_NAME = "Temporary web extension";
+ const EXTENSION_ID = "test-devtools@mozilla.org";
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ },
+ document
+ );
+
+ info("Wait until a debug target item appears");
+ await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document));
+
+ const target = findDebugTargetByText(EXTENSION_NAME, document);
+
+ const message = target.querySelector(".qa-temporary-id-message");
+ ok(!!message, "Temporary id message is displayed for temporary extensions");
+
+ const link = target.querySelector(".qa-temporary-id-link");
+ ok(!!link, "Temporary id link is displayed for temporary extensions");
+
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+ await removeTab(tab);
+});
+
+// Test that the message and the link are not displayed for a regular extension.
+add_task(async function () {
+ const PACKAGED_EXTENSION_ID = "packaged-extension@tests";
+ const PACKAGED_EXTENSION_NAME = "Packaged extension";
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installRegularExtension(
+ "resources/packaged-extension/packaged-extension.xpi"
+ );
+
+ info("Wait until extension appears in about:debugging");
+ await waitUntil(() =>
+ findDebugTargetByText(PACKAGED_EXTENSION_NAME, document)
+ );
+ const target = findDebugTargetByText(PACKAGED_EXTENSION_NAME, document);
+
+ const tmpIdMessage = target.querySelector(".qa-temporary-id-message");
+ ok(
+ !tmpIdMessage,
+ "No temporary id message is displayed for a regular extension"
+ );
+
+ await removeExtension(
+ PACKAGED_EXTENSION_ID,
+ PACKAGED_EXTENSION_NAME,
+ document
+ );
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js
new file mode 100644
index 0000000000..21a30ab3bf
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js
@@ -0,0 +1,89 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+/**
+ * Test that the installation error messages are displayed when installing temporary
+ * extensions.
+ */
+
+const INVALID_JSON_EXTENSION_PATH =
+ "resources/bad-extensions/invalid-json/manifest.json";
+const INVALID_PROP_EXTENSION_PATH =
+ "resources/bad-extensions/invalid-property/manifest.json";
+const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json";
+const EXTENSION_NAME = "test-temporary-extension";
+
+// Extension with an invalid JSON manifest will not be parsed. We check the expected
+// error message is displayed
+add_task(async function testInvalidJsonExtension() {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const installError = await installBadExtension(
+ INVALID_JSON_EXTENSION_PATH,
+ document
+ );
+ ok(
+ installError.textContent.includes("JSON.parse: unexpected keyword"),
+ "The expected installation error is displayed: " + installError.textContent
+ );
+
+ info("Install a valid extension to make the message disappear");
+ await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document);
+
+ info("Wait until the error message disappears");
+ await waitUntil(
+ () => !document.querySelector(".qa-tmp-extension-install-error")
+ );
+
+ info("Wait for the temporary addon to be displayed as a debug target");
+ await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document));
+
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+
+ await removeTab(tab);
+});
+
+// Extension with a valid JSON manifest but containing an invalid property should display
+// a detailed error message coming from the Addon Manager.
+add_task(async function testInvalidPropertyExtension() {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const installError = await installBadExtension(
+ INVALID_PROP_EXTENSION_PATH,
+ document
+ );
+
+ ok(
+ installError.textContent.includes("Extension is invalid"),
+ "The basic installation error is displayed: " + installError.textContent
+ );
+ ok(
+ installError.textContent.includes(
+ "Reading manifest: Error processing content_scripts.0.matches"
+ ),
+ "The detailed installation error is also displayed: " +
+ installError.textContent
+ );
+
+ await removeTab(tab);
+});
+
+async function installBadExtension(path, document) {
+ info("Install a bad extension at path: " + path);
+ // Do not use installTemporaryAddon here since the install will fail.
+ prepareMockFilePicker(path);
+ document.querySelector(".qa-temporary-extension-install-button").click();
+
+ info("Wait until the install error message appears");
+ await waitUntil(() =>
+ document.querySelector(".qa-tmp-extension-install-error")
+ );
+ return document.querySelector(".qa-tmp-extension-install-error");
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js
new file mode 100644
index 0000000000..a6f9fde0c1
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js
@@ -0,0 +1,65 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+/**
+ * Test the the path used to install a temporary addon is saved in a preference and reused
+ * next time the feature is used.
+ */
+
+const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json";
+const EXTENSION_NAME = "test-temporary-extension";
+const LAST_DIR_PREF = "devtools.aboutdebugging.tmpExtDirPath";
+
+// Check that the preference is updated when trying to install a temporary extension.
+add_task(async function testPreferenceUpdatedAfterInstallingExtension() {
+ registerCleanupFunction(() => {
+ Services.prefs.clearUserPref(LAST_DIR_PREF);
+ });
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document);
+
+ info("Check whether the selected dir sets into the pref");
+ const lastDirPath = Services.prefs.getCharPref(LAST_DIR_PREF, "");
+ const expectedPath = getTestFilePath("resources/test-temporary-extension");
+ is(lastDirPath, expectedPath, "The selected dir should set into the pref");
+
+ await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document));
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+ await removeTab(tab);
+});
+
+// Check that the preference is updated when trying to install a temporary extension.
+add_task(async function testPreferenceRetrievedWhenInstallingExtension() {
+ const selectedDir = getTestFilePath("resources/packaged-extension");
+
+ await pushPref(LAST_DIR_PREF, selectedDir);
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const MockFilePicker = SpecialPowers.MockFilePicker;
+ MockFilePicker.init(window);
+ const onFilePickerShown = new Promise(resolve => {
+ MockFilePicker.showCallback = fp => {
+ resolve(fp);
+ };
+ });
+ document.querySelector(".qa-temporary-extension-install-button").click();
+
+ info("Check whether the shown dir is same as the pref");
+ const fp = await onFilePickerShown;
+ is(
+ fp.displayDirectory.path,
+ selectedDir,
+ "Shown directory sets as same as the pref"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js
new file mode 100644
index 0000000000..da09727d9e
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js
@@ -0,0 +1,68 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// Test that the reload button updates the addon list with the correct metadata.
+add_task(async function () {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const EXTENSION_ID = "test-devtools@mozilla.org";
+ const EXTENSION_NAME = "Temporary web extension";
+
+ let { xpiFile: addonFile } = await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ },
+ document
+ );
+
+ const target = findDebugTargetByText(EXTENSION_NAME, document);
+ ok(!!target, "The temporary extension is installed with the expected name");
+
+ info("Update the name of the temporary extension in the manifest");
+ addonFile = updateTemporaryXPI({ id: EXTENSION_ID }, addonFile);
+
+ info("Click on the reload button for the invalid temporary extension");
+ const waitForError = waitForDispatch(
+ window.AboutDebugging.store,
+ "TEMPORARY_EXTENSION_RELOAD_FAILURE"
+ );
+ const reloadButton = target.querySelector(
+ ".qa-temporary-extension-reload-button"
+ );
+ reloadButton.click();
+ await waitForError;
+ ok(
+ target.querySelector(".qa-temporary-extension-reload-error"),
+ "The error message of reloading appears"
+ );
+
+ info("Click on the reload button for the valid temporary extension");
+ const waitForSuccess = waitForDispatch(
+ window.AboutDebugging.store,
+ "TEMPORARY_EXTENSION_RELOAD_SUCCESS"
+ );
+ updateTemporaryXPI({ id: EXTENSION_ID, name: EXTENSION_NAME }, addonFile);
+ reloadButton.click();
+ await waitForSuccess;
+ ok(
+ !target.querySelector(".qa-temporary-extension-reload-error"),
+ "The error message of reloading disappears"
+ );
+
+ info("Click on the remove button for the temporary extension");
+ const removeButton = target.querySelector(
+ ".qa-temporary-extension-remove-button"
+ );
+ removeButton.click();
+
+ info("Wait until the debug target with the extension disappears");
+ await waitUntil(() => !findDebugTargetByText(EXTENSION_NAME, document));
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js
new file mode 100644
index 0000000000..db46754caa
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js
@@ -0,0 +1,49 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+// Test that extension warnings are displayed in about:debugging.
+add_task(async function () {
+ const EXTENSION_NAME = "Temporary web extension";
+ const EXTENSION_ID = "test-devtools@mozilla.org";
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await pushPref("extensions.webextensions.warnings-as-errors", false);
+ await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ extraProperties: {
+ // This property is not expected in the manifest and should trigger a warning!
+ wrongProperty: {},
+ },
+ },
+ document
+ );
+ await SpecialPowers.popPrefEnv();
+
+ info("Wait until a debug target item appears");
+ await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document));
+ const target = findDebugTargetByText(EXTENSION_NAME, document);
+
+ const warningMessage = target.querySelector(".qa-message");
+ ok(
+ !!warningMessage,
+ "A warning message is displayed for the installed addon"
+ );
+
+ const warningText = warningMessage.textContent;
+ ok(
+ warningText.includes("wrongProperty"),
+ "The warning message mentions wrongProperty"
+ );
+
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js
new file mode 100644
index 0000000000..92096703ac
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js
@@ -0,0 +1,103 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Test the network locations form of the Connect page.
+ * Check that a network location can be added and removed.
+ */
+
+const TEST_NETWORK_LOCATION = "localhost:1111";
+const TEST_NETWORK_LOCATION_INVALID = "testnetwork";
+
+add_task(async function () {
+ const { document, tab } = await openAboutDebugging();
+
+ await selectConnectPage(document);
+
+ let networkLocations = document.querySelectorAll(".qa-network-location");
+ is(
+ networkLocations.length,
+ 0,
+ "By default, no network locations are displayed"
+ );
+
+ info("Check whether error message should show if the input value is invalid");
+ addNetworkLocation(TEST_NETWORK_LOCATION_INVALID, document);
+ await waitUntil(() =>
+ document.querySelector(".qa-connect-page__network-form__error-message")
+ );
+
+ info("Wait until the new network location is visible in the list");
+ addNetworkLocation(TEST_NETWORK_LOCATION, document);
+ await waitUntil(
+ () => document.querySelectorAll(".qa-network-location").length === 1
+ );
+ await waitUntil(
+ () =>
+ !document.querySelector(".qa-connect-page__network-form__error-message")
+ );
+
+ networkLocations = document.querySelectorAll(".qa-network-location");
+ const networkLocationValue = networkLocations[0].querySelector(
+ ".qa-network-location-value"
+ );
+ is(
+ networkLocationValue.textContent,
+ TEST_NETWORK_LOCATION,
+ "Added network location has the expected value"
+ );
+
+ info(
+ "Check whether error message should show if the input value was duplicate"
+ );
+ addNetworkLocation(TEST_NETWORK_LOCATION, document);
+ await waitUntil(() =>
+ document.querySelector(".qa-connect-page__network-form__error-message")
+ );
+
+ info("Wait until the new network location is removed from the list");
+ removeNetworkLocation(TEST_NETWORK_LOCATION, document);
+ await waitUntil(
+ () => document.querySelectorAll(".qa-network-location").length === 0
+ );
+
+ await removeTab(tab);
+});
+
+function addNetworkLocation(location, document) {
+ info("Setting a value in the network form input");
+ const networkLocationInput = document.querySelector(".qa-network-form-input");
+ networkLocationInput.value = "";
+ networkLocationInput.focus();
+ EventUtils.sendString(location, networkLocationInput.ownerGlobal);
+
+ info("Click on network form submit button");
+ const networkLocationSubmitButton = document.querySelector(
+ ".qa-network-form-submit-button"
+ );
+ networkLocationSubmitButton.click();
+}
+
+function removeNetworkLocation(location, document) {
+ const networkLocation = getNetworkLocation(location, document);
+ ok(networkLocation, "Network location container found.");
+
+ info("Click on the remove button for the provided network location");
+ const removeButton = networkLocation.querySelector(
+ ".qa-network-location-remove-button"
+ );
+ removeButton.click();
+}
+
+function getNetworkLocation(location, document) {
+ info("Find the container for network location: " + location);
+ const networkLocations = document.querySelectorAll(".qa-network-location");
+ return [...networkLocations].find(element => {
+ return (
+ element.querySelector(".qa-network-location-value").textContent ===
+ location
+ );
+ });
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js
new file mode 100644
index 0000000000..e0d7303669
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js
@@ -0,0 +1,81 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
+
+/**
+ * Check that USB Devices scanning can be enabled and disabled from the connect page.
+ */
+add_task(async function () {
+ await pushPref(
+ "devtools.remote.adb.extensionURL",
+ CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi"
+ );
+ await checkAdbNotRunning();
+
+ const { document, tab } = await openAboutDebugging();
+
+ await selectConnectPage(document);
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+
+ info("Check that by default USB devices are disabled");
+ const usbDisabledMessage = document.querySelector(
+ ".qa-connect-usb-disabled-message"
+ );
+ ok(usbDisabledMessage, "A message about enabling USB devices is rendered");
+
+ const usbToggleButton = document.querySelector(
+ ".qa-connect-usb-toggle-button"
+ );
+ ok(usbToggleButton, "The button to toggle USB devices debugging is rendered");
+ ok(
+ usbToggleButton.textContent.includes("Enable"),
+ "The text of the toggle USB button is correct"
+ );
+
+ info("Click on the toggle button");
+ usbToggleButton.click();
+
+ info("Wait until the toggle button text is updated");
+ await waitUntil(() => usbToggleButton.textContent.includes("Disable"));
+ ok(
+ !document.querySelector(".qa-connect-usb-disabled-message"),
+ "The message about enabling USB devices is no longer rendered"
+ );
+
+ info("Check that the addon was installed with the proper source");
+ const adbExtensionId = Services.prefs.getCharPref(
+ "devtools.remote.adb.extensionID"
+ );
+ const addon = await AddonManager.getAddonByID(adbExtensionId);
+ Assert.deepEqual(
+ addon.installTelemetryInfo,
+ { source: "about:debugging" },
+ "Got the expected addon.installTelemetryInfo"
+ );
+
+ // Right now we are resuming as soon as "USB enabled" is displayed, but ADB
+ // might still be starting up. If we move to uninstall directly, the ADB startup will
+ // fail and we will have an unhandled promise rejection.
+ // See Bug 1498469.
+ await waitForAdbStart();
+
+ info("Click on the toggle button");
+ usbToggleButton.click();
+
+ info("Wait until the toggle button text is updated");
+ await waitUntil(() => usbToggleButton.textContent.includes("Enable"));
+ ok(
+ document.querySelector(".qa-connect-usb-disabled-message"),
+ "The message about enabling USB devices is rendered again"
+ );
+
+ await stopAdbProcess();
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js
new file mode 100644
index 0000000000..dfee0c1ba0
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js
@@ -0,0 +1,70 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const USB_RUNTIME_ID = "1337id";
+const USB_DEVICE_NAME = "Fancy Phone";
+const USB_APP_NAME = "Lorem ipsum";
+
+/**
+ * Check whether can toggle enable/disable connection prompt setting.
+ */
+add_task(async function () {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ const runtime = mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_DEVICE_NAME,
+ name: USB_APP_NAME,
+ });
+
+ info("Set initial state for test");
+ await pushPref("devtools.debugger.prompt-connection", true);
+
+ // open a remote runtime page
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.emitUSBUpdate();
+ await connectToRuntime(USB_DEVICE_NAME, document);
+ await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
+
+ info("Check whether connection prompt toggle button exists");
+ let connectionPromptToggleButton = document.querySelector(
+ ".qa-connection-prompt-toggle-button"
+ );
+ ok(connectionPromptToggleButton, "Toggle button existed");
+ ok(
+ connectionPromptToggleButton.textContent.includes("Disable"),
+ "Toggle button shows 'Disable'"
+ );
+
+ info("Click on the toggle button");
+ connectionPromptToggleButton = document.querySelector(
+ ".qa-connection-prompt-toggle-button"
+ );
+ connectionPromptToggleButton.click();
+ info("Wait until the toggle button text is updated");
+ await waitUntil(() =>
+ connectionPromptToggleButton.textContent.includes("Enable")
+ );
+ info("Check the preference");
+ const disabledPref = runtime.getPreference(
+ "devtools.debugger.prompt-connection"
+ );
+ is(disabledPref, false, "The preference should be updated");
+
+ info("Click on the toggle button again");
+ connectionPromptToggleButton.click();
+ info("Wait until the toggle button text is updated");
+ await waitUntil(() =>
+ connectionPromptToggleButton.textContent.includes("Disable")
+ );
+ info("Check the preference");
+ const enabledPref = runtime.getPreference(
+ "devtools.debugger.prompt-connection"
+ );
+ is(enabledPref, true, "The preference should be updated");
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
new file mode 100644
index 0000000000..7b25e02a9b
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test that collapsibilities of DebugTargetPane on RuntimePage by mouse clicking.
+ */
+
+add_task(async function () {
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ for (const { title } of TARGET_PANES) {
+ info("Check whether this pane is collapsed after clicking the title");
+ await toggleCollapsibility(getDebugTargetPane(title, document));
+ assertDebugTargetCollapsed(getDebugTargetPane(title, document), title);
+
+ info("Check whether this pane is expanded after clicking the title again");
+ await toggleCollapsibility(getDebugTargetPane(title, document));
+ await assertDebugTargetExpanded(getDebugTargetPane(title, document), title);
+ }
+
+ await removeTab(tab);
+});
+
+async function assertDebugTargetCollapsed(paneEl, title) {
+ info("Check debug target is collapsed");
+
+ // check list height
+ const targetEl = paneEl.querySelector(".qa-debug-target-pane__collapsable");
+ is(targetEl.clientHeight, 0, "Height of list element is zero");
+ // check title
+ const titleEl = paneEl.querySelector(".qa-debug-target-pane-title");
+ const expectedTitle = `${title} (${
+ targetEl.querySelectorAll(".qa-debug-target-item").length
+ })`;
+ is(titleEl.textContent, expectedTitle, "Collapsed title is correct");
+}
+
+async function assertDebugTargetExpanded(paneEl, title) {
+ info("Check debug target is expanded");
+
+ // check list height
+ const targetEl = paneEl.querySelector(".qa-debug-target-pane__collapsable");
+ await waitUntil(() => targetEl.clientHeight > 0);
+ ok(true, "Height of list element is greater than zero");
+ // check title
+ const titleEl = paneEl.querySelector(".qa-debug-target-pane-title");
+ const expectedTitle = `${title} (${
+ targetEl.querySelectorAll(".qa-debug-target-item").length
+ })`;
+ is(titleEl.textContent, expectedTitle, "Expanded title is correct");
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js
new file mode 100644
index 0000000000..50857ee617
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js
@@ -0,0 +1,40 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test for preference of DebugTargetPane collapsibilities.
+ */
+
+add_task(async function () {
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Collapse all pane");
+ for (const { title } of TARGET_PANES) {
+ const debugTargetPaneEl = getDebugTargetPane(title, document);
+ await toggleCollapsibility(debugTargetPaneEl);
+ }
+
+ info("Check preference of collapsibility after closing about:debugging page");
+ await removeTab(tab);
+ // Wait until unmount.
+ await waitUntil(() => document.querySelector(".app") === null);
+
+ for (const { pref } of TARGET_PANES) {
+ is(
+ Services.prefs.getBoolPref(pref),
+ true,
+ `${pref} preference should be true`
+ );
+ }
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js
new file mode 100644
index 0000000000..301be26a32
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js
@@ -0,0 +1,83 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test that an "empty" message is displayed when there are no debug targets in a debug
+ * target pane.
+ */
+
+const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json";
+const EXTENSION_NAME = "test-temporary-extension";
+
+add_task(async function () {
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Check that the temporary extensions pane is empty");
+ const temporaryExtensionPane = getDebugTargetPane(
+ "Temporary Extensions",
+ document
+ );
+ ok(
+ !temporaryExtensionPane.querySelector(".qa-debug-target-item"),
+ "Temporary Extensions pane contains no debug target"
+ );
+
+ info("Check an empty target pane message is displayed");
+ ok(
+ temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"),
+ "An empty target list message is displayed"
+ );
+
+ info("Install a temporary extension");
+ await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document);
+
+ info("Wait until a debug target item appears");
+ await waitUntil(() =>
+ temporaryExtensionPane.querySelector(".qa-debug-target-item")
+ );
+
+ info("Check the empty target pane message is no longer displayed");
+ ok(
+ !temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"),
+ "The empty target list message is no longer displayed"
+ );
+
+ const temporaryExtensionItem = temporaryExtensionPane.querySelector(
+ ".qa-debug-target-item"
+ );
+ ok(
+ temporaryExtensionItem,
+ "Temporary Extensions pane now shows debug target"
+ );
+
+ info("Remove the temporary extension");
+ temporaryExtensionItem
+ .querySelector(".qa-temporary-extension-remove-button")
+ .click();
+
+ info("Wait until the debug target item disappears");
+ await waitUntil(
+ () => !temporaryExtensionPane.querySelector(".qa-debug-target-item")
+ );
+
+ info("Check the empty target pane message is displayed again");
+ ok(
+ temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"),
+ "An empty target list message is displayed again"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js
new file mode 100644
index 0000000000..0f50b9454b
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js
@@ -0,0 +1,72 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_DEVICE_NAME = "test device name";
+const RUNTIME_APP_NAME = "TestApp";
+
+// Test that the expected supported categories are displayed for USB runtimes.
+add_task(async function () {
+ const mocks = new Mocks();
+ await checkTargetPanes({ enableLocalTabs: false }, mocks);
+
+ info(
+ "Check that enableLocalTabs has no impact on the categories displayed for remote" +
+ " runtimes."
+ );
+ await checkTargetPanes({ enableLocalTabs: true }, mocks);
+});
+
+async function checkTargetPanes({ enableLocalTabs }, mocks) {
+ const { document, tab, window } = await openAboutDebugging({
+ enableLocalTabs,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ name: RUNTIME_APP_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ await connectToRuntime(RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document);
+
+ const SUPPORTED_TARGET_PANES = [
+ "Temporary Extensions",
+ "Extensions",
+ "Other Workers",
+ "Shared Workers",
+ "Service Workers",
+ "Tabs",
+ ];
+
+ for (const { title } of TARGET_PANES) {
+ const debugTargetPaneEl = getDebugTargetPane(title, document);
+ if (SUPPORTED_TARGET_PANES.includes(title)) {
+ ok(debugTargetPaneEl, `Supported target pane [${title}] is displayed`);
+ } else {
+ ok(!debugTargetPaneEl, `Unsupported target pane [${title}] is hidden`);
+ }
+ }
+
+ const installButton = document.querySelector(
+ ".qa-temporary-extension-install-button"
+ );
+ ok(!installButton, "Temporary Extensions install button is hidden");
+
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ await removeTab(tab);
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js
new file mode 100644
index 0000000000..4ea3238ea3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js
@@ -0,0 +1,51 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Check that DevTools are not closed when leaving This Firefox runtime page.
+ */
+
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const connectSidebarItem = findSidebarItemByText("Setup", document);
+ const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link");
+ ok(connectSidebarItem, "Found the Connect sidebar item");
+
+ info("Open devtools on the current about:debugging tab");
+ const toolbox = await openToolboxForTab(tab, "inspector");
+ const inspector = toolbox.getPanel("inspector");
+
+ info("DevTools starts workers, wait for requests to settle");
+ const store = window.AboutDebugging.store;
+ await waitForAboutDebuggingRequests(store);
+
+ info("Click on the Connect item in the sidebar");
+ connectLink.click();
+ await waitForDispatch(store, "UNWATCH_RUNTIME_SUCCESS");
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+
+ const markupViewElement = inspector.panelDoc.getElementById("markup-box");
+ ok(markupViewElement, "Inspector is still rendered");
+
+ // We explicitely destroy the toolbox in order to ensure waiting for its full destruction
+ // and avoid leak / pending requests
+ info("Destroy the opened toolbox");
+ await toolbox.destroy();
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_breakpoint.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_breakpoint.js
new file mode 100644
index 0000000000..925d40b643
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_breakpoint.js
@@ -0,0 +1,74 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/shared-head.js",
+ this
+);
+
+const SCRIPT_FILE = "script_aboutdebugging_devtoolstoolbox_breakpoint.js";
+const TAB_URL =
+ "https://example.com/browser/devtools/client/aboutdebugging/" +
+ "test/browser/resources/doc_aboutdebugging_devtoolstoolbox_breakpoint.html";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test breakpoints in about:devtools-toolbox tabs (ie non localTab tab target).
+ */
+add_task(async function () {
+ const testTab = await addTab(TAB_URL);
+
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ TAB_URL
+ );
+ info("Select performance panel");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("jsdebugger");
+
+ info("Add a breakpoint at line 10 in the test script");
+ const debuggerContext = createDebuggerContext(toolbox);
+ await selectSource(debuggerContext, SCRIPT_FILE);
+ await addBreakpoint(debuggerContext, SCRIPT_FILE, 10);
+
+ info("Invoke testMethod, expect the script to pause on line 10");
+ const onContentTaskDone = ContentTask.spawn(
+ testTab.linkedBrowser,
+ {},
+ function () {
+ content.wrappedJSObject.testMethod();
+ }
+ );
+
+ info("Wait for the debugger to pause");
+ await waitForPaused(debuggerContext);
+ const script = findSource(debuggerContext, SCRIPT_FILE);
+ assertPausedAtSourceAndLine(debuggerContext, script.id, 10);
+
+ info("Resume");
+ await resume(debuggerContext);
+
+ info("Wait for the paused content task to also resolve");
+ await onContentTaskDone;
+
+ info("Remove breakpoint");
+ await removeBreakpoint(debuggerContext, script.id, 10);
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(testTab);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js
new file mode 100644
index 0000000000..eb8f233d12
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js
@@ -0,0 +1,102 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test context menu on about:devtools-toolbox page.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsBrowser, devtoolsTab } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ info("Check whether the menu item which opens devtools is disabled");
+ const rootDocument = devtoolsTab.ownerDocument;
+ await assertContextMenu(
+ rootDocument,
+ devtoolsBrowser,
+ ".debug-target-info",
+ false
+ );
+
+ info("Force to select about:debugging page");
+ await updateSelectedTab(gBrowser, tab, window.AboutDebugging.store);
+
+ info("Check whether the menu item which opens devtools is enabled");
+ await assertContextMenu(rootDocument, devtoolsBrowser, "#mount", true);
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
+
+async function assertContextMenu(
+ rootDocument,
+ browser,
+ targetSelector,
+ shouldBeEnabled
+) {
+ if (shouldBeEnabled) {
+ await assertContextMenuEnabled(rootDocument, browser, targetSelector);
+ } else {
+ await assertContextMenuDisabled(rootDocument, browser, targetSelector);
+ }
+}
+
+async function assertContextMenuDisabled(
+ rootDocument,
+ browser,
+ targetSelector
+) {
+ const contextMenu = rootDocument.getElementById("contentAreaContextMenu");
+ let isPopupShown = false;
+ const listener = () => {
+ isPopupShown = true;
+ };
+ contextMenu.addEventListener("popupshown", listener);
+ BrowserTestUtils.synthesizeMouseAtCenter(
+ targetSelector,
+ { type: "contextmenu" },
+ browser
+ );
+ await wait(1000);
+ ok(!isPopupShown, `Context menu should not be shown`);
+ contextMenu.removeEventListener("popupshown", listener);
+}
+
+async function assertContextMenuEnabled(rootDocument, browser, targetSelector) {
+ // Show content context menu.
+ const contextMenu = rootDocument.getElementById("contentAreaContextMenu");
+ const popupShownPromise = BrowserTestUtils.waitForEvent(
+ contextMenu,
+ "popupshown"
+ );
+ BrowserTestUtils.synthesizeMouseAtCenter(
+ targetSelector,
+ { type: "contextmenu" },
+ browser
+ );
+ await popupShownPromise;
+ ok(true, `Context menu should be shown`);
+
+ // Hide content context menu.
+ const popupHiddenPromise = BrowserTestUtils.waitForEvent(
+ contextMenu,
+ "popuphidden"
+ );
+ contextMenu.hidePopup();
+ await popupHiddenPromise;
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js
new file mode 100644
index 0000000000..bc46b828fd
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js
@@ -0,0 +1,45 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test context menu of markup view on about:devtools-toolbox page.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ info("Select inspector tool");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("inspector");
+
+ info("Show context menu of markup view");
+ const markupDocument = toolbox.getPanel("inspector").markup.doc;
+ EventUtils.synthesizeMouseAtCenter(
+ markupDocument.body,
+ { type: "contextmenu" },
+ markupDocument.ownerGlobal
+ );
+
+ info("Check whether proper context menu of markup view will be shown");
+ await waitUntil(() => toolbox.topDoc.querySelector("#node-menu-edithtml"));
+ ok(true, "Context menu of markup view should be shown");
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js
new file mode 100644
index 0000000000..a3fa63c340
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js
@@ -0,0 +1,122 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test whether the focus transfers to a tab which is already inspected .
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ info(
+ "Select 'performance' panel as the initial tool since the tool does not listen " +
+ "any changes of the document without user action"
+ );
+ await pushPref("devtools.toolbox.selectedTool", "performance");
+
+ const { document, tab, window } = await openAboutDebugging();
+ const { store } = window.AboutDebugging;
+ await selectThisFirefoxPage(document, store);
+
+ const inspectionTarget = "about:debugging";
+ info(`Open ${inspectionTarget} as inspection target`);
+ await waitUntil(() => findDebugTargetByText(inspectionTarget, document));
+ info(`Inspect ${inspectionTarget} page in about:devtools-toolbox`);
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ inspectionTarget
+ );
+
+ info(
+ "Check the tab state after clicking inspect button " +
+ "when another tab was selected"
+ );
+ await updateSelectedTab(gBrowser, tab, store);
+ clickInspectButton(inspectionTarget, document);
+ const devtoolsURL = devtoolsWindow.location.href;
+ assertDevtoolsToolboxTabState(devtoolsURL);
+
+ info(
+ "Check the tab state after clicking inspect button " +
+ "when the toolbox tab is in another window"
+ );
+ const newNavigator = gBrowser.replaceTabWithWindow(devtoolsTab);
+ await waitUntil(
+ () =>
+ newNavigator.gBrowser &&
+ newNavigator.gBrowser.selectedTab.linkedBrowser.contentWindow.location
+ .href === devtoolsURL
+ );
+
+ info(
+ "Create a tab in the window and select the tab " +
+ "so that the about:devtools-toolbox tab loses focus"
+ );
+ const newTestTab = newNavigator.gBrowser.addTab(
+ "data:text/html,<title>TEST_TAB</title>",
+ {
+ triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+ }
+ );
+ await waitUntil(() => findDebugTargetByText("TEST_TAB", document));
+
+ await updateSelectedTab(newNavigator.gBrowser, newTestTab, store);
+
+ let onTabsSuccess = waitForDispatch(store, "REQUEST_TABS_SUCCESS");
+ clickInspectButton(inspectionTarget, document);
+ assertDevtoolsToolboxTabState(devtoolsURL);
+ await onTabsSuccess;
+
+ info("Close new navigator and wait until the debug target disappears");
+ onTabsSuccess = waitForDispatch(store, "REQUEST_TABS_SUCCESS");
+ const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
+ newNavigator.close();
+ await onToolboxDestroyed;
+ await onTabsSuccess;
+
+ await waitUntil(() => !findDebugTargetByText("Toolbox - ", document));
+
+ info("Remove test tab");
+ await removeTab(tab);
+});
+
+function clickInspectButton(inspectionTarget, doc) {
+ const target = findDebugTargetByText(inspectionTarget, doc);
+ const button = target.querySelector(".qa-debug-target-inspect-button");
+ button.click();
+}
+
+// Check that only one tab is currently opened for the provided URL.
+// Also check that this tab and the tab's window are focused.
+function assertDevtoolsToolboxTabState(devtoolsURL) {
+ const existingTabs = [];
+
+ for (const navigator of Services.wm.getEnumerator("navigator:browser")) {
+ for (const browser of navigator.gBrowser.browsers) {
+ if (
+ browser.contentWindow &&
+ browser.contentWindow.location.href === devtoolsURL
+ ) {
+ const tab = navigator.gBrowser.getTabForBrowser(browser);
+ existingTabs.push(tab);
+ }
+ }
+ }
+
+ is(existingTabs.length, 1, `Only one tab is opened for ${devtoolsURL}`);
+ const tab = existingTabs[0];
+ const navigator = tab.ownerGlobal;
+ is(navigator.gBrowser.selectedTab, tab, "The tab is selected");
+ const focusedNavigator = Services.wm.getMostRecentWindow("navigator:browser");
+ is(navigator, focusedNavigator, "The navigator is focused");
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js
new file mode 100644
index 0000000000..c2f0c5e362
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js
@@ -0,0 +1,74 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test the status of menu items when open about:devtools-toolbox.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ info("Check whether the menu items are disabled");
+ const rootDocument = devtoolsTab.ownerDocument;
+ await assertMenusItems(rootDocument, false);
+
+ info("Select the inspector");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("inspector");
+
+ info("Force to select about:debugging page");
+ await updateSelectedTab(gBrowser, tab, window.AboutDebugging.store);
+
+ info("Check whether the menu items are enabled");
+ await assertMenusItems(rootDocument, true);
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
+
+async function assertMenusItems(rootDocument, shouldBeEnabled) {
+ info("Wait for the Toggle Tools menu-item hidden attribute to change");
+ const menuItem = rootDocument.getElementById("menu_devToolbox");
+ await waitUntil(() => menuItem.hidden === !shouldBeEnabled);
+
+ info(
+ "Check that the state of the Toggle Tools menu-item depends on the page"
+ );
+ assertMenuItem(rootDocument, "menu_devToolbox", shouldBeEnabled);
+
+ info(
+ "Check that the tools menu-items are always enabled regardless of the page"
+ );
+ for (const toolDefinition of gDevTools.getToolDefinitionArray()) {
+ if (!toolDefinition.inMenu) {
+ continue;
+ }
+
+ assertMenuItem(rootDocument, "menuitem_" + toolDefinition.id, true);
+ }
+}
+
+function assertMenuItem(rootDocument, menuItemId, shouldBeEnabled) {
+ const menuItem = rootDocument.getElementById(menuItemId);
+ is(
+ menuItem.hidden,
+ !shouldBeEnabled,
+ `"hidden" attribute of menu item(${menuItemId}) should be correct`
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js
new file mode 100644
index 0000000000..79428ae8da
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js
@@ -0,0 +1,63 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const ORIGINAL_URL = "https://example.com/document-builder.sjs?html=page1";
+const OTHER_URL = "https://example.org/document-builder.sjs?html=page2";
+
+async function waitForUrl(url, toolbox, browserTab, win) {
+ const { onDomCompleteResource } =
+ await waitForNextTopLevelDomCompleteResource(toolbox.commands);
+
+ return Promise.all([
+ waitUntil(
+ () =>
+ toolbox.target.url === url &&
+ browserTab.linkedBrowser.currentURI.spec === url
+ ),
+ onDomCompleteResource,
+ toolbox.commands.client.waitForRequestsToSettle(),
+ waitForAboutDebuggingRequests(win.AboutDebugging.store),
+ ]);
+}
+
+// Test that ensures the remote page can go forward and back via UI buttons
+add_task(async function () {
+ const browserTab = await addTab(ORIGINAL_URL);
+
+ const { document, tab, window } = await openAboutDebugging();
+
+ // go to This Firefox and inspect the new tab
+ info("Inspecting a new tab in This Firefox");
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const devToolsToolbox = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ ORIGINAL_URL
+ );
+ const { devtoolsDocument, devtoolsWindow } = devToolsToolbox;
+ const toolbox = getToolbox(devtoolsWindow);
+
+ info("Navigating to another URL");
+ let onTargetSwitched = toolbox.commands.targetCommand.once("switched-target");
+ const urlInput = devtoolsDocument.querySelector(".devtools-textinput");
+ await synthesizeUrlKeyInput(devToolsToolbox, urlInput, OTHER_URL);
+ await waitForUrl(OTHER_URL, toolbox, browserTab, window);
+ await onTargetSwitched;
+
+ info("Clicking back button");
+ onTargetSwitched = toolbox.commands.targetCommand.once("switched-target");
+ devtoolsDocument.querySelector(".qa-back-button").click();
+ await waitForUrl(ORIGINAL_URL, toolbox, browserTab, window);
+ await onTargetSwitched;
+
+ info("Clicking the forward button");
+ onTargetSwitched = toolbox.commands.targetCommand.once("switched-target");
+ devtoolsDocument.querySelector(".qa-forward-button").click();
+ await waitForUrl(OTHER_URL, toolbox, browserTab, window);
+ await onTargetSwitched;
+
+ ok(true, "Clicking back and forward works!");
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js
new file mode 100644
index 0000000000..fbd46101a2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js
@@ -0,0 +1,53 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+function clickReload(devtoolsDocument) {
+ devtoolsDocument.querySelector(".qa-reload-button").click();
+}
+
+// Test that ensures the remote page is reloaded when the button is clicked
+add_task(async function () {
+ const debug_tab = await addTab("about:home");
+
+ const { document, tab, window } = await openAboutDebugging();
+
+ // go to This Firefox and inspect the new tab
+ info("Inspecting a new tab in This Firefox");
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsDocument, devtoolsTab, devtoolsWindow } =
+ await openAboutDevtoolsToolbox(document, tab, window, "about:home");
+
+ info("Clicking reload button and waiting for requests to complete");
+ const toolbox = getToolbox(devtoolsWindow);
+ const { onDomCompleteResource } =
+ await waitForNextTopLevelDomCompleteResource(toolbox.commands);
+
+ // Watch for navigation promises.
+ const refreshes = Promise.all([
+ onDomCompleteResource,
+ toolbox.commands.client.waitForRequestsToSettle(),
+ waitForAboutDebuggingRequests(window.AboutDebugging.store),
+ ]);
+
+ // We cannot include this one in the Promise.all array, as it needs to be
+ // explicitly called after navigation started.
+ const waitForLoadedPanelsReload = await watchForLoadedPanelsReload(toolbox);
+
+ clickReload(devtoolsDocument);
+ await refreshes;
+ await waitForLoadedPanelsReload();
+
+ ok(true, "Clicked refresh; both page and devtools reloaded");
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+
+ info("Remove the debugged tab");
+ await removeTab(debug_tab);
+ await waitUntil(() => !findDebugTargetByText("about:home", document));
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+
+ info("Remove the about:debugging tab.");
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js
new file mode 100644
index 0000000000..055db0586c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js
@@ -0,0 +1,56 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NEW_TAB_TITLE = "PAGE 2";
+const TAB_URL = "data:text/html,<title>PAGE</title>";
+const NEW_TAB_URL = `data:text/html,<title>${NEW_TAB_TITLE}</title>`;
+
+/**
+ * This test file ensures that the URL input for DebugTargetInfo navigates the target to
+ * the specified URL.
+ */
+add_task(async function () {
+ const { document, tab, window } = await openAboutDebugging();
+
+ info("Open a new background tab.");
+ const debug_tab = await addTab(TAB_URL, { background: true });
+
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const devToolsToolbox = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ "PAGE"
+ );
+ const { devtoolsDocument, devtoolsTab, devtoolsWindow } = devToolsToolbox;
+ const toolbox = getToolbox(devtoolsWindow);
+
+ const urlInput = devtoolsDocument.querySelector(".devtools-textinput");
+ const waitForLoadedPanelsReload = await watchForLoadedPanelsReload(toolbox);
+
+ await synthesizeUrlKeyInput(devToolsToolbox, urlInput, NEW_TAB_URL);
+
+ await waitForLoadedPanelsReload();
+
+ info("Test that the debug target navigated to the specified URL.");
+ await waitUntil(
+ () =>
+ toolbox.target.url === NEW_TAB_URL &&
+ debug_tab.linkedBrowser.currentURI.spec === NEW_TAB_URL
+ );
+ ok(true, "Target navigated.");
+ ok(toolbox.target.title.includes(NEW_TAB_TITLE), "Target's title updated.");
+ is(urlInput.value, NEW_TAB_URL, "Input url updated.");
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+
+ info("Remove the background tab");
+ await removeTab(debug_tab);
+ await waitUntil(() => !findDebugTargetByText("NEW_TAB_TITLE", document));
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+
+ info("Remove the about:debugging tab.");
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
new file mode 100644
index 0000000000..3eba6bcd7e
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
@@ -0,0 +1,74 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test can run for a long time on debug platforms.
+requestLongerTimeout(5);
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+const TOOLS = [
+ "inspector",
+ "webconsole",
+ "jsdebugger",
+ "styleeditor",
+ "memory",
+ "netmonitor",
+ "storage",
+ "accessibility",
+];
+
+/**
+ * Test whether about:devtools-toolbox display correctly after reloading.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ for (const toolId of TOOLS) {
+ await testReloadAboutDevToolsToolbox(toolId);
+ }
+});
+
+async function testReloadAboutDevToolsToolbox(toolId) {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ // We set the options panel to be the default one because slower panels might lead to
+ // race conditions which create leaks in debug mode.
+ await pushPref("devtools.toolbox.selectedTool", "options");
+ const { devtoolsBrowser, devtoolsTab, devtoolsWindow } =
+ await openAboutDevtoolsToolbox(document, tab, window);
+
+ info(`Select tool: ${toolId}`);
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool(toolId);
+
+ info("Wait for requests to settle before reloading");
+ await toolbox.commands.client.waitForRequestsToSettle();
+
+ info("Reload about:devtools-toolbox page");
+ devtoolsBrowser.reload();
+ await gDevTools.once("toolbox-ready");
+ ok(true, "Toolbox is re-created again");
+
+ // Check that about:devtools-toolbox is still selected tab. See Bug 1570692.
+ is(
+ devtoolsBrowser,
+ gBrowser.selectedBrowser,
+ "about:devtools-toolbox is still selected"
+ );
+
+ info("Check whether about:devtools-toolbox page displays correctly");
+ ok(
+ devtoolsBrowser.contentDocument.querySelector(".debug-target-info"),
+ "about:devtools-toolbox page displays correctly"
+ );
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js
new file mode 100644
index 0000000000..b03a206350
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js
@@ -0,0 +1,106 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test shortcut keys on about:devtools-toolbox page.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsBrowser, devtoolsTab, devtoolsWindow } =
+ await openAboutDevtoolsToolbox(document, tab, window);
+
+ info("Check whether the shortcut keys which opens devtools is disabled");
+ await assertShortcutKeys(devtoolsBrowser, false);
+
+ info("Switch to the inspector programmatically");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("inspector");
+
+ info(
+ "Use the Webconsole keyboard shortcut and wait for the panel to be selected"
+ );
+ const onToolReady = toolbox.once("webconsole-ready");
+ EventUtils.synthesizeKey(
+ "K",
+ {
+ accelKey: true,
+ shiftKey: !navigator.userAgent.match(/Mac/),
+ altKey: navigator.userAgent.match(/Mac/),
+ },
+ devtoolsWindow
+ );
+ await onToolReady;
+
+ info("Force to select about:debugging page");
+ await updateSelectedTab(gBrowser, tab, window.AboutDebugging.store);
+
+ info("Check whether the shortcut keys which opens devtools is enabled");
+ await assertShortcutKeys(tab.linkedBrowser, true);
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
+
+async function assertShortcutKeys(browser, shouldBeEnabled) {
+ await assertShortcutKey(browser.contentWindow, "VK_F12", {}, shouldBeEnabled);
+ await assertShortcutKey(
+ browser.contentWindow,
+ "I",
+ {
+ accelKey: true,
+ shiftKey: !navigator.userAgent.match(/Mac/),
+ altKey: navigator.userAgent.match(/Mac/),
+ },
+ shouldBeEnabled
+ );
+}
+
+async function assertShortcutKey(win, key, modifiers, shouldBeEnabled) {
+ info(`Assert shortcut key [${key}]`);
+
+ if (shouldBeEnabled) {
+ await assertShortcutKeyEnabled(win, key, modifiers);
+ } else {
+ await assertShortcutKeyDisabled(win, key, modifiers);
+ }
+}
+
+async function assertShortcutKeyDisabled(win, key, modifiers) {
+ let isReadyCalled = false;
+ const toolboxListener = () => {
+ isReadyCalled = true;
+ };
+ gDevTools.on("toolbox-ready", toolboxListener);
+
+ EventUtils.synthesizeKey(key, modifiers, win);
+ await wait(1000);
+ ok(!isReadyCalled, `Devtools should not be opened by ${key}`);
+
+ gDevTools.off("toolbox-ready", toolboxListener);
+}
+
+async function assertShortcutKeyEnabled(win, key, modifiers) {
+ // Open devtools
+ const onToolboxReady = gDevTools.once("toolbox-ready");
+ EventUtils.synthesizeKey(key, modifiers, win);
+ await onToolboxReady;
+ ok(true, `Devtools should be opened by ${key}`);
+
+ // Close devtools
+ const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
+ EventUtils.synthesizeKey(key, modifiers, win);
+ await onToolboxDestroyed;
+ ok(true, `Devtopls should be closed by ${key}`);
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js
new file mode 100644
index 0000000000..44e83b8c43
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js
@@ -0,0 +1,46 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test that the split console key shortcut works on about:devtools-toolbox.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ // Select any tool that is not the Webconsole, since we will assert the split-console.
+ info("Select inspector tool");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("inspector");
+
+ info("Press Escape and wait for the split console to be opened");
+ const onSplitConsole = toolbox.once("split-console");
+ EventUtils.synthesizeKey("VK_ESCAPE", {}, devtoolsWindow);
+ await onSplitConsole;
+ await waitUntil(() => toolbox.isSplitConsoleFocused());
+ ok(true, "Split console is opened and focused");
+
+ info("Press Escape again and wait for the split console to be closed");
+ EventUtils.synthesizeKey("VK_ESCAPE", {}, devtoolsWindow);
+ await waitUntil(() => !toolbox.isSplitConsoleFocused());
+ ok(true, "Split console is closed and no longer focused");
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js
new file mode 100644
index 0000000000..d0001d1c03
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js
@@ -0,0 +1,36 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test that the expected supported categories are displayed for USB runtimes.
+add_task(async function () {
+ const targetTab = await addTab("about:home");
+
+ const { document, tab, window } = await openAboutDebugging();
+
+ // go to This Firefox and inspect the new tab
+ info("Inspecting a new tab in This Firefox");
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsDocument, devtoolsTab, devtoolsWindow } =
+ await openAboutDevtoolsToolbox(document, tab, window, "about:home");
+ const targetUrl = devtoolsDocument.querySelector(".devtools-textinput");
+ ok(
+ targetUrl.value.includes("about:home"),
+ "about:devtools-toolbox is open for the target"
+ );
+
+ // close the inspected tab and check that error page is shown
+ info("removing the inspected tab");
+ await removeTab(targetTab);
+ await waitUntil(() =>
+ devtoolsWindow.document.querySelector(".qa-error-page")
+ );
+
+ info("closing the toolbox");
+ await removeTab(devtoolsTab);
+ await waitUntil(() => !findDebugTargetByText("Toolbox -", document));
+
+ info("removing about:debugging tab");
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js
new file mode 100644
index 0000000000..047b309740
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js
@@ -0,0 +1,102 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test can run for a long time on asan or debug platforms.
+requestLongerTimeout(3);
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Test tooltip of markup view on about:devtools-toolbox page.
+ */
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ info("Turn on devtools.chrome.enabled to show event badges");
+ await pushPref("devtools.chrome.enabled", true);
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsDocument, devtoolsTab, devtoolsWindow } =
+ await openAboutDevtoolsToolbox(document, tab, window);
+
+ info("Select inspector tool");
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.selectTool("inspector");
+
+ const inspector = toolbox.getPanel("inspector");
+ const markupDocument = inspector.markup.doc;
+ const eventBadge = markupDocument.querySelector(
+ ".inspector-badge.interactive"
+ );
+
+ info(
+ "Check tooltip visibility after clicking on an element in the markup view"
+ );
+ await checkTooltipVisibility(inspector, eventBadge, markupDocument.body);
+
+ info(
+ "Check tooltip visibility after clicking on an element in the DevTools document"
+ );
+ await checkTooltipVisibility(
+ inspector,
+ eventBadge,
+ devtoolsDocument.querySelector(".debug-target-info")
+ );
+
+ info(
+ "Check tooltip visibility after clicking on an element in the root document"
+ );
+ const rootDocument = devtoolsWindow.windowRoot.ownerGlobal.document;
+ await checkTooltipVisibility(
+ inspector,
+ eventBadge,
+ rootDocument.querySelector("#titlebar")
+ );
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
+
+async function checkTooltipVisibility(
+ inspector,
+ elementForShowing,
+ elementForHiding
+) {
+ info("Show event tooltip");
+ elementForShowing.click();
+ const tooltip = inspector.markup.eventDetailsTooltip;
+ await tooltip.once("shown");
+ is(
+ tooltip.container.classList.contains("tooltip-visible"),
+ true,
+ "The tooltip should be shown"
+ );
+
+ info("Hide event tooltip");
+ EventUtils.synthesizeMouse(
+ elementForHiding,
+ 1,
+ 1,
+ {},
+ elementForHiding.ownerGlobal
+ );
+ await tooltip.once("hidden");
+ is(
+ tooltip.container.classList.contains("tooltip-visible"),
+ false,
+ "Tooltip should be hidden"
+ );
+
+ if (inspector._updateProgress) {
+ info("Need to wait for the inspector to update");
+ await inspector.once("inspector-updated");
+ }
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_zoom.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_zoom.js
new file mode 100644
index 0000000000..425efee8f1
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_zoom.js
@@ -0,0 +1,65 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+const { LocalizationHelper } = require("resource://devtools/shared/l10n.js");
+const L10N = new LocalizationHelper(
+ "devtools/client/locales/toolbox.properties"
+);
+
+// Check that the about:devtools-toolbox tab can be zoomed in and that the zoom
+// persists after switching tabs.
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ is(getZoom(devtoolsWindow), 1, "default zoom level correct");
+
+ info("Increase the zoom level");
+
+ // Note that we read the shortcut from the toolbox properties, but that should
+ // match the default browser shortcut `full-zoom-enlarge-shortcut`.
+ synthesizeKeyShortcut(L10N.getStr("toolbox.zoomIn.key"));
+ await waitFor(() => getZoom(devtoolsWindow) > 1);
+ is(getZoom(devtoolsWindow).toFixed(2), "1.10", "zoom level increased");
+
+ info("Switch tabs between about:debugging and the toolbox tab");
+ gBrowser.selectedTab = tab;
+ gBrowser.selectedTab = devtoolsTab;
+
+ info("Wait for the browser to reapply the zoom");
+ await wait(500);
+
+ is(
+ getZoom(devtoolsWindow).toFixed(2),
+ "1.10",
+ "zoom level was restored after switching tabs"
+ );
+
+ info("Restore the default zoom level");
+ synthesizeKeyShortcut(L10N.getStr("toolbox.zoomReset.key"));
+ await waitFor(() => getZoom(devtoolsWindow) === 1);
+ is(getZoom(devtoolsWindow), 1, "default zoom level restored");
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
+
+function getZoom(win) {
+ return win.browsingContext.fullZoom;
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js
new file mode 100644
index 0000000000..778b1bb967
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js
@@ -0,0 +1,141 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_ID = "1337id";
+const DEVICE_NAME = "Fancy Phone";
+const SERVER_RUNTIME_NAME = "Mozilla Firefox";
+const ADB_RUNTIME_NAME = "Firefox Preview";
+const SERVER_VERSION = "v7.3.31";
+const ADB_VERSION = "v1.3.37";
+
+const FENIX_RELEASE_ICON_SRC =
+ "chrome://devtools/skin/images/aboutdebugging-fenix.svg";
+const FENIX_NIGHTLY_ICON_SRC =
+ "chrome://devtools/skin/images/aboutdebugging-fenix-nightly.svg";
+
+/**
+ * Check that Fenix runtime information is correctly displayed in about:debugging.
+ */
+add_task(async function () {
+ const mocks = new Mocks();
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: DEVICE_NAME,
+ isFenix: true,
+ name: SERVER_RUNTIME_NAME,
+ shortName: ADB_RUNTIME_NAME,
+ versionName: ADB_VERSION,
+ version: SERVER_VERSION,
+ });
+
+ // open a remote runtime page
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.emitUSBUpdate();
+ await connectToRuntime(DEVICE_NAME, document);
+ await selectRuntime(DEVICE_NAME, ADB_RUNTIME_NAME, document);
+
+ info("Check that the runtime information is displayed as expected");
+ const runtimeInfo = document.querySelector(".qa-runtime-name");
+ ok(runtimeInfo, "Runtime info for the Fenix runtime is displayed");
+ const runtimeInfoText = runtimeInfo.textContent;
+
+ ok(runtimeInfoText.includes(ADB_RUNTIME_NAME), "Name is the ADB name");
+ ok(
+ !runtimeInfoText.includes(SERVER_RUNTIME_NAME),
+ "Name does not include the server name"
+ );
+
+ ok(runtimeInfoText.includes(ADB_VERSION), "Version contains the ADB version");
+ ok(
+ !runtimeInfoText.includes(SERVER_VERSION),
+ "Version does not contain the server version"
+ );
+
+ const runtimeIcon = document.querySelector(".qa-runtime-icon");
+ is(
+ runtimeIcon.src,
+ FENIX_RELEASE_ICON_SRC,
+ "The runtime icon is the Fenix icon"
+ );
+
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document);
+
+ await removeTab(tab);
+});
+
+/**
+ * Check that Fenix runtime information is correctly displayed in about:devtools-toolbox.
+ */
+add_task(async function () {
+ // We use a real local client combined with a mocked USB runtime to be able to open
+ // about:devtools-toolbox on a real target.
+ const clientWrapper = await createLocalClientWrapper();
+
+ const mocks = new Mocks();
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ channel: "nightly",
+ clientWrapper,
+ deviceName: DEVICE_NAME,
+ isFenix: true,
+ name: SERVER_RUNTIME_NAME,
+ shortName: ADB_RUNTIME_NAME,
+ versionName: ADB_VERSION,
+ version: SERVER_VERSION,
+ });
+
+ // open a remote runtime page
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.emitUSBUpdate();
+ info("Select the runtime page for the USB runtime");
+ const onRequestSuccess = waitForRequestsSuccess(window.AboutDebugging.store);
+ await connectToRuntime(DEVICE_NAME, document);
+ await selectRuntime(DEVICE_NAME, ADB_RUNTIME_NAME, document);
+ info(
+ "Wait for requests to finish the USB runtime is backed by a real local client"
+ );
+ await onRequestSuccess;
+
+ info("Wait for the about:debugging target to be available");
+ await waitUntil(() => findDebugTargetByText("about:debugging", document));
+ const { devtoolsDocument, devtoolsTab } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ const runtimeInfo = devtoolsDocument.querySelector(".qa-runtime-info");
+ const runtimeInfoText = runtimeInfo.textContent;
+ ok(
+ runtimeInfoText.includes(ADB_RUNTIME_NAME),
+ "Name is the ADB runtime name"
+ );
+ ok(runtimeInfoText.includes(ADB_VERSION), "Version is the ADB version");
+
+ const runtimeIcon = devtoolsDocument.querySelector(".qa-runtime-icon");
+ is(
+ runtimeIcon.src,
+ FENIX_NIGHTLY_ICON_SRC,
+ "The runtime icon is the Fenix icon"
+ );
+
+ info("Wait for all pending requests to settle on the DevToolsClient");
+ await clientWrapper.client.waitForRequestsToSettle();
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document);
+
+ await removeTab(tab);
+ await clientWrapper.close();
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_node_picker.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_node_picker.js
new file mode 100644
index 0000000000..59bdbd765d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_node_picker.js
@@ -0,0 +1,83 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_ID = "1337id";
+const DEVICE_NAME = "Fancy Phone";
+const SERVER_RUNTIME_NAME = "Mozilla Firefox";
+const ADB_RUNTIME_NAME = "Firefox Preview";
+const SERVER_VERSION = "v7.3.31";
+const ADB_VERSION = "v1.3.37";
+
+/**
+ * Check that the node picker button in about:devtools-toolbox has the expected class when
+ * connecting to an Android phone.
+ */
+add_task(async function () {
+ // We use a real local client combined with a mocked USB runtime to be able to open
+ // about:devtools-toolbox on a real target.
+ const clientWrapper = await createLocalClientWrapper();
+
+ const mocks = new Mocks();
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ channel: "nightly",
+ clientWrapper,
+ deviceName: DEVICE_NAME,
+ isFenix: true,
+ name: SERVER_RUNTIME_NAME,
+ shortName: ADB_RUNTIME_NAME,
+ versionName: ADB_VERSION,
+ version: SERVER_VERSION,
+ });
+
+ // open a remote runtime page
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.emitUSBUpdate();
+ info("Select the runtime page for the USB runtime");
+ const onRequestSuccess = waitForRequestsSuccess(window.AboutDebugging.store);
+ await connectToRuntime(DEVICE_NAME, document);
+ await selectRuntime(DEVICE_NAME, ADB_RUNTIME_NAME, document);
+ info(
+ "Wait for requests to finish the USB runtime is backed by a real local client"
+ );
+ await onRequestSuccess;
+
+ info("Wait for the about:debugging target to be available");
+ await waitUntil(() => findDebugTargetByText("about:debugging", document));
+ const { devtoolsDocument, devtoolsTab } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window
+ );
+
+ const pickerButton = devtoolsDocument.querySelector("#command-button-pick");
+ ok(
+ pickerButton.classList.contains("remote-fenix"),
+ "The node picker does have the expected additional className when debugging an android phone"
+ );
+ const pickerButtonTitle = pickerButton.getAttribute("title");
+ const expectedKeyboardShortcut =
+ Services.appinfo.OS === "Darwin"
+ ? `Cmd+Shift+C or Cmd+Opt+C`
+ : `Ctrl+Shift+C`;
+ is(
+ pickerButtonTitle,
+ `Pick an element from the Android phone (${expectedKeyboardShortcut})`,
+ `The node picker does have the expected tooltip when debugging an android phone`
+ );
+
+ info("Wait for all pending requests to settle on the DevToolsClient");
+ await clientWrapper.client.waitForRequestsToSettle();
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document);
+
+ await removeTab(tab);
+ await clientWrapper.close();
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js
new file mode 100644
index 0000000000..69f75ef75e
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js
@@ -0,0 +1,106 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test that system and hidden addons are only displayed when the showSystemAddons
+// preferences is true.
+
+const SYSTEM_ADDON = createAddonData({
+ id: "system",
+ name: "System Addon",
+ isSystem: true,
+ hidden: true,
+});
+const HIDDEN_ADDON = createAddonData({
+ id: "hidden",
+ name: "Hidden Addon",
+ isSystem: false,
+ hidden: true,
+});
+const NORMAL_ADDON = createAddonData({
+ id: "normal",
+ name: "Normal Addon",
+ isSystem: false,
+ hidden: false,
+});
+
+add_task(async function testShowSystemAddonsTrue() {
+ info("Test with showHiddenAddons set to true");
+ await testAddonsDisplay(true);
+
+ info("Test with showHiddenAddons set to false");
+ await testAddonsDisplay(false);
+});
+
+async function testAddonsDisplay(showHidden) {
+ const thisFirefoxClient = setupThisFirefoxMock();
+ thisFirefoxClient.listAddons = () => [
+ SYSTEM_ADDON,
+ HIDDEN_ADDON,
+ NORMAL_ADDON,
+ ];
+
+ info("Set showHiddenAddons to " + showHidden);
+ await pushPref("devtools.aboutdebugging.showHiddenAddons", showHidden);
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const hasSystemAddon = !!findDebugTargetByText("System Addon", document);
+ const hasHiddenAddon = !!findDebugTargetByText("Hidden Addon", document);
+ const hasInstalledAddon = !!findDebugTargetByText("Normal Addon", document);
+ is(
+ hasSystemAddon,
+ showHidden,
+ "System addon display is correct when showHiddenAddons is " + showHidden
+ );
+ is(
+ hasHiddenAddon,
+ showHidden,
+ "Hidden addon display is correct when showHiddenAddons is " + showHidden
+ );
+ ok(hasInstalledAddon, "Installed addon is always displayed");
+
+ await removeTab(tab);
+}
+
+// Create a basic mock for this-firefox client, and setup a runtime-client-factory mock
+// to return our mock client when needed.
+function setupThisFirefoxMock() {
+ const runtimeClientFactoryMock = createRuntimeClientFactoryMock();
+ const thisFirefoxClient = createThisFirefoxClientMock();
+ runtimeClientFactoryMock.createClientForRuntime = runtime => {
+ const {
+ RUNTIMES,
+ } = require("resource://devtools/client/aboutdebugging/src/constants.js");
+ if (runtime.id === RUNTIMES.THIS_FIREFOX) {
+ return thisFirefoxClient;
+ }
+ throw new Error("Unexpected runtime id " + runtime.id);
+ };
+
+ info("Enable mocks");
+ enableRuntimeClientFactoryMock(runtimeClientFactoryMock);
+ registerCleanupFunction(() => {
+ disableRuntimeClientFactoryMock();
+ });
+
+ return thisFirefoxClient;
+}
+
+// Create basic addon data as the DevToolsClient would return it (debuggable and non
+// temporary).
+function createAddonData({ id, name, isSystem, hidden }) {
+ return {
+ actor: `actorid-${id}`,
+ hidden,
+ iconURL: `moz-extension://${id}/icon-url.png`,
+ id,
+ manifestURL: `moz-extension://${id}/manifest-url.json`,
+ name,
+ isSystem,
+ temporarilyInstalled: false,
+ debuggable: true,
+ };
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js
new file mode 100644
index 0000000000..58ae2db6a3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js
@@ -0,0 +1,82 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-addons.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
+
+const EXTENSION_NAME = "Temporary web extension";
+const EXTENSION_ID = "test-devtools@mozilla.org";
+
+// Test that Message component can be closed with the X button
+add_task(async function () {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Check that the message can be closed with icon");
+ let warningMessage = await installExtensionWithWarning(document);
+ await testCloseMessageWithIcon(warningMessage, document);
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+
+ info("Check that the message can be closed with the button around the icon");
+ warningMessage = await installExtensionWithWarning(document);
+ await testCloseMessageWithButton(warningMessage, document);
+ await removeTemporaryExtension(EXTENSION_NAME, document);
+
+ await removeTab(tab);
+});
+
+async function testCloseMessageWithIcon(warningMessage, doc) {
+ const closeIcon = warningMessage.querySelector(
+ ".qa-message-button-close-icon"
+ );
+ ok(!!closeIcon, "The warning message has a close icon");
+
+ info("Closing the message and waiting for it to disappear");
+ closeIcon.click();
+
+ const target = findDebugTargetByText(EXTENSION_NAME, doc);
+ await waitUntil(() => target.querySelector(".qa-message") === null);
+}
+
+async function testCloseMessageWithButton(warningMessage, doc) {
+ const closeButton = warningMessage.querySelector(
+ ".qa-message-button-close-button"
+ );
+ ok(!!closeButton, "The warning message has a close button");
+
+ info("Click on the button and wait for the message to disappear");
+ EventUtils.synthesizeMouse(closeButton, 1, 1, {}, doc.defaultView);
+
+ const target = findDebugTargetByText(EXTENSION_NAME, doc);
+ await waitUntil(() => target.querySelector(".qa-message") === null);
+}
+
+async function installExtensionWithWarning(doc) {
+ await pushPref("extensions.webextensions.warnings-as-errors", false);
+ await installTemporaryExtensionFromXPI(
+ {
+ id: EXTENSION_ID,
+ name: EXTENSION_NAME,
+ extraProperties: {
+ // This property is not expected in the manifest and should trigger a warning!
+ wrongProperty: {},
+ },
+ },
+ doc
+ );
+ await SpecialPowers.popPrefEnv();
+
+ info("Wait until a debug target item appears");
+ await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, doc));
+
+ const target = findDebugTargetByText(EXTENSION_NAME, doc);
+ const warningMessage = target.querySelector(".qa-message");
+ ok(
+ !!warningMessage,
+ "A warning message is displayed for the installed addon"
+ );
+
+ return warningMessage;
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js
new file mode 100644
index 0000000000..281f01dbdc
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js
@@ -0,0 +1,112 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+/**
+ * Check that navigating from This Firefox to Connect and back to This Firefox works and
+ * does not leak.
+ */
+
+const TAB_URL_1 = "data:text/html,<title>TAB1</title>";
+const TAB_URL_2 = "data:text/html,<title>TAB2</title>";
+
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ const AboutDebugging = window.AboutDebugging;
+ await selectThisFirefoxPage(document, AboutDebugging.store);
+
+ const connectSidebarItem = findSidebarItemByText("Setup", document);
+ const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link");
+ ok(connectSidebarItem, "Found the Connect sidebar item");
+
+ const thisFirefoxString = getThisFirefoxString(window);
+ const thisFirefoxSidebarItem = findSidebarItemByText(
+ thisFirefoxString,
+ document
+ );
+ const thisFirefoxLink =
+ thisFirefoxSidebarItem.querySelector(".qa-sidebar-link");
+ ok(thisFirefoxSidebarItem, "Found the ThisFirefox sidebar item");
+ ok(
+ isSidebarItemSelected(thisFirefoxSidebarItem),
+ "ThisFirefox sidebar item is selected by default"
+ );
+
+ info("Open a new background tab TAB1");
+ const backgroundTab1 = await addTab(TAB_URL_1, { background: true });
+
+ info("Wait for the tab to appear in the debug targets with the correct name");
+ await waitUntil(() => findDebugTargetByText("TAB1", document));
+
+ await waitForAboutDebuggingRequests(AboutDebugging.store);
+ info("Click on the Connect item in the sidebar");
+ connectLink.click();
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+ // we need to wait here because the sidebar isn't updated after mounting the page
+ info("Wait until Connect sidebar item is selected");
+ await waitUntil(() => isSidebarItemSelected(connectSidebarItem));
+ ok(
+ !document.querySelector(".qa-runtime-page"),
+ "Runtime page no longer rendered"
+ );
+
+ info("Open a new tab which should be listed when we go back to This Firefox");
+ const backgroundTab2 = await addTab(TAB_URL_2, { background: true });
+
+ info("Click on the ThisFirefox item in the sidebar");
+ const requestsSuccess = waitForRequestsSuccess(AboutDebugging.store);
+ thisFirefoxLink.click();
+
+ info("Wait for all target requests to complete");
+ await requestsSuccess;
+
+ info("Wait until ThisFirefox page is displayed");
+ await waitUntil(() => document.querySelector(".qa-runtime-page"));
+ ok(
+ isSidebarItemSelected(thisFirefoxSidebarItem),
+ "ThisFirefox sidebar item is selected again"
+ );
+ ok(
+ !document.querySelector(".qa-connect-page"),
+ "Connect page no longer rendered"
+ );
+
+ info("TAB2 should already be displayed in the debug targets");
+ await waitUntil(() => findDebugTargetByText("TAB2", document));
+
+ info("Remove first background tab");
+ await removeTab(backgroundTab1);
+
+ info(
+ "Check TAB1 disappears, meaning ThisFirefox client is correctly connected"
+ );
+ await waitUntil(() => !findDebugTargetByText("TAB1", document));
+
+ info("Remove second background tab");
+ await removeTab(backgroundTab2);
+
+ info(
+ "Check TAB2 disappears, meaning ThisFirefox client is correctly connected"
+ );
+ await waitUntil(() => !findDebugTargetByText("TAB2", document));
+
+ await waitForAboutDebuggingRequests(AboutDebugging.store);
+
+ await removeTab(tab);
+});
+
+function isSidebarItemSelected(item) {
+ return item.classList.contains("qa-sidebar-item-selected");
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js
new file mode 100644
index 0000000000..5ac1c2e188
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js
@@ -0,0 +1,91 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NETWORK_RUNTIME_HOST = "localhost:6080";
+const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const USB_RUNTIME_ID = "test-runtime-id";
+const USB_DEVICE_NAME = "test device name";
+const USB_APP_NAME = "TestApp";
+
+// Test that remote runtime connections are persisted across about:debugging reloads.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ info("Test with a USB runtime");
+ const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ name: USB_APP_NAME,
+ deviceName: USB_DEVICE_NAME,
+ });
+
+ await testRemoteClientPersistConnection(mocks, {
+ client: usbClient,
+ id: USB_RUNTIME_ID,
+ runtimeName: USB_APP_NAME,
+ sidebarName: USB_DEVICE_NAME,
+ type: "usb",
+ });
+
+ info("Test with a network runtime");
+ const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
+ name: NETWORK_RUNTIME_APP_NAME,
+ });
+
+ await testRemoteClientPersistConnection(mocks, {
+ client: networkClient,
+ id: NETWORK_RUNTIME_HOST,
+ runtimeName: NETWORK_RUNTIME_APP_NAME,
+ sidebarName: NETWORK_RUNTIME_HOST,
+ type: "network",
+ });
+});
+
+async function testRemoteClientPersistConnection(
+ mocks,
+ { client, id, runtimeName, sidebarName, type }
+) {
+ info("Open about:debugging and connect to the test runtime");
+ let { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await connectToRuntime(sidebarName, document);
+ await selectRuntime(sidebarName, runtimeName, document);
+
+ info("Reload about:debugging");
+ document = await reloadAboutDebugging(tab);
+
+ info("Wait until the remote runtime appears as connected");
+ await waitUntil(() => {
+ const sidebarItem = findSidebarItemByText(sidebarName, document);
+ return sidebarItem && !sidebarItem.querySelector(".qa-connect-button");
+ });
+
+ info("Wait until the remote runtime page is selected");
+ await waitUntil(() => {
+ const runtimeInfo = document.querySelector(".qa-runtime-name");
+ return runtimeInfo && runtimeInfo.textContent.includes(runtimeName);
+ });
+
+ // Remove the runtime without emitting an update.
+ // This is what happens today when we simply close Firefox for Android.
+ info("Remove the runtime from the list of remote runtimes");
+ mocks.removeRuntime(id);
+
+ info(
+ "Emit 'closed' on the client and wait for the sidebar item to disappear"
+ );
+ client._eventEmitter.emit("closed");
+ if (type === "usb") {
+ await waitUntilUsbDeviceIsUnplugged(sidebarName, document);
+ } else {
+ await waitUntil(
+ () =>
+ !findSidebarItemByText(sidebarName, document) &&
+ !findSidebarItemByText(runtimeName, document)
+ );
+ }
+
+ info("Remove the tab");
+ await removeTab(tab);
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js
new file mode 100644
index 0000000000..fd7fb9a852
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js
@@ -0,0 +1,53 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const CATEGORY_NAME = "Processes";
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_DEVICE_NAME = "test device name";
+const RUNTIME_APP_NAME = "TestApp";
+
+// Test whether process category exists by the runtime type.
+add_task(async function () {
+ await pushPref("devtools.aboutdebugging.process-debugging", true);
+
+ const mocks = new Mocks();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const usbRuntime = mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ name: RUNTIME_APP_NAME,
+ });
+ usbRuntime.getMainProcess = () => {
+ return {
+ getTarget: () => {
+ return { actorID: 0 };
+ },
+ };
+ };
+ mocks.emitUSBUpdate();
+
+ info("Check the process category existence for this firefox");
+ ok(
+ !getDebugTargetPane(CATEGORY_NAME, document),
+ "Process category should not display for this firefox"
+ );
+
+ info("Check the process category existence for USB runtime");
+ await connectToRuntime(RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document);
+ ok(
+ getDebugTargetPane(CATEGORY_NAME, document),
+ "Process category should display for USB runtime"
+ );
+
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js
new file mode 100644
index 0000000000..bd88545d58
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js
@@ -0,0 +1,87 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+const MULTIPROCESS_TOOLBOX_NAME = "Multiprocess Toolbox";
+const MULTIPROCESS_TOOLBOX_DESCRIPTION =
+ "Main Process and Content Processes for the target browser";
+
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_DEVICE_NAME = "test device name";
+const RUNTIME_APP_NAME = "TestApp";
+
+// Test for main process.
+add_task(async function () {
+ await pushPref("devtools.aboutdebugging.process-debugging", true);
+ const mocks = new Mocks();
+
+ const { document, tab, window } = await openAboutDebugging();
+
+ const usbRuntime = mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ name: RUNTIME_APP_NAME,
+ });
+
+ // Note: about:debugging assumes that the main process has the id 0 and will
+ // rely on it to create the about:devtools-toolbox URL.
+ // Only check that about:debugging doesn't create a target unnecessarily.
+ usbRuntime.getMainProcess = () => {
+ return {
+ getTarget: () => {
+ ok(false, "about:debugging should not create the main process target");
+ },
+ };
+ };
+ mocks.emitUSBUpdate();
+
+ info("Select USB runtime");
+ await connectToRuntime(RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document);
+
+ info("Check debug target item of the main process");
+ await waitUntil(() =>
+ findDebugTargetByText(MULTIPROCESS_TOOLBOX_NAME, document)
+ );
+ const mainProcessItem = findDebugTargetByText(
+ MULTIPROCESS_TOOLBOX_NAME,
+ document
+ );
+ ok(mainProcessItem, "Debug target item of the main process should display");
+ ok(
+ mainProcessItem.textContent.includes(MULTIPROCESS_TOOLBOX_DESCRIPTION),
+ "Debug target item of the main process should contains the description"
+ );
+
+ info("Inspect main process");
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ MULTIPROCESS_TOOLBOX_NAME,
+ false
+ );
+
+ const url = new window.URL(devtoolsWindow.location.href);
+ const type = url.searchParams.get("type");
+ is(type, "process", "Correct type argument");
+ const remoteID = url.searchParams.get("remoteId");
+ is(remoteID, `${RUNTIME_ID}-usb`, "Correct remote runtime id");
+
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ // Note that we can't use `closeAboutDevtoolsToolbox` because the toolbox init
+ // is expected to fail, and we are redirected to the error page.
+ await removeTab(devtoolsTab);
+ await waitUntil(() => !findDebugTargetByText("Toolbox - ", document));
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js
new file mode 100644
index 0000000000..06bd29095c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js
@@ -0,0 +1,44 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+// Test for main process against This Firefox.
+//
+// The main added value for this test is to check that listing processes
+// and opening a toolbox targeting a process works, even though debugging
+// the main process of This Firefox is not really supported.
+add_task(async function () {
+ await pushPref("devtools.aboutdebugging.process-debugging", true);
+ await pushPref("devtools.aboutdebugging.test-local-process-debugging", true);
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Check debug target item of the main process");
+ const mainProcessItem = findDebugTargetByText("Multiprocess", document);
+ ok(mainProcessItem, "Debug target item of the main process should display");
+ ok(
+ mainProcessItem.textContent.includes(
+ "Main Process and Content Processes for the target browser"
+ ),
+ "Debug target item of the main process should contains the description"
+ );
+
+ info("Inspect main process and wait for DevTools to open");
+ const { devtoolsTab } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ "Main Process"
+ );
+
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js
new file mode 100644
index 0000000000..02995492c0
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js
@@ -0,0 +1,238 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/performance-new/test/browser/helpers.js",
+ this
+);
+
+const BackgroundJSM = ChromeUtils.import(
+ "resource://devtools/client/performance-new/shared/background.jsm.js"
+);
+
+registerCleanupFunction(() => {
+ BackgroundJSM.revertRecordingSettings();
+});
+
+const RUNTIME_ID = "1337id";
+const DEVICE_NAME = "Fancy Phone";
+const RUNTIME_NAME = "Lorem ipsum";
+
+/**
+ * Test opening and closing the profiler dialog.
+ */
+add_task(async function test_opening_profiler_dialog() {
+ const { mocks } = await connectToLocalFirefox();
+ const { document, tab, window } = await openAboutDebugging();
+
+ mocks.emitUSBUpdate();
+ await connectToRuntime(DEVICE_NAME, document);
+ await selectRuntime(DEVICE_NAME, RUNTIME_NAME, document);
+
+ info("Open the profiler dialog");
+ await openProfilerDialogWithRealClient(document);
+ assertDialogVisible(document);
+
+ info("Click on the close button and wait until the dialog disappears");
+ const closeDialogButton = document.querySelector(".qa-profiler-dialog-close");
+ closeDialogButton.click();
+ await waitUntil(() => !document.querySelector(".qa-profiler-dialog"));
+ assertDialogHidden(document);
+
+ info("Open the profiler dialog again");
+ await openProfilerDialogWithRealClient(document);
+ assertDialogVisible(document);
+
+ info("Click on the mask element and wait until the dialog disappears");
+ const mask = document.querySelector(".qa-profiler-dialog-mask");
+ EventUtils.synthesizeMouse(mask, 5, 5, {}, window);
+ await waitUntil(() => !document.querySelector(".qa-profiler-dialog"));
+ assertDialogHidden(document);
+
+ info("Open the profiler dialog again");
+ await openProfilerDialogWithRealClient(document);
+ assertDialogVisible(document);
+
+ info("Navigate to this-firefox and wait until the dialog disappears");
+ document.location.hash = "#/runtime/this-firefox";
+ await waitUntil(() => !document.querySelector(".qa-profiler-dialog"));
+ assertDialogHidden(document);
+
+ info("Select the remote runtime again, check the dialog is still hidden");
+ await selectRuntime(DEVICE_NAME, RUNTIME_NAME, document);
+ assertDialogHidden(document);
+
+ await disconnectFromLocalFirefox({ mocks, doc: document });
+ await removeTab(tab);
+});
+
+add_task(async function test_set_profiler_settings() {
+ const { mocks } = await connectToLocalFirefox();
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.emitUSBUpdate();
+ await connectToRuntime(DEVICE_NAME, document);
+ await selectRuntime(DEVICE_NAME, RUNTIME_NAME, document);
+
+ info("Open the profiler dialog");
+ await openProfilerDialogWithRealClient(document);
+ assertDialogVisible(document);
+
+ const profilerSettingsDocument = await openProfilerSettings(document);
+ const radioButtonForCustomPreset = await getNearestInputFromText(
+ profilerSettingsDocument,
+ "Custom"
+ );
+ ok(
+ radioButtonForCustomPreset.checked,
+ "The radio button for the preset 'custom' is checked."
+ );
+
+ info("Change the preset to Graphics.");
+ const radioButtonForGraphicsPreset = await getNearestInputFromText(
+ profilerSettingsDocument,
+ "Graphics"
+ );
+ radioButtonForGraphicsPreset.click();
+
+ const profilerDocument = await saveSettingsAndGoBack(document);
+ const perfPresetsSelect = await getNearestInputFromText(
+ profilerDocument,
+ "Settings"
+ );
+ is(
+ perfPresetsSelect.value,
+ "graphics",
+ "The preset has been changed in the devtools panel UI as well."
+ );
+
+ await disconnectFromLocalFirefox({ mocks, doc: document });
+ await removeTab(tab);
+});
+
+async function connectToLocalFirefox() {
+ // This is a client to the current Firefox.
+ const clientWrapper = await createLocalClientWrapper();
+
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ const usbClient = mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: DEVICE_NAME,
+ name: RUNTIME_NAME,
+ clientWrapper,
+ });
+
+ return { mocks, usbClient };
+}
+
+async function disconnectFromLocalFirefox({ doc, mocks }) {
+ info("Remove USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, doc);
+}
+
+function assertDialogVisible(doc) {
+ ok(doc.querySelector(".qa-profiler-dialog"), "Dialog is displayed");
+ ok(doc.querySelector(".qa-profiler-dialog-mask"), "Dialog mask is displayed");
+}
+
+function assertDialogHidden(doc) {
+ ok(!doc.querySelector(".qa-profiler-dialog"), "Dialog is removed");
+ ok(!doc.querySelector(".qa-profiler-dialog-mask"), "Dialog mask is removed");
+}
+
+/**
+ * Retrieve the iframe containing the profiler UIs.
+ * Be careful as it's completely replaced when switching UIs.
+ */
+function getProfilerIframe(doc) {
+ return doc.querySelector(".profiler-dialog__frame");
+}
+
+/**
+ * This waits for the full render of the UI inside the profiler iframe, and
+ * returns the content document object.
+ */
+async function waitForProfilerUiRendering(doc, selector) {
+ // The iframe is replaced completely, so we need to retrieve a new reference
+ // each time.
+ const profilerIframe = getProfilerIframe(doc);
+ // Wait for the settings to render.
+ await TestUtils.waitForCondition(
+ () =>
+ profilerIframe.contentDocument &&
+ profilerIframe.contentDocument.querySelector(selector)
+ );
+
+ return profilerIframe.contentDocument;
+}
+
+/**
+ * Open the performance profiler dialog with a real client.
+ */
+async function openProfilerDialogWithRealClient(doc) {
+ info("Click on the Profile Runtime button");
+ const profileButton = doc.querySelector(".qa-profile-runtime-button");
+ profileButton.click();
+
+ info("Wait for the rendering of the profiler UI");
+ const contentDocument = await waitForProfilerUiRendering(
+ doc,
+ ".perf-presets"
+ );
+ await getActiveButtonFromText(contentDocument, "Start recording");
+ info("The profiler UI is rendered!");
+ return contentDocument;
+}
+
+/**
+ * Open the performance profiler settings. This assumes the profiler dialog is
+ * already open by the previous function openProfilerDialog.
+ */
+async function openProfilerSettings(doc) {
+ const profilerDocument = getProfilerIframe(doc).contentDocument;
+
+ // Select the custom preset.
+ const perfPresetsSelect = await getNearestInputFromText(
+ profilerDocument,
+ "Settings"
+ );
+ setReactFriendlyInputValue(perfPresetsSelect, "custom");
+
+ // Click on "Edit Settings".
+ const editSettingsLink = await getElementFromDocumentByText(
+ profilerDocument,
+ "Edit Settings"
+ );
+ editSettingsLink.click();
+
+ info("Wait for the rendering of the profiler settings UI");
+ const contentDocument = await waitForProfilerUiRendering(
+ doc,
+ ".perf-aboutprofiling-remote"
+ );
+ info("The profiler settings UI is rendered!");
+ return contentDocument;
+}
+
+async function saveSettingsAndGoBack(doc) {
+ const profilerDocument = getProfilerIframe(doc).contentDocument;
+
+ const saveSettingsAndGoBackButton = await getActiveButtonFromText(
+ profilerDocument,
+ "Save settings"
+ );
+ saveSettingsAndGoBackButton.click();
+
+ info("Wait for the rendering of the profiler UI");
+ const contentDocument = await waitForProfilerUiRendering(
+ doc,
+ ".perf-presets"
+ );
+ await getActiveButtonFromText(contentDocument, "Start recording");
+ info("The profiler UI is rendered!");
+ return contentDocument;
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js
new file mode 100644
index 0000000000..16462fd2b3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-real-usb.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-real-usb.js",
+ this
+);
+
+// Test that runtime info of USB runtime appears on main pane.
+// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md
+add_task(async function () {
+ if (!isAvailable()) {
+ ok(true, "Real usb runtime test is not available");
+ return;
+ }
+
+ const { document, tab } = await openAboutDebuggingWithADB();
+
+ const expectedRuntime = await getExpectedRuntime();
+ const { runtimeDetails, sidebarInfo } = expectedRuntime;
+
+ info("Connect a USB runtime");
+ await Promise.race([
+ connectToRuntime(sidebarInfo.deviceName, document),
+ /* eslint-disable mozilla/no-arbitrary-setTimeout */
+ new Promise(resolve =>
+ setTimeout(() => {
+ ok(
+ false,
+ "Failed to connect, did you disable the connection prompt for this runtime?"
+ );
+ resolve();
+ }, 5000)
+ ),
+ /* eslint-enable mozilla/no-arbitrary-setTimeout */
+ ]);
+
+ info("Select a USB runtime");
+ await selectRuntime(
+ sidebarInfo.deviceName,
+ runtimeDetails.info.name,
+ document
+ );
+
+ info("Check that runtime info is properly displayed");
+ const runtimeInfo = document.querySelector(".qa-runtime-name");
+ ok(runtimeInfo, "Runtime info is displayed");
+ const runtimeInfoText = runtimeInfo.textContent;
+ ok(
+ runtimeInfoText.includes(runtimeDetails.info.name),
+ "Runtime info shows the correct runtime name: " + runtimeInfoText
+ );
+ ok(
+ runtimeInfoText.includes(runtimeDetails.info.version),
+ "Runtime info shows the correct version number: " + runtimeInfoText
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js
new file mode 100644
index 0000000000..0b091dff87
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js
@@ -0,0 +1,34 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-real-usb.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-real-usb.js",
+ this
+);
+
+// Test that USB runtimes appear from the sidebar.
+// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md
+add_task(async function () {
+ if (!isAvailable()) {
+ ok(true, "Real usb runtime test is not available");
+ return;
+ }
+
+ const { document, tab } = await openAboutDebuggingWithADB();
+
+ for (const { sidebarInfo } of await getExpectedRuntimeAll()) {
+ const { deviceName, shortName } = sidebarInfo;
+ await waitUntil(() => findSidebarItemByText(deviceName, document));
+ const usbRuntimeSidebarItem = findSidebarItemByText(deviceName, document);
+ ok(
+ usbRuntimeSidebarItem.textContent.includes(shortName),
+ "The device name and short name of the usb runtime are visible in sidebar item " +
+ `[${usbRuntimeSidebarItem.textContent}]`
+ );
+ }
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js
new file mode 100644
index 0000000000..6295d37503
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js
@@ -0,0 +1,114 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Test that the initial route is /setup
+ */
+add_task(async function () {
+ info("Check root route redirects to setup page");
+ const { document, tab } = await openAboutDebugging();
+ is(document.location.hash, "#/setup");
+
+ await removeTab(tab);
+});
+
+/**
+ * Test that the routes in about:debugging show the proper views and document.title
+ */
+add_task(async function () {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ info("Check 'This Firefox' route");
+ document.location.hash = "#/runtime/this-firefox";
+ await waitUntil(() => document.querySelector(".qa-runtime-page"));
+ const infoLabel = document.querySelector(".qa-runtime-name").textContent;
+ // NOTE: when using USB Mocks, we see only "Firefox" as the device name
+ ok(infoLabel.includes("Firefox"), "Runtime is displayed as Firefox");
+ ok(!infoLabel.includes(" on "), "Runtime is not associated to any device");
+ is(
+ document.title,
+ "Debugging - Runtime / this-firefox",
+ "Checking title for 'runtime' page"
+ );
+
+ info("Check 'Setup' page");
+ document.location.hash = "#/setup";
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+ ok(true, "Setup page has been shown");
+ is(document.title, "Debugging - Setup", "Checking title for 'setup' page");
+
+ info("Check 'USB device runtime' page");
+ // connect to a mocked USB runtime
+ mocks.createUSBRuntime("1337id", {
+ deviceName: "Fancy Phone",
+ name: "Lorem ipsum",
+ });
+ mocks.emitUSBUpdate();
+ await connectToRuntime("Fancy Phone", document);
+ // navigate to it via URL
+ document.location.hash = "#/runtime/1337id";
+ await waitUntil(() => document.querySelector(".qa-runtime-page"));
+ const runtimeLabel = document.querySelector(".qa-runtime-name").textContent;
+ is(
+ document.title,
+ "Debugging - Runtime / 1337id",
+ "Checking title for 'runtime' page with USB device"
+ );
+ ok(
+ runtimeLabel.includes("Lorem ipsum"),
+ "Runtime is displayed with the mocked name"
+ );
+
+ await removeTab(tab);
+});
+
+/**
+ * Test that an invalid route redirects to / (currently This Firefox page)
+ */
+add_task(async function () {
+ info("Check an invalid route redirects to root");
+ const { document, tab } = await openAboutDebugging();
+
+ info("Waiting for a non setup page to load");
+ document.location.hash = "#/runtime/this-firefox";
+ await waitUntil(() => document.querySelector(".qa-runtime-page"));
+
+ info("Update hash & wait for a redirect to root (connect page)");
+ document.location.hash = "#/lorem-ipsum";
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+ is(document.title, "Debugging - Setup", "Checking title for 'setup' page");
+ is(document.location.hash, "#/setup", "Redirected to root");
+
+ await removeTab(tab);
+});
+
+/**
+ * Test that routes from old about:debugging redirect to this Firefox.
+ */
+add_task(async function testOldAboutDebuggingRoutes() {
+ info("Check that routes from old about:debugging redirect to this Firefox");
+ const { document, tab } = await openAboutDebugging();
+
+ const routes = ["addons", "tabs", "workers"];
+ for (const route of routes) {
+ info("Move to setup page before testing the route");
+ document.location.hash = "#/setup";
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+
+ info(`Check that navigating to ${route} redirects to This Firefox`);
+ document.location.hash = route;
+ await waitUntil(() => document.querySelector(".qa-runtime-page"));
+ is(
+ document.location.hash,
+ "#/runtime/this-firefox",
+ `${route} was redirected to This Firefox`
+ );
+ }
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_rtl.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_rtl.js
new file mode 100644
index 0000000000..4424df6ea8
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_rtl.js
@@ -0,0 +1,62 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// Test that the about:debugging document and the profiler dialog document
+// use the expected document direction.
+add_task(async function test_direction_is_ltr_by_default() {
+ await testAboutDebuggingDocsDirection("ltr");
+});
+
+add_task(async function test_direction_is_rtl_for_bidi_pseudolocale() {
+ await pushPref("intl.l10n.pseudo", "bidi");
+ await testAboutDebuggingDocsDirection("rtl");
+});
+
+async function testAboutDebuggingDocsDirection(expectedDir) {
+ const mocks = new Mocks();
+ const { document, usbClient } = await setupTestForMockUSBRuntime(mocks);
+
+ is(document.dir, expectedDir, "document dir is " + expectedDir);
+
+ info("Open the profiler dialog");
+ await openProfilerDialog(usbClient, document);
+
+ const profilerDialogFrame = document.querySelector(
+ ".qa-profiler-dialog iframe"
+ );
+ ok(profilerDialogFrame, "Found Profiler dialog iframe");
+
+ const profilerDoc = profilerDialogFrame.contentWindow.document;
+ is(profilerDoc.dir, expectedDir, "Profiler document dir is " + expectedDir);
+
+ await teardownTestForMockUSBRuntime(mocks, document);
+}
+
+async function setupTestForMockUSBRuntime(mocks) {
+ info("Setup mock USB runtime");
+
+ const usbClient = mocks.createUSBRuntime("runtimeId", {
+ deviceName: "deviceName",
+ name: "runtimeName",
+ });
+
+ info("Open about:debugging and select runtime page for mock USB runtime");
+ const { document } = await openAboutDebugging();
+
+ mocks.emitUSBUpdate();
+ await connectToRuntime("deviceName", document);
+ await selectRuntime("deviceName", "runtimeName", document);
+
+ return { document, usbClient };
+}
+
+async function teardownTestForMockUSBRuntime(mocks, doc) {
+ info("Remove mock USB runtime");
+
+ mocks.removeUSBRuntime("runtimeId");
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged("deviceName", doc);
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js
new file mode 100644
index 0000000000..3f45fa10d2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js
@@ -0,0 +1,90 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const COMPATIBLE_RUNTIME = "Compatible Runtime";
+const COMPATIBLE_DEVICE = "Compatible Device";
+const OLD_RUNTIME = "Old Runtime";
+const OLD_DEVICE = "Old Device";
+const FENNEC_68_RUNTIME = "Bad Runtime Fennec 68";
+const FENNEC_68_DEVICE = "Bad Device Fennec 68";
+const RECENT_RUNTIME = "Recent Runtime";
+const RECENT_DEVICE = "Recent Device";
+
+add_task(async function () {
+ const {
+ COMPATIBILITY_STATUS,
+ } = require("resource://devtools/client/shared/remote-debugging/version-checker.js");
+ const { COMPATIBLE, TOO_OLD, TOO_OLD_FENNEC, TOO_RECENT } =
+ COMPATIBILITY_STATUS;
+
+ info("Create several mocked runtimes, with different compatibility reports");
+ const mocks = new Mocks();
+ createRuntimeWithReport(
+ mocks,
+ COMPATIBLE_RUNTIME,
+ COMPATIBLE_DEVICE,
+ COMPATIBLE
+ );
+ createRuntimeWithReport(mocks, OLD_RUNTIME, OLD_DEVICE, TOO_OLD);
+ createRuntimeWithReport(mocks, RECENT_RUNTIME, RECENT_DEVICE, TOO_RECENT);
+ createRuntimeWithReport(
+ mocks,
+ FENNEC_68_RUNTIME,
+ FENNEC_68_DEVICE,
+ TOO_OLD_FENNEC
+ );
+
+ const { document, tab } = await openAboutDebugging();
+ mocks.emitUSBUpdate();
+
+ info("Connect to all runtimes");
+ await connectToRuntime(COMPATIBLE_DEVICE, document);
+ await connectToRuntime(OLD_DEVICE, document);
+ await connectToRuntime(RECENT_DEVICE, document);
+ await connectToRuntime(FENNEC_68_DEVICE, document);
+
+ info("Select the compatible runtime and check that no warning is displayed");
+ await selectRuntime(COMPATIBLE_DEVICE, COMPATIBLE_RUNTIME, document);
+ ok(
+ !document.querySelector(".qa-compatibility-warning"),
+ "Compatibility warning is not displayed"
+ );
+
+ info(
+ "Select the old runtime and check that the too-old warning is displayed"
+ );
+ await selectRuntime(OLD_DEVICE, OLD_RUNTIME, document);
+ ok(
+ document.querySelector(".qa-compatibility-warning-too-old"),
+ "Expected compatibility warning is displayed (too-old)"
+ );
+
+ info(
+ "Select the recent runtime and check that the too-recent warning is displayed"
+ );
+ await selectRuntime(RECENT_DEVICE, RECENT_RUNTIME, document);
+ ok(
+ document.querySelector(".qa-compatibility-warning-too-recent"),
+ "Expected compatibility warning is displayed (too-recent)"
+ );
+
+ info(
+ "Select the Fennec 68 runtime and check that the correct warning is displayed"
+ );
+ await selectRuntime(FENNEC_68_DEVICE, FENNEC_68_RUNTIME, document);
+ ok(document.querySelector(".qa-compatibility-warning-too-old-fennec"));
+
+ await removeTab(tab);
+});
+
+function createRuntimeWithReport(mocks, name, deviceName, status) {
+ const runtimeId = [name, deviceName].join("-");
+ const compatibleUsbClient = mocks.createUSBRuntime(runtimeId, {
+ deviceName,
+ name,
+ });
+ const report = { status };
+ compatibleUsbClient.checkVersionCompatibility = () => report;
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js
new file mode 100644
index 0000000000..e7cae28d29
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js
@@ -0,0 +1,65 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const USB_RUNTIME_ID = "1337id";
+const USB_DEVICE_NAME = "Fancy Phone";
+const USB_APP_NAME = "Lorem ipsum";
+
+const DEFAULT_PAGE = "#/runtime/this-firefox";
+
+/**
+ * Check if the disconnect button disconnects the remote runtime
+ * and redirects to the default page.
+ */
+add_task(async function () {
+ // Create a real local client and use it as the remote USB client for this
+ // test.
+ const clientWrapper = await createLocalClientWrapper();
+
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ clientWrapper,
+ deviceName: USB_DEVICE_NAME,
+ name: USB_APP_NAME,
+ });
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.emitUSBUpdate();
+
+ const onRequestSuccess = waitForRequestsSuccess(window.AboutDebugging.store);
+ await connectToRuntime(USB_DEVICE_NAME, document);
+ await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
+ await onRequestSuccess;
+
+ const disconnectRemoteRuntimeButton = document.querySelector(
+ ".qa-runtime-info__action"
+ );
+
+ info("Check whether disconnect remote runtime button exists");
+ ok(!!disconnectRemoteRuntimeButton, "Runtime contains the disconnect button");
+
+ info("Click on the disconnect button");
+ disconnectRemoteRuntimeButton.click();
+
+ info("Wait until the runtime is disconnected");
+ await waitUntil(() => document.querySelector(".qa-connect-button"));
+
+ is(
+ document.location.hash,
+ DEFAULT_PAGE,
+ "Redirection to the default page (this-firefox)"
+ );
+
+ info("Wait until the Runtime name is displayed");
+ await waitUntil(() => {
+ const runtimeInfo = document.querySelector(".qa-runtime-name");
+ return runtimeInfo && runtimeInfo.textContent.includes("Firefox");
+ });
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js
new file mode 100644
index 0000000000..563fe659ce
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js
@@ -0,0 +1,56 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const USB_RUNTIME_ID = "1337id";
+const USB_DEVICE_NAME = "Fancy Phone";
+const USB_APP_NAME = "Lorem ipsum";
+
+/**
+ * Test that remote runtimes show action buttons that are hidden for 'This Firefox'.
+ */
+add_task(async function () {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_DEVICE_NAME,
+ name: USB_APP_NAME,
+ });
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Checking This Firefox");
+ ok(
+ !document.querySelector(".qa-connection-prompt-toggle-button"),
+ "This Firefox does not contain the connection prompt button"
+ );
+ ok(
+ !document.querySelector(".qa-profile-runtime-button"),
+ "This Firefox does not contain the profile runtime button"
+ );
+ ok(
+ !document.querySelector(".qa-runtime-info__action"),
+ "This Firefox does not contain the disconnect button"
+ );
+
+ info("Checking a USB runtime");
+ mocks.emitUSBUpdate();
+ await connectToRuntime(USB_DEVICE_NAME, document);
+ await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
+ ok(
+ !!document.querySelector(".qa-connection-prompt-toggle-button"),
+ "Runtime contains the connection prompt button"
+ );
+ ok(
+ !!document.querySelector(".qa-profile-runtime-button"),
+ "Remote runtime contains the profile runtime button"
+ );
+ ok(
+ !!document.querySelector(".qa-runtime-info__action"),
+ "Runtime contains the disconnect button"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js
new file mode 100644
index 0000000000..9e9715a46b
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js
@@ -0,0 +1,109 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NETWORK_RUNTIME_HOST = "localhost:6080";
+const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const USB_RUNTIME_ID = "test-runtime-id";
+const USB_DEVICE_NAME = "test device name";
+const USB_APP_NAME = "TestApp";
+
+// Test that about:debugging navigates back to the default page when a USB device is
+// unplugged.
+add_task(async function testUsbDeviceUnplugged() {
+ const mocks = new Mocks();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_DEVICE_NAME,
+ name: USB_APP_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Connect to and select the USB device");
+ await connectToRuntime(USB_DEVICE_NAME, document);
+ await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
+
+ info("Simulate a device unplugged");
+ mocks.removeUSBRuntime(USB_RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(USB_DEVICE_NAME, document);
+
+ is(
+ document.location.hash,
+ `#/runtime/this-firefox`,
+ "Redirection to the default page (this-firefox)"
+ );
+
+ await removeTab(tab);
+});
+
+// Test that about:debugging navigates back to the default page when the server for the
+// current USB runtime is closed.
+add_task(async function testUsbClientDisconnected() {
+ const mocks = new Mocks();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_DEVICE_NAME,
+ name: USB_APP_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Connect to and select the USB device");
+ await connectToRuntime(USB_DEVICE_NAME, document);
+ await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
+
+ info("Simulate a client disconnection");
+ usbClient.isClosed = () => true;
+ usbClient._eventEmitter.emit("closed");
+
+ info("Wait until the connect button for this runtime appears");
+ await waitUntil(() => {
+ const item = findSidebarItemByText(USB_DEVICE_NAME, document);
+ return item && item.querySelector(".qa-connect-button");
+ });
+
+ is(
+ document.location.hash,
+ `#/runtime/this-firefox`,
+ "Redirection to the default page (this-firefox)"
+ );
+ await removeTab(tab);
+});
+
+// Test that about:debugging navigates back to the default page when the server for the
+// current network runtime is closed.
+add_task(async function testNetworkClientDisconnected() {
+ const mocks = new Mocks();
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
+ name: NETWORK_RUNTIME_APP_NAME,
+ });
+
+ info("Connect to and select the network runtime");
+ await connectToRuntime(NETWORK_RUNTIME_HOST, document);
+ await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
+
+ info("Simulate a client disconnection");
+ networkClient.isClosed = () => true;
+ networkClient._eventEmitter.emit("closed");
+
+ info("Wait until the connect button for this runtime appears");
+ await waitUntil(() => {
+ const item = findSidebarItemByText(NETWORK_RUNTIME_HOST, document);
+ return item && item.querySelector(".qa-connect-button");
+ });
+
+ is(
+ document.location.hash,
+ `#/runtime/this-firefox`,
+ "Redirection to the default page (this-firefox)"
+ );
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js
new file mode 100644
index 0000000000..e3f770f948
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js
@@ -0,0 +1,52 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NETWORK_RUNTIME_HOST = "localhost:6080";
+const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const NETWORK_RUNTIME_CHANNEL = "SomeChannel";
+const NETWORK_RUNTIME_VERSION = "12.3";
+
+// Test that network runtimes can be selected.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Prepare Network client mock");
+ const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
+ name: NETWORK_RUNTIME_APP_NAME,
+ });
+ networkClient.getDeviceDescription = () => {
+ return {
+ name: NETWORK_RUNTIME_APP_NAME,
+ channel: NETWORK_RUNTIME_CHANNEL,
+ version: NETWORK_RUNTIME_VERSION,
+ };
+ };
+
+ info("Test addons in runtime page for Network client");
+ await connectToRuntime(NETWORK_RUNTIME_HOST, document);
+ await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
+
+ info("Check that the network runtime mock is properly displayed");
+ const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name");
+ ok(
+ thisFirefoxRuntimeInfo,
+ "Runtime info for this-firefox runtime is displayed"
+ );
+ const runtimeInfoText = thisFirefoxRuntimeInfo.textContent;
+
+ ok(
+ runtimeInfoText.includes(NETWORK_RUNTIME_APP_NAME),
+ "network runtime info shows the correct runtime name: " + runtimeInfoText
+ );
+ ok(
+ runtimeInfoText.includes(NETWORK_RUNTIME_VERSION),
+ "network runtime info shows the correct version number: " + runtimeInfoText
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js
new file mode 100644
index 0000000000..41e69a0d42
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js
@@ -0,0 +1,78 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NETWORK_RUNTIME_HOST = "localhost:6080";
+const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const WORKER_NAME = "testserviceworker";
+
+// Test that navigating from:
+// - a remote runtime page that contains a service worker
+// to:
+// - this firefox
+// does not crash. See Bug 1519088.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Prepare Network client mock");
+ const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
+ name: NETWORK_RUNTIME_APP_NAME,
+ });
+
+ info("Connect and select the network runtime");
+ await connectToRuntime(NETWORK_RUNTIME_HOST, document);
+ await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
+
+ info(`Add a service worker to the network client`);
+ const workers = {
+ otherWorkers: [],
+ serviceWorkers: [
+ {
+ name: WORKER_NAME,
+ workerDescriptorFront: { actorID: WORKER_NAME },
+ },
+ ],
+ sharedWorkers: [],
+ };
+ networkClient.listWorkers = () => workers;
+ networkClient._eventEmitter.emit("workersUpdated");
+
+ info("Wait until the service worker is displayed");
+ await waitUntil(() => findDebugTargetByText(WORKER_NAME, document));
+
+ info("Go to This Firefox again");
+ const thisFirefoxString = getThisFirefoxString(window);
+ const thisFirefoxSidebarItem = findSidebarItemByText(
+ thisFirefoxString,
+ document
+ );
+ const thisFirefoxLink =
+ thisFirefoxSidebarItem.querySelector(".qa-sidebar-link");
+ info("Click on the ThisFirefox item in the sidebar");
+ const requestsSuccess = waitForRequestsSuccess(window.AboutDebugging.store);
+ thisFirefoxLink.click();
+
+ info("Wait for all target requests to complete");
+ await requestsSuccess;
+
+ info("Check that the runtime info is rendered for This Firefox");
+ const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name");
+ ok(
+ thisFirefoxRuntimeInfo,
+ "Runtime info for this-firefox runtime is displayed"
+ );
+
+ const text = thisFirefoxRuntimeInfo.textContent;
+ ok(
+ text.includes("Firefox") && text.includes("63.0"),
+ "this-firefox runtime info shows the correct values"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js
new file mode 100644
index 0000000000..742791668d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js
@@ -0,0 +1,131 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/shared-head.js",
+ this
+);
+
+const SW_TAB_URL =
+ URL_ROOT_SSL + "resources/service-workers/controlled-sw.html";
+const SW_URL = URL_ROOT_SSL + "resources/service-workers/controlled-sw.js";
+
+/**
+ * Test various simple debugging operation against service workers debugged through about:debugging.
+ */
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Open a tab that registers a basic service worker.
+ const swTab = await addTab(SW_TAB_URL);
+
+ // Wait for the registration to make sure service worker has been started, and that we
+ // are not just reading STOPPED as the initial state.
+ await waitForRegistration(swTab);
+
+ info("Open a toolbox to debug the worker");
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ SW_URL
+ );
+
+ const toolbox = getToolbox(devtoolsWindow);
+
+ info("Assert the default tools displayed in worker toolboxes");
+ const toolTabs = toolbox.doc.querySelectorAll(".devtools-tab");
+ const activeTools = [...toolTabs].map(toolTab =>
+ toolTab.getAttribute("data-id")
+ );
+
+ is(
+ activeTools.join(","),
+ "webconsole,jsdebugger",
+ "Correct set of tools supported by worker"
+ );
+
+ const webconsole = await toolbox.selectTool("webconsole");
+ const { hud } = webconsole;
+
+ info("Evaluate location in the console");
+ await executeAndWaitForMessage(hud, "this.location.toString()", SW_URL);
+ ok(true, "Got the location logged in the console");
+
+ info(
+ "Evaluate Date and RegExp to ensure their formater also work from worker threads"
+ );
+ await executeAndWaitForMessage(
+ hud,
+ "new Date(2013, 3, 1)",
+ "Mon Apr 01 2013 00:00:00"
+ );
+ ok(true, "Date object has expected text content");
+ await executeAndWaitForMessage(hud, "new RegExp('.*')", "/.*/");
+ ok(true, "RegExp has expected text content");
+
+ await toolbox.selectTool("jsdebugger");
+ const dbg = createDebuggerContext(toolbox);
+ const {
+ selectors: { getIsWaitingOnBreak, getCurrentThread },
+ } = dbg;
+
+ info("Wait for next interupt in the worker thread");
+ await clickElement(dbg, "pause");
+ await waitForState(dbg, state => getIsWaitingOnBreak(getCurrentThread()));
+
+ info("Trigger some code in the worker and wait for pause");
+ await SpecialPowers.spawn(swTab.linkedBrowser, [], async function () {
+ content.wrappedJSObject.installServiceWorker();
+ });
+ await waitForPaused(dbg);
+ ok(true, "successfully paused");
+
+ info(
+ "Evaluate some variable only visible if we execute in the breakpoint frame"
+ );
+ await executeAndWaitForMessage(hud, "event.data", "install-service-worker");
+
+ info("Resume execution");
+ await resume(dbg);
+
+ info("Test pausing from console evaluation");
+ hud.ui.wrapper.dispatchEvaluateExpression("debugger; 42");
+ await waitForPaused(dbg);
+ ok(true, "successfully paused");
+ info("Immediately resume");
+ await resume(dbg);
+ await waitFor(() => findMessagesByType(hud, "42", ".result"));
+ ok("The paused console evaluation resumed and logged its magic number");
+
+ info("Destroy the toolbox");
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+
+ info("Unregister service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(SW_URL, document));
+
+ info("Remove tabs");
+ await removeTab(swTab);
+ await removeTab(tab);
+});
+
+async function executeAndWaitForMessage(hud, evaluationString, expectedResult) {
+ hud.ui.wrapper.dispatchEvaluateExpression();
+ await waitFor(() => findMessagesByType(hud, expectedResult, ".result"));
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js
new file mode 100644
index 0000000000..960635a56d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js
@@ -0,0 +1,68 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const FETCH_SW_JS = URL_ROOT_SSL + "resources/service-workers/fetch-sw.js";
+const FETCH_SW_HTML = URL_ROOT_SSL + "resources/service-workers/fetch-sw.html";
+
+const EMPTY_SW_JS = URL_ROOT_SSL + "resources/service-workers/empty-sw.js";
+const EMPTY_SW_HTML = URL_ROOT_SSL + "resources/service-workers/empty-sw.html";
+
+/**
+ * Test that the appropriate fetch flag is displayed for service workers.
+ */
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Test fetch status for a service worker listening to fetch events");
+ await testServiceWorkerFetchStatus(
+ document,
+ FETCH_SW_HTML,
+ FETCH_SW_JS,
+ true
+ );
+
+ info("Test fetch status for a service worker not listening to fetch events");
+ await testServiceWorkerFetchStatus(
+ document,
+ EMPTY_SW_HTML,
+ EMPTY_SW_JS,
+ false
+ );
+
+ await removeTab(tab);
+});
+
+async function testServiceWorkerFetchStatus(doc, url, workerUrl, isListening) {
+ // Open a tab that registers a fetch service worker.
+ const swTab = await addTab(url);
+
+ info("Wait until the service worker appears and is running");
+ const targetElement = await waitForServiceWorkerRunning(workerUrl, doc);
+
+ const expectedClassName = isListening
+ ? ".qa-worker-fetch-listening"
+ : ".qa-worker-fetch-not-listening";
+ const fetchStatus = targetElement.querySelector(expectedClassName);
+ ok(!!fetchStatus, "Found the expected fetch status: " + expectedClassName);
+
+ info("Unregister the service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(workerUrl, doc));
+
+ info("Remove the service worker tab");
+ await removeTab(swTab);
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js
new file mode 100644
index 0000000000..d1a6782c09
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js
@@ -0,0 +1,124 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// This test started running during a GC and timing out on coverage platforms.
+// See Bug 1526153.
+requestLongerTimeout(2);
+
+const TEST_DATA = [
+ {
+ serviceWorkersEnabled: true,
+ privateBrowsingEnabled: false,
+ expectedMessage: false,
+ },
+ {
+ serviceWorkersEnabled: false,
+ privateBrowsingEnabled: false,
+ expectedMessage: true,
+ },
+ {
+ serviceWorkersEnabled: true,
+ privateBrowsingEnabled: true,
+ expectedMessage: true,
+ },
+ {
+ serviceWorkersEnabled: false,
+ privateBrowsingEnabled: true,
+ expectedMessage: true,
+ },
+];
+
+/**
+ * Check that the warning message for service workers is displayed if permanent private
+ * browsing is enabled or/and if service workers are disabled.
+ */
+add_task(async function testLocalRuntime() {
+ for (const testData of TEST_DATA) {
+ const { serviceWorkersEnabled, privateBrowsingEnabled, expectedMessage } =
+ testData;
+
+ info(
+ `Test warning message on this-firefox ` +
+ `with serviceWorkersEnabled: ${serviceWorkersEnabled} ` +
+ `and with privateBrowsingEnabled: ${privateBrowsingEnabled}`
+ );
+
+ await pushPref("dom.serviceWorkers.enabled", serviceWorkersEnabled);
+ await pushPref("browser.privatebrowsing.autostart", privateBrowsingEnabled);
+
+ const { document, tab, window } = await openAboutDebugging({
+ // Even though this is a service worker test, we are not adding/removing
+ // workers here. Since the test is really fast it can create intermittent
+ // failures due to pending requests to update the worker list
+ // We are updating the worker list whenever the list of processes changes
+ // and this can happen very frequently, and it's hard to control from
+ // DevTools.
+ // Set enableWorkerUpdates to false to avoid intermittent failures.
+ enableWorkerUpdates: false,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+ assertWarningMessage(document, expectedMessage);
+ await removeTab(tab);
+ }
+});
+
+add_task(async function testRemoteRuntime() {
+ const {
+ remoteClientManager,
+ } = require("resource://devtools/client/shared/remote-debugging/remote-client-manager.js");
+
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ const client = mocks.createUSBRuntime("1337id", {
+ deviceName: "Fancy Phone",
+ name: "Lorem ipsum",
+ });
+
+ for (const testData of TEST_DATA) {
+ const { serviceWorkersEnabled, privateBrowsingEnabled, expectedMessage } =
+ testData;
+
+ info(
+ `Test warning message on mocked USB runtime ` +
+ `with serviceWorkersEnabled: ${serviceWorkersEnabled} ` +
+ `and with privateBrowsingEnabled: ${privateBrowsingEnabled}`
+ );
+
+ client.setPreference("dom.serviceWorkers.enabled", serviceWorkersEnabled);
+ client.setPreference(
+ "browser.privatebrowsing.autostart",
+ privateBrowsingEnabled
+ );
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: false,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Checking a USB runtime");
+ mocks.emitUSBUpdate();
+ await connectToRuntime("Fancy Phone", document);
+ await selectRuntime("Fancy Phone", "Lorem ipsum", document);
+
+ assertWarningMessage(document, expectedMessage);
+
+ // We remove all clients in order to be able to simply connect to the runtime at
+ // every iteration of the loop without checking of the runtime is already connected.
+ info("Remove all remote clients");
+ await remoteClientManager.removeAllClients();
+
+ await removeTab(tab);
+ }
+});
+
+function assertWarningMessage(doc, expectedMessage) {
+ const hasMessage = !!doc.querySelector(".qa-service-workers-warning");
+ ok(
+ hasMessage === expectedMessage,
+ expectedMessage
+ ? "Warning message is displayed"
+ : "Warning message is not displayed"
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js
new file mode 100644
index 0000000000..740f066903
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js
@@ -0,0 +1,61 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const SERVICE_WORKER = URL_ROOT_SSL + "resources/service-workers/push-sw.js";
+const TAB_URL = URL_ROOT_SSL + "resources/service-workers/push-sw.html";
+
+// Test that clicking on the Push button next to a Service Worker works as intended.
+// It should trigger a "push" notification in the worker.
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Open a tab that registers a push service worker.
+ const swTab = await addTab(TAB_URL);
+
+ info(
+ "Wait for the service worker to claim the test window before proceeding."
+ );
+ await SpecialPowers.spawn(
+ swTab.linkedBrowser,
+ [],
+ () => content.wrappedJSObject.onSwClaimed
+ );
+
+ info("Wait until the service worker appears and is running");
+ const targetElement = await waitForServiceWorkerRunning(
+ SERVICE_WORKER,
+ document
+ );
+
+ // Retrieve the Push button for the worker.
+ const pushButton = targetElement.querySelector(".qa-push-button");
+ ok(pushButton, "Found its push button");
+
+ info("Click on the Push button and wait for the push notification");
+ const onPushNotification = onServiceWorkerMessage(swTab, "sw-pushed");
+ pushButton.click();
+ await onPushNotification;
+
+ info("Unregister the service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(SERVICE_WORKER, document));
+
+ info("Remove the service worker tab");
+ await removeTab(swTab);
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js
new file mode 100644
index 0000000000..9581a493d9
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js
@@ -0,0 +1,118 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const SERVICE_WORKER = URL_ROOT_SSL + "resources/service-workers/push-sw.js";
+const TAB_URL = URL_ROOT_SSL + "resources/service-workers/push-sw.html";
+
+const FAKE_ENDPOINT = "https://fake/endpoint";
+
+// Test that the push service url is displayed for service workers subscribed to a push
+// service.
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+
+ info("Mock the push service");
+ mockPushService(FAKE_ENDPOINT);
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Open a tab that registers a push service worker.
+ const swTab = await addTab(TAB_URL);
+
+ info(
+ "Wait for the service worker to claim the test window before proceeding."
+ );
+ await SpecialPowers.spawn(
+ swTab.linkedBrowser,
+ [],
+ () => content.wrappedJSObject.onSwClaimed
+ );
+
+ info("Wait until the service worker appears and is running");
+ const targetElement = await waitForServiceWorkerRunning(
+ SERVICE_WORKER,
+ document
+ );
+
+ info("Subscribe from the push service");
+ SpecialPowers.spawn(swTab.linkedBrowser, [], () => {
+ content.wrappedJSObject.subscribeToPush();
+ });
+
+ info("Wait until the push service appears");
+ await waitUntil(() =>
+ targetElement.querySelector(".qa-worker-push-service-value")
+ );
+ const pushUrl = targetElement.querySelector(".qa-worker-push-service-value");
+
+ ok(!!pushUrl, "Push URL is displayed for the serviceworker");
+ is(pushUrl.textContent, FAKE_ENDPOINT, "Push URL shows the expected content");
+
+ info("Unsubscribe from the push service");
+ SpecialPowers.spawn(swTab.linkedBrowser, [], () => {
+ content.wrappedJSObject.unsubscribeToPush();
+ });
+
+ info("Wait until the push service disappears");
+ await waitUntil(
+ () => !targetElement.querySelector(".qa-worker-push-service-value")
+ );
+
+ info("Unregister the service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(SERVICE_WORKER, document));
+
+ info("Remove the service worker tab");
+ await removeTab(swTab);
+
+ await removeTab(tab);
+});
+
+function mockPushService(endpoint) {
+ const PushService = Cc["@mozilla.org/push/Service;1"].getService(
+ Ci.nsIPushService
+ ).wrappedJSObject;
+
+ PushService.service = {
+ _registrations: new Map(),
+ _notify(scope) {
+ Services.obs.notifyObservers(
+ null,
+ PushService.subscriptionModifiedTopic,
+ scope
+ );
+ },
+ init() {},
+ register(pageRecord) {
+ const registration = {
+ endpoint,
+ };
+ this._registrations.set(pageRecord.scope, registration);
+ this._notify(pageRecord.scope);
+ return Promise.resolve(registration);
+ },
+ registration(pageRecord) {
+ return Promise.resolve(this._registrations.get(pageRecord.scope));
+ },
+ unregister(pageRecord) {
+ const deleted = this._registrations.delete(pageRecord.scope);
+ if (deleted) {
+ this._notify(pageRecord.scope);
+ }
+ return Promise.resolve(deleted);
+ },
+ };
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js
new file mode 100644
index 0000000000..410cbadefd
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js
@@ -0,0 +1,70 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+/* import-globals-from helper-collapsibilities.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-collapsibilities.js",
+ this
+);
+
+const SW_TAB_URL = URL_ROOT_SSL + "resources/service-workers/push-sw.html";
+const SW_URL = URL_ROOT_SSL + "resources/service-workers/push-sw.js";
+
+/**
+ * Test that service workers appear and dissapear from the runtime page when they
+ * are registered / unregistered.
+ */
+add_task(async function () {
+ prepareCollapsibilitiesTest();
+ await enableServiceWorkerDebugging();
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ const store = window.AboutDebugging.store;
+
+ await selectThisFirefoxPage(document, store);
+
+ // check that SW list is empty
+ info("Check that the SW pane is empty");
+ let swPane = getDebugTargetPane("Service Workers", document);
+ ok(!swPane.querySelector(".qa-debug-target-item"), "SW list is empty");
+
+ // open a tab and register service worker
+ info("Register a service worker");
+ const swTab = await addTab(SW_TAB_URL);
+
+ // check that service worker is rendered
+ info("Wait until the service worker appears and is running");
+ await waitForServiceWorkerRunning(SW_URL, document);
+
+ swPane = getDebugTargetPane("Service Workers", document);
+ ok(
+ swPane.querySelectorAll(".qa-debug-target-item").length === 1,
+ "Service worker list has one element"
+ );
+ ok(
+ swPane.querySelector(".qa-debug-target-item").textContent.includes(SW_URL),
+ "Service worker list is the one we registered"
+ );
+
+ // unregister the service worker
+ info("Unregister service worker");
+ await unregisterServiceWorker(swTab);
+ // check that service worker is not rendered anymore
+ info("Wait for service worker to disappear");
+ await waitUntil(() => {
+ swPane = getDebugTargetPane("Service Workers", document);
+ return swPane.querySelectorAll(".qa-debug-target-item").length === 0;
+ });
+
+ info("Remove tabs");
+ await removeTab(swTab);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js
new file mode 100644
index 0000000000..483a1cad43
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js
@@ -0,0 +1,71 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const SW_TAB_URL = URL_ROOT_SSL + "resources/service-workers/empty-sw.html";
+const SW_URL = URL_ROOT_SSL + "resources/service-workers/empty-sw.js";
+
+/**
+ * Test that service workers can be started using about:debugging.
+ */
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+
+ // Setting a low idle_timeout and idle_extended_timeout will allow the service worker
+ // to reach the STOPPED state quickly, which will allow us to test the start button.
+ // The default value is 30000 milliseconds.
+ info("Set a low service worker idle timeout");
+ await pushPref("dom.serviceWorkers.idle_timeout", 1000);
+ await pushPref("dom.serviceWorkers.idle_extended_timeout", 1000);
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Open a tab that registers a basic service worker.
+ const swTab = await addTab(SW_TAB_URL);
+
+ // Wait for the registration to make sure service worker has been started, and that we
+ // are not just reading STOPPED as the initial state.
+ await waitForRegistration(swTab);
+
+ info("Wait until the service worker stops");
+ const targetElement = await waitForServiceWorkerStopped(SW_URL, document);
+
+ // Retrieve the Start button for the worker.
+ const startButton = targetElement.querySelector(".qa-start-button");
+ ok(startButton, "Found its start button");
+
+ info(
+ "Click on the start button and wait for the service worker to be running"
+ );
+ const onServiceWorkerRunning = waitForServiceWorkerRunning(SW_URL, document);
+ startButton.click();
+ const updatedTarget = await onServiceWorkerRunning;
+
+ // Check that the buttons are displayed as expected.
+ const hasInspectButton = updatedTarget.querySelector(
+ ".qa-debug-target-inspect-button"
+ );
+ const hasStartButton = updatedTarget.querySelector(".qa-start-button");
+ ok(hasInspectButton, "Service worker has an inspect button");
+ ok(!hasStartButton, "Service worker does not have a start button");
+
+ info("Unregister service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(SW_URL, document));
+
+ info("Remove tabs");
+ await removeTab(swTab);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js
new file mode 100644
index 0000000000..50426dcb47
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js
@@ -0,0 +1,104 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const SW_TAB_URL =
+ URL_ROOT_SSL + "resources/service-workers/controlled-sw.html";
+const SW_URL = URL_ROOT_SSL + "resources/service-workers/controlled-sw.js";
+
+/**
+ * Test that the service worker has the status "registering" when the service worker is
+ * not installed yet. Other states (stopped, running) are covered by the existing tests.
+ */
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Open tab with a service worker that never leaves `registering` status");
+ const swTab = await addTab(SW_TAB_URL);
+
+ // Wait for the registration to make sure service worker has been started, and that we
+ // are not just reading STOPPED as the initial state.
+ await waitForRegistration(swTab);
+
+ info("Wait until the service worker is in registering status");
+ await waitForServiceWorkerRegistering(SW_URL, document);
+
+ // Check that the buttons are displayed as expected.
+ checkButtons(
+ { inspect: true, push: false, start: false, unregister: false },
+ SW_URL,
+ document
+ );
+
+ info("Install the service worker");
+ SpecialPowers.spawn(swTab.linkedBrowser, [], () =>
+ content.wrappedJSObject.installServiceWorker()
+ );
+
+ info("Wait until the service worker is running");
+ await waitForServiceWorkerRunning(SW_URL, document);
+
+ checkButtons(
+ { inspect: true, push: true, start: false, unregister: true },
+ SW_URL,
+ document
+ );
+
+ info("Unregister service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(SW_URL, document));
+
+ info("Remove tabs");
+ await removeTab(swTab);
+ await removeTab(tab);
+});
+
+function checkButtons(
+ { inspect, push, start, unregister },
+ workerText,
+ document
+) {
+ const targetElement = findDebugTargetByText(SW_URL, document);
+
+ const inspectButton = targetElement.querySelector(
+ ".qa-debug-target-inspect-button"
+ );
+ const pushButton = targetElement.querySelector(".qa-push-button");
+ const startButton = targetElement.querySelector(".qa-start-button");
+ const unregisterButton = targetElement.querySelector(".qa-unregister-button");
+
+ is(
+ !!inspectButton,
+ inspect,
+ "Inspect button should be " + (inspect ? "visible" : "hidden")
+ );
+ is(
+ !!pushButton,
+ push,
+ "Push button should be " + (push ? "visible" : "hidden")
+ );
+ is(
+ !!startButton,
+ start,
+ "Start button should be " + (start ? "visible" : "hidden")
+ );
+ is(
+ !!unregisterButton,
+ unregister,
+ "Unregister button should be " + (unregister ? "visible" : "hidden")
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js
new file mode 100644
index 0000000000..f4fc04d229
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js
@@ -0,0 +1,104 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// This test will be idle for a long period to give a chance to the service worker to
+// timeout.
+requestLongerTimeout(3);
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const SW_TAB_URL = URL_ROOT_SSL + "resources/service-workers/empty-sw.html";
+const SW_URL = URL_ROOT_SSL + "resources/service-workers/empty-sw.js";
+const SW_TIMEOUT = 4000;
+
+/**
+ * Test that service workers will _not_ timeout and be stopped when a toolbox is attached
+ * to them. Feature implemented in Bug 1228382.
+ */
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+
+ // Setting a low idle_timeout and idle_extended_timeout will allow the service worker
+ // to reach the STOPPED state quickly, which will allow us to test the start button.
+ // The default value is 30000 milliseconds.
+ info("Set a low service worker idle timeout");
+ await pushPref("dom.serviceWorkers.idle_timeout", SW_TIMEOUT);
+ await pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Open a tab that registers a basic service worker.
+ const swTab = await addTab(SW_TAB_URL);
+
+ // Wait for the registration to make sure service worker has been started, and that we
+ // are not just reading STOPPED as the initial state.
+ await waitForRegistration(swTab);
+
+ info("Wait until the service worker stops");
+ await waitForServiceWorkerStopped(SW_URL, document);
+
+ info(
+ "Click on the start button and wait for the service worker to be running"
+ );
+ const onServiceWorkerRunning = waitForServiceWorkerRunning(SW_URL, document);
+ const startButton = getStartButton(SW_URL, document);
+ startButton.click();
+ await onServiceWorkerRunning;
+
+ const inspectButton = getInspectButton(SW_URL, document);
+ ok(!!inspectButton, "Service worker target has an inspect button");
+
+ info("Click on inspect and wait for the toolbox to open");
+ const onToolboxReady = gDevTools.once("toolbox-ready");
+ inspectButton.click();
+ await onToolboxReady;
+
+ // Wait for more 5 times the service worker timeout to check that the toolbox prevents
+ // the worker from being destroyed.
+ await wait(SW_TIMEOUT * 5);
+
+ // Check that the service worker is still running, even after waiting 5 times the
+ // service worker timeout.
+ const hasInspectButton = !!getInspectButton(SW_URL, document);
+ ok(hasInspectButton, "Service worker target still has an inspect button");
+
+ info("Destroy the toolbox");
+ const devtoolsTab = gBrowser.selectedTab;
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+
+ // After stopping the toolbox, the service worker instance should be released and the
+ // service worker registration should be displayed as stopped again.
+ info("Wait until the service worker stops after closing the toolbox");
+ await waitForServiceWorkerStopped(SW_URL, document);
+
+ info("Unregister service worker");
+ await unregisterServiceWorker(swTab);
+
+ info("Wait until the service worker disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(SW_URL, document));
+
+ info("Remove tabs");
+ await removeTab(swTab);
+ await removeTab(tab);
+});
+
+function getStartButton(workerText, doc) {
+ const target = findDebugTargetByText(workerText, doc);
+ return target ? target.querySelector(".qa-start-button") : null;
+}
+
+function getInspectButton(workerText, doc) {
+ const target = findDebugTargetByText(workerText, doc);
+ return target
+ ? target.querySelector(".qa-debug-target-inspect-button")
+ : null;
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js
new file mode 100644
index 0000000000..f9237e1795
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js
@@ -0,0 +1,48 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-serviceworker.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-serviceworker.js",
+ this
+);
+
+const SW_TAB_URL = URL_ROOT_SSL + "resources/service-workers/empty-sw.html";
+const SW_URL = URL_ROOT_SSL + "resources/service-workers/empty-sw.js";
+
+/**
+ * Test that service workers can be started using about:debugging.
+ */
+add_task(async function () {
+ await enableServiceWorkerDebugging();
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Open a tab that registers a basic service worker.
+ const swTab = await addTab(SW_TAB_URL);
+
+ info("Wait until the service worker appears and is running");
+ const targetElement = await waitForServiceWorkerRunning(SW_URL, document);
+
+ // Retrieve the Start button for the worker.
+ const unregisterButton = targetElement.querySelector(".qa-unregister-button");
+ ok(unregisterButton, "Found its unregister button");
+
+ info(
+ "Click on the unregister button and wait for the service worker to disappear"
+ );
+ unregisterButton.click();
+ await waitUntil(() => !findDebugTargetByText(SW_URL, document));
+
+ const hasServiceWorkerTarget = !!findDebugTargetByText(SW_URL, document);
+ ok(!hasServiceWorkerTarget, "Service worker was successfully unregistered");
+
+ info("Remove tabs");
+ await removeTab(swTab);
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js
new file mode 100644
index 0000000000..d4d31a7522
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js
@@ -0,0 +1,192 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_NAME = "test runtime name";
+const RUNTIME_DEVICE_NAME = "test device name";
+const RUNTIME_SHORT_NAME = "test short name";
+
+const CONNECTION_TIMING_OUT_DELAY = 1000;
+const CONNECTION_CANCEL_DELAY = 2000;
+
+// Test following connection state tests.
+// * Connect button label and state will change during connecting.
+// * Show error message if connection failed.
+// * Show warninng if connection has been taken time.
+add_task(async function () {
+ await setupPreferences();
+
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ name: RUNTIME_NAME,
+ deviceName: RUNTIME_DEVICE_NAME,
+ shortName: RUNTIME_SHORT_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document));
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ RUNTIME_DEVICE_NAME,
+ document
+ );
+ const connectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+
+ info("Simulate to happen connection error");
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ throw new Error("Dummy connection error");
+ };
+
+ info(
+ "Check whether the error message displayed after clicking connect button"
+ );
+ connectButton.click();
+ await waitUntil(() => document.querySelector(".qa-connection-error"));
+ ok(true, "Error message displays when connection failed");
+
+ info("Simulate to wait for the connection prompt on remote runtime");
+ let resumeConnection;
+ const resumeConnectionPromise = new Promise(r => {
+ resumeConnection = r;
+ });
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ await resumeConnectionPromise;
+ return mocks._clients[runtime.type][runtime.id];
+ };
+
+ info("Click on the connect button and wait until it disappears");
+ connectButton.click();
+ info("Check whether a warning of connection not responding displays");
+ await waitUntil(() =>
+ document.querySelector(".qa-connection-not-responding")
+ );
+ ok(
+ document.querySelector(".qa-connection-not-responding"),
+ "A warning of connection not responding displays"
+ );
+ ok(connectButton.disabled, "Connect button is disabled");
+ ok(
+ connectButton.textContent.startsWith("Connecting"),
+ "Label of the connect button changes"
+ );
+ ok(
+ !document.querySelector(".qa-connection-error"),
+ "Error message disappears"
+ );
+
+ info(
+ "Unblock the connection and check the message and connect button disappear"
+ );
+ resumeConnection();
+ await waitUntil(
+ () => !usbRuntimeSidebarItem.querySelector(".qa-connect-button")
+ );
+ ok(!document.querySelector(".qa-connection-error"), "Error disappears");
+ ok(
+ !document.querySelector(".qa-connection-not-responding"),
+ "Warning disappears"
+ );
+
+ info("Remove a USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ await removeTab(tab);
+});
+
+// Test whether the status of all will be reverted after a certain period of time during
+// waiting connection.
+add_task(async function () {
+ await setupPreferences();
+
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ name: RUNTIME_NAME,
+ deviceName: RUNTIME_DEVICE_NAME,
+ shortName: RUNTIME_SHORT_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document));
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ RUNTIME_DEVICE_NAME,
+ document
+ );
+ const connectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+
+ let resumeConnection;
+ const resumeConnectionPromise = new Promise(r => {
+ resumeConnection = r;
+ });
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ await resumeConnectionPromise;
+ return mocks._clients[runtime.type][runtime.id];
+ };
+
+ info("Click on the connect button and wait until it disappears");
+ connectButton.click();
+ await waitUntil(() =>
+ document.querySelector(".qa-connection-not-responding")
+ );
+ info("Check whether the all status will be reverted");
+ await waitUntil(
+ () => !document.querySelector(".qa-connection-not-responding")
+ );
+ ok(
+ document.querySelector(".qa-connection-timeout"),
+ "Connection timeout message displays"
+ );
+ ok(!connectButton.disabled, "Connect button is enabled");
+ is(
+ connectButton.textContent,
+ "Connect",
+ "Label of the connect button reverted"
+ );
+ ok(
+ !document.querySelector(".qa-connection-error"),
+ "Error message disappears"
+ );
+
+ info("Check whether the timeout message disappears");
+ resumeConnection();
+ await waitUntil(() => !document.querySelector(".qa-connection-timeout"));
+
+ info("Remove a USB runtime");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item disappears");
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ await removeTab(tab);
+});
+
+async function setupPreferences() {
+ if (SpecialPowers.isDebugBuild) {
+ // On debug builds, reducing the timings might lead to skip the "warning"
+ // state and will block the test execution.
+ // Do not change the timings in debug builds.
+ return;
+ }
+
+ await pushPref(
+ "devtools.aboutdebugging.test-connection-timing-out-delay",
+ CONNECTION_TIMING_OUT_DELAY
+ );
+ await pushPref(
+ "devtools.aboutdebugging.test-connection-cancel-delay",
+ CONNECTION_CANCEL_DELAY
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js
new file mode 100644
index 0000000000..0482aa70c2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js
@@ -0,0 +1,43 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const networkLocationsModule = require("resource://devtools/client/aboutdebugging/src/modules/network-locations.js");
+
+/**
+ * Test the sidebar is updated correctly when network runtimes are added/removed.
+ */
+
+add_task(async function () {
+ registerCleanupFunction(() => {
+ Services.prefs.clearUserPref("devtools.aboutdebugging.network-locations");
+ });
+
+ const { document, tab } = await openAboutDebugging();
+
+ const noDevicesElement = document.querySelector(".qa-sidebar-no-devices");
+ ok(noDevicesElement, "Sidebar shows the 'no devices' element");
+
+ info("Add a network location");
+ networkLocationsModule.addNetworkLocation("localhost:6080");
+
+ info("Wait for 'no devices' element to disappear");
+ waitUntil(() => !document.querySelector(".qa-sidebar-no-devices"));
+ ok(
+ findSidebarItemByText("localhost:6080", document),
+ "Found a sidebar item for localhost:6080"
+ );
+
+ info("Remove the network location");
+ networkLocationsModule.removeNetworkLocation("localhost:6080");
+
+ info("Wait for 'no devices' element to reappear");
+ waitUntil(() => document.querySelector(".qa-sidebar-no-devices"));
+ ok(
+ !findSidebarItemByText("localhost:6080", document),
+ "Sidebar item for localhost:6080 removed"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js
new file mode 100644
index 0000000000..b63b7ae08e
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js
@@ -0,0 +1,38 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_ID = "RUNTIME_ID";
+const RUNTIME_DEVICE_NAME = "RUNTIME_DEVICE_NAME";
+const RUNTIME_SHORT_NAME = "testshort";
+
+// Test that USB runtimes appear and disappear from the sidebar.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ shortName: RUNTIME_SHORT_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document));
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ RUNTIME_DEVICE_NAME,
+ document
+ );
+ ok(
+ usbRuntimeSidebarItem.textContent.includes(RUNTIME_SHORT_NAME),
+ "The short name of the usb runtime is visible"
+ );
+
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js
new file mode 100644
index 0000000000..f4978b0495
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_NAME = "test runtime name";
+const RUNTIME_DEVICE_NAME = "test device name";
+const RUNTIME_SHORT_NAME = "test short name";
+
+// Test that USB runtimes appear and disappear from the sidebar,
+// as well as their connect button.
+// Also checks whether the label of item is updated after connecting.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ name: RUNTIME_NAME,
+ deviceName: RUNTIME_DEVICE_NAME,
+ shortName: RUNTIME_SHORT_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document));
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ RUNTIME_DEVICE_NAME,
+ document
+ );
+ const connectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+ ok(connectButton, "Connect button is displayed for the USB runtime");
+
+ info("Click on the connect button and wait until it disappears");
+ connectButton.click();
+ await waitUntil(
+ () => !usbRuntimeSidebarItem.querySelector(".qa-connect-button")
+ );
+
+ info("Check whether the label of item is updated after connecting");
+ ok(
+ usbRuntimeSidebarItem.textContent.includes(RUNTIME_NAME),
+ "Label of item updated"
+ );
+
+ info("Remove all USB runtimes");
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document);
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js
new file mode 100644
index 0000000000..47ecc03239
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js
@@ -0,0 +1,50 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_DEVICE_NAME = "test device name";
+const RUNTIME_APP_NAME = "TestApp";
+
+const OTHER_RUNTIME_ID = "other-runtime-id";
+const OTHER_RUNTIME_APP_NAME = "OtherApp";
+
+// Test that USB runtimes are not disconnected on refresh.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ info("Create a first runtime and connect to it");
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ name: RUNTIME_APP_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ await connectToRuntime(RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document);
+
+ info("Create a second runtime and click on Refresh Devices");
+ mocks.createUSBRuntime(OTHER_RUNTIME_ID, {
+ deviceName: OTHER_RUNTIME_APP_NAME,
+ });
+
+ // adb.updateRuntimes should ultimately fire the "runtime-list-updated" event.
+ mocks.adbMock.adb.updateRuntimes = () => mocks.emitUSBUpdate();
+ document.querySelector(".qa-refresh-devices-button").click();
+
+ info(`Wait until the sidebar item for ${OTHER_RUNTIME_APP_NAME} appears`);
+ await waitUntil(() =>
+ findSidebarItemByText(OTHER_RUNTIME_APP_NAME, document)
+ );
+
+ const sidebarItem = findSidebarItemByText(RUNTIME_DEVICE_NAME, document);
+ ok(
+ !sidebarItem.querySelector(".qa-connect-button"),
+ "Original USB runtime is still connected"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js
new file mode 100644
index 0000000000..66ca219bf3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js
@@ -0,0 +1,44 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_DEVICE_ID = "1234";
+const RUNTIME_DEVICE_NAME = "A device";
+
+// Test that we can select a runtime in the sidebar
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.createUSBRuntime(RUNTIME_DEVICE_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document));
+ const sidebarItem = findSidebarItemByText(RUNTIME_DEVICE_NAME, document);
+ const connectButton = sidebarItem.querySelector(".qa-connect-button");
+ ok(connectButton, "Connect button is displayed for the USB runtime");
+
+ info(
+ "Click on the connect button and wait until the sidebar displays a link"
+ );
+ connectButton.click();
+ await waitUntil(() =>
+ findSidebarItemLinkByText(RUNTIME_DEVICE_NAME, document)
+ );
+
+ info("Click on the runtime link");
+ const link = findSidebarItemLinkByText(RUNTIME_DEVICE_NAME, document);
+ link.click();
+ is(
+ document.location.hash,
+ `#/runtime/${RUNTIME_DEVICE_ID}`,
+ "Redirection to runtime page"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js
new file mode 100644
index 0000000000..e67cde31bb
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js
@@ -0,0 +1,50 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ adbAddon,
+} = require("resource://devtools/client/shared/remote-debugging/adb/adb-addon.js");
+
+/**
+ * This test asserts that the sidebar shows a message describing the status of the USB
+ * devices scanning.
+ */
+add_task(async function () {
+ const mocks = new Mocks();
+
+ await pushPref(
+ "devtools.remote.adb.extensionURL",
+ CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi"
+ );
+ const { document, tab } = await openAboutDebugging();
+
+ const usbStatusElement = document.querySelector(".qa-sidebar-usb-status");
+ ok(usbStatusElement, "Sidebar shows the USB status element");
+ ok(
+ usbStatusElement.textContent.includes("USB disabled"),
+ "USB status element has 'disabled' content"
+ );
+
+ info("Install the adb extension and wait for the message to udpate");
+ // Use "internal" as the install source to avoid triggering telemetry.
+ adbAddon.install("internal");
+ // When using mocks, we manually control the .start() call
+ await mocks.adbProcessMock.adbProcess.start();
+
+ info("Wait till the USB status element has 'enabled' content");
+ await waitUntil(() => {
+ const el = document.querySelector(".qa-sidebar-usb-status");
+ return el.textContent.includes("USB enabled");
+ });
+
+ info("Uninstall the adb extension and wait for USB status element to update");
+ adbAddon.uninstall();
+ await waitUntil(() => {
+ const el = document.querySelector(".qa-sidebar-usb-status");
+ return el.textContent.includes("USB disabled");
+ });
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js
new file mode 100644
index 0000000000..e073939b6d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js
@@ -0,0 +1,65 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_NAME = "Firefox 123";
+const DEVICE_NAME = "DEVICE_NAME";
+const DEVICE_ID = "DEVICE_ID";
+const RUNTIME_ID = "RUNTIME_ID";
+
+// Test that unavailable runtimes:
+// - are displayed without a connect button.
+// - cannot be selected
+// - display a specific text ("Waiting for runtime") instead of the runtime name
+add_task(async function () {
+ const mocks = new Mocks();
+ const { document, tab } = await openAboutDebugging();
+
+ info("Create a device without a corresponding runtime");
+ mocks.addDevice(DEVICE_ID, DEVICE_NAME);
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(DEVICE_NAME, document));
+
+ const usbRuntimeSidebarItem = findSidebarItemByText(DEVICE_NAME, document);
+
+ ok(
+ usbRuntimeSidebarItem.querySelector(".qa-runtime-item-waiting-for-browser"),
+ "Sidebar item shows as `Waiting for browser`"
+ );
+
+ const hasConnectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+ ok(!hasConnectButton, "Connect button is not displayed");
+
+ const hasLink = usbRuntimeSidebarItem.querySelector(".qa-sidebar-link");
+ ok(!hasLink, "Unavailable runtime is not selectable");
+
+ info("Add a valid runtime for the same device id and emit update event");
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceId: DEVICE_ID,
+ deviceName: DEVICE_NAME,
+ shortName: RUNTIME_NAME,
+ });
+ mocks.removeDevice(DEVICE_ID);
+ mocks.emitUSBUpdate();
+
+ info("Wait until connect button appears for the USB runtime");
+ let updatedSidebarItem = null;
+ await waitUntil(() => {
+ updatedSidebarItem = findSidebarItemByText(DEVICE_NAME, document);
+ return (
+ updatedSidebarItem &&
+ updatedSidebarItem.querySelector(".qa-connect-button")
+ );
+ });
+
+ ok(
+ updatedSidebarItem.querySelector(".qa-runtime-item-standard"),
+ "Sidebar item for the USB runtime is now a standard sidebar item"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js
new file mode 100644
index 0000000000..5074538a94
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js
@@ -0,0 +1,69 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RUNTIME_NAME = "RUNTIME_NAME_1";
+const DEVICE_NAME = "DEVICE_NAME_1";
+const DEVICE_ID = "DEVICE_ID_1";
+const RUNTIME_ID = "RUNTIME_ID_1";
+
+const RUNTIME_NAME_2 = "RUNTIME_NAME_2";
+const DEVICE_NAME_2 = "DEVICE_NAME_2";
+const DEVICE_ID_2 = "DEVICE_ID_2";
+const RUNTIME_ID_2 = "RUNTIME_ID_2";
+
+// Test that removed USB devices are still visible as "Unplugged devices", until
+// about:debugging is reloaded.
+add_task(async function () {
+ const mocks = new Mocks();
+ let { document, tab } = await openAboutDebugging();
+
+ info("Create a mocked USB runtime");
+ mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceId: DEVICE_ID,
+ deviceName: DEVICE_NAME,
+ shortName: RUNTIME_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(DEVICE_NAME, document));
+ const sidebarItem = findSidebarItemByText(DEVICE_NAME, document);
+ ok(
+ sidebarItem.textContent.includes(RUNTIME_NAME),
+ "Sidebar item shows the runtime name"
+ );
+
+ mocks.removeUSBRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document);
+
+ const unpluggedItem = findSidebarItemByText(DEVICE_NAME, document);
+ ok(
+ unpluggedItem.querySelector(".qa-runtime-item-unplugged"),
+ "Sidebar item is shown as `Unplugged…`"
+ );
+
+ info("Reload about:debugging");
+ document = await reloadAboutDebugging(tab);
+
+ info(
+ "Add another mocked USB runtime, to make sure the sidebar items are rendered."
+ );
+ mocks.createUSBRuntime(RUNTIME_ID_2, {
+ deviceId: DEVICE_ID_2,
+ deviceName: DEVICE_NAME_2,
+ shortName: RUNTIME_NAME_2,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait until the other USB sidebar item appears");
+ await waitUntil(() => findSidebarItemByText(DEVICE_NAME_2, document));
+ ok(
+ !findSidebarItemByText(DEVICE_NAME, document),
+ "Unplugged device is no longer displayed after reloading aboutdebugging"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js
new file mode 100644
index 0000000000..e4acd1727d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js
@@ -0,0 +1,57 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that about:debugging uses the favicon of tab targets as the icon of their debug
+ * target item, and doesn't always use the default globe icon.
+ */
+
+// PlaceUtils will not store any favicon for data: uris so we need to use a dedicated page
+// here.
+const TAB_URL =
+ "https://example.com/browser/devtools/client/aboutdebugging/" +
+ "test/browser/test-tab-favicons.html";
+
+// This is the same png data-url as the one used in test-tab-favicons.html.
+const EXPECTED_FAVICON =
+ "data:image/png;base64," +
+ "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATklEQVRYhe3SIQ4AI" +
+ "BADwf7/04elBAtrVlSduGnSTDJ7cuT1PQJwwO+Hl7sAGAA07gjAAfgIBeAAoH" +
+ "FHAA7ARygABwCNOwJwAD5CATRgAYXh+kypw86nAAAAAElFTkSuQmCC";
+
+add_task(async function () {
+ const faviconTab = await addTab(TAB_URL, { background: true });
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ await waitUntil(() => {
+ const target = findDebugTargetByText("Favicon tab", document);
+ if (!target) {
+ return false;
+ }
+ // We may get a default globe.svg icon for a short period of time while
+ // the target tab is still loading.
+ return target
+ .querySelector(".qa-debug-target-item-icon")
+ .src.includes("data:");
+ });
+ const faviconTabTarget = findDebugTargetByText("Favicon tab", document);
+ const faviconTabIcon = faviconTabTarget.querySelector(
+ ".qa-debug-target-item-icon"
+ );
+
+ // Note this relies on PlaceUtils.promiseFaviconData returning the same data-url as the
+ // one provided in the test page. If the implementation changes and PlaceUtils returns a
+ // different base64 from the one we defined, we can instead load the image and check a
+ // few pixels to verify it matches the expected icon.
+ is(
+ faviconTabIcon.src,
+ EXPECTED_FAVICON,
+ "The debug target item for the tab shows the favicon of the tab"
+ );
+
+ await removeTab(tab);
+ await removeTab(faviconTab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_navigate.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_navigate.js
new file mode 100644
index 0000000000..45355203e3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_navigate.js
@@ -0,0 +1,31 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_1_URL =
+ "http://example.org/document-builder.sjs?html=<title>TITLE1</title>";
+const TAB_2_URL =
+ "http://example.org/document-builder.sjs?html=<title>TITLE2</title>";
+
+// Check that the list of tabs in about:debugging is updated when a page
+// navigates. This indirectly checks that the tabListChanged event is correctly
+// fired from the root actor.
+add_task(async function () {
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const testTab = await addTab(TAB_1_URL, { background: true });
+ await waitFor(() => findDebugTargetByText("TITLE1", document));
+
+ navigateTo(TAB_2_URL, { browser: testTab.linkedBrowser });
+ await waitFor(() => findDebugTargetByText("TITLE2", document));
+
+ ok(
+ !findDebugTargetByText("TITLE1", document),
+ "TITLE2 target replaced TITLE1"
+ );
+
+ await removeTab(tab);
+ await removeTab(testTab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js
new file mode 100644
index 0000000000..1243d3374d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js
@@ -0,0 +1,108 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+let gUniqueCounter = 0;
+
+const triggeringPrincipal_base64 = E10SUtils.SERIALIZED_SYSTEMPRINCIPAL;
+
+const BROWSER_STATE_TABS = [
+ "about:debugging",
+ "data:text/html,<title>TEST_TAB_1</title>",
+ "data:text/html,<title>TEST_TAB_2</title>",
+ "data:text/html,<title>TEST_TAB_3</title>",
+];
+const BROWSER_STATE = {
+ windows: [
+ {
+ tabs: BROWSER_STATE_TABS.map(url => {
+ return {
+ entries: [{ url, triggeringPrincipal_base64 }],
+ extData: { uniq: Date.now() + "-" + ++gUniqueCounter },
+ };
+ }),
+ selected: 1,
+ },
+ ],
+};
+
+// Check that the inspect action is disabled for lazy/zombie tabs, such as the
+// ones created after a session restore.
+add_task(async function () {
+ // This setup is normally handed by the openAboutDebugging helper, but here we
+ // open about:debugging via session restore.
+ silenceWorkerUpdates();
+ await pushPref("devtools.aboutdebugging.local-tab-debugging", true);
+
+ info("Restore 4 tabs including a selected about:debugging tab");
+ const onBrowserSessionRestored = Promise.all([
+ TestUtils.topicObserved("sessionstore-browser-state-restored"),
+ BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "SSTabRestored"),
+ ]);
+ SessionStore.setBrowserState(JSON.stringify(BROWSER_STATE));
+ await onBrowserSessionRestored;
+
+ const tab = gBrowser.selectedTab;
+ const browser = tab.linkedBrowser;
+ const doc = browser.contentDocument;
+ const win = browser.contentWindow;
+ const store = win.AboutDebugging.store;
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => doc.querySelector(".qa-connect-page"));
+
+ await selectThisFirefoxPage(doc, store);
+
+ // Check that all inspect butttons are disabled.
+ checkInspectButton("TEST_TAB_1", doc, { expectDisabled: true });
+ checkInspectButton("TEST_TAB_2", doc, { expectDisabled: true });
+ checkInspectButton("TEST_TAB_3", doc, { expectDisabled: true });
+
+ info("Select the TEST_TAB_2 tab top restore it completely");
+ const onTabRestored = BrowserTestUtils.waitForEvent(
+ gBrowser.tabContainer,
+ "SSTabRestored"
+ );
+ gBrowser.selectedTab = gBrowser.tabs[2];
+ await onTabRestored;
+
+ const onTabsSuccess = waitForDispatch(store, "REQUEST_TABS_SUCCESS");
+
+ info("Select the about:debugging tab again");
+ gBrowser.selectedTab = tab;
+
+ info("Wait until the tabs update is finished");
+ await onTabsSuccess;
+
+ info("Wait until the inspect button for TEST_TAB_2 is enabled");
+ await waitUntil(() => {
+ const target = findDebugTargetByText("TEST_TAB_2", doc);
+ if (!target) {
+ // TEST_TAB_2 target might be missing while the tab target list updates.
+ return false;
+ }
+
+ const button = target.querySelector(".qa-debug-target-inspect-button");
+ return !button.disabled;
+ });
+
+ // Check that all inspect butttons are disabled, except for #2.
+ checkInspectButton("TEST_TAB_1", doc, { expectDisabled: true });
+ checkInspectButton("TEST_TAB_2", doc, { expectDisabled: false });
+ checkInspectButton("TEST_TAB_3", doc, { expectDisabled: true });
+});
+
+function checkInspectButton(targetText, doc, { expectDisabled }) {
+ const inspectButton = getInspectButton(targetText, doc);
+ if (expectDisabled) {
+ ok(inspectButton.disabled, `Inspect button is disabled for ${targetText}`);
+ } else {
+ ok(!inspectButton.disabled, `Inspect button is enabled for ${targetText}`);
+ }
+}
+
+function getInspectButton(targetText, doc) {
+ const targetElement = findDebugTargetByText(targetText, doc);
+ return targetElement.querySelector(".qa-debug-target-inspect-button");
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js
new file mode 100644
index 0000000000..5970d6a70d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js
@@ -0,0 +1,46 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+/**
+ * Check that telemetry events are recorded when opening and closing about debugging.
+ */
+add_task(async function () {
+ setupTelemetryTest();
+
+ const { tab } = await openAboutDebugging();
+
+ const openEvents = readAboutDebuggingEvents().filter(
+ e => e.method === "open_adbg"
+ );
+ is(
+ openEvents.length,
+ 1,
+ "Exactly one open event was logged for about:debugging"
+ );
+ const sessionId = openEvents[0].extras.session_id;
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ await removeTab(tab);
+
+ const closeEvents = readAboutDebuggingEvents().filter(
+ e => e.method === "close_adbg"
+ );
+ is(
+ closeEvents.length,
+ 1,
+ "Exactly one close event was logged for about:debugging"
+ );
+ is(
+ closeEvents[0].extras.session_id,
+ sessionId,
+ "Close event has the same session id as the open event"
+ );
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js
new file mode 100644
index 0000000000..a5836ad50a
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js
@@ -0,0 +1,274 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const USB_RUNTIME = {
+ id: "runtime-id-1",
+ deviceName: "Device A",
+ name: "Runtime 1",
+ shortName: "R1",
+};
+
+/**
+ * Check that telemetry events for connection attempts are correctly recorded in various
+ * scenarios:
+ * - successful connection
+ * - successful connection after showing the timeout warning
+ * - failed connection
+ * - connection timeout
+ */
+add_task(async function testSuccessfulConnectionAttempt() {
+ const { doc, mocks, runtimeId, sessionId, tab } =
+ await setupConnectionAttemptTest();
+
+ await connectToRuntime(USB_RUNTIME.deviceName, doc);
+
+ const connectionEvents = checkTelemetryEvents(
+ [
+ { method: "runtime_connected", extras: { runtime_id: runtimeId } },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("start", runtimeId),
+ },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("success", runtimeId),
+ },
+ ],
+ sessionId
+ ).filter(({ method }) => method === "connection_attempt");
+
+ checkConnectionId(connectionEvents);
+
+ await removeUsbRuntime(USB_RUNTIME, mocks, doc);
+ await removeTab(tab);
+});
+
+add_task(async function testFailedConnectionAttempt() {
+ const { doc, mocks, runtimeId, sessionId, tab } =
+ await setupConnectionAttemptTest();
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ throw new Error("failed");
+ };
+
+ info(
+ "Try to connect to the runtime and wait for the connection error message"
+ );
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ USB_RUNTIME.deviceName,
+ doc
+ );
+ const connectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+ connectButton.click();
+ await waitUntil(() =>
+ usbRuntimeSidebarItem.querySelector(".qa-connection-error")
+ );
+
+ const connectionEvents = checkTelemetryEvents(
+ [
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("start", runtimeId),
+ },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("failed", runtimeId),
+ },
+ ],
+ sessionId
+ ).filter(({ method }) => method === "connection_attempt");
+
+ checkConnectionId(connectionEvents);
+
+ await removeUsbRuntime(USB_RUNTIME, mocks, doc);
+ await removeTab(tab);
+});
+
+add_task(async function testPendingConnectionAttempt() {
+ info("Set timeout preferences to avoid cancelling the connection");
+ await pushPref(
+ "devtools.aboutdebugging.test-connection-timing-out-delay",
+ 100
+ );
+ await pushPref(
+ "devtools.aboutdebugging.test-connection-cancel-delay",
+ 100000
+ );
+
+ const { doc, mocks, runtimeId, sessionId, tab } =
+ await setupConnectionAttemptTest();
+
+ info("Simulate a pending connection");
+ let resumeConnection;
+ const resumeConnectionPromise = new Promise(r => {
+ resumeConnection = r;
+ });
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ await resumeConnectionPromise;
+ return mocks._clients[runtime.type][runtime.id];
+ };
+
+ info("Click on the connect button and wait for the warning message");
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ USB_RUNTIME.deviceName,
+ doc
+ );
+ const connectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+ connectButton.click();
+ await waitUntil(() => doc.querySelector(".qa-connection-not-responding"));
+
+ info("Resume the connection and wait for the connection to succeed");
+ resumeConnection();
+ await waitUntil(
+ () => !usbRuntimeSidebarItem.querySelector(".qa-connect-button")
+ );
+
+ const connectionEvents = checkTelemetryEvents(
+ [
+ { method: "runtime_connected", extras: { runtime_id: runtimeId } },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("start", runtimeId),
+ },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("not responding", runtimeId),
+ },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("success", runtimeId),
+ },
+ ],
+ sessionId
+ ).filter(({ method }) => method === "connection_attempt");
+ checkConnectionId(connectionEvents);
+
+ await removeUsbRuntime(USB_RUNTIME, mocks, doc);
+ await removeTab(tab);
+});
+
+add_task(async function testCancelledConnectionAttempt() {
+ info("Set timeout preferences to quickly cancel the connection");
+ await pushPref(
+ "devtools.aboutdebugging.test-connection-timing-out-delay",
+ 100
+ );
+ await pushPref("devtools.aboutdebugging.test-connection-cancel-delay", 1000);
+
+ const { doc, mocks, runtimeId, sessionId, tab } =
+ await setupConnectionAttemptTest();
+
+ info("Simulate a connection timeout");
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ await new Promise(r => {});
+ };
+
+ info("Click on the connect button and wait for the error message");
+ const usbRuntimeSidebarItem = findSidebarItemByText(
+ USB_RUNTIME.deviceName,
+ doc
+ );
+ const connectButton =
+ usbRuntimeSidebarItem.querySelector(".qa-connect-button");
+ connectButton.click();
+ await waitUntil(() =>
+ usbRuntimeSidebarItem.querySelector(".qa-connection-timeout")
+ );
+
+ const connectionEvents = checkTelemetryEvents(
+ [
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("start", runtimeId),
+ },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("not responding", runtimeId),
+ },
+ {
+ method: "connection_attempt",
+ extras: getEventExtras("cancelled", runtimeId),
+ },
+ ],
+ sessionId
+ ).filter(({ method }) => method === "connection_attempt");
+ checkConnectionId(connectionEvents);
+
+ await removeUsbRuntime(USB_RUNTIME, mocks, doc);
+ await removeTab(tab);
+});
+
+function checkConnectionId(connectionEvents) {
+ const connectionId = connectionEvents[0].extras.connection_id;
+ ok(
+ !!connectionId,
+ "Found a valid connection id in the first connection_attempt event"
+ );
+ for (const evt of connectionEvents) {
+ is(
+ evt.extras.connection_id,
+ connectionId,
+ "All connection_attempt events share the same connection id"
+ );
+ }
+}
+
+// Small helper to create the expected event extras object for connection_attempt events
+function getEventExtras(status, runtimeId) {
+ return {
+ connection_type: "usb",
+ runtime_id: runtimeId,
+ status,
+ };
+}
+
+// Open about:debugging, setup telemetry, mocks and create a mocked USB runtime.
+async function setupConnectionAttemptTest() {
+ const mocks = new Mocks();
+ setupTelemetryTest();
+
+ const { tab, document } = await openAboutDebugging();
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ mocks.createUSBRuntime(USB_RUNTIME.id, {
+ deviceName: USB_RUNTIME.deviceName,
+ name: USB_RUNTIME.name,
+ shortName: USB_RUNTIME.shortName,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait for the runtime to appear in the sidebar");
+ await waitUntil(() => findSidebarItemByText(USB_RUNTIME.shortName, document));
+ const evts = checkTelemetryEvents(
+ [
+ { method: "device_added", extras: {} },
+ { method: "runtime_added", extras: {} },
+ ],
+ sessionId
+ );
+
+ const runtimeId = evts.filter(e => e.method === "runtime_added")[0].extras
+ .runtime_id;
+ return { doc: document, mocks, runtimeId, sessionId, tab };
+}
+
+async function removeUsbRuntime(runtime, mocks, doc) {
+ mocks.removeRuntime(runtime.id);
+ mocks.emitUSBUpdate();
+ await waitUntil(
+ () =>
+ !findSidebarItemByText(runtime.name, doc) &&
+ !findSidebarItemByText(runtime.shortName, doc)
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js
new file mode 100644
index 0000000000..60176258b1
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js
@@ -0,0 +1,67 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const TAB_URL = "data:text/html,<title>TEST_TAB</title>";
+
+/**
+ * Check that telemetry events are recorded when inspecting a target.
+ */
+add_task(async function () {
+ setupTelemetryTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ info("Open a new background tab TEST_TAB");
+ const backgroundTab1 = await addTab(TAB_URL, { background: true });
+
+ info("Wait for the tab to appear in the debug targets with the correct name");
+ await waitUntil(() => findDebugTargetByText("TEST_TAB", document));
+
+ const { devtoolsTab } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ "TEST_TAB"
+ );
+
+ const evts = readAboutDebuggingEvents().filter(e => e.method === "inspect");
+ is(evts.length, 1, "Exactly one Inspect event found");
+ is(
+ evts[0].extras.target_type,
+ "TAB",
+ "Inspect event has the expected target type"
+ );
+ is(
+ evts[0].extras.runtime_type,
+ "this-firefox",
+ "Inspect event has the expected runtime type"
+ );
+ is(
+ evts[0].extras.session_id,
+ sessionId,
+ "Inspect event has the expected session"
+ );
+
+ info("Close the about:devtools-toolbox tab");
+ await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+
+ info("Remove first background tab");
+ await removeTab(backgroundTab1);
+ await waitUntil(() => !findDebugTargetByText("TEST_TAB", document));
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js
new file mode 100644
index 0000000000..946f5e9e43
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js
@@ -0,0 +1,67 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+/**
+ * Check that telemetry events are recorded when navigating between different
+ * about:debugging pages.
+ */
+add_task(async function () {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+
+ setupTelemetryTest();
+
+ const { tab, document, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ info("Navigate to 'Connect' page");
+ document.location.hash = "#/connect";
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+ checkSelectPageEvent("connect", sessionId);
+
+ info("Navigate to 'USB device runtime' page");
+ await navigateToUSBRuntime(mocks, document);
+ checkSelectPageEvent("runtime", sessionId);
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+
+ await removeTab(tab);
+});
+
+function checkSelectPageEvent(expectedType, expectedSessionId) {
+ const evts = readAboutDebuggingEvents().filter(
+ e => e.method === "select_page"
+ );
+ is(evts.length, 1, "Exactly one select_page event recorded");
+ is(
+ evts[0].extras.page_type,
+ expectedType,
+ "Select page event has the expected type"
+ );
+ is(
+ evts[0].extras.session_id,
+ expectedSessionId,
+ "Select page event has the expected session"
+ );
+}
+
+async function navigateToUSBRuntime(mocks, doc) {
+ mocks.createUSBRuntime("1337id", {
+ deviceName: "Fancy Phone",
+ name: "Lorem ipsum",
+ });
+ mocks.emitUSBUpdate();
+ await connectToRuntime("Fancy Phone", doc);
+ // navigate to it via URL
+ doc.location.hash = "#/runtime/1337id";
+ await waitUntil(() => doc.querySelector(".qa-runtime-page"));
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js
new file mode 100644
index 0000000000..92d07a3d9c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js
@@ -0,0 +1,97 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const RUNTIME_ID = "test-runtime-id";
+const RUNTIME_NAME = "Test Runtime";
+const RUNTIME_DEVICE_NAME = "Test Device";
+
+/**
+ * Test that runtime specific actions are logged as telemetry events with the expected
+ * runtime id and action type.
+ */
+add_task(async function testUsbRuntimeUpdates() {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ setupTelemetryTest();
+
+ const { tab, document } = await openAboutDebugging();
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ const usbClient = mocks.createUSBRuntime(RUNTIME_ID, {
+ deviceName: RUNTIME_DEVICE_NAME,
+ name: RUNTIME_NAME,
+ shortName: RUNTIME_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait for the runtime to appear in the sidebar");
+ await waitUntil(() => findSidebarItemByText(RUNTIME_NAME, document));
+ await connectToRuntime(RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_NAME, document);
+
+ info("Read telemetry events to flush unrelated events");
+ const evts = readAboutDebuggingEvents();
+ const runtimeAddedEvent = evts.filter(e => e.method === "runtime_added")[0];
+ const telemetryRuntimeId = runtimeAddedEvent.extras.runtime_id;
+
+ info("Click on the toggle button and wait until the text is updated");
+ const promptButton = document.querySelector(
+ ".qa-connection-prompt-toggle-button"
+ );
+ promptButton.click();
+ await waitUntil(() => promptButton.textContent.includes("Enable"));
+
+ checkTelemetryEvents(
+ [
+ {
+ method: "update_conn_prompt",
+ extras: { prompt_enabled: "false", runtime_id: telemetryRuntimeId },
+ },
+ ],
+ sessionId
+ );
+
+ info("Click on the toggle button again and check we log the correct value");
+ promptButton.click();
+ await waitUntil(() => promptButton.textContent.includes("Disable"));
+
+ checkTelemetryEvents(
+ [
+ {
+ method: "update_conn_prompt",
+ extras: { prompt_enabled: "true", runtime_id: telemetryRuntimeId },
+ },
+ ],
+ sessionId
+ );
+
+ info("Open the profiler dialog");
+ await openProfilerDialog(usbClient, document);
+
+ checkTelemetryEvents(
+ [
+ {
+ method: "show_profiler",
+ extras: { runtime_id: telemetryRuntimeId },
+ },
+ ],
+ sessionId
+ );
+
+ info("Remove runtime");
+ mocks.removeRuntime(RUNTIME_ID);
+ mocks.emitUSBUpdate();
+ await waitUntil(() => !findSidebarItemByText(RUNTIME_NAME, document));
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js
new file mode 100644
index 0000000000..808cfdcae8
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js
@@ -0,0 +1,69 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const REMOTE_RUNTIME_ID = "remote-runtime";
+const REMOTE_RUNTIME = "Remote Runtime";
+const REMOTE_DEVICE = "Remote Device";
+
+const REMOTE_VERSION = "12.0a1";
+const REMOTE_OS = "SOME_OS";
+
+/**
+ * Runtime connected events will log additional extras about the runtime connection that
+ * was established.
+ */
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const usbClient = mocks.createUSBRuntime(REMOTE_RUNTIME_ID, {
+ deviceName: REMOTE_DEVICE,
+ name: REMOTE_RUNTIME,
+ shortName: REMOTE_RUNTIME,
+ });
+ usbClient.getDeviceDescription = () => {
+ return {
+ os: REMOTE_OS,
+ version: REMOTE_VERSION,
+ };
+ };
+
+ const { document, tab } = await openAboutDebugging();
+
+ mocks.emitUSBUpdate();
+ await connectToRuntime(REMOTE_DEVICE, document);
+ const evts = readAboutDebuggingEvents().filter(
+ e => e.method === "runtime_connected"
+ );
+
+ is(
+ evts.length,
+ 1,
+ "runtime_connected event logged when connecting to remote runtime"
+ );
+ const {
+ connection_type,
+ device_name,
+ runtime_name,
+ runtime_os,
+ runtime_version,
+ } = evts[0].extras;
+ is(connection_type, "usb", "Expected value for `connection_type` extra");
+ is(device_name, REMOTE_DEVICE, "Expected value for `device_name` extra");
+ is(runtime_name, REMOTE_RUNTIME, "Expected value for `runtime_name` extra");
+ is(runtime_os, REMOTE_OS, "Expected value for `runtime_os` extra");
+ is(
+ runtime_version,
+ REMOTE_VERSION,
+ "Expected value for `runtime_version` extra"
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js
new file mode 100644
index 0000000000..51934550a8
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js
@@ -0,0 +1,154 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const DEVICE_A = "Device A";
+const USB_RUNTIME_1 = {
+ id: "runtime-id-1",
+ deviceName: DEVICE_A,
+ name: "Runtime 1",
+ shortName: "R1",
+};
+
+const USB_RUNTIME_2 = {
+ id: "runtime-id-2",
+ deviceName: DEVICE_A,
+ name: "Runtime 2",
+ shortName: "R2",
+};
+
+const DEVICE_A_EXTRAS = {
+ connection_type: "usb",
+ device_name: DEVICE_A,
+};
+
+const RUNTIME_1_EXTRAS = {
+ connection_type: "usb",
+ device_name: USB_RUNTIME_1.deviceName,
+ runtime_name: USB_RUNTIME_1.shortName,
+};
+
+const RUNTIME_2_EXTRAS = {
+ connection_type: "usb",
+ device_name: USB_RUNTIME_2.deviceName,
+ runtime_name: USB_RUNTIME_2.shortName,
+};
+
+/**
+ * Check that telemetry events are recorded for USB runtimes when:
+ * - adding a device/runtime
+ * - removing a device/runtime
+ * - connecting to a runtime
+ */
+add_task(async function testUsbRuntimeUpdates() {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ setupTelemetryTest();
+
+ const { tab, document } = await openAboutDebugging();
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ await addUsbRuntime(USB_RUNTIME_1, mocks, document);
+
+ let evts = checkTelemetryEvents(
+ [
+ { method: "device_added", extras: DEVICE_A_EXTRAS },
+ { method: "runtime_added", extras: RUNTIME_1_EXTRAS },
+ ],
+ sessionId
+ );
+
+ // Now that a first telemetry event has been logged for RUNTIME_1, retrieve the id
+ // generated for telemetry, and check that we keep logging the same id for all events
+ // related to runtime 1.
+ const runtime1Id = evts.filter(e => e.method === "runtime_added")[0].extras
+ .runtime_id;
+ const runtime1Extras = Object.assign({}, RUNTIME_1_EXTRAS, {
+ runtime_id: runtime1Id,
+ });
+ // Same as runtime1Extras, but the runtime name should be the complete one.
+ const runtime1ConnectedExtras = Object.assign({}, runtime1Extras, {
+ runtime_name: USB_RUNTIME_1.name,
+ });
+
+ await connectToRuntime(USB_RUNTIME_1.deviceName, document);
+
+ checkTelemetryEvents(
+ [
+ { method: "runtime_connected", extras: runtime1ConnectedExtras },
+ { method: "connection_attempt", extras: { status: "start" } },
+ { method: "connection_attempt", extras: { status: "success" } },
+ ],
+ sessionId
+ );
+
+ info("Add a second runtime");
+ await addUsbRuntime(USB_RUNTIME_2, mocks, document);
+ evts = checkTelemetryEvents(
+ [{ method: "runtime_added", extras: RUNTIME_2_EXTRAS }],
+ sessionId
+ );
+
+ // Similar to what we did for RUNTIME_1,w e want to check we reuse the same telemetry id
+ // for all the events related to RUNTIME_2.
+ const runtime2Id = evts.filter(e => e.method === "runtime_added")[0].extras
+ .runtime_id;
+ const runtime2Extras = Object.assign({}, RUNTIME_2_EXTRAS, {
+ runtime_id: runtime2Id,
+ });
+
+ info("Remove runtime 1");
+ await removeUsbRuntime(USB_RUNTIME_1, mocks, document);
+
+ checkTelemetryEvents(
+ [
+ { method: "runtime_disconnected", extras: runtime1ConnectedExtras },
+ { method: "runtime_removed", extras: runtime1Extras },
+ ],
+ sessionId
+ );
+
+ info("Remove runtime 2");
+ await removeUsbRuntime(USB_RUNTIME_2, mocks, document);
+
+ checkTelemetryEvents(
+ [
+ { method: "runtime_removed", extras: runtime2Extras },
+ { method: "device_removed", extras: DEVICE_A_EXTRAS },
+ ],
+ sessionId
+ );
+
+ await removeTab(tab);
+});
+
+async function addUsbRuntime(runtime, mocks, doc) {
+ mocks.createUSBRuntime(runtime.id, {
+ deviceName: runtime.deviceName,
+ name: runtime.name,
+ shortName: runtime.shortName,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Wait for the runtime to appear in the sidebar");
+ await waitUntil(() => findSidebarItemByText(runtime.shortName, doc));
+}
+
+async function removeUsbRuntime(runtime, mocks, doc) {
+ mocks.removeRuntime(runtime.id);
+ mocks.emitUSBUpdate();
+ await waitUntil(
+ () =>
+ !findSidebarItemByText(runtime.name, doc) &&
+ !findSidebarItemByText(runtime.shortName, doc)
+ );
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js
new file mode 100644
index 0000000000..707ddf4621
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js
@@ -0,0 +1,111 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const DEVICE_A = "Device A";
+const USB_RUNTIME_1 = {
+ id: "runtime-id-1",
+ deviceName: DEVICE_A,
+ name: "Runtime 1",
+ shortName: "R1",
+};
+
+const USB_RUNTIME_2 = {
+ id: "runtime-id-2",
+ deviceName: DEVICE_A,
+ name: "Runtime 2",
+ shortName: "R2",
+};
+
+const DEVICE_A_EXTRAS = {
+ connection_type: "usb",
+ device_name: DEVICE_A,
+};
+
+const RUNTIME_1_EXTRAS = {
+ connection_type: "usb",
+ device_name: USB_RUNTIME_1.deviceName,
+ runtime_name: USB_RUNTIME_1.shortName,
+};
+
+const RUNTIME_2_EXTRAS = {
+ connection_type: "usb",
+ device_name: USB_RUNTIME_2.deviceName,
+ runtime_name: USB_RUNTIME_2.shortName,
+};
+
+/**
+ * Test runtime update events when a device is connected/disconnected with multiple
+ * runtimes available on the same device.
+ */
+add_task(async function () {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ setupTelemetryTest();
+
+ const { tab, document } = await openAboutDebugging();
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ info("Add two runtimes on the same device at the same time");
+ mocks.createUSBRuntime(USB_RUNTIME_1.id, {
+ deviceName: USB_RUNTIME_1.deviceName,
+ name: USB_RUNTIME_1.name,
+ shortName: USB_RUNTIME_1.shortName,
+ });
+ mocks.createUSBRuntime(USB_RUNTIME_2.id, {
+ deviceName: USB_RUNTIME_2.deviceName,
+ name: USB_RUNTIME_2.name,
+ shortName: USB_RUNTIME_2.shortName,
+ });
+ mocks.emitUSBUpdate();
+ await waitUntil(() =>
+ findSidebarItemByText(USB_RUNTIME_1.shortName, document)
+ );
+ await waitUntil(() =>
+ findSidebarItemByText(USB_RUNTIME_2.shortName, document)
+ );
+
+ checkTelemetryEvents(
+ [
+ { method: "device_added", extras: DEVICE_A_EXTRAS },
+ { method: "runtime_added", extras: RUNTIME_1_EXTRAS },
+ { method: "runtime_added", extras: RUNTIME_2_EXTRAS },
+ ],
+ sessionId
+ );
+
+ info("Remove both runtimes at once to simulate a device disconnection");
+ mocks.removeRuntime(USB_RUNTIME_1.id);
+ mocks.removeRuntime(USB_RUNTIME_2.id);
+ mocks.emitUSBUpdate();
+ await waitUntil(
+ () =>
+ !findSidebarItemByText(USB_RUNTIME_1.name, document) &&
+ !findSidebarItemByText(USB_RUNTIME_1.shortName, document)
+ );
+ await waitUntil(
+ () =>
+ !findSidebarItemByText(USB_RUNTIME_2.name, document) &&
+ !findSidebarItemByText(USB_RUNTIME_2.shortName, document)
+ );
+
+ checkTelemetryEvents(
+ [
+ { method: "runtime_removed", extras: RUNTIME_1_EXTRAS },
+ { method: "runtime_removed", extras: RUNTIME_2_EXTRAS },
+ { method: "device_removed", extras: DEVICE_A_EXTRAS },
+ ],
+ sessionId
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js
new file mode 100644
index 0000000000..d33810dc59
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js
@@ -0,0 +1,90 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-telemetry.js */
+Services.scriptloader.loadSubScript(
+ CHROME_URL_ROOT + "helper-telemetry.js",
+ this
+);
+
+const NETWORK_RUNTIME = {
+ host: "localhost:1234",
+ // No device name for network runtimes.
+ name: "Local Network Runtime",
+};
+
+/**
+ * Test runtime update events for network runtimes.
+ */
+add_task(async function testNetworkRuntimeUpdates() {
+ // enable USB devices mocks
+ const mocks = new Mocks();
+ setupTelemetryTest();
+
+ const { tab, document } = await openAboutDebugging();
+
+ const sessionId = getOpenEventSessionId();
+ ok(!isNaN(sessionId), "Open event has a valid session id");
+
+ info("Add a network runtime");
+ await addNetworkRuntime(NETWORK_RUNTIME, mocks, document);
+
+ // Before the connection, we don't have any information about the runtime.
+ // Device information is also not available to network runtimes.
+ const networkRuntimeExtras = {
+ connection_type: "network",
+ device_name: "",
+ runtime_name: "",
+ };
+
+ // Once connected we should be able to log a valid runtime name.
+ const connectedNetworkRuntimeExtras = Object.assign(
+ {},
+ networkRuntimeExtras,
+ {
+ runtime_name: NETWORK_RUNTIME.name,
+ }
+ );
+
+ // For network runtimes, we don't have any device information, so we shouldn't have any
+ // device_added event.
+ checkTelemetryEvents(
+ [{ method: "runtime_added", extras: networkRuntimeExtras }],
+ sessionId
+ );
+
+ await connectToRuntime(NETWORK_RUNTIME.host, document);
+ checkTelemetryEvents(
+ [
+ { method: "runtime_connected", extras: connectedNetworkRuntimeExtras },
+ { method: "connection_attempt", extras: { status: "start" } },
+ { method: "connection_attempt", extras: { status: "success" } },
+ ],
+ sessionId
+ );
+
+ info("Remove network runtime");
+ mocks.removeRuntime(NETWORK_RUNTIME.host);
+ await waitUntil(() => !findSidebarItemByText(NETWORK_RUNTIME.host, document));
+ // Similarly we should not have any device removed event.
+ checkTelemetryEvents(
+ [
+ { method: "runtime_disconnected", extras: connectedNetworkRuntimeExtras },
+ { method: "runtime_removed", extras: networkRuntimeExtras },
+ ],
+ sessionId
+ );
+
+ await removeTab(tab);
+});
+
+async function addNetworkRuntime(runtime, mocks, doc) {
+ mocks.createNetworkRuntime(runtime.host, {
+ name: runtime.name,
+ });
+
+ info("Wait for the Network Runtime to appear in the sidebar");
+ await waitUntil(() => findSidebarItemByText(runtime.host, doc));
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js
new file mode 100644
index 0000000000..3f673df758
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js
@@ -0,0 +1,121 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const EXPECTED_TARGET_PANES = [
+ "Tabs",
+ "Temporary Extensions",
+ "Extensions",
+ "Service Workers",
+ "Shared Workers",
+ "Other Workers",
+];
+
+/**
+ * Check that the This Firefox runtime page contains the expected categories if
+ * the preference to enable local tab debugging is true.
+ */
+add_task(async function testThisFirefoxWithLocalTab() {
+ const { document, tab, window } = await openAboutDebugging({
+ enableLocalTabs: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Expect all target panes to be displayed including tabs.
+ await checkThisFirefoxTargetPanes(document, EXPECTED_TARGET_PANES);
+
+ await removeTab(tab);
+});
+
+/**
+ * Check that the This Firefox runtime page contains the expected categories if
+ * the preference to enable local tab debugging is false.
+ */
+add_task(async function testThisFirefoxWithoutLocalTab() {
+ const { document, tab, window } = await openAboutDebugging({
+ enableLocalTabs: false,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Expect all target panes but tabs to be displayed.
+ const expectedTargetPanesWithoutTabs = EXPECTED_TARGET_PANES.filter(
+ p => p !== "Tabs"
+ );
+ await checkThisFirefoxTargetPanes(document, expectedTargetPanesWithoutTabs);
+
+ await removeTab(tab);
+});
+
+/**
+ * Check that the tab which is discarded keeps the state after open the aboutdebugging.
+ */
+add_task(async function testThisFirefoxKeepDiscardedTab() {
+ const targetTab = await addTab("https://example.com/");
+ const blankTab = await addTab("about:blank");
+ targetTab.ownerGlobal.gBrowser.discardBrowser(targetTab);
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableLocalTabs: false,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ ok(!targetTab.linkedPanel, "The target tab is still discarded");
+
+ await removeTab(blankTab);
+ await removeTab(targetTab);
+ await removeTab(tab);
+});
+
+/**
+ * Check that the Temporary Extensions is hidden if "xpinstall.enabled" is set to false.
+ */
+add_task(async function testThisFirefoxWithXpinstallDisabled() {
+ await pushPref("xpinstall.enabled", false);
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ // Expect all target panes but temporary extensions to be displayed.
+ const expectedTargetPanesWithXpinstallDisabled = EXPECTED_TARGET_PANES.filter(
+ p => p !== "Temporary Extensions"
+ );
+ await checkThisFirefoxTargetPanes(
+ document,
+ expectedTargetPanesWithXpinstallDisabled
+ );
+
+ await removeTab(tab);
+});
+
+async function checkThisFirefoxTargetPanes(doc, expectedTargetPanes) {
+ const win = doc.ownerGlobal;
+ // Check that the selected sidebar item is "This Firefox"/"This Nightly"/...
+ const selectedSidebarItem = doc.querySelector(".qa-sidebar-item-selected");
+ ok(selectedSidebarItem, "An item is selected in the sidebar");
+
+ const thisFirefoxString = getThisFirefoxString(win);
+ is(
+ selectedSidebarItem.textContent,
+ thisFirefoxString,
+ "The selected sidebar item is " + thisFirefoxString
+ );
+
+ const paneTitlesEls = doc.querySelectorAll(".qa-debug-target-pane-title");
+ is(
+ paneTitlesEls.length,
+ expectedTargetPanes.length,
+ "This Firefox has the expected number of debug target categories"
+ );
+
+ const paneTitles = [...paneTitlesEls].map(el => el.textContent);
+
+ for (let i = 0; i < expectedTargetPanes.length; i++) {
+ const expectedPaneTitle = expectedTargetPanes[i];
+ const actualPaneTitle = paneTitles[i];
+ ok(
+ actualPaneTitle.startsWith(expectedPaneTitle),
+ `Expected debug target category found: ${expectedPaneTitle}`
+ );
+ }
+}
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
new file mode 100644
index 0000000000..2475994fed
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the runtime info is correctly displayed for ThisFirefox.
+ * Also acts as basic sanity check for the default mock of the this-firefox client.
+ */
+
+add_task(async function () {
+ // Setup a mock for our runtime client factory to return the default THIS_FIREFOX client
+ // when the client for the this-firefox runtime is requested.
+ const runtimeClientFactoryMock = createRuntimeClientFactoryMock();
+ const thisFirefoxClient = createThisFirefoxClientMock();
+ runtimeClientFactoryMock.createClientForRuntime = runtime => {
+ const {
+ RUNTIMES,
+ } = require("resource://devtools/client/aboutdebugging/src/constants.js");
+ if (runtime.id === RUNTIMES.THIS_FIREFOX) {
+ return thisFirefoxClient;
+ }
+ throw new Error("Unexpected runtime id " + runtime.id);
+ };
+
+ info("Enable mocks");
+ enableRuntimeClientFactoryMock(runtimeClientFactoryMock);
+ registerCleanupFunction(() => {
+ disableRuntimeClientFactoryMock();
+ });
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Check that the 'This Firefox' mock is properly displayed");
+ const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name");
+ ok(
+ thisFirefoxRuntimeInfo,
+ "Runtime info for this-firefox runtime is displayed"
+ );
+ const runtimeInfoText = thisFirefoxRuntimeInfo.textContent;
+ ok(
+ runtimeInfoText.includes("Firefox"),
+ "this-firefox runtime info shows the correct runtime name: " +
+ runtimeInfoText
+ );
+ ok(
+ runtimeInfoText.includes("63.0"),
+ "this-firefox runtime info shows the correct version number: " +
+ runtimeInfoText
+ );
+
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js
new file mode 100644
index 0000000000..4d02c73b1b
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js
@@ -0,0 +1,68 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+add_task(async function () {
+ const thisFirefoxClient = createThisFirefoxClientMock();
+ // Prepare a worker mock.
+ const testWorker = {
+ id: "test-worker-id",
+ name: "Test Worker",
+ };
+ // Add a worker mock as other worker.
+ thisFirefoxClient.listWorkers = () => ({
+ otherWorkers: [testWorker],
+ serviceWorkers: [],
+ sharedWorkers: [],
+ });
+ thisFirefoxClient.client.mainRoot = {
+ getWorker: id => {
+ return id === testWorker.id ? testWorker : null;
+ },
+ };
+
+ const runtimeClientFactoryMock = createRuntimeClientFactoryMock();
+ runtimeClientFactoryMock.createClientForRuntime = runtime => {
+ const {
+ RUNTIMES,
+ } = require("resource://devtools/client/aboutdebugging/src/constants.js");
+ if (runtime.id === RUNTIMES.THIS_FIREFOX) {
+ return thisFirefoxClient;
+ }
+ throw new Error("Unexpected runtime id " + runtime.id);
+ };
+
+ info("Enable mocks");
+ enableRuntimeClientFactoryMock(runtimeClientFactoryMock);
+ registerCleanupFunction(() => {
+ disableRuntimeClientFactoryMock();
+ });
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Open a toolbox to debug the worker");
+ const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox(
+ document,
+ tab,
+ window,
+ testWorker.name,
+ false
+ );
+
+ info(
+ "Check whether the correct actor front will be opened in worker toolbox"
+ );
+ const url = new window.URL(devtoolsWindow.location.href);
+ const workerID = url.searchParams.get("id");
+ is(
+ workerID,
+ testWorker.id,
+ "Correct actor front will be opened in worker toolbox"
+ );
+
+ await removeTab(devtoolsTab);
+ await waitUntil(() => !findDebugTargetByText("Toolbox - ", document));
+ await removeTab(tab);
+});
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js
new file mode 100644
index 0000000000..3e0ccf1532
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js
@@ -0,0 +1,160 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const NETWORK_RUNTIME_HOST = "localhost:6080";
+const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const USB_RUNTIME_ID = "test-runtime-id";
+const USB_RUNTIME_DEVICE_NAME = "test device name";
+const USB_RUNTIME_APP_NAME = "TestUsbApp";
+
+const TESTS = [
+ {
+ category: "Other Workers",
+ propertyName: "otherWorkers",
+ workerName: "other/worker/script.js",
+ },
+ {
+ category: "Service Workers",
+ propertyName: "serviceWorkers",
+ workerName: "service/worker/script.js",
+ },
+ {
+ category: "Shared Workers",
+ propertyName: "sharedWorkers",
+ workerName: "shared/worker/script.js",
+ },
+];
+
+const EMPTY_WORKERS_RESPONSE = {
+ otherWorkers: [],
+ serviceWorkers: [],
+ sharedWorkers: [],
+};
+
+// Test that workers are displayed and updated for remote runtimes when expected.
+add_task(async function () {
+ const mocks = new Mocks();
+
+ const { document, tab, window } = await openAboutDebugging({
+ enableWorkerUpdates: true,
+ });
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ info("Prepare USB client mock");
+ const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, {
+ deviceName: USB_RUNTIME_DEVICE_NAME,
+ name: USB_RUNTIME_APP_NAME,
+ });
+ mocks.emitUSBUpdate();
+
+ info("Test addons in runtime page for USB client");
+ await connectToRuntime(USB_RUNTIME_DEVICE_NAME, document);
+ await selectRuntime(USB_RUNTIME_DEVICE_NAME, USB_RUNTIME_APP_NAME, document);
+ for (const testData of TESTS) {
+ await testWorkerOnMockedRemoteClient(
+ testData,
+ usbClient,
+ mocks.thisFirefoxClient,
+ document
+ );
+ }
+
+ info("Prepare Network client mock");
+ const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
+ name: NETWORK_RUNTIME_APP_NAME,
+ });
+
+ info("Test workers in runtime page for Network client");
+ await connectToRuntime(NETWORK_RUNTIME_HOST, document);
+ await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
+
+ for (const testData of TESTS) {
+ await testWorkerOnMockedRemoteClient(
+ testData,
+ networkClient,
+ mocks.thisFirefoxClient,
+ document
+ );
+ }
+
+ await removeTab(tab);
+});
+
+/**
+ * Check that workers are visible in the runtime page for a remote client.
+ */
+async function testWorkerOnMockedRemoteClient(
+ testData,
+ remoteClient,
+ firefoxClient,
+ document
+) {
+ const { category, propertyName, workerName } = testData;
+ info(`Test workers for category [${category}] in remote runtime`);
+
+ const workersPane = getDebugTargetPane(category, document);
+ info("Check an empty target pane message is displayed");
+ ok(
+ workersPane.querySelector(".qa-debug-target-list-empty"),
+ "Workers list is empty"
+ );
+
+ info(`Add a worker of type [${propertyName}] to the remote client`);
+ const workers = Object.assign({}, EMPTY_WORKERS_RESPONSE, {
+ [propertyName]: [
+ {
+ name: workerName,
+ workerDescriptorFront: {
+ actorID: workerName,
+ },
+ },
+ ],
+ });
+ remoteClient.listWorkers = () => workers;
+ remoteClient._eventEmitter.emit("workersUpdated");
+
+ info("Wait until the worker appears");
+ await waitUntil(
+ () => !workersPane.querySelector(".qa-debug-target-list-empty")
+ );
+
+ const workerTarget = findDebugTargetByText(workerName, document);
+ ok(workerTarget, "Worker target appeared for the remote runtime");
+
+ // Check that the list of REMOTE workers are NOT updated when the local this-firefox
+ // emits a workersUpdated event.
+ info("Remove the worker from the remote client WITHOUT sending an event");
+ remoteClient.listWorkers = () => EMPTY_WORKERS_RESPONSE;
+
+ info("Simulate a worker update on the ThisFirefox client");
+ firefoxClient._eventEmitter.emit("workersUpdated");
+
+ // To avoid wait for a set period of time we trigger another async update, adding a new
+ // tab. We assume that if the worker update mechanism had started, it would also be done
+ // when the new tab was processed.
+ info("Wait until the tab target for 'http://some.random/url.com' appears");
+ const testTab = {
+ retrieveFavicon: () => {},
+ outerWindowID: 0,
+ traits: {},
+ url: "http://some.random/url.com",
+ };
+ remoteClient.listTabs = () => [testTab];
+ remoteClient._eventEmitter.emit("tabListChanged");
+ await waitUntil(() =>
+ findDebugTargetByText("http://some.random/url.com", document)
+ );
+
+ ok(
+ findDebugTargetByText(workerName, document),
+ "The test worker is still visible"
+ );
+
+ info(
+ "Emit `workersUpdated` on remoteClient and wait for the target list to update"
+ );
+ remoteClient._eventEmitter.emit("workersUpdated");
+ await waitUntil(() => !findDebugTargetByText(workerName, document));
+}
diff --git a/devtools/client/aboutdebugging/test/browser/empty.html b/devtools/client/aboutdebugging/test/browser/empty.html
new file mode 100644
index 0000000000..d0fd95ab08
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/empty.html
@@ -0,0 +1 @@
+<body>fake_profiler_page</body>
diff --git a/devtools/client/aboutdebugging/test/browser/head.js b/devtools/client/aboutdebugging/test/browser/head.js
new file mode 100644
index 0000000000..3c32e0b87b
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/head.js
@@ -0,0 +1,505 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* eslint-env browser */
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+// Load the shared-head file first.
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js",
+ this
+);
+
+/* import-globals-from helper-mocks.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
+
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/shared-head.js",
+ this
+);
+
+// Make sure the ADB addon is removed and ADB is stopped when the test ends.
+registerCleanupFunction(async function () {
+ // Reset the selected tool in case we opened about:devtools-toolbox to
+ // avoid side effects between tests.
+ Services.prefs.clearUserPref("devtools.toolbox.selectedTool");
+
+ try {
+ const {
+ adbAddon,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-addon.js");
+ await adbAddon.uninstall();
+ } catch (e) {
+ // Will throw if the addon is already uninstalled, ignore exceptions here.
+ }
+ const {
+ adbProcess,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-process.js");
+ await adbProcess.kill();
+
+ const {
+ remoteClientManager,
+ } = require("resource://devtools/client/shared/remote-debugging/remote-client-manager.js");
+ await remoteClientManager.removeAllClients();
+});
+
+async function openAboutDebugging({
+ enableWorkerUpdates,
+ enableLocalTabs = true,
+} = {}) {
+ if (!enableWorkerUpdates) {
+ silenceWorkerUpdates();
+ }
+
+ // This preference changes value depending on the build type, tests need to use a
+ // consistent value regarless of the build used.
+ await pushPref(
+ "devtools.aboutdebugging.local-tab-debugging",
+ enableLocalTabs
+ );
+
+ info("opening about:debugging");
+
+ const tab = await addTab("about:debugging");
+ const browser = tab.linkedBrowser;
+ const document = browser.contentDocument;
+ const window = browser.contentWindow;
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+
+ return { tab, document, window };
+}
+
+async function openAboutDevtoolsToolbox(
+ doc,
+ tab,
+ win,
+ targetText = "about:debugging",
+ shouldWaitToolboxReady = true
+) {
+ info("Open about:devtools-toolbox page");
+
+ info("Wait for the target to appear: " + targetText);
+ await waitUntil(() => findDebugTargetByText(targetText, doc));
+
+ const target = findDebugTargetByText(targetText, doc);
+ ok(target, `${targetText} target appeared`);
+
+ const {
+ DEBUG_TARGETS,
+ } = require("resource://devtools/client/aboutdebugging/src/constants.js");
+ const isWebExtension = target.dataset.qaTargetType == DEBUG_TARGETS.EXTENSION;
+
+ const inspectButton = target.querySelector(".qa-debug-target-inspect-button");
+ ok(inspectButton, `Inspect button for ${targetText} appeared`);
+ inspectButton.click();
+ const onToolboxReady = gDevTools.once("toolbox-ready");
+ await Promise.all([
+ waitForAboutDebuggingRequests(win.AboutDebugging.store),
+ shouldWaitToolboxReady ? onToolboxReady : Promise.resolve(),
+ ]);
+
+ // WebExtension open a toolbox in a dedicated window
+ if (isWebExtension) {
+ const toolbox = await onToolboxReady;
+ // For some reason the test helpers prevents the toolbox from being automatically focused on opening,
+ // whereas it is IRL.
+ const focusedWin = Services.focus.focusedWindow;
+ if (focusedWin?.top != toolbox.win) {
+ info("Wait for the toolbox window to be focused");
+ await new Promise(r => {
+ // focus event only fired on the chrome event handler and in capture phase
+ toolbox.win.docShell.chromeEventHandler.addEventListener("focus", r, {
+ once: true,
+ capture: true,
+ });
+ toolbox.win.focus();
+ });
+ info("The toolbox is focused");
+ }
+ return {
+ devtoolsBrowser: null,
+ devtoolsDocument: toolbox.doc,
+ devtoolsTab: null,
+ devtoolsWindow: toolbox.win,
+ };
+ }
+
+ await waitUntil(() => tab.nextElementSibling);
+
+ info("Wait for about:devtools-toolbox tab will be selected");
+ const devtoolsTab = tab.nextElementSibling;
+ await waitUntil(() => gBrowser.selectedTab === devtoolsTab);
+ const devtoolsBrowser = gBrowser.selectedBrowser;
+ await waitUntil(() =>
+ devtoolsBrowser.contentWindow.location.href.startsWith(
+ "about:devtools-toolbox?"
+ )
+ );
+
+ if (!shouldWaitToolboxReady) {
+ // Wait for show error page.
+ await waitUntil(() =>
+ devtoolsBrowser.contentDocument.querySelector(".qa-error-page")
+ );
+ }
+
+ return {
+ devtoolsBrowser,
+ devtoolsDocument: devtoolsBrowser.contentDocument,
+ devtoolsTab,
+ devtoolsWindow: devtoolsBrowser.contentWindow,
+ };
+}
+
+async function closeAboutDevtoolsToolbox(
+ aboutDebuggingDocument,
+ devtoolsTab,
+ win
+) {
+ // Wait for all requests to settle on the opened about:devtools toolbox.
+ const devtoolsBrowser = devtoolsTab.linkedBrowser;
+ const devtoolsWindow = devtoolsBrowser.contentWindow;
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.commands.client.waitForRequestsToSettle();
+
+ info("Close about:devtools-toolbox page");
+ const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
+
+ info("Wait for removeTab");
+ await removeTab(devtoolsTab);
+
+ info("Wait for toolbox destroyed");
+ await onToolboxDestroyed;
+
+ // Changing the tab will also trigger a request to list tabs, so wait until the selected
+ // tab has changed to wait for requests to settle.
+ info("Wait until aboutdebugging is selected");
+ await waitUntil(() => gBrowser.selectedTab !== devtoolsTab);
+
+ // Wait for removing about:devtools-toolbox tab info from about:debugging.
+ info("Wait until about:devtools-toolbox is removed from debug targets");
+ await waitUntil(
+ () => !findDebugTargetByText("Toolbox - ", aboutDebuggingDocument)
+ );
+
+ await waitForAboutDebuggingRequests(win.AboutDebugging.store);
+}
+
+async function closeWebExtAboutDevtoolsToolbox(devtoolsWindow, win) {
+ // Wait for all requests to settle on the opened about:devtools toolbox.
+ const toolbox = getToolbox(devtoolsWindow);
+ await toolbox.commands.client.waitForRequestsToSettle();
+
+ info("Close the toolbox and wait for its destruction");
+ await toolbox.destroy();
+
+ await waitForAboutDebuggingRequests(win.AboutDebugging.store);
+}
+
+async function reloadAboutDebugging(tab) {
+ info("reload about:debugging");
+
+ await reloadBrowser(tab.linkedBrowser);
+ const browser = tab.linkedBrowser;
+ const document = browser.contentDocument;
+ const window = browser.contentWindow;
+ info("wait for the initial about:debugging requests to settle");
+ await waitForAboutDebuggingRequests(window.AboutDebugging.store);
+
+ return document;
+}
+
+// Wait for all about:debugging target request actions to succeed.
+// They will typically be triggered after watching a new runtime or loading
+// about:debugging.
+function waitForRequestsSuccess(store) {
+ return Promise.all([
+ waitForDispatch(store, "REQUEST_EXTENSIONS_SUCCESS"),
+ waitForDispatch(store, "REQUEST_TABS_SUCCESS"),
+ waitForDispatch(store, "REQUEST_WORKERS_SUCCESS"),
+ ]);
+}
+
+/**
+ * Wait for all aboutdebugging REQUEST_*_SUCCESS actions to settle, meaning here
+ * that no new request has been dispatched after the provided delay.
+ */
+async function waitForAboutDebuggingRequests(store, delay = 500) {
+ let hasSettled = false;
+
+ // After each iteration of this while loop, we check is the timerPromise had the time
+ // to resolve or if we captured a REQUEST_*_SUCCESS action before.
+ while (!hasSettled) {
+ let timer;
+
+ // This timer will be executed only if no REQUEST_*_SUCCESS action is dispatched
+ // during the delay. We consider that when no request are received for some time, it
+ // means there are no ongoing requests anymore.
+ const timerPromise = new Promise(resolve => {
+ timer = setTimeout(() => {
+ hasSettled = true;
+ resolve();
+ }, delay);
+ });
+
+ // Wait either for a REQUEST_*_SUCCESS to be dispatched, or for the timer to resolve.
+ await Promise.race([
+ waitForDispatch(store, "REQUEST_EXTENSIONS_SUCCESS"),
+ waitForDispatch(store, "REQUEST_TABS_SUCCESS"),
+ waitForDispatch(store, "REQUEST_WORKERS_SUCCESS"),
+ timerPromise,
+ ]);
+
+ // Clear the timer to avoid setting hasSettled to true accidently unless timerPromise
+ // was the first to resolve.
+ clearTimeout(timer);
+ }
+}
+
+/**
+ * Navigate to "This Firefox"
+ */
+async function selectThisFirefoxPage(doc, store) {
+ info("Select This Firefox page");
+
+ const onRequestSuccess = waitForRequestsSuccess(store);
+ doc.location.hash = "#/runtime/this-firefox";
+ info("Wait for requests to be complete");
+ await onRequestSuccess;
+
+ info("Wait for runtime page to be rendered");
+ await waitUntil(() => doc.querySelector(".qa-runtime-page"));
+
+ // Navigating to this-firefox will trigger a title change for the
+ // about:debugging tab. This title change _might_ trigger a tablist update.
+ // If it does, we should make sure to wait for pending tab requests.
+ await waitForAboutDebuggingRequests(store);
+}
+
+/**
+ * Navigate to the Connect page. Resolves when the Connect page is rendered.
+ */
+async function selectConnectPage(doc) {
+ const sidebarItems = doc.querySelectorAll(".qa-sidebar-item");
+ const connectSidebarItem = [...sidebarItems].find(element => {
+ return element.textContent === "Setup";
+ });
+ ok(connectSidebarItem, "Sidebar contains a Connect item");
+ const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link");
+ ok(connectLink, "Sidebar contains a Connect link");
+
+ info("Click on the Connect link in the sidebar");
+ connectLink.click();
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => doc.querySelector(".qa-connect-page"));
+}
+
+function getDebugTargetPane(title, document) {
+ // removes the suffix "(<NUMBER>)" in debug target pane's title, if needed
+ const sanitizeTitle = x => {
+ return x.replace(/\s+\(\d+\)$/, "");
+ };
+
+ const targetTitle = sanitizeTitle(title);
+ for (const titleEl of document.querySelectorAll(
+ ".qa-debug-target-pane-title"
+ )) {
+ if (sanitizeTitle(titleEl.textContent) !== targetTitle) {
+ continue;
+ }
+
+ return titleEl.closest(".qa-debug-target-pane");
+ }
+
+ return null;
+}
+
+function findDebugTargetByText(text, document) {
+ const targets = [...document.querySelectorAll(".qa-debug-target-item")];
+ return targets.find(target => target.textContent.includes(text));
+}
+
+function findSidebarItemByText(text, document) {
+ const sidebarItems = document.querySelectorAll(".qa-sidebar-item");
+ return [...sidebarItems].find(element => {
+ return element.textContent.includes(text);
+ });
+}
+
+function findSidebarItemLinkByText(text, document) {
+ const links = document.querySelectorAll(".qa-sidebar-link");
+ return [...links].find(element => {
+ return element.textContent.includes(text);
+ });
+}
+
+async function connectToRuntime(deviceName, document) {
+ info(`Wait until the sidebar item for ${deviceName} appears`);
+ await waitUntil(() => findSidebarItemByText(deviceName, document));
+ const sidebarItem = findSidebarItemByText(deviceName, document);
+ const connectButton = sidebarItem.querySelector(".qa-connect-button");
+ ok(
+ connectButton,
+ `Connect button is displayed for the runtime ${deviceName}`
+ );
+
+ info("Click on the connect button and wait until it disappears");
+ connectButton.click();
+ await waitUntil(() => !sidebarItem.querySelector(".qa-connect-button"));
+}
+
+async function selectRuntime(deviceName, name, document) {
+ const sidebarItem = findSidebarItemByText(deviceName, document);
+ const store = document.defaultView.AboutDebugging.store;
+ const onSelectPageSuccess = waitForDispatch(store, "SELECT_PAGE_SUCCESS");
+
+ sidebarItem.querySelector(".qa-sidebar-link").click();
+
+ await waitUntil(() => {
+ const runtimeInfo = document.querySelector(".qa-runtime-name");
+ return runtimeInfo && runtimeInfo.textContent.includes(name);
+ });
+
+ info("Wait for SELECT_PAGE_SUCCESS to be dispatched");
+ await onSelectPageSuccess;
+}
+
+function getToolbox(win) {
+ return gDevTools.getToolboxes().find(toolbox => toolbox.win === win);
+}
+
+/**
+ * Open the performance profiler dialog. Assumes the client is a mocked remote runtime
+ * client.
+ */
+async function openProfilerDialog(client, doc) {
+ const onProfilerLoaded = new Promise(r => {
+ client.loadPerformanceProfiler = r;
+ });
+
+ info("Click on the Profile Runtime button");
+ const profileButton = doc.querySelector(".qa-profile-runtime-button");
+ profileButton.click();
+
+ info(
+ "Wait for the loadPerformanceProfiler callback to be executed on client-wrapper"
+ );
+ return onProfilerLoaded;
+}
+
+/**
+ * The "This Firefox" string depends on the brandShortName, which will be different
+ * depending on the channel where tests are running.
+ */
+function getThisFirefoxString(aboutDebuggingWindow) {
+ const loader = aboutDebuggingWindow.getBrowserLoaderForWindow();
+ const { l10n } = loader.require(
+ "resource://devtools/client/aboutdebugging/src/modules/l10n.js"
+ );
+ return l10n.getString("about-debugging-this-firefox-runtime-name");
+}
+
+function waitUntilUsbDeviceIsUnplugged(deviceName, aboutDebuggingDocument) {
+ info("Wait until the USB sidebar item appears as unplugged");
+ return waitUntil(() => {
+ const sidebarItem = findSidebarItemByText(
+ deviceName,
+ aboutDebuggingDocument
+ );
+ return !!sidebarItem.querySelector(".qa-runtime-item-unplugged");
+ });
+}
+
+/**
+ * Changing the selected tab in the current browser will trigger a tablist
+ * update.
+ * If the currently selected page is "this-firefox", we should wait for the
+ * the corresponding REQUEST_TABS_SUCCESS that will be triggered by the change.
+ *
+ * @param {Browser} browser
+ * The browser instance to update.
+ * @param {XULTab} tab
+ * The tab to select.
+ * @param {Object} store
+ * The about:debugging redux store.
+ */
+async function updateSelectedTab(browser, tab, store) {
+ info("Update the selected tab");
+
+ const { runtimes, ui } = store.getState();
+ const isOnThisFirefox =
+ runtimes.selectedRuntimeId === "this-firefox" &&
+ ui.selectedPage === "runtime";
+
+ // A tabs request will only be issued if we are on this-firefox.
+ const onTabsSuccess = isOnThisFirefox
+ ? waitForDispatch(store, "REQUEST_TABS_SUCCESS")
+ : null;
+
+ // Update the selected tab.
+ browser.selectedTab = tab;
+
+ if (onTabsSuccess) {
+ info("Wait for the tablist update after updating the selected tab");
+ await onTabsSuccess;
+ }
+}
+
+/**
+ * Synthesizes key input inside the DebugTargetInfo's URL component.
+ *
+ * @param {DevToolsToolbox} toolbox
+ * The DevToolsToolbox debugging the target.
+ * @param {HTMLElement} inputEl
+ * The <input> element to submit the URL with.
+ * @param {String} url
+ * The URL to navigate to.
+ */
+async function synthesizeUrlKeyInput(toolbox, inputEl, url) {
+ const { devtoolsDocument, devtoolsWindow } = toolbox;
+ info("Wait for URL input to be focused.");
+ const onInputFocused = waitUntil(
+ () => devtoolsDocument.activeElement === inputEl
+ );
+ inputEl.focus();
+ await onInputFocused;
+
+ info("Synthesize entering URL into text field");
+ const onInputChange = waitUntil(() => inputEl.value === url);
+ for (const key of url.split("")) {
+ EventUtils.synthesizeKey(key, {}, devtoolsWindow);
+ }
+ await onInputChange;
+
+ info("Submit URL to navigate to");
+ EventUtils.synthesizeKey("KEY_Enter");
+}
+
+/**
+ * Click on a given add-on widget button so that its browser actor is fired.
+ * Typically a popup would open, or a listener would be called in the background page.
+ *
+ * @param {String} addonId
+ * The ID of the add-on to click on.
+ */
+function clickOnAddonWidget(addonId) {
+ // Devtools are in another window and may have the focus.
+ // Ensure focusing the browser window when clicking on the widget.
+ const focusedWin = Services.focus.focusedWindow;
+ if (focusedWin != window) {
+ window.focus();
+ }
+ // Find the browserAction button that will show the webextension popup.
+ const widgetId = addonId.toLowerCase().replace(/[^a-z0-9_-]/g, "_");
+ const browserActionId = widgetId + "-browser-action";
+ const browserActionEl = window.document.getElementById(browserActionId);
+ ok(browserActionEl, "Got the browserAction button from the browser UI");
+
+ info("Show the web extension popup");
+ browserActionEl.firstElementChild.click();
+}
diff --git a/devtools/client/aboutdebugging/test/browser/helper-adb.js b/devtools/client/aboutdebugging/test/browser/helper-adb.js
new file mode 100644
index 0000000000..f5e6adfc6b
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-adb.js
@@ -0,0 +1,59 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from head.js */
+
+async function checkAdbNotRunning() {
+ info("Check if ADB is already running before the test starts");
+ const {
+ check,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-running-checker.js");
+ const isAdbAlreadyRunning = await check();
+ if (isAdbAlreadyRunning) {
+ throw new Error(
+ "The ADB process is already running on this machine, it should be " +
+ "stopped before running this test"
+ );
+ }
+}
+/* exported checkAdbNotRunning */
+
+// Returns a promise that resolves when the adb process exists and is running.
+async function waitForAdbStart() {
+ info("Wait for ADB to start");
+ const {
+ adbProcess,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-process.js");
+ const {
+ check,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-running-checker.js");
+ return asyncWaitUntil(async () => {
+ const isProcessReady = adbProcess.ready;
+ const isRunning = await check();
+ return isProcessReady && isRunning;
+ });
+}
+/* exported waitForAdbStart */
+
+// Attempt to stop ADB. Will only work if ADB was started by the current Firefox instance.
+// Returns a promise that resolves when the adb process is no longer running.
+async function stopAdbProcess() {
+ info("Attempt to stop ADB");
+ const {
+ adbProcess,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-process.js");
+ await adbProcess.stop();
+
+ info("Wait for ADB to stop");
+ const {
+ check,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-running-checker.js");
+ return asyncWaitUntil(async () => {
+ const isProcessReady = adbProcess.ready;
+ const isRunning = await check();
+ return !isProcessReady && !isRunning;
+ });
+}
+/* exported stopAdbProcess */
diff --git a/devtools/client/aboutdebugging/test/browser/helper-addons.js b/devtools/client/aboutdebugging/test/browser/helper-addons.js
new file mode 100644
index 0000000000..e3a8be3761
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-addons.js
@@ -0,0 +1,262 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from head.js */
+
+function _getSupportsFile(path) {
+ const cr = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
+ Ci.nsIChromeRegistry
+ );
+ const uri = Services.io.newURI(CHROME_URL_ROOT + path);
+ const fileurl = cr.convertChromeURL(uri);
+ return fileurl.QueryInterface(Ci.nsIFileURL);
+}
+
+async function enableExtensionDebugging() {
+ // Disable security prompt
+ await pushPref("devtools.debugger.prompt-connection", false);
+}
+/* exported enableExtensionDebugging */
+
+/**
+ * Install an extension using the AddonManager so it does not show up as temporary.
+ */
+async function installRegularExtension(pathOrFile) {
+ const isFile = typeof pathOrFile.isFile === "function" && pathOrFile.isFile();
+ const file = isFile ? pathOrFile : _getSupportsFile(pathOrFile).file;
+ const install = await AddonManager.getInstallForFile(file);
+ return new Promise((resolve, reject) => {
+ if (!install) {
+ throw new Error(`An install was not created for ${file.path}`);
+ }
+ install.addListener({
+ onDownloadFailed: reject,
+ onDownloadCancelled: reject,
+ onInstallFailed: reject,
+ onInstallCancelled: reject,
+ onInstallEnded: resolve,
+ });
+ install.install();
+ });
+}
+/* exported installRegularExtension */
+
+/**
+ * Install a temporary extension at the provided path, with the provided name.
+ * Will use a mock file picker to select the file.
+ */
+async function installTemporaryExtension(pathOrFile, name, document) {
+ const { Management } = ChromeUtils.importESModule(
+ "resource://gre/modules/Extension.sys.mjs"
+ );
+
+ info("Install temporary extension named " + name);
+ // Mock the file picker to select a test addon
+ prepareMockFilePicker(pathOrFile);
+
+ const onAddonInstalled = new Promise(done => {
+ Management.on("startup", function listener(event, extension) {
+ if (extension.name != name) {
+ return;
+ }
+
+ Management.off("startup", listener);
+ done(extension);
+ });
+ });
+
+ // Trigger the file picker by clicking on the button
+ document.querySelector(".qa-temporary-extension-install-button").click();
+
+ info("Wait for addon to be installed");
+ return onAddonInstalled;
+}
+/* exported installTemporaryExtension */
+
+function createTemporaryXPI(xpiData) {
+ const { ExtensionTestCommon } = ChromeUtils.importESModule(
+ "resource://testing-common/ExtensionTestCommon.sys.mjs"
+ );
+
+ const { background, files, id, name, extraProperties } = xpiData;
+ info("Generate XPI file for " + id);
+
+ const manifest = Object.assign(
+ {},
+ {
+ browser_specific_settings: { gecko: { id } },
+ manifest_version: 2,
+ name,
+ version: "1.0",
+ },
+ extraProperties
+ );
+
+ const xpiFile = ExtensionTestCommon.generateXPI({
+ background,
+ files,
+ manifest,
+ });
+ registerCleanupFunction(() => xpiFile.exists() && xpiFile.remove(false));
+ return xpiFile;
+}
+/* exported createTemporaryXPI */
+
+/**
+ * Remove the existing temporary XPI file generated by ExtensionTestCommon and create a
+ * new one at the same location.
+ * @return {File} the temporary extension XPI file created
+ */
+function updateTemporaryXPI(xpiData, existingXPI) {
+ info("Delete and regenerate XPI for " + xpiData.id);
+
+ // Store the current name to check the xpi is correctly replaced.
+ const existingName = existingXPI.leafName;
+ info("Delete existing XPI named: " + existingName);
+ existingXPI.exists() && existingXPI.remove(false);
+
+ const xpiFile = createTemporaryXPI(xpiData);
+ // Check that the name of the new file is correct
+ if (xpiFile.leafName !== existingName) {
+ throw new Error(
+ "New XPI created with unexpected name: " + xpiFile.leafName
+ );
+ }
+ return xpiFile;
+}
+/* exported updateTemporaryXPI */
+
+/**
+ * Install a fake temporary extension by creating a temporary in-memory XPI file.
+ * @return {File} the temporary extension XPI file created
+ */
+async function installTemporaryExtensionFromXPI(xpiData, document) {
+ const xpiFile = createTemporaryXPI(xpiData);
+ const extension = await installTemporaryExtension(
+ xpiFile,
+ xpiData.name,
+ document
+ );
+
+ info("Wait until the addon debug target appears");
+ await waitUntil(() => findDebugTargetByText(xpiData.name, document));
+ return { extension, xpiFile };
+}
+/* exported installTemporaryExtensionFromXPI */
+
+async function removeTemporaryExtension(name, document) {
+ info(`Wait for removable extension with name: '${name}'`);
+ const buttonName = ".qa-temporary-extension-remove-button";
+ await waitUntil(() => {
+ const extension = findDebugTargetByText(name, document);
+ return extension && extension.querySelector(buttonName);
+ });
+ info(`Remove the temporary extension with name: '${name}'`);
+ const temporaryExtensionItem = findDebugTargetByText(name, document);
+ temporaryExtensionItem.querySelector(buttonName).click();
+
+ info("Wait until the debug target item disappears");
+ await waitUntil(() => !findDebugTargetByText(name, document));
+}
+/* exported removeTemporaryExtension */
+
+async function removeExtension(id, name, document) {
+ info(
+ "Retrieve the extension instance from the addon manager, and uninstall it"
+ );
+ const extension = await AddonManager.getAddonByID(id);
+ extension.uninstall();
+
+ info("Wait until the addon disappears from about:debugging");
+ await waitUntil(() => !findDebugTargetByText(name, document));
+}
+/* exported removeExtension */
+
+function prepareMockFilePicker(pathOrFile) {
+ const isFile = typeof pathOrFile.isFile === "function" && pathOrFile.isFile();
+ const file = isFile ? pathOrFile : _getSupportsFile(pathOrFile).file;
+
+ // Mock the file picker to select a test addon
+ const MockFilePicker = SpecialPowers.MockFilePicker;
+ MockFilePicker.init(window);
+ MockFilePicker.setFiles([file]);
+}
+/* exported prepareMockFilePicker */
+
+function promiseBackgroundContextEvent(extensionId, eventName) {
+ const { Management } = ChromeUtils.importESModule(
+ "resource://gre/modules/Extension.sys.mjs"
+ );
+
+ return new Promise(resolve => {
+ Management.on(eventName, function listener(_evtName, context) {
+ if (context.extension.id === extensionId) {
+ Management.off(eventName, listener);
+ resolve();
+ }
+ });
+ });
+}
+
+function promiseBackgroundContextLoaded(extensionId) {
+ return promiseBackgroundContextEvent(extensionId, "proxy-context-load");
+}
+/* exported promiseBackgroundContextLoaded */
+
+function promiseBackgroundContextUnloaded(extensionId) {
+ return promiseBackgroundContextEvent(extensionId, "proxy-context-unload");
+}
+/* exported promiseBackgroundContextUnloaded */
+
+async function assertBackgroundStatus(
+ extName,
+ { document, expectedStatus, targetElement }
+) {
+ const target = targetElement || findDebugTargetByText(extName, document);
+ const getBackgroundStatusElement = () =>
+ target.querySelector(".extension-backgroundscript__status");
+ await waitFor(
+ () =>
+ getBackgroundStatusElement()?.classList.contains(
+ `extension-backgroundscript__status--${expectedStatus}`
+ ),
+ `Wait ${extName} Background script status "${expectedStatus}" to be rendered`
+ );
+}
+/* exported assertBackgroundStatus */
+
+function getExtensionInstance(extensionId) {
+ const policy = WebExtensionPolicy.getByID(extensionId);
+ ok(policy, `Got a WebExtensionPolicy instance for ${extensionId}`);
+ ok(policy.extension, `Got an Extension class instance for ${extensionId}`);
+ return policy.extension;
+}
+/* exported getExtensionInstance */
+
+async function triggerExtensionEventPageIdleTimeout(extensionId) {
+ await getExtensionInstance(extensionId).terminateBackground();
+}
+/* exported triggerExtensionEventPageIdleTimeout */
+
+async function wakeupExtensionEventPage(extensionId) {
+ await getExtensionInstance(extensionId).wakeupBackground();
+}
+/* exported wakeupExtensionEventPage */
+
+function promiseTerminateBackgroundScriptIgnored(extensionId) {
+ const extension = getExtensionInstance(extensionId);
+ return new Promise(resolve => {
+ extension.once("background-script-suspend-ignored", resolve);
+ });
+}
+/* exported promiseTerminateBackgroundScriptIgnored */
+
+async function promiseBackgroundStatusUpdate(window) {
+ waitForDispatch(
+ window.AboutDebugging.store,
+ "EXTENSION_BGSCRIPT_STATUS_UPDATED"
+ );
+}
+/* exported promiseBackgroundStatusUpdate */
diff --git a/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js b/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js
new file mode 100644
index 0000000000..0f0d28da1d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TARGET_PANES = [
+ {
+ title: "Temporary Extensions",
+ pref: "devtools.aboutdebugging.collapsibilities.temporaryExtension",
+ },
+ {
+ title: "Extensions",
+ pref: "devtools.aboutdebugging.collapsibilities.installedExtension",
+ },
+ {
+ title: "Tabs",
+ pref: "devtools.aboutdebugging.collapsibilities.tab",
+ },
+ {
+ title: "Service Workers",
+ pref: "devtools.aboutdebugging.collapsibilities.serviceWorker",
+ },
+ {
+ title: "Shared Workers",
+ pref: "devtools.aboutdebugging.collapsibilities.sharedWorker",
+ },
+ {
+ title: "Other Workers",
+ pref: "devtools.aboutdebugging.collapsibilities.otherWorker",
+ },
+];
+/* exported TARGET_PANES */
+
+function prepareCollapsibilitiesTest() {
+ // Make all collapsibilities to be expanded.
+ for (const { pref } of TARGET_PANES) {
+ Services.prefs.setBoolPref(pref, false);
+ }
+}
+/* exported prepareCollapsibilitiesTest */
+
+async function toggleCollapsibility(debugTargetPane) {
+ debugTargetPane.querySelector(".qa-debug-target-pane-title").click();
+ // Wait for animation of collapse/expand.
+ const animations = debugTargetPane.ownerDocument.getAnimations();
+ await Promise.all(animations.map(animation => animation.finished));
+}
+/* exported toggleCollapsibility */
+
+registerCleanupFunction(() => {
+ for (const { pref } of TARGET_PANES) {
+ Services.prefs.clearUserPref(pref);
+ }
+});
diff --git a/devtools/client/aboutdebugging/test/browser/helper-mocks.js b/devtools/client/aboutdebugging/test/browser/helper-mocks.js
new file mode 100644
index 0000000000..76fc414ae8
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-mocks.js
@@ -0,0 +1,262 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from ../../../shared/test/shared-head.js */
+
+const MOCKS_ROOT = CHROME_URL_ROOT + "mocks/";
+/* import-globals-from mocks/helper-adb-mock.js */
+Services.scriptloader.loadSubScript(MOCKS_ROOT + "helper-adb-mock.js", this);
+/* import-globals-from mocks/helper-client-wrapper-mock.js */
+Services.scriptloader.loadSubScript(
+ MOCKS_ROOT + "helper-client-wrapper-mock.js",
+ this
+);
+/* import-globals-from mocks/helper-runtime-client-factory-mock.js */
+Services.scriptloader.loadSubScript(
+ MOCKS_ROOT + "helper-runtime-client-factory-mock.js",
+ this
+);
+
+const {
+ RUNTIMES,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+/**
+ * This wrapper around the mocks used in about:debugging tests provides helpers to
+ * quickly setup mocks for runtime tests involving USB, network or wifi runtimes that can
+ * are difficult to setup in a test environment.
+ */
+class Mocks {
+ constructor() {
+ // Setup the adb mock to rely on internal arrays.
+ this.adbMock = createAdbMock();
+ this.adbProcessMock = createAdbProcessMock();
+ this._usbRuntimes = [];
+ this._usbDevices = [];
+ this.adbMock.adb.getRuntimes = () => {
+ return this._usbRuntimes;
+ };
+ this.adbMock.adb.getDevices = () => {
+ const runtimeDevices = this._usbRuntimes.map(r => {
+ return { id: r.deviceId, name: r.deviceName };
+ });
+ return runtimeDevices.concat(this._usbDevices);
+ };
+
+ // adb.updateRuntimes should ultimately fire the "runtime-list-updated" event.
+ this.adbMock.adb.updateRuntimes = () => {
+ this.emitUSBUpdate();
+ };
+
+ this.adbMock.adb.isProcessStarted = () => true;
+
+ // Prepare a fake observer to be able to emit events from this mock.
+ this._observerMock = addObserverMock(this.adbMock.adb);
+
+ // Setup the runtime-client-factory mock to rely on the internal _clients map.
+ this.runtimeClientFactoryMock = createRuntimeClientFactoryMock();
+ this._clients = {
+ [RUNTIMES.NETWORK]: {},
+ [RUNTIMES.THIS_FIREFOX]: {},
+ [RUNTIMES.USB]: {},
+ };
+ this.runtimeClientFactoryMock.createClientForRuntime = runtime => {
+ return this._clients[runtime.type][runtime.id];
+ };
+
+ // Add a client for THIS_FIREFOX, since about:debugging will start on the This Firefox
+ // page.
+ this._thisFirefoxClient = createThisFirefoxClientMock();
+ this._clients[RUNTIMES.THIS_FIREFOX][RUNTIMES.THIS_FIREFOX] =
+ this._thisFirefoxClient;
+
+ // Enable mocks and remove them after the test.
+ this.enableMocks();
+ registerCleanupFunction(() => this.disableMocks());
+ }
+
+ get thisFirefoxClient() {
+ return this._thisFirefoxClient;
+ }
+
+ enableMocks() {
+ enableAdbMock(this.adbMock);
+ enableAdbProcessMock(this.adbProcessMock);
+ enableRuntimeClientFactoryMock(this.runtimeClientFactoryMock);
+ }
+
+ disableMocks() {
+ disableAdbMock();
+ disableAdbProcessMock();
+ disableRuntimeClientFactoryMock();
+
+ for (const host of Object.keys(this._clients[RUNTIMES.NETWORK])) {
+ this.removeNetworkRuntime(host);
+ }
+ }
+
+ createNetworkRuntime(host, runtimeInfo) {
+ const {
+ addNetworkLocation,
+ } = require("resource://devtools/client/aboutdebugging/src/modules/network-locations.js");
+ addNetworkLocation(host);
+
+ // Add a valid client that can be returned for this particular runtime id.
+ const mockNetworkClient = createClientMock();
+ mockNetworkClient.getDeviceDescription = () => {
+ return {
+ name: runtimeInfo.name || "TestBrand",
+ channel: runtimeInfo.channel || "release",
+ version: runtimeInfo.version || "1.0",
+ };
+ };
+ this._clients[RUNTIMES.NETWORK][host] = mockNetworkClient;
+
+ return mockNetworkClient;
+ }
+
+ removeNetworkRuntime(host) {
+ const {
+ removeNetworkLocation,
+ } = require("resource://devtools/client/aboutdebugging/src/modules/network-locations.js");
+ removeNetworkLocation(host);
+
+ delete this._clients[RUNTIMES.NETWORK][host];
+ }
+
+ emitUSBUpdate() {
+ this._observerMock.emit("runtime-list-updated");
+ }
+
+ /**
+ * Creates a USB runtime for which a client conenction can be established.
+ * @param {String} id
+ * The id of the runtime.
+ * @param {Object} optional object used to create the fake runtime & device
+ * - channel: {String} Release channel, for instance "release", "nightly"
+ * - clientWrapper: {ClientWrapper} optional ClientWrapper for this runtime
+ * - deviceId: {String} Device id
+ * - deviceName: {String} Device name
+ * - isFenix: {Boolean} set by ADB if the package name matches a Fenix package
+ * - name: {String} Application name, for instance "Firefox"
+ * - shortName: {String} Short name for the device
+ * - socketPath: {String} (should only be used for connecting, so not here)
+ * - version: {String} Version, for instance "63.0a"
+ * - versionName: {String} Version return by ADB "63.0a"
+ * @return {Object} Returns the mock client created for this runtime so that methods
+ * can be overridden on it.
+ */
+ createUSBRuntime(id, runtimeInfo = {}) {
+ // Add a new runtime to the list of scanned runtimes.
+ this._usbRuntimes.push({
+ deviceId: runtimeInfo.deviceId || "test device id",
+ deviceName: runtimeInfo.deviceName || "test device name",
+ id,
+ isFenix: runtimeInfo.isFenix,
+ shortName: runtimeInfo.shortName || "testshort",
+ socketPath: runtimeInfo.socketPath || "test/path",
+ versionName: runtimeInfo.versionName || "1.0",
+ });
+
+ // Add a valid client that can be returned for this particular runtime id.
+ let mockUsbClient = runtimeInfo.clientWrapper;
+ if (mockUsbClient) {
+ const originalGetDeviceDescription =
+ mockUsbClient.getDeviceDescription.bind(mockUsbClient);
+ mockUsbClient.getDeviceDescription = async () => {
+ const deviceDescription = await originalGetDeviceDescription();
+ return {
+ channel: runtimeInfo.channel || deviceDescription.channel,
+ name: runtimeInfo.name || deviceDescription.name,
+ version: runtimeInfo.version || deviceDescription.version,
+ };
+ };
+ } else {
+ // If no clientWrapper was provided, create a mock client here.
+ mockUsbClient = createClientMock();
+ mockUsbClient.getDeviceDescription = () => {
+ return {
+ channel: runtimeInfo.channel || "release",
+ name: runtimeInfo.name || "TestBrand",
+ version: runtimeInfo.version || "1.0",
+ };
+ };
+ }
+
+ this._clients[RUNTIMES.USB][id] = mockUsbClient;
+
+ return mockUsbClient;
+ }
+
+ removeUSBRuntime(id) {
+ this._usbRuntimes = this._usbRuntimes.filter(runtime => runtime.id !== id);
+ delete this._clients[RUNTIMES.USB][id];
+ }
+
+ addDevice(deviceId, deviceName) {
+ this._usbDevices.push({
+ id: deviceId,
+ name: deviceName,
+ });
+ }
+
+ removeDevice(deviceId) {
+ this._usbDevices = this._usbDevices.filter(d => {
+ return d.id !== deviceId;
+ });
+ }
+
+ removeRuntime(id) {
+ if (this._clients[RUNTIMES.USB][id]) {
+ this.removeUSBRuntime(id);
+ } else if (this._clients[RUNTIMES.NETWORK][id]) {
+ this.removeNetworkRuntime(id);
+ }
+ }
+}
+/* exported Mocks */
+
+const silenceWorkerUpdates = function () {
+ const {
+ removeMockedModule,
+ setMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+
+ const mock = {
+ WorkersListener: () => {
+ return {
+ addListener: () => {},
+ removeListener: () => {},
+ };
+ },
+ };
+ setMockedModule(mock, "devtools/client/shared/workers-listener");
+
+ registerCleanupFunction(() => {
+ removeMockedModule("devtools/client/shared/workers-listener");
+ });
+};
+/* exported silenceWorkerUpdates */
+
+async function createLocalClientWrapper() {
+ info("Create a local DevToolsClient");
+ const {
+ DevToolsServer,
+ } = require("resource://devtools/server/devtools-server.js");
+ const {
+ DevToolsClient,
+ } = require("resource://devtools/client/devtools-client.js");
+ const {
+ ClientWrapper,
+ } = require("resource://devtools/client/aboutdebugging/src/modules/client-wrapper.js");
+
+ DevToolsServer.init();
+ DevToolsServer.registerAllActors();
+ const client = new DevToolsClient(DevToolsServer.connectPipe());
+
+ await client.connect();
+ return new ClientWrapper(client);
+}
+/* exported createLocalClientWrapper */
diff --git a/devtools/client/aboutdebugging/test/browser/helper-real-usb.js b/devtools/client/aboutdebugging/test/browser/helper-real-usb.js
new file mode 100644
index 0000000000..dd6c8c263d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-real-usb.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from helper-adb.js */
+Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
+
+async function getExpectedRuntime() {
+ const runtimes = await getExpectedRuntimeAll();
+ return runtimes[0];
+}
+/* exported getExpectedRuntime */
+
+async function getExpectedRuntimeAll() {
+ const runtimesPath = _getExpectedRuntimesPath();
+ const currentPath = Services.env.get("PWD");
+ const path = `${currentPath}/${runtimesPath}`;
+ info(`Load ${path}`);
+ const buffer = await IOUtils.read(path);
+ const data = new TextDecoder().decode(buffer);
+ return JSON.parse(data);
+}
+/* exported getExpectedRuntimeAll */
+
+function isAvailable() {
+ return !!_getExpectedRuntimesPath();
+}
+/* exported isAvailable */
+
+async function openAboutDebuggingWithADB() {
+ const { document, tab, window } = await openAboutDebugging();
+
+ await pushPref(
+ "devtools.remote.adb.extensionURL",
+ CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi"
+ );
+ await checkAdbNotRunning();
+
+ const {
+ adbAddon,
+ } = require("resource://devtools/client/shared/remote-debugging/adb/adb-addon.js");
+ adbAddon.install("internal");
+ const usbStatusElement = document.querySelector(".qa-sidebar-usb-status");
+ await waitUntil(() => usbStatusElement.textContent.includes("USB enabled"));
+ await waitForAdbStart();
+
+ return { document, tab, window };
+}
+/* exported openAboutDebuggingWithADB */
+
+function _getExpectedRuntimesPath() {
+ return Services.env.get("USB_RUNTIMES");
+}
diff --git a/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js b/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js
new file mode 100644
index 0000000000..e57b62b7eb
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js
@@ -0,0 +1,111 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from head.js */
+
+/**
+ * Temporarily flip all the preferences necessary for service worker testing.
+ */
+async function enableServiceWorkerDebugging() {
+ // Enable service workers.
+ await pushPref("dom.serviceWorkers.enabled", true);
+
+ // Accept workers from mochitest's http (normally only available in https).
+ await pushPref("dom.serviceWorkers.testing.enabled", true);
+
+ // Force single content process. Necessary until sw e10s refactor is done (Bug 1231208).
+ await pushPref("dom.ipc.processCount", 1);
+ Services.ppmm.releaseCachedProcesses();
+}
+/* exported enableServiceWorkerDebugging */
+
+/**
+ * Helper to listen once on a message sent using postMessage from the provided tab.
+ *
+ * @param {Tab} tab
+ * The tab on which the message will be received.
+ * @param {String} message
+ * The name of the expected message.
+ */
+function onServiceWorkerMessage(tab, message) {
+ info("Make the test page notify us when the service worker sends a message.");
+ return SpecialPowers.spawn(
+ tab.linkedBrowser,
+ [message],
+ function (messageChild) {
+ return new Promise(resolve => {
+ const win = content.wrappedJSObject;
+ win.navigator.serviceWorker.addEventListener(
+ "message",
+ function (event) {
+ if (event.data == messageChild) {
+ resolve();
+ }
+ }
+ );
+ });
+ }
+ );
+}
+/* exported onServiceWorkerMessage */
+
+async function _waitForServiceWorkerStatus(workerText, status, document) {
+ await waitUntil(() => {
+ const target = findDebugTargetByText(workerText, document);
+ const statusElement = target && target.querySelector(".qa-worker-status");
+ return statusElement && statusElement.textContent === status;
+ });
+
+ return findDebugTargetByText(workerText, document);
+}
+/* exported waitForServiceWorkerRunning */
+
+async function waitForServiceWorkerStopped(workerText, document) {
+ return _waitForServiceWorkerStatus(workerText, "Stopped", document);
+}
+/* exported waitForServiceWorkerStopped */
+
+async function waitForServiceWorkerRunning(workerText, document) {
+ return _waitForServiceWorkerStatus(workerText, "Running", document);
+}
+/* exported waitForServiceWorkerRunning */
+
+async function waitForServiceWorkerRegistering(workerText, document) {
+ return _waitForServiceWorkerStatus(workerText, "Registering", document);
+}
+/* exported waitForServiceWorkerRegistering */
+
+async function waitForRegistration(tab) {
+ info("Wait until the registration appears on the window");
+ const swBrowser = tab.linkedBrowser;
+ await asyncWaitUntil(async () =>
+ SpecialPowers.spawn(swBrowser, [], async function () {
+ return !!(await content.wrappedJSObject.getRegistration());
+ })
+ );
+}
+/* exported waitForRegistration */
+
+/**
+ * Unregister the service worker from the content page. The content page should define
+ * `getRegistration` to allow this helper to retrieve the service worker registration that
+ * should be unregistered.
+ *
+ * @param {Tab} tab
+ * The tab on which the service worker should be removed.
+ */
+async function unregisterServiceWorker(tab) {
+ return SpecialPowers.spawn(tab.linkedBrowser, [], function () {
+ const win = content.wrappedJSObject;
+ // Check that the content page defines getRegistration.
+ is(
+ typeof win.getRegistration,
+ "function",
+ "getRegistration is a valid function"
+ );
+ win.getRegistration().unregister();
+ });
+}
+/* exported unregisterServiceWorker */
diff --git a/devtools/client/aboutdebugging/test/browser/helper-telemetry.js b/devtools/client/aboutdebugging/test/browser/helper-telemetry.js
new file mode 100644
index 0000000000..228f01aff3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-telemetry.js
@@ -0,0 +1,115 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from head.js */
+
+/**
+ * Reset all telemetry events.
+ */
+function setupTelemetryTest() {
+ // Let's reset the counts.
+ Services.telemetry.clearEvents();
+
+ // Ensure no events have been logged
+ const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS;
+ const snapshot = Services.telemetry.snapshotEvents(ALL_CHANNELS, true);
+ ok(!snapshot.parent, "No events have been logged for the main process");
+}
+/* exported setupTelemetryTest */
+
+/**
+ * Check that the logged telemetry events exactly match the array of expected events.
+ * Will compare the number of events, the event methods, and the event extras including
+ * the about:debugging session id.
+ */
+function checkTelemetryEvents(expectedEvents, expectedSessionId) {
+ const evts = readAboutDebuggingEvents();
+ is(evts.length, expectedEvents.length, "Expected number of events");
+
+ function _eventHasExpectedExtras(e, expectedEvent) {
+ const expectedExtras = Object.keys(expectedEvent.extras);
+ return expectedExtras.every(extra => {
+ return e.extras[extra] === expectedEvent.extras[extra];
+ });
+ }
+
+ for (const expectedEvent of expectedEvents) {
+ const sameMethodEvents = evts.filter(
+ e => e.method === expectedEvent.method
+ );
+ ok(
+ !!sameMethodEvents.length,
+ "Found event for method: " + expectedEvent.method
+ );
+
+ const sameExtrasEvents = sameMethodEvents.filter(e =>
+ _eventHasExpectedExtras(e, expectedEvent)
+ );
+ ok(
+ sameExtrasEvents.length === 1,
+ "Found exactly one event matching the expected extras"
+ );
+ if (sameExtrasEvents.length === 0) {
+ info(JSON.stringify(sameMethodEvents));
+ }
+ is(
+ sameExtrasEvents[0].extras.session_id,
+ expectedSessionId,
+ "Select page event has the expected session"
+ );
+ }
+
+ return evts;
+}
+/* exported checkTelemetryEvents */
+
+/**
+ * Retrieve the session id from an "open" event.
+ * Note that calling this will "clear" all the events.
+ */
+function getOpenEventSessionId() {
+ const openEvents = readAboutDebuggingEvents().filter(
+ e => e.method === "open_adbg"
+ );
+ ok(!!openEvents[0], "Found an about:debugging open event");
+ return openEvents[0].extras.session_id;
+}
+/* exported getOpenEventSessionId */
+
+/**
+ * Read all the pending events that have "aboutdebugging" as their object property.
+ * WARNING: Calling this method also flushes/clears the events.
+ */
+function readAboutDebuggingEvents() {
+ const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS;
+ // Retrieve and clear telemetry events.
+ const snapshot = Services.telemetry.snapshotEvents(ALL_CHANNELS, true);
+ // about:debugging events are logged in the parent process
+ const parentEvents = snapshot.parent || [];
+
+ return parentEvents
+ .map(_toEventObject)
+ .filter(e => e.object === "aboutdebugging");
+}
+/* exported getLoggedEvents */
+
+/**
+ * The telemetry event data structure is simply an array. This helper remaps the array to
+ * an object with more user friendly properties.
+ */
+function _toEventObject(rawEvent) {
+ return {
+ // Category is typically devtools.main for us.
+ category: rawEvent[1],
+ // Method is the event's name (eg open, select_page etc...)
+ method: rawEvent[2],
+ // Object will usually be aboutdebugging for our tests
+ object: rawEvent[3],
+ // Value is usually empty for devtools events
+ value: rawEvent[4],
+ // Extras contain all the details of the event, including the session_id.
+ extras: rawEvent[5],
+ };
+}
diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js
new file mode 100644
index 0000000000..f02ca02ee3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js
@@ -0,0 +1,137 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Setup the loader to return the provided mock object instead of the regular adb module.
+ *
+ * @param {Object}
+ * mock should implement the following methods:
+ * - registerListener(listener)
+ * - getRuntimes()
+ * - getDevices()
+ * - updateRuntimes()
+ * - unregisterListener(listener)
+ */
+function enableAdbMock(mock) {
+ const {
+ setMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+ setMockedModule(mock, "devtools/client/shared/remote-debugging/adb/adb");
+}
+/* exported enableAdbMock */
+
+/**
+ * Update the loader to clear the mock entry for the adb module.
+ */
+function disableAdbMock() {
+ const {
+ removeMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+ removeMockedModule("devtools/client/shared/remote-debugging/adb/adb");
+}
+/* exported disableAdbMock */
+
+/**
+ * Creates a simple mock version for adb, implementing all the expected methods
+ * with empty placeholders.
+ */
+function createAdbMock() {
+ const adbMock = {};
+ adbMock.registerListener = function (listener) {
+ console.log("MOCKED METHOD registerListener");
+ };
+
+ adbMock.getRuntimes = function () {
+ console.log("MOCKED METHOD getRuntimes");
+ };
+
+ adbMock.getDevices = function () {
+ console.log("MOCKED METHOD getDevices");
+ };
+
+ adbMock.updateRuntimes = function () {
+ console.log("MOCKED METHOD updateRuntimes");
+ };
+
+ adbMock.unregisterListener = function (listener) {
+ console.log("MOCKED METHOD unregisterListener");
+ };
+
+ adbMock.once = function () {
+ console.log("MOCKED METHOD once");
+ };
+
+ adbMock.isProcessStarted = function () {
+ console.log("MOCKED METHOD isProcessStarted");
+ };
+
+ return { adb: adbMock };
+}
+/* exported createAdbMock */
+
+/**
+ * The adb module allows to observe runtime updates. To simulate this behaviour
+ * the easiest is to use an EventEmitter-decorated object that can accept listeners and
+ * can emit events from the test.
+ *
+ * This method will update the registerListener method of the provided
+ * usbRuntimesMock in order to add listeners to a mockObserver, and returns said observer
+ * so that the test can emit "runtime-list-updated" when needed.
+ */
+function addObserverMock(adbMock) {
+ const EventEmitter = require("resource://devtools/shared/event-emitter.js");
+
+ const observerMock = {};
+ EventEmitter.decorate(observerMock);
+ adbMock.registerListener = function (listener) {
+ console.log("MOCKED METHOD registerListener with mock scanner");
+ observerMock.on("runtime-list-updated", listener);
+ };
+
+ // NOTE FOR REVIEW: Instead of emitting "runtime-list-updated" events in the test,
+ // this mock could have a emitObservedEvent method, that would just emit the correct
+ // event. This way if the event name changes, everything remains contained in this
+ // method.
+
+ return observerMock;
+}
+/* exported addObserverMock */
+
+function createAdbProcessMock() {
+ const EventEmitter = require("resource://devtools/shared/event-emitter.js");
+
+ const mock = {};
+ EventEmitter.decorate(mock);
+
+ mock.ready = false;
+
+ mock.start = async () => {
+ console.log("MOCKED METHOD start");
+ mock.ready = true;
+ mock.emit("adb-ready");
+ };
+
+ return { adbProcess: mock };
+}
+/* exported createAdbProcessMock */
+
+function enableAdbProcessMock(mock) {
+ const {
+ setMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+ setMockedModule(
+ mock,
+ "devtools/client/shared/remote-debugging/adb/adb-process"
+ );
+}
+/* exported enableAdbProcessMock */
+
+function disableAdbProcessMock() {
+ const {
+ removeMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+ removeMockedModule("devtools/client/shared/remote-debugging/adb/adb-process");
+}
+/* exported disableAdbProcessMock */
diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js
new file mode 100644
index 0000000000..5748904bff
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js
@@ -0,0 +1,138 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict"; // defined in head.js
+
+/* global CHROME_URL_ROOT */
+
+// This head file contains helpers to create mock versions of the ClientWrapper class
+// defined at devtools/client/aboutdebugging/src/modules/client-wrapper.js .
+
+const {
+ RUNTIME_PREFERENCE,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+// Sensible default values for runtime preferences that should be usable in most
+// situations
+const DEFAULT_PREFERENCES = {
+ [RUNTIME_PREFERENCE.CONNECTION_PROMPT]: true,
+ [RUNTIME_PREFERENCE.PERMANENT_PRIVATE_BROWSING]: false,
+ [RUNTIME_PREFERENCE.SERVICE_WORKERS_ENABLED]: true,
+};
+
+// Creates a simple mock ClientWrapper.
+function createClientMock() {
+ const EventEmitter = require("resource://devtools/shared/event-emitter.js");
+ const eventEmitter = {};
+ EventEmitter.decorate(eventEmitter);
+
+ return {
+ // add a reference to the internal event emitter so that consumers can fire client
+ // events.
+ _eventEmitter: eventEmitter,
+ _preferences: {},
+ contentProcessFronts: [],
+ serviceWorkerRegistrationFronts: [],
+ once: (evt, listener) => {
+ eventEmitter.once(evt, listener);
+ },
+ on: (evt, listener) => {
+ eventEmitter.on(evt, listener);
+ },
+ off: (evt, listener) => {
+ eventEmitter.off(evt, listener);
+ },
+ client: {
+ once: (evt, listener) => {
+ eventEmitter.once(evt, listener);
+ },
+ on: (evt, listener) => {
+ eventEmitter.on(evt, listener);
+ },
+ off: (evt, listener) => {
+ eventEmitter.off(evt, listener);
+ },
+ },
+ // no-op
+ close: () => {},
+ // client is not closed
+ isClosed: () => false,
+ // no-op
+ connect: () => {},
+ // no-op
+ getDeviceDescription: () => {},
+ // Return default preference value or null if no match.
+ getPreference(prefName) {
+ if (prefName in this._preferences) {
+ return this._preferences[prefName];
+ }
+ if (prefName in DEFAULT_PREFERENCES) {
+ return DEFAULT_PREFERENCES[prefName];
+ }
+ return null;
+ },
+ // no-op
+ createRootResourceCommand: () => {
+ return {
+ watchResources: () => new Promise(r => r()),
+ unwatchResources: () => {},
+ };
+ },
+ // Empty array of addons
+ listAddons: () => [],
+ // Empty array of processes
+ listProcesses: () => [],
+ // Empty array of tabs
+ listTabs: () => [],
+ // Empty arrays of workers
+ listWorkers: () => ({
+ otherWorkers: [],
+ serviceWorkers: [],
+ sharedWorkers: [],
+ }),
+ // no-op
+ getMainProcess: () => {},
+ // no-op
+ getFront: () => {},
+ // stores the preference locally (doesn't update about:config)
+ setPreference(prefName, value) {
+ this._preferences[prefName] = value;
+ },
+ getPerformancePanelUrl: () => CHROME_URL_ROOT + "empty.html",
+ loadPerformanceProfiler: () => {},
+ // Valid compatibility report
+ checkVersionCompatibility: () => {
+ const {
+ COMPATIBILITY_STATUS,
+ } = require("resource://devtools/client/shared/remote-debugging/version-checker.js");
+ return { status: COMPATIBILITY_STATUS.COMPATIBLE };
+ },
+ // No traits by default but allow updates.
+ traits: {},
+ };
+}
+
+// Create a ClientWrapper mock that can be used to replace the this-firefox runtime.
+function createThisFirefoxClientMock() {
+ const mockThisFirefoxDescription = {
+ name: "Firefox",
+ channel: "nightly",
+ version: "63.0",
+ };
+
+ // Create a fake about:debugging tab because our test helper openAboutDebugging
+ // waits until about:debugging is displayed in the list of tabs.
+ const mockAboutDebuggingTab = {
+ retrieveFavicon: () => {},
+ outerWindowID: 0,
+ traits: {},
+ url: "about:debugging",
+ };
+
+ const mockThisFirefoxClient = createClientMock();
+ mockThisFirefoxClient.listTabs = () => [mockAboutDebuggingTab];
+ mockThisFirefoxClient.getDeviceDescription = () => mockThisFirefoxDescription;
+
+ return mockThisFirefoxClient;
+}
+/* exported createThisFirefoxClientMock */
diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js
new file mode 100644
index 0000000000..b74c229fcf
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js
@@ -0,0 +1,76 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Setup the loader to return the provided mock object instead of the regular
+ * runtime-client-factory module.
+ *
+ * @param {Object}
+ * mock should implement the following methods:
+ * - createClientForRuntime(runtime)
+ */
+function enableRuntimeClientFactoryMock(mock) {
+ const {
+ setMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+ setMockedModule(
+ mock,
+ "devtools/client/aboutdebugging/src/modules/runtime-client-factory"
+ );
+
+ // When using a mocked client, we should not attempt to check default
+ // preferences.
+ mockRuntimeDefaultPreferences();
+}
+/* exported enableRuntimeClientFactoryMock */
+
+const mockRuntimeDefaultPreferences = function () {
+ const {
+ removeMockedModule,
+ setMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+
+ const mock = {
+ setDefaultPreferencesIfNeeded: () => {},
+ DEFAULT_PREFERENCES: [],
+ };
+ setMockedModule(
+ mock,
+ "devtools/client/aboutdebugging/src/modules/runtime-default-preferences"
+ );
+
+ registerCleanupFunction(() => {
+ removeMockedModule(
+ "devtools/client/aboutdebugging/src/modules/runtime-default-preferences"
+ );
+ });
+};
+
+/**
+ * Update the loader to clear the mock entry for the runtime-client-factory module.
+ */
+function disableRuntimeClientFactoryMock() {
+ const {
+ removeMockedModule,
+ } = require("resource://devtools/shared/loader/browser-loader-mocks.js");
+ removeMockedModule(
+ "devtools/client/aboutdebugging/src/modules/runtime-client-factory"
+ );
+}
+/* exported disableRuntimeClientFactoryMock */
+
+/**
+ * Creates a simple mock version for runtime-client-factory, implementing all the expected
+ * methods with empty placeholders.
+ */
+function createRuntimeClientFactoryMock() {
+ const RuntimeClientFactoryMock = {};
+ RuntimeClientFactoryMock.createClientForRuntime = function (runtime) {
+ console.log("MOCKED METHOD createClientForRuntime");
+ };
+
+ return RuntimeClientFactoryMock;
+}
+/* exported createRuntimeClientFactoryMock */
diff --git a/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json
new file mode 100644
index 0000000000..4ab10b4de7
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json
@@ -0,0 +1 @@
+this is not valid json
diff --git a/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json
new file mode 100644
index 0000000000..992818bd77
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json
@@ -0,0 +1,23 @@
+{
+ "manifest_version": 2,
+ "name": "test-invalid-extension",
+ "version": "1",
+ "description": "the name says it all",
+ "permissions": ["*://*.foo.com/*", "alarms", "notifications", "tabs"],
+ "background": {
+ "scripts": ["background.js"]
+ },
+ "content_scripts": [
+ {
+ "matches": "*://*.foo.com/*",
+ "js": ["content.js"]
+ }
+ ],
+ "browser_action": {
+ "default_icon": {
+ "32": "home.svg"
+ },
+ "default_title": "foobarbaz (v1)",
+ "browser_style": true
+ }
+}
diff --git a/devtools/client/aboutdebugging/test/browser/resources/doc_aboutdebugging_devtoolstoolbox_breakpoint.html b/devtools/client/aboutdebugging/test/browser/resources/doc_aboutdebugging_devtoolstoolbox_breakpoint.html
new file mode 100644
index 0000000000..bb28556775
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/doc_aboutdebugging_devtoolstoolbox_breakpoint.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>BREAKPOINT TEST PAGE</title>
+</head>
+<body>
+ <script type="text/javascript" src="script_aboutdebugging_devtoolstoolbox_breakpoint.js"></script>
+</body>
+</html>
diff --git a/devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpi b/devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpi
new file mode 100644
index 0000000000..c1c7af9600
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpi
Binary files differ
diff --git a/devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json b/devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json
new file mode 100644
index 0000000000..bce334e95a
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json
@@ -0,0 +1,14 @@
+[
+ {
+ "sidebarInfo": {
+ "deviceName": "Pixel 2",
+ "shortName": "Firefox Nightly"
+ },
+ "runtimeDetails": {
+ "info": {
+ "name": "Mozilla Nightly",
+ "version": "64.0a1"
+ }
+ }
+ }
+]
diff --git a/devtools/client/aboutdebugging/test/browser/resources/script_aboutdebugging_devtoolstoolbox_breakpoint.js b/devtools/client/aboutdebugging/test/browser/resources/script_aboutdebugging_devtoolstoolbox_breakpoint.js
new file mode 100644
index 0000000000..99401016e4
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/script_aboutdebugging_devtoolstoolbox_breakpoint.js
@@ -0,0 +1,12 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Random method on which a breakpoint will be set from the DevTools UI in the
+// test.
+window.testMethod = function () {
+ const a = 1;
+ const b = 2;
+ return a + b;
+};
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html
new file mode 100644
index 0000000000..98d3bffd95
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker controlled</title>
+</head>
+<body>
+<script type="text/javascript">
+
+"use strict";
+
+let registration;
+
+const registerServiceWorker = async function() {
+ try {
+ registration = await navigator.serviceWorker.register("controlled-sw.js");
+ dump("Controlled service worker registered\n");
+ } catch (e) {
+ dump("Controlled service worker not registered: " + e + "\n");
+ }
+};
+
+// Helper called from helper-serviceworker.js to unregister the service worker.
+window.getRegistration = function() {
+ return registration;
+};
+
+// Called from browser_aboutdebugging_serviceworker_status.js
+window.installServiceWorker = function() {
+ registration.installing.postMessage("install-service-worker");
+};
+
+// Register the service worker.
+registerServiceWorker();
+
+</script>
+</body>
+</html>
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js
new file mode 100644
index 0000000000..0a6d9cfdc6
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js
@@ -0,0 +1,31 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* eslint-env worker */
+
+"use strict";
+
+// Copied from shared-head.js
+function waitUntil(predicate, interval = 10) {
+ if (predicate()) {
+ return Promise.resolve(true);
+ }
+ return new Promise(resolve => {
+ setTimeout(function () {
+ waitUntil(predicate, interval).then(() => resolve(true));
+ }, interval);
+ });
+}
+
+// This flag will be flipped from controlled-sw.html::installServiceWorker()
+let canInstall = false;
+self.addEventListener("message", function (event) {
+ if (event.data === "install-service-worker") {
+ canInstall = true;
+ }
+});
+
+// Wait for the canInstall flag to be flipped before completing the install.
+self.addEventListener("install", function (event) {
+ event.waitUntil(waitUntil(() => canInstall));
+});
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html
new file mode 100644
index 0000000000..ab862743a7
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+let registration;
+
+const registerServiceWorker = async function() {
+ try {
+ registration = await navigator.serviceWorker.register("empty-sw.js");
+ dump("Empty service worker registered\n");
+ } catch (e) {
+ dump("Empty service worker not registered: " + e + "\n");
+ }
+};
+
+// Helper called from helper-serviceworker.js to unregister the service worker.
+window.getRegistration = function() {
+ return registration;
+};
+// Register the service worker.
+registerServiceWorker();
+</script>
+</body>
+</html>
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js
new file mode 100644
index 0000000000..1e7226402c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js
@@ -0,0 +1 @@
+// Empty, just test registering.
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html
new file mode 100644
index 0000000000..a1bb218341
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+let registration;
+
+const registerServiceWorker = async function() {
+ try {
+ registration = await navigator.serviceWorker.register("fetch-sw.js");
+ dump("Empty service worker registered\n");
+ } catch (e) {
+ dump("Empty service worker not registered: " + e + "\n");
+ }
+};
+
+// Helper called from helper-serviceworker.js to unregister the service worker.
+window.getRegistration = function() {
+ return registration;
+};
+// Register the service worker.
+registerServiceWorker();
+</script>
+</body>
+</html>
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js
new file mode 100644
index 0000000000..de6ee1fb32
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js
@@ -0,0 +1,6 @@
+"use strict";
+
+// Bug 1328293
+self.onfetch = function (event) {
+ // do nothing.
+};
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html
new file mode 100644
index 0000000000..bf5b0b0b0a
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker push test</title>
+</head>
+<body>
+<script type="text/javascript">
+
+"use strict";
+
+let registration;
+let subscription;
+
+const registerServiceWorker = async function() {
+ const perm = { type: "desktop-notification", allow: true, context: document };
+ await SpecialPowers.pushPermissions([perm]);
+
+ try {
+ registration = await navigator.serviceWorker.register("push-sw.js");
+ dump("Push service worker registered\n");
+ } catch (e) {
+ dump("Push service worker not registered: " + e + "\n");
+ }
+};
+
+// Helper called from helper-serviceworker.js to unregister the service worker.
+window.getRegistration = function() {
+ return registration;
+};
+
+// Helper called from browser_aboutdebugging_serviceworker_pushservice_url.js
+window.subscribeToPush = async function() {
+ try {
+ subscription = await registration.pushManager.subscribe();
+ dump("SW subscribed to push: " + subscription.endpoint + "\n");
+ } catch (e) {
+ dump("SW not subscribed to push: " + e + "\n");
+ }
+};
+
+// Helper called from browser_aboutdebugging_serviceworker_pushservice_url.js
+window.unsubscribeToPush = async function() {
+ subscription.unsubscribe();
+};
+
+// Expose a promise to wait until the service worker is claimed.
+window.onSwClaimed = new Promise(resolve => {
+ navigator.serviceWorker.addEventListener("message", function(event) {
+ if (event.data == "sw-claimed") {
+ resolve();
+ }
+ });
+});
+
+// Register the service worker.
+registerServiceWorker();
+
+</script>
+</body>
+</html>
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js
new file mode 100644
index 0000000000..1231697ddd
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js
@@ -0,0 +1,35 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* eslint-env worker */
+/* global clients */
+
+"use strict";
+
+// Send a message to all controlled windows.
+function postMessage(message) {
+ return clients.matchAll().then(function (clientlist) {
+ clientlist.forEach(function (client) {
+ client.postMessage(message);
+ });
+ });
+}
+
+// Don't wait for the next page load to become the active service worker.
+self.addEventListener("install", function (event) {
+ event.waitUntil(self.skipWaiting());
+});
+
+// Claim control over the currently open test page when activating.
+self.addEventListener("activate", function (event) {
+ event.waitUntil(
+ self.clients.claim().then(function () {
+ return postMessage("sw-claimed");
+ })
+ );
+});
+
+// Forward all "push" events to the controlled window.
+self.addEventListener("push", function (event) {
+ event.waitUntil(postMessage("sw-pushed"));
+});
diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpi
new file mode 100644
index 0000000000..56054c341c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpi
Binary files differ
diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpi
new file mode 100644
index 0000000000..9cd737b017
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpi
Binary files differ
diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpi
new file mode 100644
index 0000000000..5af9bc963d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpi
Binary files differ
diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpi
new file mode 100644
index 0000000000..0c10c8502c
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpi
Binary files differ
diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json
new file mode 100644
index 0000000000..c62b2ddbd6
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json
@@ -0,0 +1,13 @@
+{
+ "manifest_version": 2,
+ "name": "test-temporary-extension",
+ "version": "1.0",
+ "browser_specific_settings": {
+ "gecko": {
+ "id": "test-temporary-extension@mozilla.org"
+ }
+ },
+ "background": {
+ "scripts": ["script.js"]
+ }
+}
diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js
new file mode 100644
index 0000000000..02d5604c3a
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js
@@ -0,0 +1,8 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* eslint-env browser */
+
+"use strict";
+
+document.body.innerText = "Background Page Body Test Content";
diff --git a/devtools/client/aboutdebugging/test/browser/test-tab-favicons.html b/devtools/client/aboutdebugging/test/browser/test-tab-favicons.html
new file mode 100644
index 0000000000..35954f67a1
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/test-tab-favicons.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Favicon tab</title>
+ <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATklEQVRYhe3SIQ4AIBADwf7/04elBAtrVlSduGnSTDJ7cuT1PQJwwO+Hl7sAGAA07gjAAfgIBeAAoHFHAA7ARygABwCNOwJwAD5CATRgAYXh+kypw86nAAAAAElFTkSuQmCC">
+ <head>
+ <body>Some page with a favicon</body>
+</html>
diff --git a/devtools/client/aboutdebugging/test/node/.eslintrc.js b/devtools/client/aboutdebugging/test/node/.eslintrc.js
new file mode 100644
index 0000000000..ffb3e70473
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/.eslintrc.js
@@ -0,0 +1,10 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+module.exports = {
+ env: {
+ jest: true,
+ },
+};
diff --git a/devtools/client/aboutdebugging/test/node/README.md b/devtools/client/aboutdebugging/test/node/README.md
new file mode 100644
index 0000000000..58cbe55691
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/README.md
@@ -0,0 +1,22 @@
+# Jest Tests for devtools/client/aboutdebugging
+
+## About
+
+DevTools React components can be tested using [jest](https://jestjs.io/). Jest allows to test our UI components in isolation and complement our end to end mochitests.
+
+## Run locally
+
+We use yarn for dependency management. To run the tests locally:
+```
+ cd devtools/client/shared/aboutdebugging/test/node
+ yarn && yarn test
+```
+
+## Run on try
+
+The tests run on try on linux64 platforms. The complete name of try job is `devtools-tests`. In treeherder, they will show up as `node(devtools)`.
+
+Adding the tests to a try push depends on the try selector you are using.
+- try fuzzy: look for the job named `source-test-node-devtools-tests`
+
+The configuration file for try can be found at `taskcluster/ci/source-test/node.yml`
diff --git a/devtools/client/aboutdebugging/test/node/babel.config.js b/devtools/client/aboutdebugging/test/node/babel.config.js
new file mode 100644
index 0000000000..a9e47ba7fb
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/babel.config.js
@@ -0,0 +1,8 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+module.exports = {
+ plugins: ["@babel/plugin-proposal-async-generator-functions"],
+};
diff --git a/devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap b/devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap
new file mode 100644
index 0000000000..eb1e3ac6ee
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap
@@ -0,0 +1,91 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Message component renders the expected snapshot for ERROR level 1`] = `
+<aside
+ className="message message--level-error qa-message some-classname-3"
+>
+ <img
+ className="message__icon"
+ src="chrome://devtools/skin/images/aboutdebugging-error.svg"
+ />
+ <div
+ className="message__body"
+ >
+ <div>
+ Message content
+ </div>
+ </div>
+</aside>
+`;
+
+exports[`Message component renders the expected snapshot for INFO level 1`] = `
+<aside
+ className="message message--level-info qa-message some-classname-1"
+>
+ <img
+ className="message__icon"
+ src="chrome://devtools/skin/images/aboutdebugging-information.svg"
+ />
+ <div
+ className="message__body"
+ >
+ <div>
+ Message content
+ </div>
+ </div>
+</aside>
+`;
+
+exports[`Message component renders the expected snapshot for WARNING level 1`] = `
+<aside
+ className="message message--level-warning qa-message some-classname-2"
+>
+ <img
+ className="message__icon"
+ src="chrome://devtools/skin/images/alert.svg"
+ />
+ <div
+ className="message__body"
+ >
+ <div>
+ Message content
+ </div>
+ </div>
+</aside>
+`;
+
+exports[`Message component renders with closing button renders the expected snapshot for Message with closing button 1`] = `
+<aside
+ className="message message--level-info qa-message some-classname-1"
+>
+ <img
+ className="message__icon"
+ src="chrome://devtools/skin/images/aboutdebugging-information.svg"
+ />
+ <div
+ className="message__body"
+ >
+ <div>
+ Message content
+ </div>
+ </div>
+ <button
+ className="ghost-button message__button message__button--info qa-message-button-close-button"
+ onClick={[Function]}
+ >
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="about-debugging-message-close-icon"
+ >
+ <img
+ className="qa-message-button-close-icon"
+ src="chrome://devtools/skin/images/close.svg"
+ />
+ </Localized>
+ </button>
+</aside>
+`;
diff --git a/devtools/client/aboutdebugging/test/node/components/shared-message.test.js b/devtools/client/aboutdebugging/test/node/components/shared-message.test.js
new file mode 100644
index 0000000000..21a3f44c58
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/components/shared-message.test.js
@@ -0,0 +1,69 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Unit tests for the shared/Message component.
+ */
+
+const { shallow } = require("enzyme");
+const React = require("react");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ MESSAGE_LEVEL,
+} = require("resource://devtools/client/aboutdebugging/src/constants.js");
+
+const Message = React.createFactory(
+ require("resource://devtools/client/aboutdebugging/src/components/shared/Message.js")
+);
+
+describe("Message component", () => {
+ it("renders the expected snapshot for INFO level", () => {
+ const message = shallow(
+ Message({
+ children: dom.div({}, "Message content"),
+ className: "some-classname-1",
+ level: MESSAGE_LEVEL.INFO,
+ })
+ );
+ expect(message).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for WARNING level", () => {
+ const message = shallow(
+ Message({
+ children: dom.div({}, "Message content"),
+ className: "some-classname-2",
+ level: MESSAGE_LEVEL.WARNING,
+ })
+ );
+ expect(message).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for ERROR level", () => {
+ const message = shallow(
+ Message({
+ children: dom.div({}, "Message content"),
+ className: "some-classname-3",
+ level: MESSAGE_LEVEL.ERROR,
+ })
+ );
+ expect(message).toMatchSnapshot();
+ });
+});
+
+describe("Message component renders with closing button", () => {
+ it("renders the expected snapshot for Message with closing button", () => {
+ const message = shallow(
+ Message({
+ children: dom.div({}, "Message content"),
+ className: "some-classname-1",
+ level: MESSAGE_LEVEL.INFO,
+ isCloseable: true,
+ })
+ );
+ expect(message).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/aboutdebugging/test/node/jest.config.js b/devtools/client/aboutdebugging/test/node/jest.config.js
new file mode 100644
index 0000000000..e114658f88
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/jest.config.js
@@ -0,0 +1,14 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global __dirname */
+
+const sharedJestConfig = require(`${__dirname}/../../../shared/test-helpers/shared-jest.config`);
+
+module.exports = {
+ ...sharedJestConfig,
+ setupFiles: ["<rootDir>setup.js"],
+ snapshotSerializers: ["enzyme-to-json/serializer"],
+};
diff --git a/devtools/client/aboutdebugging/test/node/package.json b/devtools/client/aboutdebugging/test/node/package.json
new file mode 100644
index 0000000000..db8fa83e5d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "devtools-client-framework-tests",
+ "license": "MPL-2.0",
+ "version": "0.0.1",
+ "engines": {
+ "node": ">=8.9.4"
+ },
+ "scripts": {
+ "test": "jest",
+ "test-ci": "jest --json"
+ },
+ "dependencies": {
+ "@babel/plugin-proposal-async-generator-functions": "^7.2.0",
+ "enzyme": "^3.9.0",
+ "enzyme-adapter-react-16": "^1.13.2",
+ "enzyme-to-json": "^3.3.5",
+ "jest": "^24.6.0",
+ "react": "16.4.1",
+ "react-dom": "16.4.1",
+ "react-test-renderer": "16.4.1"
+ }
+}
diff --git a/devtools/client/aboutdebugging/test/node/setup.js b/devtools/client/aboutdebugging/test/node/setup.js
new file mode 100644
index 0000000000..570e4462ae
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/setup.js
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+// Configure enzyme with React 16 adapter.
+const Enzyme = require("enzyme");
+const Adapter = require("enzyme-adapter-react-16");
+Enzyme.configure({ adapter: new Adapter() });
+
+const {
+ setMocksInGlobal,
+} = require("resource://devtools/client/shared/test-helpers/shared-node-helpers.js");
+setMocksInGlobal();
diff --git a/devtools/client/aboutdebugging/test/node/yarn.lock b/devtools/client/aboutdebugging/test/node/yarn.lock
new file mode 100644
index 0000000000..396c84ebcd
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/node/yarn.lock
@@ -0,0 +1,4133 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@babel/code-frame@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8"
+ integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==
+ dependencies:
+ "@babel/highlight" "^7.0.0"
+
+"@babel/core@^7.1.0":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a"
+ integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/generator" "^7.4.4"
+ "@babel/helpers" "^7.4.4"
+ "@babel/parser" "^7.4.5"
+ "@babel/template" "^7.4.4"
+ "@babel/traverse" "^7.4.5"
+ "@babel/types" "^7.4.4"
+ convert-source-map "^1.1.0"
+ debug "^4.1.0"
+ json5 "^2.1.0"
+ lodash "^4.17.11"
+ resolve "^1.3.2"
+ semver "^5.4.1"
+ source-map "^0.5.0"
+
+"@babel/generator@^7.4.0", "@babel/generator@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041"
+ integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==
+ dependencies:
+ "@babel/types" "^7.4.4"
+ jsesc "^2.5.1"
+ lodash "^4.17.11"
+ source-map "^0.5.0"
+ trim-right "^1.0.1"
+
+"@babel/helper-annotate-as-pure@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32"
+ integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-function-name@^7.1.0":
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53"
+ integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==
+ dependencies:
+ "@babel/helper-get-function-arity" "^7.0.0"
+ "@babel/template" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-get-function-arity@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3"
+ integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-plugin-utils@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250"
+ integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==
+
+"@babel/helper-remap-async-to-generator@^7.1.0":
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f"
+ integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.0.0"
+ "@babel/helper-wrap-function" "^7.1.0"
+ "@babel/template" "^7.1.0"
+ "@babel/traverse" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-split-export-declaration@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677"
+ integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==
+ dependencies:
+ "@babel/types" "^7.4.4"
+
+"@babel/helper-wrap-function@^7.1.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa"
+ integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==
+ dependencies:
+ "@babel/helper-function-name" "^7.1.0"
+ "@babel/template" "^7.1.0"
+ "@babel/traverse" "^7.1.0"
+ "@babel/types" "^7.2.0"
+
+"@babel/helpers@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5"
+ integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==
+ dependencies:
+ "@babel/template" "^7.4.4"
+ "@babel/traverse" "^7.4.4"
+ "@babel/types" "^7.4.4"
+
+"@babel/highlight@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4"
+ integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==
+ dependencies:
+ chalk "^2.0.0"
+ esutils "^2.0.2"
+ js-tokens "^4.0.0"
+
+"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872"
+ integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==
+
+"@babel/plugin-proposal-async-generator-functions@^7.2.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e"
+ integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+ "@babel/helper-remap-async-to-generator" "^7.1.0"
+ "@babel/plugin-syntax-async-generators" "^7.2.0"
+
+"@babel/plugin-syntax-async-generators@^7.2.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f"
+ integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+
+"@babel/plugin-syntax-object-rest-spread@^7.0.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e"
+ integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+
+"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
+ integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/parser" "^7.4.4"
+ "@babel/types" "^7.4.4"
+
+"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216"
+ integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/generator" "^7.4.4"
+ "@babel/helper-function-name" "^7.1.0"
+ "@babel/helper-split-export-declaration" "^7.4.4"
+ "@babel/parser" "^7.4.5"
+ "@babel/types" "^7.4.4"
+ debug "^4.1.0"
+ globals "^11.1.0"
+ lodash "^4.17.11"
+
+"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0"
+ integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==
+ dependencies:
+ esutils "^2.0.2"
+ lodash "^4.17.11"
+ to-fast-properties "^2.0.0"
+
+"@cnakazawa/watch@^1.0.3":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef"
+ integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==
+ dependencies:
+ exec-sh "^0.3.2"
+ minimist "^1.2.0"
+
+"@jest/console@^24.7.1":
+ version "24.7.1"
+ resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"
+ integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==
+ dependencies:
+ "@jest/source-map" "^24.3.0"
+ chalk "^2.0.1"
+ slash "^2.0.0"
+
+"@jest/core@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b"
+ integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/reporters" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ graceful-fs "^4.1.15"
+ jest-changed-files "^24.8.0"
+ jest-config "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve-dependencies "^24.8.0"
+ jest-runner "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ jest-watcher "^24.8.0"
+ micromatch "^3.1.10"
+ p-each-series "^1.0.0"
+ pirates "^4.0.1"
+ realpath-native "^1.1.0"
+ rimraf "^2.5.4"
+ strip-ansi "^5.0.0"
+
+"@jest/environment@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac"
+ integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==
+ dependencies:
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+
+"@jest/fake-timers@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1"
+ integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-mock "^24.8.0"
+
+"@jest/reporters@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729"
+ integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ glob "^7.1.2"
+ istanbul-lib-coverage "^2.0.2"
+ istanbul-lib-instrument "^3.0.1"
+ istanbul-lib-report "^2.0.4"
+ istanbul-lib-source-maps "^3.0.1"
+ istanbul-reports "^2.1.1"
+ jest-haste-map "^24.8.0"
+ jest-resolve "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ node-notifier "^5.2.1"
+ slash "^2.0.0"
+ source-map "^0.6.0"
+ string-length "^2.0.0"
+
+"@jest/source-map@^24.3.0":
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28"
+ integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag==
+ dependencies:
+ callsites "^3.0.0"
+ graceful-fs "^4.1.15"
+ source-map "^0.6.0"
+
+"@jest/test-result@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3"
+ integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/types" "^24.8.0"
+ "@types/istanbul-lib-coverage" "^2.0.0"
+
+"@jest/test-sequencer@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b"
+ integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==
+ dependencies:
+ "@jest/test-result" "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-runner "^24.8.0"
+ jest-runtime "^24.8.0"
+
+"@jest/transform@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5"
+ integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==
+ dependencies:
+ "@babel/core" "^7.1.0"
+ "@jest/types" "^24.8.0"
+ babel-plugin-istanbul "^5.1.0"
+ chalk "^2.0.1"
+ convert-source-map "^1.4.0"
+ fast-json-stable-stringify "^2.0.0"
+ graceful-fs "^4.1.15"
+ jest-haste-map "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-util "^24.8.0"
+ micromatch "^3.1.10"
+ realpath-native "^1.1.0"
+ slash "^2.0.0"
+ source-map "^0.6.1"
+ write-file-atomic "2.4.1"
+
+"@jest/types@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad"
+ integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==
+ dependencies:
+ "@types/istanbul-lib-coverage" "^2.0.0"
+ "@types/istanbul-reports" "^1.1.1"
+ "@types/yargs" "^12.0.9"
+
+"@types/babel__core@^7.1.0":
+ version "7.1.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f"
+ integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+ "@types/babel__generator" "*"
+ "@types/babel__template" "*"
+ "@types/babel__traverse" "*"
+
+"@types/babel__generator@*":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc"
+ integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@types/babel__template@*":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307"
+ integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6":
+ version "7.0.6"
+ resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2"
+ integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw==
+ dependencies:
+ "@babel/types" "^7.3.0"
+
+"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
+ integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==
+
+"@types/istanbul-lib-report@*":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c"
+ integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+
+"@types/istanbul-reports@^1.1.1":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a"
+ integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+ "@types/istanbul-lib-report" "*"
+
+"@types/node@*":
+ version "12.0.3"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.3.tgz#5d8d24e0033fc6393efadc85cb59c1f638095c9a"
+ integrity sha512-zkOxCS/fA+3SsdA+9Yun0iANxzhQRiNwTvJSr6N95JhuJ/x27z9G2URx1Jpt3zYFfCGUXZGL5UDxt5eyLE7wgw==
+
+"@types/stack-utils@^1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
+ integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
+
+"@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
+ version "12.0.12"
+ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"
+ integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==
+
+abab@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f"
+ integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==
+
+abbrev@1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
+ integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
+
+acorn-globals@^4.1.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103"
+ integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==
+ dependencies:
+ acorn "^6.0.1"
+ acorn-walk "^6.0.1"
+
+acorn-walk@^6.0.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913"
+ integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==
+
+acorn@^5.5.3:
+ version "5.7.3"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
+ integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
+
+acorn@^6.0.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f"
+ integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==
+
+airbnb-prop-types@^2.13.2:
+ version "2.13.2"
+ resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc"
+ integrity sha512-2FN6DlHr6JCSxPPi25EnqGaXC4OC3/B3k1lCd6MMYrZ51/Gf/1qDfaR+JElzWa+Tl7cY2aYOlsYJGFeQyVHIeQ==
+ dependencies:
+ array.prototype.find "^2.0.4"
+ function.prototype.name "^1.1.0"
+ has "^1.0.3"
+ is-regex "^1.0.4"
+ object-is "^1.0.1"
+ object.assign "^4.1.0"
+ object.entries "^1.1.0"
+ prop-types "^15.7.2"
+ prop-types-exact "^1.2.0"
+ react-is "^16.8.6"
+
+ajv@^6.5.5:
+ version "6.10.0"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
+ integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==
+ dependencies:
+ fast-deep-equal "^2.0.1"
+ fast-json-stable-stringify "^2.0.0"
+ json-schema-traverse "^0.4.1"
+ uri-js "^4.2.2"
+
+ansi-escapes@^3.0.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
+ integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==
+
+ansi-regex@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
+ integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
+
+ansi-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
+ integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
+
+ansi-regex@^4.0.0, ansi-regex@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
+ integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
+
+ansi-styles@^3.2.0, ansi-styles@^3.2.1:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
+ integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
+ dependencies:
+ color-convert "^1.9.0"
+
+anymatch@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
+ integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==
+ dependencies:
+ micromatch "^3.1.4"
+ normalize-path "^2.1.1"
+
+aproba@^1.0.3:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
+ integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
+
+are-we-there-yet@~1.1.2:
+ version "1.1.5"
+ resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
+ integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==
+ dependencies:
+ delegates "^1.0.0"
+ readable-stream "^2.0.6"
+
+arr-diff@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
+ integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=
+
+arr-flatten@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
+ integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==
+
+arr-union@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
+ integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=
+
+array-equal@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
+ integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=
+
+array-filter@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
+ integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=
+
+array-unique@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
+ integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
+
+array.prototype.find@^2.0.4:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7"
+ integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.13.0"
+
+array.prototype.flat@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4"
+ integrity sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw==
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.10.0"
+ function-bind "^1.1.1"
+
+asap@~2.0.3:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
+ integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
+
+asn1@~0.2.3:
+ version "0.2.4"
+ resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
+ integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
+ dependencies:
+ safer-buffer "~2.1.0"
+
+assert-plus@1.0.0, assert-plus@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
+ integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
+
+assign-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
+ integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=
+
+astral-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
+ integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
+
+async-limiter@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
+ integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==
+
+asynckit@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
+ integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
+
+atob@^2.1.1:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
+ integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
+
+aws-sign2@~0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
+ integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
+
+aws4@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
+ integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
+
+babel-jest@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589"
+ integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==
+ dependencies:
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/babel__core" "^7.1.0"
+ babel-plugin-istanbul "^5.1.0"
+ babel-preset-jest "^24.6.0"
+ chalk "^2.4.2"
+ slash "^2.0.0"
+
+babel-plugin-istanbul@^5.1.0:
+ version "5.1.4"
+ resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba"
+ integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==
+ dependencies:
+ find-up "^3.0.0"
+ istanbul-lib-instrument "^3.3.0"
+ test-exclude "^5.2.3"
+
+babel-plugin-jest-hoist@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019"
+ integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==
+ dependencies:
+ "@types/babel__traverse" "^7.0.6"
+
+babel-preset-jest@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984"
+ integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==
+ dependencies:
+ "@babel/plugin-syntax-object-rest-spread" "^7.0.0"
+ babel-plugin-jest-hoist "^24.6.0"
+
+balanced-match@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
+ integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
+
+base@^0.11.1:
+ version "0.11.2"
+ resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
+ integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==
+ dependencies:
+ cache-base "^1.0.1"
+ class-utils "^0.3.5"
+ component-emitter "^1.2.1"
+ define-property "^1.0.0"
+ isobject "^3.0.1"
+ mixin-deep "^1.2.0"
+ pascalcase "^0.1.1"
+
+bcrypt-pbkdf@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
+ integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
+ dependencies:
+ tweetnacl "^0.14.3"
+
+boolbase@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
+ integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
+
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+braces@^2.3.1:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
+ integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==
+ dependencies:
+ arr-flatten "^1.1.0"
+ array-unique "^0.3.2"
+ extend-shallow "^2.0.1"
+ fill-range "^4.0.0"
+ isobject "^3.0.1"
+ repeat-element "^1.1.2"
+ snapdragon "^0.8.1"
+ snapdragon-node "^2.0.1"
+ split-string "^3.0.2"
+ to-regex "^3.0.1"
+
+browser-process-hrtime@^0.1.2:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4"
+ integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==
+
+browser-resolve@^1.11.3:
+ version "1.11.3"
+ resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6"
+ integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==
+ dependencies:
+ resolve "1.1.7"
+
+bser@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
+ integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=
+ dependencies:
+ node-int64 "^0.4.0"
+
+buffer-from@^1.0.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
+ integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
+
+cache-base@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
+ integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==
+ dependencies:
+ collection-visit "^1.0.0"
+ component-emitter "^1.2.1"
+ get-value "^2.0.6"
+ has-value "^1.0.0"
+ isobject "^3.0.1"
+ set-value "^2.0.0"
+ to-object-path "^0.3.0"
+ union-value "^1.0.0"
+ unset-value "^1.0.0"
+
+callsites@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
+ integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
+
+camelcase@^5.0.0:
+ version "5.3.1"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
+ integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
+
+capture-exit@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4"
+ integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==
+ dependencies:
+ rsvp "^4.8.4"
+
+caseless@~0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
+ integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
+
+chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
+ integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
+ dependencies:
+ ansi-styles "^3.2.1"
+ escape-string-regexp "^1.0.5"
+ supports-color "^5.3.0"
+
+cheerio@^1.0.0-rc.2:
+ version "1.0.0-rc.3"
+ resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6"
+ integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==
+ dependencies:
+ css-select "~1.2.0"
+ dom-serializer "~0.1.1"
+ entities "~1.1.1"
+ htmlparser2 "^3.9.1"
+ lodash "^4.15.0"
+ parse5 "^3.0.1"
+
+chownr@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494"
+ integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==
+
+ci-info@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
+ integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
+
+class-utils@^0.3.5:
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
+ integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==
+ dependencies:
+ arr-union "^3.1.0"
+ define-property "^0.2.5"
+ isobject "^3.0.0"
+ static-extend "^0.1.1"
+
+cliui@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
+ integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==
+ dependencies:
+ string-width "^2.1.1"
+ strip-ansi "^4.0.0"
+ wrap-ansi "^2.0.0"
+
+co@^4.6.0:
+ version "4.6.0"
+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
+ integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
+
+code-point-at@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
+ integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
+
+collection-visit@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
+ integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=
+ dependencies:
+ map-visit "^1.0.0"
+ object-visit "^1.0.0"
+
+color-convert@^1.9.0:
+ version "1.9.3"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
+ integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
+ dependencies:
+ color-name "1.1.3"
+
+color-name@1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
+ integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
+
+combined-stream@^1.0.6, combined-stream@~1.0.6:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
+ integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
+ dependencies:
+ delayed-stream "~1.0.0"
+
+commander@^2.19.0:
+ version "2.20.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
+ integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
+
+commander@~2.19.0:
+ version "2.19.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
+ integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
+
+component-emitter@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
+ integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
+console-control-strings@^1.0.0, console-control-strings@~1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
+ integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
+
+convert-source-map@^1.1.0, convert-source-map@^1.4.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20"
+ integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==
+ dependencies:
+ safe-buffer "~5.1.1"
+
+copy-descriptor@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
+ integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
+
+core-js@^1.0.0:
+ version "1.2.7"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
+ integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=
+
+core-util-is@1.0.2, core-util-is@~1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
+ integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
+
+cross-spawn@^6.0.0:
+ version "6.0.5"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
+ integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
+ dependencies:
+ nice-try "^1.0.4"
+ path-key "^2.0.1"
+ semver "^5.5.0"
+ shebang-command "^1.2.0"
+ which "^1.2.9"
+
+css-select@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
+ integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
+ dependencies:
+ boolbase "~1.0.0"
+ css-what "2.1"
+ domutils "1.5.1"
+ nth-check "~1.0.1"
+
+css-what@2.1:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
+ integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
+
+cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad"
+ integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==
+
+cssstyle@^1.0.0:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.1.tgz#3aceb2759eaf514ac1a21628d723d6043a819495"
+ integrity sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A==
+ dependencies:
+ cssom "0.3.x"
+
+dashdash@^1.12.0:
+ version "1.14.1"
+ resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
+ integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
+ dependencies:
+ assert-plus "^1.0.0"
+
+data-urls@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe"
+ integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==
+ dependencies:
+ abab "^2.0.0"
+ whatwg-mimetype "^2.2.0"
+ whatwg-url "^7.0.0"
+
+debug@^2.1.2, debug@^2.2.0, debug@^2.3.3:
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+ integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
+ dependencies:
+ ms "2.0.0"
+
+debug@^4.1.0, debug@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
+ integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
+ dependencies:
+ ms "^2.1.1"
+
+decamelize@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
+ integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
+
+decode-uri-component@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
+ integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
+
+deep-extend@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
+ integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
+
+deep-is@~0.1.3:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
+ integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
+
+define-properties@^1.1.2, define-properties@^1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
+ integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
+ dependencies:
+ object-keys "^1.0.12"
+
+define-property@^0.2.5:
+ version "0.2.5"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
+ integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=
+ dependencies:
+ is-descriptor "^0.1.0"
+
+define-property@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
+ integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY=
+ dependencies:
+ is-descriptor "^1.0.0"
+
+define-property@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
+ integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==
+ dependencies:
+ is-descriptor "^1.0.2"
+ isobject "^3.0.1"
+
+delayed-stream@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
+ integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
+
+delegates@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
+ integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
+
+detect-libc@^1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
+ integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
+
+detect-newline@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2"
+ integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=
+
+diff-sequences@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975"
+ integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==
+
+discontinuous-range@1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a"
+ integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=
+
+dom-serializer@0, dom-serializer@~0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
+ integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
+ dependencies:
+ domelementtype "^1.3.0"
+ entities "^1.1.1"
+
+domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
+ integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
+
+domexception@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"
+ integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==
+ dependencies:
+ webidl-conversions "^4.0.2"
+
+domhandler@^2.3.0:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
+ integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
+ dependencies:
+ domelementtype "1"
+
+domutils@1.5.1:
+ version "1.5.1"
+ resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
+ integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
+ dependencies:
+ dom-serializer "0"
+ domelementtype "1"
+
+domutils@^1.5.1:
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
+ integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
+ dependencies:
+ dom-serializer "0"
+ domelementtype "1"
+
+ecc-jsbn@~0.1.1:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
+ integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
+ dependencies:
+ jsbn "~0.1.0"
+ safer-buffer "^2.1.0"
+
+encoding@^0.1.11:
+ version "0.1.12"
+ resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
+ integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=
+ dependencies:
+ iconv-lite "~0.4.13"
+
+end-of-stream@^1.1.0:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
+ integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==
+ dependencies:
+ once "^1.4.0"
+
+entities@^1.1.1, entities@~1.1.1:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
+ integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
+
+enzyme-adapter-react-16@^1.13.2:
+ version "1.13.2"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.13.2.tgz#8a574d7cbbef7ef0cab2022e9bfc12aeaebb7ae5"
+ integrity sha512-h0neTuAAFfQUgEZ+PPHVIMDFJ9+CGafI8AjojNlSVh4Fd1pLDgtl2OeVkm4yKF7RSgzrPAwugq4JW8Jjo2iRJA==
+ dependencies:
+ enzyme-adapter-utils "^1.12.0"
+ has "^1.0.3"
+ object.assign "^4.1.0"
+ object.values "^1.1.0"
+ prop-types "^15.7.2"
+ react-is "^16.8.6"
+ react-test-renderer "^16.0.0-0"
+ semver "^5.7.0"
+
+enzyme-adapter-utils@^1.12.0:
+ version "1.12.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93"
+ integrity sha512-wkZvE0VxcFx/8ZsBw0iAbk3gR1d9hK447ebnSYBf95+r32ezBq+XDSAvRErkc4LZosgH8J7et7H7/7CtUuQfBA==
+ dependencies:
+ airbnb-prop-types "^2.13.2"
+ function.prototype.name "^1.1.0"
+ object.assign "^4.1.0"
+ object.fromentries "^2.0.0"
+ prop-types "^15.7.2"
+ semver "^5.6.0"
+
+enzyme-to-json@^3.3.5:
+ version "3.3.5"
+ resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.5.tgz#f8eb82bd3d5941c9d8bc6fd9140030777d17d0af"
+ integrity sha512-DmH1wJ68HyPqKSYXdQqB33ZotwfUhwQZW3IGXaNXgR69Iodaoj8TF/D9RjLdz4pEhGq2Tx2zwNUIjBuqoZeTgA==
+ dependencies:
+ lodash "^4.17.4"
+
+enzyme@^3.9.0:
+ version "3.9.0"
+ resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.9.0.tgz#2b491f06ca966eb56b6510068c7894a7e0be3909"
+ integrity sha512-JqxI2BRFHbmiP7/UFqvsjxTirWoM1HfeaJrmVSZ9a1EADKkZgdPcAuISPMpoUiHlac9J4dYt81MC5BBIrbJGMg==
+ dependencies:
+ array.prototype.flat "^1.2.1"
+ cheerio "^1.0.0-rc.2"
+ function.prototype.name "^1.1.0"
+ has "^1.0.3"
+ html-element-map "^1.0.0"
+ is-boolean-object "^1.0.0"
+ is-callable "^1.1.4"
+ is-number-object "^1.0.3"
+ is-regex "^1.0.4"
+ is-string "^1.0.4"
+ is-subset "^0.1.1"
+ lodash.escape "^4.0.1"
+ lodash.isequal "^4.5.0"
+ object-inspect "^1.6.0"
+ object-is "^1.0.1"
+ object.assign "^4.1.0"
+ object.entries "^1.0.4"
+ object.values "^1.0.4"
+ raf "^3.4.0"
+ rst-selector-parser "^2.2.3"
+ string.prototype.trim "^1.1.2"
+
+error-ex@^1.3.1:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
+ integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
+ dependencies:
+ is-arrayish "^0.2.1"
+
+es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13.0, es-abstract@^1.5.0, es-abstract@^1.5.1:
+ version "1.13.0"
+ resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
+ integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==
+ dependencies:
+ es-to-primitive "^1.2.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+ is-callable "^1.1.4"
+ is-regex "^1.0.4"
+ object-keys "^1.0.12"
+
+es-to-primitive@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377"
+ integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==
+ dependencies:
+ is-callable "^1.1.4"
+ is-date-object "^1.0.1"
+ is-symbol "^1.0.2"
+
+escape-string-regexp@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+ integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
+
+escodegen@^1.9.1:
+ version "1.11.1"
+ resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510"
+ integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==
+ dependencies:
+ esprima "^3.1.3"
+ estraverse "^4.2.0"
+ esutils "^2.0.2"
+ optionator "^0.8.1"
+ optionalDependencies:
+ source-map "~0.6.1"
+
+esprima@^3.1.3:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
+ integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=
+
+estraverse@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
+ integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=
+
+esutils@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
+ integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=
+
+exec-sh@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b"
+ integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==
+
+execa@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
+ integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
+ dependencies:
+ cross-spawn "^6.0.0"
+ get-stream "^4.0.0"
+ is-stream "^1.1.0"
+ npm-run-path "^2.0.0"
+ p-finally "^1.0.0"
+ signal-exit "^3.0.0"
+ strip-eof "^1.0.0"
+
+exit@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
+ integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=
+
+expand-brackets@^2.1.4:
+ version "2.1.4"
+ resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
+ integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI=
+ dependencies:
+ debug "^2.3.3"
+ define-property "^0.2.5"
+ extend-shallow "^2.0.1"
+ posix-character-classes "^0.1.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+expect@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d"
+ integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ ansi-styles "^3.2.0"
+ jest-get-type "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-regex-util "^24.3.0"
+
+extend-shallow@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
+ integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=
+ dependencies:
+ is-extendable "^0.1.0"
+
+extend-shallow@^3.0.0, extend-shallow@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
+ integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=
+ dependencies:
+ assign-symbols "^1.0.0"
+ is-extendable "^1.0.1"
+
+extend@~3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
+ integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
+
+extglob@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
+ integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==
+ dependencies:
+ array-unique "^0.3.2"
+ define-property "^1.0.0"
+ expand-brackets "^2.1.4"
+ extend-shallow "^2.0.1"
+ fragment-cache "^0.2.1"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+extsprintf@1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
+ integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
+
+extsprintf@^1.2.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
+ integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
+
+fast-deep-equal@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
+ integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
+
+fast-json-stable-stringify@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
+ integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I=
+
+fast-levenshtein@~2.0.4:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
+ integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
+
+fb-watchman@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58"
+ integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=
+ dependencies:
+ bser "^2.0.0"
+
+fbjs@^0.8.16:
+ version "0.8.17"
+ resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
+ integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
+ dependencies:
+ core-js "^1.0.0"
+ isomorphic-fetch "^2.1.1"
+ loose-envify "^1.0.0"
+ object-assign "^4.1.0"
+ promise "^7.1.1"
+ setimmediate "^1.0.5"
+ ua-parser-js "^0.7.18"
+
+fill-range@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
+ integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-number "^3.0.0"
+ repeat-string "^1.6.1"
+ to-regex-range "^2.1.0"
+
+find-up@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
+ integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
+ dependencies:
+ locate-path "^3.0.0"
+
+for-in@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
+ integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=
+
+forever-agent@~0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
+ integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
+
+form-data@~2.3.2:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
+ integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
+ dependencies:
+ asynckit "^0.4.0"
+ combined-stream "^1.0.6"
+ mime-types "^2.1.12"
+
+fragment-cache@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
+ integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=
+ dependencies:
+ map-cache "^0.2.2"
+
+fs-minipass@^1.2.5:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d"
+ integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==
+ dependencies:
+ minipass "^2.2.1"
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
+
+fsevents@^1.2.7:
+ version "1.2.9"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f"
+ integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==
+ dependencies:
+ nan "^2.12.1"
+ node-pre-gyp "^0.12.0"
+
+function-bind@^1.0.2, function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+
+function.prototype.name@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327"
+ integrity sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg==
+ dependencies:
+ define-properties "^1.1.2"
+ function-bind "^1.1.1"
+ is-callable "^1.1.3"
+
+gauge@~2.7.3:
+ version "2.7.4"
+ resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
+ integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=
+ dependencies:
+ aproba "^1.0.3"
+ console-control-strings "^1.0.0"
+ has-unicode "^2.0.0"
+ object-assign "^4.1.0"
+ signal-exit "^3.0.0"
+ string-width "^1.0.1"
+ strip-ansi "^3.0.1"
+ wide-align "^1.1.0"
+
+get-caller-file@^1.0.1:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
+ integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
+
+get-stream@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
+ integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
+ dependencies:
+ pump "^3.0.0"
+
+get-value@^2.0.3, get-value@^2.0.6:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
+ integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=
+
+getpass@^0.1.1:
+ version "0.1.7"
+ resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
+ integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
+ dependencies:
+ assert-plus "^1.0.0"
+
+glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
+ version "7.1.3"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
+ integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
+globals@^11.1.0:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
+ integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
+
+graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:
+ version "4.1.15"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
+ integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
+
+growly@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
+ integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=
+
+handlebars@^4.1.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67"
+ integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==
+ dependencies:
+ neo-async "^2.6.0"
+ optimist "^0.6.1"
+ source-map "^0.6.1"
+ optionalDependencies:
+ uglify-js "^3.1.4"
+
+har-schema@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
+ integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
+
+har-validator@~5.1.0:
+ version "5.1.3"
+ resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
+ integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
+ dependencies:
+ ajv "^6.5.5"
+ har-schema "^2.0.0"
+
+has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+ integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
+
+has-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
+ integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=
+
+has-unicode@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
+ integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
+
+has-value@^0.3.1:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
+ integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=
+ dependencies:
+ get-value "^2.0.3"
+ has-values "^0.1.4"
+ isobject "^2.0.0"
+
+has-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
+ integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=
+ dependencies:
+ get-value "^2.0.6"
+ has-values "^1.0.0"
+ isobject "^3.0.0"
+
+has-values@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
+ integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E=
+
+has-values@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
+ integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=
+ dependencies:
+ is-number "^3.0.0"
+ kind-of "^4.0.0"
+
+has@^1.0.1, has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
+ dependencies:
+ function-bind "^1.1.1"
+
+hosted-git-info@^2.1.4:
+ version "2.7.1"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
+ integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
+
+html-element-map@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.1.tgz#3c4fcb4874ebddfe4283b51c8994e7713782b592"
+ integrity sha512-BZSfdEm6n706/lBfXKWa4frZRZcT5k1cOusw95ijZsHlI+GdgY0v95h6IzO3iIDf2ROwq570YTwqNPqHcNMozw==
+ dependencies:
+ array-filter "^1.0.0"
+
+html-encoding-sniffer@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
+ integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==
+ dependencies:
+ whatwg-encoding "^1.0.1"
+
+htmlparser2@^3.9.1:
+ version "3.10.1"
+ resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
+ integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
+ dependencies:
+ domelementtype "^1.3.1"
+ domhandler "^2.3.0"
+ domutils "^1.5.1"
+ entities "^1.1.1"
+ inherits "^2.0.1"
+ readable-stream "^3.1.1"
+
+http-signature@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
+ integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
+ dependencies:
+ assert-plus "^1.0.0"
+ jsprim "^1.2.2"
+ sshpk "^1.7.0"
+
+iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
+ version "0.4.24"
+ resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+ integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
+ dependencies:
+ safer-buffer ">= 2.1.2 < 3"
+
+ignore-walk@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8"
+ integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==
+ dependencies:
+ minimatch "^3.0.4"
+
+import-local@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d"
+ integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==
+ dependencies:
+ pkg-dir "^3.0.0"
+ resolve-cwd "^2.0.0"
+
+imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
+
+inflight@^1.0.4:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
+ integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
+ dependencies:
+ once "^1.3.0"
+ wrappy "1"
+
+inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
+ integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
+
+ini@~1.3.0:
+ version "1.3.5"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
+ integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
+
+invariant@^2.2.4:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
+ integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
+ dependencies:
+ loose-envify "^1.0.0"
+
+invert-kv@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
+ integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
+
+is-accessor-descriptor@^0.1.6:
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
+ integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=
+ dependencies:
+ kind-of "^3.0.2"
+
+is-accessor-descriptor@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
+ integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==
+ dependencies:
+ kind-of "^6.0.0"
+
+is-arrayish@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
+ integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
+
+is-boolean-object@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93"
+ integrity sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M=
+
+is-buffer@^1.1.5:
+ version "1.1.6"
+ resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
+ integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
+
+is-callable@^1.1.3, is-callable@^1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
+ integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==
+
+is-ci@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
+ integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
+ dependencies:
+ ci-info "^2.0.0"
+
+is-data-descriptor@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
+ integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=
+ dependencies:
+ kind-of "^3.0.2"
+
+is-data-descriptor@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
+ integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==
+ dependencies:
+ kind-of "^6.0.0"
+
+is-date-object@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
+ integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=
+
+is-descriptor@^0.1.0:
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
+ integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==
+ dependencies:
+ is-accessor-descriptor "^0.1.6"
+ is-data-descriptor "^0.1.4"
+ kind-of "^5.0.0"
+
+is-descriptor@^1.0.0, is-descriptor@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
+ integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==
+ dependencies:
+ is-accessor-descriptor "^1.0.0"
+ is-data-descriptor "^1.0.0"
+ kind-of "^6.0.2"
+
+is-extendable@^0.1.0, is-extendable@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
+ integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=
+
+is-extendable@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
+ integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==
+ dependencies:
+ is-plain-object "^2.0.4"
+
+is-fullwidth-code-point@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
+ integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
+ dependencies:
+ number-is-nan "^1.0.0"
+
+is-fullwidth-code-point@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
+ integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
+
+is-generator-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118"
+ integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==
+
+is-number-object@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799"
+ integrity sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=
+
+is-number@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
+ integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=
+ dependencies:
+ kind-of "^3.0.2"
+
+is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
+ integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
+ dependencies:
+ isobject "^3.0.1"
+
+is-regex@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
+ integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=
+ dependencies:
+ has "^1.0.1"
+
+is-stream@^1.0.1, is-stream@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
+ integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
+
+is-string@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64"
+ integrity sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ=
+
+is-subset@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6"
+ integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=
+
+is-symbol@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
+ integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==
+ dependencies:
+ has-symbols "^1.0.0"
+
+is-typedarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
+ integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
+
+is-windows@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
+ integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
+
+is-wsl@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
+ integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=
+
+isarray@1.0.0, isarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
+ integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+
+isexe@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
+ integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
+
+isobject@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
+ integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=
+ dependencies:
+ isarray "1.0.0"
+
+isobject@^3.0.0, isobject@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
+ integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=
+
+isomorphic-fetch@^2.1.1:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
+ integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=
+ dependencies:
+ node-fetch "^1.0.1"
+ whatwg-fetch ">=0.10.0"
+
+isstream@~0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
+ integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
+
+istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49"
+ integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==
+
+istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630"
+ integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==
+ dependencies:
+ "@babel/generator" "^7.4.0"
+ "@babel/parser" "^7.4.3"
+ "@babel/template" "^7.4.0"
+ "@babel/traverse" "^7.4.3"
+ "@babel/types" "^7.4.0"
+ istanbul-lib-coverage "^2.0.5"
+ semver "^6.0.0"
+
+istanbul-lib-report@^2.0.4:
+ version "2.0.8"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33"
+ integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==
+ dependencies:
+ istanbul-lib-coverage "^2.0.5"
+ make-dir "^2.1.0"
+ supports-color "^6.1.0"
+
+istanbul-lib-source-maps@^3.0.1:
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8"
+ integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==
+ dependencies:
+ debug "^4.1.1"
+ istanbul-lib-coverage "^2.0.5"
+ make-dir "^2.1.0"
+ rimraf "^2.6.3"
+ source-map "^0.6.1"
+
+istanbul-reports@^2.1.1:
+ version "2.2.6"
+ resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af"
+ integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==
+ dependencies:
+ handlebars "^4.1.2"
+
+jest-changed-files@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b"
+ integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ execa "^1.0.0"
+ throat "^4.0.0"
+
+jest-cli@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989"
+ integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==
+ dependencies:
+ "@jest/core" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ import-local "^2.0.0"
+ is-ci "^2.0.0"
+ jest-config "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ prompts "^2.0.1"
+ realpath-native "^1.1.0"
+ yargs "^12.0.2"
+
+jest-config@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f"
+ integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==
+ dependencies:
+ "@babel/core" "^7.1.0"
+ "@jest/test-sequencer" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ babel-jest "^24.8.0"
+ chalk "^2.0.1"
+ glob "^7.1.1"
+ jest-environment-jsdom "^24.8.0"
+ jest-environment-node "^24.8.0"
+ jest-get-type "^24.8.0"
+ jest-jasmine2 "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ micromatch "^3.1.10"
+ pretty-format "^24.8.0"
+ realpath-native "^1.1.0"
+
+jest-diff@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172"
+ integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==
+ dependencies:
+ chalk "^2.0.1"
+ diff-sequences "^24.3.0"
+ jest-get-type "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-docblock@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd"
+ integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==
+ dependencies:
+ detect-newline "^2.1.0"
+
+jest-each@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775"
+ integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ jest-get-type "^24.8.0"
+ jest-util "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-environment-jsdom@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857"
+ integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-util "^24.8.0"
+ jsdom "^11.5.1"
+
+jest-environment-node@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231"
+ integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-util "^24.8.0"
+
+jest-get-type@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc"
+ integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==
+
+jest-haste-map@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800"
+ integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ anymatch "^2.0.0"
+ fb-watchman "^2.0.0"
+ graceful-fs "^4.1.15"
+ invariant "^2.2.4"
+ jest-serializer "^24.4.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ micromatch "^3.1.10"
+ sane "^4.0.3"
+ walker "^1.0.7"
+ optionalDependencies:
+ fsevents "^1.2.7"
+
+jest-jasmine2@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898"
+ integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==
+ dependencies:
+ "@babel/traverse" "^7.1.0"
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ co "^4.6.0"
+ expect "^24.8.0"
+ is-generator-fn "^2.0.0"
+ jest-each "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ pretty-format "^24.8.0"
+ throat "^4.0.0"
+
+jest-leak-detector@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980"
+ integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==
+ dependencies:
+ pretty-format "^24.8.0"
+
+jest-matcher-utils@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495"
+ integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==
+ dependencies:
+ chalk "^2.0.1"
+ jest-diff "^24.8.0"
+ jest-get-type "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-message-util@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b"
+ integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/stack-utils" "^1.0.1"
+ chalk "^2.0.1"
+ micromatch "^3.1.10"
+ slash "^2.0.0"
+ stack-utils "^1.0.1"
+
+jest-mock@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56"
+ integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==
+ dependencies:
+ "@jest/types" "^24.8.0"
+
+jest-pnp-resolver@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a"
+ integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==
+
+jest-regex-util@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36"
+ integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==
+
+jest-resolve-dependencies@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0"
+ integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-snapshot "^24.8.0"
+
+jest-resolve@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f"
+ integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ browser-resolve "^1.11.3"
+ chalk "^2.0.1"
+ jest-pnp-resolver "^1.2.1"
+ realpath-native "^1.1.0"
+
+jest-runner@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb"
+ integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.4.2"
+ exit "^0.1.2"
+ graceful-fs "^4.1.15"
+ jest-config "^24.8.0"
+ jest-docblock "^24.3.0"
+ jest-haste-map "^24.8.0"
+ jest-jasmine2 "^24.8.0"
+ jest-leak-detector "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-resolve "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ source-map-support "^0.5.6"
+ throat "^4.0.0"
+
+jest-runtime@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620"
+ integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/environment" "^24.8.0"
+ "@jest/source-map" "^24.3.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/yargs" "^12.0.2"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ glob "^7.1.3"
+ graceful-fs "^4.1.15"
+ jest-config "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ realpath-native "^1.1.0"
+ slash "^2.0.0"
+ strip-bom "^3.0.0"
+ yargs "^12.0.2"
+
+jest-serializer@^24.4.0:
+ version "24.4.0"
+ resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3"
+ integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==
+
+jest-snapshot@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6"
+ integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==
+ dependencies:
+ "@babel/types" "^7.0.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ expect "^24.8.0"
+ jest-diff "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-resolve "^24.8.0"
+ mkdirp "^0.5.1"
+ natural-compare "^1.4.0"
+ pretty-format "^24.8.0"
+ semver "^5.5.0"
+
+jest-util@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1"
+ integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/source-map" "^24.3.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ callsites "^3.0.0"
+ chalk "^2.0.1"
+ graceful-fs "^4.1.15"
+ is-ci "^2.0.0"
+ mkdirp "^0.5.1"
+ slash "^2.0.0"
+ source-map "^0.6.0"
+
+jest-validate@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849"
+ integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ camelcase "^5.0.0"
+ chalk "^2.0.1"
+ jest-get-type "^24.8.0"
+ leven "^2.1.0"
+ pretty-format "^24.8.0"
+
+jest-watcher@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4"
+ integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==
+ dependencies:
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/yargs" "^12.0.9"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.1"
+ jest-util "^24.8.0"
+ string-length "^2.0.0"
+
+jest-worker@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3"
+ integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==
+ dependencies:
+ merge-stream "^1.0.1"
+ supports-color "^6.1.0"
+
+jest@^24.6.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081"
+ integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==
+ dependencies:
+ import-local "^2.0.0"
+ jest-cli "^24.8.0"
+
+"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
+ integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
+
+jsbn@~0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
+ integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
+
+jsdom@^11.5.1:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8"
+ integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==
+ dependencies:
+ abab "^2.0.0"
+ acorn "^5.5.3"
+ acorn-globals "^4.1.0"
+ array-equal "^1.0.0"
+ cssom ">= 0.3.2 < 0.4.0"
+ cssstyle "^1.0.0"
+ data-urls "^1.0.0"
+ domexception "^1.0.1"
+ escodegen "^1.9.1"
+ html-encoding-sniffer "^1.0.2"
+ left-pad "^1.3.0"
+ nwsapi "^2.0.7"
+ parse5 "4.0.0"
+ pn "^1.1.0"
+ request "^2.87.0"
+ request-promise-native "^1.0.5"
+ sax "^1.2.4"
+ symbol-tree "^3.2.2"
+ tough-cookie "^2.3.4"
+ w3c-hr-time "^1.0.1"
+ webidl-conversions "^4.0.2"
+ whatwg-encoding "^1.0.3"
+ whatwg-mimetype "^2.1.0"
+ whatwg-url "^6.4.1"
+ ws "^5.2.0"
+ xml-name-validator "^3.0.0"
+
+jsesc@^2.5.1:
+ version "2.5.2"
+ resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
+ integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
+
+json-parse-better-errors@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
+ integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
+
+json-schema-traverse@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
+ integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
+
+json-schema@0.2.3:
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
+ integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
+
+json-stringify-safe@~5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
+ integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
+
+json5@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850"
+ integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==
+ dependencies:
+ minimist "^1.2.0"
+
+jsprim@^1.2.2:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
+ integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
+ dependencies:
+ assert-plus "1.0.0"
+ extsprintf "1.3.0"
+ json-schema "0.2.3"
+ verror "1.10.0"
+
+kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
+ integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=
+ dependencies:
+ is-buffer "^1.1.5"
+
+kind-of@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
+ integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc=
+ dependencies:
+ is-buffer "^1.1.5"
+
+kind-of@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
+ integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==
+
+kind-of@^6.0.0, kind-of@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
+ integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==
+
+kleur@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
+ integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
+
+lcid@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf"
+ integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==
+ dependencies:
+ invert-kv "^2.0.0"
+
+left-pad@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
+ integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
+
+leven@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
+ integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA=
+
+levn@~0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
+ integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=
+ dependencies:
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+
+load-json-file@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
+ integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs=
+ dependencies:
+ graceful-fs "^4.1.2"
+ parse-json "^4.0.0"
+ pify "^3.0.0"
+ strip-bom "^3.0.0"
+
+locate-path@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
+ integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==
+ dependencies:
+ p-locate "^3.0.0"
+ path-exists "^3.0.0"
+
+lodash.escape@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98"
+ integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=
+
+lodash.flattendeep@^4.4.0:
+ version "4.4.0"
+ resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
+ integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=
+
+lodash.isequal@^4.5.0:
+ version "4.5.0"
+ resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
+ integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
+
+lodash.sortby@^4.7.0:
+ version "4.7.0"
+ resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
+ integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
+
+lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.4:
+ version "4.17.11"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
+ integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
+
+loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
+ integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
+ dependencies:
+ js-tokens "^3.0.0 || ^4.0.0"
+
+make-dir@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
+ integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==
+ dependencies:
+ pify "^4.0.1"
+ semver "^5.6.0"
+
+makeerror@1.0.x:
+ version "1.0.11"
+ resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c"
+ integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=
+ dependencies:
+ tmpl "1.0.x"
+
+map-age-cleaner@^0.1.1:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
+ integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==
+ dependencies:
+ p-defer "^1.0.0"
+
+map-cache@^0.2.2:
+ version "0.2.2"
+ resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
+ integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=
+
+map-visit@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
+ integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=
+ dependencies:
+ object-visit "^1.0.0"
+
+mem@^4.0.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178"
+ integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==
+ dependencies:
+ map-age-cleaner "^0.1.1"
+ mimic-fn "^2.0.0"
+ p-is-promise "^2.0.0"
+
+merge-stream@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
+ integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=
+ dependencies:
+ readable-stream "^2.0.1"
+
+micromatch@^3.1.10, micromatch@^3.1.4:
+ version "3.1.10"
+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
+ integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==
+ dependencies:
+ arr-diff "^4.0.0"
+ array-unique "^0.3.2"
+ braces "^2.3.1"
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ extglob "^2.0.4"
+ fragment-cache "^0.2.1"
+ kind-of "^6.0.2"
+ nanomatch "^1.2.9"
+ object.pick "^1.3.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.2"
+
+mime-db@~1.38.0:
+ version "1.38.0"
+ resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad"
+ integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==
+
+mime-types@^2.1.12, mime-types@~2.1.19:
+ version "2.1.22"
+ resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd"
+ integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==
+ dependencies:
+ mime-db "~1.38.0"
+
+mimic-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
+ integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
+
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
+ dependencies:
+ brace-expansion "^1.1.7"
+
+minimist@0.0.8:
+ version "0.0.8"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
+ integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
+
+minimist@^1.1.1, minimist@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
+ integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
+
+minimist@~0.0.1:
+ version "0.0.10"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
+ integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=
+
+minipass@^2.2.1, minipass@^2.3.4:
+ version "2.3.5"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848"
+ integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==
+ dependencies:
+ safe-buffer "^5.1.2"
+ yallist "^3.0.0"
+
+minizlib@^1.1.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614"
+ integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==
+ dependencies:
+ minipass "^2.2.1"
+
+mixin-deep@^1.2.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
+ integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==
+ dependencies:
+ for-in "^1.0.2"
+ is-extendable "^1.0.1"
+
+mkdirp@^0.5.0, mkdirp@^0.5.1:
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
+ integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
+ dependencies:
+ minimist "0.0.8"
+
+moo@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
+ integrity sha512-gFD2xGCl8YFgGHsqJ9NKRVdwlioeW3mI1iqfLNYQOv0+6JRwG58Zk9DIGQgyIaffSYaO1xsKnMaYzzNr1KyIAw==
+
+ms@2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
+ integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
+
+ms@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
+ integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
+
+nan@^2.12.1:
+ version "2.13.2"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7"
+ integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==
+
+nanomatch@^1.2.9:
+ version "1.2.13"
+ resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
+ integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==
+ dependencies:
+ arr-diff "^4.0.0"
+ array-unique "^0.3.2"
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ fragment-cache "^0.2.1"
+ is-windows "^1.0.2"
+ kind-of "^6.0.2"
+ object.pick "^1.3.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+natural-compare@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+ integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
+
+nearley@^2.7.10:
+ version "2.16.0"
+ resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.16.0.tgz#77c297d041941d268290ec84b739d0ee297e83a7"
+ integrity sha512-Tr9XD3Vt/EujXbZBv6UAHYoLUSMQAxSsTnm9K3koXzjzNWY195NqALeyrzLZBKzAkL3gl92BcSogqrHjD8QuUg==
+ dependencies:
+ commander "^2.19.0"
+ moo "^0.4.3"
+ railroad-diagrams "^1.0.0"
+ randexp "0.4.6"
+ semver "^5.4.1"
+
+needle@^2.2.1:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e"
+ integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==
+ dependencies:
+ debug "^2.1.2"
+ iconv-lite "^0.4.4"
+ sax "^1.2.4"
+
+neo-async@^2.6.0:
+ version "2.6.0"
+ resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835"
+ integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==
+
+nice-try@^1.0.4:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
+ integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
+
+node-fetch@^1.0.1:
+ version "1.7.3"
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
+ integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==
+ dependencies:
+ encoding "^0.1.11"
+ is-stream "^1.0.1"
+
+node-int64@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
+ integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=
+
+node-modules-regexp@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40"
+ integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=
+
+node-notifier@^5.2.1:
+ version "5.4.0"
+ resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a"
+ integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==
+ dependencies:
+ growly "^1.3.0"
+ is-wsl "^1.1.0"
+ semver "^5.5.0"
+ shellwords "^0.1.1"
+ which "^1.3.0"
+
+node-pre-gyp@^0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149"
+ integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==
+ dependencies:
+ detect-libc "^1.0.2"
+ mkdirp "^0.5.1"
+ needle "^2.2.1"
+ nopt "^4.0.1"
+ npm-packlist "^1.1.6"
+ npmlog "^4.0.2"
+ rc "^1.2.7"
+ rimraf "^2.6.1"
+ semver "^5.3.0"
+ tar "^4"
+
+nopt@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
+ integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=
+ dependencies:
+ abbrev "1"
+ osenv "^0.1.4"
+
+normalize-package-data@^2.3.2:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
+ integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==
+ dependencies:
+ hosted-git-info "^2.1.4"
+ resolve "^1.10.0"
+ semver "2 || 3 || 4 || 5"
+ validate-npm-package-license "^3.0.1"
+
+normalize-path@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
+ integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=
+ dependencies:
+ remove-trailing-separator "^1.0.1"
+
+npm-bundled@^1.0.1:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd"
+ integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==
+
+npm-packlist@^1.1.6:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc"
+ integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==
+ dependencies:
+ ignore-walk "^3.0.1"
+ npm-bundled "^1.0.1"
+
+npm-run-path@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
+ integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=
+ dependencies:
+ path-key "^2.0.0"
+
+npmlog@^4.0.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
+ integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
+ dependencies:
+ are-we-there-yet "~1.1.2"
+ console-control-strings "~1.1.0"
+ gauge "~2.7.3"
+ set-blocking "~2.0.0"
+
+nth-check@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
+ integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
+ dependencies:
+ boolbase "~1.0.0"
+
+number-is-nan@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
+ integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
+
+nwsapi@^2.0.7:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.1.tgz#08d6d75e69fd791bdea31507ffafe8c843b67e9c"
+ integrity sha512-T5GaA1J/d34AC8mkrFD2O0DR17kwJ702ZOtJOsS8RpbsQZVOC2/xYFb1i/cw+xdM54JIlMuojjDOYct8GIWtwg==
+
+oauth-sign@~0.9.0:
+ version "0.9.0"
+ resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
+ integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
+
+object-assign@^4.1.0, object-assign@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
+ integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
+
+object-copy@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
+ integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw=
+ dependencies:
+ copy-descriptor "^0.1.0"
+ define-property "^0.2.5"
+ kind-of "^3.0.3"
+
+object-inspect@^1.6.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
+ integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==
+
+object-is@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6"
+ integrity sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=
+
+object-keys@^1.0.11:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
+ integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
+
+object-keys@^1.0.12:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.0.tgz#11bd22348dd2e096a045ab06f6c85bcc340fa032"
+ integrity sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==
+
+object-visit@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
+ integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=
+ dependencies:
+ isobject "^3.0.0"
+
+object.assign@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
+ integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==
+ dependencies:
+ define-properties "^1.1.2"
+ function-bind "^1.1.1"
+ has-symbols "^1.0.0"
+ object-keys "^1.0.11"
+
+object.entries@^1.0.4, object.entries@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
+ integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.12.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
+object.fromentries@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
+ integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.11.0"
+ function-bind "^1.1.1"
+ has "^1.0.1"
+
+object.getownpropertydescriptors@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
+ integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.1"
+
+object.pick@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
+ integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=
+ dependencies:
+ isobject "^3.0.1"
+
+object.values@^1.0.4, object.values@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9"
+ integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.12.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
+once@^1.3.0, once@^1.3.1, once@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
+ dependencies:
+ wrappy "1"
+
+optimist@^0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
+ integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY=
+ dependencies:
+ minimist "~0.0.1"
+ wordwrap "~0.0.2"
+
+optionator@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
+ integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=
+ dependencies:
+ deep-is "~0.1.3"
+ fast-levenshtein "~2.0.4"
+ levn "~0.3.0"
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+ wordwrap "~1.0.0"
+
+os-homedir@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
+ integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
+
+os-locale@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
+ integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==
+ dependencies:
+ execa "^1.0.0"
+ lcid "^2.0.0"
+ mem "^4.0.0"
+
+os-tmpdir@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
+ integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
+
+osenv@^0.1.4:
+ version "0.1.5"
+ resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
+ integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
+ dependencies:
+ os-homedir "^1.0.0"
+ os-tmpdir "^1.0.0"
+
+p-defer@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
+ integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=
+
+p-each-series@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71"
+ integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=
+ dependencies:
+ p-reduce "^1.0.0"
+
+p-finally@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
+ integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
+
+p-is-promise@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
+ integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==
+
+p-limit@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
+ integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==
+ dependencies:
+ p-try "^2.0.0"
+
+p-locate@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
+ integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==
+ dependencies:
+ p-limit "^2.0.0"
+
+p-reduce@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa"
+ integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=
+
+p-try@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
+ integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
+
+parse-json@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
+ integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=
+ dependencies:
+ error-ex "^1.3.1"
+ json-parse-better-errors "^1.0.1"
+
+parse5@4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
+ integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==
+
+parse5@^3.0.1:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c"
+ integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==
+ dependencies:
+ "@types/node" "*"
+
+pascalcase@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
+ integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=
+
+path-exists@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
+ integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
+
+path-is-absolute@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+ integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
+
+path-key@^2.0.0, path-key@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
+ integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
+
+path-parse@^1.0.6:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
+ integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
+
+path-type@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
+ integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==
+ dependencies:
+ pify "^3.0.0"
+
+performance-now@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
+ integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
+
+pify@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
+ integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
+
+pify@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
+ integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==
+
+pirates@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"
+ integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==
+ dependencies:
+ node-modules-regexp "^1.0.0"
+
+pkg-dir@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
+ integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==
+ dependencies:
+ find-up "^3.0.0"
+
+pn@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
+ integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==
+
+posix-character-classes@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
+ integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
+
+prelude-ls@~1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
+ integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
+
+pretty-format@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
+ integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ ansi-regex "^4.0.0"
+ ansi-styles "^3.2.0"
+ react-is "^16.8.4"
+
+process-nextick-args@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
+ integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
+
+promise@^7.1.1:
+ version "7.3.1"
+ resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
+ integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==
+ dependencies:
+ asap "~2.0.3"
+
+prompts@^2.0.1:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db"
+ integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==
+ dependencies:
+ kleur "^3.0.2"
+ sisteransi "^1.0.0"
+
+prop-types-exact@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869"
+ integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==
+ dependencies:
+ has "^1.0.3"
+ object.assign "^4.1.0"
+ reflect.ownkeys "^0.2.0"
+
+prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:
+ version "15.7.2"
+ resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
+ integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
+ dependencies:
+ loose-envify "^1.4.0"
+ object-assign "^4.1.1"
+ react-is "^16.8.1"
+
+psl@^1.1.24, psl@^1.1.28:
+ version "1.1.31"
+ resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
+ integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
+
+pump@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
+ integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
+ dependencies:
+ end-of-stream "^1.1.0"
+ once "^1.3.1"
+
+punycode@^1.4.1:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
+ integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
+
+punycode@^2.1.0, punycode@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
+ integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
+
+qs@~6.5.2:
+ version "6.5.2"
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
+ integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
+
+raf@^3.4.0:
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
+ integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
+ dependencies:
+ performance-now "^2.1.0"
+
+railroad-diagrams@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e"
+ integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234=
+
+randexp@0.4.6:
+ version "0.4.6"
+ resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3"
+ integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==
+ dependencies:
+ discontinuous-range "1.0.0"
+ ret "~0.1.10"
+
+rc@^1.2.7:
+ version "1.2.8"
+ resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
+ integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
+ dependencies:
+ deep-extend "^0.6.0"
+ ini "~1.3.0"
+ minimist "^1.2.0"
+ strip-json-comments "~2.0.1"
+
+react-dom@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6"
+ integrity sha512-1Gin+wghF/7gl4Cqcvr1DxFX2Osz7ugxSwl6gBqCMpdrxHjIFUS7GYxrFftZ9Ln44FHw0JxCFD9YtZsrbR5/4A==
+ dependencies:
+ fbjs "^0.8.16"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+
+react-is@^16.4.1, react-is@^16.8.4, react-is@^16.8.6:
+ version "16.8.6"
+ resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
+ integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
+
+react-is@^16.8.1:
+ version "16.8.5"
+ resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.5.tgz#c54ac229dd66b5afe0de5acbe47647c3da692ff8"
+ integrity sha512-sudt2uq5P/2TznPV4Wtdi+Lnq3yaYW8LfvPKLM9BKD8jJNBkxMVyB0C9/GmVhLw7Jbdmndk/73n7XQGeN9A3QQ==
+
+react-test-renderer@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.1.tgz#f2fb30c2c7b517db6e5b10ed20bb6b0a7ccd8d70"
+ integrity sha512-wyyiPxRZOTpKnNIgUBOB6xPLTpIzwcQMIURhZvzUqZzezvHjaGNsDPBhMac5fIY3Jf5NuKxoGvV64zDSOECPPQ==
+ dependencies:
+ fbjs "^0.8.16"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+ react-is "^16.4.1"
+
+react-test-renderer@^16.0.0-0:
+ version "16.8.6"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1"
+ integrity sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw==
+ dependencies:
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ react-is "^16.8.6"
+ scheduler "^0.13.6"
+
+react@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32"
+ integrity sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg==
+ dependencies:
+ fbjs "^0.8.16"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+
+read-pkg-up@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978"
+ integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==
+ dependencies:
+ find-up "^3.0.0"
+ read-pkg "^3.0.0"
+
+read-pkg@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
+ integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=
+ dependencies:
+ load-json-file "^4.0.0"
+ normalize-package-data "^2.3.2"
+ path-type "^3.0.0"
+
+readable-stream@^2.0.1, readable-stream@^2.0.6:
+ version "2.3.6"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
+ integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.3"
+ isarray "~1.0.0"
+ process-nextick-args "~2.0.0"
+ safe-buffer "~5.1.1"
+ string_decoder "~1.1.1"
+ util-deprecate "~1.0.1"
+
+readable-stream@^3.1.1:
+ version "3.4.0"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc"
+ integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==
+ dependencies:
+ inherits "^2.0.3"
+ string_decoder "^1.1.1"
+ util-deprecate "^1.0.1"
+
+realpath-native@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c"
+ integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==
+ dependencies:
+ util.promisify "^1.0.0"
+
+reflect.ownkeys@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
+ integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=
+
+regex-not@^1.0.0, regex-not@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
+ integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==
+ dependencies:
+ extend-shallow "^3.0.2"
+ safe-regex "^1.1.0"
+
+remove-trailing-separator@^1.0.1:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
+ integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8=
+
+repeat-element@^1.1.2:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce"
+ integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==
+
+repeat-string@^1.6.1:
+ version "1.6.1"
+ resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
+ integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=
+
+request-promise-core@1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346"
+ integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==
+ dependencies:
+ lodash "^4.17.11"
+
+request-promise-native@^1.0.5:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59"
+ integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==
+ dependencies:
+ request-promise-core "1.1.2"
+ stealthy-require "^1.1.1"
+ tough-cookie "^2.3.3"
+
+request@^2.87.0:
+ version "2.88.0"
+ resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
+ integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
+ dependencies:
+ aws-sign2 "~0.7.0"
+ aws4 "^1.8.0"
+ caseless "~0.12.0"
+ combined-stream "~1.0.6"
+ extend "~3.0.2"
+ forever-agent "~0.6.1"
+ form-data "~2.3.2"
+ har-validator "~5.1.0"
+ http-signature "~1.2.0"
+ is-typedarray "~1.0.0"
+ isstream "~0.1.2"
+ json-stringify-safe "~5.0.1"
+ mime-types "~2.1.19"
+ oauth-sign "~0.9.0"
+ performance-now "^2.1.0"
+ qs "~6.5.2"
+ safe-buffer "^5.1.2"
+ tough-cookie "~2.4.3"
+ tunnel-agent "^0.6.0"
+ uuid "^3.3.2"
+
+require-directory@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
+ integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
+
+require-main-filename@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
+ integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=
+
+require-main-filename@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
+ integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
+
+resolve-cwd@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
+ integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=
+ dependencies:
+ resolve-from "^3.0.0"
+
+resolve-from@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
+ integrity sha1-six699nWiBvItuZTM17rywoYh0g=
+
+resolve-url@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
+ integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
+
+resolve@1.1.7:
+ version "1.1.7"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
+ integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
+
+resolve@^1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba"
+ integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==
+ dependencies:
+ path-parse "^1.0.6"
+
+resolve@^1.3.2:
+ version "1.11.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232"
+ integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==
+ dependencies:
+ path-parse "^1.0.6"
+
+ret@~0.1.10:
+ version "0.1.15"
+ resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
+ integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
+
+rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3:
+ version "2.6.3"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
+ integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
+ dependencies:
+ glob "^7.1.3"
+
+rst-selector-parser@^2.2.3:
+ version "2.2.3"
+ resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91"
+ integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE=
+ dependencies:
+ lodash.flattendeep "^4.4.0"
+ nearley "^2.7.10"
+
+rsvp@^4.8.4:
+ version "4.8.4"
+ resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911"
+ integrity sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==
+
+safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
+ integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
+
+safe-regex@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
+ integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4=
+ dependencies:
+ ret "~0.1.10"
+
+"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
+ integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
+
+sane@^4.0.3:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded"
+ integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==
+ dependencies:
+ "@cnakazawa/watch" "^1.0.3"
+ anymatch "^2.0.0"
+ capture-exit "^2.0.0"
+ exec-sh "^0.3.2"
+ execa "^1.0.0"
+ fb-watchman "^2.0.0"
+ micromatch "^3.1.4"
+ minimist "^1.1.1"
+ walker "~1.0.5"
+
+sax@^1.2.4:
+ version "1.2.4"
+ resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
+ integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
+
+scheduler@^0.13.6:
+ version "0.13.6"
+ resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
+ integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+
+"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0:
+ version "5.6.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
+ integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
+
+semver@^5.4.1, semver@^5.6.0, semver@^5.7.0:
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
+ integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
+
+semver@^6.0.0:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b"
+ integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==
+
+set-blocking@^2.0.0, set-blocking@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
+ integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
+
+set-value@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1"
+ integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE=
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-extendable "^0.1.1"
+ is-plain-object "^2.0.1"
+ to-object-path "^0.3.0"
+
+set-value@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274"
+ integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-extendable "^0.1.1"
+ is-plain-object "^2.0.3"
+ split-string "^3.0.1"
+
+setimmediate@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
+ integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
+
+shebang-command@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
+ integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=
+ dependencies:
+ shebang-regex "^1.0.0"
+
+shebang-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
+ integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
+
+shellwords@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
+ integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
+
+signal-exit@^3.0.0, signal-exit@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
+ integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
+
+sisteransi@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c"
+ integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ==
+
+slash@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
+ integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
+
+snapdragon-node@^2.0.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
+ integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==
+ dependencies:
+ define-property "^1.0.0"
+ isobject "^3.0.0"
+ snapdragon-util "^3.0.1"
+
+snapdragon-util@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
+ integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==
+ dependencies:
+ kind-of "^3.2.0"
+
+snapdragon@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d"
+ integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==
+ dependencies:
+ base "^0.11.1"
+ debug "^2.2.0"
+ define-property "^0.2.5"
+ extend-shallow "^2.0.1"
+ map-cache "^0.2.2"
+ source-map "^0.5.6"
+ source-map-resolve "^0.5.0"
+ use "^3.1.0"
+
+source-map-resolve@^0.5.0:
+ version "0.5.2"
+ resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259"
+ integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==
+ dependencies:
+ atob "^2.1.1"
+ decode-uri-component "^0.2.0"
+ resolve-url "^0.2.1"
+ source-map-url "^0.4.0"
+ urix "^0.1.0"
+
+source-map-support@^0.5.6:
+ version "0.5.11"
+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.11.tgz#efac2ce0800355d026326a0ca23e162aeac9a4e2"
+ integrity sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==
+ dependencies:
+ buffer-from "^1.0.0"
+ source-map "^0.6.0"
+
+source-map-url@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
+ integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=
+
+source-map@^0.5.0, source-map@^0.5.6:
+ version "0.5.7"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
+ integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
+
+source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
+ integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
+
+spdx-correct@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4"
+ integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==
+ dependencies:
+ spdx-expression-parse "^3.0.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-exceptions@^2.1.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977"
+ integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==
+
+spdx-expression-parse@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
+ integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==
+ dependencies:
+ spdx-exceptions "^2.1.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-license-ids@^3.0.0:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e"
+ integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==
+
+split-string@^3.0.1, split-string@^3.0.2:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
+ integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==
+ dependencies:
+ extend-shallow "^3.0.0"
+
+sshpk@^1.7.0:
+ version "1.16.1"
+ resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
+ integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
+ dependencies:
+ asn1 "~0.2.3"
+ assert-plus "^1.0.0"
+ bcrypt-pbkdf "^1.0.0"
+ dashdash "^1.12.0"
+ ecc-jsbn "~0.1.1"
+ getpass "^0.1.1"
+ jsbn "~0.1.0"
+ safer-buffer "^2.0.2"
+ tweetnacl "~0.14.0"
+
+stack-utils@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8"
+ integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==
+
+static-extend@^0.1.1:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
+ integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=
+ dependencies:
+ define-property "^0.2.5"
+ object-copy "^0.1.0"
+
+stealthy-require@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
+ integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
+
+string-length@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
+ integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=
+ dependencies:
+ astral-regex "^1.0.0"
+ strip-ansi "^4.0.0"
+
+string-width@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
+ integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
+ dependencies:
+ code-point-at "^1.0.0"
+ is-fullwidth-code-point "^1.0.0"
+ strip-ansi "^3.0.0"
+
+"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
+ integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
+ dependencies:
+ is-fullwidth-code-point "^2.0.0"
+ strip-ansi "^4.0.0"
+
+string.prototype.trim@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
+ integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.0"
+ function-bind "^1.0.2"
+
+string_decoder@^1.1.1:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d"
+ integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==
+ dependencies:
+ safe-buffer "~5.1.0"
+
+string_decoder@~1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
+ integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
+ dependencies:
+ safe-buffer "~5.1.0"
+
+strip-ansi@^3.0.0, strip-ansi@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
+ integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
+ dependencies:
+ ansi-regex "^2.0.0"
+
+strip-ansi@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
+ integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
+ dependencies:
+ ansi-regex "^3.0.0"
+
+strip-ansi@^5.0.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
+ integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
+ dependencies:
+ ansi-regex "^4.1.0"
+
+strip-bom@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
+ integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
+
+strip-eof@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
+ integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=
+
+strip-json-comments@~2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+ integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
+
+supports-color@^5.3.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
+ dependencies:
+ has-flag "^3.0.0"
+
+supports-color@^6.1.0:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3"
+ integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==
+ dependencies:
+ has-flag "^3.0.0"
+
+symbol-tree@^3.2.2:
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
+ integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=
+
+tar@^4:
+ version "4.4.8"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d"
+ integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==
+ dependencies:
+ chownr "^1.1.1"
+ fs-minipass "^1.2.5"
+ minipass "^2.3.4"
+ minizlib "^1.1.1"
+ mkdirp "^0.5.0"
+ safe-buffer "^5.1.2"
+ yallist "^3.0.2"
+
+test-exclude@^5.2.3:
+ version "5.2.3"
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0"
+ integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==
+ dependencies:
+ glob "^7.1.3"
+ minimatch "^3.0.4"
+ read-pkg-up "^4.0.0"
+ require-main-filename "^2.0.0"
+
+throat@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
+ integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=
+
+tmpl@1.0.x:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
+ integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
+
+to-fast-properties@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
+ integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
+
+to-object-path@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
+ integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=
+ dependencies:
+ kind-of "^3.0.2"
+
+to-regex-range@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
+ integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=
+ dependencies:
+ is-number "^3.0.0"
+ repeat-string "^1.6.1"
+
+to-regex@^3.0.1, to-regex@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
+ integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==
+ dependencies:
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ regex-not "^1.0.2"
+ safe-regex "^1.1.0"
+
+tough-cookie@^2.3.3, tough-cookie@^2.3.4:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
+ integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
+ dependencies:
+ psl "^1.1.28"
+ punycode "^2.1.1"
+
+tough-cookie@~2.4.3:
+ version "2.4.3"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
+ integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
+ dependencies:
+ psl "^1.1.24"
+ punycode "^1.4.1"
+
+tr46@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
+ integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=
+ dependencies:
+ punycode "^2.1.0"
+
+trim-right@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
+ integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=
+
+tunnel-agent@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
+ integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
+ dependencies:
+ safe-buffer "^5.0.1"
+
+tweetnacl@^0.14.3, tweetnacl@~0.14.0:
+ version "0.14.5"
+ resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
+ integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
+
+type-check@~0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
+ integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=
+ dependencies:
+ prelude-ls "~1.1.2"
+
+ua-parser-js@^0.7.18:
+ version "0.7.19"
+ resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b"
+ integrity sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==
+
+uglify-js@^3.1.4:
+ version "3.5.2"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.2.tgz#dc0c7ac2da0a4b7d15e84266818ff30e82529474"
+ integrity sha512-imog1WIsi9Yb56yRt5TfYVxGmnWs3WSGU73ieSOlMVFwhJCA9W8fqFFMMj4kgDqiS/80LGdsYnWL7O9UcjEBlg==
+ dependencies:
+ commander "~2.19.0"
+ source-map "~0.6.1"
+
+union-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"
+ integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=
+ dependencies:
+ arr-union "^3.1.0"
+ get-value "^2.0.6"
+ is-extendable "^0.1.1"
+ set-value "^0.4.3"
+
+unset-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
+ integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=
+ dependencies:
+ has-value "^0.3.1"
+ isobject "^3.0.0"
+
+uri-js@^4.2.2:
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
+ integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
+ dependencies:
+ punycode "^2.1.0"
+
+urix@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
+ integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
+
+use@^3.1.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
+ integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==
+
+util-deprecate@^1.0.1, util-deprecate@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
+ integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
+
+util.promisify@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
+ integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==
+ dependencies:
+ define-properties "^1.1.2"
+ object.getownpropertydescriptors "^2.0.3"
+
+uuid@^3.3.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
+ integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
+
+validate-npm-package-license@^3.0.1:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
+ integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==
+ dependencies:
+ spdx-correct "^3.0.0"
+ spdx-expression-parse "^3.0.0"
+
+verror@1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
+ integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
+ dependencies:
+ assert-plus "^1.0.0"
+ core-util-is "1.0.2"
+ extsprintf "^1.2.0"
+
+w3c-hr-time@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
+ integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=
+ dependencies:
+ browser-process-hrtime "^0.1.2"
+
+walker@^1.0.7, walker@~1.0.5:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb"
+ integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=
+ dependencies:
+ makeerror "1.0.x"
+
+webidl-conversions@^4.0.2:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
+ integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
+
+whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"
+ integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==
+ dependencies:
+ iconv-lite "0.4.24"
+
+whatwg-fetch@>=0.10.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
+ integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
+
+whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
+ integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==
+
+whatwg-url@^6.4.1:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8"
+ integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==
+ dependencies:
+ lodash.sortby "^4.7.0"
+ tr46 "^1.0.1"
+ webidl-conversions "^4.0.2"
+
+whatwg-url@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd"
+ integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==
+ dependencies:
+ lodash.sortby "^4.7.0"
+ tr46 "^1.0.1"
+ webidl-conversions "^4.0.2"
+
+which-module@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
+ integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
+
+which@^1.2.9, which@^1.3.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
+ integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
+ dependencies:
+ isexe "^2.0.0"
+
+wide-align@^1.1.0:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
+ integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==
+ dependencies:
+ string-width "^1.0.2 || 2"
+
+wordwrap@~0.0.2:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
+ integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc=
+
+wordwrap@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
+ integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
+
+wrap-ansi@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
+ integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=
+ dependencies:
+ string-width "^1.0.1"
+ strip-ansi "^3.0.1"
+
+wrappy@1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+
+write-file-atomic@2.4.1:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529"
+ integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==
+ dependencies:
+ graceful-fs "^4.1.11"
+ imurmurhash "^0.1.4"
+ signal-exit "^3.0.2"
+
+ws@^5.2.0:
+ version "5.2.2"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f"
+ integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==
+ dependencies:
+ async-limiter "~1.0.0"
+
+xml-name-validator@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
+ integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==
+
+"y18n@^3.2.1 || ^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
+ integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
+
+yallist@^3.0.0, yallist@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9"
+ integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==
+
+yargs-parser@^11.1.1:
+ version "11.1.1"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4"
+ integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==
+ dependencies:
+ camelcase "^5.0.0"
+ decamelize "^1.2.0"
+
+yargs@^12.0.2:
+ version "12.0.5"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13"
+ integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==
+ dependencies:
+ cliui "^4.0.0"
+ decamelize "^1.2.0"
+ find-up "^3.0.0"
+ get-caller-file "^1.0.1"
+ os-locale "^3.0.0"
+ require-directory "^2.1.1"
+ require-main-filename "^1.0.1"
+ set-blocking "^2.0.0"
+ string-width "^2.0.0"
+ which-module "^2.0.0"
+ y18n "^3.2.1 || ^4.0.0"
+ yargs-parser "^11.1.1"
diff --git a/devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js b/devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js
new file mode 100644
index 0000000000..8611c174f5
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = {
+ // Extend from the common devtools xpcshell eslintrc config.
+ extends: "../../../../.eslintrc.xpcshell.js",
+};
diff --git a/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js b/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js
new file mode 100644
index 0000000000..1ec9f0d7c2
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js
@@ -0,0 +1,27 @@
+/* global equal */
+
+"use strict";
+
+const {
+ parseFileUri,
+} = require("resource://devtools/client/aboutdebugging/src/modules/extensions-helper.js");
+
+add_task(async function testParseFileUri() {
+ equal(
+ parseFileUri("file:///home/me/my-extension/"),
+ "/home/me/my-extension/",
+ "UNIX paths are supported"
+ );
+
+ equal(
+ parseFileUri("file:///C:/Documents/my-extension/"),
+ "C:/Documents/my-extension/",
+ "Windows paths are supported"
+ );
+
+ equal(
+ parseFileUri("file://home/Documents/my-extension/"),
+ "home/Documents/my-extension/",
+ "Windows network paths are supported"
+ );
+});
diff --git a/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js
new file mode 100644
index 0000000000..637e42e078
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js
@@ -0,0 +1,203 @@
+"use strict";
+
+const { sinon } = ChromeUtils.importESModule(
+ "resource://testing-common/Sinon.sys.mjs"
+);
+const {
+ setDefaultPreferencesIfNeeded,
+ PREFERENCE_TYPES,
+} = require("resource://devtools/client/aboutdebugging/src/modules/runtime-default-preferences.js");
+
+const CHAR_PREF = "some.char.pref";
+const BOOL_PREF = "some.bool.pref";
+const INT_PREF = "some.int.pref";
+
+const TEST_PREFERENCES = [
+ {
+ prefName: BOOL_PREF,
+ defaultValue: false,
+ trait: "boolPrefTrait",
+ type: PREFERENCE_TYPES.BOOL,
+ },
+ {
+ prefName: CHAR_PREF,
+ defaultValue: "",
+ trait: "charPrefTrait",
+ type: PREFERENCE_TYPES.CHAR,
+ },
+ {
+ prefName: INT_PREF,
+ defaultValue: 1,
+ trait: "intPrefTrait",
+ type: PREFERENCE_TYPES.INT,
+ },
+];
+
+add_task(async function test_with_traits() {
+ // Create a front that indicates that the preferences should be safe to query.
+ // We should not perform any additional call to the preferences front.
+ const preferencesFront = {
+ getTraits: () => ({
+ boolPrefTrait: true,
+ charPrefTrait: true,
+ intPrefTrait: true,
+ }),
+
+ setBoolPref: sinon.spy(),
+ getBoolPref: sinon.spy(),
+ setCharPref: sinon.spy(),
+ getCharPref: sinon.spy(),
+ setIntPref: sinon.spy(),
+ getIntPref: sinon.spy(),
+ };
+
+ const clientWrapper = createClientWrapper(preferencesFront);
+ await setDefaultPreferencesIfNeeded(clientWrapper, TEST_PREFERENCES);
+
+ // Check get/setBoolPref spies
+ ok(preferencesFront.getBoolPref.notCalled, "getBoolPref was not called");
+ ok(preferencesFront.setBoolPref.notCalled, "setBoolPref was not called");
+
+ // Check get/setCharPref spies
+ ok(preferencesFront.getCharPref.notCalled, "getCharPref was not called");
+ ok(preferencesFront.setCharPref.notCalled, "setCharPref was not called");
+
+ // Check get/setIntPref spies
+ ok(preferencesFront.getIntPref.notCalled, "getIntPref was not called");
+ ok(preferencesFront.setIntPref.notCalled, "setIntPref was not called");
+});
+
+add_task(async function test_without_traits_no_error() {
+ // Create a front that indicates that the preferences are missing, but which
+ // doesn't fail when getting the preferences. This will typically happen when
+ // the user managed to set the preference on the remote runtime.
+ // We should not erase user values, so we should not call the set*Pref APIs.
+ const preferencesFront = {
+ getTraits: () => ({
+ boolPrefTrait: false,
+ charPrefTrait: false,
+ intPrefTrait: false,
+ }),
+
+ setBoolPref: sinon.spy(),
+ getBoolPref: sinon.spy(),
+ setCharPref: sinon.spy(),
+ getCharPref: sinon.spy(),
+ setIntPref: sinon.spy(),
+ getIntPref: sinon.spy(),
+ };
+
+ const clientWrapper = createClientWrapper(preferencesFront);
+ await setDefaultPreferencesIfNeeded(clientWrapper, TEST_PREFERENCES);
+
+ // Check get/setBoolPref spies
+ ok(
+ preferencesFront.getBoolPref.calledWith(BOOL_PREF),
+ "getBoolPref was called with the proper preference name"
+ );
+ ok(preferencesFront.getBoolPref.calledOnce, "getBoolPref was called once");
+ ok(preferencesFront.setBoolPref.notCalled, "setBoolPref was not called");
+
+ // Check get/setCharPref spies
+ ok(
+ preferencesFront.getCharPref.calledWith(CHAR_PREF),
+ "getCharPref was called with the proper preference name"
+ );
+ ok(preferencesFront.getCharPref.calledOnce, "getCharPref was called once");
+ ok(preferencesFront.setCharPref.notCalled, "setCharPref was not called");
+
+ // Check get/setIntPref spies
+ ok(
+ preferencesFront.getIntPref.calledWith(INT_PREF),
+ "getIntPref was called with the proper preference name"
+ );
+ ok(preferencesFront.getIntPref.calledOnce, "getIntPref was called once");
+ ok(preferencesFront.setIntPref.notCalled, "setIntPref was not called");
+});
+
+add_task(async function test_without_traits_with_error() {
+ // Create a front that indicates that the preferences are missing, and which
+ // will also throw when attempting to get said preferences.
+ // This should lead to create default values for the preferences.
+ const preferencesFront = {
+ getTraits: () => ({
+ boolPrefTrait: false,
+ charPrefTrait: false,
+ intPrefTrait: false,
+ }),
+
+ setBoolPref: sinon.spy(),
+ getBoolPref: sinon.spy(pref => {
+ if (pref === BOOL_PREF) {
+ throw new Error("Invalid preference");
+ }
+ }),
+ setCharPref: sinon.spy(),
+ getCharPref: sinon.spy(pref => {
+ if (pref === CHAR_PREF) {
+ throw new Error("Invalid preference");
+ }
+ }),
+ setIntPref: sinon.spy(),
+ getIntPref: sinon.spy(pref => {
+ if (pref === INT_PREF) {
+ throw new Error("Invalid preference");
+ }
+ }),
+ };
+
+ const clientWrapper = createClientWrapper(preferencesFront);
+ await setDefaultPreferencesIfNeeded(clientWrapper, TEST_PREFERENCES);
+
+ // Check get/setBoolPref spies
+ ok(preferencesFront.getBoolPref.calledOnce, "getBoolPref was called once");
+ ok(preferencesFront.getBoolPref.threw(), "getBoolPref threw");
+ ok(
+ preferencesFront.getBoolPref.calledWith(BOOL_PREF),
+ "getBoolPref was called with the proper preference name"
+ );
+
+ ok(preferencesFront.setBoolPref.calledOnce, "setBoolPref was called once");
+ ok(
+ preferencesFront.setBoolPref.calledWith(BOOL_PREF, false),
+ "setBoolPref was called with the proper preference name and value"
+ );
+
+ // Check get/setCharPref spies
+ ok(preferencesFront.getCharPref.calledOnce, "getCharPref was called once");
+ ok(preferencesFront.getCharPref.threw(), "getCharPref threw");
+ ok(
+ preferencesFront.getCharPref.calledWith(CHAR_PREF),
+ "getCharPref was called with the proper preference name"
+ );
+
+ ok(preferencesFront.setCharPref.calledOnce, "setCharPref was called once");
+ ok(
+ preferencesFront.setCharPref.calledWith(CHAR_PREF, ""),
+ "setCharPref was called with the proper preference name and value"
+ );
+
+ // Check get/setIntPref spies
+ ok(preferencesFront.getIntPref.calledOnce, "getIntPref was called once");
+ ok(preferencesFront.getIntPref.threw(), "getIntPref threw");
+ ok(
+ preferencesFront.getIntPref.calledWith(INT_PREF),
+ "getIntPref was called with the proper preference name"
+ );
+
+ ok(preferencesFront.setIntPref.calledOnce, "setIntPref was called once");
+ ok(
+ preferencesFront.setIntPref.calledWith(INT_PREF, 1),
+ "setIntPref was called with the proper preference name and value"
+ );
+});
+
+function createClientWrapper(preferencesFront) {
+ const clientWrapper = {
+ getFront: name => {
+ return preferencesFront;
+ },
+ };
+
+ return clientWrapper;
+}
diff --git a/devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js b/devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js
new file mode 100644
index 0000000000..733c0400da
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js
@@ -0,0 +1,10 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+const { require } = ChromeUtils.importESModule(
+ "resource://devtools/shared/loader/Loader.sys.mjs"
+);
diff --git a/devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini b/devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini
new file mode 100644
index 0000000000..42954757e8
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini
@@ -0,0 +1,8 @@
+[DEFAULT]
+tags = devtools
+head = xpcshell-head.js
+firefox-appdir = browser
+skip-if = toolkit == 'android'
+
+[test_extensions_path.js]
+[test_runtime_default_preferences.js]
diff --git a/devtools/client/accessibility/accessibility-proxy.js b/devtools/client/accessibility/accessibility-proxy.js
new file mode 100644
index 0000000000..287ea44b71
--- /dev/null
+++ b/devtools/client/accessibility/accessibility-proxy.js
@@ -0,0 +1,595 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+loader.lazyRequireGetter(
+ this,
+ "CombinedProgress",
+ "resource://devtools/client/accessibility/utils/audit.js",
+ true
+);
+
+const {
+ accessibility: { AUDIT_TYPE },
+} = require("resource://devtools/shared/constants.js");
+const {
+ FILTERS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Component responsible for tracking all Accessibility fronts in parent and
+ * content processes.
+ */
+class AccessibilityProxy {
+ #panel;
+ constructor(commands, panel) {
+ this.commands = commands;
+ this.#panel = panel;
+
+ this._accessibilityWalkerFronts = new Set();
+ this.lifecycleEvents = new Map();
+ this.accessibilityEvents = new Map();
+ this.supports = {};
+
+ this.audit = this.audit.bind(this);
+ this.enableAccessibility = this.enableAccessibility.bind(this);
+ this.getAccessibilityTreeRoot = this.getAccessibilityTreeRoot.bind(this);
+ this.resetAccessiblity = this.resetAccessiblity.bind(this);
+ this.startListeningForAccessibilityEvents =
+ this.startListeningForAccessibilityEvents.bind(this);
+ this.startListeningForLifecycleEvents =
+ this.startListeningForLifecycleEvents.bind(this);
+ this.startListeningForParentLifecycleEvents =
+ this.startListeningForParentLifecycleEvents.bind(this);
+ this.stopListeningForAccessibilityEvents =
+ this.stopListeningForAccessibilityEvents.bind(this);
+ this.stopListeningForLifecycleEvents =
+ this.stopListeningForLifecycleEvents.bind(this);
+ this.stopListeningForParentLifecycleEvents =
+ this.stopListeningForParentLifecycleEvents.bind(this);
+ this.highlightAccessible = this.highlightAccessible.bind(this);
+ this.unhighlightAccessible = this.unhighlightAccessible.bind(this);
+ this.onTargetAvailable = this.onTargetAvailable.bind(this);
+ this.onTargetDestroyed = this.onTargetDestroyed.bind(this);
+ this.onTargetSelected = this.onTargetSelected.bind(this);
+ this.onResourceAvailable = this.onResourceAvailable.bind(this);
+ this.onAccessibilityFrontAvailable =
+ this.onAccessibilityFrontAvailable.bind(this);
+ this.onAccessibilityFrontDestroyed =
+ this.onAccessibilityFrontDestroyed.bind(this);
+ this.onAccessibleWalkerFrontAvailable =
+ this.onAccessibleWalkerFrontAvailable.bind(this);
+ this.onAccessibleWalkerFrontDestroyed =
+ this.onAccessibleWalkerFrontDestroyed.bind(this);
+ this.unhighlightBeforeCalling = this.unhighlightBeforeCalling.bind(this);
+ this.toggleDisplayTabbingOrder = this.toggleDisplayTabbingOrder.bind(this);
+ }
+
+ get enabled() {
+ return this.accessibilityFront && this.accessibilityFront.enabled;
+ }
+
+ /**
+ * Indicates whether the accessibility service is enabled.
+ */
+ get canBeEnabled() {
+ return this.parentAccessibilityFront.canBeEnabled;
+ }
+
+ get currentTarget() {
+ return this.commands.targetCommand.selectedTargetFront;
+ }
+
+ /**
+ * Perform an audit for a given filter.
+ *
+ * @param {String} filter
+ * Type of an audit to perform.
+ * @param {Function} onProgress
+ * Audit progress callback.
+ *
+ * @return {Promise}
+ * Resolves when the audit for every document, that each of the frame
+ * accessibility walkers traverse, completes.
+ */
+ async audit(filter, onProgress) {
+ const types = filter === FILTERS.ALL ? Object.values(AUDIT_TYPE) : [filter];
+
+ const targetTypes = [this.commands.targetCommand.TYPES.FRAME];
+ const targets =
+ await this.commands.targetCommand.getAllTargetsInSelectedTargetTree(
+ targetTypes
+ );
+
+ const progress = new CombinedProgress({
+ onProgress,
+ totalFrames: targets.length,
+ });
+ const audits = await this.withAllAccessibilityWalkerFronts(
+ async accessibleWalkerFront =>
+ accessibleWalkerFront.audit({
+ types,
+ onProgress: progress.onProgressForWalker.bind(
+ progress,
+ accessibleWalkerFront
+ ),
+ // If a frame was selected in the iframe picker, we don't want to retrieve the
+ // ancestries at it would mess with the tree structure and would make it misbehave.
+ retrieveAncestries:
+ this.commands.targetCommand.isTopLevelTargetSelected(),
+ })
+ );
+
+ // Accumulate all audits into a single structure.
+ const combinedAudit = { ancestries: [] };
+ for (const audit of audits) {
+ // If any of the audits resulted in an error, no need to continue.
+ if (audit.error) {
+ return audit;
+ }
+
+ combinedAudit.ancestries.push(...audit.ancestries);
+ }
+
+ return combinedAudit;
+ }
+
+ async toggleDisplayTabbingOrder(displayTabbingOrder) {
+ if (displayTabbingOrder) {
+ const { walker: domWalkerFront } = await this.currentTarget.getFront(
+ "inspector"
+ );
+ await this.accessibilityFront.accessibleWalkerFront.showTabbingOrder(
+ await domWalkerFront.getRootNode(),
+ 0
+ );
+ } else {
+ // we don't want to use withAllAccessibilityWalkerFronts as it only acts on selected
+ // target tree, and we want to hide _all_ highlighters.
+ const accessibilityFronts =
+ await this.commands.targetCommand.getAllFronts(
+ [this.commands.targetCommand.TYPES.FRAME],
+ "accessibility"
+ );
+ await Promise.all(
+ accessibilityFronts.map(accessibilityFront =>
+ accessibilityFront.accessibleWalkerFront.hideTabbingOrder()
+ )
+ );
+ }
+ }
+
+ async enableAccessibility() {
+ // Accessibility service is initialized using the parent accessibility
+ // front. That, in turn, initializes accessibility service in all content
+ // processes. We need to wait until that happens to be sure platform
+ // accessibility is fully enabled.
+ const enabled = this.accessibilityFront.once("init");
+ await this.parentAccessibilityFront.enable();
+ await enabled;
+ }
+
+ /**
+ * Return the topmost level accessibility walker to be used as the root of
+ * the accessibility tree view.
+ *
+ * @return {Object}
+ * Topmost accessibility walker.
+ */
+ getAccessibilityTreeRoot() {
+ return this.accessibilityFront.accessibleWalkerFront;
+ }
+
+ /**
+ * Look up accessibility fronts (get an existing one or create a new one) for
+ * all existing target fronts and run a task with each one of them.
+ * @param {Function} task
+ * Function to execute with each accessiblity front.
+ */
+ async withAllAccessibilityFronts(taskFn) {
+ const accessibilityFronts = await this.commands.targetCommand.getAllFronts(
+ [this.commands.targetCommand.TYPES.FRAME],
+ "accessibility",
+ {
+ // only get the fronts for the selected frame tree, in case a specific document
+ // is selected in the iframe picker (if not, the top-level target is considered
+ // as the selected target)
+ onlyInSelectedTargetTree: true,
+ }
+ );
+ const tasks = [];
+ for (const accessibilityFront of accessibilityFronts) {
+ tasks.push(taskFn(accessibilityFront));
+ }
+
+ return Promise.all(tasks);
+ }
+
+ /**
+ * Look up accessibility walker fronts (get an existing one or create a new
+ * one using accessibility front) for all existing target fronts and run a
+ * task with each one of them.
+ * @param {Function} task
+ * Function to execute with each accessiblity walker front.
+ */
+ withAllAccessibilityWalkerFronts(taskFn) {
+ return this.withAllAccessibilityFronts(async accessibilityFront =>
+ taskFn(accessibilityFront.accessibleWalkerFront)
+ );
+ }
+
+ /**
+ * Unhighlight previous accessible object if we switched between processes and
+ * call the appropriate event handler.
+ */
+ unhighlightBeforeCalling(listener) {
+ return async accessible => {
+ if (accessible) {
+ const accessibleWalkerFront = accessible.getParent();
+ if (this._currentAccessibleWalkerFront !== accessibleWalkerFront) {
+ if (this._currentAccessibleWalkerFront) {
+ await this._currentAccessibleWalkerFront.unhighlight();
+ }
+
+ this._currentAccessibleWalkerFront = accessibleWalkerFront;
+ }
+ }
+
+ await listener(accessible);
+ };
+ }
+
+ /**
+ * Start picking and add walker listeners.
+ * @param {Boolean} doFocus
+ * If true, move keyboard focus into content.
+ */
+ pick(doFocus, onHovered, onPicked, onPreviewed, onCanceled) {
+ return this.withAllAccessibilityWalkerFronts(
+ async accessibleWalkerFront => {
+ this.startListening(accessibleWalkerFront, {
+ events: {
+ "picker-accessible-hovered":
+ this.unhighlightBeforeCalling(onHovered),
+ "picker-accessible-picked": this.unhighlightBeforeCalling(onPicked),
+ "picker-accessible-previewed":
+ this.unhighlightBeforeCalling(onPreviewed),
+ "picker-accessible-canceled":
+ this.unhighlightBeforeCalling(onCanceled),
+ },
+ // Only register listeners once (for top level), no need to register
+ // them for all walkers again and again.
+ register: accessibleWalkerFront.targetFront.isTopLevel,
+ });
+ await accessibleWalkerFront.pick(
+ // Only pass doFocus to the top level accessibility walker front.
+ doFocus && accessibleWalkerFront.targetFront.isTopLevel
+ );
+ }
+ );
+ }
+
+ /**
+ * Stop picking and remove all walker listeners.
+ */
+ async cancelPick() {
+ this._currentAccessibleWalkerFront = null;
+ return this.withAllAccessibilityWalkerFronts(
+ async accessibleWalkerFront => {
+ await accessibleWalkerFront.cancelPick();
+ this.stopListening(accessibleWalkerFront, {
+ events: {
+ "picker-accessible-hovered": null,
+ "picker-accessible-picked": null,
+ "picker-accessible-previewed": null,
+ "picker-accessible-canceled": null,
+ },
+ // Only unregister listeners once (for top level), no need to
+ // unregister them for all walkers again and again.
+ unregister: accessibleWalkerFront.targetFront.isTopLevel,
+ });
+ }
+ );
+ }
+
+ async resetAccessiblity() {
+ const { enabled } = this.accessibilityFront;
+ const { canBeEnabled, canBeDisabled } = this.parentAccessibilityFront;
+ return { enabled, canBeDisabled, canBeEnabled };
+ }
+
+ startListening(front, { events, register = false } = {}) {
+ for (const [type, listener] of Object.entries(events)) {
+ front.on(type, listener);
+ if (register) {
+ this.registerEvent(front, type, listener);
+ }
+ }
+ }
+
+ stopListening(front, { events, unregister = false } = {}) {
+ for (const [type, listener] of Object.entries(events)) {
+ front.off(type, listener);
+ if (unregister) {
+ this.unregisterEvent(front, type, listener);
+ }
+ }
+ }
+
+ startListeningForAccessibilityEvents(events) {
+ for (const accessibleWalkerFront of this._accessibilityWalkerFronts.values()) {
+ this.startListening(accessibleWalkerFront, {
+ events,
+ // Only register listeners once (for top level), no need to register
+ // them for all walkers again and again.
+ register: accessibleWalkerFront.targetFront.isTopLevel,
+ });
+ }
+ }
+
+ stopListeningForAccessibilityEvents(events) {
+ for (const accessibleWalkerFront of this._accessibilityWalkerFronts.values()) {
+ this.stopListening(accessibleWalkerFront, {
+ events,
+ // Only unregister listeners once (for top level), no need to unregister
+ // them for all walkers again and again.
+ unregister: accessibleWalkerFront.targetFront.isTopLevel,
+ });
+ }
+ }
+
+ startListeningForLifecycleEvents(events) {
+ this.startListening(this.accessibilityFront, { events, register: true });
+ }
+
+ stopListeningForLifecycleEvents(events) {
+ this.stopListening(this.accessibilityFront, { events, unregister: true });
+ }
+
+ startListeningForParentLifecycleEvents(events) {
+ this.startListening(this.parentAccessibilityFront, {
+ events,
+ register: false,
+ });
+ }
+
+ stopListeningForParentLifecycleEvents(events) {
+ this.stopListening(this.parentAccessibilityFront, {
+ events,
+ unregister: false,
+ });
+ }
+
+ highlightAccessible(accessibleFront, options) {
+ if (!accessibleFront) {
+ return;
+ }
+
+ const accessibleWalkerFront = accessibleFront.getParent();
+ if (!accessibleWalkerFront) {
+ return;
+ }
+
+ accessibleWalkerFront
+ .highlightAccessible(accessibleFront, options)
+ .catch(error => {
+ // Only report an error where there's still a commands instance.
+ // Ignore cases where toolbox is already destroyed.
+ if (this.commands) {
+ console.error(error);
+ }
+ });
+ }
+
+ unhighlightAccessible(accessibleFront) {
+ if (!accessibleFront) {
+ return;
+ }
+
+ const accessibleWalkerFront = accessibleFront.getParent();
+ if (!accessibleWalkerFront) {
+ return;
+ }
+
+ accessibleWalkerFront.unhighlight().catch(error => {
+ // Only report an error where there's still a commands instance.
+ // Ignore cases where toolbox is already destroyed.
+ if (this.commands) {
+ console.error(error);
+ }
+ });
+ }
+
+ async initialize() {
+ await this.commands.targetCommand.watchTargets({
+ types: [this.commands.targetCommand.TYPES.FRAME],
+ onAvailable: this.onTargetAvailable,
+ onSelected: this.onTargetSelected,
+ onDestroyed: this.onTargetDestroyed,
+ });
+ await this.commands.resourceCommand.watchResources(
+ [this.commands.resourceCommand.TYPES.DOCUMENT_EVENT],
+ {
+ onAvailable: this.onResourceAvailable,
+ }
+ );
+ this.parentAccessibilityFront =
+ await this.commands.targetCommand.rootFront.getFront(
+ "parentaccessibility"
+ );
+ }
+
+ destroy() {
+ this.commands.targetCommand.unwatchTargets({
+ types: [this.commands.targetCommand.TYPES.FRAME],
+ onAvailable: this.onTargetAvailable,
+ onSelected: this.onTargetSelected,
+ onDestroyed: this.onTargetDestroyed,
+ });
+ this.commands.resourceCommand.unwatchResources(
+ [this.commands.resourceCommand.TYPES.DOCUMENT_EVENT],
+ { onAvailable: this.onResourceAvailable }
+ );
+
+ this.lifecycleEvents.clear();
+ this.accessibilityEvents.clear();
+
+ this.accessibilityFront = null;
+ this.accessibilityFrontGetPromise = null;
+ this.parentAccessibilityFront = null;
+ this.simulatorFront = null;
+ this.simulate = null;
+ this.commands = null;
+ }
+
+ _getEvents(front) {
+ return front.typeName === "accessiblewalker"
+ ? this.accessibilityEvents
+ : this.lifecycleEvents;
+ }
+
+ registerEvent(front, type, listener) {
+ const events = this._getEvents(front);
+ if (events.has(type)) {
+ events.get(type).add(listener);
+ } else {
+ events.set(type, new Set([listener]));
+ }
+ }
+
+ unregisterEvent(front, type, listener) {
+ const events = this._getEvents(front);
+ if (!events.has(type)) {
+ return;
+ }
+
+ if (!listener) {
+ events.delete(type);
+ return;
+ }
+
+ const listeners = events.get(type);
+ if (listeners.has(listener)) {
+ listeners.delete(listener);
+ }
+
+ if (!listeners.size) {
+ events.delete(type);
+ }
+ }
+
+ onAccessibilityFrontAvailable(accessibilityFront) {
+ accessibilityFront.watchFronts(
+ "accessiblewalker",
+ this.onAccessibleWalkerFrontAvailable,
+ this.onAccessibleWalkerFrontDestroyed
+ );
+ }
+
+ onAccessibilityFrontDestroyed(accessibilityFront) {
+ accessibilityFront.unwatchFronts(
+ "accessiblewalker",
+ this.onAccessibleWalkerFrontAvailable,
+ this.onAccessibleWalkerFrontDestroyed
+ );
+ }
+
+ onAccessibleWalkerFrontAvailable(accessibleWalkerFront) {
+ this._accessibilityWalkerFronts.add(accessibleWalkerFront);
+ // Apply all existing accessible walker front event listeners to the new
+ // front.
+ for (const [type, listeners] of this.accessibilityEvents.entries()) {
+ for (const listener of listeners) {
+ accessibleWalkerFront.on(type, listener);
+ }
+ }
+ }
+
+ onAccessibleWalkerFrontDestroyed(accessibleWalkerFront) {
+ this._accessibilityWalkerFronts.delete(accessibleWalkerFront);
+ // Remove all existing accessible walker front event listeners from the
+ // destroyed front.
+ for (const [type, listeners] of this.accessibilityEvents.entries()) {
+ for (const listener of listeners) {
+ accessibleWalkerFront.off(type, listener);
+ }
+ }
+ }
+
+ async onTargetAvailable({ targetFront, isTargetSwitching }) {
+ targetFront.watchFronts(
+ "accessibility",
+ this.onAccessibilityFrontAvailable,
+ this.onAccessibilityFrontDestroyed
+ );
+
+ if (!targetFront.isTopLevel) {
+ return;
+ }
+
+ this._accessibilityWalkerFronts.clear();
+
+ this.accessibilityFrontGetPromise = targetFront.getFront("accessibility");
+ this.accessibilityFront = await this.accessibilityFrontGetPromise;
+
+ // Check for backward compatibility. New API's must be described in the
+ // "getTraits" method of the AccessibilityActor.
+ this.supports = { ...this.accessibilityFront.traits };
+
+ this.simulatorFront = this.accessibilityFront.simulatorFront;
+ if (this.simulatorFront) {
+ this.simulate = types => this.simulatorFront.simulate({ types });
+ } else {
+ this.simulate = null;
+ }
+
+ // Move accessibility front lifecycle event listeners to a new top level
+ // front.
+ for (const [type, listeners] of this.lifecycleEvents.entries()) {
+ for (const listener of listeners.values()) {
+ this.accessibilityFront.on(type, listener);
+ }
+ }
+ }
+
+ async onTargetDestroyed({ targetFront }) {
+ targetFront.unwatchFronts(
+ "accessibility",
+ this.onAccessibilityFrontAvailable,
+ this.onAccessibilityFrontDestroyed
+ );
+ }
+
+ async onTargetSelected({ targetFront }) {
+ await this.toggleDisplayTabbingOrder(false);
+ this.accessibilityFront = await targetFront.getFront("accessibility");
+
+ this.simulatorFront = this.accessibilityFront.simulatorFront;
+ if (this.simulatorFront) {
+ this.simulate = types => this.simulatorFront.simulate({ types });
+ } else {
+ this.simulate = null;
+ }
+
+ this.#panel.shouldRefresh = true;
+ this.#panel.refresh();
+ }
+
+ onResourceAvailable(resources) {
+ for (const resource of resources) {
+ // Only consider top level document, and ignore remote iframes top document
+ if (
+ resource.resourceType ===
+ this.commands.resourceCommand.TYPES.DOCUMENT_EVENT &&
+ resource.name === "dom-complete" &&
+ resource.targetFront.isTopLevel
+ ) {
+ this.#panel.forceRefresh();
+ }
+ }
+ }
+}
+
+exports.AccessibilityProxy = AccessibilityProxy;
diff --git a/devtools/client/accessibility/accessibility-view.js b/devtools/client/accessibility/accessibility-view.js
new file mode 100644
index 0000000000..36b5aa9e6e
--- /dev/null
+++ b/devtools/client/accessibility/accessibility-view.js
@@ -0,0 +1,260 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+/* global EVENTS */
+
+const nodeConstants = require("resource://devtools/shared/dom-node-constants.js");
+
+// React & Redux
+const {
+ createFactory,
+ createElement,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom.js");
+const {
+ Provider,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+// Accessibility Panel
+const MainFrame = createFactory(
+ require("resource://devtools/client/accessibility/components/MainFrame.js")
+);
+
+// Store
+const createStore = require("resource://devtools/client/shared/redux/create-store.js");
+
+// Reducers
+const {
+ reducers,
+} = require("resource://devtools/client/accessibility/reducers/index.js");
+const thunkOptions = { options: {} };
+const store = createStore(reducers, {
+ // Thunk options will be updated, when we [re]initialize the accessibility
+ // view.
+ thunkOptions,
+});
+
+// Actions
+const {
+ reset,
+} = require("resource://devtools/client/accessibility/actions/ui.js");
+const {
+ select,
+ highlight,
+} = require("resource://devtools/client/accessibility/actions/accessibles.js");
+
+/**
+ * This object represents view of the Accessibility panel and is responsible
+ * for rendering the content. It renders the top level ReactJS
+ * component: the MainFrame.
+ */
+function AccessibilityView(localStore) {
+ addEventListener("devtools/chrome/message", this.onMessage.bind(this), true);
+ this.store = localStore;
+}
+
+AccessibilityView.prototype = {
+ /**
+ * Initialize accessibility view, create its top level component and set the
+ * data store.
+ *
+ * @param {Object}
+ * Object that contains the following properties:
+ * - supports {JSON}
+ * a collection of flags indicating
+ * which accessibility panel features
+ * are supported by the current
+ * serverside version.
+ * - fluentBundles {Array}
+ * array of FluentBundles elements
+ * for localization
+ * - toolbox {Object}
+ * devtools toolbox.
+ * - getAccessibilityTreeRoot {Function}
+ * Returns the topmost accessibiliity
+ * walker that is used as the root of
+ * the accessibility tree.
+ * - startListeningForAccessibilityEvents {Function}
+ * Add listeners for specific
+ * accessibility events.
+ * - stopListeningForAccessibilityEvents {Function}
+ * Remove listeners for specific
+ * accessibility events.
+ * - audit {Function}
+ * Audit function that will start
+ * accessibility audit for given types
+ * of accessibility issues.
+ * - simulate {null|Function}
+ * Apply simulation of a given type
+ * (by setting color matrices in
+ * docShell).
+ * - toggleDisplayTabbingOrder {Function}
+ * Toggle the highlight of focusable
+ * elements along with their tabbing
+ * index.
+ * - enableAccessibility {Function}
+ * Enable accessibility services.
+ * - resetAccessiblity {Function}
+ * Reset the state of the
+ * accessibility services.
+ * - startListeningForLifecycleEvents {Function}
+ * Add listeners for accessibility
+ * service lifecycle events.
+ * - stopListeningForLifecycleEvents {Function}
+ * Remove listeners for accessibility
+ * service lifecycle events.
+ * - startListeningForParentLifecycleEvents {Function}
+ * Add listeners for parent process
+ * accessibility service lifecycle
+ * events.
+ * - stopListeningForParentLifecycleEvents {Function}
+ * Remove listeners for parent
+ * process accessibility service
+ * lifecycle events.
+ * - highlightAccessible {Function}
+ * Highlight accessible object.
+ * - unhighlightAccessible {Function}
+ * Unhighlight accessible object.
+ */
+ async initialize({
+ supports,
+ fluentBundles,
+ toolbox,
+ getAccessibilityTreeRoot,
+ startListeningForAccessibilityEvents,
+ stopListeningForAccessibilityEvents,
+ audit,
+ simulate,
+ toggleDisplayTabbingOrder,
+ enableAccessibility,
+ resetAccessiblity,
+ startListeningForLifecycleEvents,
+ stopListeningForLifecycleEvents,
+ startListeningForParentLifecycleEvents,
+ stopListeningForParentLifecycleEvents,
+ highlightAccessible,
+ unhighlightAccessible,
+ }) {
+ // Make sure state is reset every time accessibility panel is initialized.
+ await this.store.dispatch(reset(resetAccessiblity, supports));
+ const container = document.getElementById("content");
+ const mainFrame = MainFrame({
+ fluentBundles,
+ toolbox,
+ getAccessibilityTreeRoot,
+ startListeningForAccessibilityEvents,
+ stopListeningForAccessibilityEvents,
+ audit,
+ simulate,
+ enableAccessibility,
+ resetAccessiblity,
+ startListeningForLifecycleEvents,
+ stopListeningForLifecycleEvents,
+ startListeningForParentLifecycleEvents,
+ stopListeningForParentLifecycleEvents,
+ highlightAccessible,
+ unhighlightAccessible,
+ });
+ thunkOptions.options.toggleDisplayTabbingOrder = toggleDisplayTabbingOrder;
+ // Render top level component
+ const provider = createElement(Provider, { store: this.store }, mainFrame);
+ window.once(EVENTS.PROPERTIES_UPDATED).then(() => {
+ window.emit(EVENTS.INITIALIZED);
+ });
+ this.mainFrame = ReactDOM.render(provider, container);
+ },
+
+ destroy() {
+ const container = document.getElementById("content");
+ ReactDOM.unmountComponentAtNode(container);
+ },
+
+ async selectAccessible(accessible) {
+ await this.store.dispatch(select(accessible));
+ window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED);
+ },
+
+ async highlightAccessible(accessible) {
+ await this.store.dispatch(highlight(accessible));
+ window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_HIGHLIGHTED);
+ },
+
+ async selectNodeAccessible(node) {
+ if (!node) {
+ return;
+ }
+
+ const accessibilityFront = await node.targetFront.getFront("accessibility");
+ const accessibleWalkerFront = await accessibilityFront.getWalker();
+ let accessible = await accessibleWalkerFront.getAccessibleFor(node);
+ if (accessible) {
+ await accessible.hydrate();
+ }
+
+ // If node does not have an accessible object, try to find node's child text node and
+ // try to retrieve an accessible object for that child instead. This is the best
+ // effort approach until there's accessibility API to retrieve accessible object at
+ // point.
+ if (!accessible || accessible.indexInParent < 0) {
+ const { nodes: children } = await node.walkerFront.children(node);
+ for (const child of children) {
+ if (child.nodeType === nodeConstants.TEXT_NODE) {
+ accessible = await accessibleWalkerFront.getAccessibleFor(child);
+ // indexInParent property is only available with additional request
+ // for data (hydration) about the accessible object.
+ if (accessible) {
+ await accessible.hydrate();
+ if (accessible.indexInParent >= 0) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Attempt to find closest accessible ancestor for a given node.
+ if (!accessible || accessible.indexInParent < 0) {
+ let parentNode = node.parentNode();
+ while (parentNode) {
+ accessible = await accessibleWalkerFront.getAccessibleFor(parentNode);
+ if (accessible) {
+ await accessible.hydrate();
+ if (accessible.indexInParent >= 0) {
+ break;
+ }
+ }
+
+ parentNode = parentNode.parentNode();
+ }
+ }
+
+ // Do not set the selected state if there is no corresponding accessible.
+ if (!accessible) {
+ console.warn(
+ `No accessible object found for a node or a node in its ancestry: ${node.actorID}`
+ );
+ return;
+ }
+
+ await this.store.dispatch(select(accessible));
+ window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED);
+ },
+
+ /**
+ * Process message from accessibility panel.
+ *
+ * @param {Object} event message type and data.
+ */
+ onMessage(event) {
+ const data = event.data;
+ const method = data.type;
+
+ if (typeof this[method] === "function") {
+ this[method](...data.args);
+ }
+ },
+};
+
+window.view = new AccessibilityView(store);
diff --git a/devtools/client/accessibility/accessibility.css b/devtools/client/accessibility/accessibility.css
new file mode 100644
index 0000000000..efb627a80c
--- /dev/null
+++ b/devtools/client/accessibility/accessibility.css
@@ -0,0 +1,851 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+:root {
+ --accessibility-font-size: 12px;
+ --accessibility-toolbar-height-tall: 35px;
+ --accessibility-toolbar-focus: var(--blue-50);
+ --accessibility-toolbar-focus-alpha30: rgba(10, 132, 255, 0.3);
+ --accessibility-full-length-minus-splitter: calc(100% - 1px);
+ --accessibility-horizontal-padding: 5px;
+ --accessibility-horizontal-indent: 20px;
+ --accessibility-properties-item-width: calc(100% - var(--accessibility-horizontal-indent));
+ /* The main content can use the full height minus the height of the toolbar
+ (including 1px border bottom) */
+ --accessibility-main-height: calc(100vh - var(--theme-toolbar-height) - 1px);
+ /* The tree can use the main content height minus the height of the tree
+ header, which has the same height as the toolbar and a 1px border bottom */
+ --accessibility-tree-height: calc(var(--accessibility-main-height) - var(--theme-toolbar-height) - 1px);
+ --accessibility-arrow-horizontal-padding: 4px;
+ --accessibility-tree-row-height: 21px;
+ --accessibility-unfocused-tree-focused-node-background: var(--grey-20);
+ --accessibility-unfocused-tree-focused-node-twisty-fill: var(--theme-icon-dimmed-color);
+ --accessibility-link-color: var(--blue-60);
+ --accessibility-link-color-active: var(--blue-70);
+ --accessibility-body-background-a90: rgba(255, 255, 255, 0.9);
+ --accessibility-code-background: var(--grey-20);
+}
+
+:root.theme-dark {
+ --accessibility-unfocused-tree-focused-node-background: var(--grey-70);
+ --accessibility-unfocused-tree-focused-node-twisty-fill: var(--theme-selection-color);
+ --accessibility-link-color: var(--theme-highlight-blue);
+ --accessibility-link-color-active: var(--blue-40);
+ --accessibility-body-background-a90: rgba(42, 42, 46, 0.9);
+ --accessibility-code-background: var(--grey-70);
+}
+
+/* General */
+html,
+body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+:root .flash-out {
+ animation: flash-out 0.5s ease-out;
+}
+
+:root {
+ --theme-popup-border-radius: 0px;
+}
+:root[platform="mac"] {
+ --theme-popup-border-radius: 3.5px;
+}
+
+@keyframes flash-out {
+ from {
+ background: var(--theme-contrast-background);
+ }
+}
+
+.accessible .tree .node .theme-twisty {
+ width: var(--accessibility-horizontal-indent);
+}
+
+.accessible .tree .node .theme-twisty:not(.open):dir(rtl) {
+ transform: rotate(-90deg);
+}
+
+.accessible .tree .node.focused .theme-twisty,
+.treeTable .treeRow.selected .theme-twisty {
+ fill: var(--theme-selection-color);
+}
+
+.mainFrame {
+ height: 100%;
+ color: var(--theme-toolbar-color);
+}
+
+.main-panel {
+ /* To compenstate for 1px splitter between the tree and sidebar. */
+ width: var(--accessibility-full-length-minus-splitter);
+}
+
+.devtools-button,
+.toggle-button {
+ cursor: pointer;
+ border: 1px solid transparent;
+}
+
+.mainFrame .devtools-button.devtools-throbber::before,
+.mainFrame .toggle-button.devtools-throbber::before {
+ /* Default for .devtools-throbber is set to 1em which is too big for the
+ devtools toolbar. */
+ height: 8px;
+ width: 8px;
+ margin-block-end: 1px;
+ margin-inline-end: 2px;
+}
+
+.split-box.horz {
+ height: var(--accessibility-main-height);
+}
+
+.mainFrame .devtools-button,
+.description .devtools-button {
+ padding: unset;
+}
+
+.mainFrame .devtools-button > .btn-content {
+ padding: 2px var(--accessibility-horizontal-padding);
+}
+
+.description .devtools-button > .btn-content {
+ padding: 7px var(--accessibility-horizontal-padding);
+}
+
+.devtools-button:focus,
+.devtools-button > .btn-content:focus,
+.devtools-button::-moz-focus-inner {
+ outline: none;
+}
+
+.devtools-button:focus > .btn-content:not(.devtools-throbber) {
+ outline: 2px solid var(--accessibility-toolbar-focus);
+ outline-offset: -2px;
+ box-shadow: 0 0 0 2px var(--accessibility-toolbar-focus-alpha30);
+ border-radius: 2px;
+}
+
+.devtools-toolbar {
+ display: flex;
+ align-items: center;
+ font: message-box;
+ font-size: var(--accessibility-font-size);
+}
+
+/* Similarly to webconsole, add more padding before the toolbar group. */
+.devtools-toolbar .devtools-separator {
+ margin-inline: 5px;
+}
+
+.devtools-toolbar .accessibility-tree-filters,
+.devtools-toolbar .accessibility-simulation {
+ margin-inline-start: 4px;
+ display: flex;
+ flex-wrap: nowrap;
+ flex-direction: row;
+ align-items: center;
+ white-space: nowrap;
+}
+
+.devtools-toolbar .toolbar-menu-button {
+ border-color: transparent;
+ padding: 0 3px;
+}
+
+.devtools-toolbar .toolbar-menu-button.filters {
+ max-width: 100px;
+}
+
+.devtools-toolbar .toolbar-menu-button.simulation {
+ max-width: 200px;
+}
+
+.devtools-toolbar .toolbar-menu-button.filters,
+.devtools-toolbar .toolbar-menu-button.simulation {
+ text-overflow: ellipsis;
+ overflow-x: hidden;
+ margin-inline-start: 3px;
+}
+
+.devtools-toolbar .toolbar-menu-button::after,
+.devtools-toolbar .toolbar-menu-button.simulation::before {
+ content: "";
+ display: inline-block;
+ -moz-context-properties: fill;
+ fill: currentColor;
+ margin-inline-start: 3px;
+}
+
+.devtools-toolbar .toolbar-menu-button.filters::after,
+.devtools-toolbar .toolbar-menu-button.simulation::after {
+ background: url("chrome://devtools/skin/images/select-arrow.svg") no-repeat;
+ width: 8px;
+ height: 8px;
+}
+
+.devtools-toolbar .toolbar-menu-button.prefs {
+ background-color: transparent;
+ height: 18px;
+ padding: 0;
+ margin-inline-start: auto;
+ margin-inline-end: 3px;
+}
+
+.devtools-toolbar .toolbar-menu-button.prefs:active:hover {
+ background-color: var(--theme-selection-background-hover);
+}
+
+.devtools-toolbar .toolbar-menu-button.prefs::after {
+ display: none;
+}
+
+.devtools-toolbar .toolbar-menu-button.prefs::before {
+ background: url("chrome://devtools/skin/images/settings.svg") no-repeat;
+ width: 14px;
+ height: 14px;
+ background-size: contain;
+ margin: 0px 1px;
+ vertical-align: text-bottom;
+}
+
+.devtools-toolbar .badge.toggle-button[disabled],
+.tooltip-container .menuitem > .command[disabled] {
+ opacity: 0.5;
+}
+
+:root .theme-body .tooltip-container.tooltip-visible[type="doorhanger"] > .tooltip-panel,
+:root .theme-body .tooltip-container.tooltip-visible[type="doorhanger"] > .tooltip-arrow::before {
+ border: 1px solid var(--theme-popup-border-color);
+ border-radius: var(--theme-popup-border-radius);
+ box-shadow: 0 0 4px hsla(210,4%,10%,.2);
+}
+
+.tooltip-container .menuitem > .command[role="link"] {
+ appearance: none;
+ border: none;
+ color: var(--theme-arrowpanel-color);
+ background-color: transparent;
+ text-align: start;
+ width: 100%;
+}
+
+.devtools-toolbar .beta {
+ color: var(--theme-highlight-blue);
+ font-size: 80%;
+ font-weight: 500;
+ margin-inline-end: 3px;
+ margin-inline-start: 4px;
+}
+
+#audit-progress-container {
+ position: fixed;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ z-index: 9999;
+ background: var(--accessibility-body-background-a90);
+ padding-block-start: 30vh;
+ font: message-box;
+ font-size: 12px;
+ font-style: italic;
+}
+
+.audit-progress-progressbar {
+ width: 30vw;
+}
+
+/* Description */
+.description {
+ color: var(--theme-toolbar-color);
+ font: message-box;
+ font-size: calc(var(--accessibility-font-size) + 1px);
+ margin: auto;
+ padding-top: 15vh;
+ width: 50vw;
+}
+
+/* To ensure that the message does not look squished in vertical mode, increase its width
+ when the toolbox is narrow */
+@media (max-width: 700px) {
+ .description {
+ width: 80vw;
+ }
+}
+
+.description .general {
+ display: flex;
+ align-items: center;
+ margin-bottom: 1em;
+}
+
+.description img {
+ margin-inline-end: 12px;
+ flex-basis: 42px;
+ height: 42px;
+ flex-shrink: 0;
+ -moz-context-properties: fill;
+ fill: var(--grey-40);
+}
+
+.description .devtools-button {
+ display: flex;
+ align-items: center;
+ margin: auto;
+}
+
+.description .link,
+.accessibility-check-annotation .link {
+ color: var(--accessibility-link-color);
+ cursor: pointer;
+ outline: 0;
+}
+
+.description .link:hover:not(:focus),
+.accessibility-check-annotation .link:hover:not(:focus) {
+ text-decoration: underline;
+}
+
+.description .link:focus:not(:active),
+.accessibility-check-annotation .link:focus:not(:active) {
+ box-shadow: 0 0 0 2px var(--accessibility-toolbar-focus), 0 0 0 4px var(--accessibility-toolbar-focus-alpha30);
+ border-radius: 2px;
+}
+
+.description .link:active,
+.accessibility-check-annotation .link:active {
+ color: var(--accessibility-link-color-active);
+ text-decoration: underline;
+}
+
+/* TreeView Customization */
+.treeTable thead, .treeTable tbody {
+ display: block;
+}
+
+.treeTable tr {
+ width: 100%;
+ display: table;
+}
+
+.treeTable tbody {
+ overflow-y: auto;
+}
+
+.split-box:not(.horz) .treeTable tbody {
+ height: var(--accessibility-tree-height);
+}
+
+.split-box.horz .treeTable tbody {
+ /* Accessibility tree height depends on the height of the controlled panel
+ (sidebar) when in horz mode and also has an additional separator. */
+ height: calc(var(--accessibility-tree-height) - var(--split-box-controlled-panel-size) - 1px);
+}
+
+.treeTable {
+ width: 100%;
+}
+
+.treeTable .treeRow.highlighted:not(.selected) {
+ background-color: var(--theme-selection-background-hover);
+}
+
+.treeTable.filtered .treeRow .treeLabelCell {
+ /* Unset row indentation when the tree is filtered. */
+ padding-inline-start: var(--accessibility-arrow-horizontal-padding);
+}
+
+/* When the accesibility tree is filtered, we flatten the tree and want to hide
+ the expander icon (▶) for expandable tree rows. */
+.treeTable.filtered .treeRow .treeLabelCell .treeIcon {
+ display: none;
+}
+
+.treeTable .treeLabelCell {
+ min-width: 50%;
+}
+
+.treeTable:focus, .treeTable tbody:focus {
+ outline: 0;
+}
+
+.treeTable::-moz-focus-inner {
+ border: 0;
+}
+
+.treeTable:not(:focus, :focus-within) .treeRow.selected {
+ background-color: var(--accessibility-unfocused-tree-focused-node-background);
+}
+
+.treeTable:not(:focus, :focus-within) .treeRow.selected .theme-twisty {
+ fill: var(--accessibility-unfocused-tree-focused-node-twisty-fill);
+}
+
+.treeTable:not(:focus, :focus-within) .treeRow.selected *,
+.treeTable:not(:focus, :focus-within) .treeRow.selected .treeLabelCell:after {
+ color: inherit;
+}
+
+.treeTable:not(:focus, :focus-within) .treeRow.selected .objectBox-string {
+ color: var(--string-color);
+}
+
+.treeTable > thead {
+ pointer-events: none;
+}
+
+.treeTable > tbody tr {
+ height: var(--accessibility-tree-row-height);
+}
+
+.treeTable > tbody td {
+ user-select: none;
+}
+
+.treeTable > tbody td > span {
+ user-select: text;
+}
+
+.mainFrame .treeTable .treeRow.hasChildren > .treeLabelCell > .treeLabel:hover {
+ cursor: unset;
+ text-decoration: none;
+}
+
+.mainFrame .treeTable .treeHeaderRow > .treeHeaderCell:first-child > .treeHeaderCellBox,
+.mainFrame .treeTable .treeHeaderRow > .treeHeaderCell > .treeHeaderCellBox {
+ padding: 0;
+ padding-inline-start: var(--accessibility-arrow-horizontal-padding);
+}
+
+.mainFrame .treeTable .treeHeaderCell {
+ width: 50%;
+ border-bottom: 1px solid var(--theme-splitter-color);
+ background: var(--theme-toolbar-background);
+ font: message-box;
+ font-size: var(--accessibility-font-size);
+ height: var(--theme-toolbar-height);
+ color: var(--theme-toolbar-color);
+}
+
+.badge {
+ display: inline-block;
+ font: message-box;
+ font-size: var(--theme-body-font-size);
+ border-radius: 3px;
+ padding: 0px 3px;
+ margin-inline-start: 5px;
+ color: var(--badge-color);
+ background-color: var(--badge-background-color);
+ border: 1px solid var(--badge-border-color);
+ user-select: none;
+}
+
+.badge.audit-badge::before {
+ content: "";
+ display: inline-block;
+ vertical-align: 0px;
+ width: 9px;
+ height: 9px;
+ margin-inline-end: 2px;
+ -moz-context-properties: fill;
+ fill: currentColor;
+ opacity: 0.9;
+}
+
+.badge.audit-badge[data-score="BEST_PRACTICES"]::before {
+ background-image: url(chrome://devtools/skin/images/info-tiny.svg);
+ vertical-align: -1px;
+}
+
+.badge.audit-badge[data-score="WARNING"]::before {
+ background-image: url(chrome://devtools/skin/images/alert-tiny.svg);
+}
+
+.badge.audit-badge[data-score="FAIL"]::before {
+ background-image: url(chrome://devtools/skin/images/error-tiny.svg);
+ vertical-align: -1px;
+}
+
+/* improve alignment in high res (where we can use half pixels) */
+@media (min-resolution: 1.5x) {
+ .badge.audit-badge[data-score="WARNING"]::before {
+ vertical-align: -0.5px;
+ }
+}
+
+.badge.toggle-button {
+ color: var(--theme-body-color);
+ background-color: var(--badge-interactive-background-color);
+ border-color: transparent;
+}
+
+.devtools-toolbar .badge.toggle-button:focus,
+.devtools-toolbar .toolbar-menu-button:focus {
+ outline: 2px solid var(--accessibility-toolbar-focus);
+ outline-offset: -2px;
+ box-shadow: 0 0 0 2px var(--accessibility-toolbar-focus-alpha30);
+}
+
+.treeTable:focus-within .treeRow.selected .badges .badge {
+ background-color: var(--badge-active-background-color);
+ border-color: var(--accessible-active-border-color);
+ color: var(--theme-selection-color);
+}
+
+.treeTable:not(:focus, :focus-within) .treeRow.selected .badges .badge {
+ color: var(--badge-color);
+}
+
+.badge.toggle-button.checked {
+ background-color: var(--badge-active-background-color);
+ color: var(--theme-selection-color);
+}
+
+/* Avoid having a default dotted border on keyboard focus since we provide focus
+ styling*/
+.badge.toggle-button::-moz-focus-inner {
+ border: none;
+}
+
+/* Right Sidebar */
+.right-sidebar {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ overflow-y: auto;
+ white-space: nowrap;
+ font: message-box;
+ font-size: var(--accessibility-font-size);
+ background-color: var(--theme-sidebar-background);
+}
+
+.split-box:not(.horz) .right-sidebar {
+ position: fixed;
+ width: inherit;
+ height: var(--accessibility-main-height)
+}
+
+/* Tree customization */
+.accessible .tree {
+ flex: 1;
+ height: 100%;
+ white-space: nowrap;
+ overflow: auto;
+ display: block;
+ /* Force the properties list to always be displayed in LTR (bug 1575002) */
+ direction: ltr;
+}
+
+.split-box.horz .accessible .tree {
+ width: 100vw;
+}
+
+.accessible .tree button {
+ display: block;
+}
+
+/* NOTE: total height of the node (height + padding + border + margin) must
+ be exactly the same as the value of TREE_ROW_HEIGHT constant in
+ devtools/client/accessibility/constants.js */
+.accessible .tree .node {
+ padding: 0 var(--accessibility-horizontal-indent);
+ position: relative;
+ display: flex;
+ height: var(--accessibility-tree-row-height);
+ width: var(--accessibility-properties-item-width);
+ cursor: default;
+ align-items: center;
+}
+
+.accessible .tree:focus {
+ outline: 0;
+}
+
+.accessible .tree::-moz-focus-inner {
+ border: 0;
+}
+
+/* Unset tree styles leaking from reps.css */
+.accessible .tree .tree-node:not(.focused):hover {
+ background-color: transparent;
+}
+
+.accessible .tree:not(:focus) .node.focused {
+ background-color: var(--accessibility-unfocused-tree-focused-node-background);
+}
+
+.accessible .tree:not(:focus) .node.focused .theme-twisty {
+ fill: var(--accessibility-unfocused-tree-focused-node-twisty-fill);
+}
+
+.accessible .tree .node:not(.focused):hover {
+ background-color: var(--theme-selection-background-hover);
+}
+
+.accessible .tree:focus .node.focused,
+.accessible .tree .tree-node-active .node.focused {
+ background-color: var(--theme-selection-background);
+}
+
+.accessible .tree:focus .node.focused *,
+.accessible .tree .tree-node-active .node.focused * {
+ color: var(--theme-selection-color);
+}
+
+/* Invert text selection color in selected rows */
+.accessible .tree:focus .node.focused ::selection,
+.accessible .tree .tree-node-active .node.focused ::selection {
+ color: var(--theme-selection-background);
+ background-color: var(--theme-selection-color);
+}
+
+.accessible .tree:focus .node.focused .open-inspector,
+.accessible .tree .tree-node-active .node.focused .open-inspector {
+ fill: var(--grey-30);
+}
+
+.accessible .tree:focus .node.focused:hover .open-inspector,
+.accessible .tree .tree-node-active .node.focused:hover .open-inspector {
+ fill: var(--theme-selection-color);
+}
+
+.accessible .tree .tree-node-active .node.focused .open-inspector:focus,
+.accessible .tree .tree-node-active .node.focused:hover .open-inspector:focus {
+ fill: var(--grey-40);
+}
+
+.accessible .tree .arrow {
+ flex-shrink: 0;
+}
+
+.accessible .tree .object-value {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.accessible .tree .object-delimiter {
+ padding-inline-end: var(--accessibility-arrow-horizontal-padding);
+}
+
+.accessible .tree .object-label {
+ color: var(--theme-highlight-blue);
+}
+
+.accessible .tree .objectBox-accessible .accessible-role {
+ background-color: var(--badge-background-color);
+ color: var(--badge-color);
+ border: 1px solid var(--badge-border-color);
+ border-radius: 3px;
+ padding: 0px 2px;
+ margin-inline-start: 5px;
+ user-select: none;
+}
+
+.accessible .tree:focus .node.focused .objectBox-accessible .accessible-role,
+.accessible .tree .tree-node-active .node.focused .objectBox-accessible .accessible-role {
+ background-color: var(--badge-active-background-color);
+ border-color: var(--badge-active-border-color);
+ color: var(--theme-selection-color);
+}
+
+.accessible .tree:focus .node.focused .open-accessibility-inspector,
+.accessible .tree .tree-node-active .node.focused .open-accessibility-inspector {
+ fill: var(--grey-30);
+}
+
+.accessible .tree:focus .node.focused:hover .open-accessibility-inspector,
+.accessible .tree .tree-node-active .node.focused:hover .open-accessibility-inspector {
+ fill: var(--theme-selection-color);
+}
+
+.accessible .tree .tree-node-active .node.focused .open-accessibility-inspector:focus,
+.accessible .tree .tree-node-active .node.focused:hover .open-accessibility-inspector:focus {
+ fill: var(--grey-40);
+}
+
+.accessible .tree .objectBox-accessible,
+.accessible .tree .objectBox-node {
+ width: 100%;
+ display: flex;
+ align-items: center;
+}
+
+.accessible .tree .objectBox-accessible .accessible-name,
+.accessible .tree .objectBox-node .attrName {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.accessible .tree .objectBox-accessible .open-accessibility-inspector,
+.accessible .tree .objectBox-node .open-inspector {
+ width: 17px;
+ cursor: pointer;
+ flex-shrink: 0;
+}
+
+.accessible .tree .objectBox-object,
+.accessible .tree .objectBox-string,
+.accessible .tree .objectBox-text,
+.accessible .tree .objectBox-table,
+.accessible .tree .objectLink-textNode,
+.accessible .tree .objectLink-event,
+.accessible .tree .objectLink-eventLog,
+.accessible .tree .objectLink-regexp,
+.accessible .tree .objectLink-object,
+.accessible .tree .objectLink-Date,
+.theme-dark .accessible .tree .objectBox-object,
+.theme-light .accessible .tree .objectBox-object {
+ white-space: nowrap;
+}
+
+/* Styling for accessible details panel when accessible is not available */
+.accessible .info {
+ color: var(--theme-body-color);
+ font-size: 110%;
+ padding-inline-start: var(--accessibility-arrow-horizontal-padding);
+ height: var(--accessibility-toolbar-height-tall);
+ line-height: var(--accessibility-toolbar-height-tall);
+}
+
+.checks-empty {
+ font-style: italic;
+ padding: 0.5em 20px;
+ user-select: none;
+ font-size: 12px;
+ white-space: initial;
+}
+
+/* Checks */
+.checks .list li:last-of-type {
+ padding-block-end: 4px;
+}
+
+.accessibility-check code {
+ background-color: var(--accessibility-code-background);
+ border-radius: 2px;
+ box-decoration-break: clone;
+ padding: 0 4px;
+}
+
+.accessibility-check .icon {
+ display: inline;
+ -moz-context-properties: fill;
+ vertical-align: top;
+ margin-block-start: 2px;
+ margin-inline-end: 4px;
+}
+
+.accessibility-check .icon[data-score="FAIL"] {
+ fill: var(--theme-icon-error-color);
+}
+
+.accessibility-check .icon[data-score="WARNING"] {
+ fill: var(--theme-icon-warning-color);
+}
+
+.accessibility-check .icon[data-score="BEST_PRACTICES"] {
+ fill: currentColor;
+}
+
+.accessibility-check,
+.accessibility-color-contrast {
+ position: relative;
+ display: flex;
+ cursor: default;
+ height: inherit;
+}
+
+.accessibility-check {
+ flex-direction: column;
+ padding: 4px var(--accessibility-horizontal-indent);
+ line-height: 20px;
+}
+
+.accessibility-check-header {
+ margin: 0;
+ font-weight: bold;
+ font-size: var(--accessibility-font-size);
+ line-height: var(--theme-toolbar-height);
+}
+
+.accessibility-check-annotation {
+ display: inline;
+ margin: 0;
+ white-space: normal;
+ color: var(--badge-color);
+}
+
+.accessibility-check-annotation .link {
+ white-space: nowrap;
+ font-style: normal;
+}
+
+.accessibility-color-contrast .accessibility-contrast-value:not(:empty) {
+ margin-block-end: 4px;
+}
+
+.accessibility-color-contrast .accessibility-contrast-value:not(:empty):before {
+ content: "";
+ height: 14px;
+ width: 14px;
+ display: inline-flex;
+ background-color: var(--accessibility-contrast-color);
+ box-shadow: 0 0 0 1px var(--grey-40), 6px 5px var(--accessibility-contrast-bg), 6px 5px 0 1px var(--grey-40);
+ margin-inline-end: 11px;
+}
+
+.accessibility-color-contrast .accessibility-contrast-value:first-child:not(:empty):before {
+ margin-inline-start: 1px;
+}
+
+.accessibility-color-contrast .accessibility-contrast-value:not(:first-child, :empty):before {
+ margin-inline-start: 4px;
+}
+
+.accessibility-color-contrast .accessibility-color-contrast-label:after {
+ content: ":";
+}
+
+.accessibility-color-contrast .accessibility-color-contrast-label,
+.accessibility-color-contrast .accessibility-color-contrast-separator:before {
+ margin-inline-end: 3px;
+}
+
+.devtools-toolbar .toolbar-menu-button.simulation::before {
+ width: 12px;
+ height: 12px;
+ margin-inline-end: 3px;
+ margin-inline-start: 0px;
+ background: url("chrome://devtools/skin/images/eye.svg") no-repeat;
+ -moz-context-properties: fill, stroke;
+ fill: var(--theme-icon-color);
+ stroke: var(--theme-icon-color);
+ vertical-align: -2px;
+}
+
+.devtools-toolbar .toolbar-menu-button.active,
+.devtools-toolbar .toolbar-menu-button.active.devtools-button:not(:empty, .checked, :disabled):focus {
+ color: var(--theme-toolbar-selected-color);
+}
+
+.devtools-toolbar .toolbar-menu-button.simulation.active::before {
+ fill: var(--theme-toolbar-selected-color);
+ stroke: var(--theme-toolbar-selected-color);
+}
+
+#simulation-menu-button-menu .link {
+ background-color: transparent;
+ border: none;
+}
+
+#simulation-menu-button-menu .link:focus,
+#simulation-menu-button-menu .link:hover {
+ background-color: var(--theme-arrowpanel-dimmed);
+}
diff --git a/devtools/client/accessibility/actions/accessibles.js b/devtools/client/accessibility/actions/accessibles.js
new file mode 100644
index 0000000000..085157c445
--- /dev/null
+++ b/devtools/client/accessibility/actions/accessibles.js
@@ -0,0 +1,70 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ FETCH_CHILDREN,
+ SELECT,
+ HIGHLIGHT,
+ UNHIGHLIGHT,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Fetch child accessibles for a given accessible object.
+ * @param {Object} accessible front
+ */
+exports.fetchChildren =
+ accessible =>
+ ({ dispatch }) =>
+ accessible
+ .children()
+ .then(response =>
+ dispatch({ accessible, type: FETCH_CHILDREN, response })
+ )
+ .catch(error => dispatch({ accessible, type: FETCH_CHILDREN, error }));
+
+exports.select =
+ accessible =>
+ ({ dispatch }) => {
+ const accessibleWalkerFront = accessible.getParent();
+ if (!accessibleWalkerFront) {
+ dispatch({
+ accessible,
+ type: SELECT,
+ error: new Error("AccessibleWalker front is not available."),
+ });
+
+ return Promise.reject();
+ }
+
+ return accessibleWalkerFront
+ .getAncestry(accessible)
+ .then(response => dispatch({ accessible, type: SELECT, response }))
+ .catch(error => dispatch({ accessible, type: SELECT, error }));
+ };
+
+exports.highlight =
+ accessible =>
+ ({ dispatch }) => {
+ const accessibleWalkerFront = accessible.getParent();
+ if (!accessibleWalkerFront) {
+ dispatch({
+ accessible,
+ type: SELECT,
+ error: new Error("AccessibleWalker front is not available."),
+ });
+
+ return Promise.reject();
+ }
+
+ return accessibleWalkerFront
+ .getAncestry(accessible)
+ .then(response => dispatch({ accessible, type: HIGHLIGHT, response }))
+ .catch(error => dispatch({ accessible, type: HIGHLIGHT, error }));
+ };
+
+exports.unhighlight =
+ () =>
+ ({ dispatch }) =>
+ dispatch({ type: UNHIGHLIGHT });
diff --git a/devtools/client/accessibility/actions/audit.js b/devtools/client/accessibility/actions/audit.js
new file mode 100644
index 0000000000..7d91299eea
--- /dev/null
+++ b/devtools/client/accessibility/actions/audit.js
@@ -0,0 +1,36 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ AUDIT,
+ AUDIT_PROGRESS,
+ AUDITING,
+ FILTER_TOGGLE,
+ FILTERS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+exports.filterToggle =
+ filter =>
+ ({ dispatch }) =>
+ dispatch({ filter, type: FILTER_TOGGLE });
+
+exports.auditing =
+ filter =>
+ ({ dispatch }) => {
+ const auditing = filter === FILTERS.ALL ? Object.values(FILTERS) : [filter];
+ return dispatch({ auditing, type: AUDITING });
+ };
+
+exports.audit =
+ (auditFunc, filter) =>
+ ({ dispatch }) =>
+ auditFunc(filter, progress =>
+ dispatch({ type: AUDIT_PROGRESS, progress })
+ ).then(({ error, ancestries }) => {
+ return error
+ ? dispatch({ type: AUDIT, error: true })
+ : dispatch({ type: AUDIT, response: ancestries });
+ });
diff --git a/devtools/client/accessibility/actions/details.js b/devtools/client/accessibility/actions/details.js
new file mode 100644
index 0000000000..f25996589e
--- /dev/null
+++ b/devtools/client/accessibility/actions/details.js
@@ -0,0 +1,40 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ UPDATE_DETAILS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Update details with the given accessible object.
+ *
+ * @param {Object} accessible front
+ */
+exports.updateDetails =
+ accessible =>
+ async ({ dispatch }) => {
+ const { walker: domWalker } = await accessible.targetFront.getFront(
+ "inspector"
+ );
+ // By the time getFront resolves, the accessibleFront may have been destroyed.
+ // This typically happens during navigations.
+ if (accessible.isDestroyed()) {
+ return;
+ }
+ try {
+ const response = await Promise.all([
+ domWalker.getNodeFromActor(accessible.actorID, [
+ "rawAccessible",
+ "DOMNode",
+ ]),
+ accessible.getRelations(),
+ accessible.audit(),
+ accessible.hydrate(),
+ ]);
+ dispatch({ accessible, type: UPDATE_DETAILS, response });
+ } catch (error) {
+ dispatch({ accessible, type: UPDATE_DETAILS, error });
+ }
+ };
diff --git a/devtools/client/accessibility/actions/moz.build b/devtools/client/accessibility/actions/moz.build
new file mode 100644
index 0000000000..c4571d7998
--- /dev/null
+++ b/devtools/client/accessibility/actions/moz.build
@@ -0,0 +1,5 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules("accessibles.js", "audit.js", "details.js", "simulation.js", "ui.js")
diff --git a/devtools/client/accessibility/actions/simulation.js b/devtools/client/accessibility/actions/simulation.js
new file mode 100644
index 0000000000..98d69d62f3
--- /dev/null
+++ b/devtools/client/accessibility/actions/simulation.js
@@ -0,0 +1,16 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ SIMULATE,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+exports.simulate =
+ (simulateFunc, simTypes = []) =>
+ ({ dispatch }) =>
+ simulateFunc(simTypes)
+ .then(success => dispatch({ error: !success, simTypes, type: SIMULATE }))
+ .catch(error => dispatch({ error, type: SIMULATE }));
diff --git a/devtools/client/accessibility/actions/ui.js b/devtools/client/accessibility/actions/ui.js
new file mode 100644
index 0000000000..d4af5ba8fb
--- /dev/null
+++ b/devtools/client/accessibility/actions/ui.js
@@ -0,0 +1,77 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ ENABLE,
+ RESET,
+ UPDATE_CAN_BE_DISABLED,
+ UPDATE_CAN_BE_ENABLED,
+ UPDATE_PREF,
+ PREF_KEYS,
+ UPDATE_DISPLAY_TABBING_ORDER,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Reset accessibility panel UI.
+ */
+exports.reset =
+ (resetAccessiblity, supports) =>
+ async ({ dispatch }) => {
+ try {
+ const { enabled, canBeDisabled, canBeEnabled } =
+ await resetAccessiblity();
+ dispatch({ enabled, canBeDisabled, canBeEnabled, supports, type: RESET });
+ } catch (error) {
+ dispatch({ type: RESET, error });
+ }
+ };
+
+/**
+ * Update a "canBeDisabled" flag for accessibility service.
+ */
+exports.updateCanBeDisabled =
+ canBeDisabled =>
+ ({ dispatch }) =>
+ dispatch({ canBeDisabled, type: UPDATE_CAN_BE_DISABLED });
+
+/**
+ * Update a "canBeEnabled" flag for accessibility service.
+ */
+exports.updateCanBeEnabled =
+ canBeEnabled =>
+ ({ dispatch }) =>
+ dispatch({ canBeEnabled, type: UPDATE_CAN_BE_ENABLED });
+
+exports.updatePref =
+ (name, value) =>
+ ({ dispatch }) => {
+ dispatch({ type: UPDATE_PREF, name, value });
+ Services.prefs.setBoolPref(PREF_KEYS[name], value);
+ };
+
+/**
+ * Enable accessibility services in order to view accessible tree.
+ */
+exports.enable =
+ enableAccessibility =>
+ async ({ dispatch }) => {
+ try {
+ await enableAccessibility();
+ dispatch({ type: ENABLE });
+ } catch (error) {
+ dispatch({ error, type: ENABLE });
+ }
+ };
+
+exports.updateDisplayTabbingOrder =
+ tabbingOrderDisplayed =>
+ async ({ dispatch, options: { toggleDisplayTabbingOrder } }) => {
+ try {
+ await toggleDisplayTabbingOrder(tabbingOrderDisplayed);
+ dispatch({ tabbingOrderDisplayed, type: UPDATE_DISPLAY_TABBING_ORDER });
+ } catch (error) {
+ dispatch({ error, type: UPDATE_DISPLAY_TABBING_ORDER });
+ }
+ };
diff --git a/devtools/client/accessibility/components/AccessibilityPrefs.js b/devtools/client/accessibility/components/AccessibilityPrefs.js
new file mode 100644
index 0000000000..8c5de5f15f
--- /dev/null
+++ b/devtools/client/accessibility/components/AccessibilityPrefs.js
@@ -0,0 +1,109 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ createFactory,
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ hr,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+loader.lazyGetter(this, "MenuButton", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuButton.js")
+ );
+});
+loader.lazyGetter(this, "MenuItem", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuItem.js")
+ );
+});
+loader.lazyGetter(this, "MenuList", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuList.js")
+ );
+});
+
+const {
+ A11Y_LEARN_MORE_LINK,
+} = require("resource://devtools/client/accessibility/constants.js");
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+
+const {
+ updatePref,
+} = require("resource://devtools/client/accessibility/actions/ui.js");
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ PREFS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+class AccessibilityPrefs extends Component {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ [PREFS.SCROLL_INTO_VIEW]: PropTypes.bool.isRequired,
+ toolboxDoc: PropTypes.object.isRequired,
+ };
+ }
+
+ togglePref(prefKey) {
+ this.props.dispatch(updatePref(prefKey, !this.props[prefKey]));
+ }
+
+ onPrefClick(prefKey) {
+ this.togglePref(prefKey);
+ }
+
+ onLearnMoreClick() {
+ openDocLink(A11Y_LEARN_MORE_LINK);
+ }
+
+ render() {
+ return MenuButton(
+ {
+ menuId: "accessibility-tree-filters-prefs-menu",
+ toolboxDoc: this.props.toolboxDoc,
+ className: `devtools-button badge toolbar-menu-button prefs`,
+ title: L10N.getStr("accessibility.tree.filters.prefs"),
+ },
+ MenuList({}, [
+ MenuItem({
+ key: "pref-scroll-into-view",
+ checked: this.props[PREFS.SCROLL_INTO_VIEW],
+ className: `pref ${PREFS.SCROLL_INTO_VIEW}`,
+ label: L10N.getStr("accessibility.pref.scroll.into.view.label"),
+ tooltip: L10N.getStr("accessibility.pref.scroll.into.view.title"),
+ onClick: this.onPrefClick.bind(this, PREFS.SCROLL_INTO_VIEW),
+ }),
+ hr({ key: "hr" }),
+ MenuItem({
+ role: "link",
+ key: "accessibility-tree-filters-prefs-menu-help",
+ className: "help",
+ label: L10N.getStr("accessibility.documentation.label"),
+ tooltip: L10N.getStr("accessibility.learnMore"),
+ onClick: this.onLearnMoreClick,
+ }),
+ ])
+ );
+ }
+}
+
+const mapStateToProps = ({ ui }) => ({
+ [PREFS.SCROLL_INTO_VIEW]: ui[PREFS.SCROLL_INTO_VIEW],
+});
+
+// Exports from this module
+module.exports = connect(mapStateToProps)(AccessibilityPrefs);
diff --git a/devtools/client/accessibility/components/AccessibilityRow.js b/devtools/client/accessibility/components/AccessibilityRow.js
new file mode 100644
index 0000000000..ffca5c74ef
--- /dev/null
+++ b/devtools/client/accessibility/components/AccessibilityRow.js
@@ -0,0 +1,328 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+/* global gTelemetry, EVENTS */
+
+// React & Redux
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ findDOMNode,
+} = require("resource://devtools/client/shared/vendor/react-dom.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const TreeRow = require("resource://devtools/client/shared/components/tree/TreeRow.js");
+const AuditFilter = createFactory(
+ require("resource://devtools/client/accessibility/components/AuditFilter.js")
+);
+const AuditController = createFactory(
+ require("resource://devtools/client/accessibility/components/AuditController.js")
+);
+
+// Utils
+const {
+ flashElementOn,
+ flashElementOff,
+} = require("resource://devtools/client/inspector/markup/utils.js");
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+const {
+ PREFS,
+ VALUE_FLASHING_DURATION,
+ VALUE_HIGHLIGHT_DURATION,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+const nodeConstants = require("resource://devtools/shared/dom-node-constants.js");
+
+// Actions
+const {
+ updateDetails,
+} = require("resource://devtools/client/accessibility/actions/details.js");
+const {
+ unhighlight,
+} = require("resource://devtools/client/accessibility/actions/accessibles.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+loader.lazyRequireGetter(
+ this,
+ "Menu",
+ "resource://devtools/client/framework/menu.js"
+);
+loader.lazyRequireGetter(
+ this,
+ "MenuItem",
+ "resource://devtools/client/framework/menu-item.js"
+);
+
+const {
+ scrollIntoView,
+} = require("resource://devtools/client/shared/scroll.js");
+
+const JSON_URL_PREFIX = "data:application/json;charset=UTF-8,";
+
+const TELEMETRY_ACCESSIBLE_CONTEXT_MENU_OPENED =
+ "devtools.accessibility.accessible_context_menu_opened";
+const TELEMETRY_ACCESSIBLE_CONTEXT_MENU_ITEM_ACTIVATED =
+ "devtools.accessibility.accessible_context_menu_item_activated";
+
+class HighlightableTreeRowClass extends TreeRow {
+ shouldComponentUpdate(nextProps) {
+ const shouldTreeRowUpdate = super.shouldComponentUpdate(nextProps);
+ if (shouldTreeRowUpdate) {
+ return shouldTreeRowUpdate;
+ }
+
+ if (
+ nextProps.highlighted !== this.props.highlighted ||
+ nextProps.filtered !== this.props.filtered
+ ) {
+ return true;
+ }
+
+ return false;
+ }
+}
+
+const HighlightableTreeRow = createFactory(HighlightableTreeRowClass);
+
+// Component that expands TreeView's own TreeRow and is responsible for
+// rendering an accessible object.
+class AccessibilityRow extends Component {
+ static get propTypes() {
+ return {
+ ...TreeRow.propTypes,
+ dispatch: PropTypes.func.isRequired,
+ toolboxDoc: PropTypes.object.isRequired,
+ scrollContentNodeIntoView: PropTypes.bool.isRequired,
+ highlightAccessible: PropTypes.func.isRequired,
+ unhighlightAccessible: PropTypes.func.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ const {
+ member: { selected, object },
+ scrollContentNodeIntoView,
+ } = this.props;
+ if (selected) {
+ this.unhighlight(object);
+ this.update();
+ this.highlight(
+ object,
+ { duration: VALUE_HIGHLIGHT_DURATION },
+ scrollContentNodeIntoView
+ );
+ }
+
+ if (this.props.highlighted) {
+ this.scrollIntoView();
+ }
+ }
+
+ /**
+ * Update accessible object details that are going to be rendered inside the
+ * accessible panel sidebar.
+ */
+ componentDidUpdate(prevProps) {
+ const {
+ member: { selected, object },
+ scrollContentNodeIntoView,
+ } = this.props;
+ // If row is selected, update corresponding accessible details.
+ if (!prevProps.member.selected && selected) {
+ this.unhighlight(object);
+ this.update();
+ this.highlight(
+ object,
+ { duration: VALUE_HIGHLIGHT_DURATION },
+ scrollContentNodeIntoView
+ );
+ }
+
+ if (this.props.highlighted) {
+ this.scrollIntoView();
+ }
+
+ if (!selected && prevProps.member.value !== this.props.member.value) {
+ this.flashValue();
+ }
+ }
+
+ scrollIntoView() {
+ const row = findDOMNode(this);
+ // Row might not be rendered in the DOM tree if it is filtered out during
+ // audit.
+ if (!row) {
+ return;
+ }
+
+ scrollIntoView(row);
+ }
+
+ update() {
+ const {
+ dispatch,
+ member: { object },
+ } = this.props;
+ if (!object.actorID) {
+ return;
+ }
+
+ dispatch(updateDetails(object));
+ window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED, object);
+ }
+
+ flashValue() {
+ const row = findDOMNode(this);
+ // Row might not be rendered in the DOM tree if it is filtered out during
+ // audit.
+ if (!row) {
+ return;
+ }
+
+ const value = row.querySelector(".objectBox");
+
+ flashElementOn(value);
+ if (this._flashMutationTimer) {
+ clearTimeout(this._flashMutationTimer);
+ this._flashMutationTimer = null;
+ }
+ this._flashMutationTimer = setTimeout(() => {
+ flashElementOff(value);
+ }, VALUE_FLASHING_DURATION);
+ }
+
+ /**
+ * Scroll the node that corresponds to a current accessible object into view.
+ * @param {Object}
+ * Accessible front that is rendered for this node.
+ *
+ * @returns {Promise}
+ * Promise that resolves when the node is scrolled into view if
+ * possible.
+ */
+ async scrollNodeIntoViewIfNeeded(accessibleFront) {
+ if (accessibleFront.isDestroyed()) {
+ return;
+ }
+
+ const domWalker = (await accessibleFront.targetFront.getFront("inspector"))
+ .walker;
+ if (accessibleFront.isDestroyed()) {
+ return;
+ }
+
+ const node = await domWalker.getNodeFromActor(accessibleFront.actorID, [
+ "rawAccessible",
+ "DOMNode",
+ ]);
+ if (!node) {
+ return;
+ }
+
+ if (node.nodeType == nodeConstants.ELEMENT_NODE) {
+ await node.scrollIntoView();
+ } else if (node.nodeType != nodeConstants.DOCUMENT_NODE) {
+ // scrollIntoView method is only part of the Element interface, in cases
+ // where node is a text node (and not a document node) scroll into view
+ // its parent.
+ await node.parentNode().scrollIntoView();
+ }
+ }
+
+ async highlight(accessibleFront, options, scrollContentNodeIntoView) {
+ this.props.dispatch(unhighlight());
+ // If necessary scroll the node into view before showing the accessibility
+ // highlighter.
+ if (scrollContentNodeIntoView) {
+ await this.scrollNodeIntoViewIfNeeded(accessibleFront);
+ }
+
+ this.props.highlightAccessible(accessibleFront, options);
+ }
+
+ unhighlight(accessibleFront) {
+ this.props.dispatch(unhighlight());
+ this.props.unhighlightAccessible(accessibleFront);
+ }
+
+ async printToJSON() {
+ if (gTelemetry) {
+ gTelemetry.keyedScalarAdd(
+ TELEMETRY_ACCESSIBLE_CONTEXT_MENU_ITEM_ACTIVATED,
+ "print-to-json",
+ 1
+ );
+ }
+
+ const snapshot = await this.props.member.object.snapshot();
+ openDocLink(
+ `${JSON_URL_PREFIX}${encodeURIComponent(JSON.stringify(snapshot))}`
+ );
+ }
+
+ onContextMenu(e) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ if (!this.props.toolboxDoc) {
+ return;
+ }
+
+ const menu = new Menu({ id: "accessibility-row-contextmenu" });
+ menu.append(
+ new MenuItem({
+ id: "menu-printtojson",
+ label: L10N.getStr("accessibility.tree.menu.printToJSON"),
+ click: () => this.printToJSON(),
+ })
+ );
+
+ menu.popup(e.screenX, e.screenY, this.props.toolboxDoc);
+
+ if (gTelemetry) {
+ gTelemetry.scalarAdd(TELEMETRY_ACCESSIBLE_CONTEXT_MENU_OPENED, 1);
+ }
+ }
+
+ /**
+ * Render accessible row component.
+ * @returns acecssible-row React component.
+ */
+ render() {
+ const { member } = this.props;
+ const props = {
+ ...this.props,
+ onContextMenu: e => this.onContextMenu(e),
+ onMouseOver: () => this.highlight(member.object),
+ onMouseOut: () => this.unhighlight(member.object),
+ key: `${member.path}-${member.active ? "active" : "inactive"}`,
+ };
+
+ return AuditController(
+ {
+ accessibleFront: member.object,
+ },
+ AuditFilter({}, HighlightableTreeRow(props))
+ );
+ }
+}
+
+const mapStateToProps = ({
+ ui: { [PREFS.SCROLL_INTO_VIEW]: scrollContentNodeIntoView },
+}) => ({
+ scrollContentNodeIntoView,
+});
+
+module.exports = connect(mapStateToProps, null, null, { withRef: true })(
+ AccessibilityRow
+);
diff --git a/devtools/client/accessibility/components/AccessibilityRowValue.js b/devtools/client/accessibility/components/AccessibilityRowValue.js
new file mode 100644
index 0000000000..ab631fedb4
--- /dev/null
+++ b/devtools/client/accessibility/components/AccessibilityRowValue.js
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const Badges = createFactory(
+ require("resource://devtools/client/accessibility/components/Badges.js")
+);
+const AuditController = createFactory(
+ require("resource://devtools/client/accessibility/components/AuditController.js")
+);
+
+const {
+ REPS,
+} = require("resource://devtools/client/shared/components/reps/index.js");
+const { Grip } = REPS;
+const Rep = createFactory(REPS.Rep);
+
+class AccessibilityRowValue extends Component {
+ static get propTypes() {
+ return {
+ member: PropTypes.shape({
+ object: PropTypes.object,
+ }).isRequired,
+ };
+ }
+
+ render() {
+ return span(
+ {
+ role: "presentation",
+ },
+ Rep({
+ ...this.props,
+ defaultRep: Grip,
+ cropLimit: 50,
+ }),
+ AuditController(
+ {
+ accessibleFront: this.props.member.object,
+ },
+ Badges()
+ )
+ );
+ }
+}
+
+module.exports = AccessibilityRowValue;
diff --git a/devtools/client/accessibility/components/AccessibilityTree.js b/devtools/client/accessibility/components/AccessibilityTree.js
new file mode 100644
index 0000000000..df67377283
--- /dev/null
+++ b/devtools/client/accessibility/components/AccessibilityTree.js
@@ -0,0 +1,298 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+/* global EVENTS */
+
+// React & Redux
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const TreeView = createFactory(
+ require("resource://devtools/client/shared/components/tree/TreeView.js")
+);
+// Reps
+const {
+ MODE,
+} = require("resource://devtools/client/shared/components/reps/index.js");
+
+const {
+ fetchChildren,
+} = require("resource://devtools/client/accessibility/actions/accessibles.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+const {
+ isFiltered,
+} = require("resource://devtools/client/accessibility/utils/audit.js");
+const AccessibilityRow = createFactory(
+ require("resource://devtools/client/accessibility/components/AccessibilityRow.js")
+);
+const AccessibilityRowValue = createFactory(
+ require("resource://devtools/client/accessibility/components/AccessibilityRowValue.js")
+);
+const {
+ Provider,
+} = require("resource://devtools/client/accessibility/provider.js");
+
+const {
+ scrollIntoView,
+} = require("resource://devtools/client/shared/scroll.js");
+
+/**
+ * Renders Accessibility panel tree.
+ */
+class AccessibilityTree extends Component {
+ static get propTypes() {
+ return {
+ toolboxDoc: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ accessibles: PropTypes.object,
+ expanded: PropTypes.object,
+ selected: PropTypes.string,
+ highlighted: PropTypes.object,
+ filtered: PropTypes.bool,
+ getAccessibilityTreeRoot: PropTypes.func.isRequired,
+ startListeningForAccessibilityEvents: PropTypes.func.isRequired,
+ stopListeningForAccessibilityEvents: PropTypes.func.isRequired,
+ highlightAccessible: PropTypes.func.isRequired,
+ unhighlightAccessible: PropTypes.func.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.onNameChange = this.onNameChange.bind(this);
+ this.onReorder = this.onReorder.bind(this);
+ this.onTextChange = this.onTextChange.bind(this);
+ this.renderValue = this.renderValue.bind(this);
+ this.scrollSelectedRowIntoView = this.scrollSelectedRowIntoView.bind(this);
+ }
+
+ /**
+ * Add accessibility event listeners that affect tree rendering and updates.
+ */
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ this.props.startListeningForAccessibilityEvents({
+ reorder: this.onReorder,
+ "name-change": this.onNameChange,
+ "text-change": this.onTextChange,
+ });
+ window.on(
+ EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED,
+ this.scrollSelectedRowIntoView
+ );
+ return null;
+ }
+
+ componentDidUpdate(prevProps) {
+ // When filtering is toggled, make sure that the selected row remains in
+ // view.
+ if (this.props.filtered !== prevProps.filtered) {
+ this.scrollSelectedRowIntoView();
+ }
+
+ window.emit(EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED);
+ }
+
+ /**
+ * Remove accessible event listeners.
+ */
+ componentWillUnmount() {
+ this.props.stopListeningForAccessibilityEvents({
+ reorder: this.onReorder,
+ "name-change": this.onNameChange,
+ "text-change": this.onTextChange,
+ });
+
+ window.off(
+ EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED,
+ this.scrollSelectedRowIntoView
+ );
+ }
+
+ /**
+ * Handle accessible reorder event. If the accessible is cached and rendered
+ * within the accessibility tree, re-fetch its children and re-render the
+ * corresponding subtree.
+ * @param {Object} accessibleFront
+ * accessible front that had its subtree reordered.
+ */
+ onReorder(accessibleFront) {
+ if (this.props.accessibles.has(accessibleFront.actorID)) {
+ this.props.dispatch(fetchChildren(accessibleFront));
+ }
+ }
+
+ scrollSelectedRowIntoView() {
+ const { treeview } = this.refs;
+ if (!treeview) {
+ return;
+ }
+
+ const treeEl = treeview.treeRef.current;
+ if (!treeEl) {
+ return;
+ }
+
+ const selected = treeEl.ownerDocument.querySelector(
+ ".treeTable .treeRow.selected"
+ );
+ if (selected) {
+ scrollIntoView(selected, { center: true });
+ }
+ }
+
+ /**
+ * Handle accessible name change event. If the name of an accessible changes
+ * and that accessible is cached and rendered within the accessibility tree,
+ * re-fetch its parent's children and re-render the corresponding subtree.
+ * @param {Object} accessibleFront
+ * accessible front that had its name changed.
+ * @param {Object} parentFront
+ * optional parent accessible front. Note: if it parent is not
+ * present, we assume that the top level document's name has changed
+ * and use accessible walker as a parent.
+ */
+ onNameChange(accessibleFront, parentFront) {
+ const { accessibles, dispatch } = this.props;
+ const accessibleWalkerFront = accessibleFront.getParent();
+ parentFront = parentFront || accessibleWalkerFront;
+
+ if (
+ accessibles.has(accessibleFront.actorID) ||
+ accessibles.has(parentFront.actorID)
+ ) {
+ dispatch(fetchChildren(parentFront));
+ }
+ }
+
+ /**
+ * Handle accessible text change (change/insert/remove) event. If the text of
+ * an accessible changes and that accessible is cached and rendered within the
+ * accessibility tree, re-fetch its children and re-render the corresponding
+ * subtree.
+ * @param {Object} accessibleFront
+ * accessible front that had its child text changed.
+ */
+ onTextChange(accessibleFront) {
+ const { accessibles, dispatch } = this.props;
+ if (accessibles.has(accessibleFront.actorID)) {
+ dispatch(fetchChildren(accessibleFront));
+ }
+ }
+
+ renderValue(props) {
+ return AccessibilityRowValue(props);
+ }
+
+ /**
+ * Render Accessibility panel content
+ */
+ render() {
+ const columns = [
+ {
+ id: "default",
+ title: L10N.getStr("accessibility.role"),
+ },
+ {
+ id: "value",
+ title: L10N.getStr("accessibility.name"),
+ },
+ ];
+
+ const {
+ accessibles,
+ dispatch,
+ expanded,
+ selected,
+ highlighted: highlightedItem,
+ toolboxDoc,
+ filtered,
+ getAccessibilityTreeRoot,
+ highlightAccessible,
+ unhighlightAccessible,
+ } = this.props;
+
+ const renderRow = rowProps => {
+ const { object } = rowProps.member;
+ const highlighted = object === highlightedItem;
+ return AccessibilityRow(
+ Object.assign({}, rowProps, {
+ toolboxDoc,
+ highlighted,
+ decorator: {
+ getRowClass() {
+ return highlighted ? ["highlighted"] : [];
+ },
+ },
+ highlightAccessible,
+ unhighlightAccessible,
+ })
+ );
+ };
+ const className = filtered ? "filtered" : undefined;
+
+ return TreeView({
+ ref: "treeview",
+ object: getAccessibilityTreeRoot(),
+ mode: MODE.SHORT,
+ provider: new Provider(accessibles, filtered, dispatch),
+ columns,
+ className,
+ renderValue: this.renderValue,
+ renderRow,
+ label: L10N.getStr("accessibility.treeName"),
+ header: true,
+ expandedNodes: expanded,
+ selected,
+ onClickRow(nodePath, event) {
+ if (event.target.classList.contains("theme-twisty")) {
+ this.toggle(nodePath);
+ }
+
+ this.selectRow(
+ this.rows.find(row => row.props.member.path === nodePath),
+ { preventAutoScroll: true }
+ );
+
+ return true;
+ },
+ onContextMenuTree(e) {
+ // If context menu event is triggered on (or bubbled to) the TreeView, it was
+ // done via keyboard. Open context menu for currently selected row.
+ let row = this.getSelectedRow();
+ if (!row) {
+ return;
+ }
+
+ row = row.getWrappedInstance();
+ row.onContextMenu(e);
+ },
+ });
+ }
+}
+
+const mapStateToProps = ({
+ accessibles,
+ ui: { expanded, selected, highlighted },
+ audit: { filters },
+}) => ({
+ accessibles,
+ expanded,
+ selected,
+ highlighted,
+ filtered: isFiltered(filters),
+});
+// Exports from this module
+module.exports = connect(mapStateToProps)(AccessibilityTree);
diff --git a/devtools/client/accessibility/components/AccessibilityTreeFilter.js b/devtools/client/accessibility/components/AccessibilityTreeFilter.js
new file mode 100644
index 0000000000..90eabd350a
--- /dev/null
+++ b/devtools/client/accessibility/components/AccessibilityTreeFilter.js
@@ -0,0 +1,171 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+/* global gTelemetry */
+
+// React
+const {
+ createFactory,
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+ hr,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+loader.lazyGetter(this, "MenuButton", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuButton.js")
+ );
+});
+loader.lazyGetter(this, "MenuItem", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuItem.js")
+ );
+});
+loader.lazyGetter(this, "MenuList", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuList.js")
+ );
+});
+
+const actions = require("resource://devtools/client/accessibility/actions/audit.js");
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ FILTERS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+const TELEMETRY_AUDIT_ACTIVATED = "devtools.accessibility.audit_activated";
+const FILTER_LABELS = {
+ [FILTERS.NONE]: "accessibility.filter.none",
+ [FILTERS.ALL]: "accessibility.filter.all2",
+ [FILTERS.CONTRAST]: "accessibility.filter.contrast",
+ [FILTERS.KEYBOARD]: "accessibility.filter.keyboard",
+ [FILTERS.TEXT_LABEL]: "accessibility.filter.textLabel",
+};
+
+class AccessibilityTreeFilter extends Component {
+ static get propTypes() {
+ return {
+ auditing: PropTypes.array.isRequired,
+ filters: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ describedby: PropTypes.string,
+ toolboxDoc: PropTypes.object.isRequired,
+ audit: PropTypes.func.isRequired,
+ };
+ }
+
+ async toggleFilter(filterKey) {
+ const { audit: auditFunc, dispatch, filters } = this.props;
+
+ if (filterKey !== FILTERS.NONE && !filters[filterKey]) {
+ if (gTelemetry) {
+ gTelemetry.keyedScalarAdd(TELEMETRY_AUDIT_ACTIVATED, filterKey, 1);
+ }
+
+ dispatch(actions.auditing(filterKey));
+ await dispatch(actions.audit(auditFunc, filterKey));
+ }
+
+ // We wait to dispatch filter toggle until the tree is ready to be filtered
+ // right after the audit. This is to make sure that we render an empty tree
+ // (filtered) while the audit is running.
+ dispatch(actions.filterToggle(filterKey));
+ }
+
+ onClick(filterKey) {
+ this.toggleFilter(filterKey);
+ }
+
+ render() {
+ const { auditing, filters, describedby, toolboxDoc } = this.props;
+ const toolbarLabelID = "accessibility-tree-filters-label";
+ const filterNoneChecked = !Object.values(filters).includes(true);
+ const items = [
+ MenuItem({
+ key: FILTERS.NONE,
+ checked: filterNoneChecked,
+ className: `filter ${FILTERS.NONE}`,
+ label: L10N.getStr(FILTER_LABELS[FILTERS.NONE]),
+ onClick: this.onClick.bind(this, FILTERS.NONE),
+ disabled: !!auditing.length,
+ }),
+ hr({ key: "hr-1" }),
+ ];
+
+ const { [FILTERS.ALL]: filterAllChecked, ...filtersWithoutAll } = filters;
+ items.push(
+ MenuItem({
+ key: FILTERS.ALL,
+ checked: filterAllChecked,
+ className: `filter ${FILTERS.ALL}`,
+ label: L10N.getStr(FILTER_LABELS[FILTERS.ALL]),
+ onClick: this.onClick.bind(this, FILTERS.ALL),
+ disabled: !!auditing.length,
+ }),
+ hr({ key: "hr-2" }),
+ Object.entries(filtersWithoutAll).map(([filterKey, active]) =>
+ MenuItem({
+ key: filterKey,
+ checked: active,
+ className: `filter ${filterKey}`,
+ label: L10N.getStr(FILTER_LABELS[filterKey]),
+ onClick: this.onClick.bind(this, filterKey),
+ disabled: !!auditing.length,
+ })
+ )
+ );
+
+ let label;
+ if (filterNoneChecked) {
+ label = L10N.getStr(FILTER_LABELS[FILTERS.NONE]);
+ } else if (filterAllChecked) {
+ label = L10N.getStr(FILTER_LABELS[FILTERS.ALL]);
+ } else {
+ label = Object.keys(filtersWithoutAll)
+ .filter(filterKey => filtersWithoutAll[filterKey])
+ .map(filterKey => L10N.getStr(FILTER_LABELS[filterKey]))
+ .join(", ");
+ }
+
+ return div(
+ {
+ role: "group",
+ className: "accessibility-tree-filters",
+ "aria-labelledby": toolbarLabelID,
+ "aria-describedby": describedby,
+ },
+ span(
+ { id: toolbarLabelID, role: "presentation" },
+ L10N.getStr("accessibility.tree.filters")
+ ),
+ MenuButton(
+ {
+ menuId: "accessibility-tree-filters-menu",
+ toolboxDoc,
+ className: `devtools-button badge toolbar-menu-button filters`,
+ label,
+ },
+ MenuList({}, items)
+ )
+ );
+ }
+}
+
+const mapStateToProps = ({ audit: { filters, auditing } }) => {
+ return { filters, auditing };
+};
+
+// Exports from this module
+module.exports = connect(mapStateToProps)(AccessibilityTreeFilter);
diff --git a/devtools/client/accessibility/components/Accessible.js b/devtools/client/accessibility/components/Accessible.js
new file mode 100644
index 0000000000..36f0068218
--- /dev/null
+++ b/devtools/client/accessibility/components/Accessible.js
@@ -0,0 +1,563 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+/* global EVENTS, gTelemetry */
+
+// React & Redux
+const {
+ createFactory,
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ findDOMNode,
+} = require("resource://devtools/client/shared/vendor/react-dom.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const {
+ TREE_ROW_HEIGHT,
+ ORDERED_PROPS,
+ ACCESSIBLE_EVENTS,
+ VALUE_FLASHING_DURATION,
+} = require("resource://devtools/client/accessibility/constants.js");
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+const {
+ flashElementOn,
+ flashElementOff,
+} = require("resource://devtools/client/inspector/markup/utils.js");
+const {
+ updateDetails,
+} = require("resource://devtools/client/accessibility/actions/details.js");
+const {
+ select,
+ unhighlight,
+} = require("resource://devtools/client/accessibility/actions/accessibles.js");
+
+const Tree = createFactory(
+ require("resource://devtools/client/shared/components/VirtualizedTree.js")
+);
+// Reps
+const {
+ REPS,
+ MODE,
+} = require("resource://devtools/client/shared/components/reps/index.js");
+const { Rep, ElementNode, Accessible: AccessibleRep, Obj } = REPS;
+
+const {
+ translateNodeFrontToGrip,
+} = require("resource://devtools/client/inspector/shared/utils.js");
+
+loader.lazyRequireGetter(
+ this,
+ "openContentLink",
+ "resource://devtools/client/shared/link.js",
+ true
+);
+
+const TELEMETRY_NODE_INSPECTED_COUNT =
+ "devtools.accessibility.node_inspected_count";
+
+const TREE_DEPTH_PADDING_INCREMENT = 20;
+
+class AccessiblePropertyClass extends Component {
+ static get propTypes() {
+ return {
+ accessibleFrontActorID: PropTypes.string,
+ object: PropTypes.any,
+ focused: PropTypes.bool,
+ children: PropTypes.func,
+ };
+ }
+
+ componentDidUpdate({
+ object: prevObject,
+ accessibleFrontActorID: prevAccessibleFrontActorID,
+ }) {
+ const { accessibleFrontActorID, object, focused } = this.props;
+ // Fast check if row is focused or if the value did not update.
+ if (
+ focused ||
+ accessibleFrontActorID !== prevAccessibleFrontActorID ||
+ prevObject === object ||
+ (object && prevObject && typeof object === "object")
+ ) {
+ return;
+ }
+
+ this.flashRow();
+ }
+
+ flashRow() {
+ const row = findDOMNode(this);
+ flashElementOn(row);
+ if (this._flashMutationTimer) {
+ clearTimeout(this._flashMutationTimer);
+ this._flashMutationTimer = null;
+ }
+ this._flashMutationTimer = setTimeout(() => {
+ flashElementOff(row);
+ }, VALUE_FLASHING_DURATION);
+ }
+
+ render() {
+ return this.props.children();
+ }
+}
+
+const AccessibleProperty = createFactory(AccessiblePropertyClass);
+
+class Accessible extends Component {
+ static get propTypes() {
+ return {
+ accessibleFront: PropTypes.object,
+ dispatch: PropTypes.func.isRequired,
+ nodeFront: PropTypes.object,
+ items: PropTypes.array,
+ labelledby: PropTypes.string.isRequired,
+ parents: PropTypes.object,
+ relations: PropTypes.object,
+ toolbox: PropTypes.object.isRequired,
+ toolboxHighlighter: PropTypes.object.isRequired,
+ highlightAccessible: PropTypes.func.isRequired,
+ unhighlightAccessible: PropTypes.func.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ expanded: new Set(),
+ active: null,
+ focused: null,
+ };
+
+ this.onAccessibleInspected = this.onAccessibleInspected.bind(this);
+ this.renderItem = this.renderItem.bind(this);
+ this.update = this.update.bind(this);
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ window.on(
+ EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED,
+ this.onAccessibleInspected
+ );
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillReceiveProps({ accessibleFront }) {
+ const oldAccessibleFront = this.props.accessibleFront;
+
+ if (oldAccessibleFront) {
+ if (
+ accessibleFront &&
+ accessibleFront.actorID === oldAccessibleFront.actorID
+ ) {
+ return;
+ }
+ ACCESSIBLE_EVENTS.forEach(event =>
+ oldAccessibleFront.off(event, this.update)
+ );
+ }
+
+ if (accessibleFront) {
+ ACCESSIBLE_EVENTS.forEach(event =>
+ accessibleFront.on(event, this.update)
+ );
+ }
+ }
+
+ componentDidUpdate(prevProps) {
+ if (
+ this.props.accessibleFront &&
+ !this.props.accessibleFront.isDestroyed() &&
+ this.props.accessibleFront !== prevProps.accessibleFront
+ ) {
+ window.emit(EVENTS.PROPERTIES_UPDATED);
+ }
+ }
+
+ componentWillUnmount() {
+ window.off(
+ EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED,
+ this.onAccessibleInspected
+ );
+
+ const { accessibleFront } = this.props;
+ if (accessibleFront) {
+ ACCESSIBLE_EVENTS.forEach(event =>
+ accessibleFront.off(event, this.update)
+ );
+ }
+ }
+
+ onAccessibleInspected() {
+ const { props } = this.refs;
+ if (props) {
+ props.refs.tree.focus();
+ }
+ }
+
+ update() {
+ const { dispatch, accessibleFront } = this.props;
+ if (accessibleFront.isDestroyed()) {
+ return;
+ }
+
+ dispatch(updateDetails(accessibleFront));
+ }
+
+ setExpanded(item, isExpanded) {
+ const { expanded } = this.state;
+
+ if (isExpanded) {
+ expanded.add(item.path);
+ } else {
+ expanded.delete(item.path);
+ }
+
+ this.setState({ expanded });
+ }
+
+ async showHighlighter(nodeFront) {
+ if (!this.props.toolboxHighlighter) {
+ return;
+ }
+
+ await this.props.toolboxHighlighter.highlight(nodeFront);
+ }
+
+ async hideHighlighter() {
+ if (!this.props.toolboxHighlighter) {
+ return;
+ }
+
+ await this.props.toolboxHighlighter.unhighlight();
+ }
+
+ showAccessibleHighlighter(accessibleFront) {
+ this.props.dispatch(unhighlight());
+ this.props.highlightAccessible(accessibleFront);
+ }
+
+ hideAccessibleHighlighter(accessibleFront) {
+ this.props.dispatch(unhighlight());
+ this.props.unhighlightAccessible(accessibleFront);
+ }
+
+ async selectNode(nodeFront, reason = "accessibility") {
+ if (gTelemetry) {
+ gTelemetry.scalarAdd(TELEMETRY_NODE_INSPECTED_COUNT, 1);
+ }
+
+ if (!this.props.toolbox) {
+ return;
+ }
+
+ const inspector = await this.props.toolbox.selectTool("inspector");
+ inspector.selection.setNodeFront(nodeFront, reason);
+ }
+
+ async selectAccessible(accessibleFront) {
+ if (!accessibleFront) {
+ return;
+ }
+
+ await this.props.dispatch(select(accessibleFront));
+
+ const { props } = this.refs;
+ if (props) {
+ props.refs.tree.blur();
+ }
+ await this.setState({ active: null, focused: null });
+
+ window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED);
+ }
+
+ openLink(link, e) {
+ openContentLink(link);
+ }
+
+ renderItem(item, depth, focused, arrow, expanded) {
+ const object = item.contents;
+ const valueProps = {
+ object,
+ mode: MODE.TINY,
+ title: "Object",
+ openLink: this.openLink,
+ };
+
+ if (isNodeFront(object)) {
+ valueProps.defaultRep = ElementNode;
+ valueProps.onDOMNodeMouseOut = () => this.hideHighlighter();
+ valueProps.onDOMNodeMouseOver = () =>
+ this.showHighlighter(this.props.nodeFront);
+
+ valueProps.inspectIconTitle = L10N.getStr(
+ "accessibility.accessible.selectNodeInInspector.title"
+ );
+ valueProps.onInspectIconClick = () =>
+ this.selectNode(this.props.nodeFront);
+ } else if (isAccessibleFront(object)) {
+ const target = findAccessibleTarget(this.props.relations, object.actor);
+ valueProps.defaultRep = AccessibleRep;
+ valueProps.onAccessibleMouseOut = () =>
+ this.hideAccessibleHighlighter(target);
+ valueProps.onAccessibleMouseOver = () =>
+ this.showAccessibleHighlighter(target);
+ valueProps.inspectIconTitle = L10N.getStr(
+ "accessibility.accessible.selectElement.title"
+ );
+ valueProps.onInspectIconClick = (obj, e) => {
+ e.stopPropagation();
+ this.selectAccessible(target);
+ };
+ valueProps.separatorText = "";
+ } else if (item.name === "relations") {
+ valueProps.defaultRep = Obj;
+ } else {
+ valueProps.noGrip = true;
+ }
+
+ const classList = ["node", "object-node"];
+ if (focused) {
+ classList.push("focused");
+ }
+
+ const depthPadding = depth * TREE_DEPTH_PADDING_INCREMENT;
+
+ return AccessibleProperty(
+ {
+ object,
+ focused,
+ accessibleFrontActorID: this.props.accessibleFront.actorID,
+ },
+ () =>
+ div(
+ {
+ className: classList.join(" "),
+ style: {
+ paddingInlineStart: depthPadding,
+ inlineSize: `calc(var(--accessibility-properties-item-width) - ${depthPadding}px)`,
+ },
+ onClick: e => {
+ if (e.target.classList.contains("theme-twisty")) {
+ this.setExpanded(item, !expanded);
+ }
+ },
+ },
+ arrow,
+ span({ className: "object-label" }, item.name),
+ span({ className: "object-delimiter" }, ":"),
+ span({ className: "object-value" }, Rep(valueProps) || "")
+ )
+ );
+ }
+
+ render() {
+ const { expanded, active, focused } = this.state;
+ const { items, parents, accessibleFront, labelledby } = this.props;
+
+ if (accessibleFront) {
+ return Tree({
+ ref: "props",
+ key: "accessible-properties",
+ itemHeight: TREE_ROW_HEIGHT,
+ getRoots: () => items,
+ getKey: item => item.path,
+ getParent: item => parents.get(item),
+ getChildren: item => item.children,
+ isExpanded: item => expanded.has(item.path),
+ onExpand: item => this.setExpanded(item, true),
+ onCollapse: item => this.setExpanded(item, false),
+ onFocus: item => {
+ if (this.state.focused !== item.path) {
+ this.setState({ focused: item.path });
+ }
+ },
+ onActivate: item => {
+ if (item == null) {
+ this.setState({ active: null });
+ } else if (this.state.active !== item.path) {
+ this.setState({ active: item.path });
+ }
+ },
+ focused: findByPath(focused, items),
+ active: findByPath(active, items),
+ renderItem: this.renderItem,
+ labelledby,
+ });
+ }
+
+ return div(
+ { className: "info" },
+ L10N.getStr("accessibility.accessible.notAvailable")
+ );
+ }
+}
+
+/**
+ * Match accessibility object from relations targets to the grip that's being activated.
+ * @param {Object} relations Object containing relations grouped by type and targets.
+ * @param {String} actorID Actor ID to match to the relation target.
+ * @return {Object} Accessible front that matches the relation target.
+ */
+const findAccessibleTarget = (relations, actorID) => {
+ for (const relationType in relations) {
+ let targets = relations[relationType];
+ targets = Array.isArray(targets) ? targets : [targets];
+ for (const target of targets) {
+ if (target.actorID === actorID) {
+ return target;
+ }
+ }
+ }
+
+ return null;
+};
+
+/**
+ * Find an item based on a given path.
+ * @param {String} path
+ * Key of the item to be looked up.
+ * @param {Array} items
+ * Accessibility properties array.
+ * @return {Object?}
+ * Possibly found item.
+ */
+const findByPath = (path, items) => {
+ for (const item of items) {
+ if (item.path === path) {
+ return item;
+ }
+
+ const found = findByPath(path, item.children);
+ if (found) {
+ return found;
+ }
+ }
+ return null;
+};
+
+/**
+ * Check if a given property is a DOMNode front.
+ * @param {Object?} value A property to check for being a DOMNode.
+ * @return {Boolean} A flag that indicates whether a property is a DOMNode.
+ */
+const isNodeFront = value => value && value.typeName === "domnode";
+
+/**
+ * Check if a given property is an Accessible front.
+ * @param {Object?} value A property to check for being an Accessible.
+ * @return {Boolean} A flag that indicates whether a property is an Accessible.
+ */
+const isAccessibleFront = value => value && value.typeName === "accessible";
+
+/**
+ * While waiting for a reps fix in https://github.com/firefox-devtools/reps/issues/92,
+ * translate accessibleFront to a grip-like object that can be used with an Accessible
+ * rep.
+ *
+ * @params {accessibleFront} accessibleFront
+ * The AccessibleFront for which we want to create a grip-like object.
+ * @returns {Object} a grip-like object that can be used with Reps.
+ */
+const translateAccessibleFrontToGrip = accessibleFront => ({
+ actor: accessibleFront.actorID,
+ typeName: accessibleFront.typeName,
+ preview: {
+ name: accessibleFront.name,
+ role: accessibleFront.role,
+ // All the grid containers are assumed to be in the Accessibility tree.
+ isConnected: true,
+ },
+});
+
+const translateNodeFrontToGripWrapper = nodeFront => ({
+ ...translateNodeFrontToGrip(nodeFront),
+ typeName: nodeFront.typeName,
+});
+
+/**
+ * Build props ingestible by Tree component.
+ * @param {Object} props Component properties to be processed.
+ * @param {String} parentPath Unique path that is used to identify a Tree Node.
+ * @return {Object} Processed properties.
+ */
+const makeItemsForDetails = (props, parentPath) =>
+ Object.getOwnPropertyNames(props).map(name => {
+ let children = [];
+ const path = `${parentPath}/${name}`;
+ let contents = props[name];
+
+ if (contents) {
+ if (isNodeFront(contents)) {
+ contents = translateNodeFrontToGripWrapper(contents);
+ name = "DOMNode";
+ } else if (isAccessibleFront(contents)) {
+ contents = translateAccessibleFrontToGrip(contents);
+ } else if (Array.isArray(contents) || typeof contents === "object") {
+ children = makeItemsForDetails(contents, path);
+ }
+ }
+
+ return { name, path, contents, children };
+ });
+
+const makeParentMap = items => {
+ const map = new WeakMap();
+
+ function _traverse(item) {
+ if (item.children.length) {
+ for (const child of item.children) {
+ map.set(child, item);
+ _traverse(child);
+ }
+ }
+ }
+
+ items.forEach(_traverse);
+ return map;
+};
+
+const mapStateToProps = ({ details }) => {
+ const {
+ accessible: accessibleFront,
+ DOMNode: nodeFront,
+ relations,
+ } = details;
+ if (!accessibleFront || !nodeFront) {
+ return {};
+ }
+
+ const items = makeItemsForDetails(
+ ORDERED_PROPS.reduce((props, key) => {
+ if (key === "DOMNode") {
+ props.nodeFront = nodeFront;
+ } else if (key === "relations") {
+ props.relations = relations;
+ } else {
+ props[key] = accessibleFront[key];
+ }
+
+ return props;
+ }, {}),
+ ""
+ );
+ const parents = makeParentMap(items);
+
+ return { accessibleFront, nodeFront, items, parents, relations };
+};
+
+module.exports = connect(mapStateToProps)(Accessible);
diff --git a/devtools/client/accessibility/components/AuditController.js b/devtools/client/accessibility/components/AuditController.js
new file mode 100644
index 0000000000..e6ada9a0a9
--- /dev/null
+++ b/devtools/client/accessibility/components/AuditController.js
@@ -0,0 +1,90 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const React = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+class AuditController extends React.Component {
+ static get propTypes() {
+ return {
+ accessibleFront: PropTypes.object.isRequired,
+ children: PropTypes.any,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ const {
+ accessibleFront: { checks },
+ } = props;
+ this.state = {
+ checks,
+ };
+
+ this.onAudited = this.onAudited.bind(this);
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ const { accessibleFront } = this.props;
+ accessibleFront.on("audited", this.onAudited);
+ }
+
+ componentDidMount() {
+ this.maybeRequestAudit();
+ }
+
+ componentDidUpdate() {
+ this.maybeRequestAudit();
+ }
+
+ componentWillUnmount() {
+ const { accessibleFront } = this.props;
+ accessibleFront.off("audited", this.onAudited);
+ }
+
+ onAudited() {
+ const { accessibleFront } = this.props;
+ if (accessibleFront.isDestroyed()) {
+ // Accessible front is being removed, stop listening for 'audited' events.
+ accessibleFront.off("audited", this.onAudited);
+ return;
+ }
+
+ this.setState({ checks: accessibleFront.checks });
+ }
+
+ maybeRequestAudit() {
+ const { accessibleFront } = this.props;
+ if (accessibleFront.isDestroyed()) {
+ // Accessible front is being removed, stop listening for 'audited' events.
+ accessibleFront.off("audited", this.onAudited);
+ return;
+ }
+
+ if (accessibleFront.checks) {
+ return;
+ }
+
+ accessibleFront.audit().catch(error => {
+ // If the actor was destroyed (due to a connection closed for instance) do
+ // nothing, otherwise log a warning
+ if (!accessibleFront.isDestroyed()) {
+ console.warn(error);
+ }
+ });
+ }
+
+ render() {
+ const { children } = this.props;
+ const { checks } = this.state;
+
+ return React.Children.only(React.cloneElement(children, { checks }));
+ }
+}
+
+module.exports = AuditController;
diff --git a/devtools/client/accessibility/components/AuditFilter.js b/devtools/client/accessibility/components/AuditFilter.js
new file mode 100644
index 0000000000..361a1c30a7
--- /dev/null
+++ b/devtools/client/accessibility/components/AuditFilter.js
@@ -0,0 +1,91 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const React = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const {
+ isFiltered,
+} = require("resource://devtools/client/accessibility/utils/audit.js");
+const {
+ FILTERS,
+} = require("resource://devtools/client/accessibility/constants.js");
+const {
+ accessibility: {
+ AUDIT_TYPE,
+ SCORES: { BEST_PRACTICES, FAIL, WARNING },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+function validateCheck({ error, score }) {
+ return !error && [BEST_PRACTICES, FAIL, WARNING].includes(score);
+}
+
+const AUDIT_TYPE_TO_FILTER = {
+ [AUDIT_TYPE.CONTRAST]: {
+ filterKey: FILTERS.CONTRAST,
+ validator: validateCheck,
+ },
+ [AUDIT_TYPE.KEYBOARD]: {
+ filterKey: FILTERS.KEYBOARD,
+ validator: validateCheck,
+ },
+ [AUDIT_TYPE.TEXT_LABEL]: {
+ filterKey: FILTERS.TEXT_LABEL,
+ validator: validateCheck,
+ },
+};
+
+class AuditFilter extends React.Component {
+ static get propTypes() {
+ return {
+ checks: PropTypes.object,
+ children: PropTypes.any,
+ filters: PropTypes.object.isRequired,
+ };
+ }
+
+ isVisible(filters) {
+ return !isFiltered(filters);
+ }
+
+ shouldHide() {
+ const { filters, checks } = this.props;
+ if (this.isVisible(filters)) {
+ return false;
+ }
+
+ if (!checks || Object.values(checks).every(check => check == null)) {
+ return true;
+ }
+
+ for (const type in checks) {
+ if (
+ AUDIT_TYPE_TO_FILTER[type] &&
+ checks[type] &&
+ filters[AUDIT_TYPE_TO_FILTER[type].filterKey] &&
+ AUDIT_TYPE_TO_FILTER[type].validator(checks[type])
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ render() {
+ return this.shouldHide() ? null : this.props.children;
+ }
+}
+
+const mapStateToProps = ({ audit: { filters } }) => {
+ return { filters };
+};
+
+module.exports = connect(mapStateToProps)(AuditFilter);
diff --git a/devtools/client/accessibility/components/AuditProgressOverlay.js b/devtools/client/accessibility/components/AuditProgressOverlay.js
new file mode 100644
index 0000000000..e9f4291286
--- /dev/null
+++ b/devtools/client/accessibility/components/AuditProgressOverlay.js
@@ -0,0 +1,95 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const React = require("resource://devtools/client/shared/vendor/react.js");
+const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const { PluralForm } = require("resource://devtools/shared/plural-form.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+/**
+ * Helper functional component to render an accessible text progressbar.
+ * @param {Object} props
+ * - id for the progressbar element
+ * - valuetext for the progressbar element
+ */
+function TextProgressBar({ id, textStringKey }) {
+ const text = L10N.getStr(textStringKey);
+ return ReactDOM.span(
+ {
+ id,
+ key: id,
+ role: "progressbar",
+ "aria-valuetext": text,
+ },
+ text
+ );
+}
+
+class AuditProgressOverlay extends React.Component {
+ static get propTypes() {
+ return {
+ auditing: PropTypes.array.isRequired,
+ total: PropTypes.number,
+ percentage: PropTypes.number,
+ };
+ }
+
+ render() {
+ const { auditing, percentage, total } = this.props;
+ if (auditing.length === 0) {
+ return null;
+ }
+
+ const id = "audit-progress-container";
+
+ if (total == null) {
+ return TextProgressBar({
+ id,
+ textStringKey: "accessibility.progress.initializing",
+ });
+ }
+
+ if (percentage === 100) {
+ return TextProgressBar({
+ id,
+ textStringKey: "accessibility.progress.finishing",
+ });
+ }
+
+ const progressbarString = PluralForm.get(
+ total,
+ L10N.getStr("accessibility.progress.progressbar")
+ );
+
+ return ReactDOM.span(
+ {
+ id,
+ key: id,
+ },
+ progressbarString.replace("#1", total),
+ ReactDOM.progress({
+ max: 100,
+ value: percentage,
+ className: "audit-progress-progressbar",
+ "aria-labelledby": id,
+ })
+ );
+ }
+}
+
+const mapStateToProps = ({ audit: { auditing, progress } }) => {
+ const { total, percentage } = progress || {};
+ return { auditing, total, percentage };
+};
+
+module.exports = connect(mapStateToProps)(AuditProgressOverlay);
diff --git a/devtools/client/accessibility/components/Badge.js b/devtools/client/accessibility/components/Badge.js
new file mode 100644
index 0000000000..207bb96f55
--- /dev/null
+++ b/devtools/client/accessibility/components/Badge.js
@@ -0,0 +1,40 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+class Badge extends Component {
+ static get propTypes() {
+ return {
+ score: PropTypes.string.isRequired,
+ label: PropTypes.string.isRequired,
+ ariaLabel: PropTypes.string,
+ tooltip: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { score, label, ariaLabel, tooltip } = this.props;
+
+ return span(
+ {
+ className: `audit-badge badge`,
+ "data-score": score,
+ title: tooltip,
+ "aria-label": ariaLabel || label,
+ },
+ label
+ );
+ }
+}
+
+module.exports = Badge;
diff --git a/devtools/client/accessibility/components/Badges.js b/devtools/client/accessibility/components/Badges.js
new file mode 100644
index 0000000000..00079d21b6
--- /dev/null
+++ b/devtools/client/accessibility/components/Badges.js
@@ -0,0 +1,88 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ accessibility: { AUDIT_TYPE },
+} = require("resource://devtools/shared/constants.js");
+
+loader.lazyGetter(this, "ContrastBadge", () =>
+ createFactory(
+ require("resource://devtools/client/accessibility/components/ContrastBadge.js")
+ )
+);
+
+loader.lazyGetter(this, "KeyboardBadge", () =>
+ createFactory(
+ require("resource://devtools/client/accessibility/components/KeyboardBadge.js")
+ )
+);
+
+loader.lazyGetter(this, "TextLabelBadge", () =>
+ createFactory(
+ require("resource://devtools/client/accessibility/components/TextLabelBadge.js")
+ )
+);
+
+function getComponentForAuditType(type) {
+ const auditTypeToComponentMap = {
+ [AUDIT_TYPE.CONTRAST]: ContrastBadge,
+ [AUDIT_TYPE.KEYBOARD]: KeyboardBadge,
+ [AUDIT_TYPE.TEXT_LABEL]: TextLabelBadge,
+ };
+
+ return auditTypeToComponentMap[type];
+}
+
+class Badges extends Component {
+ static get propTypes() {
+ return {
+ checks: PropTypes.object,
+ };
+ }
+
+ render() {
+ const { checks } = this.props;
+ if (!checks) {
+ return null;
+ }
+
+ const items = [];
+ for (const type in checks) {
+ const component = getComponentForAuditType(type);
+ if (checks[type] && component) {
+ items.push(component({ key: type, ...checks[type] }));
+ }
+ }
+
+ if (items.length === 0) {
+ return null;
+ }
+
+ return span(
+ {
+ className: "badges",
+ role: "group",
+ "aria-label": L10N.getStr("accessibility.badges"),
+ },
+ items
+ );
+ }
+}
+
+module.exports = Badges;
diff --git a/devtools/client/accessibility/components/Button.js b/devtools/client/accessibility/components/Button.js
new file mode 100644
index 0000000000..92cd90a56c
--- /dev/null
+++ b/devtools/client/accessibility/components/Button.js
@@ -0,0 +1,112 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ button,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const defaultProps = {
+ disabled: false,
+ busy: false,
+ title: null,
+ children: null,
+ className: "",
+};
+
+/**
+ * Button component that handles keyboard in an accessible way. When user
+ * uses the mouse to hover/click on the button, there is no focus
+ * highlighting. However if the user uses a keyboard to focus on the button,
+ * it will have focus highlighting in the form of an outline.
+ */
+class Button extends Component {
+ static get propTypes() {
+ return {
+ disabled: PropTypes.bool,
+ busy: PropTypes.bool,
+ title: PropTypes.string,
+ children: PropTypes.string,
+ className: PropTypes.string,
+ };
+ }
+
+ static get defaultProps() {
+ return defaultProps;
+ }
+
+ render() {
+ const className = [
+ ...this.props.className.split(" "),
+ "devtools-button",
+ ].join(" ");
+ const props = Object.assign({}, this.props, {
+ className,
+ "aria-busy": this.props.busy.toString(),
+ busy: this.props.busy.toString(),
+ });
+
+ const classList = ["btn-content"];
+ if (this.props.busy) {
+ classList.push("devtools-throbber");
+ }
+
+ return button(
+ props,
+ span(
+ {
+ className: classList.join(" "),
+ tabIndex: -1,
+ },
+ this.props.children
+ )
+ );
+ }
+}
+
+function ToggleButton(props) {
+ const {
+ active,
+ busy,
+ disabled,
+ label,
+ className,
+ onClick,
+ onKeyDown,
+ tooltip,
+ } = props;
+ const classList = [...className.split(" "), "toggle-button"];
+
+ if (active) {
+ classList.push("checked");
+ }
+
+ if (busy) {
+ classList.push("devtools-throbber");
+ }
+
+ return button(
+ {
+ disabled,
+ "aria-pressed": active === true,
+ "aria-busy": busy,
+ className: classList.join(" "),
+ onClick,
+ onKeyDown,
+ title: tooltip,
+ },
+ label
+ );
+}
+
+module.exports = {
+ Button,
+ ToggleButton,
+};
diff --git a/devtools/client/accessibility/components/Check.js b/devtools/client/accessibility/components/Check.js
new file mode 100644
index 0000000000..3ca6c9c39a
--- /dev/null
+++ b/devtools/client/accessibility/components/Check.js
@@ -0,0 +1,157 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ Component,
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+
+const {
+ accessibility: {
+ SCORES: { BEST_PRACTICES, FAIL, WARNING },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+/**
+ * A map of accessibility scores to the text descriptions of check icons.
+ */
+const SCORE_TO_ICON_MAP = {
+ [BEST_PRACTICES]: {
+ l10nId: "accessibility-best-practices",
+ src: "chrome://devtools/skin/images/info.svg",
+ },
+ [FAIL]: {
+ l10nId: "accessibility-fail",
+ src: "chrome://devtools/skin/images/error.svg",
+ },
+ [WARNING]: {
+ l10nId: "accessibility-warning",
+ src: "chrome://devtools/skin/images/alert.svg",
+ },
+};
+
+/**
+ * Localized "Learn more" link that opens a new tab with relevant documentation.
+ */
+class LearnMoreClass extends PureComponent {
+ static get propTypes() {
+ return {
+ href: PropTypes.string,
+ l10nId: PropTypes.string.isRequired,
+ onClick: PropTypes.func,
+ };
+ }
+
+ static get defaultProps() {
+ return {
+ href: "#",
+ l10nId: null,
+ onClick: LearnMoreClass.openDocOnClick,
+ };
+ }
+
+ static openDocOnClick(event) {
+ event.preventDefault();
+ openDocLink(event.target.href);
+ }
+
+ render() {
+ const { href, l10nId, onClick } = this.props;
+ const className = "link";
+
+ return Localized({ id: l10nId }, ReactDOM.a({ className, href, onClick }));
+ }
+}
+
+const LearnMore = createFactory(LearnMoreClass);
+
+/**
+ * Renders icon with text description for the accessibility check.
+ *
+ * @param {Object}
+ * Options:
+ * - score: value from SCORES from "devtools/shared/constants"
+ */
+function Icon({ score }) {
+ const { l10nId, src } = SCORE_TO_ICON_MAP[score];
+
+ return Localized(
+ { id: l10nId, attrs: { alt: true } },
+ ReactDOM.img({ src, "data-score": score, className: "icon" })
+ );
+}
+
+/**
+ * Renders text description of the accessibility check.
+ *
+ * @param {Object}
+ * Options:
+ * - args: arguments for fluent localized string
+ * - href: url for the learn more link pointing to MDN
+ * - l10nId: fluent localization id
+ */
+function Annotation({ args, href, l10nId }) {
+ return Localized(
+ {
+ id: l10nId,
+ a: LearnMore({ l10nId: "accessibility-learn-more", href }),
+ ...args,
+ },
+ ReactDOM.p({ className: "accessibility-check-annotation" })
+ );
+}
+
+/**
+ * Component for rendering a check for accessibliity checks section,
+ * warnings and best practices suggestions association with a given
+ * accessibility object in the accessibility tree.
+ */
+class Check extends Component {
+ static get propTypes() {
+ return {
+ getAnnotation: PropTypes.func.isRequired,
+ id: PropTypes.string.isRequired,
+ issue: PropTypes.string.isRequired,
+ score: PropTypes.string.isRequired,
+ };
+ }
+
+ render() {
+ const { getAnnotation, id, issue, score } = this.props;
+
+ return ReactDOM.div(
+ {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-check",
+ },
+ Localized(
+ {
+ id,
+ },
+ ReactDOM.h3({ className: "accessibility-check-header" })
+ ),
+ ReactDOM.div(
+ {
+ role: "presentation",
+ tabIndex: "-1",
+ },
+ Icon({ score }),
+ Annotation({ ...getAnnotation(issue) })
+ )
+ );
+ }
+}
+
+module.exports = Check;
diff --git a/devtools/client/accessibility/components/Checks.js b/devtools/client/accessibility/components/Checks.js
new file mode 100644
index 0000000000..f2b4e4835a
--- /dev/null
+++ b/devtools/client/accessibility/components/Checks.js
@@ -0,0 +1,117 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const List = createFactory(
+ require("resource://devtools/client/shared/components/List.js").List
+);
+const ColorContrastCheck = createFactory(
+ require("resource://devtools/client/accessibility/components/ColorContrastAccessibility.js")
+ .ColorContrastCheck
+);
+const TextLabelCheck = createFactory(
+ require("resource://devtools/client/accessibility/components/TextLabelCheck.js")
+);
+const KeyboardCheck = createFactory(
+ require("resource://devtools/client/accessibility/components/KeyboardCheck.js")
+);
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ accessibility: { AUDIT_TYPE },
+} = require("resource://devtools/shared/constants.js");
+
+function EmptyChecks() {
+ return div(
+ {
+ className: "checks-empty",
+ role: "presentation",
+ tabIndex: "-1",
+ },
+ L10N.getStr("accessibility.checks.empty2")
+ );
+}
+
+// Component that is responsible for rendering accessible audit data in the a11y panel
+// sidebar.
+class Checks extends Component {
+ static get propTypes() {
+ return {
+ audit: PropTypes.object,
+ labelledby: PropTypes.string.isRequired,
+ };
+ }
+
+ [AUDIT_TYPE.CONTRAST](contrastRatio) {
+ return ColorContrastCheck(contrastRatio);
+ }
+
+ [AUDIT_TYPE.KEYBOARD](keyboardCheck) {
+ return KeyboardCheck(keyboardCheck);
+ }
+
+ [AUDIT_TYPE.TEXT_LABEL](textLabelCheck) {
+ return TextLabelCheck(textLabelCheck);
+ }
+
+ render() {
+ const { audit, labelledby } = this.props;
+ if (!audit) {
+ return EmptyChecks();
+ }
+
+ const items = [];
+ for (const name in audit) {
+ // There are going to be various audit reports for this object, sent by the server.
+ // Iterate over them and delegate rendering to the method with the corresponding
+ // name.
+ if (audit[name] && this[name]) {
+ items.push({
+ component: this[name](audit[name]),
+ className: name,
+ key: name,
+ });
+ }
+ }
+
+ if (items.length === 0) {
+ return EmptyChecks();
+ }
+
+ return div(
+ {
+ className: "checks",
+ role: "presentation",
+ tabIndex: "-1",
+ },
+ List({ items, labelledby })
+ );
+ }
+}
+
+const mapStateToProps = ({ details, ui }) => {
+ const { audit } = details;
+ if (!audit) {
+ return {};
+ }
+
+ return { audit };
+};
+
+module.exports = connect(mapStateToProps)(Checks);
diff --git a/devtools/client/accessibility/components/ColorContrastAccessibility.js b/devtools/client/accessibility/components/ColorContrastAccessibility.js
new file mode 100644
index 0000000000..117ab67593
--- /dev/null
+++ b/devtools/client/accessibility/components/ColorContrastAccessibility.js
@@ -0,0 +1,229 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ div,
+ span,
+ h3,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const LearnMoreLink = createFactory(
+ require("resource://devtools/client/accessibility/components/LearnMoreLink.js")
+);
+
+const {
+ A11Y_CONTRAST_LEARN_MORE_LINK,
+} = require("resource://devtools/client/accessibility/constants.js");
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+/**
+ * Component that renders a colour contrast value along with a swatch preview of what the
+ * text and background colours are.
+ */
+class ContrastValueClass extends Component {
+ static get propTypes() {
+ return {
+ backgroundColor: PropTypes.array.isRequired,
+ color: PropTypes.array.isRequired,
+ value: PropTypes.number.isRequired,
+ score: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { backgroundColor, color, value, score } = this.props;
+
+ const className = ["accessibility-contrast-value", score].join(" ");
+
+ return span(
+ {
+ className,
+ role: "presentation",
+ style: {
+ "--accessibility-contrast-color": `rgba(${color})`,
+ "--accessibility-contrast-bg": `rgba(${backgroundColor})`,
+ },
+ },
+ value.toFixed(2)
+ );
+ }
+}
+
+const ContrastValue = createFactory(ContrastValueClass);
+
+/**
+ * Component that renders labeled colour contrast values together with the large text
+ * indiscator.
+ */
+class ColorContrastAccessibilityClass extends Component {
+ static get propTypes() {
+ return {
+ error: PropTypes.string,
+ isLargeText: PropTypes.bool.isRequired,
+ color: PropTypes.array.isRequired,
+ value: PropTypes.number,
+ min: PropTypes.number,
+ max: PropTypes.number,
+ backgroundColor: PropTypes.array,
+ backgroundColorMin: PropTypes.array,
+ backgroundColorMax: PropTypes.array,
+ score: PropTypes.string,
+ scoreMin: PropTypes.string,
+ scoreMax: PropTypes.string,
+ };
+ }
+
+ render() {
+ const {
+ error,
+ isLargeText,
+ color,
+ value,
+ backgroundColor,
+ score,
+ min,
+ backgroundColorMin,
+ scoreMin,
+ max,
+ backgroundColorMax,
+ scoreMax,
+ } = this.props;
+
+ const children = [];
+
+ if (error) {
+ children.push(
+ span(
+ {
+ className: "accessibility-color-contrast-error",
+ role: "presentation",
+ },
+ L10N.getStr("accessibility.contrast.error")
+ )
+ );
+
+ return div(
+ {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast",
+ },
+ ...children
+ );
+ }
+
+ if (value) {
+ children.push(ContrastValue({ score, color, backgroundColor, value }));
+ } else {
+ children.push(
+ ContrastValue({
+ score: scoreMin,
+ color,
+ backgroundColor: backgroundColorMin,
+ value: min,
+ }),
+ div({
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast-separator",
+ }),
+ ContrastValue({
+ score: scoreMax,
+ color,
+ backgroundColor: backgroundColorMax,
+ value: max,
+ })
+ );
+ }
+
+ if (isLargeText) {
+ children.push(
+ span(
+ {
+ className: "accessibility-color-contrast-large-text",
+ role: "presentation",
+ title: L10N.getStr("accessibility.contrast.large.title"),
+ },
+ L10N.getStr("accessibility.contrast.large.text")
+ )
+ );
+ }
+
+ return div(
+ {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast",
+ },
+ ...children
+ );
+ }
+}
+
+const ColorContrastAccessibility = createFactory(
+ ColorContrastAccessibilityClass
+);
+
+class ContrastAnnotationClass extends Component {
+ static get propTypes() {
+ return {
+ score: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { score } = this.props;
+
+ return LearnMoreLink({
+ className: "accessibility-check-annotation",
+ href: A11Y_CONTRAST_LEARN_MORE_LINK,
+ learnMoreStringKey: "accessibility.learnMore",
+ l10n: L10N,
+ messageStringKey: `accessibility.contrast.annotation.${score}`,
+ });
+ }
+}
+
+const ContrastAnnotation = createFactory(ContrastAnnotationClass);
+
+class ColorContrastCheck extends Component {
+ static get propTypes() {
+ return {
+ error: PropTypes.string.isRequired,
+ };
+ }
+
+ render() {
+ const { error } = this.props;
+
+ return div(
+ {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-check",
+ },
+ h3(
+ {
+ className: "accessibility-check-header",
+ },
+ L10N.getStr("accessibility.contrast.header")
+ ),
+ ColorContrastAccessibility(this.props),
+ !error && ContrastAnnotation(this.props)
+ );
+ }
+}
+
+module.exports = {
+ ColorContrastAccessibility: ColorContrastAccessibilityClass,
+ ColorContrastCheck,
+};
diff --git a/devtools/client/accessibility/components/ContrastBadge.js b/devtools/client/accessibility/components/ContrastBadge.js
new file mode 100644
index 0000000000..ee37958f1e
--- /dev/null
+++ b/devtools/client/accessibility/components/ContrastBadge.js
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+loader.lazyGetter(this, "Badge", () =>
+ createFactory(
+ require("resource://devtools/client/accessibility/components/Badge.js")
+ )
+);
+
+/**
+ * Component for rendering a badge for contrast accessibliity check
+ * failures association with a given accessibility object in the accessibility
+ * tree.
+ */
+class ContrastBadge extends PureComponent {
+ static get propTypes() {
+ return {
+ error: PropTypes.string,
+ score: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { error, score } = this.props;
+ if (error || score !== SCORES.FAIL) {
+ return null;
+ }
+
+ return Badge({
+ score,
+ label: L10N.getStr("accessibility.badge.contrast"),
+ ariaLabel: L10N.getStr("accessibility.badge.contrast.warning"),
+ tooltip: L10N.getStr("accessibility.badge.contrast.tooltip"),
+ });
+ }
+}
+
+module.exports = ContrastBadge;
diff --git a/devtools/client/accessibility/components/Description.js b/devtools/client/accessibility/components/Description.js
new file mode 100644
index 0000000000..a31dbcbfa6
--- /dev/null
+++ b/devtools/client/accessibility/components/Description.js
@@ -0,0 +1,56 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React & Redux
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+ p,
+ img,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const LearnMoreLink = createFactory(
+ require("resource://devtools/client/accessibility/components/LearnMoreLink.js")
+);
+
+// Localization
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ A11Y_LEARN_MORE_LINK,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Landing UI for the accessibility panel when Accessibility features are
+ * deactivated.
+ */
+function Description() {
+ return div(
+ { className: "description", role: "presentation", tabIndex: "-1" },
+ div(
+ { className: "general", role: "presentation", tabIndex: "-1" },
+ img({
+ src: "chrome://devtools/skin/images/accessibility.svg",
+ alt: L10N.getStr("accessibility.logo"),
+ }),
+ div(
+ { role: "presentation", tabIndex: "-1" },
+ LearnMoreLink({
+ href: A11Y_LEARN_MORE_LINK,
+ learnMoreStringKey: "accessibility.learnMore",
+ l10n: L10N,
+ messageStringKey: "accessibility.description.general.p1",
+ }),
+ p({}, L10N.getStr("accessibility.enable.disabledTitle"))
+ )
+ )
+ );
+}
+
+// Exports from this module
+exports.Description = Description;
diff --git a/devtools/client/accessibility/components/DisplayTabbingOrder.js b/devtools/client/accessibility/components/DisplayTabbingOrder.js
new file mode 100644
index 0000000000..f6e3fdf453
--- /dev/null
+++ b/devtools/client/accessibility/components/DisplayTabbingOrder.js
@@ -0,0 +1,79 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ label,
+ input,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ updateDisplayTabbingOrder,
+} = require("resource://devtools/client/accessibility/actions/ui.js");
+
+class DisplayTabbingOrder extends PureComponent {
+ static get propTypes() {
+ return {
+ dispatch: PropTypes.func.isRequired,
+ tabbingOrderDisplayed: PropTypes.bool.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ disabled: false,
+ };
+
+ this.onChange = this.onChange.bind(this);
+ }
+
+ async onChange() {
+ const { dispatch, tabbingOrderDisplayed } = this.props;
+
+ this.setState({ disabled: true });
+ await dispatch(updateDisplayTabbingOrder(!tabbingOrderDisplayed));
+ this.setState({ disabled: false });
+ }
+
+ render() {
+ const { tabbingOrderDisplayed } = this.props;
+ return label(
+ {
+ className:
+ "accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text",
+ htmlFor: "devtools-display-tabbing-order-checkbox",
+ title: L10N.getStr("accessibility.toolbar.displayTabbingOrder.tooltip"),
+ },
+ input({
+ id: "devtools-display-tabbing-order-checkbox",
+ className: "devtools-checkbox",
+ type: "checkbox",
+ checked: tabbingOrderDisplayed,
+ disabled: this.state.disabled,
+ onChange: this.onChange,
+ }),
+ L10N.getStr("accessibility.toolbar.displayTabbingOrder.label")
+ );
+ }
+}
+
+const mapStateToProps = ({ ui: { tabbingOrderDisplayed } }) => ({
+ tabbingOrderDisplayed,
+});
+
+module.exports = connect(mapStateToProps)(DisplayTabbingOrder);
diff --git a/devtools/client/accessibility/components/KeyboardBadge.js b/devtools/client/accessibility/components/KeyboardBadge.js
new file mode 100644
index 0000000000..ac6b6b8841
--- /dev/null
+++ b/devtools/client/accessibility/components/KeyboardBadge.js
@@ -0,0 +1,56 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// React
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ accessibility: {
+ SCORES: { BEST_PRACTICES, FAIL, WARNING },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+loader.lazyGetter(this, "Badge", () =>
+ createFactory(
+ require("resource://devtools/client/accessibility/components/Badge.js")
+ )
+);
+
+/**
+ * Component for rendering a badge for keyboard accessibliity check failures
+ * association with a given accessibility object in the accessibility tree.
+ */
+class KeyboardBadge extends PureComponent {
+ static get propTypes() {
+ return {
+ error: PropTypes.string,
+ score: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { error, score } = this.props;
+ if (error || ![BEST_PRACTICES, FAIL, WARNING].includes(score)) {
+ return null;
+ }
+
+ return Badge({
+ score,
+ label: L10N.getStr("accessibility.badge.keyboard"),
+ tooltip: L10N.getStr("accessibility.badge.keyboard.tooltip"),
+ });
+ }
+}
+
+module.exports = KeyboardBadge;
diff --git a/devtools/client/accessibility/components/KeyboardCheck.js b/devtools/client/accessibility/components/KeyboardCheck.js
new file mode 100644
index 0000000000..0109dd22b0
--- /dev/null
+++ b/devtools/client/accessibility/components/KeyboardCheck.js
@@ -0,0 +1,94 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const Check = createFactory(
+ require("resource://devtools/client/accessibility/components/Check.js")
+);
+
+const {
+ A11Y_KEYBOARD_LINKS,
+} = require("resource://devtools/client/accessibility/constants.js");
+const {
+ accessibility: {
+ AUDIT_TYPE: { KEYBOARD },
+ ISSUE_TYPE: {
+ [KEYBOARD]: {
+ FOCUSABLE_NO_SEMANTICS,
+ FOCUSABLE_POSITIVE_TABINDEX,
+ INTERACTIVE_NO_ACTION,
+ INTERACTIVE_NOT_FOCUSABLE,
+ MOUSE_INTERACTIVE_ONLY,
+ NO_FOCUS_VISIBLE,
+ },
+ },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+/**
+ * A map from text label issues to annotation component properties.
+ */
+const ISSUE_TO_ANNOTATION_MAP = {
+ [FOCUSABLE_NO_SEMANTICS]: {
+ href: A11Y_KEYBOARD_LINKS.FOCUSABLE_NO_SEMANTICS,
+ l10nId: "accessibility-keyboard-issue-semantics",
+ },
+ [FOCUSABLE_POSITIVE_TABINDEX]: {
+ href: A11Y_KEYBOARD_LINKS.FOCUSABLE_POSITIVE_TABINDEX,
+ l10nId: "accessibility-keyboard-issue-tabindex",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "tabindex");
+ },
+ },
+ },
+ [INTERACTIVE_NO_ACTION]: {
+ href: A11Y_KEYBOARD_LINKS.INTERACTIVE_NO_ACTION,
+ l10nId: "accessibility-keyboard-issue-action",
+ },
+ [INTERACTIVE_NOT_FOCUSABLE]: {
+ href: A11Y_KEYBOARD_LINKS.INTERACTIVE_NOT_FOCUSABLE,
+ l10nId: "accessibility-keyboard-issue-focusable",
+ },
+ [MOUSE_INTERACTIVE_ONLY]: {
+ href: A11Y_KEYBOARD_LINKS.MOUSE_INTERACTIVE_ONLY,
+ l10nId: "accessibility-keyboard-issue-mouse-only",
+ },
+ [NO_FOCUS_VISIBLE]: {
+ href: A11Y_KEYBOARD_LINKS.NO_FOCUS_VISIBLE,
+ l10nId: "accessibility-keyboard-issue-focus-visible",
+ },
+};
+
+/**
+ * Component for rendering a check for text label accessibliity check failures,
+ * warnings and best practices suggestions association with a given
+ * accessibility object in the accessibility tree.
+ */
+class KeyboardCheck extends PureComponent {
+ static get propTypes() {
+ return {
+ issue: PropTypes.string.isRequired,
+ score: PropTypes.string.isRequired,
+ };
+ }
+
+ render() {
+ return Check({
+ ...this.props,
+ getAnnotation: issue => ISSUE_TO_ANNOTATION_MAP[issue],
+ id: "accessibility-keyboard-header",
+ });
+ }
+}
+
+module.exports = KeyboardCheck;
diff --git a/devtools/client/accessibility/components/LearnMoreLink.js b/devtools/client/accessibility/components/LearnMoreLink.js
new file mode 100644
index 0000000000..2a21df4ea5
--- /dev/null
+++ b/devtools/client/accessibility/components/LearnMoreLink.js
@@ -0,0 +1,76 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ p,
+ a,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+
+/**
+ * Localization friendly component for rendering a block of text with a "Learn more" link
+ * as a part of it.
+ */
+class LearnMoreLink extends Component {
+ static get propTypes() {
+ return {
+ className: PropTypes.string,
+ href: PropTypes.string,
+ learnMoreStringKey: PropTypes.string.isRequired,
+ l10n: PropTypes.object.isRequired,
+ messageStringKey: PropTypes.string.isRequired,
+ onClick: PropTypes.func,
+ };
+ }
+
+ static get defaultProps() {
+ return {
+ href: "#",
+ learnMoreStringKey: null,
+ l10n: null,
+ messageStringKey: null,
+ onClick: LearnMoreLink.openDocOnClick,
+ };
+ }
+
+ static openDocOnClick(event) {
+ event.preventDefault();
+ openDocLink(event.target.href);
+ }
+
+ render() {
+ const {
+ className,
+ href,
+ learnMoreStringKey,
+ l10n,
+ messageStringKey,
+ onClick,
+ } = this.props;
+ const learnMoreString = l10n.getStr(learnMoreStringKey);
+ const messageString = l10n.getFormatStr(messageStringKey, learnMoreString);
+
+ // Split the paragraph string with the link as a separator, and include the link into
+ // results.
+ const re = new RegExp(`(\\b${learnMoreString}\\b)`);
+ const contents = messageString.split(re);
+ contents[1] = a({ className: "link", href, onClick }, contents[1]);
+
+ return p(
+ {
+ className,
+ },
+ ...contents
+ );
+ }
+}
+
+module.exports = LearnMoreLink;
diff --git a/devtools/client/accessibility/components/MainFrame.js b/devtools/client/accessibility/components/MainFrame.js
new file mode 100644
index 0000000000..d918dc7be0
--- /dev/null
+++ b/devtools/client/accessibility/components/MainFrame.js
@@ -0,0 +1,245 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React & Redux
+const {
+ Component,
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ span,
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ enable,
+ reset,
+ updateCanBeEnabled,
+ updateCanBeDisabled,
+} = require("resource://devtools/client/accessibility/actions/ui.js");
+
+// Localization
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+// Constants
+const {
+ SIDEBAR_WIDTH,
+ PORTRAIT_MODE_WIDTH,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+// Accessibility Panel
+const AccessibilityTree = createFactory(
+ require("resource://devtools/client/accessibility/components/AccessibilityTree.js")
+);
+const AuditProgressOverlay = createFactory(
+ require("resource://devtools/client/accessibility/components/AuditProgressOverlay.js")
+);
+const Description = createFactory(
+ require("resource://devtools/client/accessibility/components/Description.js")
+ .Description
+);
+const RightSidebar = createFactory(
+ require("resource://devtools/client/accessibility/components/RightSidebar.js")
+);
+const Toolbar = createFactory(
+ require("resource://devtools/client/accessibility/components/Toolbar.js")
+ .Toolbar
+);
+const SplitBox = createFactory(
+ require("resource://devtools/client/shared/components/splitter/SplitBox.js")
+);
+
+/**
+ * Renders basic layout of the Accessibility panel. The Accessibility panel
+ * content consists of two main parts: tree and sidebar.
+ */
+class MainFrame extends Component {
+ static get propTypes() {
+ return {
+ fluentBundles: PropTypes.array.isRequired,
+ enabled: PropTypes.bool.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ auditing: PropTypes.array.isRequired,
+ supports: PropTypes.object,
+ toolbox: PropTypes.object.isRequired,
+ getAccessibilityTreeRoot: PropTypes.func.isRequired,
+ startListeningForAccessibilityEvents: PropTypes.func.isRequired,
+ stopListeningForAccessibilityEvents: PropTypes.func.isRequired,
+ audit: PropTypes.func.isRequired,
+ simulate: PropTypes.func,
+ enableAccessibility: PropTypes.func.isRequired,
+ resetAccessiblity: PropTypes.func.isRequired,
+ startListeningForLifecycleEvents: PropTypes.func.isRequired,
+ stopListeningForLifecycleEvents: PropTypes.func.isRequired,
+ startListeningForParentLifecycleEvents: PropTypes.func.isRequired,
+ stopListeningForParentLifecycleEvents: PropTypes.func.isRequired,
+ highlightAccessible: PropTypes.func.isRequired,
+ unhighlightAccessible: PropTypes.func.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.resetAccessibility = this.resetAccessibility.bind(this);
+ this.onPanelWindowResize = this.onPanelWindowResize.bind(this);
+ this.onCanBeEnabledChange = this.onCanBeEnabledChange.bind(this);
+ this.onCanBeDisabledChange = this.onCanBeDisabledChange.bind(this);
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ this.props.startListeningForLifecycleEvents({
+ init: this.resetAccessibility,
+ shutdown: this.resetAccessibility,
+ });
+ this.props.startListeningForParentLifecycleEvents({
+ "can-be-enabled-change": this.onCanBeEnabledChange,
+ "can-be-disabled-change": this.onCanBeDisabledChange,
+ });
+ this.props.startListeningForAccessibilityEvents({
+ "top-level-document-ready": this.resetAccessibility,
+ });
+ window.addEventListener("resize", this.onPanelWindowResize, true);
+ }
+
+ componentWillUnmount() {
+ this.props.stopListeningForLifecycleEvents({
+ init: this.resetAccessibility,
+ shutdown: this.resetAccessibility,
+ });
+ this.props.stopListeningForParentLifecycleEvents({
+ "can-be-enabled-change": this.onCanBeEnabledChange,
+ "can-be-disabled-change": this.onCanBeDisabledChange,
+ });
+ this.props.stopListeningForAccessibilityEvents({
+ "top-level-document-ready": this.resetAccessibility,
+ });
+ window.removeEventListener("resize", this.onPanelWindowResize, true);
+ }
+
+ resetAccessibility() {
+ const { dispatch, resetAccessiblity, supports } = this.props;
+ dispatch(reset(resetAccessiblity, supports));
+ }
+
+ onCanBeEnabledChange(canBeEnabled) {
+ const { enableAccessibility, dispatch } = this.props;
+ dispatch(updateCanBeEnabled(canBeEnabled));
+ if (canBeEnabled) {
+ dispatch(enable(enableAccessibility));
+ }
+ }
+
+ onCanBeDisabledChange(canBeDisabled) {
+ this.props.dispatch(updateCanBeDisabled(canBeDisabled));
+ }
+
+ get useLandscapeMode() {
+ const { clientWidth } = document.getElementById("content");
+ return clientWidth > PORTRAIT_MODE_WIDTH;
+ }
+
+ /**
+ * If panel width is less than PORTRAIT_MODE_WIDTH px, the splitter changes
+ * its mode to `horizontal` to support portrait view.
+ */
+ onPanelWindowResize() {
+ if (this.refs.splitBox) {
+ this.refs.splitBox.setState({ vert: this.useLandscapeMode });
+ }
+ }
+
+ /**
+ * Render Accessibility panel content
+ */
+ render() {
+ const {
+ fluentBundles,
+ enabled,
+ auditing,
+ simulate,
+ toolbox,
+ getAccessibilityTreeRoot,
+ startListeningForAccessibilityEvents,
+ stopListeningForAccessibilityEvents,
+ audit,
+ highlightAccessible,
+ unhighlightAccessible,
+ } = this.props;
+
+ if (!enabled) {
+ return Description();
+ }
+
+ // Audit is currently running.
+ const isAuditing = !!auditing.length;
+
+ return LocalizationProvider(
+ { bundles: fluentBundles },
+ div(
+ { className: "mainFrame", role: "presentation", tabIndex: "-1" },
+ Toolbar({
+ audit,
+ simulate,
+ toolboxDoc: toolbox.doc,
+ }),
+ isAuditing && AuditProgressOverlay(),
+ span(
+ {
+ "aria-hidden": isAuditing,
+ role: "presentation",
+ style: { display: "contents" },
+ },
+ SplitBox({
+ ref: "splitBox",
+ initialSize: SIDEBAR_WIDTH,
+ minSize: "10%",
+ maxSize: "80%",
+ splitterSize: 1,
+ endPanelControl: true,
+ startPanel: div(
+ {
+ className: "main-panel",
+ role: "presentation",
+ tabIndex: "-1",
+ },
+ AccessibilityTree({
+ toolboxDoc: toolbox.doc,
+ getAccessibilityTreeRoot,
+ startListeningForAccessibilityEvents,
+ stopListeningForAccessibilityEvents,
+ highlightAccessible,
+ unhighlightAccessible,
+ })
+ ),
+ endPanel: RightSidebar({
+ highlightAccessible,
+ unhighlightAccessible,
+ toolbox,
+ }),
+ vert: this.useLandscapeMode,
+ })
+ )
+ )
+ );
+ }
+}
+
+const mapStateToProps = ({
+ ui: { enabled, supports },
+ audit: { auditing },
+}) => ({
+ enabled,
+ supports,
+ auditing,
+});
+
+// Exports from this module
+module.exports = connect(mapStateToProps)(MainFrame);
diff --git a/devtools/client/accessibility/components/RightSidebar.js b/devtools/client/accessibility/components/RightSidebar.js
new file mode 100644
index 0000000000..f525b96294
--- /dev/null
+++ b/devtools/client/accessibility/components/RightSidebar.js
@@ -0,0 +1,67 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+const Accessible = createFactory(
+ require("resource://devtools/client/accessibility/components/Accessible.js")
+);
+const Accordion = createFactory(
+ require("resource://devtools/client/shared/components/Accordion.js")
+);
+const Checks = createFactory(
+ require("resource://devtools/client/accessibility/components/Checks.js")
+);
+
+// Component that is responsible for rendering accessible panel's sidebar.
+function RightSidebar({ highlightAccessible, unhighlightAccessible, toolbox }) {
+ const propertiesID = "accessibility-properties";
+ const checksID = "accessibility-checks";
+
+ return div(
+ {
+ className: "right-sidebar",
+ role: "presentation",
+ tabIndex: "-1",
+ },
+ Accordion({
+ items: [
+ {
+ className: "checks",
+ component: Checks,
+ componentProps: { labelledby: `${checksID}-header` },
+ header: L10N.getStr("accessibility.checks"),
+ id: checksID,
+ opened: true,
+ },
+ {
+ className: "accessible",
+ component: Accessible,
+ componentProps: {
+ highlightAccessible,
+ unhighlightAccessible,
+ toolboxHighlighter: toolbox.getHighlighter(),
+ toolbox,
+ labelledby: `${propertiesID}-header`,
+ },
+ header: L10N.getStr("accessibility.properties"),
+ id: propertiesID,
+ opened: true,
+ },
+ ],
+ })
+ );
+}
+
+module.exports = RightSidebar;
diff --git a/devtools/client/accessibility/components/SimulationMenuButton.js b/devtools/client/accessibility/components/SimulationMenuButton.js
new file mode 100644
index 0000000000..6fd21f4cc8
--- /dev/null
+++ b/devtools/client/accessibility/components/SimulationMenuButton.js
@@ -0,0 +1,167 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+/* global gTelemetry */
+
+// React
+const {
+ createFactory,
+ Component,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ hr,
+ span,
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const MenuButton = createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuButton.js")
+);
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+const {
+ A11Y_SIMULATION_DOCUMENTATION_LINK,
+} = require("resource://devtools/client/accessibility/constants.js");
+const {
+ accessibility: { SIMULATION_TYPE },
+} = require("resource://devtools/shared/constants.js");
+const actions = require("resource://devtools/client/accessibility/actions/simulation.js");
+
+loader.lazyGetter(this, "MenuItem", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuItem.js")
+ );
+});
+loader.lazyGetter(this, "MenuList", function () {
+ return createFactory(
+ require("resource://devtools/client/shared/components/menu/MenuList.js")
+ );
+});
+
+const TELEMETRY_SIMULATION_ACTIVATED =
+ "devtools.accessibility.simulation_activated";
+const SIMULATION_MENU_LABELS = {
+ NONE: "accessibility.filter.none",
+ [SIMULATION_TYPE.ACHROMATOPSIA]: "accessibility.simulation.achromatopsia",
+ [SIMULATION_TYPE.PROTANOPIA]: "accessibility.simulation.protanopia",
+ [SIMULATION_TYPE.DEUTERANOPIA]: "accessibility.simulation.deuteranopia",
+ [SIMULATION_TYPE.TRITANOPIA]: "accessibility.simulation.tritanopia",
+ [SIMULATION_TYPE.CONTRAST_LOSS]: "accessibility.simulation.contrastLoss",
+ DOCUMENTATION: "accessibility.documentation.label",
+};
+
+class SimulationMenuButton extends Component {
+ static get propTypes() {
+ return {
+ simulate: PropTypes.func,
+ simulation: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ toolboxDoc: PropTypes.object.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.disableSimulation = this.disableSimulation.bind(this);
+ }
+
+ disableSimulation() {
+ const { dispatch, simulate: simulateFunc } = this.props;
+
+ dispatch(actions.simulate(simulateFunc));
+ }
+
+ toggleSimulation(simKey) {
+ const { dispatch, simulation, simulate: simulateFunc } = this.props;
+
+ if (!simulation[simKey]) {
+ if (gTelemetry) {
+ gTelemetry.keyedScalarAdd(TELEMETRY_SIMULATION_ACTIVATED, simKey, 1);
+ }
+
+ dispatch(actions.simulate(simulateFunc, [simKey]));
+ return;
+ }
+
+ this.disableSimulation();
+ }
+
+ render() {
+ const { simulation, toolboxDoc } = this.props;
+ const simulationMenuButtonId = "simulation-menu-button";
+ const toolbarLabelID = "accessibility-simulation-label";
+ const currSimulation = Object.entries(simulation).find(
+ simEntry => simEntry[1]
+ );
+
+ const items = [
+ // No simulation option
+ MenuItem({
+ key: "simulation-none",
+ label: L10N.getStr(SIMULATION_MENU_LABELS.NONE),
+ checked: !currSimulation,
+ onClick: this.disableSimulation,
+ }),
+ hr({ key: "hr-1" }),
+ // Simulation options
+ ...Object.keys(SIMULATION_TYPE).map(simType =>
+ MenuItem({
+ key: `simulation-${simType}`,
+ label: L10N.getStr(SIMULATION_MENU_LABELS[simType]),
+ checked: simulation[simType],
+ onClick: this.toggleSimulation.bind(this, simType),
+ })
+ ),
+ hr({ key: "hr-2" }),
+ // Documentation link
+ MenuItem({
+ className: "link",
+ key: "simulation-documentation",
+ label: L10N.getStr(SIMULATION_MENU_LABELS.DOCUMENTATION),
+ role: "link",
+ onClick: () => openDocLink(A11Y_SIMULATION_DOCUMENTATION_LINK),
+ }),
+ ];
+
+ return div(
+ {
+ role: "group",
+ className: "accessibility-simulation",
+ "aria-labelledby": toolbarLabelID,
+ },
+ span(
+ { id: toolbarLabelID, role: "presentation" },
+ L10N.getStr("accessibility.simulation")
+ ),
+ MenuButton(
+ {
+ id: simulationMenuButtonId,
+ menuId: simulationMenuButtonId + "-menu",
+ className: `devtools-button toolbar-menu-button simulation${
+ currSimulation ? " active" : ""
+ }`,
+ toolboxDoc,
+ label: L10N.getStr(
+ SIMULATION_MENU_LABELS[currSimulation ? currSimulation[0] : "NONE"]
+ ),
+ },
+ MenuList({}, items)
+ )
+ );
+ }
+}
+
+const mapStateToProps = ({ simulation }) => {
+ return { simulation };
+};
+
+// Exports from this module
+module.exports = connect(mapStateToProps)(SimulationMenuButton);
diff --git a/devtools/client/accessibility/components/TextLabelBadge.js b/devtools/client/accessibility/components/TextLabelBadge.js
new file mode 100644
index 0000000000..0ff54ef8e0
--- /dev/null
+++ b/devtools/client/accessibility/components/TextLabelBadge.js
@@ -0,0 +1,57 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// React
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const {
+ accessibility: {
+ SCORES: { BEST_PRACTICES, FAIL, WARNING },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+loader.lazyGetter(this, "Badge", () =>
+ createFactory(
+ require("resource://devtools/client/accessibility/components/Badge.js")
+ )
+);
+
+/**
+ * Component for rendering a badge for text alternative accessibliity check
+ * failures association with a given accessibility object in the accessibility
+ * tree.
+ */
+class TextLabelBadge extends PureComponent {
+ static get propTypes() {
+ return {
+ error: PropTypes.string,
+ score: PropTypes.string,
+ };
+ }
+
+ render() {
+ const { error, score } = this.props;
+ if (error || ![BEST_PRACTICES, FAIL, WARNING].includes(score)) {
+ return null;
+ }
+
+ return Badge({
+ score,
+ label: L10N.getStr("accessibility.badge.textLabel"),
+ tooltip: L10N.getStr("accessibility.badge.textLabel.tooltip"),
+ });
+ }
+}
+
+module.exports = TextLabelBadge;
diff --git a/devtools/client/accessibility/components/TextLabelCheck.js b/devtools/client/accessibility/components/TextLabelCheck.js
new file mode 100644
index 0000000000..adfbb4b412
--- /dev/null
+++ b/devtools/client/accessibility/components/TextLabelCheck.js
@@ -0,0 +1,225 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const Check = createFactory(
+ require("resource://devtools/client/accessibility/components/Check.js")
+);
+
+const {
+ A11Y_TEXT_LABEL_LINKS,
+} = require("resource://devtools/client/accessibility/constants.js");
+const {
+ accessibility: {
+ AUDIT_TYPE: { TEXT_LABEL },
+ ISSUE_TYPE: {
+ [TEXT_LABEL]: {
+ AREA_NO_NAME_FROM_ALT,
+ DIALOG_NO_NAME,
+ DOCUMENT_NO_TITLE,
+ EMBED_NO_NAME,
+ FIGURE_NO_NAME,
+ FORM_FIELDSET_NO_NAME,
+ FORM_FIELDSET_NO_NAME_FROM_LEGEND,
+ FORM_NO_NAME,
+ FORM_NO_VISIBLE_NAME,
+ FORM_OPTGROUP_NO_NAME_FROM_LABEL,
+ FRAME_NO_NAME,
+ HEADING_NO_CONTENT,
+ HEADING_NO_NAME,
+ IFRAME_NO_NAME_FROM_TITLE,
+ IMAGE_NO_NAME,
+ INTERACTIVE_NO_NAME,
+ MATHML_GLYPH_NO_NAME,
+ TOOLBAR_NO_NAME,
+ },
+ },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+/**
+ * A map from text label issues to annotation component properties.
+ */
+const ISSUE_TO_ANNOTATION_MAP = {
+ [AREA_NO_NAME_FROM_ALT]: {
+ href: A11Y_TEXT_LABEL_LINKS.AREA_NO_NAME_FROM_ALT,
+ l10nId: "accessibility-text-label-issue-area",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "alt");
+ },
+ // Note: there is no way right now to use custom elements in privileged
+ // content. We have to use something like <div> since we can't provide
+ // three args with the same name.
+ get div() {
+ return ReactDOM.code({}, "area");
+ },
+ // Note: there is no way right now to use custom elements in privileged
+ // content. We have to use something like <span> since we can't provide
+ // three args with the same name.
+ get span() {
+ return ReactDOM.code({}, "href");
+ },
+ },
+ },
+ [DIALOG_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.DIALOG_NO_NAME,
+ l10nId: "accessibility-text-label-issue-dialog",
+ },
+ [DOCUMENT_NO_TITLE]: {
+ href: A11Y_TEXT_LABEL_LINKS.DOCUMENT_NO_TITLE,
+ l10nId: "accessibility-text-label-issue-document-title",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "title");
+ },
+ },
+ },
+ [EMBED_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.EMBED_NO_NAME,
+ l10nId: "accessibility-text-label-issue-embed",
+ },
+ [FIGURE_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.FIGURE_NO_NAME,
+ l10nId: "accessibility-text-label-issue-figure",
+ },
+ [FORM_FIELDSET_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.FORM_FIELDSET_NO_NAME,
+ l10nId: "accessibility-text-label-issue-fieldset",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "fieldset");
+ },
+ },
+ },
+ [FORM_FIELDSET_NO_NAME_FROM_LEGEND]: {
+ href: A11Y_TEXT_LABEL_LINKS.FORM_FIELDSET_NO_NAME_FROM_LEGEND,
+ l10nId: "accessibility-text-label-issue-fieldset-legend2",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "legend");
+ },
+ // Note: there is no way right now to use custom elements in privileged
+ // content. We have to use something like <span> since we can't provide
+ // two args with the same name.
+ get span() {
+ return ReactDOM.code({}, "fieldset");
+ },
+ },
+ },
+ [FORM_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.FORM_NO_NAME,
+ l10nId: "accessibility-text-label-issue-form",
+ },
+ [FORM_NO_VISIBLE_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.FORM_NO_VISIBLE_NAME,
+ l10nId: "accessibility-text-label-issue-form-visible",
+ },
+ [FORM_OPTGROUP_NO_NAME_FROM_LABEL]: {
+ href: A11Y_TEXT_LABEL_LINKS.FORM_OPTGROUP_NO_NAME_FROM_LABEL,
+ l10nId: "accessibility-text-label-issue-optgroup-label2",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "label");
+ },
+ // Note: there is no way right now to use custom elements in privileged
+ // content. We have to use something like <span> since we can't provide
+ // two args with the same name.
+ get span() {
+ return ReactDOM.code({}, "optgroup");
+ },
+ },
+ },
+ [FRAME_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.FRAME_NO_NAME,
+ l10nId: "accessibility-text-label-issue-frame",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "frame");
+ },
+ },
+ },
+ [HEADING_NO_CONTENT]: {
+ href: A11Y_TEXT_LABEL_LINKS.HEADING_NO_CONTENT,
+ l10nId: "accessibility-text-label-issue-heading-content",
+ },
+ [HEADING_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.HEADING_NO_NAME,
+ l10nId: "accessibility-text-label-issue-heading",
+ },
+ [IFRAME_NO_NAME_FROM_TITLE]: {
+ href: A11Y_TEXT_LABEL_LINKS.IFRAME_NO_NAME_FROM_TITLE,
+ l10nId: "accessibility-text-label-issue-iframe",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "title");
+ },
+ // Note: there is no way right now to use custom elements in privileged
+ // content. We have to use something like <span> since we can't provide
+ // two args with the same name.
+ get span() {
+ return ReactDOM.code({}, "iframe");
+ },
+ },
+ },
+ [IMAGE_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.IMAGE_NO_NAME,
+ l10nId: "accessibility-text-label-issue-image",
+ },
+ [INTERACTIVE_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.INTERACTIVE_NO_NAME,
+ l10nId: "accessibility-text-label-issue-interactive",
+ },
+ [MATHML_GLYPH_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.MATHML_GLYPH_NO_NAME,
+ l10nId: "accessibility-text-label-issue-glyph",
+ args: {
+ get code() {
+ return ReactDOM.code({}, "alt");
+ },
+ // Note: there is no way right now to use custom elements in privileged
+ // content. We have to use something like <span> since we can't provide
+ // two args with the same name.
+ get span() {
+ return ReactDOM.code({}, "mglyph");
+ },
+ },
+ },
+ [TOOLBAR_NO_NAME]: {
+ href: A11Y_TEXT_LABEL_LINKS.TOOLBAR_NO_NAME,
+ l10nId: "accessibility-text-label-issue-toolbar",
+ },
+};
+
+/**
+ * Component for rendering a check for text label accessibliity check failures,
+ * warnings and best practices suggestions association with a given
+ * accessibility object in the accessibility tree.
+ */
+class TextLabelCheck extends PureComponent {
+ static get propTypes() {
+ return {
+ issue: PropTypes.string.isRequired,
+ score: PropTypes.string.isRequired,
+ };
+ }
+
+ render() {
+ return Check({
+ ...this.props,
+ getAnnotation: issue => ISSUE_TO_ANNOTATION_MAP[issue],
+ id: "accessibility-text-label-header",
+ });
+ }
+}
+
+module.exports = TextLabelCheck;
diff --git a/devtools/client/accessibility/components/Toolbar.js b/devtools/client/accessibility/components/Toolbar.js
new file mode 100644
index 0000000000..b5f27485ed
--- /dev/null
+++ b/devtools/client/accessibility/components/Toolbar.js
@@ -0,0 +1,74 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+// React
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const AccessibilityTreeFilter = createFactory(
+ require("resource://devtools/client/accessibility/components/AccessibilityTreeFilter.js")
+);
+const AccessibilityPrefs = createFactory(
+ require("resource://devtools/client/accessibility/components/AccessibilityPrefs.js")
+);
+loader.lazyGetter(this, "SimulationMenuButton", function () {
+ return createFactory(
+ require("resource://devtools/client/accessibility/components/SimulationMenuButton.js")
+ );
+});
+const DisplayTabbingOrder = createFactory(
+ require("resource://devtools/client/accessibility/components/DisplayTabbingOrder.js")
+);
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+function Toolbar({ audit, simulate, supportsTabbingOrder, toolboxDoc }) {
+ const optionalSimulationSection = simulate
+ ? [
+ div({
+ role: "separator",
+ className: "devtools-separator",
+ }),
+ SimulationMenuButton({ simulate, toolboxDoc }),
+ ]
+ : [];
+ const optionalDisplayTabbingOrderSection = supportsTabbingOrder
+ ? [
+ div({
+ role: "separator",
+ className: "devtools-separator",
+ }),
+ DisplayTabbingOrder(),
+ ]
+ : [];
+
+ return div(
+ {
+ className: "devtools-toolbar",
+ role: "toolbar",
+ },
+ AccessibilityTreeFilter({ audit, toolboxDoc }),
+ // Simulation section is shown if webrender is enabled
+ ...optionalSimulationSection,
+ ...optionalDisplayTabbingOrderSection,
+ AccessibilityPrefs({ toolboxDoc })
+ );
+}
+
+const mapStateToProps = ({
+ ui: {
+ supports: { tabbingOrder },
+ },
+}) => ({
+ supportsTabbingOrder: tabbingOrder,
+});
+
+// Exports from this module
+exports.Toolbar = connect(mapStateToProps)(Toolbar);
diff --git a/devtools/client/accessibility/components/moz.build b/devtools/client/accessibility/components/moz.build
new file mode 100644
index 0000000000..23e01d42c6
--- /dev/null
+++ b/devtools/client/accessibility/components/moz.build
@@ -0,0 +1,33 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "AccessibilityPrefs.js",
+ "AccessibilityRow.js",
+ "AccessibilityRowValue.js",
+ "AccessibilityTree.js",
+ "AccessibilityTreeFilter.js",
+ "Accessible.js",
+ "AuditController.js",
+ "AuditFilter.js",
+ "AuditProgressOverlay.js",
+ "Badge.js",
+ "Badges.js",
+ "Button.js",
+ "Check.js",
+ "Checks.js",
+ "ColorContrastAccessibility.js",
+ "ContrastBadge.js",
+ "Description.js",
+ "DisplayTabbingOrder.js",
+ "KeyboardBadge.js",
+ "KeyboardCheck.js",
+ "LearnMoreLink.js",
+ "MainFrame.js",
+ "RightSidebar.js",
+ "SimulationMenuButton.js",
+ "TextLabelBadge.js",
+ "TextLabelCheck.js",
+ "Toolbar.js",
+)
diff --git a/devtools/client/accessibility/constants.js b/devtools/client/accessibility/constants.js
new file mode 100644
index 0000000000..192c5eaf8c
--- /dev/null
+++ b/devtools/client/accessibility/constants.js
@@ -0,0 +1,197 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ accessibility: {
+ AUDIT_TYPE,
+ ISSUE_TYPE: {
+ [AUDIT_TYPE.KEYBOARD]: {
+ FOCUSABLE_NO_SEMANTICS,
+ FOCUSABLE_POSITIVE_TABINDEX,
+ INTERACTIVE_NO_ACTION,
+ INTERACTIVE_NOT_FOCUSABLE,
+ MOUSE_INTERACTIVE_ONLY,
+ NO_FOCUS_VISIBLE,
+ },
+ [AUDIT_TYPE.TEXT_LABEL]: {
+ AREA_NO_NAME_FROM_ALT,
+ DIALOG_NO_NAME,
+ DOCUMENT_NO_TITLE,
+ EMBED_NO_NAME,
+ FIGURE_NO_NAME,
+ FORM_FIELDSET_NO_NAME,
+ FORM_FIELDSET_NO_NAME_FROM_LEGEND,
+ FORM_NO_NAME,
+ FORM_NO_VISIBLE_NAME,
+ FORM_OPTGROUP_NO_NAME_FROM_LABEL,
+ FRAME_NO_NAME,
+ HEADING_NO_CONTENT,
+ HEADING_NO_NAME,
+ IFRAME_NO_NAME_FROM_TITLE,
+ IMAGE_NO_NAME,
+ INTERACTIVE_NO_NAME,
+ MATHML_GLYPH_NO_NAME,
+ TOOLBAR_NO_NAME,
+ },
+ },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+// Used in accessible component for properties tree rendering.
+exports.TREE_ROW_HEIGHT = 21;
+
+// Initial sidebar width.
+exports.SIDEBAR_WIDTH = "350px";
+
+// When value is updated either in the tree or sidebar.
+exports.VALUE_FLASHING_DURATION = 500;
+// When new row is selected, flash highlighter.
+exports.VALUE_HIGHLIGHT_DURATION = 1000;
+
+// If the panel width is smaller than given amount of pixels,
+// the sidebar automatically switches from 'landscape' to 'portrait' mode.
+exports.PORTRAIT_MODE_WIDTH = 700;
+
+// Names for Redux actions.
+exports.FETCH_CHILDREN = "FETCH_CHILDREN";
+exports.UPDATE_DETAILS = "UPDATE_DETAILS";
+exports.RESET = "RESET";
+exports.SELECT = "SELECT";
+exports.HIGHLIGHT = "HIGHLIGHT";
+exports.UNHIGHLIGHT = "UNHIGHLIGHT";
+exports.ENABLE = "ENABLE";
+exports.UPDATE_CAN_BE_DISABLED = "UPDATE_CAN_BE_DISABLED";
+exports.UPDATE_CAN_BE_ENABLED = "UPDATE_CAN_BE_ENABLED";
+exports.UPDATE_PREF = "UPDATE_PREF";
+exports.FILTER_TOGGLE = "FILTER_TOGGLE";
+exports.AUDIT = "AUDIT";
+exports.AUDITING = "AUDITING";
+exports.AUDIT_PROGRESS = "AUDIT_PROGRESS";
+exports.SIMULATE = "SIMULATE";
+exports.UPDATE_DISPLAY_TABBING_ORDER = "UPDATE_DISPLAY_TABBING_ORDER";
+
+// List of filters for accessibility checks.
+exports.FILTERS = {
+ NONE: "NONE",
+ ALL: "ALL",
+ [AUDIT_TYPE.CONTRAST]: "CONTRAST",
+ [AUDIT_TYPE.KEYBOARD]: "KEYBOARD",
+ [AUDIT_TYPE.TEXT_LABEL]: "TEXT_LABEL",
+};
+
+// Ordered accessible properties to be displayed by the accessible component.
+exports.ORDERED_PROPS = [
+ "name",
+ "role",
+ "actions",
+ "value",
+ "DOMNode",
+ "description",
+ "keyboardShortcut",
+ "childCount",
+ "indexInParent",
+ "states",
+ "relations",
+ "attributes",
+];
+
+// Accessible events (emitted by accessible front) that the accessible component
+// listens to for a current accessible.
+exports.ACCESSIBLE_EVENTS = [
+ "actions-change",
+ "attributes-change",
+ "description-change",
+ "name-change",
+ "reorder",
+ "shortcut-change",
+ "states-change",
+ "text-change",
+ "value-change",
+ "index-in-parent-change",
+];
+
+// Telemetry name constants.
+exports.A11Y_SERVICE_DURATION =
+ "DEVTOOLS_ACCESSIBILITY_SERVICE_TIME_ACTIVE_SECONDS";
+
+// URL constants
+exports.A11Y_LEARN_MORE_LINK =
+ "https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/";
+exports.A11Y_CONTRAST_LEARN_MORE_LINK =
+ "https://developer.mozilla.org/docs/Web/Accessibility/Understanding_WCAG/Perceivable/" +
+ "Color_contrast?utm_source=devtools&utm_medium=a11y-panel-checks-color-contrast";
+exports.A11Y_SIMULATION_DOCUMENTATION_LINK =
+ "https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/simulation/";
+
+const A11Y_TEXT_LABEL_LINK_BASE =
+ "https://developer.mozilla.org/docs/Web/Accessibility/Understanding_WCAG/Text_labels_and_names" +
+ "?utm_source=devtools&utm_medium=a11y-panel-checks-text-label";
+
+const A11Y_TEXT_LABEL_LINK_IDS = {
+ [AREA_NO_NAME_FROM_ALT]:
+ "Use_alt_attribute_to_label_area_elements_that_have_the_href_attribute",
+ [DIALOG_NO_NAME]: "Dialogs_should_be_labeled",
+ [DOCUMENT_NO_TITLE]: "Documents_must_have_a_title",
+ [EMBED_NO_NAME]: "Embedded_content_must_be_labeled",
+ [FIGURE_NO_NAME]: "Figures_with_optional_captions_should_be_labeled",
+ [FORM_FIELDSET_NO_NAME]: "Fieldset_elements_must_be_labeled",
+ [FORM_FIELDSET_NO_NAME_FROM_LEGEND]: "Use_a_legend_to_label_a_fieldset",
+ [FORM_NO_NAME]: "Form_elements_must_be_labeled",
+ [FORM_NO_VISIBLE_NAME]: "Form_elements_should_have_a_visible_text_label",
+ [FORM_OPTGROUP_NO_NAME_FROM_LABEL]:
+ "Use_label_attribute_on_optgroup_elements",
+ [FRAME_NO_NAME]: "Frame_elements_must_be_labeled",
+ [HEADING_NO_NAME]: "Headings_must_be_labeled",
+ [HEADING_NO_CONTENT]: "Headings_should_have_visible_text_content",
+ [IFRAME_NO_NAME_FROM_TITLE]: "Use_title_attribute_to_describe_iframe_content",
+ [IMAGE_NO_NAME]: "Content_with_images_must_be_labeled",
+ [INTERACTIVE_NO_NAME]: "Interactive_elements_must_be_labeled",
+ [MATHML_GLYPH_NO_NAME]: "Use_alt_attribute_to_label_mglyph_elements",
+ [TOOLBAR_NO_NAME]:
+ "Toolbars_must_be_labeled_when_there_is_more_than_one_toolbar",
+};
+
+const A11Y_TEXT_LABEL_LINKS = {};
+for (const key in A11Y_TEXT_LABEL_LINK_IDS) {
+ A11Y_TEXT_LABEL_LINKS[
+ key
+ ] = `${A11Y_TEXT_LABEL_LINK_BASE}#${A11Y_TEXT_LABEL_LINK_IDS[key]}`;
+}
+exports.A11Y_TEXT_LABEL_LINKS = A11Y_TEXT_LABEL_LINKS;
+
+const A11Y_KEYBOARD_LINK_BASE =
+ "https://developer.mozilla.org/docs/Web/Accessibility/Understanding_WCAG/Keyboard" +
+ "?utm_source=devtools&utm_medium=a11y-panel-checks-keyboard";
+
+const A11Y_KEYBOARD_LINK_IDS = {
+ [FOCUSABLE_NO_SEMANTICS]:
+ "Focusable_elements_should_have_interactive_semantics",
+ [FOCUSABLE_POSITIVE_TABINDEX]:
+ "Avoid_using_tabindex_attribute_greater_than_zero",
+ [INTERACTIVE_NO_ACTION]:
+ "Interactive_elements_must_be_able_to_be_activated_using_a_keyboard",
+ [INTERACTIVE_NOT_FOCUSABLE]: "Interactive_elements_must_be_focusable",
+ [MOUSE_INTERACTIVE_ONLY]:
+ "Clickable_elements_must_be_focusable_and_should_have_interactive_semantics",
+ [NO_FOCUS_VISIBLE]: "Focusable_element_must_have_focus_styling",
+};
+
+const A11Y_KEYBOARD_LINKS = {};
+for (const key in A11Y_KEYBOARD_LINK_IDS) {
+ A11Y_KEYBOARD_LINKS[
+ key
+ ] = `${A11Y_KEYBOARD_LINK_BASE}#${A11Y_KEYBOARD_LINK_IDS[key]}`;
+}
+exports.A11Y_KEYBOARD_LINKS = A11Y_KEYBOARD_LINKS;
+
+// Lists of preference names and keys.
+const PREFS = {
+ SCROLL_INTO_VIEW: "SCROLL_INTO_VIEW",
+};
+
+exports.PREFS = PREFS;
+exports.PREF_KEYS = {
+ [PREFS.SCROLL_INTO_VIEW]: "devtools.accessibility.scroll-into-view",
+};
diff --git a/devtools/client/accessibility/index.html b/devtools/client/accessibility/index.html
new file mode 100644
index 0000000000..74e5057769
--- /dev/null
+++ b/devtools/client/accessibility/index.html
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE html>
+<html dir="">
+ <head>
+ <meta charset="utf-8" />
+
+ <link href="chrome://devtools/skin/badge.css" rel="stylesheet" />
+ <link
+ href="chrome://devtools/skin/accessibility-color-contrast.css"
+ rel="stylesheet"
+ />
+ <link
+ href="chrome://devtools/content/accessibility/accessibility.css"
+ rel="stylesheet"
+ />
+ <link
+ href="chrome://devtools/content/shared/components/splitter/SplitBox.css"
+ rel="stylesheet"
+ />
+ <link
+ href="chrome://devtools/content/shared/components/Accordion.css"
+ rel="stylesheet"
+ />
+ <link
+ href="chrome://devtools/content/shared/components/List.css"
+ rel="stylesheet"
+ />
+ <link
+ href="chrome://devtools/content/shared/components/tree/TreeView.css"
+ rel="stylesheet"
+ />
+
+ <script src="chrome://devtools/content/shared/theme-switching.js"></script>
+ </head>
+ <body class="theme-body devtools-monospace" role="application">
+ <div id="content" role="presentation" tabindex="-1"></div>
+ <script src="./main.js"></script>
+ </body>
+</html>
diff --git a/devtools/client/accessibility/main.js b/devtools/client/accessibility/main.js
new file mode 100644
index 0000000000..c658d05825
--- /dev/null
+++ b/devtools/client/accessibility/main.js
@@ -0,0 +1,17 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { BrowserLoader } = ChromeUtils.import(
+ "resource://devtools/shared/loader/browser-loader.js"
+);
+
+// Module Loader
+const require = BrowserLoader({
+ baseURI: "resource://devtools/client/accessibility/",
+ window,
+}).require;
+
+// Load accessibility panel content
+require("resource://devtools/client/accessibility/accessibility-view.js");
diff --git a/devtools/client/accessibility/moz.build b/devtools/client/accessibility/moz.build
new file mode 100644
index 0000000000..0b6874dfee
--- /dev/null
+++ b/devtools/client/accessibility/moz.build
@@ -0,0 +1,20 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+MOCHITEST_CHROME_MANIFESTS += ["test/chrome/chrome.ini"]
+BROWSER_CHROME_MANIFESTS += ["test/browser/browser.ini"]
+
+DIRS += ["actions", "components", "reducers", "utils"]
+
+DevToolsModules(
+ "accessibility-proxy.js",
+ "accessibility-view.js",
+ "constants.js",
+ "panel.js",
+ "picker.js",
+ "provider.js",
+)
+
+with Files("**"):
+ BUG_COMPONENT = ("DevTools", "Accessibility Tools")
diff --git a/devtools/client/accessibility/panel.js b/devtools/client/accessibility/panel.js
new file mode 100644
index 0000000000..02c6c8f415
--- /dev/null
+++ b/devtools/client/accessibility/panel.js
@@ -0,0 +1,350 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const EventEmitter = require("resource://devtools/shared/event-emitter.js");
+
+loader.lazyRequireGetter(
+ this,
+ "AccessibilityProxy",
+ "resource://devtools/client/accessibility/accessibility-proxy.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "Picker",
+ "resource://devtools/client/accessibility/picker.js",
+ true
+);
+const {
+ A11Y_SERVICE_DURATION,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+// The panel's window global is an EventEmitter firing the following events:
+const EVENTS = {
+ // When the accessibility inspector has a new accessible front selected.
+ NEW_ACCESSIBLE_FRONT_SELECTED: "Accessibility:NewAccessibleFrontSelected",
+ // When the accessibility inspector has a new accessible front highlighted.
+ NEW_ACCESSIBLE_FRONT_HIGHLIGHTED:
+ "Accessibility:NewAccessibleFrontHighlighted",
+ // When the accessibility inspector has a new accessible front inspected.
+ NEW_ACCESSIBLE_FRONT_INSPECTED: "Accessibility:NewAccessibleFrontInspected",
+ // When the accessibility inspector is updated.
+ ACCESSIBILITY_INSPECTOR_UPDATED:
+ "Accessibility:AccessibilityInspectorUpdated",
+ // When accessibility panel UI is initialized (rendered).
+ INITIALIZED: "Accessibility:Initialized",
+ // When accessibile object properties are updated in the panel sidebar for a
+ // new accessible object.
+ PROPERTIES_UPDATED: "Accessibility:PropertiesUpdated",
+};
+
+/**
+ * This object represents Accessibility panel. It's responsibility is to
+ * render Accessibility Tree of the current debugger target and the sidebar that
+ * displays current relevant accessible details.
+ */
+function AccessibilityPanel(iframeWindow, toolbox, commands) {
+ this.panelWin = iframeWindow;
+ this._toolbox = toolbox;
+ this._commands = commands;
+
+ this.onPanelVisibilityChange = this.onPanelVisibilityChange.bind(this);
+ this.onNewAccessibleFrontSelected =
+ this.onNewAccessibleFrontSelected.bind(this);
+ this.onAccessibilityInspectorUpdated =
+ this.onAccessibilityInspectorUpdated.bind(this);
+ this.updateA11YServiceDurationTimer =
+ this.updateA11YServiceDurationTimer.bind(this);
+ this.forceUpdatePickerButton = this.forceUpdatePickerButton.bind(this);
+ this.onLifecycleEvent = this.onLifecycleEvent.bind(this);
+
+ EventEmitter.decorate(this);
+}
+
+AccessibilityPanel.prototype = {
+ /**
+ * Open is effectively an asynchronous constructor.
+ */
+ async open() {
+ if (this._opening) {
+ await this._opening;
+ return this._opening;
+ }
+
+ let resolver;
+ this._opening = new Promise(resolve => {
+ resolver = resolve;
+ });
+
+ this._telemetry = this._toolbox.telemetry;
+ this.panelWin.gTelemetry = this._telemetry;
+
+ this._toolbox.on("select", this.onPanelVisibilityChange);
+
+ this.panelWin.EVENTS = EVENTS;
+ EventEmitter.decorate(this.panelWin);
+ this.panelWin.on(
+ EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED,
+ this.onNewAccessibleFrontSelected
+ );
+ this.panelWin.on(
+ EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED,
+ this.onAccessibilityInspectorUpdated
+ );
+
+ this.accessibilityProxy = new AccessibilityProxy(this._commands, this);
+ await this.accessibilityProxy.initialize();
+
+ // Enable accessibility service if necessary.
+ if (
+ this.accessibilityProxy.canBeEnabled &&
+ !this.accessibilityProxy.enabled
+ ) {
+ await this.accessibilityProxy.enableAccessibility();
+ }
+
+ this.picker = new Picker(this);
+ this.fluentBundles = await this.createFluentBundles();
+
+ this.updateA11YServiceDurationTimer();
+ this.accessibilityProxy.startListeningForLifecycleEvents({
+ init: this.onLifecycleEvent,
+ shutdown: this.onLifecycleEvent,
+ });
+
+ // Force refresh to render the UI and wait for the INITIALIZED event.
+ const onInitialized = this.panelWin.once(EVENTS.INITIALIZED);
+ this.shouldRefresh = true;
+ this.refresh();
+ await onInitialized;
+
+ resolver(this);
+ return this._opening;
+ },
+
+ /**
+ * Retrieve message contexts for the current locales, and return them as an
+ * array of FluentBundles elements.
+ */
+ async createFluentBundles() {
+ const locales = Services.locale.appLocalesAsBCP47;
+ const generator = L10nRegistry.getInstance().generateBundles(locales, [
+ "devtools/client/accessibility.ftl",
+ ]);
+
+ // Return value of generateBundles is a generator and should be converted to
+ // a sync iterable before using it with React.
+ const contexts = [];
+ for await (const message of generator) {
+ contexts.push(message);
+ }
+
+ return contexts;
+ },
+
+ onLifecycleEvent() {
+ this.updateA11YServiceDurationTimer();
+ this.forceUpdatePickerButton();
+ },
+
+ onNewAccessibleFrontSelected(selected) {
+ this.emit("new-accessible-front-selected", selected);
+ },
+
+ onAccessibilityInspectorUpdated() {
+ this.emit("accessibility-inspector-updated");
+ },
+
+ /**
+ * Make sure the panel is refreshed when the page is reloaded. The panel is
+ * refreshed immediatelly if it's currently selected or lazily when the user
+ * actually selects it.
+ */
+ async forceRefresh() {
+ this.shouldRefresh = true;
+ await this._opening;
+
+ await this.accessibilityProxy.accessibilityFrontGetPromise;
+ const onUpdated = this.panelWin.once(EVENTS.INITIALIZED);
+ this.refresh();
+ await onUpdated;
+
+ this.emit("reloaded");
+ },
+
+ /**
+ * Make sure the panel is refreshed (if needed) when it's selected.
+ */
+ onPanelVisibilityChange() {
+ this._opening.then(() => this.refresh());
+ },
+
+ refresh() {
+ this.cancelPicker();
+
+ if (!this.isVisible) {
+ // Do not refresh if the panel isn't visible.
+ return;
+ }
+
+ // Do not refresh if it isn't necessary.
+ if (!this.shouldRefresh) {
+ return;
+ }
+ // Alright reset the flag we are about to refresh the panel.
+ this.shouldRefresh = false;
+ const {
+ supports,
+ getAccessibilityTreeRoot,
+ startListeningForAccessibilityEvents,
+ stopListeningForAccessibilityEvents,
+ audit,
+ simulate,
+ toggleDisplayTabbingOrder,
+ enableAccessibility,
+ resetAccessiblity,
+ startListeningForLifecycleEvents,
+ stopListeningForLifecycleEvents,
+ startListeningForParentLifecycleEvents,
+ stopListeningForParentLifecycleEvents,
+ highlightAccessible,
+ unhighlightAccessible,
+ } = this.accessibilityProxy;
+ this.postContentMessage("initialize", {
+ fluentBundles: this.fluentBundles,
+ toolbox: this._toolbox,
+ supports,
+ getAccessibilityTreeRoot,
+ startListeningForAccessibilityEvents,
+ stopListeningForAccessibilityEvents,
+ audit,
+ simulate,
+ toggleDisplayTabbingOrder,
+ enableAccessibility,
+ resetAccessiblity,
+ startListeningForLifecycleEvents,
+ stopListeningForLifecycleEvents,
+ startListeningForParentLifecycleEvents,
+ stopListeningForParentLifecycleEvents,
+ highlightAccessible,
+ unhighlightAccessible,
+ });
+ },
+
+ updateA11YServiceDurationTimer() {
+ if (this.accessibilityProxy.enabled) {
+ this._telemetry.start(A11Y_SERVICE_DURATION, this);
+ } else {
+ this._telemetry.finish(A11Y_SERVICE_DURATION, this, true);
+ }
+ },
+
+ selectAccessible(accessibleFront) {
+ this.postContentMessage("selectAccessible", accessibleFront);
+ },
+
+ selectAccessibleForNode(nodeFront, reason) {
+ if (reason) {
+ this._telemetry.keyedScalarAdd(
+ "devtools.accessibility.select_accessible_for_node",
+ reason,
+ 1
+ );
+ }
+
+ this.postContentMessage("selectNodeAccessible", nodeFront);
+ },
+
+ highlightAccessible(accessibleFront) {
+ this.postContentMessage("highlightAccessible", accessibleFront);
+ },
+
+ postContentMessage(type, ...args) {
+ const event = new this.panelWin.MessageEvent("devtools/chrome/message", {
+ bubbles: true,
+ cancelable: true,
+ data: { type, args },
+ });
+
+ this.panelWin.dispatchEvent(event);
+ },
+
+ updatePickerButton() {
+ this.picker && this.picker.updateButton();
+ },
+
+ forceUpdatePickerButton() {
+ // Only update picker button when the panel is selected.
+ if (!this.isVisible) {
+ return;
+ }
+
+ this.updatePickerButton();
+ // Calling setToolboxButtons to make sure toolbar is forced to re-render.
+ this._toolbox.component.setToolboxButtons(this._toolbox.toolbarButtons);
+ },
+
+ togglePicker(focus) {
+ this.picker && this.picker.toggle();
+ },
+
+ cancelPicker() {
+ this.picker && this.picker.cancel();
+ },
+
+ stopPicker() {
+ this.picker && this.picker.stop();
+ },
+
+ /**
+ * Return true if the Accessibility panel is currently selected.
+ */
+ get isVisible() {
+ return this._toolbox.currentToolId === "accessibility";
+ },
+
+ destroy() {
+ if (this._destroyed) {
+ return;
+ }
+ this._destroyed = true;
+
+ this.postContentMessage("destroy");
+
+ if (this.accessibilityProxy) {
+ this.accessibilityProxy.stopListeningForLifecycleEvents({
+ init: this.onLifecycleEvent,
+ shutdown: this.onLifecycleEvent,
+ });
+ this.accessibilityProxy.destroy();
+ this.accessibilityProxy = null;
+ }
+
+ this._toolbox.off("select", this.onPanelVisibilityChange);
+
+ this.panelWin.off(
+ EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED,
+ this.onNewAccessibleFrontSelected
+ );
+ this.panelWin.off(
+ EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED,
+ this.onAccessibilityInspectorUpdated
+ );
+
+ // Older versions of devtools server do not support picker functionality.
+ if (this.picker) {
+ this.picker.release();
+ this.picker = null;
+ }
+
+ this._telemetry = null;
+ this.panelWin.gTelemetry = null;
+
+ this.emit("destroyed");
+ },
+};
+
+// Exports from this module
+exports.AccessibilityPanel = AccessibilityPanel;
diff --git a/devtools/client/accessibility/picker.js b/devtools/client/accessibility/picker.js
new file mode 100644
index 0000000000..49ba2b5bfc
--- /dev/null
+++ b/devtools/client/accessibility/picker.js
@@ -0,0 +1,189 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+class Picker {
+ constructor(panel) {
+ this._panel = panel;
+
+ this.isPicking = false;
+
+ this.onPickerAccessibleHovered = this.onPickerAccessibleHovered.bind(this);
+ this.onPickerAccessiblePicked = this.onPickerAccessiblePicked.bind(this);
+ this.onPickerAccessiblePreviewed =
+ this.onPickerAccessiblePreviewed.bind(this);
+ this.onPickerAccessibleCanceled =
+ this.onPickerAccessibleCanceled.bind(this);
+ }
+
+ get toolbox() {
+ return this._panel._toolbox;
+ }
+
+ get accessibilityProxy() {
+ return this._panel.accessibilityProxy;
+ }
+
+ get pickerButton() {
+ return this.toolbox.pickerButton;
+ }
+
+ get _telemetry() {
+ return this._panel._telemetry;
+ }
+
+ release() {
+ this._panel = null;
+ }
+
+ emit(event, data) {
+ this.toolbox.emit(event, data);
+ }
+
+ /**
+ * Select accessible object in the tree.
+ * @param {Object} accessible
+ * Accessiblle object to be selected in the inspector tree.
+ */
+ select(accessible) {
+ this._panel.selectAccessible(accessible);
+ }
+
+ /**
+ * Highlight accessible object in the tree.
+ * @param {Object} accessible
+ * Accessiblle object to be selected in the inspector tree.
+ */
+ highlight(accessible) {
+ this._panel.highlightAccessible(accessible);
+ }
+
+ getStr(key) {
+ return L10N.getStr(key);
+ }
+
+ /**
+ * Override the default presentation of the picker button in toolbox's top
+ * level toolbar.
+ */
+ updateButton() {
+ this.pickerButton.description = this.getStr("accessibility.pick");
+ this.pickerButton.className = "accessibility";
+ this.pickerButton.disabled = !this.accessibilityProxy.enabled;
+ if (!this.accessibilityProxy.enabled && this.isPicking) {
+ this.cancel();
+ }
+ }
+
+ /**
+ * Handle an event when a new accessible object is hovered over.
+ * @param {Object} accessible
+ * newly hovered accessible object
+ */
+ onPickerAccessibleHovered(accessible) {
+ if (accessible) {
+ this.emit("picker-accessible-hovered", accessible);
+ this.highlight(accessible);
+ }
+ }
+
+ /**
+ * Handle an event when a new accessible is picked by the user.
+ * @param {Object} accessible
+ * newly picked accessible object
+ */
+ onPickerAccessiblePicked(accessible) {
+ if (accessible) {
+ this.select(accessible);
+ }
+ this.stop();
+ }
+
+ /**
+ * Handle an event when a new accessible is previewed by the user.
+ * @param {Object} accessible
+ * newly previewed accessible object
+ */
+ onPickerAccessiblePreviewed(accessible) {
+ if (accessible) {
+ this.select(accessible);
+ }
+ }
+
+ /**
+ * Handle an event when picking is cancelled by the user.s
+ */
+ onPickerAccessibleCanceled() {
+ this.cancel();
+ this.emit("picker-accessible-canceled");
+ }
+
+ /**
+ * Cancel picking.
+ */
+ async cancel() {
+ await this.stop();
+ }
+
+ /**
+ * Stop picking.
+ */
+ async stop() {
+ if (!this.isPicking) {
+ return;
+ }
+
+ this.isPicking = false;
+ this.pickerButton.isChecked = false;
+
+ await this.accessibilityProxy.cancelPick();
+ this._telemetry.toolClosed("accessibility_picker", this);
+ this.emit("picker-stopped");
+ }
+
+ /**
+ * Start picking.
+ * @param {Boolean} doFocus
+ * If true, move keyboard focus into content.
+ */
+ async start(doFocus = true) {
+ if (this.isPicking) {
+ return;
+ }
+
+ this.isPicking = true;
+ this.pickerButton.isChecked = true;
+
+ await this.accessibilityProxy.pick(
+ doFocus,
+ this.onPickerAccessibleHovered,
+ this.onPickerAccessiblePicked,
+ this.onPickerAccessiblePreviewed,
+ this.onPickerAccessibleCanceled
+ );
+
+ this._telemetry.toolOpened("accessibility_picker", this);
+ this.emit("picker-started");
+ }
+
+ /**
+ * Toggle between starting and canceling the picker.
+ * @param {Boolean} doFocus
+ * If true, move keyboard focus into content.
+ */
+ toggle(doFocus) {
+ if (this.isPicking) {
+ return this.cancel();
+ }
+
+ return this.start(doFocus);
+ }
+}
+
+exports.Picker = Picker;
diff --git a/devtools/client/accessibility/provider.js b/devtools/client/accessibility/provider.js
new file mode 100644
index 0000000000..f0fc05c628
--- /dev/null
+++ b/devtools/client/accessibility/provider.js
@@ -0,0 +1,112 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ fetchChildren,
+} = require("resource://devtools/client/accessibility/actions/accessibles.js");
+
+/**
+ * Data provider that is responsible for mapping of an accessibles cache to the
+ * data format that is supported by the TreeView component.
+ * @param {Map} accessibles accessibles object cache
+ * @param {Function} dispatch react dispatch function that triggers a redux
+ * action.
+ */
+
+class Provider {
+ constructor(accessibles, filtered, dispatch) {
+ this.accessibles = accessibles;
+ this.filtered = filtered;
+ this.dispatch = dispatch;
+ }
+
+ /**
+ * Get accessible's cached children if available, if not fetch them from
+ * backend.
+ * @param {Object} accessible accessible object whose children to get.
+ * @returns {Array} arraof of accessible children.
+ */
+ getChildren(accessible) {
+ if (!accessible || !accessible.actorID || accessible.childCount === 0) {
+ return [];
+ }
+
+ const obj = this.accessibles.get(accessible.actorID);
+ if (!obj || !obj.children) {
+ return this.dispatch(fetchChildren(accessible));
+ }
+
+ return obj.children;
+ }
+
+ /**
+ * Return a flag indicating if an accessible object has any children.
+ * @param {Object} accessible accessible object whose children to get.
+ * @returns {Boolean} idicator of whether accessible object has children.
+ */
+ hasChildren(accessible) {
+ return accessible.childCount > 0;
+ }
+
+ /**
+ * Get a value for an accessible object. Used to render the second (value)
+ * column of the accessible tree. Corresponds to an accesible object name, if
+ * available.
+ * @param {Object} accessible accessible object
+ * @returns {String} accessible object value.
+ */
+ getValue(accessible) {
+ return accessible.name || "";
+ }
+
+ /**
+ * Get a label for an accessible object. Used to render the first column of
+ * the accessible tree. Corresponds to an accessible object role.
+ * @param {Object} accessible accessible object
+ * @returns {String} accessible object label.
+ */
+ getLabel(accessible) {
+ return accessible.role;
+ }
+
+ /**
+ * Get a unique key for an accessible object. Corresponds to an accessible
+ * front's actorID.
+ * @param {Object} accessible accessible object
+ * @returns {String} a key for an accessible object.
+ */
+ getKey(accessible) {
+ return accessible.actorID;
+ }
+
+ /**
+ * Get a type of an accesible object. Corresponds to the type of an accessible
+ * front.
+ * @param {Object} accessible accessible object
+ * @returns {String} accessible object type
+ */
+ getType(accessible) {
+ return accessible.typeName;
+ }
+
+ /**
+ * Get the depth of the accesible object in the accessibility tree. When the
+ * tree is filtered it is flattened and the level is set to 0. Otherwise use
+ * internal TreeView level.
+ *
+ * @param {Object} accessible
+ * accessible object
+ * @param {Number} defaultLevel
+ * default level provided by the TreeView component.
+ *
+ * @returns {null|Number}
+ * depth level of the accessible object.
+ */
+ getLevel(accessible, defaultLevel) {
+ return this.filtered ? 0 : defaultLevel;
+ }
+}
+
+exports.Provider = Provider;
diff --git a/devtools/client/accessibility/reducers/accessibles.js b/devtools/client/accessibility/reducers/accessibles.js
new file mode 100644
index 0000000000..908d1b734d
--- /dev/null
+++ b/devtools/client/accessibility/reducers/accessibles.js
@@ -0,0 +1,158 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ AUDIT,
+ FETCH_CHILDREN,
+ HIGHLIGHT,
+ RESET,
+ SELECT,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Initial state definition
+ */
+function getInitialState() {
+ return new Map();
+}
+
+/**
+ * Maintain a cache of received accessibles responses from the backend.
+ */
+function accessibles(state = getInitialState(), action) {
+ switch (action.type) {
+ case FETCH_CHILDREN:
+ return onReceiveChildren(state, action);
+ case HIGHLIGHT:
+ case SELECT:
+ return onReceiveAncestry(state, action);
+ case AUDIT:
+ return onAudit(state, action);
+ case RESET:
+ return getInitialState();
+ default:
+ return state;
+ }
+}
+
+function getActorID(accessible) {
+ return accessible.actorID || accessible._form?.actor;
+}
+
+/**
+ * If accessible is cached recursively remove all its children and remove itself
+ * from cache.
+ * @param {Map} cache Previous state maintaining a cache of previously
+ * fetched accessibles.
+ * @param {Object} accessible Accessible object to remove from cache.
+ */
+function cleanupChild(cache, accessible) {
+ const actorID = getActorID(accessible);
+ const cached = cache.get(actorID);
+ if (!cached) {
+ return;
+ }
+
+ for (const child of cached.children) {
+ cleanupChild(cache, child);
+ }
+
+ cache.delete(actorID);
+}
+
+/**
+ * Determine if accessible in cache is stale. Accessible object is stale if its
+ * cached children array has the size other than the value of its childCount
+ * property that updates on accessible actor event.
+ * @param {Map} cache Previous state maintaining a cache of previously
+ * fetched accessibles.
+ * @param {Object} accessible Accessible object to test for staleness.
+ */
+function staleChildren(cache, accessible) {
+ const cached = cache.get(getActorID(accessible));
+ if (!cached) {
+ return false;
+ }
+
+ return cached.children.length !== accessible.childCount;
+}
+
+function updateChildrenCache(cache, accessible, children) {
+ const actorID = getActorID(accessible);
+
+ if (cache.has(actorID)) {
+ const cached = cache.get(actorID);
+ for (const child of cached.children) {
+ // If exhisting children cache includes an accessible that is not present
+ // any more or if child accessible is stale remove it and all its children
+ // from cache.
+ if (!children.includes(child) || staleChildren(cache, child)) {
+ cleanupChild(cache, child);
+ }
+ }
+ cached.children = children;
+ cache.set(actorID, cached);
+ } else {
+ cache.set(actorID, { children });
+ }
+
+ return cache;
+}
+
+function updateAncestry(cache, ancestry) {
+ ancestry.forEach(({ accessible, children }) =>
+ updateChildrenCache(cache, accessible, children)
+ );
+
+ return cache;
+}
+
+/**
+ * Handles fetching of accessible children.
+ * @param {Map} cache Previous state maintaining a cache of previously
+ * fetched accessibles.
+ * @param {Object} action Redux action object.
+ * @return {Object} updated state
+ */
+function onReceiveChildren(cache, action) {
+ const { error, accessible, response: children } = action;
+ if (!error) {
+ return updateChildrenCache(new Map(cache), accessible, children);
+ }
+
+ if (!accessible.isDestroyed()) {
+ console.warn(`Error fetching children: `, error);
+ return cache;
+ }
+
+ const newCache = new Map(cache);
+ cleanupChild(newCache, accessible);
+ return newCache;
+}
+
+function onReceiveAncestry(cache, action) {
+ const { error, response: ancestry } = action;
+ if (error) {
+ console.warn(`Error fetching ancestry: `, error);
+ return cache;
+ }
+
+ return updateAncestry(new Map(cache), ancestry);
+}
+
+function onAudit(cache, action) {
+ const { error, response: ancestries } = action;
+ if (error) {
+ console.warn(`Error performing an audit: `, error);
+ return cache;
+ }
+
+ const newCache = new Map(cache);
+ ancestries.forEach(ancestry => updateAncestry(newCache, ancestry));
+
+ return newCache;
+}
+
+exports.accessibles = accessibles;
diff --git a/devtools/client/accessibility/reducers/audit.js b/devtools/client/accessibility/reducers/audit.js
new file mode 100644
index 0000000000..e65251ba64
--- /dev/null
+++ b/devtools/client/accessibility/reducers/audit.js
@@ -0,0 +1,109 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ accessibility: { AUDIT_TYPE },
+} = require("resource://devtools/shared/constants.js");
+const {
+ AUDIT,
+ AUDITING,
+ AUDIT_PROGRESS,
+ FILTER_TOGGLE,
+ FILTERS,
+ RESET,
+ SELECT,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Initial state definition
+ */
+function getInitialState() {
+ return {
+ filters: {
+ [FILTERS.ALL]: false,
+ [FILTERS.CONTRAST]: false,
+ [FILTERS.KEYBOARD]: false,
+ [FILTERS.TEXT_LABEL]: false,
+ },
+ auditing: [],
+ progress: null,
+ };
+}
+
+/**
+ * State with all filters active.
+ */
+function allActiveFilters() {
+ return {
+ [FILTERS.ALL]: true,
+ [FILTERS.CONTRAST]: true,
+ [FILTERS.KEYBOARD]: true,
+ [FILTERS.TEXT_LABEL]: true,
+ };
+}
+
+function audit(state = getInitialState(), action) {
+ switch (action.type) {
+ case FILTER_TOGGLE:
+ const { filter } = action;
+ let { filters } = state;
+ const isToggledToActive = !filters[filter];
+
+ if (filter === FILTERS.NONE) {
+ filters = getInitialState().filters;
+ } else if (filter === FILTERS.ALL) {
+ filters = isToggledToActive
+ ? allActiveFilters()
+ : getInitialState().filters;
+ } else {
+ filters = {
+ ...filters,
+ [filter]: isToggledToActive,
+ };
+
+ const allAuditTypesActive = Object.values(AUDIT_TYPE)
+ .filter(filterKey => filters.hasOwnProperty(filterKey))
+ .every(filterKey => filters[filterKey]);
+ if (isToggledToActive && !filters[FILTERS.ALL] && allAuditTypesActive) {
+ filters[FILTERS.ALL] = true;
+ } else if (!isToggledToActive && filters[FILTERS.ALL]) {
+ filters[FILTERS.ALL] = false;
+ }
+ }
+
+ return {
+ ...state,
+ filters,
+ };
+ case AUDITING:
+ const { auditing } = action;
+
+ return {
+ ...state,
+ auditing,
+ };
+ case AUDIT:
+ return {
+ ...state,
+ auditing: getInitialState().auditing,
+ progress: null,
+ };
+ case AUDIT_PROGRESS:
+ const { progress } = action;
+
+ return {
+ ...state,
+ progress,
+ };
+ case SELECT:
+ case RESET:
+ return getInitialState();
+ default:
+ return state;
+ }
+}
+
+exports.audit = audit;
diff --git a/devtools/client/accessibility/reducers/details.js b/devtools/client/accessibility/reducers/details.js
new file mode 100644
index 0000000000..25a1c42ed2
--- /dev/null
+++ b/devtools/client/accessibility/reducers/details.js
@@ -0,0 +1,60 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ UPDATE_DETAILS,
+ RESET,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Initial state definition
+ */
+function getInitialState() {
+ return {};
+}
+
+/**
+ * Maintain details of a current relevant accessible.
+ */
+function details(state = getInitialState(), action) {
+ switch (action.type) {
+ case UPDATE_DETAILS:
+ return onUpdateDetails(state, action);
+ case RESET:
+ return getInitialState();
+ default:
+ return state;
+ }
+}
+
+/**
+ * Handle details update for an accessible object
+ * @param {Object} state Current accessible object details.
+ * @param {Object} action Redux action object
+ * @return {Object} updated state
+ */
+function onUpdateDetails(state, action) {
+ const { accessible, response, error } = action;
+ if (error) {
+ if (!accessible.isDestroyed()) {
+ console.warn(
+ `Error fetching accessible details: `,
+ accessible.actorID,
+ error
+ );
+ }
+
+ return getInitialState();
+ }
+
+ const [DOMNode, relationObjects, audit] = response;
+ const relations = {};
+ relationObjects.forEach(({ type, targets }) => {
+ relations[type] = targets.length === 1 ? targets[0] : targets;
+ });
+ return { accessible, DOMNode, relations, audit };
+}
+
+exports.details = details;
diff --git a/devtools/client/accessibility/reducers/index.js b/devtools/client/accessibility/reducers/index.js
new file mode 100644
index 0000000000..d9ca8467ff
--- /dev/null
+++ b/devtools/client/accessibility/reducers/index.js
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const {
+ accessibles,
+} = require("resource://devtools/client/accessibility/reducers/accessibles.js");
+const {
+ audit,
+} = require("resource://devtools/client/accessibility/reducers/audit.js");
+const {
+ details,
+} = require("resource://devtools/client/accessibility/reducers/details.js");
+const {
+ simulation,
+} = require("resource://devtools/client/accessibility/reducers/simulation.js");
+const {
+ ui,
+} = require("resource://devtools/client/accessibility/reducers/ui.js");
+
+exports.reducers = {
+ accessibles,
+ audit,
+ details,
+ simulation,
+ ui,
+};
diff --git a/devtools/client/accessibility/reducers/moz.build b/devtools/client/accessibility/reducers/moz.build
new file mode 100644
index 0000000000..0c7398f397
--- /dev/null
+++ b/devtools/client/accessibility/reducers/moz.build
@@ -0,0 +1,7 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "accessibles.js", "audit.js", "details.js", "index.js", "simulation.js", "ui.js"
+)
diff --git a/devtools/client/accessibility/reducers/simulation.js b/devtools/client/accessibility/reducers/simulation.js
new file mode 100644
index 0000000000..1b68331d93
--- /dev/null
+++ b/devtools/client/accessibility/reducers/simulation.js
@@ -0,0 +1,52 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ accessibility: { SIMULATION_TYPE },
+} = require("resource://devtools/shared/constants.js");
+const {
+ SIMULATE,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Initial state definition
+ */
+function getInitialState() {
+ return {
+ [SIMULATION_TYPE.ACHROMATOPSIA]: false,
+ [SIMULATION_TYPE.PROTANOPIA]: false,
+ [SIMULATION_TYPE.DEUTERANOPIA]: false,
+ [SIMULATION_TYPE.TRITANOPIA]: false,
+ [SIMULATION_TYPE.CONTRAST_LOSS]: false,
+ };
+}
+
+function simulation(state = getInitialState(), action) {
+ switch (action.type) {
+ case SIMULATE:
+ if (action.error) {
+ console.warn("Error running simulation", action.error);
+ return state;
+ }
+
+ const simTypes = action.simTypes;
+
+ if (simTypes.length === 0) {
+ return getInitialState();
+ }
+
+ const updatedState = getInitialState();
+ simTypes.forEach(simType => {
+ updatedState[simType] = true;
+ });
+
+ return updatedState;
+ default:
+ return state;
+ }
+}
+
+exports.simulation = simulation;
diff --git a/devtools/client/accessibility/reducers/ui.js b/devtools/client/accessibility/reducers/ui.js
new file mode 100644
index 0000000000..828889680c
--- /dev/null
+++ b/devtools/client/accessibility/reducers/ui.js
@@ -0,0 +1,217 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ AUDIT,
+ ENABLE,
+ RESET,
+ SELECT,
+ HIGHLIGHT,
+ UNHIGHLIGHT,
+ UPDATE_CAN_BE_DISABLED,
+ UPDATE_CAN_BE_ENABLED,
+ UPDATE_PREF,
+ UPDATE_DETAILS,
+ PREF_KEYS,
+ PREFS,
+ UPDATE_DISPLAY_TABBING_ORDER,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+const TreeView = require("resource://devtools/client/shared/components/tree/TreeView.js");
+
+/**
+ * Initial state definition
+ */
+function getInitialState() {
+ return {
+ enabled: false,
+ canBeDisabled: true,
+ canBeEnabled: true,
+ selected: null,
+ highlighted: null,
+ expanded: new Set(),
+ [PREFS.SCROLL_INTO_VIEW]: Services.prefs.getBoolPref(
+ PREF_KEYS[PREFS.SCROLL_INTO_VIEW],
+ false
+ ),
+ tabbingOrderDisplayed: false,
+ supports: {},
+ };
+}
+
+/**
+ * Maintain ui components of the accessibility panel.
+ */
+function ui(state = getInitialState(), action) {
+ switch (action.type) {
+ case ENABLE:
+ return onToggle(state, action, true);
+ case UPDATE_CAN_BE_DISABLED:
+ return onCanBeDisabledChange(state, action);
+ case UPDATE_CAN_BE_ENABLED:
+ return onCanBeEnabledChange(state, action);
+ case UPDATE_PREF:
+ return onPrefChange(state, action);
+ case UPDATE_DETAILS:
+ return onUpdateDetails(state, action);
+ case HIGHLIGHT:
+ return onHighlight(state, action);
+ case AUDIT:
+ return onAudit(state, action);
+ case UNHIGHLIGHT:
+ return onUnhighlight(state, action);
+ case SELECT:
+ return onSelect(state, action);
+ case RESET:
+ return onReset(state, action);
+ case UPDATE_DISPLAY_TABBING_ORDER:
+ return onUpdateDisplayTabbingOrder(state, action);
+ default:
+ return state;
+ }
+}
+
+function onUpdateDetails(state) {
+ if (!state.selected) {
+ return state;
+ }
+
+ // Clear selected state that should only be set when select action is
+ // performed.
+ return Object.assign({}, state, { selected: null });
+}
+
+function onUnhighlight(state) {
+ return Object.assign({}, state, { highlighted: null });
+}
+
+function updateExpandedNodes(expanded, ancestry) {
+ expanded = new Set(expanded);
+ const path = ancestry.reduceRight((accPath, { accessible }) => {
+ accPath = TreeView.subPath(accPath, accessible.actorID);
+ expanded.add(accPath);
+ return accPath;
+ }, "");
+
+ return { path, expanded };
+}
+
+function onAudit(state, { response: ancestries, error }) {
+ if (error) {
+ console.warn("Error running audit", error);
+ return state;
+ }
+
+ let expanded = new Set(state.expanded);
+ for (const ancestry of ancestries) {
+ ({ expanded } = updateExpandedNodes(expanded, ancestry));
+ }
+
+ return {
+ ...state,
+ expanded,
+ };
+}
+
+function onHighlight(state, { accessible, response: ancestry, error }) {
+ if (error) {
+ console.warn("Error fetching ancestry", error);
+ return state;
+ }
+
+ const { expanded } = updateExpandedNodes(state.expanded, ancestry);
+ return Object.assign({}, state, { expanded, highlighted: accessible });
+}
+
+function onSelect(state, { accessible, response: ancestry, error }) {
+ if (error) {
+ console.warn("Error fetching ancestry", error);
+ return state;
+ }
+
+ const { path, expanded } = updateExpandedNodes(state.expanded, ancestry);
+ const selected = TreeView.subPath(path, accessible.actorID);
+
+ return Object.assign({}, state, { expanded, selected });
+}
+
+/**
+ * Handle "canBeDisabled" flag update for accessibility service
+ * @param {Object} state Current ui state
+ * @param {Object} action Redux action object
+ * @return {Object} updated state
+ */
+function onCanBeDisabledChange(state, { canBeDisabled }) {
+ return Object.assign({}, state, { canBeDisabled });
+}
+
+/**
+ * Handle "canBeEnabled" flag update for accessibility service
+ * @param {Object} state Current ui state.
+ * @param {Object} action Redux action object
+ * @return {Object} updated state
+ */
+function onCanBeEnabledChange(state, { canBeEnabled }) {
+ return Object.assign({}, state, { canBeEnabled });
+}
+
+/**
+ * Handle pref update for accessibility panel.
+ * @param {Object} state Current ui state.
+ * @param {Object} action Redux action object
+ * @return {Object} updated state
+ */
+function onPrefChange(state, { name, value }) {
+ return {
+ ...state,
+ [name]: value,
+ };
+}
+
+/**
+ * Handle reset action for the accessibility panel UI.
+ * @param {Object} state Current ui state.
+ * @param {Object} action Redux action object
+ * @return {Object} updated state
+ */
+function onReset(state, { enabled, canBeDisabled, canBeEnabled, supports }) {
+ const newState = {
+ ...getInitialState(),
+ enabled,
+ canBeDisabled,
+ canBeEnabled,
+ supports,
+ };
+
+ return newState;
+}
+
+/**
+ * Handle accessibilty service enabling/disabling.
+ * @param {Object} state Current accessibility services enabled state.
+ * @param {Object} action Redux action object
+ * @param {Boolean} enabled New enabled state.
+ * @return {Object} updated state
+ */
+function onToggle(state, { error }, enabled) {
+ if (error) {
+ console.warn("Error enabling accessibility service: ", error);
+ return state;
+ }
+
+ return Object.assign({}, state, { enabled });
+}
+
+function onUpdateDisplayTabbingOrder(state, { error, tabbingOrderDisplayed }) {
+ if (error) {
+ console.warn("Error updating displaying tabbing order: ", error);
+ return state;
+ }
+
+ return Object.assign({}, state, { tabbingOrderDisplayed });
+}
+
+exports.ui = ui;
diff --git a/devtools/client/accessibility/test/browser/browser.ini b/devtools/client/accessibility/test/browser/browser.ini
new file mode 100644
index 0000000000..3058fac933
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser.ini
@@ -0,0 +1,49 @@
+[DEFAULT]
+tags = devtools
+subsuite = devtools
+skip-if = (os == 'win' && processor == 'aarch64')
+support-files =
+ head.js
+ !/devtools/client/shared/test/shared-head.js
+ !/devtools/client/shared/test/highlighter-test-actor.js
+ !/devtools/client/inspector/test/shared-head.js
+ !/devtools/client/shared/test/telemetry-test-helpers.js
+
+[browser_accessibility_context_menu_browser.js]
+skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184
+[browser_accessibility_context_menu_inspector.js]
+skip-if =
+ (os == 'win' && processor == 'aarch64') # bug 1533484
+ win10_2004 # Bug 1723573
+ apple_catalina # Bug 1713392
+[browser_accessibility_fission_switch_target.js]
+https_first_disabled = true
+skip-if = (os == 'linux' && asan) # bug 1666940
+[browser_accessibility_mutations.js]
+skip-if =
+ os == 'win' && processor == 'aarch64' # bug 1533534
+ os == 'linux' && bits == 64 && fission # Bug 1675445
+[browser_accessibility_panel_audit_hidden_iframe.js]
+[browser_accessibility_panel_audit_oop.js]
+[browser_accessibility_panel_toolbar_checks.js]
+[browser_accessibility_panel_toolbar_pref_scroll.js]
+skip-if = true # bug 1674060
+[browser_accessibility_print_to_json.js]
+[browser_accessibility_relation_navigation.js]
+[browser_accessibility_reload.js]
+[browser_accessibility_sidebar_checks.js]
+[browser_accessibility_sidebar_dom_nodes.js]
+[browser_accessibility_sidebar.js]
+[browser_accessibility_simulation.js]
+skip-if = true # bug 1674060
+[browser_accessibility_tabbing_order_highlighter_iframe_picker.js]
+[browser_accessibility_tabbing_order_highlighter.js]
+[browser_accessibility_tree_audit_long.js]
+[browser_accessibility_tree_audit_reset.js]
+[browser_accessibility_tree_audit_toolbar.js]
+[browser_accessibility_tree_audit.js]
+[browser_accessibility_tree_contrast.js]
+[browser_accessibility_tree_iframe_picker.js]
+[browser_accessibility_tree_navigation_oop.js]
+[browser_accessibility_tree_navigation.js]
+[browser_accessibility_tree.js]
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js
new file mode 100644
index 0000000000..0491b29eb4
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js
@@ -0,0 +1,74 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = '<h1 id="h1">header</h1><p id="p">paragraph</p>';
+
+addA11YPanelTask(
+ "Test show accessibility properties context menu in browser.",
+ TEST_URI,
+ async function ({ panel, toolbox, browser }) {
+ // Load the inspector to ensure it to use in this test.
+ await toolbox.loadTool("inspector");
+
+ const headerSelector = "#h1";
+
+ const contextMenu = document.getElementById("contentAreaContextMenu");
+ const awaitPopupShown = BrowserTestUtils.waitForEvent(
+ contextMenu,
+ "popupshown"
+ );
+ await BrowserTestUtils.synthesizeMouse(
+ headerSelector,
+ 0,
+ 0,
+ {
+ type: "contextmenu",
+ button: 2,
+ centered: true,
+ },
+ browser
+ );
+ await awaitPopupShown;
+
+ const inspectA11YPropsItem = contextMenu.querySelector(
+ "#context-inspect-a11y"
+ );
+
+ info(
+ "Triggering 'Inspect Accessibility Properties' and waiting for " +
+ "accessibility panel to open"
+ );
+ const popupHidden = BrowserTestUtils.waitForEvent(
+ contextMenu,
+ "popuphidden"
+ );
+ contextMenu.activateItem(inspectA11YPropsItem);
+ await popupHidden;
+
+ const selected = await panel.once("new-accessible-front-selected");
+ const expectedSelectedNode = await getNodeFront(
+ headerSelector,
+ toolbox.getPanel("inspector")
+ );
+ const expectedSelected =
+ await panel.accessibilityProxy.accessibilityFront.accessibleWalkerFront.getAccessibleFor(
+ expectedSelectedNode
+ );
+ is(
+ toolbox.getCurrentPanel(),
+ panel,
+ "Accessibility panel is currently selected"
+ );
+ is(selected, expectedSelected, "Accessible front selected correctly");
+
+ const doc = panel.panelWin.document;
+ const propertiesTree = doc.querySelector(".tree");
+ is(doc.activeElement, propertiesTree, "Properties list must be focused.");
+ ok(
+ isVisible(doc.querySelector(".treeTable .treeRow.selected")),
+ "Selected row is visible."
+ );
+ }
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js
new file mode 100644
index 0000000000..03273a30c2
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js
@@ -0,0 +1,104 @@
+/* Any copyright is dedicated to the Public Domain.
+http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+const TEST_URI = `
+ <h1 id="h1">header</h1>
+ <p id="p">paragraph</p>
+ <span id="span-1">text</span>
+ <span id="span-2">
+ IamaverylongtextwhichdoesntfitinInlineTextChildReallyIdontIamtoobig
+ </span>`;
+
+async function openContextMenuForNode({ toolbox }, selector) {
+ info("Selecting Inspector tab and opening a context menu");
+ const inspector = await toolbox.selectTool("inspector");
+
+ if (!selector) {
+ ok(inspector.selection.isBodyNode(), "Default selection is a body node.");
+ } else if (typeof selector === "string") {
+ await selectNode(selector, inspector, "test");
+ } else {
+ const updated = inspector.once("inspector-updated");
+ inspector.selection.setNodeFront(selector, { reason: "test" });
+ await updated;
+ }
+
+ return openContextMenuAndGetAllItems(inspector);
+}
+
+function checkShowA11YPropertiesNode(allMenuItems) {
+ const showA11YPropertiesNode = allMenuItems.find(
+ item => item.id === "node-menu-showaccessibilityproperties"
+ );
+ ok(
+ showA11YPropertiesNode,
+ "the popup menu now has a show accessibility properties item"
+ );
+ return showA11YPropertiesNode;
+}
+
+async function checkAccessibleObjectSelection(
+ { toolbox, panel },
+ menuItem,
+ isText
+) {
+ const inspector = await toolbox.getPanel("inspector");
+ info(
+ "Triggering 'Show Accessibility Properties' and waiting for " +
+ "accessibility panel to open"
+ );
+ const panelSelected = toolbox.once("accessibility-selected");
+ const objectSelected = panel.once("new-accessible-front-selected");
+ menuItem.click();
+ await panelSelected;
+ const selected = await objectSelected;
+
+ const expectedNode = isText
+ ? inspector.selection.nodeFront.inlineTextChild
+ : inspector.selection.nodeFront;
+ const expectedSelected =
+ await panel.accessibilityProxy.accessibilityFront.accessibleWalkerFront.getAccessibleFor(
+ expectedNode
+ );
+ is(selected, expectedSelected, "Accessible front selected correctly");
+
+ const doc = panel.panelWin.document;
+ const propertiesTree = doc.querySelector(".tree");
+ is(doc.activeElement, propertiesTree, "Properties list must be focused.");
+ ok(
+ isVisible(doc.querySelector(".treeTable .treeRow.selected")),
+ "Selected row is visible."
+ );
+}
+
+addA11YPanelTask(
+ "Test show accessibility properties context menu.",
+ TEST_URI,
+ async function testShowAccessibilityPropertiesContextMenu(env) {
+ // Load the inspector to ensure it to use in this test.
+ await env.toolbox.loadTool("inspector");
+
+ let allMenuItems = await openContextMenuForNode(env);
+ let showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems);
+
+ allMenuItems = await openContextMenuForNode(env, "#h1");
+ showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems);
+ await checkAccessibleObjectSelection(env, showA11YPropertiesNode);
+
+ allMenuItems = await openContextMenuForNode(env, "#span-1");
+ showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems);
+ await checkAccessibleObjectSelection(env, showA11YPropertiesNode, true);
+
+ allMenuItems = await openContextMenuForNode(env, "#span-2");
+ showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems);
+
+ const inspector = env.toolbox.getPanel("inspector");
+ const span2 = await getNodeFront("#span-2", inspector);
+ await inspector.markup.expandNode(span2);
+ const { nodes } = await inspector.walker.children(span2);
+ allMenuItems = await openContextMenuForNode(env, nodes[0]);
+ showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems);
+ await checkAccessibleObjectSelection(env, showA11YPropertiesNode, false);
+ }
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js b/devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js
new file mode 100644
index 0000000000..9da56a0b1b
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js
@@ -0,0 +1,58 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test switching for the top-level target.
+
+const MAIN_PROCESS_URL = "about:robots";
+const MAIN_PROCESS_EXPECTED = [
+ {
+ expected: {
+ sidebar: {
+ name: "Gort! Klaatu barada nikto!",
+ role: "document",
+ },
+ },
+ },
+];
+
+const CONTENT_PROCESS_URL = buildURL(`<title>Test page</title>`);
+const CONTENT_PROCESS_EXPECTED = [
+ {
+ expected: {
+ sidebar: {
+ name: "Test page",
+ role: "document",
+ relations: {
+ "containing document": {
+ role: "document",
+ name: "Test page",
+ },
+ embeds: {
+ role: "document",
+ name: "Test page",
+ },
+ },
+ },
+ },
+ },
+];
+
+add_task(async () => {
+ info(
+ "Open a test page running on the content process and accessibility panel"
+ );
+ const env = await addTestTab(CONTENT_PROCESS_URL);
+ await runA11yPanelTests(CONTENT_PROCESS_EXPECTED, env);
+
+ info("Navigate to a page running on the main process");
+ await navigateTo(MAIN_PROCESS_URL);
+ await runA11yPanelTests(MAIN_PROCESS_EXPECTED, env);
+
+ info("Back to a page running on the content process");
+ await navigateTo(CONTENT_PROCESS_URL);
+ await runA11yPanelTests(CONTENT_PROCESS_EXPECTED, env);
+
+ await closeTabToolboxAccessibility(env.tab);
+});
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_mutations.js b/devtools/client/accessibility/test/browser/browser_accessibility_mutations.js
new file mode 100644
index 0000000000..4c564747f9
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_mutations.js
@@ -0,0 +1,217 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 id="h1">Top level header</h1>
+ <p id="p">This is a paragraph.</p>
+ </body>
+</html>`;
+
+const documentRow = {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+};
+const documentRowOOP = {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+};
+const subtree = [
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+];
+const frameSubtree = [
+ { role: "internal frame", name: `"Accessibility Panel Test (OOP)"` },
+ {
+ role: "document",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+];
+const subtreeOOP = [...frameSubtree, ...subtree];
+const renamed = [
+ {
+ role: "heading",
+ name: `"New Header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"New Header"`,
+ },
+];
+const paragraphSidebar = {
+ name: null,
+ role: "paragraph",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 1,
+ indexInParent: 1,
+ states: ["selectable text", "opaque", "enabled", "sensitive"],
+};
+const headerSidebar = {
+ name: "Top level header",
+ role: "text leaf",
+};
+const newHeaderSidebar = {
+ name: "New Header",
+};
+
+function removeRow(rowNumber) {
+ return async ({ doc, browser }) => {
+ is(
+ doc.querySelectorAll(".treeRow").length,
+ rowNumber,
+ "Tree size is correct."
+ );
+ await SpecialPowers.spawn(browser, [], async () => {
+ const iframe = content.document.getElementsByTagName("iframe")[0];
+ if (iframe) {
+ await SpecialPowers.spawn(iframe, [], () =>
+ content.document.getElementById("p").remove()
+ );
+ return;
+ }
+
+ content.document.getElementById("p").remove();
+ });
+ await BrowserTestUtils.waitForCondition(
+ () => doc.querySelectorAll(".treeRow").length === rowNumber - 1,
+ "Tree updated."
+ );
+ };
+}
+
+async function rename({ browser }) {
+ await SpecialPowers.spawn(browser, [], async () => {
+ const iframe = content.document.getElementsByTagName("iframe")[0];
+ if (iframe) {
+ await SpecialPowers.spawn(
+ iframe,
+ [],
+ () => (content.document.getElementById("h1").textContent = "New Header")
+ );
+ return;
+ }
+
+ content.document.getElementById("h1").textContent = "New Header";
+ });
+}
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const testsTopLevel = [
+ {
+ desc: "Expand first and second rows, select third row.",
+ setup: async ({ doc }) => {
+ await toggleRow(doc, 0);
+ await toggleRow(doc, 1);
+ selectRow(doc, 3);
+ },
+ expected: {
+ tree: [documentRow, ...subtree],
+ sidebar: paragraphSidebar,
+ },
+ },
+ {
+ desc: "Remove a child from a document.",
+ setup: removeRow(4),
+ expected: {
+ tree: [documentRow, ...subtree.slice(0, -1)],
+ sidebar: headerSidebar,
+ },
+ },
+ {
+ desc: "Update child's text content.",
+ setup: rename,
+ expected: {
+ tree: [documentRow, ...renamed],
+ },
+ },
+ {
+ desc: "Select third row in the tree.",
+ setup: ({ doc }) => selectRow(doc, 1),
+ expected: {
+ sidebar: newHeaderSidebar,
+ },
+ },
+];
+
+const testsOOP = [
+ {
+ desc: "Expand rows until we reach an internal OOP frame.",
+ setup: async ({ doc }) => {
+ await toggleRow(doc, 0);
+ await toggleRow(doc, 1);
+ await toggleRow(doc, 2);
+ await toggleRow(doc, 3);
+ selectRow(doc, 5);
+ },
+ expected: {
+ tree: [documentRowOOP, ...subtreeOOP],
+ sidebar: paragraphSidebar,
+ },
+ },
+ {
+ desc: "Remove a child from a document.",
+ setup: removeRow(6),
+ expected: {
+ tree: [documentRowOOP, ...subtreeOOP.slice(0, -1)],
+ sidebar: headerSidebar,
+ },
+ },
+ {
+ desc: "Update child's text content.",
+ setup: rename,
+ expected: {
+ tree: [documentRowOOP, ...frameSubtree, ...renamed],
+ },
+ },
+ {
+ desc: "Select third row in the tree.",
+ setup: ({ doc }) => selectRow(doc, 1),
+ expected: {
+ sidebar: newHeaderSidebar,
+ },
+ },
+];
+
+/**
+ * Tests that checks the Accessibility panel after DOM tree mutations.
+ */
+addA11yPanelTestsTask(
+ testsTopLevel,
+ TEST_URI,
+ "Test Accessibility panel after DOM tree mutations."
+);
+
+addA11yPanelTestsTask(
+ testsOOP,
+ TEST_URI,
+ "Test Accessibility panel after DOM tree mutations in the OOP frame.",
+ { remoteIframe: true }
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js
new file mode 100644
index 0000000000..1e7d0e26c2
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js
@@ -0,0 +1,66 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, TREE_FILTERS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ <iframe style="display: none"></iframe>
+ <iframe style="display: none" src="data:text/html,iframe"></iframe>
+ <iframe style="display: none" src="https://example.com/document-builder.sjs?html=oop"></iframe>
+ </body>
+ </html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Initial state.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Click on the Check for issues - all.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ level: 1,
+ },
+ ],
+ },
+ },
+];
+
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree audit on a page with hidden iframes."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js
new file mode 100644
index 0000000000..d1ccbe9d5c
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js
@@ -0,0 +1,109 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, TREE_FILTERS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ </body>
+ </html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Initial state.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ level: 1,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Click on the Check for issues - all.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ level: 1,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ level: 1,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Click on the Check for issues - all again.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ level: 1,
+ },
+ {
+ role: "internal frame",
+ name: `"Accessibility Panel Test (OOP)"`,
+ level: 2,
+ },
+ {
+ role: "document",
+ name: `"Accessibility Panel Test (OOP)"`,
+ level: 3,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ level: 4,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ level: 5,
+ },
+ ],
+ },
+ },
+];
+
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree audit on a page with an OOP document.",
+ { remoteIframe: true }
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js
new file mode 100644
index 0000000000..b7d541853b
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js
@@ -0,0 +1,114 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, TREE_FILTERS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body></body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Check initial state.",
+ expected: {
+ activeToolbarFilters: [true, false, false, false, false],
+ },
+ },
+ {
+ desc: "Toggle first filter (all) to activate.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ activeToolbarFilters: [false, true, true, true, true],
+ },
+ },
+ {
+ desc: "Click on the filter again.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ activeToolbarFilters: [true, false, false, false, false],
+ },
+ },
+ {
+ desc: "Toggle first custom filter to activate.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 2);
+ },
+ expected: {
+ activeToolbarFilters: [false, false, true, false, false],
+ },
+ },
+ {
+ desc: "Click on the filter again.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 2);
+ },
+ expected: {
+ activeToolbarFilters: [true, false, false, false, false],
+ },
+ },
+ {
+ desc: "Toggle first custom filter to activate.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 2);
+ },
+ expected: {
+ activeToolbarFilters: [false, false, true, false, false],
+ },
+ },
+ {
+ desc: "Toggle second custom filter to activate.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 3);
+ },
+ expected: {
+ activeToolbarFilters: [false, false, true, true, false],
+ },
+ },
+ {
+ desc: "Toggle third custom filter to activate.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 4);
+ },
+ expected: {
+ activeToolbarFilters: [false, true, true, true, true],
+ },
+ },
+ {
+ desc: "Click on the none filter to de-activate all.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 0);
+ },
+ expected: {
+ activeToolbarFilters: [true, false, false, false, false],
+ },
+ },
+];
+
+/**
+ * Simple test that checks toggle states for filters in the Accessibility panel
+ * toolbar.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel filter toggle states."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js
new file mode 100644
index 0000000000..9f8434f695
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js
@@ -0,0 +1,73 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, PREFS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body></body>
+</html>`;
+
+const {
+ PREFS: { SCROLL_INTO_VIEW },
+} = require("resource://devtools/client/accessibility/constants.js");
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Check initial state. All filters are disabled (except none). Scroll into view pref disabled.",
+ expected: {
+ activeToolbarFilters: [true, false, false, false],
+ toolbarPrefValues: {
+ [SCROLL_INTO_VIEW]: false,
+ },
+ },
+ },
+ {
+ desc: "Toggle scroll into view checkbox to set the pref. Scroll into view pref should be enabled.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, PREFS_MENU_ID, 0);
+ },
+ expected: {
+ activeToolbarFilters: [true, false, false, false],
+ toolbarPrefValues: {
+ [SCROLL_INTO_VIEW]: true,
+ },
+ },
+ },
+ {
+ desc: "Toggle off scroll into view checkbox to unset the pref. Scroll into view pref disabled.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, PREFS_MENU_ID, 0);
+ },
+ expected: {
+ activeToolbarFilters: [true, false, false, false],
+ toolbarPrefValues: {
+ [SCROLL_INTO_VIEW]: false,
+ },
+ },
+ },
+];
+
+/**
+ * Simple test that checks toggle state and pref set for automatic scroll into
+ * view setting.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel scroll into view pref."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js b/devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js
new file mode 100644
index 0000000000..b7641430c0
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js
@@ -0,0 +1,245 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = "<h1>Top level header</h1>";
+
+function getMenuItems(toolbox) {
+ const menuDoc = toolbox.doc.defaultView.windowRoot.ownerGlobal.document;
+ const menu = menuDoc.getElementById("accessibility-row-contextmenu");
+ return {
+ menu,
+ items: [...menu.getElementsByTagName("menuitem")],
+ };
+}
+
+async function newTabSelected(tab) {
+ info("Waiting for the JSON viewer tab.");
+ await BrowserTestUtils.waitForCondition(
+ () => gBrowser.selectedTab !== tab,
+ "Current tab updated."
+ );
+ return gBrowser.selectedTab;
+}
+
+function parseSnapshotFromTabURI(tab) {
+ let snapshot = tab.label.split("data:application/json;charset=UTF-8,")[1];
+ snapshot = decodeURIComponent(snapshot);
+ return JSON.parse(snapshot);
+}
+
+async function checkJSONSnapshotForRow({ doc, tab, toolbox }, index, expected) {
+ info(`Triggering context menu for row #${index}.`);
+ EventUtils.synthesizeMouseAtCenter(
+ doc.querySelectorAll(".treeRow")[index],
+ { type: "contextmenu" },
+ doc.defaultView
+ );
+
+ info(`Triggering "Print To JSON" menu item for row ${index}.`);
+ const {
+ menu,
+ items: [printToJSON],
+ } = getMenuItems(toolbox);
+
+ await BrowserTestUtils.waitForPopupEvent(menu, "shown");
+
+ menu.activateItem(printToJSON);
+
+ const jsonViewTab = await newTabSelected(tab);
+ Assert.deepEqual(
+ parseSnapshotFromTabURI(jsonViewTab),
+ expected,
+ "JSON snapshot for the whole document is correct"
+ );
+
+ await removeTab(jsonViewTab);
+}
+
+const OOP_FRAME_DOCUMENT_SNAPSHOT = {
+ childCount: 1,
+ description: "",
+ indexInParent: 0,
+ keyboardShortcut: "",
+ name: "Accessibility Panel Test (OOP)",
+ nodeCssSelector: "",
+ nodeType: 9,
+ role: "document",
+ value: "",
+ actions: [],
+ attributes: {
+ display: "block",
+ "explicit-name": "true",
+ "margin-bottom": "8px",
+ "margin-left": "8px",
+ "margin-right": "8px",
+ "margin-top": "8px",
+ tag: "body",
+ "text-align": "start",
+ "text-indent": "0px",
+ },
+ states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
+ children: [
+ {
+ childCount: 1,
+ description: "",
+ indexInParent: 0,
+ keyboardShortcut: "",
+ name: "Top level header",
+ nodeCssSelector: "body > h1:nth-child(1)",
+ nodeType: 1,
+ role: "heading",
+ value: "",
+ actions: [],
+ attributes: {
+ display: "block",
+ formatting: "block",
+ level: "1",
+ "margin-bottom": "21.44px",
+ "margin-left": "0px",
+ "margin-right": "0px",
+ "margin-top": "0px",
+ tag: "h1",
+ "text-align": "start",
+ "text-indent": "0px",
+ },
+ states: ["selectable text", "opaque", "enabled", "sensitive"],
+ children: [
+ {
+ childCount: 0,
+ description: "",
+ indexInParent: 0,
+ keyboardShortcut: "",
+ name: "Top level header",
+ nodeCssSelector: "body > h1:nth-child(1)#text",
+ nodeType: 3,
+ role: "text leaf",
+ value: "",
+ actions: [],
+ attributes: {
+ "explicit-name": "true",
+ },
+ states: ["opaque", "enabled", "sensitive"],
+ children: [],
+ },
+ ],
+ },
+ ],
+};
+
+const OOP_FRAME_SNAPSHOT = {
+ childCount: 1,
+ description: "",
+ indexInParent: 0,
+ keyboardShortcut: "",
+ name: "Accessibility Panel Test (OOP)",
+ nodeCssSelector: "body > iframe:nth-child(1)",
+ nodeType: 1,
+ role: "internal frame",
+ value: "",
+ actions: [],
+ attributes: {
+ display: "inline",
+ "explicit-name": "true",
+ "margin-bottom": "0px",
+ "margin-left": "0px",
+ "margin-right": "0px",
+ "margin-top": "0px",
+ tag: "iframe",
+ "text-align": "start",
+ "text-indent": "0px",
+ },
+ states: ["focusable", "opaque", "enabled", "sensitive"],
+ children: [OOP_FRAME_DOCUMENT_SNAPSHOT],
+};
+
+const EXPECTED_SNAPSHOT = {
+ childCount: 1,
+ description: "",
+ indexInParent: 0,
+ keyboardShortcut: "",
+ name: "",
+ nodeCssSelector: "",
+ nodeType: 9,
+ role: "document",
+ value: "",
+ actions: [],
+ attributes: {
+ display: "block",
+ "explicit-name": "true",
+ "margin-bottom": "8px",
+ "margin-left": "8px",
+ "margin-right": "8px",
+ "margin-top": "8px",
+ tag: "body",
+ "text-align": "start",
+ "text-indent": "0px",
+ },
+ states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
+ children: [OOP_FRAME_SNAPSHOT],
+};
+
+addA11YPanelTask(
+ "Test print to JSON functionality.",
+ TEST_URI,
+ async env => {
+ const { doc } = env;
+ await runA11yPanelTests(
+ [
+ {
+ desc: "Test the initial accessibility tree.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ },
+ ],
+ },
+ },
+ ],
+ env
+ );
+
+ await toggleRow(doc, 0);
+ await toggleRow(doc, 1);
+
+ await runA11yPanelTests(
+ [
+ {
+ desc: "Test expanded accessibility tree.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ },
+ {
+ role: "internal frame",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ {
+ role: "document",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ ],
+ },
+ },
+ ],
+ env
+ );
+
+ // Complete snapshot that includes OOP frame document (crossing process boundry).
+ await checkJSONSnapshotForRow(env, 0, EXPECTED_SNAPSHOT);
+ // Snapshot of an OOP frame (crossing process boundry).
+ await checkJSONSnapshotForRow(env, 1, OOP_FRAME_SNAPSHOT);
+ // Snapshot of an OOP frame document (not crossing process boundry).
+ await checkJSONSnapshotForRow(env, 2, OOP_FRAME_DOCUMENT_SNAPSHOT);
+ },
+ {
+ remoteIframe: true,
+ }
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js b/devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js
new file mode 100644
index 0000000000..5f9b5e6eb5
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js
@@ -0,0 +1,169 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1>Top level header</h1>
+ <p>This is a paragraph.</p>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility tree and sidebar states.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 2,
+ indexInParent: 0,
+ states: [
+ // The focused state is an outdated state, since the toolbox should now
+ // have the focus and not the content page. See Bug 1702709.
+ "focused",
+ "readonly",
+ "focusable",
+ "opaque",
+ "enabled",
+ "sensitive",
+ ],
+ },
+ },
+ },
+ {
+ desc: "Expand first tree node.",
+ setup: ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Select second tree node.",
+ setup: ({ doc }) => selectRow(doc, 1),
+ expected: {
+ sidebar: {
+ name: "Top level header",
+ role: "heading",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 1,
+ indexInParent: 0,
+ relations: {
+ "containing document": {
+ role: "document",
+ name: "Accessibility Panel Test",
+ },
+ },
+ states: ["selectable text", "opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+ {
+ desc: "Select containing document.",
+ setup: async ({ doc, win }) => {
+ const relations = await selectProperty(doc, "/relations");
+ AccessibilityUtils.setEnv({
+ // Keyboard navigation is handled on the container level using arrow
+ // keys.
+ mustHaveAccessibleRule: false,
+ });
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ relations.querySelector(".arrow"),
+ win
+ );
+ AccessibilityUtils.resetEnv();
+ const containingDocRelation = await selectProperty(
+ doc,
+ "/relations/containing document"
+ );
+ AccessibilityUtils.setEnv({
+ // Keyboard interaction is only enabled when the row is selected and
+ // activated.
+ nonNegativeTabIndexRule: false,
+ });
+
+ const selectElementInTreeButton = containingDocRelation.querySelector(
+ ".open-accessibility-inspector"
+ );
+ ok(!!selectElementInTreeButton, "There's a button to select the element");
+ is(
+ selectElementInTreeButton.getAttribute("title"),
+ L10N.getStr("accessibility.accessible.selectElement.title"),
+ "The button has the expected title"
+ );
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ selectElementInTreeButton,
+ win
+ );
+ AccessibilityUtils.resetEnv();
+ },
+ expected: {
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 2,
+ indexInParent: 0,
+ states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+];
+
+/**
+ * Check navigation within the tree.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel relation navigation."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_reload.js b/devtools/client/accessibility/test/browser/browser_accessibility_reload.js
new file mode 100644
index 0000000000..c4ffdf30dd
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_reload.js
@@ -0,0 +1,107 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI_1 = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1>Top level header</h1>
+ <p>This is a paragraph.</p>
+ </body>
+</html>`;
+
+const TEST_URI_2 = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Navigation Accessibility Panel</title>
+ </head>
+ <body></body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility tree state after first row is expanded.",
+ setup: async ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ },
+ },
+ },
+ {
+ desc: "Reload the page.",
+ setup: async ({ panel }) => {
+ const onReloaded = panel.once("reloaded");
+ panel.accessibilityProxy.commands.targetCommand.reloadTopLevelTarget();
+ await onReloaded;
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ },
+ },
+ },
+ {
+ desc: "Navigate to a new page.",
+ setup: async () => {
+ // `navigate` waits for the "reloaded" event so we don't need to do it explicitly here
+ await navigateTo(buildURL(TEST_URI_2));
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Navigation Accessibility Panel"`,
+ },
+ ],
+ sidebar: {
+ name: "Navigation Accessibility Panel",
+ role: "document",
+ },
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree on reload.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI_1,
+ "Test Accessibility panel tree on reload."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js
new file mode 100644
index 0000000000..e7c2795ced
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js
@@ -0,0 +1,81 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body></body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility sidebar state.",
+ expected: {
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 0,
+ indexInParent: 0,
+ states: [
+ // The focused state is an outdated state, since the toolbox should now
+ // have the focus and not the content page. See Bug 1702709.
+ "focused",
+ "readonly",
+ "focusable",
+ "opaque",
+ "enabled",
+ "sensitive",
+ ],
+ },
+ },
+ },
+ {
+ desc: "Mark document as disabled for accessibility.",
+ setup: async ({ browser }) =>
+ SpecialPowers.spawn(browser, [], () =>
+ content.document.body.setAttribute("aria-disabled", true)
+ ),
+ expected: {
+ sidebar: {
+ states: ["unavailable", "readonly", "focusable", "opaque"],
+ },
+ },
+ },
+ {
+ desc: "Append a new child to the document.",
+ setup: async ({ browser }) =>
+ SpecialPowers.spawn(browser, [], () => {
+ const doc = content.document;
+ const button = doc.createElement("button");
+ button.textContent = "Press Me!";
+ doc.body.appendChild(button);
+ }),
+ expected: {
+ sidebar: {
+ childCount: 1,
+ },
+ },
+ },
+];
+
+/**
+ * Test that checks the Accessibility panel sidebar.
+ */
+addA11yPanelTestsTask(tests, TEST_URI, "Test Accessibility panel sidebar.");
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js
new file mode 100644
index 0000000000..304d562189
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js
@@ -0,0 +1,80 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <p style="color: red;">Red</p>
+ <p style="color: blue;">Blue</p>
+ <p style="color: gray; background: linear-gradient(#e66465, #9198e5);">Gray</p>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility audit state.",
+ expected: {
+ audit: { CONTRAST: null },
+ },
+ },
+ {
+ desc: "Check accessible representing text node in red.",
+ setup: async ({ doc }) => {
+ await toggleRow(doc, 0);
+ await toggleRow(doc, 1);
+ await selectRow(doc, 2);
+ },
+ expected: {
+ audit: {
+ CONTRAST: {
+ value: 4.0,
+ color: [255, 0, 0, 1],
+ backgroundColor: [255, 255, 255, 1],
+ isLargeText: false,
+ score: SCORES.FAIL,
+ },
+ },
+ },
+ },
+ {
+ desc: "Check accessible representing text node in blue.",
+ setup: async ({ doc }) => {
+ await toggleRow(doc, 3);
+ await selectRow(doc, 4);
+ },
+ expected: {
+ audit: {
+ CONTRAST: {
+ value: 8.59,
+ color: [0, 0, 255, 1],
+ backgroundColor: [255, 255, 255, 1],
+ isLargeText: false,
+ score: SCORES.AAA,
+ },
+ },
+ },
+ },
+];
+
+/**
+ * Test that checks the Accessibility panel sidebar.
+ */
+addA11yPanelTestsTask(tests, TEST_URI, "Test Accessibility panel sidebar.");
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js
new file mode 100644
index 0000000000..075354b0c3
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js
@@ -0,0 +1,111 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ L10N,
+} = require("resource://devtools/client/accessibility/utils/l10n.js");
+
+// Check that DOM nodes in the sidebar can be highlighted and that clicking on the icon
+// next to them opens the inspector.
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Sidebar DOM Nodes Test</title>
+ </head>
+ <body>
+ <h1 id="select-me">Hello</h1>
+ </body>
+</html>`;
+
+/**
+ * Test that checks the Accessibility panel sidebar.
+ */
+addA11YPanelTask(
+ "Check behavior of DOM nodes in side panel",
+ TEST_URI,
+ async ({ toolbox, doc }) => {
+ info("Select an item having an actual associated DOM node");
+ await toggleRow(doc, 0);
+ selectRow(doc, 1);
+
+ await BrowserTestUtils.waitForCondition(
+ () => getPropertyValue(doc, "name") === `"Hello"`,
+ "Wait until the sidebar is updated"
+ );
+
+ info("Check DOMNode");
+ const domNodeEl = getPropertyItem(doc, "DOMNode");
+ ok(domNodeEl, "The DOMNode item was retrieved");
+
+ const openInspectorButton = domNodeEl.querySelector(".open-inspector");
+ ok(openInspectorButton, "The open inspector button is displayed");
+ is(
+ openInspectorButton.getAttribute("title"),
+ L10N.getStr("accessibility.accessible.selectNodeInInspector.title"),
+ "The open inspector button has expected title"
+ );
+
+ info("Check that hovering DOMNode triggers the highlight");
+ // Loading the inspector panel at first, to make it possible to listen for
+ // new node selections
+ await toolbox.loadTool("inspector");
+ const highlighter = toolbox.getHighlighter();
+ const highlighterTestFront = await getHighlighterTestFront(toolbox);
+
+ const onHighlighterShown = highlighter.waitForHighlighterShown();
+
+ EventUtils.synthesizeMouseAtCenter(
+ openInspectorButton,
+ { type: "mousemove" },
+ doc.defaultView
+ );
+
+ const { nodeFront } = await onHighlighterShown;
+ is(nodeFront.displayName, "h1", "The correct node was highlighted");
+ isVisible = await highlighterTestFront.isHighlighting();
+ ok(isVisible, "Highlighter is displayed");
+
+ info("Unhighlight the node by moving away from the node");
+ const onHighlighterHidden = highlighter.waitForHighlighterHidden();
+ EventUtils.synthesizeMouseAtCenter(
+ getPropertyItem(doc, "name"),
+ { type: "mousemove" },
+ doc.defaultView
+ );
+
+ await onHighlighterHidden;
+ ok(true, "The highlighter was closed when moving away from the node");
+
+ info(
+ "Clicking on the inspector icon and waiting for the inspector to be selected"
+ );
+ const onNewNode = toolbox.selection.once("new-node-front");
+ openInspectorButton.click();
+ const inspectorSelectedNodeFront = await onNewNode;
+
+ ok(true, "Inspector selected and new node got selected");
+ is(
+ inspectorSelectedNodeFront.id,
+ "select-me",
+ "The expected node was selected"
+ );
+ }
+);
+
+function getPropertyItem(doc, label) {
+ const labelEl = Array.from(
+ doc.querySelectorAll("#accessibility-properties .object-label")
+ ).find(el => el.textContent === label);
+ if (!labelEl) {
+ return null;
+ }
+ return labelEl.closest(".node");
+}
+
+function getPropertyValue(doc, label) {
+ return getPropertyItem(doc, label)?.querySelector(".object-value")
+ ?.textContent;
+}
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_simulation.js b/devtools/client/accessibility/test/browser/browser_accessibility_simulation.js
new file mode 100644
index 0000000000..85a9be6b36
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_simulation.js
@@ -0,0 +1,99 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global openSimulationMenu, toggleSimulationOption */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Simulations Test</title>
+ </head>
+ <body>
+ <h1 style="color:blue; background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ <h2 style="color:green; background-color:rgba(255,255,255,1);">
+ Second level header
+ </h2>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the simulation components can be checked.
+ * expected {JSON} An expected states for the simulation components.
+ * }
+ */
+const tests = [
+ {
+ desc: "Check that the menu button is inactivate and the menu is closed initially.",
+ expected: {
+ simulation: {
+ buttonActive: false,
+ },
+ },
+ },
+ {
+ desc: "Clicking the menu button shows the menu with No Simulation selected.",
+ setup: async ({ doc }) => {
+ await openSimulationMenu(doc);
+ },
+ expected: {
+ simulation: {
+ buttonActive: false,
+ checkedOptionIndices: [0],
+ },
+ },
+ },
+ {
+ desc: "Selecting an option renders the menu button active and closes the menu.",
+ setup: async ({ doc }) => {
+ await toggleSimulationOption(doc, 2);
+ },
+ expected: {
+ simulation: {
+ buttonActive: true,
+ checkedOptionIndices: [2],
+ },
+ },
+ },
+ {
+ desc: "Reopening the menu preserves the previously selected option.",
+ setup: async ({ doc }) => {
+ await openSimulationMenu(doc);
+ },
+ expected: {
+ simulation: {
+ buttonActive: true,
+ checkedOptionIndices: [2],
+ },
+ },
+ },
+ {
+ desc: "Unselecting the option renders the button inactive and closes the menu.",
+ setup: async ({ doc }) => {
+ await toggleSimulationOption(doc, 2);
+ },
+ expected: {
+ simulation: {
+ buttonActive: false,
+ checkedOptionIndices: [0],
+ },
+ },
+ },
+];
+
+/**
+ * Test that checks state of simulation button and menu when
+ * options are selected/unselected with web render enabled.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test selecting and unselecting simulation options updates UI."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js
new file mode 100644
index 0000000000..ed872f46e0
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js
@@ -0,0 +1,140 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Check "Show tabbing order" works as expected
+
+const TEST_URI = `https://example.com/document-builder.sjs?html=
+ <button id=top-btn-1>Top level button before iframe</button>
+ <iframe src="https://example.org/document-builder.sjs?html=${encodeURIComponent(`
+ <button id=iframe-org-btn-1>in iframe button 1</button>
+ <button id=iframe-org-btn-2>in iframe button 2</button>
+ `)}"></iframe>
+ <button id=top-btn-2>Top level button after iframe</button>
+ <iframe src="https://example.net/document-builder.sjs?html=${encodeURIComponent(`
+ <button id=iframe-net-btn-1>in iframe button 1</button>
+ `)}"></iframe>`;
+
+add_task(async () => {
+ const { doc, store, tab, toolbox } = await addTestTab(TEST_URI);
+
+ const topLevelFrameHighlighterTestFront = await toolbox.target.getFront(
+ "highlighterTest"
+ );
+
+ const frameTargets = toolbox.commands.targetCommand.getAllTargets([
+ toolbox.commands.targetCommand.TYPES.FRAME,
+ ]);
+ const orgIframeTarget = frameTargets.find(t =>
+ t.url.startsWith("https://example.org")
+ );
+ const netIframeTarget = frameTargets.find(t =>
+ t.url.startsWith("https://example.net")
+ );
+
+ // The iframe only has a dedicated target when Fission or EFT is enabled
+ const orgIframeHighlighterTestFront = orgIframeTarget
+ ? await orgIframeTarget.getFront("highlighterTest")
+ : null;
+ const netIframeHighlighterTestFront = netIframeTarget
+ ? await netIframeTarget.getFront("highlighterTest")
+ : null;
+
+ let tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData();
+ is(
+ tabbingOrderHighlighterData.length,
+ 0,
+ "Tabbing order is not visible at first"
+ );
+
+ info(`Click on "Show Tabbing Order" checkbox`);
+ const tabbingOrderCheckbox = doc.getElementById(
+ "devtools-display-tabbing-order-checkbox"
+ );
+ tabbingOrderCheckbox.click();
+
+ await waitUntilState(store, state => state.ui.tabbingOrderDisplayed === true);
+
+ is(tabbingOrderCheckbox.checked, true, "Checkbox is checked");
+ tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData();
+ if (isFissionEnabled()) {
+ // ⚠️ We don't get the highlighter for the <html> node of the iframe when Fission is enabled.
+ // This should be fix as part of Bug 1740509.
+ is(
+ JSON.stringify(tabbingOrderHighlighterData),
+ JSON.stringify([`button#top-btn-1 : 1`, `button#top-btn-2 : 4`]),
+ "Tabbing order is visible for the top level target after clicking the checkbox"
+ );
+
+ const orgIframeTabingOrderHighlighterData =
+ await orgIframeHighlighterTestFront.getTabbingOrderHighlighterData();
+ is(
+ JSON.stringify(orgIframeTabingOrderHighlighterData),
+ JSON.stringify([
+ `button#iframe-org-btn-1 : 2`,
+ `button#iframe-org-btn-2 : 3`,
+ ]),
+ "Tabbing order is visible for the org iframe after clicking the checkbox"
+ );
+
+ const netIframeTabingOrderHighlighterData =
+ await netIframeHighlighterTestFront.getTabbingOrderHighlighterData();
+ is(
+ JSON.stringify(netIframeTabingOrderHighlighterData),
+ JSON.stringify([`button#iframe-net-btn-1 : 5`]),
+ "Tabbing order is visible for the net iframe after clicking the checkbox"
+ );
+ } else {
+ is(
+ JSON.stringify(tabbingOrderHighlighterData),
+ JSON.stringify([
+ `button#top-btn-1 : 1`,
+ `html : 2`,
+ `button#iframe-org-btn-1 : 3`,
+ `button#iframe-org-btn-2 : 4`,
+ `button#top-btn-2 : 5`,
+ `html : 6`,
+ `button#iframe-net-btn-1 : 7`,
+ ]),
+ "Tabbing order is visible for the top level target after clicking the checkbox"
+ );
+ }
+
+ info(`Clicking on the checkbox again hides the highlighter`);
+ tabbingOrderCheckbox.click();
+ await waitUntilState(
+ store,
+ state => state.ui.tabbingOrderDisplayed === false
+ );
+
+ is(tabbingOrderCheckbox.checked, false, "Checkbox is unchecked");
+ tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData();
+ is(
+ tabbingOrderHighlighterData.length,
+ 0,
+ "Tabbing order is not visible anymore after unchecking the checkbox"
+ );
+
+ if (isFissionEnabled()) {
+ const orgIframeTabingOrderHighlighterData =
+ await orgIframeHighlighterTestFront.getTabbingOrderHighlighterData();
+ is(
+ orgIframeTabingOrderHighlighterData.length,
+ 0,
+ "Tabbing order is also hidden on the org iframe target"
+ );
+ const netIframeTabingOrderHighlighterData =
+ await netIframeHighlighterTestFront.getTabbingOrderHighlighterData();
+ is(
+ netIframeTabingOrderHighlighterData.length,
+ 0,
+ "Tabbing order is also hidden on the net iframe target"
+ );
+ }
+
+ await closeTabToolboxAccessibility(tab);
+});
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js
new file mode 100644
index 0000000000..788813d343
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js
@@ -0,0 +1,195 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Check "Show tabbing order" works as expected when used with the iframe picker
+
+const TEST_URI = `https://example.com/document-builder.sjs?html=
+ <button id=top-btn-1>Top level button before iframe</button>
+ <iframe src="https://example.org/document-builder.sjs?html=${encodeURIComponent(`
+ <button id=iframe-btn-1>in iframe button 1</button>
+ <button id=iframe-btn-2>in iframe button 2</button>
+ `)}"></iframe>
+ <button id=top-btn-2>Top level button after iframe</button>`;
+
+add_task(async () => {
+ const env = await addTestTab(TEST_URI);
+ const { doc, panel, store, toolbox, win } = env;
+
+ const topLevelFrameHighlighterTestFront = await toolbox.target.getFront(
+ "highlighterTest"
+ );
+
+ const iframeTarget = toolbox.commands.targetCommand
+ .getAllTargets([toolbox.commands.targetCommand.TYPES.FRAME])
+ .find(t => t.url.startsWith("https://example.org"));
+
+ // The iframe only has a dedicated target when Fission or EFT is enabled
+ const iframeHighlighterTestFront = iframeTarget
+ ? await iframeTarget.getFront("highlighterTest")
+ : null;
+
+ const topLevelAccessibilityFrontActorID =
+ panel.accessibilityProxy.accessibilityFront.actorID;
+
+ const iframeAccessibilityFrontActorID = iframeTarget
+ ? (await iframeTarget.getFront("accessibility")).actorID
+ : null;
+
+ info(`Click on "Show Tabbing Order" checkbox`);
+ const tabbingOrderCheckbox = doc.getElementById(
+ "devtools-display-tabbing-order-checkbox"
+ );
+ tabbingOrderCheckbox.click();
+ await waitUntilState(store, state => state.ui.tabbingOrderDisplayed === true);
+
+ is(tabbingOrderCheckbox.checked, true, "Checkbox is checked");
+ let tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(
+ topLevelAccessibilityFrontActorID
+ );
+ if (isFissionEnabled()) {
+ // ⚠️ We don't get the highlighter for the <html> node of the iframe when Fission is enabled.
+ // This should be fix as part of Bug 1740509.
+ is(
+ JSON.stringify(tabbingOrderHighlighterData),
+ JSON.stringify([`button#top-btn-1 : 1`, `button#top-btn-2 : 4`]),
+ "Tabbing order is visible for the top level target after clicking the checkbox"
+ );
+
+ const iframeTabingOrderHighlighterData =
+ await iframeHighlighterTestFront.getTabbingOrderHighlighterData(
+ iframeAccessibilityFrontActorID
+ );
+
+ is(
+ JSON.stringify(iframeTabingOrderHighlighterData),
+ JSON.stringify([`button#iframe-btn-1 : 2`, `button#iframe-btn-2 : 3`]),
+ "Tabbing order is visible for the top level target after clicking the checkbox"
+ );
+ } else {
+ is(
+ JSON.stringify(tabbingOrderHighlighterData),
+ JSON.stringify([
+ `button#top-btn-1 : 1`,
+ `html : 2`,
+ `button#iframe-btn-1 : 3`,
+ `button#iframe-btn-2 : 4`,
+ `button#top-btn-2 : 5`,
+ ]),
+ "Tabbing order is visible for the top level target after clicking the checkbox"
+ );
+ }
+
+ info("Select the iframe in the iframe picker");
+ // Get the iframe picker items
+ const menuList = toolbox.doc.getElementById("toolbox-frame-menu");
+
+ if (isFissionEnabled() && !isEveryFrameTargetEnabled()) {
+ is(
+ menuList,
+ null,
+ "iframe picker does not show remote frames when Fission is enabled and EFT is disabled"
+ );
+ return;
+ }
+
+ const frames = Array.from(menuList.querySelectorAll(".command"));
+
+ let onInitialized = win.once(win.EVENTS.INITIALIZED);
+ frames[1].click();
+ await onInitialized;
+ await waitUntilState(
+ store,
+ state => state.ui.tabbingOrderDisplayed === false
+ );
+
+ is(
+ tabbingOrderCheckbox.checked,
+ false,
+ "Checkbox is unchecked after selecting an iframe"
+ );
+
+ tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(
+ topLevelAccessibilityFrontActorID
+ );
+ is(
+ tabbingOrderHighlighterData.length,
+ 0,
+ "Tabbing order is not visible anymore"
+ );
+
+ info(
+ `Click on "Show Tabbing Order" checkbox and check that highlighter is only displayed for selected frame`
+ );
+ tabbingOrderCheckbox.click();
+ await waitUntilState(store, state => state.ui.tabbingOrderDisplayed === true);
+
+ tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(
+ topLevelAccessibilityFrontActorID
+ );
+ if (isFissionEnabled() || isEveryFrameTargetEnabled()) {
+ is(
+ tabbingOrderHighlighterData.length,
+ 0,
+ "There's no highlighter displayed on the top level target when focused on specific iframe"
+ );
+
+ const iframeTabingOrderHighlighterData =
+ await iframeHighlighterTestFront.getTabbingOrderHighlighterData(
+ iframeAccessibilityFrontActorID
+ );
+
+ is(
+ JSON.stringify(iframeTabingOrderHighlighterData),
+ JSON.stringify([`button#iframe-btn-1 : 1`, `button#iframe-btn-2 : 2`]),
+ "Tabbing order has expected data when a specific iframe is selected"
+ );
+ } else {
+ // When Fission/EFT are not enabled, the highlighter is displayed from the top-level
+ // target, but only for the iframe
+ is(
+ JSON.stringify(tabbingOrderHighlighterData),
+ JSON.stringify([`button#iframe-btn-1 : 1`, `button#iframe-btn-2 : 2`]),
+ "Tabbing order has expected data when a specific iframe is selected"
+ );
+ }
+
+ info("Select the top level document back");
+ onInitialized = win.once(win.EVENTS.INITIALIZED);
+ toolbox.doc.querySelector("#toolbox-frame-menu .command").click();
+ await onInitialized;
+
+ is(
+ tabbingOrderCheckbox.checked,
+ false,
+ "Checkbox is unchecked after selecting the top level frame"
+ );
+ await waitUntilState(
+ store,
+ state => state.ui.tabbingOrderDisplayed === false
+ );
+
+ tabbingOrderHighlighterData =
+ await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(
+ topLevelAccessibilityFrontActorID
+ );
+
+ if (isFissionEnabled() || isEveryFrameTargetEnabled()) {
+ const iframeTabingOrderHighlighterData =
+ await iframeHighlighterTestFront.getTabbingOrderHighlighterData(
+ iframeAccessibilityFrontActorID
+ );
+
+ is(
+ iframeTabingOrderHighlighterData.length,
+ 0,
+ "Highlighter is hidden on the frame after selecting back the top level target"
+ );
+ }
+
+ await closeTabToolboxAccessibility(env.tab);
+});
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree.js
new file mode 100644
index 0000000000..d1be57ee2d
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree.js
@@ -0,0 +1,75 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1>Top level header</h1>
+ <p>This is a paragraph.</p>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility tree state.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Expand first tree node.",
+ setup: async ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Collapse first tree node.",
+ setup: async ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree.
+ */
+addA11yPanelTestsTask(tests, TEST_URI, "Test Accessibility panel tree.");
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js
new file mode 100644
index 0000000000..b321fafba2
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js
@@ -0,0 +1,137 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleRow, toggleMenuItem, TREE_FILTERS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ <h2 style="color:rgba(0,255,0,0.1); background-color:rgba(255,255,255,1);">
+ Second level header
+ </h2>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Expand first and second tree nodes.",
+ setup: async ({ doc }) => {
+ await toggleRow(doc, 0);
+ await toggleRow(doc, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ level: 1,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ level: 2,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ level: 3,
+ },
+ {
+ role: "heading",
+ name: `"Second level header"`,
+ level: 2,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Click on the all filter.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ level: 1,
+ },
+ {
+ role: "text leaf",
+ name: `"Second level header "contrast`,
+ badges: ["contrast"],
+ selected: true,
+ level: 1,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Click on the all filter again.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ level: 1,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ level: 2,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ level: 3,
+ },
+ {
+ role: "heading",
+ name: `"Second level header"`,
+ level: 2,
+ },
+ {
+ role: "text leaf",
+ name: `"Second level header "contrast`,
+ badges: ["contrast"],
+ selected: true,
+ level: 3,
+ },
+ ],
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree when one of
+ * the tree rows has a "contrast" badge and auditing is activated via toolbar
+ * filter.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree with contrast badge present."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js
new file mode 100644
index 0000000000..a8e295c504
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js
@@ -0,0 +1,104 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, TREE_FILTERS_MENU_ID */
+
+const header =
+ '<h1 style="color:rgba(255,0,0,0.1); ' +
+ 'background-color:rgba(255,255,255,1);">header</h1>';
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ ${header.repeat(20)}
+ </body>
+</html>`;
+
+const docRow = {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+};
+const headingRow = {
+ role: "heading",
+ name: `"header"`,
+};
+const textLeafRow = {
+ role: "text leaf",
+ name: `"header"contrast`,
+ badges: ["contrast"],
+};
+const audit = new Array(20).fill(textLeafRow);
+
+const auditInitial = audit.map(check => ({ ...check }));
+auditInitial[0].selected = true;
+
+const auditSecondLastSelected = audit.map(check => ({ ...check }));
+auditSecondLastSelected[19].selected = true;
+
+const resetAfterAudit = [docRow];
+for (let i = 0; i < 20; i++) {
+ resetAfterAudit.push(headingRow);
+ resetAfterAudit.push({ ...textLeafRow, selected: i === 19 });
+}
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Check initial state.",
+ expected: {
+ tree: [{ ...docRow, selected: true }],
+ },
+ },
+ {
+ desc: "Run an audit from a11y panel toolbar by activating a filter.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: auditInitial,
+ },
+ },
+ {
+ desc: "Select a row that is guaranteed to have to be scrolled into view.",
+ setup: async ({ doc }) => {
+ selectRow(doc, 0);
+ EventUtils.synthesizeKey("VK_END", {}, doc.defaultView);
+ },
+ expected: {
+ tree: auditSecondLastSelected,
+ },
+ },
+ {
+ desc: "Click on the filter again.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: resetAfterAudit,
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree when the
+ * audit is activated via the panel's toolbar and the selection persists when
+ * the filter is toggled off.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree with persistent selected row."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js
new file mode 100644
index 0000000000..084a46dc89
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js
@@ -0,0 +1,109 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, selectAccessibleForNode, TREE_FILTERS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ <h2 style="color:rgba(0,255,0,0.1); background-color:rgba(255,255,255,1);">
+ Second level header
+ </h2>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Check initial state.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ selected: true,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Run an audit from a11y panel toolbar by activating a filter.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ selected: true,
+ },
+ {
+ role: "text leaf",
+ name: `"Second level header "contrast`,
+ badges: ["contrast"],
+ },
+ ],
+ },
+ },
+ {
+ desc: "Select an accessible object.",
+ setup: async env => {
+ await selectAccessibleForNode(env, "h1");
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ selected: true,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ },
+ {
+ role: "heading",
+ name: `"Second level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Second level header "contrast`,
+ badges: ["contrast"],
+ },
+ ],
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree when the
+ * audit is activated via the panel's toolbar.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree with contrast filter audit activation."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js
new file mode 100644
index 0000000000..9a1b9ba4c7
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js
@@ -0,0 +1,112 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global toggleMenuItem, TREE_FILTERS_MENU_ID */
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ <h2 style="color:rgba(0,255,0,0.1); background-color:rgba(255,255,255,1);">
+ Second level header
+ </h2>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Check initial state.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ selected: true,
+ },
+ ],
+ activeToolbarFilters: [true, false, false, false, false],
+ },
+ },
+ {
+ desc: "Run an audit (all) from a11y panel toolbar by activating a filter.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ selected: true,
+ },
+ {
+ role: "text leaf",
+ name: `"Second level header "contrast`,
+ badges: ["contrast"],
+ },
+ ],
+ activeToolbarFilters: [false, true, true, true, true],
+ },
+ },
+ {
+ desc: "Click on the filter again.",
+ setup: async ({ doc, toolbox }) => {
+ await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ selected: true,
+ },
+ {
+ role: "heading",
+ name: `"Second level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Second level header "contrast`,
+ badges: ["contrast"],
+ },
+ ],
+ activeToolbarFilters: [true, false, false, false, false],
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree when the
+ * audit is activated via the panel's toolbar.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree with 'all' filter audit activation."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js
new file mode 100644
index 0000000000..2abfabd324
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);">
+ Top level header
+ </h1>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Expand first and second tree nodes.",
+ setup: async ({ doc }) => {
+ await toggleRow(doc, 0);
+ await toggleRow(doc, 1);
+ },
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header "contrast`,
+ badges: ["contrast"],
+ },
+ ],
+ },
+ },
+];
+
+/**
+ * Simple test that checks content of the Accessibility panel tree when one of
+ * the tree rows has a "contrast" badge.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree with contrast badge."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js
new file mode 100644
index 0000000000..dc146a32d5
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js
@@ -0,0 +1,121 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Check that the accessibility panel works as expected when using the iframe picker
+
+const TEST_URI = `data:text/html,<meta charset=utf8>
+ <head>
+ <title>TopLevel</title>
+ <style>h1 { color: lightgrey; }</style>
+ </head>
+ <body>
+ <h1>Top level header</h1>
+ <p>This is a paragraph.</p>
+ <iframe src="data:text/html,<meta charset=utf8>
+ <head>
+ <title>iframe</title>
+ <style>h2 { color: aliceblue }</style>
+ </head>
+ <body>
+ <h2>Iframe header</h2>
+
+ <iframe src='data:text/html,<meta charset=utf8>
+ <head>
+ <title>nested iframe</title>
+ <style>h2 { color: lightpink }</style>
+ </head>
+ <body>
+ <h2>Nested Iframe header</h2>
+ </body>
+ '></iframe>
+
+ </body>
+ "></iframe>`;
+
+add_task(async () => {
+ const env = await addTestTab(TEST_URI);
+ const { doc, toolbox, win } = env;
+
+ await checkTree(env, [
+ {
+ role: "document",
+ name: `"TopLevel"`,
+ },
+ ]);
+
+ info("Select the iframe in the iframe picker");
+ // Get the iframe picker items
+ const menuList = toolbox.doc.getElementById("toolbox-frame-menu");
+ const frames = Array.from(menuList.querySelectorAll(".command"));
+
+ let onInitialized = win.once(win.EVENTS.INITIALIZED);
+ frames[1].click();
+ await onInitialized;
+
+ await checkTree(env, [
+ {
+ role: "document",
+ name: `"iframe"`,
+ },
+ ]);
+
+ info(
+ "Run a constrast audit to check only issues from selected iframe tree are displayed"
+ );
+ const CONTRAST_MENU_ITEM_INDEX = 2;
+ const onUpdated = win.once(win.EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED);
+ await toggleMenuItem(
+ doc,
+ toolbox.doc,
+ TREE_FILTERS_MENU_ID,
+ CONTRAST_MENU_ITEM_INDEX
+ );
+ await onUpdated;
+ // wait until the tree is filtered (i.e. the audit is done and only nodes with issues
+ // should be displayed)
+ await waitFor(() => doc.querySelector(".treeTable.filtered"));
+
+ await checkTree(env, [
+ {
+ role: "text leaf",
+ name: `"Iframe header"contrast`,
+ badges: ["contrast"],
+ level: 1,
+ },
+ {
+ role: "text leaf",
+ name: `"Nested Iframe header"contrast`,
+ badges: ["contrast"],
+ level: 1,
+ },
+ ]);
+
+ info("Select the top level document back");
+ onInitialized = win.once(win.EVENTS.INITIALIZED);
+ frames[0].click();
+ await onInitialized;
+
+ await checkTree(env, [
+ {
+ role: "document",
+ name: `"TopLevel"`,
+ },
+ ]);
+
+ await closeTabToolboxAccessibility(env.tab);
+});
+
+function checkTree(env, tree) {
+ return runA11yPanelTests(
+ [
+ {
+ expected: {
+ tree,
+ },
+ },
+ ],
+ env
+ );
+}
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js
new file mode 100644
index 0000000000..d98c3d8e35
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js
@@ -0,0 +1,186 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test</title>
+ </head>
+ <body>
+ <h1>Top level header</h1>
+ <p>This is a paragraph.</p>
+ </body>
+</html>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility tree and sidebar states.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 2,
+ indexInParent: 0,
+ states: [
+ // The focused state is an outdated state, since the toolbox should now
+ // have the focus and not the content page. See Bug 1702709.
+ "focused",
+ "readonly",
+ "focusable",
+ "opaque",
+ "enabled",
+ "sensitive",
+ ],
+ },
+ },
+ },
+ {
+ desc: "Expand first tree node.",
+ setup: async ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Expand second tree node.",
+ setup: async ({ doc }) => toggleRow(doc, 1),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ sidebar: {
+ name: "Top level header",
+ role: "heading",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 1,
+ indexInParent: 0,
+ states: ["selectable text", "opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+ {
+ desc: "Select third tree node.",
+ setup: ({ doc }) => selectRow(doc, 2),
+ expected: {
+ sidebar: {
+ name: "Top level header",
+ role: "text leaf",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 0,
+ indexInParent: 0,
+ states: ["opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+ {
+ desc: "Collapse first tree node.",
+ setup: async ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 2,
+ indexInParent: 0,
+ states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+ {
+ desc: "Expand first tree node again.",
+ setup: async ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `"Accessibility Panel Test"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "text leaf",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ },
+ },
+];
+
+/**
+ * Check navigation within the tree.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree navigation."
+);
diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js
new file mode 100644
index 0000000000..dc710c82e4
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js
@@ -0,0 +1,149 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_URI = `<h1>Top level header</h1><p>This is a paragraph.</p>`;
+
+/**
+ * Test data has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be performed before
+ * the state of the tree and the sidebar can be checked.
+ * expected {JSON} An expected states for the tree and the sidebar.
+ * }
+ */
+const tests = [
+ {
+ desc: "Test the initial accessibility tree and sidebar states.",
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ },
+ ],
+ sidebar: {
+ name: "",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 1,
+ indexInParent: 0,
+ states: [
+ // The focused state is an outdated state, since the toolbox should now
+ // have the focus and not the content page. See Bug 1702709.
+ "focused",
+ "readonly",
+ "focusable",
+ "opaque",
+ "enabled",
+ "sensitive",
+ ],
+ },
+ },
+ },
+ {
+ desc: "Expand first tree node.",
+ setup: ({ doc }) => toggleRow(doc, 0),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ },
+ {
+ role: "internal frame",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ ],
+ },
+ },
+ {
+ desc: "Expand second tree node. Display OOP document.",
+ setup: ({ doc }) => toggleRow(doc, 1),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ },
+ {
+ role: "internal frame",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ {
+ role: "document",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test (OOP)",
+ role: "internal frame",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 1,
+ indexInParent: 0,
+ states: ["focusable", "opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+ {
+ desc: "Expand third tree node. Display OOP frame content.",
+ setup: ({ doc }) => toggleRow(doc, 2),
+ expected: {
+ tree: [
+ {
+ role: "document",
+ name: `""text label`,
+ badges: ["text label"],
+ },
+ {
+ role: "internal frame",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ {
+ role: "document",
+ name: `"Accessibility Panel Test (OOP)"`,
+ },
+ {
+ role: "heading",
+ name: `"Top level header"`,
+ },
+ {
+ role: "paragraph",
+ name: `""`,
+ },
+ ],
+ sidebar: {
+ name: "Accessibility Panel Test (OOP)",
+ role: "document",
+ actions: [],
+ value: "",
+ description: "",
+ keyboardShortcut: "",
+ childCount: 2,
+ indexInParent: 0,
+ states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
+ },
+ },
+ },
+];
+
+/**
+ * Check navigation within the tree.
+ */
+addA11yPanelTestsTask(
+ tests,
+ TEST_URI,
+ "Test Accessibility panel tree navigation with OOP frame.",
+ { remoteIframe: true }
+);
diff --git a/devtools/client/accessibility/test/browser/head.js b/devtools/client/accessibility/test/browser/head.js
new file mode 100644
index 0000000000..1a94c723e0
--- /dev/null
+++ b/devtools/client/accessibility/test/browser/head.js
@@ -0,0 +1,823 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* global waitUntilState, gBrowser */
+/* exported addTestTab, checkTreeState, checkSidebarState, checkAuditState, selectRow,
+ toggleRow, toggleMenuItem, addA11yPanelTestsTask, navigate,
+ openSimulationMenu, toggleSimulationOption, TREE_FILTERS_MENU_ID,
+ PREFS_MENU_ID */
+
+"use strict";
+
+// Import framework's shared head.
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js",
+ this
+);
+
+// Import inspector's shared head.
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js",
+ this
+);
+
+const {
+ ORDERED_PROPS,
+ PREF_KEYS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+// Enable the Accessibility panel
+Services.prefs.setBoolPref("devtools.accessibility.enabled", true);
+
+const SIMULATION_MENU_BUTTON_ID = "#simulation-menu-button";
+const TREE_FILTERS_MENU_ID = "accessibility-tree-filters-menu";
+const PREFS_MENU_ID = "accessibility-tree-filters-prefs-menu";
+
+const MENU_INDEXES = {
+ [TREE_FILTERS_MENU_ID]: 0,
+ [PREFS_MENU_ID]: 1,
+};
+
+/**
+ * Wait for accessibility service to shut down. We consider it shut down when
+ * an "a11y-init-or-shutdown" event is received with a value of "0".
+ */
+function waitForAccessibilityShutdown() {
+ return new Promise(resolve => {
+ if (!Services.appinfo.accessibilityEnabled) {
+ resolve();
+ return;
+ }
+
+ const observe = (subject, topic, data) => {
+ if (data === "0") {
+ Services.obs.removeObserver(observe, "a11y-init-or-shutdown");
+ // Sanity check
+ ok(
+ !Services.appinfo.accessibilityEnabled,
+ "Accessibility disabled in this process"
+ );
+ resolve();
+ }
+ };
+ // This event is coming from Gecko accessibility module when the
+ // accessibility service is shutdown or initialzied. We attempt to shutdown
+ // accessibility service naturally if there are no more XPCOM references to
+ // a11y related objects (after GC/CC).
+ Services.obs.addObserver(observe, "a11y-init-or-shutdown");
+
+ // Force garbage collection.
+ SpecialPowers.gc();
+ SpecialPowers.forceShrinkingGC();
+ SpecialPowers.forceCC();
+ });
+}
+
+/**
+ * Ensure that accessibility is completely shutdown.
+ */
+async function shutdownAccessibility(browser) {
+ await waitForAccessibilityShutdown();
+ await SpecialPowers.spawn(browser, [], waitForAccessibilityShutdown);
+}
+
+registerCleanupFunction(async () => {
+ info("Cleaning up...");
+ Services.prefs.clearUserPref("devtools.accessibility.enabled");
+});
+
+const EXPANDABLE_PROPS = ["actions", "states", "attributes"];
+
+/**
+ * Add a new test tab in the browser and load the given url.
+ * @param {String} url
+ * The url to be loaded in the new tab
+ * @return a promise that resolves to the tab object when
+ * the url is loaded
+ */
+async function addTestTab(url) {
+ info("Adding a new test tab with URL: '" + url + "'");
+
+ const tab = await addTab(url);
+ const panel = await initAccessibilityPanel(tab);
+ const win = panel.panelWin;
+ const doc = win.document;
+ const store = win.view.store;
+
+ const enableButton = doc.getElementById("accessibility-enable-button");
+ // If enable button is not found, asume the tool is already enabled.
+ if (enableButton) {
+ EventUtils.sendMouseEvent({ type: "click" }, enableButton, win);
+ }
+
+ await waitUntilState(
+ store,
+ state =>
+ state.accessibles.size === 1 &&
+ state.details.accessible &&
+ state.details.accessible.role === "document"
+ );
+
+ return {
+ tab,
+ browser: tab.linkedBrowser,
+ panel,
+ win,
+ toolbox: panel._toolbox,
+ doc,
+ store,
+ };
+}
+
+/**
+ * Open the Accessibility panel for the given tab.
+ *
+ * @param {Element} tab
+ * Optional tab element for which you want open the Accessibility panel.
+ * The default tab is taken from the global variable |tab|.
+ * @return a promise that is resolved once the panel is open.
+ */
+async function initAccessibilityPanel(tab = gBrowser.selectedTab) {
+ const toolbox = await gDevTools.showToolboxForTab(tab, {
+ toolId: "accessibility",
+ });
+ return toolbox.getCurrentPanel();
+}
+
+/**
+ * Compare text within the list of potential badges rendered for accessibility
+ * tree row when its accessible object has accessibility failures.
+ * @param {DOMNode} badges
+ * Container element that contains badge elements.
+ * @param {Array|null} expected
+ * List of expected badge labels for failing accessibility checks.
+ */
+function compareBadges(badges, expected = []) {
+ const badgeEls = badges ? [...badges.querySelectorAll(".badge")] : [];
+ return (
+ badgeEls.length === expected.length &&
+ badgeEls.every((badge, i) => badge.textContent === expected[i])
+ );
+}
+
+/**
+ * Find an ancestor that is scrolled for a given DOMNode.
+ *
+ * @param {DOMNode} node
+ * DOMNode that to find an ancestor for that is scrolled.
+ */
+function closestScrolledParent(node) {
+ if (node == null) {
+ return null;
+ }
+
+ if (node.scrollHeight > node.clientHeight) {
+ return node;
+ }
+
+ return closestScrolledParent(node.parentNode);
+}
+
+/**
+ * Check if a given element is visible to the user and is not scrolled off
+ * because of the overflow.
+ *
+ * @param {Element} element
+ * Element to be checked whether it is visible and is not scrolled off.
+ *
+ * @returns {Boolean}
+ * True if the element is visible.
+ */
+function isVisible(element) {
+ const { top, bottom } = element.getBoundingClientRect();
+ const scrolledParent = closestScrolledParent(element.parentNode);
+ const scrolledParentRect = scrolledParent
+ ? scrolledParent.getBoundingClientRect()
+ : null;
+ return (
+ !scrolledParent ||
+ (top >= scrolledParentRect.top && bottom <= scrolledParentRect.bottom)
+ );
+}
+
+/**
+ * Check selected styling and visibility for a given row in the accessibility
+ * tree.
+ * @param {DOMNode} row
+ * DOMNode for a given accessibility row.
+ * @param {Boolean} expected
+ * Expected selected state.
+ *
+ * @returns {Boolean}
+ * True if visibility and styling matches expected selected state.
+ */
+function checkSelected(row, expected) {
+ if (!expected) {
+ return true;
+ }
+
+ if (row.classList.contains("selected") !== expected) {
+ return false;
+ }
+
+ return isVisible(row);
+}
+
+/**
+ * Check level for a given row in the accessibility tree.
+ * @param {DOMNode} row
+ * DOMNode for a given accessibility row.
+ * @param {Boolean} expected
+ * Expected row level (aria-level).
+ *
+ * @returns {Boolean}
+ * True if the aria-level for the row is as expected.
+ */
+function checkLevel(row, expected) {
+ if (!expected) {
+ return true;
+ }
+
+ return parseInt(row.getAttribute("aria-level"), 10) === expected;
+}
+
+/**
+ * Check the state of the accessibility tree.
+ * @param {document} doc panel documnent.
+ * @param {Array} expected an array that represents an expected row list.
+ */
+async function checkTreeState(doc, expected) {
+ info("Checking tree state.");
+ const hasExpectedStructure = await BrowserTestUtils.waitForCondition(() => {
+ const rows = [...doc.querySelectorAll(".treeRow")];
+ if (rows.length !== expected.length) {
+ return false;
+ }
+
+ return rows.every((row, i) => {
+ const { role, name, badges, selected, level } = expected[i];
+ return (
+ row.querySelector(".treeLabelCell").textContent === role &&
+ row.querySelector(".treeValueCell").textContent === name &&
+ compareBadges(row.querySelector(".badges"), badges) &&
+ checkSelected(row, selected) &&
+ checkLevel(row, level)
+ );
+ });
+ }, "Wait for the right tree update.");
+
+ ok(hasExpectedStructure, "Tree structure is correct.");
+}
+
+/**
+ * Check if relations object matches what is expected. Note: targets are matched by their
+ * name and role.
+ * @param {Object} relations Relations to test.
+ * @param {Object} expected Expected relations.
+ * @return {Boolean} True if relation types and their targers match what is
+ * expected.
+ */
+function relationsMatch(relations, expected) {
+ for (const relationType in expected) {
+ let expTargets = expected[relationType];
+ expTargets = Array.isArray(expTargets) ? expTargets : [expTargets];
+
+ let targets = relations ? relations[relationType] : [];
+ targets = Array.isArray(targets) ? targets : [targets];
+
+ for (const index in expTargets) {
+ if (!targets[index]) {
+ return false;
+ }
+ if (
+ expTargets[index].name !== targets[index].name ||
+ expTargets[index].role !== targets[index].role
+ ) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+/**
+ * When comparing numerical values (for example contrast), we only care about the 2
+ * decimal points.
+ * @param {String} _
+ * Key of the property that is parsed.
+ * @param {Any} value
+ * Value of the property that is parsed.
+ * @return {Any}
+ * Newly formatted value in case of the numeric value.
+ */
+function parseNumReplacer(_, value) {
+ if (typeof value === "number") {
+ return value.toFixed(2);
+ }
+
+ return value;
+}
+
+/**
+ * Check the state of the accessibility sidebar audit(checks).
+ * @param {Object} store React store for the panel (includes store for
+ * the audit).
+ * @param {Object} expectedState Expected state of the sidebar audit(checks).
+ */
+async function checkAuditState(store, expectedState) {
+ info("Checking audit state.");
+ await waitUntilState(store, ({ details }) => {
+ const { audit } = details;
+
+ for (const key in expectedState) {
+ const expected = expectedState[key];
+ if (expected && typeof expected === "object") {
+ if (
+ JSON.stringify(audit[key], parseNumReplacer) !==
+ JSON.stringify(expected, parseNumReplacer)
+ ) {
+ return false;
+ }
+ } else if (audit && audit[key] !== expected) {
+ return false;
+ }
+ }
+
+ ok(true, "Audit state is correct.");
+ return true;
+ });
+}
+
+/**
+ * Check the state of the accessibility sidebar.
+ * @param {Object} store React store for the panel (includes store for
+ * the sidebar).
+ * @param {Object} expectedState Expected state of the sidebar.
+ */
+async function checkSidebarState(store, expectedState) {
+ info("Checking sidebar state.");
+ await waitUntilState(store, ({ details }) => {
+ for (const key of ORDERED_PROPS) {
+ const expected = expectedState[key];
+ if (expected === undefined) {
+ continue;
+ }
+
+ if (key === "relations") {
+ if (!relationsMatch(details.relations, expected)) {
+ return false;
+ }
+ } else if (EXPANDABLE_PROPS.includes(key)) {
+ if (
+ JSON.stringify(details.accessible[key]) !== JSON.stringify(expected)
+ ) {
+ return false;
+ }
+ } else if (details.accessible && details.accessible[key] !== expected) {
+ return false;
+ }
+ }
+
+ ok(true, "Sidebar state is correct.");
+ return true;
+ });
+}
+
+/**
+ * Check the state of the accessibility related prefs.
+ * @param {Document} doc
+ * accessibility inspector panel document.
+ * @param {Object} toolbarPrefValues
+ * Expected state of the panel prefs as well as the redux state that
+ * keeps track of it. Includes:
+ * - SCROLL_INTO_VIEW (devtools.accessibility.scroll-into-view)
+ * @param {Object} store
+ * React store for the panel (includes store for the sidebar).
+ */
+async function checkToolbarPrefsState(doc, toolbarPrefValues, store) {
+ info("Checking toolbar prefs state.");
+ const [hasExpectedStructure] = await Promise.all([
+ // Check that appropriate preferences are set as expected.
+ BrowserTestUtils.waitForCondition(() => {
+ return Object.keys(toolbarPrefValues).every(
+ name =>
+ Services.prefs.getBoolPref(PREF_KEYS[name], false) ===
+ toolbarPrefValues[name]
+ );
+ }, "Wait for the right prefs state."),
+ // Check that ui state is set as expected.
+ waitUntilState(store, ({ ui }) => {
+ for (const name in toolbarPrefValues) {
+ if (ui[name] !== toolbarPrefValues[name]) {
+ return false;
+ }
+ }
+
+ ok(true, "UI pref state is correct.");
+ return true;
+ }),
+ ]);
+ ok(hasExpectedStructure, "Prefs state is correct.");
+}
+
+/**
+ * Check the state of the accessibility checks toolbar.
+ * @param {Object} store
+ * React store for the panel (includes store for the sidebar).
+ * @param {Object} activeToolbarFilters
+ * Expected active state of the filters in the toolbar.
+ */
+async function checkToolbarState(doc, activeToolbarFilters) {
+ info("Checking toolbar state.");
+ const hasExpectedStructure = await BrowserTestUtils.waitForCondition(
+ () =>
+ [
+ ...doc.querySelectorAll("#accessibility-tree-filters-menu .command"),
+ ].every(
+ (filter, i) =>
+ (activeToolbarFilters[i] ? "true" : null) ===
+ filter.getAttribute("aria-checked")
+ ),
+ "Wait for the right toolbar state."
+ );
+
+ ok(hasExpectedStructure, "Toolbar state is correct.");
+}
+
+/**
+ * Check the state of the simulation button and menu components.
+ * @param {Object} doc Panel document.
+ * @param {Object} expected Expected states of the simulation components:
+ * menuVisible, buttonActive, checkedOptionIndices (Optional)
+ */
+async function checkSimulationState(doc, expected) {
+ const { buttonActive, checkedOptionIndices } = expected;
+ const simulationMenuOptions = doc
+ .querySelector(SIMULATION_MENU_BUTTON_ID + "-menu")
+ .querySelectorAll(".menuitem");
+
+ // Check simulation menu button state
+ is(
+ doc.querySelector(SIMULATION_MENU_BUTTON_ID).className,
+ `devtools-button toolbar-menu-button simulation${
+ buttonActive ? " active" : ""
+ }`,
+ `Simulation menu button contains ${buttonActive ? "active" : "base"} class.`
+ );
+
+ // Check simulation menu options states, if specified
+ if (checkedOptionIndices) {
+ simulationMenuOptions.forEach((menuListItem, index) => {
+ const isChecked = checkedOptionIndices.includes(index);
+ const button = menuListItem.firstChild;
+
+ is(
+ button.getAttribute("aria-checked"),
+ isChecked ? "true" : null,
+ `Simulation option ${index} is ${isChecked ? "" : "not "}selected.`
+ );
+ });
+ }
+}
+
+/**
+ * Focus accessibility properties tree in the a11y inspector sidebar. If focused for the
+ * first time, the tree will select first rendered node as defult selection for keyboard
+ * purposes.
+ *
+ * @param {Document} doc accessibility inspector panel document.
+ */
+async function focusAccessibleProperties(doc) {
+ const tree = doc.querySelector(".tree");
+ if (doc.activeElement !== tree) {
+ tree.focus();
+ await BrowserTestUtils.waitForCondition(
+ () => tree.querySelector(".node.focused"),
+ "Tree selected."
+ );
+ }
+}
+
+/**
+ * Select accessibility property in the sidebar.
+ * @param {Document} doc accessibility inspector panel document.
+ * @param {String} id id of the property to be selected.
+ * @return {DOMNode} Node that corresponds to the selected accessibility property.
+ */
+async function selectProperty(doc, id) {
+ const win = doc.defaultView;
+ let selected = false;
+ let node;
+
+ await focusAccessibleProperties(doc);
+ await BrowserTestUtils.waitForCondition(() => {
+ node = doc.getElementById(`${id}`);
+ if (node) {
+ if (selected) {
+ return node.firstChild.classList.contains("focused");
+ }
+
+ AccessibilityUtils.setEnv({
+ // Keyboard navigation is handled on the container level using arrow
+ // keys.
+ nonNegativeTabIndexRule: false,
+ });
+ EventUtils.sendMouseEvent({ type: "click" }, node, win);
+ AccessibilityUtils.resetEnv();
+ selected = true;
+ } else {
+ const tree = doc.querySelector(".tree");
+ tree.scrollTop = parseFloat(win.getComputedStyle(tree).height);
+ }
+
+ return false;
+ });
+
+ return node;
+}
+
+/**
+ * Select tree row.
+ * @param {document} doc panel documnent.
+ * @param {Number} rowNumber number of the row/tree node to be selected.
+ */
+function selectRow(doc, rowNumber) {
+ info(`Selecting row ${rowNumber}.`);
+ AccessibilityUtils.setEnv({
+ // Keyboard navigation is handled on the container level using arrow keys.
+ nonNegativeTabIndexRule: false,
+ });
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ doc.querySelectorAll(".treeRow")[rowNumber],
+ doc.defaultView
+ );
+ AccessibilityUtils.resetEnv();
+}
+
+/**
+ * Toggle an expandable tree row.
+ * @param {document} doc panel documnent.
+ * @param {Number} rowNumber number of the row/tree node to be toggled.
+ */
+async function toggleRow(doc, rowNumber) {
+ const win = doc.defaultView;
+ const row = doc.querySelectorAll(".treeRow")[rowNumber];
+ const twisty = row.querySelector(".theme-twisty");
+ const expected = !twisty.classList.contains("open");
+
+ info(`${expected ? "Expanding" : "Collapsing"} row ${rowNumber}.`);
+
+ AccessibilityUtils.setEnv({
+ // We intentionally remove the twisty from the accessibility tree in the
+ // TreeView component and handle keyboard navigation using the arrow keys.
+ mustHaveAccessibleRule: false,
+ });
+ EventUtils.sendMouseEvent({ type: "click" }, twisty, win);
+ AccessibilityUtils.resetEnv();
+ await BrowserTestUtils.waitForCondition(
+ () =>
+ !twisty.classList.contains("devtools-throbber") &&
+ expected === twisty.classList.contains("open"),
+ "Twisty updated."
+ );
+}
+
+/**
+ * Toggle a specific menu item based on its index in the menu.
+ * @param {document} toolboxDoc
+ * toolbox document.
+ * @param {document} doc
+ * panel document.
+ * @param {String} menuId
+ * The id of the menu (menuId passed to the MenuButton component)
+ * @param {Number} menuItemIndex
+ * index of the menu item to be toggled.
+ */
+async function toggleMenuItem(doc, toolboxDoc, menuId, menuItemIndex) {
+ const toolboxWin = toolboxDoc.defaultView;
+ const panelWin = doc.defaultView;
+
+ const menuButton = doc.querySelectorAll(".toolbar-menu-button")[
+ MENU_INDEXES[menuId]
+ ];
+ ok(menuButton, "Expected menu button");
+
+ const menuEl = toolboxDoc.getElementById(menuId);
+ const menuItem = menuEl.querySelectorAll(".command")[menuItemIndex];
+ ok(menuItem, "Expected menu item");
+
+ const expected =
+ menuItem.getAttribute("aria-checked") === "true" ? null : "true";
+
+ // Make the menu visible first.
+ const onPopupShown = new Promise(r =>
+ toolboxDoc.addEventListener("popupshown", r, { once: true })
+ );
+ EventUtils.synthesizeMouseAtCenter(menuButton, {}, panelWin);
+ await onPopupShown;
+ const boundingRect = menuItem.getBoundingClientRect();
+ ok(
+ boundingRect.width > 0 && boundingRect.height > 0,
+ "Menu item is visible."
+ );
+
+ EventUtils.synthesizeMouseAtCenter(menuItem, {}, toolboxWin);
+ await BrowserTestUtils.waitForCondition(
+ () => expected === menuItem.getAttribute("aria-checked"),
+ "Menu item updated."
+ );
+}
+
+async function openSimulationMenu(doc) {
+ doc.querySelector(SIMULATION_MENU_BUTTON_ID).click();
+
+ await BrowserTestUtils.waitForCondition(() =>
+ doc
+ .querySelector(SIMULATION_MENU_BUTTON_ID + "-menu")
+ .classList.contains("tooltip-visible")
+ );
+}
+
+async function toggleSimulationOption(doc, optionIndex) {
+ const simulationMenu = doc.querySelector(SIMULATION_MENU_BUTTON_ID + "-menu");
+ simulationMenu.querySelectorAll(".menuitem")[optionIndex].firstChild.click();
+
+ await BrowserTestUtils.waitForCondition(
+ () => !simulationMenu.classList.contains("tooltip-visible")
+ );
+}
+
+async function findAccessibleFor(
+ {
+ toolbox: { target },
+ panel: {
+ accessibilityProxy: {
+ accessibilityFront: { accessibleWalkerFront },
+ },
+ },
+ },
+ selector
+) {
+ const domWalker = (await target.getFront("inspector")).walker;
+ const node = await domWalker.querySelector(domWalker.rootNode, selector);
+ return accessibleWalkerFront.getAccessibleFor(node);
+}
+
+async function selectAccessibleForNode(env, selector) {
+ const { panel, win } = env;
+ const front = await findAccessibleFor(env, selector);
+ const { EVENTS } = win;
+ const onSelected = win.once(EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED);
+ panel.selectAccessible(front);
+ await onSelected;
+}
+
+/**
+ * Iterate over setups/tests structure and test the state of the
+ * accessibility panel.
+ * @param {JSON} tests
+ * test data that has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be
+ * performed before the state of the
+ * tree and the sidebar can be checked
+ * expected {JSON} An expected states for parts of
+ * accessibility panel:
+ * - tree: state of the accessibility tree widget
+ * - sidebar: state of the accessibility panel sidebar
+ * - audit: state of the audit redux state of the
+ * panel
+ * - toolbarPrefValues: state of the accessibility panel
+ * toolbar prefs and corresponding user
+ * preferences.
+ * - activeToolbarFilters: state of the accessibility panel
+ * toolbar filters.
+ * }
+ * @param {Object} env
+ * contains all relevant environment objects (same structure as the
+ * return value of 'addTestTab' funciton)
+ */
+async function runA11yPanelTests(tests, env) {
+ for (const { desc, setup, expected } of tests) {
+ info(desc);
+
+ if (setup) {
+ await setup(env);
+ }
+
+ const {
+ tree,
+ sidebar,
+ audit,
+ toolbarPrefValues,
+ activeToolbarFilters,
+ simulation,
+ } = expected;
+ if (tree) {
+ await checkTreeState(env.doc, tree);
+ }
+
+ if (sidebar) {
+ await checkSidebarState(env.store, sidebar);
+ }
+
+ if (activeToolbarFilters) {
+ await checkToolbarState(env.doc, activeToolbarFilters);
+ }
+
+ if (toolbarPrefValues) {
+ await checkToolbarPrefsState(env.doc, toolbarPrefValues, env.store);
+ }
+
+ if (typeof audit !== "undefined") {
+ await checkAuditState(env.store, audit);
+ }
+
+ if (simulation) {
+ await checkSimulationState(env.doc, simulation);
+ }
+ }
+}
+
+/**
+ * Build a valid URL from an HTML snippet.
+ * @param {String} uri HTML snippet
+ * @param {Object} options options for the test
+ * @return {String} built URL
+ */
+function buildURL(uri, options = {}) {
+ if (options.remoteIframe) {
+ const srcURL = new URL(`http://example.net/document-builder.sjs`);
+ srcURL.searchParams.append(
+ "html",
+ `<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Accessibility Panel Test (OOP)</title>
+ </head>
+ <body>${uri}</body>
+ </html>`
+ );
+ uri = `<iframe title="Accessibility Panel Test (OOP)" src="${srcURL.href}"/>`;
+ }
+
+ return `data:text/html;charset=UTF-8,${encodeURIComponent(uri)}`;
+}
+
+/**
+ * Add a test task based on the test structure and a test URL.
+ * @param {JSON} tests test data that has the format of:
+ * {
+ * desc {String} description for better logging
+ * setup {Function} An optional setup that needs to be
+ * performed before the state of the
+ * tree and the sidebar can be checked
+ * expected {JSON} An expected states for the tree and
+ * the sidebar
+ * }
+ * @param {String} uri test URL
+ * @param {String} msg a message that is printed for the test
+ * @param {Object} options options for the test
+ */
+function addA11yPanelTestsTask(tests, uri, msg, options) {
+ addA11YPanelTask(msg, uri, env => runA11yPanelTests(tests, env), options);
+}
+
+/**
+ * Borrowed from framework's shared head. Close toolbox, completely disable
+ * accessibility and remove the tab.
+ * @param {Tab}
+ * tab The tab to close.
+ * @return {Promise}
+ * Resolves when the toolbox and tab have been destroyed and closed.
+ */
+async function closeTabToolboxAccessibility(tab = gBrowser.selectedTab) {
+ if (gDevTools.hasToolboxForTab(tab)) {
+ await gDevTools.closeToolboxForTab(tab);
+ }
+
+ await shutdownAccessibility(gBrowser.getBrowserForTab(tab));
+ await removeTab(tab);
+ await new Promise(resolve => setTimeout(resolve, 0));
+}
+
+/**
+ * A wrapper function around add_task that sets up the test environment, runs
+ * the test and then disables accessibility tools.
+ * @param {String} msg a message that is printed for the test
+ * @param {String} uri test URL
+ * @param {Function} task task function containing the tests.
+ * @param {Object} options options for the test
+ */
+function addA11YPanelTask(msg, uri, task, options = {}) {
+ add_task(async function a11YPanelTask() {
+ info(msg);
+
+ const env = await addTestTab(buildURL(uri, options));
+ await task(env);
+ await closeTabToolboxAccessibility(env.tab);
+ });
+}
diff --git a/devtools/client/accessibility/test/chrome/chrome.ini b/devtools/client/accessibility/test/chrome/chrome.ini
new file mode 100644
index 0000000000..58a6a144bd
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/chrome.ini
@@ -0,0 +1,11 @@
+[DEFAULT]
+support-files =
+ head.js
+ contrast.snapshots.js
+ !/devtools/client/shared/components/test/chrome/head.js
+
+[test_accessible_contrast.html]
+[test_accessible_learnMoreLink.html]
+[test_accessible_openLink.html]
+[test_accessible_relations.html]
+[test_accessible_row_context_menu.html]
diff --git a/devtools/client/accessibility/test/chrome/contrast.snapshots.js b/devtools/client/accessibility/test/chrome/contrast.snapshots.js
new file mode 100644
index 0000000000..3b14ff8d66
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/contrast.snapshots.js
@@ -0,0 +1,262 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+window._snapshots = {
+ "ColorContrastAccessibility error render.": {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-check",
+ },
+ children: [
+ {
+ type: "h3",
+ props: {
+ className: "accessibility-check-header",
+ },
+ children: ["Color and Contrast"],
+ },
+ {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast",
+ },
+ children: [
+ {
+ type: "span",
+ props: {
+ className: "accessibility-color-contrast-error",
+ role: "presentation",
+ },
+ children: ["Unable to calculate"],
+ },
+ ],
+ },
+ ],
+ },
+ "ColorContrastAccessibility basic render.": {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-check",
+ },
+ children: [
+ {
+ type: "h3",
+ props: {
+ className: "accessibility-check-header",
+ },
+ children: ["Color and Contrast"],
+ },
+ {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast",
+ },
+ children: [
+ {
+ type: "span",
+ props: {
+ className: "accessibility-contrast-value FAIL",
+ role: "presentation",
+ style: {
+ "--accessibility-contrast-color": "rgba(255,0,0,1)",
+ "--accessibility-contrast-bg": "rgba(255,255,255,1)",
+ },
+ },
+ children: ["4.00"],
+ },
+ ],
+ },
+ {
+ type: "p",
+ props: {
+ className: "accessibility-check-annotation",
+ },
+ children: [
+ "Does not meet WCAG standards for accessible text. ",
+ {
+ type: "a",
+ props: {
+ className: "link",
+ href:
+ "https://developer.mozilla.org/docs/Web/Accessibility/" +
+ "Understanding_WCAG/Perceivable/Color_contrast?utm_source=" +
+ "devtools&utm_medium=a11y-panel-checks-color-contrast",
+ onClick:
+ "openDocOnClick(event) {\n event.preventDefault();\n " +
+ "openDocLink(event.target.href);\n }",
+ },
+ children: ["Learn more"],
+ },
+ "",
+ ],
+ },
+ ],
+ },
+ "ColorContrastAccessibility range render.": {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-check",
+ },
+ children: [
+ {
+ type: "h3",
+ props: {
+ className: "accessibility-check-header",
+ },
+ children: ["Color and Contrast"],
+ },
+ {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast",
+ },
+ children: [
+ {
+ type: "span",
+ props: {
+ className: "accessibility-contrast-value FAIL",
+ role: "presentation",
+ style: {
+ "--accessibility-contrast-color": "rgba(128,128,128,1)",
+ "--accessibility-contrast-bg": "rgba(219,106,116,1)",
+ },
+ },
+ children: ["1.19"],
+ },
+ {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast-separator",
+ },
+ children: null,
+ },
+ {
+ type: "span",
+ props: {
+ className: "accessibility-contrast-value FAIL",
+ role: "presentation",
+ style: {
+ "--accessibility-contrast-color": "rgba(128,128,128,1)",
+ "--accessibility-contrast-bg": "rgba(156,145,211,1)",
+ },
+ },
+ children: ["1.39"],
+ },
+ ],
+ },
+ {
+ type: "p",
+ props: {
+ className: "accessibility-check-annotation",
+ },
+ children: [
+ "Does not meet WCAG standards for accessible text. ",
+ {
+ type: "a",
+ props: {
+ className: "link",
+ href:
+ "https://developer.mozilla.org/docs/Web/Accessibility/" +
+ "Understanding_WCAG/Perceivable/Color_contrast?utm_source=" +
+ "devtools&utm_medium=a11y-panel-checks-color-contrast",
+ onClick:
+ "openDocOnClick(event) {\n event.preventDefault();\n " +
+ "openDocLink(event.target.href);\n }",
+ },
+ children: ["Learn more"],
+ },
+ "",
+ ],
+ },
+ ],
+ },
+ "ColorContrastAccessibility large text render.": {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-check",
+ },
+ children: [
+ {
+ type: "h3",
+ props: {
+ className: "accessibility-check-header",
+ },
+ children: ["Color and Contrast"],
+ },
+ {
+ type: "div",
+ props: {
+ role: "presentation",
+ tabIndex: "-1",
+ className: "accessibility-color-contrast",
+ },
+ children: [
+ {
+ type: "span",
+ props: {
+ className: "accessibility-contrast-value AA",
+ role: "presentation",
+ style: {
+ "--accessibility-contrast-color": "rgba(255,0,0,1)",
+ "--accessibility-contrast-bg": "rgba(255,255,255,1)",
+ },
+ },
+ children: ["4.00"],
+ },
+ {
+ type: "span",
+ props: {
+ className: "accessibility-color-contrast-large-text",
+ role: "presentation",
+ title:
+ "Text is 14 point and bold or larger, or 18 point or larger.",
+ },
+ children: ["large text"],
+ },
+ ],
+ },
+ {
+ type: "p",
+ props: {
+ className: "accessibility-check-annotation",
+ },
+ children: [
+ "Meets WCAG AA standards for accessible text. ",
+ {
+ type: "a",
+ props: {
+ className: "link",
+ href:
+ "https://developer.mozilla.org/docs/Web/Accessibility/" +
+ "Understanding_WCAG/Perceivable/Color_contrast?utm_source=" +
+ "devtools&utm_medium=a11y-panel-checks-color-contrast",
+ onClick:
+ "openDocOnClick(event) {\n event.preventDefault();\n " +
+ "openDocLink(event.target.href);\n }",
+ },
+ children: ["Learn more"],
+ },
+ "",
+ ],
+ },
+ ],
+ },
+};
diff --git a/devtools/client/accessibility/test/chrome/head.js b/devtools/client/accessibility/test/chrome/head.js
new file mode 100644
index 0000000000..a1a02df8a8
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/head.js
@@ -0,0 +1,32 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+"use strict";
+
+var { require } = ChromeUtils.importESModule(
+ "resource://devtools/shared/loader/Loader.sys.mjs"
+);
+var { BrowserLoader } = ChromeUtils.import(
+ "resource://devtools/shared/loader/browser-loader.js"
+);
+var DevToolsUtils = require("resource://devtools/shared/DevToolsUtils.js");
+
+var { require: browserRequire } = BrowserLoader({
+ baseURI: "resource://devtools/client/shared/",
+ window,
+});
+
+window.EVENTS = {};
+window.on = function () {};
+window.off = function () {};
+
+SimpleTest.registerCleanupFunction(() => {
+ window.EVENTS = null;
+ window.on = null;
+ window.off = null;
+});
+
+// All tests are asynchronous.
+SimpleTest.waitForExplicitFinish();
diff --git a/devtools/client/accessibility/test/chrome/test_accessible_contrast.html b/devtools/client/accessibility/test/chrome/test_accessible_contrast.html
new file mode 100644
index 0000000000..aeb1cc47a5
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/test_accessible_contrast.html
@@ -0,0 +1,84 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE HTML>
+<html>
+<!--
+Test that Color Contrast component renders correctly.
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Color Contrast accessibility component test</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+ <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css">
+</head>
+<body>
+<pre id="test">
+<script src="head.js" type="application/javascript"></script>
+<script src="chrome://mochitests/content/chrome/devtools/client/shared/components/test/chrome/head.js" type="application/javascript"/>
+<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" type="application/javascript"></script>
+<script src="contrast.snapshots.js" type="application/javascript"></script>
+<script type="application/javascript">
+
+"use strict";
+
+/* global matchSnapshot */
+
+window.onload = async function() {
+ try {
+ const React = browserRequire("devtools/client/shared/vendor/react");
+ const { ColorContrastCheck } = browserRequire(
+ "devtools/client/accessibility/components/ColorContrastAccessibility");
+
+ const {
+ accessibility: { SCORES },
+ } = browserRequire("devtools/shared/constants");
+
+ matchSnapshot("ColorContrastAccessibility error render.",
+ React.createElement(ColorContrastCheck, { error: true })
+ );
+
+ matchSnapshot("ColorContrastAccessibility basic render.",
+ React.createElement(ColorContrastCheck, {
+ "value": 4.00,
+ "color": [255, 0, 0, 1],
+ "backgroundColor": [255, 255, 255, 1],
+ "isLargeText": false,
+ "score": SCORES.FAIL,
+ })
+ );
+
+ matchSnapshot("ColorContrastAccessibility range render.",
+ React.createElement(ColorContrastCheck, {
+ "min": 1.19,
+ "max": 1.39,
+ "color": [128, 128, 128, 1],
+ "backgroundColorMin": [219, 106, 116, 1],
+ "backgroundColorMax": [156, 145, 211, 1],
+ "isLargeText": false,
+ "score": SCORES.FAIL,
+ "scoreMin": SCORES.FAIL,
+ "scoreMax": SCORES.FAIL,
+ })
+ );
+
+ matchSnapshot("ColorContrastAccessibility large text render.",
+ React.createElement(ColorContrastCheck, {
+ "value": 4.00,
+ "color": [255, 0, 0, 1],
+ "backgroundColor": [255, 255, 255, 1],
+ "isLargeText": true,
+ "score": SCORES.AA,
+ })
+ );
+ } catch (e) {
+ ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
+ } finally {
+ SimpleTest.finish();
+ }
+};
+</script>
+</pre>
+</body>
+</html>
diff --git a/devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html b/devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html
new file mode 100644
index 0000000000..4644b21cd0
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html
@@ -0,0 +1,97 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE HTML>
+<html>
+<!--
+Test that LearnMoreLink parses and renders correctly text with learn more links.
+-->
+<head>
+ <meta charset="utf-8">
+ <title>LearnMoreLink component test</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+ <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css">
+</head>
+<body>
+<pre id="test">
+<script src="head.js" type="application/javascript"></script>
+<script type="application/javascript">
+
+"use strict";
+
+window.onload = async function() {
+ try {
+ const { gDevTools } = require("devtools/client/framework/devtools");
+ const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
+ const { createFactory } = browserRequire("devtools/client/shared/vendor/react");
+ const { Simulate } =
+ browserRequire("devtools/client/shared/vendor/react-dom-test-utils");
+ const LearnMoreLink = createFactory(
+ browserRequire("devtools/client/accessibility/components/LearnMoreLink"));
+
+ class MockL10N {
+ constructor(bundle) {
+ this.bundle = bundle;
+ }
+
+ getStr(name) {
+ return this.bundle[name];
+ }
+
+ getFormatStr(name, ...args) {
+ let index = 0;
+ return this.bundle[name].replace("%S", () => args[index++]);
+ }
+ }
+
+ function testLinkClicked(link, expectedUrl) {
+ const browserWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
+ const defaultOpenWebLinkIn = browserWindow.openWebLinkIn;
+
+ const checker = Symbol();
+ let onClickUrl = checker;
+ browserWindow.openWebLinkIn = url => {
+ onClickUrl = url;
+ };
+
+ Simulate.click(link);
+
+ ok(onClickUrl !== checker, "Link was clicked");
+ is(onClickUrl, expectedUrl, "Correct URL is opened");
+
+ browserWindow.openWebLinkIn = defaultOpenWebLinkIn;
+ }
+
+ const href = "http://example.com/";
+ const className = "test-class";
+ const l10n = new MockL10N({
+ message: "This is a message that contains a link. %S",
+ link: "Learn more",
+ });
+ const learnMoreLink = LearnMoreLink(
+ { href, className, l10n, learnMoreStringKey: "link", messageStringKey: "message" });
+ ok(LearnMoreLink, "Should be able to create LearnMoreLink instances");
+
+ ReactDOM.render(learnMoreLink, document.body);
+ const p = document.querySelector("p");
+ is(p.textContent, "This is a message that contains a link. Learn more",
+ "Text content for the whole paragraph is correct");
+
+ is(p.className, className, "Class name is set correctly.");
+
+ const link = p.querySelector(".link");
+ ok(link, "Link was rendered");
+ is(link.textContent, "Learn more", "Text content for link is correct");
+
+ testLinkClicked(link, href);
+ } catch (e) {
+ ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
+ } finally {
+ SimpleTest.finish();
+ }
+};
+</script>
+</pre>
+</body>
+</html>
diff --git a/devtools/client/accessibility/test/chrome/test_accessible_openLink.html b/devtools/client/accessibility/test/chrome/test_accessible_openLink.html
new file mode 100644
index 0000000000..1ed351e2fb
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/test_accessible_openLink.html
@@ -0,0 +1,111 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE HTML>
+<html>
+<!--
+Test that openLink function is called if accessible object property is rendered as a link.
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Accessible component test</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+ <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css">
+</head>
+<body>
+<pre id="test">
+<script src="head.js" type="application/javascript"></script>
+<script type="application/javascript">
+
+"use strict";
+
+window.onload = async function() {
+ try {
+ const { gDevTools } = require("devtools/client/framework/devtools");
+ const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
+ const { createFactory, createElement } =
+ browserRequire("devtools/client/shared/vendor/react");
+ const { Provider } = require("devtools/client/shared/vendor/react-redux");
+ const createStore = require("devtools/client/shared/redux/create-store");
+ const { Simulate } =
+ browserRequire("devtools/client/shared/vendor/react-dom-test-utils");
+ const Accessible = createFactory(
+ browserRequire("devtools/client/accessibility/components/Accessible"));
+
+ function testLinkClicked(link, event, expectedUrl, expectedWhere) {
+ const browserWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
+ const defaultOpenWebLinkIn = browserWindow.openWebLinkIn;
+
+ const checker = Symbol();
+ let onClickArgs = checker;
+ browserWindow.openWebLinkIn = (url, where) => {
+ onClickArgs = { url, where };
+ };
+
+ Simulate.click(link, event);
+
+ ok(onClickArgs !== checker, "Link was clicked");
+ is(onClickArgs.url, expectedUrl, "Correct URL is opened");
+ is(onClickArgs.where, expectedWhere, "URL was opened correctly");
+
+ browserWindow.openWebLinkIn = defaultOpenWebLinkIn;
+ }
+
+ const a = Accessible({ labelledby: "Test Accessible" });
+ ok(a, "Should be able to create Accessible instances");
+
+ let URL = "http://example.com";
+ const mockStore = createStore((state, action) =>
+ action ? { ...state, ...action } : state,
+ {
+ initialState: {
+ details: {
+ DOMNode: {},
+ accessible: {
+ // This accessible mock has no actorID and should be treated as
+ // destroyed.
+ isDestroyed: () => true,
+ value: URL,
+ }
+ },
+ ui: {
+ supports: {}
+ }
+ },
+ }
+ );
+ const provider = createElement(Provider, { store: mockStore }, a);
+ const accessible = ReactDOM.render(provider, window.document.body);
+ ok(accessible, "Should be able to mount Accessible instances");
+
+ let link = document.querySelector(".url");
+ testLinkClicked(link, null, URL, "tab");
+
+ URL = "non-URL";
+ await mockStore.dispatch(
+ {
+ type: "update",
+ details: {
+ DOMNode: {},
+ accessible: {
+ // This accessible mock has no actorID and should be treated as
+ // destroyed.
+ isDestroyed: () => true,
+ value: URL,
+ }
+ }
+ }
+ );
+ link = document.querySelector(".url");
+ ok(!link, "Non URL link should not be rendered as a link.");
+ } catch (e) {
+ ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
+ } finally {
+ SimpleTest.finish();
+ }
+};
+</script>
+</pre>
+</body>
+</html>
diff --git a/devtools/client/accessibility/test/chrome/test_accessible_relations.html b/devtools/client/accessibility/test/chrome/test_accessible_relations.html
new file mode 100644
index 0000000000..c2d868b50c
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/test_accessible_relations.html
@@ -0,0 +1,103 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE HTML>
+<html>
+<!--
+Test that openLink function is called if accessible object property is rendered as a link.
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Accessible component test</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+ <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css">
+</head>
+<body>
+<pre id="test">
+<script src="head.js" type="application/javascript"></script>
+<script type="application/javascript">
+
+"use strict";
+
+window.onload = async function() {
+ try {
+ const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
+ const { createFactory, createElement } =
+ browserRequire("devtools/client/shared/vendor/react");
+ const { Provider } = require("devtools/client/shared/vendor/react-redux");
+ const createStore = require("devtools/client/shared/redux/create-store");
+ const { Simulate } =
+ browserRequire("devtools/client/shared/vendor/react-dom-test-utils");
+ const Accessible = createFactory(
+ browserRequire("devtools/client/accessibility/components/Accessible"));
+
+ const a = Accessible({ labelledby: "Test Accessible" });
+ ok(a, "Should be able to create Accessible instances");
+
+ const mockState = {
+ details: {
+ DOMNode: {},
+ accessible: {
+ on: () => {},
+ off: () => {},
+ // This accessible mock has no actorID and should be treated as
+ // destroyed.
+ isDestroyed: () => true,
+ },
+ },
+ ui: { supports: {} }
+ };
+
+ const mockStore = createStore((state, action) =>
+ action ? { ...state, ...action } : state, { initialState: mockState });
+ const provider = createElement(Provider, { store: mockStore }, a);
+ const accessible = ReactDOM.render(provider, window.document.body);
+ ok(accessible, "Should be able to mount Accessible instances");
+ let relationsNode = document.getElementById("/relations");
+ ok(relationsNode, "Relations are rendered when supported.");
+ let arrow = relationsNode.querySelector(".arrow.theme-twisty");
+ is(arrow.style.visibility, "hidden", "Relations are empty.");
+
+ info("Render accessible object with relations.");
+ const state = {
+ details: {
+ ...mockState.details,
+ relations: {
+ "containing document": {
+ actorID: "server1.conn2.child1/accessible29",
+ typeName: "accessible",
+ name: "New Tab",
+ role: "document",
+ },
+ },
+ },
+ };
+ await mockStore.dispatch({ type: "update", ...state });
+ relationsNode = document.getElementById("/relations");
+ ok(relationsNode, "Relations are rendered when supported.");
+ arrow = relationsNode.querySelector(".arrow.theme-twisty");
+ ok(!arrow.style.visibility,
+ "There is at least one relation for the current accessible object.");
+
+ Simulate.click(arrow, null);
+ const relationNode = document.getElementById("/relations/containing document");
+ ok(relationNode, "Relation node is rendered.");
+ ok(relationNode.textContent.includes(
+ state.details.relations["containing document"].name),
+ "Relation target's name is rendered");
+ ok(relationNode.textContent.includes(
+ state.details.relations["containing document"].role),
+ "Relation target's name is rendered");
+ ok(relationNode.querySelector(".open-accessibility-inspector"),
+ "Select accessible button is rendered.");
+ } catch (e) {
+ ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
+ } finally {
+ SimpleTest.finish();
+ }
+};
+</script>
+</pre>
+</body>
+</html>
diff --git a/devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html b/devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html
new file mode 100644
index 0000000000..7cc2e6f005
--- /dev/null
+++ b/devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html
@@ -0,0 +1,148 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE HTML>
+<html>
+<!--
+Test that openLink function is called if accessible object property is rendered as a link.
+-->
+<head>
+ <meta charset="utf-8">
+ <title>AccessibilityRow context menu test</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+ <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css">
+</head>
+<body>
+<pre id="test">
+<script src="head.js" type="application/javascript"></script>
+<script type="application/javascript">
+
+"use strict";
+
+window.onload = async function() {
+ try {
+ const { gDevTools } = require("devtools/client/framework/devtools");
+ const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
+ const { createFactory, createElement } =
+ browserRequire("devtools/client/shared/vendor/react");
+ const { Provider } = require("devtools/client/shared/vendor/react-redux");
+ const createStore = require("devtools/client/shared/redux/create-store");
+ const { Simulate } =
+ browserRequire("devtools/client/shared/vendor/react-dom-test-utils");
+ const AccessibilityRow = createFactory(
+ browserRequire("devtools/client/accessibility/components/AccessibilityRow"));
+ const { FILTERS } = browserRequire("devtools/client/accessibility/constants");
+
+ async function withMockEnv(func) {
+ const { gTelemetry: originalTelemetry } = window;
+ window.gTelemetry = null;
+
+ await func();
+
+ window.gTelemetry = originalTelemetry;
+ }
+
+ function renderAccessibilityRow(newProps, newState) {
+ let container = document.getElementById("container");
+ if (container) {
+ container.remove();
+ }
+
+ const accRow = AccessibilityRow(newProps);
+ const mockStore = createStore((state, action) =>
+ action ? { ...state, ...action } : state, { initialState: newState });
+ const provider = createElement(Provider, { store: mockStore }, accRow);
+
+ container = document.createElement("div");
+ container.id = "container";
+ document.body.appendChild(container);
+ return ReactDOM.render(provider, container);
+ }
+
+ const ROW_ID = "test-row";
+ const JSON_URL_PREFIX = "data:application/json;charset=UTF-8,";
+ const SNAPSHOT = { "snapshot": true };
+ const defaultProps = {
+ id: ROW_ID,
+ member: {
+ object: {
+ name: "test",
+ value: "test",
+ loading: false,
+ selected: false,
+ hasChildren: false,
+ snapshot: async () => SNAPSHOT,
+ on: () => {},
+ off: () => {},
+ // This accessible mock has no actorID and should be treated as
+ // destroyed.
+ isDestroyed: () => true,
+ },
+ },
+ columns: [
+ { "id": "default", "title": "role" },
+ { "id": "value", "title": "name" },
+ ],
+ provider: {
+ getValue: (object, id) => object[id],
+ },
+ hasContextMenu: true,
+ toolboxDoc: document,
+ };
+
+ const auditState = { audit: { filters: { [FILTERS.CONTRAST]: false }}};
+
+ const defaultState = {
+ ui: { supports: {} },
+ ...auditState,
+ };
+
+ info("Check contextmenu default behaviour.");
+ renderAccessibilityRow(defaultProps, defaultState);
+ const row = document.getElementById(ROW_ID);
+
+ info("Get topmost document where the context meny will be rendered");
+ const menuDoc = document.defaultView.windowRoot.ownerGlobal.document;
+ await withMockEnv(async function() {
+ Simulate.contextMenu(row);
+
+ const menu = menuDoc.getElementById("accessibility-row-contextmenu");
+ const printtojsonMenuItem = menuDoc.getElementById("menu-printtojson");
+
+ ok(menu, "Accessibility row context menu is open");
+ ok(printtojsonMenuItem, "Print to JSON menu item is visible");
+
+ const browserWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
+ const defaultOpenWebLinkIn = browserWindow.openWebLinkIn;
+
+ let openWebLinkInCalled;
+ const openWebLinkInPromise = new Promise(resolve => {
+ openWebLinkInCalled = resolve;
+ });
+
+ // Mock top chrome window's @openWebLinkIn method.
+ browserWindow.openWebLinkIn = (...args) => {
+ openWebLinkInCalled(args);
+ };
+ printtojsonMenuItem.click();
+
+ const [ url, where ] = await openWebLinkInPromise;
+ is(url, `${JSON_URL_PREFIX}${encodeURIComponent(JSON.stringify(SNAPSHOT))}`,
+ "Correct URL is opened");
+ is(where, "tab", "URL was opened correctly");
+
+ // Reset @openWebLinkIn to default.
+ browserWindow.openWebLinkIn = defaultOpenWebLinkIn;
+ menu.remove();
+ });
+ } catch (e) {
+ ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
+ } finally {
+ SimpleTest.finish();
+ }
+};
+</script>
+</pre>
+</body>
+</html>
diff --git a/devtools/client/accessibility/test/node/.eslintrc.js b/devtools/client/accessibility/test/node/.eslintrc.js
new file mode 100644
index 0000000000..698a392120
--- /dev/null
+++ b/devtools/client/accessibility/test/node/.eslintrc.js
@@ -0,0 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+module.exports = {
+ env: {
+ jest: true,
+ },
+};
diff --git a/devtools/client/accessibility/test/node/README.md b/devtools/client/accessibility/test/node/README.md
new file mode 100644
index 0000000000..4b40aacffe
--- /dev/null
+++ b/devtools/client/accessibility/test/node/README.md
@@ -0,0 +1,22 @@
+# Jest Tests for devtools/client/accessibility
+
+## About
+
+DevTools React components can be tested using [jest](https://jestjs.io/). Jest allows to test our UI components in isolation and complement our end to end mochitests.
+
+## Run locally
+
+We use yarn for dependency management. To run the tests locally:
+```
+ cd devtools/client/accessibility/test/node
+ yarn && yarn test
+```
+
+## Run on try
+
+The tests run on try on linux64 platforms. The complete name of try job is `devtools-tests`. In treeherder, they will show up as `node(devtools)`.
+
+Adding the tests to a try push depends on the try selector you are using.
+- try fuzzy: look for the job named `source-test-node-devtools-tests`
+
+The configuration file for try can be found at `taskcluster/ci/source-test/node.yml`
diff --git a/devtools/client/accessibility/test/node/babel.config.js b/devtools/client/accessibility/test/node/babel.config.js
new file mode 100644
index 0000000000..eb289b73e7
--- /dev/null
+++ b/devtools/client/accessibility/test/node/babel.config.js
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+module.exports = {
+ plugins: [
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-async-generator-functions",
+ "@babel/plugin-proposal-optional-chaining",
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "transform-amd-to-commonjs",
+ ],
+};
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap
new file mode 100644
index 0000000000..eea9c7ece4
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap
@@ -0,0 +1,7 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AccessibilityPrefs component: prefs checked 1`] = `"<button class=\\"devtools-button badge toolbar-menu-button prefs\\" title=\\"Configure preferences\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-prefs-menu\\"></button>"`;
+
+exports[`AccessibilityPrefs component: prefs not set by default 1`] = `"<button class=\\"devtools-button badge toolbar-menu-button prefs\\" title=\\"Configure preferences\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-prefs-menu\\"></button>"`;
+
+exports[`AccessibilityPrefs component: toggle pref 1`] = `"<button class=\\"devtools-button badge toolbar-menu-button prefs\\" title=\\"Configure preferences\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-prefs-menu\\"></button>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap
new file mode 100644
index 0000000000..e35558e016
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AccessibilityRowValue component: basic render 1`] = `"<span role=\\"presentation\\"><span class=\\"objectBox objectBox-undefined\\">undefined</span></span>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap
new file mode 100644
index 0000000000..8d54471f0b
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap
@@ -0,0 +1,39 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AccessibilityTreeFilter component: audit all filter filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: audit all filter not filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: audit filter not filtered 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: audit filters filtered 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: audit other filter filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Contrast</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: audit other filter not filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 2`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 3`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 4`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 5`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Keyboard, Text Labels</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 6`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Keyboard, Text Labels</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 7`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Keyboard, Text Labels</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 8`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 9`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 10`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 11`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: render filters after state changes 12`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Text Labels</button></div>"`;
+
+exports[`AccessibilityTreeFilter component: toggle filter 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap
new file mode 100644
index 0000000000..b510bd22d3
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap
@@ -0,0 +1,7 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AuditController component: accessible with checks 1`] = `"<span class=\\"child\\" checks=\\"[object Object]\\"></span>"`;
+
+exports[`AuditController component: accessible without checks 1`] = `"<span></span>"`;
+
+exports[`AuditController component: dead accessible actor 1`] = `"<span></span>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap
new file mode 100644
index 0000000000..32564ff6d7
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap
@@ -0,0 +1,13 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AuditController component: audit filter filtered contrast checks fail 1`] = `"<span></span>"`;
+
+exports[`AuditController component: audit filter filtered contrast checks fail range 1`] = `"<span></span>"`;
+
+exports[`AuditController component: audit filter filtered contrast checks success 1`] = `""`;
+
+exports[`AuditController component: audit filter filtered no checks 1`] = `""`;
+
+exports[`AuditController component: audit filter filtered unknown checks 1`] = `""`;
+
+exports[`AuditController component: audit filter not filtered 1`] = `"<span></span>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap
new file mode 100644
index 0000000000..8ae235d352
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap
@@ -0,0 +1,13 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AuditProgressOverlay component: render auditing finishing up 1`] = `"<span id=\\"audit-progress-container\\" role=\\"progressbar\\" aria-valuetext=\\"Finishing up…\\">Finishing up…</span>"`;
+
+exports[`AuditProgressOverlay component: render auditing initializing 1`] = `"<span id=\\"audit-progress-container\\" role=\\"progressbar\\" aria-valuetext=\\"Initializing…\\">Initializing…</span>"`;
+
+exports[`AuditProgressOverlay component: render auditing progress 1`] = `"<span id=\\"audit-progress-container\\">Checking 5 nodes<progress max=\\"100\\" value=\\"0\\" class=\\"audit-progress-progressbar\\" aria-labelledby=\\"audit-progress-container\\"></progress></span>"`;
+
+exports[`AuditProgressOverlay component: render auditing progress 2`] = `"<span id=\\"audit-progress-container\\">Checking 5 nodes<progress max=\\"100\\" value=\\"50\\" class=\\"audit-progress-progressbar\\" aria-labelledby=\\"audit-progress-container\\"></progress></span>"`;
+
+exports[`AuditProgressOverlay component: render auditing progress 3`] = `"<span id=\\"audit-progress-container\\">Checking 5 nodes<progress max=\\"100\\" value=\\"75\\" class=\\"audit-progress-progressbar\\" aria-labelledby=\\"audit-progress-container\\"></progress></span>"`;
+
+exports[`AuditProgressOverlay component: render not auditing 1`] = `""`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap
new file mode 100644
index 0000000000..324c72105b
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Badge component: basic render 1`] = `"<span class=\\"audit-badge badge\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"Contrast\\">Contrast</span>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap
new file mode 100644
index 0000000000..5065d172d0
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap
@@ -0,0 +1,15 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Badges component: contrast ratio fail range render 1`] = `"<span class=\\"badges\\" role=\\"group\\" aria-label=\\"Accessibility checks\\"><span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"contrast warning\\">contrast</span></span>"`;
+
+exports[`Badges component: contrast ratio fail render 1`] = `"<span class=\\"badges\\" role=\\"group\\" aria-label=\\"Accessibility checks\\"><span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"contrast warning\\">contrast</span></span>"`;
+
+exports[`Badges component: contrast ratio success render 1`] = `"<span class=\\"badges\\" role=\\"group\\" aria-label=\\"Accessibility checks\\"></span>"`;
+
+exports[`Badges component: empty checks render 1`] = `""`;
+
+exports[`Badges component: no props render 1`] = `""`;
+
+exports[`Badges component: null checks render 1`] = `""`;
+
+exports[`Badges component: unsupported checks render 1`] = `""`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap
new file mode 100644
index 0000000000..06d9cb60c5
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap
@@ -0,0 +1,5 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Check component: basic render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`Check component: basic render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap
new file mode 100644
index 0000000000..f24c7a92ab
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap
@@ -0,0 +1,11 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ContrastBadge component: error render 1`] = `null`;
+
+exports[`ContrastBadge component: fail render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"contrast warning\\">contrast</span>"`;
+
+exports[`ContrastBadge component: success large text render 1`] = `null`;
+
+exports[`ContrastBadge component: success range render 1`] = `null`;
+
+exports[`ContrastBadge component: success render 1`] = `null`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap
new file mode 100644
index 0000000000..d7e8c1ebdb
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap
@@ -0,0 +1,9 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`DisplayTabbingOrder component: default render 1`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`;
+
+exports[`DisplayTabbingOrder component: displaying tabbing order render/update 1`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`;
+
+exports[`DisplayTabbingOrder component: displaying tabbing order render/update 2`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`;
+
+exports[`DisplayTabbingOrder component: toggle tabbing order overlay 1`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap
new file mode 100644
index 0000000000..f1d9bc5c76
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap
@@ -0,0 +1,7 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`KeyboardBadge component: error render 1`] = `null`;
+
+exports[`KeyboardBadge component: fail render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for keyboard accessibility.\\" aria-label=\\"keyboard\\">keyboard</span>"`;
+
+exports[`KeyboardBadge component: warning render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"WARNING\\" title=\\"Does not meet WCAG standards for keyboard accessibility.\\" aria-label=\\"keyboard\\">keyboard</span>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap
new file mode 100644
index 0000000000..60b66cc6dc
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap
@@ -0,0 +1,9 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`KeyboardCheck component: FAIL render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`KeyboardCheck component: FAIL render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`KeyboardCheck component: WARNING render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`KeyboardCheck component: WARNING render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap
new file mode 100644
index 0000000000..4f43a73a62
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap
@@ -0,0 +1,9 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`TextLabelBadge component: best practices render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"BEST_PRACTICES\\" title=\\"Does not meet WCAG standards for text alternative.\\" aria-label=\\"text label\\">text label</span>"`;
+
+exports[`TextLabelBadge component: error render 1`] = `null`;
+
+exports[`TextLabelBadge component: fail render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for text alternative.\\" aria-label=\\"text label\\">text label</span>"`;
+
+exports[`TextLabelBadge component: warning render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"WARNING\\" title=\\"Does not meet WCAG standards for text alternative.\\" aria-label=\\"text label\\">text label</span>"`;
diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap
new file mode 100644
index 0000000000..7a5735f3e0
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap
@@ -0,0 +1,13 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`TextLabelCheck component: BEST_PRACTICES render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/info.svg\\" data-score=\\"BEST_PRACTICES\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`TextLabelCheck component: BEST_PRACTICES render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/info.svg\\" data-score=\\"BEST_PRACTICES\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`TextLabelCheck component: FAIL render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`TextLabelCheck component: FAIL render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`TextLabelCheck component: WARNING render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
+
+exports[`TextLabelCheck component: WARNING render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`;
diff --git a/devtools/client/accessibility/test/node/components/accessibility-prefs.test.js b/devtools/client/accessibility/test/node/components/accessibility-prefs.test.js
new file mode 100644
index 0000000000..efd247d789
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/accessibility-prefs.test.js
@@ -0,0 +1,107 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+
+const MenuButton = require("resource://devtools/client/shared/components/menu/MenuButton.js");
+const ConnectedAccessibilityPrefsClass = require("resource://devtools/client/accessibility/components/AccessibilityPrefs.js");
+const AccessibilityPrefsClass =
+ ConnectedAccessibilityPrefsClass.WrappedComponent;
+const AccessibilityPrefs = createFactory(ConnectedAccessibilityPrefsClass);
+const {
+ checkMenuItem,
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const {
+ PREFS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+function checkTogglePrefCheckbox(wrapper, pref) {
+ const prefsInstance = wrapper.find(AccessibilityPrefsClass).instance();
+ prefsInstance.togglePref = jest.fn();
+ pref instanceof Node ? pref.click() : pref.simulate("click");
+ expect(prefsInstance.togglePref.mock.calls.length).toBe(1);
+}
+
+function getMenuItems(wrapper, selector) {
+ const menuButton = wrapper.find(MenuButton);
+ // Focusing on the menu button will trigger rendering of the HTMLTooltip with
+ // the menu list.
+ menuButton.childAt(0).getDOMNode().focus();
+
+ return menuButton
+ .instance()
+ .tooltip.panel.querySelectorAll(`.menuitem ${selector}`);
+}
+
+function checkPrefsState(wrapper, expected) {
+ const prefs = getMenuItems(wrapper, ".pref");
+ for (let i = 0; i < prefs.length; i++) {
+ checkMenuItem(prefs[i], {
+ checked: expected.prefs[i].active,
+ label: expected.prefs[i].text,
+ });
+ }
+ checkMenuItem(getMenuItems(wrapper, ".help")[0], {
+ role: "link",
+ label: "Documentation…",
+ });
+}
+
+describe("AccessibilityPrefs component:", () => {
+ it("prefs not set by default", () => {
+ const store = setupStore();
+ const wrapper = mount(
+ Provider({ store }, AccessibilityPrefs({ toolboxDoc: document }))
+ );
+ const accPrefs = wrapper.find(AccessibilityPrefsClass);
+ const menuButton = accPrefs.childAt(0);
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(accPrefs.children().length).toBe(1);
+ expect(menuButton.is(MenuButton)).toBe(true);
+
+ checkPrefsState(wrapper, {
+ prefs: [{ active: false, text: "Scroll into view" }],
+ });
+ });
+
+ it("prefs checked", () => {
+ const store = setupStore({
+ preloadedState: {
+ ui: {
+ [PREFS.SCROLL_INTO_VIEW]: true,
+ },
+ },
+ });
+ const wrapper = mount(
+ Provider({ store }, AccessibilityPrefs({ toolboxDoc: document }))
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ checkPrefsState(wrapper, {
+ prefs: [{ active: true, text: "Scroll into view" }],
+ });
+ });
+
+ it("toggle pref", () => {
+ const store = setupStore();
+ const wrapper = mount(
+ Provider({ store }, AccessibilityPrefs({ toolboxDoc: document }))
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ for (const pref of getMenuItems(wrapper, ".pref")) {
+ checkTogglePrefCheckbox(wrapper, pref);
+ }
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/accessibility-row-value.test.js b/devtools/client/accessibility/test/node/components/accessibility-row-value.test.js
new file mode 100644
index 0000000000..5e73f0f18f
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/accessibility-row-value.test.js
@@ -0,0 +1,56 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ mockAccessible,
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const Badges = require("resource://devtools/client/accessibility/components/Badges.js");
+const {
+ REPS: { Rep },
+} = require("resource://devtools/client/shared/components/reps/index.js");
+const AuditController = require("resource://devtools/client/accessibility/components/AuditController.js");
+
+const AccessibilityRowValueClass = require("resource://devtools/client/accessibility/components/AccessibilityRowValue.js");
+const AccessibilityRowValue = createFactory(AccessibilityRowValueClass);
+
+describe("AccessibilityRowValue component:", () => {
+ it("basic render", () => {
+ const store = setupStore({
+ preloadedState: { ui: { supports: {} } },
+ });
+ const wrapper = mount(
+ Provider(
+ { store },
+ AccessibilityRowValue({
+ member: { object: mockAccessible() },
+ })
+ )
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ const rowValue = wrapper.find(AccessibilityRowValueClass);
+ expect(rowValue.children().length).toBe(1);
+ const container = rowValue.childAt(0);
+ expect(container.type()).toBe("span");
+ expect(container.prop("role")).toBe("presentation");
+ expect(container.children().length).toBe(2);
+ expect(container.childAt(0).type()).toBe(Rep);
+ const controller = container.childAt(1);
+ expect(controller.type()).toBe(AuditController);
+ expect(controller.children().length).toBe(1);
+ expect(controller.childAt(0).type()).toBe(Badges);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js b/devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js
new file mode 100644
index 0000000000..af37a8318d
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js
@@ -0,0 +1,437 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+
+const MenuButton = require("resource://devtools/client/shared/components/menu/MenuButton.js");
+const ConnectedAccessibilityTreeFilterClass = require("resource://devtools/client/accessibility/components/AccessibilityTreeFilter.js");
+const AccessibilityTreeFilterClass =
+ ConnectedAccessibilityTreeFilterClass.WrappedComponent;
+const AccessibilityTreeFilter = createFactory(
+ ConnectedAccessibilityTreeFilterClass
+);
+const {
+ checkMenuItem,
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const {
+ AUDIT,
+ AUDITING,
+ FILTERS,
+ FILTER_TOGGLE,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+function checkToggleFilterCheckbox(wrapper, filter) {
+ const filterInstance = wrapper.find(AccessibilityTreeFilterClass).instance();
+ filterInstance.toggleFilter = jest.fn();
+ filter.click();
+ expect(filterInstance.toggleFilter.mock.calls.length).toBe(1);
+}
+
+function getMenuItems(wrapper, selector) {
+ const menuButton = wrapper.find(MenuButton);
+ // Focusing on the menu button will trigger rendering of the HTMLTooltip with
+ // the menu list.
+ menuButton.childAt(0).getDOMNode().focus();
+
+ return menuButton
+ .instance()
+ .tooltip.panel.querySelectorAll(`.menuitem ${selector}`);
+}
+
+function checkFiltersState(wrapper, expected) {
+ const filters = getMenuItems(wrapper, ".filter");
+ for (let i = 0; i < filters.length; i++) {
+ checkMenuItem(filters[i], {
+ checked: expected.filters[i].active,
+ label: expected.filters[i].text,
+ disabled: expected.filters[i].disabled,
+ });
+ }
+}
+
+describe("AccessibilityTreeFilter component:", () => {
+ it("audit filter not filtered", () => {
+ const store = setupStore();
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ const accTreeFilter = wrapper.find(AccessibilityTreeFilterClass);
+ const toolbar = accTreeFilter.childAt(0);
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(accTreeFilter.children().length).toBe(1);
+ expect(toolbar.is("div")).toBe(true);
+ expect(toolbar.prop("role")).toBe("group");
+
+ checkFiltersState(wrapper, {
+ filters: [
+ { active: true, disabled: false, text: "None" },
+ { active: false, disabled: false, text: "All Issues" },
+ {
+ active: false,
+ disabled: false,
+ text: "Contrast",
+ },
+ {
+ active: false,
+ disabled: false,
+ text: "Keyboard",
+ },
+ {
+ active: false,
+ disabled: false,
+ text: "Text Labels",
+ },
+ ],
+ });
+ });
+
+ it("audit filters filtered", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ filters: {
+ [FILTERS.ALL]: true,
+ [FILTERS.CONTRAST]: true,
+ [FILTERS.KEYBOARD]: true,
+ [FILTERS.TEXT_LABEL]: true,
+ },
+ auditing: [],
+ },
+ },
+ });
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ checkFiltersState(wrapper, {
+ filters: [
+ { active: false, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ ],
+ });
+ });
+
+ it("audit all filter not filtered auditing", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ filters: {
+ [FILTERS.ALL]: false,
+ },
+ auditing: [FILTERS.ALL],
+ },
+ },
+ });
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ checkFiltersState(wrapper, {
+ filters: [
+ { active: true, disabled: false, text: "None" },
+ { active: false, disabled: true, text: "All Issues" },
+ ],
+ });
+ });
+
+ it("audit other filter not filtered auditing", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ filters: {
+ [FILTERS.ALL]: false,
+ [FILTERS.CONTRAST]: false,
+ [FILTERS.KEYBOARD]: false,
+ [FILTERS.TEXT_LABEL]: false,
+ },
+ auditing: [FILTERS.CONTRAST],
+ },
+ },
+ });
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ checkFiltersState(wrapper, {
+ filters: [
+ { active: true, disabled: true },
+ { active: false, disabled: false },
+ { active: false, disabled: true },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ ],
+ });
+ });
+
+ it("audit all filter filtered auditing", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ filters: {
+ [FILTERS.ALL]: true,
+ },
+ auditing: [FILTERS.ALL],
+ },
+ },
+ });
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ const filters = getMenuItems(wrapper, ".filter");
+ expect(wrapper.html()).toMatchSnapshot();
+ checkMenuItem(filters[1], { checked: true, disabled: true });
+ });
+
+ it("audit other filter filtered auditing", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ filters: {
+ [FILTERS.ALL]: false,
+ [FILTERS.CONTRAST]: true,
+ [FILTERS.KEYBOARD]: false,
+ [FILTERS.TEXT_LABEL]: false,
+ },
+ auditing: [FILTERS.CONTRAST],
+ },
+ },
+ });
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ checkFiltersState(wrapper, {
+ filters: [
+ { active: false, disabled: true },
+ { active: false, disabled: false },
+ { active: true, disabled: true },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ ],
+ });
+ });
+
+ it("toggle filter", () => {
+ const store = setupStore();
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ const filters = getMenuItems(wrapper, ".filter");
+
+ expect(wrapper.html()).toMatchSnapshot();
+ for (const filter of filters) {
+ checkToggleFilterCheckbox(wrapper, filter);
+ }
+ });
+
+ it("render filters after state changes", () => {
+ const store = setupStore();
+ const wrapper = mount(
+ Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document }))
+ );
+ const tests = [
+ {
+ expected: {
+ filters: [
+ { active: true, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: AUDITING,
+ auditing: Object.values(FILTERS),
+ },
+ expected: {
+ filters: [
+ { active: true, disabled: true },
+ { active: false, disabled: true },
+ { active: false, disabled: true },
+ { active: false, disabled: true },
+ { active: false, disabled: true },
+ ],
+ },
+ },
+ {
+ action: {
+ type: AUDIT,
+ response: [],
+ },
+ expected: {
+ filters: [
+ { active: true, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: FILTER_TOGGLE,
+ filter: FILTERS.ALL,
+ },
+ expected: {
+ filters: [
+ { active: false, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: FILTER_TOGGLE,
+ filter: FILTERS.CONTRAST,
+ },
+ expected: {
+ filters: [
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: AUDITING,
+ auditing: [FILTERS.CONTRAST],
+ },
+ expected: {
+ filters: [
+ { active: false, disabled: true },
+ { active: false, disabled: false },
+ { active: false, disabled: true },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: AUDIT,
+ response: [],
+ },
+ expected: {
+ filters: [
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: FILTER_TOGGLE,
+ filter: FILTERS.CONTRAST,
+ },
+ expected: {
+ filters: [
+ { active: false, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ { active: true, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: FILTER_TOGGLE,
+ filter: FILTERS.NONE,
+ },
+ expected: {
+ filters: [
+ { active: true, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: AUDITING,
+ auditing: [FILTERS.TEXT_LABEL],
+ },
+ expected: {
+ filters: [
+ { active: true, disabled: true },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: true },
+ ],
+ },
+ },
+ {
+ action: {
+ type: AUDIT,
+ response: [],
+ },
+ expected: {
+ filters: [
+ { active: true, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ ],
+ },
+ },
+ {
+ action: {
+ type: FILTER_TOGGLE,
+ filter: FILTERS.TEXT_LABEL,
+ },
+ expected: {
+ filters: [
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: false, disabled: false },
+ { active: true, disabled: false },
+ ],
+ },
+ },
+ ];
+
+ for (const test of tests) {
+ const { action, expected } = test;
+ if (action) {
+ store.dispatch(action);
+ wrapper.update();
+ }
+
+ expect(wrapper.html()).toMatchSnapshot();
+ checkFiltersState(wrapper, expected);
+ }
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/audit-controller.test.js b/devtools/client/accessibility/test/node/components/audit-controller.test.js
new file mode 100644
index 0000000000..ad8ba3ee2b
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/audit-controller.test.js
@@ -0,0 +1,91 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const AuditController = createFactory(
+ require("resource://devtools/client/accessibility/components/AuditController.js")
+);
+const {
+ mockAccessible,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+describe("AuditController component:", () => {
+ it("dead accessible actor", () => {
+ const accessibleFront = mockAccessible();
+ const wrapper = mount(
+ AuditController(
+ {
+ accessibleFront,
+ },
+ span()
+ )
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.find("span").length).toBe(1);
+ expect(wrapper.find("span").first().props()).toMatchObject({
+ checks: undefined,
+ });
+
+ const instance = wrapper.instance();
+ expect(accessibleFront.on.mock.calls.length).toBe(1);
+ expect(accessibleFront.off.mock.calls.length).toBe(1);
+ expect(accessibleFront.on.mock.calls[0]).toEqual([
+ "audited",
+ instance.onAudited,
+ ]);
+ expect(accessibleFront.off.mock.calls[0]).toEqual([
+ "audited",
+ instance.onAudited,
+ ]);
+ });
+
+ it("accessible without checks", () => {
+ const accessibleFront = mockAccessible({
+ actorID: "1",
+ });
+ const wrapper = mount(
+ AuditController(
+ {
+ accessibleFront,
+ },
+ span()
+ )
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(accessibleFront.audit.mock.calls.length).toBe(1);
+ expect(accessibleFront.on.mock.calls.length).toBe(1);
+ expect(accessibleFront.off.mock.calls.length).toBe(0);
+ });
+
+ it("accessible with checks", () => {
+ const checks = { foo: "bar" };
+ const accessibleFront = mockAccessible({
+ actorID: "1",
+ checks,
+ });
+ const wrapper = mount(
+ AuditController(
+ {
+ accessibleFront,
+ },
+ span({ className: "child" })
+ )
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.state("checks")).toMatchObject(checks);
+ expect(wrapper.find(".child").prop("checks")).toMatchObject(checks);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/audit-filter.test.js b/devtools/client/accessibility/test/node/components/audit-filter.test.js
new file mode 100644
index 0000000000..a38efa12ae
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/audit-filter.test.js
@@ -0,0 +1,153 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+
+const ConnectedAuditFilterClass = require("resource://devtools/client/accessibility/components/AuditFilter.js");
+const AuditFilterClass = ConnectedAuditFilterClass.WrappedComponent;
+const AuditFilter = createFactory(ConnectedAuditFilterClass);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+const {
+ FILTERS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+describe("AuditController component:", () => {
+ it("audit filter not filtered", () => {
+ const store = setupStore();
+
+ const wrapper = mount(Provider({ store }, AuditFilter({}, span())));
+ expect(wrapper.html()).toMatchSnapshot();
+
+ const filter = wrapper.find(AuditFilterClass);
+ expect(filter.children().length).toBe(1);
+ expect(filter.childAt(0).is("span")).toBe(true);
+ });
+
+ it("audit filter filtered no checks", () => {
+ const store = setupStore({
+ preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } },
+ });
+
+ const wrapper = mount(Provider({ store }, AuditFilter({}, span())));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("audit filter filtered unknown checks", () => {
+ const store = setupStore({
+ preloadedState: { audit: { filters: { tbd: true } } },
+ });
+
+ const wrapper = mount(Provider({ store }, AuditFilter({}, span())));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("audit filter filtered contrast checks success", () => {
+ const store = setupStore({
+ preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } },
+ });
+
+ const wrapper = mount(
+ Provider(
+ { store },
+ AuditFilter(
+ {
+ checks: {
+ CONTRAST: {
+ value: 5.11,
+ color: [255, 0, 0, 1],
+ backgroundColor: [255, 255, 255, 1],
+ isLargeText: false,
+ score: SCORES.AA,
+ },
+ },
+ },
+ span()
+ )
+ )
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("audit filter filtered contrast checks fail", () => {
+ const store = setupStore({
+ preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } },
+ });
+
+ const CONTRAST = {
+ value: 3.1,
+ color: [255, 0, 0, 1],
+ backgroundColor: [255, 255, 255, 1],
+ isLargeText: false,
+ score: SCORES.FAIL,
+ };
+
+ const wrapper = mount(
+ Provider(
+ { store },
+ AuditFilter(
+ {
+ checks: { CONTRAST },
+ },
+ span()
+ )
+ )
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ const filter = wrapper.find(AuditFilterClass);
+ expect(filter.children().length).toBe(1);
+ expect(filter.childAt(0).is("span")).toBe(true);
+ });
+
+ it("audit filter filtered contrast checks fail range", () => {
+ const store = setupStore({
+ preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } },
+ });
+
+ const CONTRAST = {
+ min: 1.19,
+ max: 1.39,
+ color: [128, 128, 128, 1],
+ backgroundColorMin: [219, 106, 116, 1],
+ backgroundColorMax: [156, 145, 211, 1],
+ isLargeText: false,
+ score: SCORES.FAIL,
+ };
+
+ const wrapper = mount(
+ Provider(
+ { store },
+ AuditFilter(
+ {
+ checks: { CONTRAST },
+ },
+ span()
+ )
+ )
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ const filter = wrapper.find(AuditFilterClass);
+ expect(filter.children().length).toBe(1);
+ expect(filter.childAt(0).is("span")).toBe(true);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js b/devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js
new file mode 100644
index 0000000000..797bbce1a1
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js
@@ -0,0 +1,126 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const {
+ accessibility: { AUDIT_TYPE },
+} = require("resource://devtools/shared/constants.js");
+const {
+ AUDIT_PROGRESS,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+const ConnectedAuditProgressOverlayClass = require("resource://devtools/client/accessibility/components/AuditProgressOverlay.js");
+const AuditProgressOverlayClass =
+ ConnectedAuditProgressOverlayClass.WrappedComponent;
+const AuditProgressOverlay = createFactory(ConnectedAuditProgressOverlayClass);
+
+function testTextProgressBar(store, expectedText) {
+ const wrapper = mount(Provider({ store }, AuditProgressOverlay()));
+ expect(wrapper.html()).toMatchSnapshot();
+
+ const overlay = wrapper.find(AuditProgressOverlayClass);
+ expect(overlay.children().length).toBe(1);
+
+ const overlayText = overlay.childAt(0);
+ expect(overlayText.type()).toBe("span");
+ expect(overlayText.prop("id")).toBe("audit-progress-container");
+ expect(overlayText.prop("role")).toBe("progressbar");
+ expect(overlayText.prop("aria-valuetext")).toBe(expectedText);
+ expect(overlayText.text()).toBe(expectedText);
+}
+
+function testProgress(wrapper, percentage) {
+ const progress = wrapper.find("progress");
+ expect(progress.prop("max")).toBe(100);
+ expect(progress.prop("value")).toBe(percentage);
+ expect(progress.hasClass("audit-progress-progressbar")).toBe(true);
+ expect(progress.prop("aria-labelledby")).toBe("audit-progress-container");
+}
+
+describe("AuditProgressOverlay component:", () => {
+ it("render not auditing", () => {
+ const store = setupStore();
+ const wrapper = mount(Provider({ store }, AuditProgressOverlay()));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("render auditing initializing", () => {
+ const store = setupStore({
+ preloadedState: { audit: { auditing: [AUDIT_TYPE.CONTRAST] } },
+ });
+
+ testTextProgressBar(store, "Initializing…");
+ });
+
+ it("render auditing progress", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ auditing: [AUDIT_TYPE.CONTRAST],
+ progress: { total: 5, percentage: 0 },
+ },
+ },
+ });
+
+ const wrapper = mount(Provider({ store }, AuditProgressOverlay()));
+ expect(wrapper.html()).toMatchSnapshot();
+
+ const overlay = wrapper.find(AuditProgressOverlayClass);
+ expect(overlay.children().length).toBe(1);
+
+ const overlayContainer = overlay.childAt(0);
+ expect(overlayContainer.type()).toBe("span");
+ expect(overlayContainer.prop("id")).toBe("audit-progress-container");
+ expect(overlayContainer.children().length).toBe(1);
+
+ expect(overlayContainer.text()).toBe("Checking 5 nodes");
+ expect(overlayContainer.childAt(0).type()).toBe("progress");
+
+ testProgress(wrapper, 0);
+
+ store.dispatch({
+ type: AUDIT_PROGRESS,
+ progress: { total: 5, percentage: 50 },
+ });
+ wrapper.update();
+
+ expect(wrapper.html()).toMatchSnapshot();
+ testProgress(wrapper, 50);
+
+ store.dispatch({
+ type: AUDIT_PROGRESS,
+ progress: { total: 5, percentage: 75 },
+ });
+ wrapper.update();
+
+ expect(wrapper.html()).toMatchSnapshot();
+ testProgress(wrapper, 75);
+ });
+
+ it("render auditing finishing up", () => {
+ const store = setupStore({
+ preloadedState: {
+ audit: {
+ auditing: [AUDIT_TYPE.CONTRAST],
+ progress: { total: 5, percentage: 100 },
+ },
+ },
+ });
+
+ testTextProgressBar(store, "Finishing up…");
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/badge.test.js b/devtools/client/accessibility/test/node/components/badge.test.js
new file mode 100644
index 0000000000..4285d1adb5
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/badge.test.js
@@ -0,0 +1,42 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const BadgeClass = require("resource://devtools/client/accessibility/components/Badge.js");
+const Badge = createFactory(BadgeClass);
+
+describe("Badge component:", () => {
+ const label = "Contrast";
+ const tooltip = "Does not meet WCAG standards for accessible text.";
+ const props = { label, tooltip };
+
+ it("basic render", () => {
+ const store = setupStore();
+ const wrapper = mount(Provider({ store }, Badge(props)));
+ expect(wrapper.html()).toMatchSnapshot();
+
+ const badge = wrapper.find(BadgeClass);
+ expect(badge.children().length).toBe(1);
+ expect(
+ badge.find(`span[aria-label="${label}"][title="${tooltip}"]`)
+ ).toHaveLength(1);
+
+ const badgeText = badge.childAt(0);
+ expect(badgeText.hasClass("audit-badge")).toBe(true);
+ expect(badgeText.hasClass("badge")).toBe(true);
+ expect(badgeText.text()).toBe(label);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/badges.test.js b/devtools/client/accessibility/test/node/components/badges.test.js
new file mode 100644
index 0000000000..c98e4602ac
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/badges.test.js
@@ -0,0 +1,114 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const Badge = require("resource://devtools/client/accessibility/components/Badge.js");
+const Badges = createFactory(
+ require("resource://devtools/client/accessibility/components/Badges.js")
+);
+const ContrastBadge = require("resource://devtools/client/accessibility/components/ContrastBadge.js");
+
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+describe("Badges component:", () => {
+ const store = setupStore();
+
+ it("no props render", () => {
+ const wrapper = mount(Provider({ store }, Badges()));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("null checks render", () => {
+ const wrapper = mount(Provider({ store }, Badges({ checks: null })));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("empty checks render", () => {
+ const wrapper = mount(Provider({ store }, Badges({ checks: {} })));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("unsupported checks render", () => {
+ const wrapper = mount(Provider({ store }, Badges({ checks: { tbd: {} } })));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("contrast ratio success render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ Badges({
+ checks: {
+ CONTRAST: {
+ value: 5.11,
+ color: [255, 0, 0, 1],
+ backgroundColor: [255, 255, 255, 1],
+ isLargeText: false,
+ score: SCORES.AA,
+ },
+ },
+ })
+ )
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("contrast ratio fail render", () => {
+ const CONTRAST = {
+ value: 3.1,
+ color: [255, 0, 0, 1],
+ backgroundColor: [255, 255, 255, 1],
+ isLargeText: false,
+ score: SCORES.FAIL,
+ };
+ const wrapper = mount(
+ Provider({ store }, Badges({ checks: { CONTRAST } }))
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.find(Badge).length).toBe(1);
+ expect(wrapper.find(ContrastBadge).length).toBe(1);
+ expect(wrapper.find(ContrastBadge).first().props()).toMatchObject(CONTRAST);
+ });
+
+ it("contrast ratio fail range render", () => {
+ const CONTRAST = {
+ min: 1.19,
+ max: 1.39,
+ color: [128, 128, 128, 1],
+ backgroundColorMin: [219, 106, 116, 1],
+ backgroundColorMax: [156, 145, 211, 1],
+ isLargeText: false,
+ score: SCORES.FAIL,
+ };
+ const wrapper = mount(
+ Provider({ store }, Badges({ checks: { CONTRAST } }))
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.find(Badge).length).toBe(1);
+ expect(wrapper.find(ContrastBadge).length).toBe(1);
+ expect(wrapper.find(ContrastBadge).first().props()).toMatchObject(CONTRAST);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/check.test.js b/devtools/client/accessibility/test/node/components/check.test.js
new file mode 100644
index 0000000000..ef024ea0ab
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/check.test.js
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const CheckClass = require("resource://devtools/client/accessibility/components/Check.js");
+const Check = createFactory(CheckClass);
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+const {
+ accessibility: {
+ AUDIT_TYPE: { TEXT_LABEL },
+ ISSUE_TYPE: {
+ [TEXT_LABEL]: { AREA_NO_NAME_FROM_ALT },
+ },
+ SCORES: { FAIL },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+const {
+ testCheck,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+describe("Check component:", () => {
+ const props = {
+ id: "accessibility-text-label-header",
+ issue: AREA_NO_NAME_FROM_ALT,
+ score: FAIL,
+ getAnnotation: jest.fn(),
+ };
+
+ it("basic render", () => {
+ const wrapper = mount(LocalizationProvider({ bundles: [] }, Check(props)));
+ expect(wrapper.html()).toMatchSnapshot();
+
+ testCheck(wrapper.childAt(0), {
+ issue: AREA_NO_NAME_FROM_ALT,
+ score: FAIL,
+ });
+ expect(props.getAnnotation.mock.calls.length).toBe(1);
+ expect(props.getAnnotation.mock.calls[0]).toEqual([AREA_NO_NAME_FROM_ALT]);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/contrast-badge.test.js b/devtools/client/accessibility/test/node/components/contrast-badge.test.js
new file mode 100644
index 0000000000..c96134b834
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/contrast-badge.test.js
@@ -0,0 +1,96 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { shallow, mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const Badge = require("resource://devtools/client/accessibility/components/Badge.js");
+const ContrastBadgeClass = require("resource://devtools/client/accessibility/components/ContrastBadge.js");
+const ContrastBadge = createFactory(ContrastBadgeClass);
+
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+describe("ContrastBadge component:", () => {
+ const store = setupStore();
+
+ it("error render", () => {
+ const wrapper = shallow(ContrastBadge({ error: true }));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("success render", () => {
+ const wrapper = shallow(
+ ContrastBadge({
+ value: 5.11,
+ isLargeText: false,
+ score: SCORES.AA,
+ })
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("success range render", () => {
+ const wrapper = shallow(
+ ContrastBadge({
+ min: 5.11,
+ max: 6.25,
+ isLargeText: false,
+ score: SCORES.AA,
+ })
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("success large text render", () => {
+ const wrapper = shallow(
+ ContrastBadge({
+ value: 3.77,
+ isLargeText: true,
+ score: SCORES.AA,
+ })
+ );
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("fail render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ ContrastBadge({
+ value: 3.77,
+ isLargeText: false,
+ score: SCORES.FAIL,
+ })
+ )
+ );
+
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.children().length).toBe(1);
+ const contrastBadge = wrapper.find(ContrastBadgeClass);
+ const badge = contrastBadge.childAt(0);
+ expect(badge.type()).toBe(Badge);
+ expect(badge.props()).toMatchObject({
+ label: "contrast",
+ tooltip: "Does not meet WCAG standards for accessible text.",
+ });
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/display-tabbing-order.test.js b/devtools/client/accessibility/test/node/components/display-tabbing-order.test.js
new file mode 100644
index 0000000000..65952a10e5
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/display-tabbing-order.test.js
@@ -0,0 +1,91 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+const {
+ UPDATE_DISPLAY_TABBING_ORDER,
+} = require("resource://devtools/client/accessibility/constants.js");
+
+const ConnectedDisplayTabbingOrderClass = require("resource://devtools/client/accessibility/components/DisplayTabbingOrder.js");
+const DisplayTabbingOrderClass =
+ ConnectedDisplayTabbingOrderClass.WrappedComponent;
+const DisplayTabbingOrder = createFactory(ConnectedDisplayTabbingOrderClass);
+
+function testCheckbox(wrapper, expected) {
+ expect(wrapper.html()).toMatchSnapshot();
+ const displayTabbingOrder = wrapper.find(DisplayTabbingOrderClass);
+ expect(displayTabbingOrder.children().length).toBe(1);
+
+ // Label checks
+ const label = displayTabbingOrder.childAt(0);
+ expect(label.hasClass("accessibility-tabbing-order")).toBe(true);
+ expect(label.hasClass("devtools-checkbox-label")).toBe(true);
+ expect(label.prop("title")).toBe(
+ "Show tabbing order of elements and their tabbing index."
+ );
+ expect(label.text()).toBe("Show Tabbing Order");
+ expect(label.children().length).toBe(1);
+
+ // Checkbox checks
+ const checkbox = label.childAt(0);
+ expect(checkbox.prop("checked")).toBe(expected.checked);
+ expect(checkbox.prop("disabled")).toBe(!!expected.disabled);
+}
+
+describe("DisplayTabbingOrder component:", () => {
+ it("default render", () => {
+ const store = setupStore();
+ const wrapper = mount(Provider({ store }, DisplayTabbingOrder()));
+
+ testCheckbox(wrapper, { checked: false });
+ });
+
+ it("toggle tabbing order overlay", () => {
+ const store = setupStore();
+ const wrapper = mount(Provider({ store }, DisplayTabbingOrder()));
+
+ expect(wrapper.html()).toMatchSnapshot();
+ const displayTabbingOrderInstance = wrapper
+ .find(DisplayTabbingOrderClass)
+ .instance();
+ displayTabbingOrderInstance.onChange = jest.fn();
+ displayTabbingOrderInstance.forceUpdate();
+ const checkbox = wrapper.find("input");
+ checkbox.simulate("change");
+ expect(displayTabbingOrderInstance.onChange.mock.calls.length).toBe(1);
+ });
+
+ it("displaying tabbing order render/update", () => {
+ const store = setupStore({
+ preloadedState: {
+ ui: {
+ tabbingOrderDisplayed: true,
+ },
+ },
+ });
+ const wrapper = mount(Provider({ store }, DisplayTabbingOrder()));
+
+ testCheckbox(wrapper, { checked: true });
+
+ store.dispatch({
+ type: UPDATE_DISPLAY_TABBING_ORDER,
+ tabbingOrderDisplayed: false,
+ });
+ wrapper.update();
+
+ testCheckbox(wrapper, { checked: false });
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/keyboard-badge.test.js b/devtools/client/accessibility/test/node/components/keyboard-badge.test.js
new file mode 100644
index 0000000000..ae462dd29e
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/keyboard-badge.test.js
@@ -0,0 +1,73 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { shallow, mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const Badge = require("resource://devtools/client/accessibility/components/Badge.js");
+const KeyboardBadgeClass = require("resource://devtools/client/accessibility/components/KeyboardBadge.js");
+const KeyboardBadge = createFactory(KeyboardBadgeClass);
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+function testBadge(wrapper) {
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.children().length).toBe(1);
+ const keyboardBadge = wrapper.find(KeyboardBadgeClass);
+ const badge = keyboardBadge.childAt(0);
+ expect(badge.type()).toBe(Badge);
+ expect(badge.props()).toMatchObject({
+ label: "keyboard",
+ tooltip: "Does not meet WCAG standards for keyboard accessibility.",
+ });
+}
+
+describe("KeyboardBadge component:", () => {
+ const store = setupStore();
+
+ it("error render", () => {
+ const wrapper = shallow(KeyboardBadge({ error: true }));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("fail render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ KeyboardBadge({
+ score: SCORES.FAIL,
+ })
+ )
+ );
+
+ testBadge(wrapper);
+ });
+
+ it("warning render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ KeyboardBadge({
+ score: SCORES.WARNING,
+ })
+ )
+ );
+
+ testBadge(wrapper);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/keyboard-check.test.js b/devtools/client/accessibility/test/node/components/keyboard-check.test.js
new file mode 100644
index 0000000000..d0f16d0bb8
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/keyboard-check.test.js
@@ -0,0 +1,47 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { mount } = require("enzyme");
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const KeyboardCheckClass = require("resource://devtools/client/accessibility/components/KeyboardCheck.js");
+const KeyboardCheck = createFactory(KeyboardCheckClass);
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+const {
+ testCustomCheck,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const {
+ accessibility: {
+ AUDIT_TYPE: { KEYBOARD },
+ ISSUE_TYPE: {
+ [KEYBOARD]: { INTERACTIVE_NO_ACTION, FOCUSABLE_NO_SEMANTICS },
+ },
+ SCORES: { FAIL, WARNING },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+describe("KeyboardCheck component:", () => {
+ const testProps = [
+ { score: FAIL, issue: INTERACTIVE_NO_ACTION },
+ { score: WARNING, issue: FOCUSABLE_NO_SEMANTICS },
+ ];
+
+ for (const props of testProps) {
+ it(`${props.score} render`, () => {
+ const wrapper = mount(
+ LocalizationProvider({ bundles: [] }, KeyboardCheck(props))
+ );
+
+ const keyboardCheck = wrapper.find(KeyboardCheckClass);
+ testCustomCheck(keyboardCheck, props);
+ });
+ }
+});
diff --git a/devtools/client/accessibility/test/node/components/text-label-badge.test.js b/devtools/client/accessibility/test/node/components/text-label-badge.test.js
new file mode 100644
index 0000000000..39510c0e92
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/text-label-badge.test.js
@@ -0,0 +1,86 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { shallow, mount } = require("enzyme");
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ setupStore,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const Badge = require("resource://devtools/client/accessibility/components/Badge.js");
+const TextLabelBadgeClass = require("resource://devtools/client/accessibility/components/TextLabelBadge.js");
+const TextLabelBadge = createFactory(TextLabelBadgeClass);
+const {
+ accessibility: { SCORES },
+} = require("resource://devtools/shared/constants.js");
+
+function testBadge(wrapper) {
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.children().length).toBe(1);
+ const textLabelBadge = wrapper.find(TextLabelBadgeClass);
+ const badge = textLabelBadge.childAt(0);
+ expect(badge.type()).toBe(Badge);
+ expect(badge.props()).toMatchObject({
+ label: "text label",
+ tooltip: "Does not meet WCAG standards for text alternative.",
+ });
+}
+
+describe("TextLabelBadge component:", () => {
+ const store = setupStore();
+
+ it("error render", () => {
+ const wrapper = shallow(TextLabelBadge({ error: true }));
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.isEmptyRender()).toBe(true);
+ });
+
+ it("fail render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ TextLabelBadge({
+ score: SCORES.FAIL,
+ })
+ )
+ );
+
+ testBadge(wrapper);
+ });
+
+ it("warning render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ TextLabelBadge({
+ score: SCORES.WARNING,
+ })
+ )
+ );
+
+ testBadge(wrapper);
+ });
+
+ it("best practices render", () => {
+ const wrapper = mount(
+ Provider(
+ { store },
+ TextLabelBadge({
+ score: SCORES.BEST_PRACTICES,
+ })
+ )
+ );
+
+ testBadge(wrapper);
+ });
+});
diff --git a/devtools/client/accessibility/test/node/components/text-label-check.test.js b/devtools/client/accessibility/test/node/components/text-label-check.test.js
new file mode 100644
index 0000000000..38a56ba3ce
--- /dev/null
+++ b/devtools/client/accessibility/test/node/components/text-label-check.test.js
@@ -0,0 +1,52 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { mount } = require("enzyme");
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const TextLabelCheckClass = require("resource://devtools/client/accessibility/components/TextLabelCheck.js");
+const TextLabelCheck = createFactory(TextLabelCheckClass);
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+const {
+ testCustomCheck,
+} = require("resource://devtools/client/accessibility/test/node/helpers.js");
+
+const {
+ accessibility: {
+ AUDIT_TYPE: { TEXT_LABEL },
+ ISSUE_TYPE: {
+ [TEXT_LABEL]: {
+ AREA_NO_NAME_FROM_ALT,
+ DIALOG_NO_NAME,
+ FORM_NO_VISIBLE_NAME,
+ },
+ },
+ SCORES: { BEST_PRACTICES, FAIL, WARNING },
+ },
+} = require("resource://devtools/shared/constants.js");
+
+describe("TextLabelCheck component:", () => {
+ const testProps = [
+ { issue: AREA_NO_NAME_FROM_ALT, score: FAIL },
+ { issue: FORM_NO_VISIBLE_NAME, score: WARNING },
+ { issue: DIALOG_NO_NAME, score: BEST_PRACTICES },
+ ];
+
+ for (const props of testProps) {
+ it(`${props.score} render`, () => {
+ const wrapper = mount(
+ LocalizationProvider({ bundles: [] }, TextLabelCheck(props))
+ );
+
+ const textLabelCheck = wrapper.find(TextLabelCheckClass);
+ testCustomCheck(textLabelCheck, props);
+ });
+ }
+});
diff --git a/devtools/client/accessibility/test/node/helpers.js b/devtools/client/accessibility/test/node/helpers.js
new file mode 100644
index 0000000000..bfb14c258c
--- /dev/null
+++ b/devtools/client/accessibility/test/node/helpers.js
@@ -0,0 +1,134 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ reducers,
+} = require("resource://devtools/client/accessibility/reducers/index.js");
+const CheckClass = require("resource://devtools/client/accessibility/components/Check.js");
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+
+const {
+ createStore,
+ combineReducers,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+
+/**
+ * Prepare the store for use in testing.
+ */
+function setupStore({ preloadedState } = {}) {
+ const store = createStore(combineReducers(reducers), preloadedState);
+ return store;
+}
+
+/**
+ * Build a mock accessible object.
+ * @param {Object} form
+ * Data similar to what accessible actor passes to accessible front.
+ */
+function mockAccessible(form) {
+ return {
+ on: jest.fn(),
+ off: jest.fn(),
+ isDestroyed: () => !form?.actorID,
+ audit: jest.fn().mockReturnValue(Promise.resolve()),
+ ...form,
+ };
+}
+
+/**
+ *
+ * @param {DOMNode}
+ * DOMNode that corresponds to a menu item in a menu list
+ * @param {Object}
+ * Expected properties:
+ * - role: optional ARIA role for the menu item
+ * - checked: optional checked state for the menu item
+ * - disabled: optional disabled state for the menu item
+ * - label: optional text label for the menu item
+ */
+function checkMenuItem(menuItem, expected) {
+ expect(menuItem.tagName).toBe("BUTTON");
+ if (expected.role) {
+ expect(menuItem.getAttribute("role")).toBe(expected.role);
+ } else if (typeof expected.checked !== "undefined") {
+ expect(menuItem.getAttribute("role")).toBe("menuitemcheckbox");
+ } else {
+ expect(menuItem.getAttribute("role")).toBe("menuitem");
+ }
+
+ if (typeof expected.checked !== "undefined") {
+ expect(menuItem.hasAttribute("aria-checked")).toBe(expected.checked);
+ }
+
+ if (expected.checked) {
+ expect(menuItem.getAttribute("aria-checked")).toBe("true");
+ }
+
+ if (expected.disabled) {
+ expect(menuItem.hasAttribute("disabled")).toBe(true);
+ }
+
+ if (expected.label) {
+ expect(menuItem.textContent).toBe(expected.label);
+ }
+}
+
+/**
+ *
+ * @param {ReactWrapper}
+ * React wrapper for the top level check component.
+ * @param {Object}
+ * Expected audit properties:
+ * - score: audit score
+ * - issue: audit issue type
+ */
+function testCustomCheck(wrapper, props) {
+ expect(wrapper.html()).toMatchSnapshot();
+ expect(wrapper.children().length).toBe(1);
+ const check = wrapper.childAt(0);
+ expect(wrapper.find(CheckClass)).toStrictEqual(check);
+ testCheck(check, props);
+}
+
+/**
+ *
+ * @param {ReactWrapper}
+ * React wrapper for the check component.
+ * @param {Object}
+ * Expected audit properties:
+ * - score: audit score
+ * - issue: audit issue type
+ */
+function testCheck(wrapper, props) {
+ expect(wrapper.html()).toMatchSnapshot();
+ const container = wrapper.childAt(0);
+ expect(container.hasClass("accessibility-check")).toBe(true);
+ expect(container.prop("role")).toBe("presentation");
+ expect(container.prop("tabIndex")).toBe("-1");
+ expect(wrapper.props()).toMatchObject(props);
+
+ const localized = wrapper.find(FluentReact.Localized);
+ expect(localized.length).toBe(3);
+
+ const heading = localized.at(0).childAt(0);
+ expect(heading.type()).toBe("h3");
+ expect(heading.hasClass("accessibility-check-header")).toBe(true);
+
+ const icon = localized.at(1).childAt(0);
+ expect(icon.type()).toBe("img");
+ expect(icon.prop("data-score")).toEqual(props.score);
+
+ const annotation = localized.at(2).childAt(0);
+ expect(annotation.type()).toBe("p");
+ expect(annotation.hasClass("accessibility-check-annotation")).toBe(true);
+}
+
+module.exports = {
+ checkMenuItem,
+ mockAccessible,
+ setupStore,
+ testCheck,
+ testCustomCheck,
+};
diff --git a/devtools/client/accessibility/test/node/jest.config.js b/devtools/client/accessibility/test/node/jest.config.js
new file mode 100644
index 0000000000..c561ec66f4
--- /dev/null
+++ b/devtools/client/accessibility/test/node/jest.config.js
@@ -0,0 +1,19 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/* global __dirname */
+const sharedJestConfig = require(`${__dirname}/../../../shared/test-helpers/shared-jest.config`);
+
+module.exports = {
+ ...sharedJestConfig,
+ moduleNameMapper: {
+ // This needs to be set before the other rules
+ "^resource://devtools/shared/event-emitter": `${__dirname}/node_modules/devtools-modules/src/utils/event-emitter`,
+ ...sharedJestConfig.moduleNameMapper,
+ },
+ setupFiles: ["<rootDir>setup.js"],
+ snapshotSerializers: ["enzyme-to-json/serializer"],
+};
diff --git a/devtools/client/accessibility/test/node/package.json b/devtools/client/accessibility/test/node/package.json
new file mode 100644
index 0000000000..787a47df36
--- /dev/null
+++ b/devtools/client/accessibility/test/node/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "devtools-client-framework-tests",
+ "license": "MPL-2.0",
+ "version": "0.0.1",
+ "engines": {
+ "node": ">=8.9.4"
+ },
+ "scripts": {
+ "test": "jest",
+ "test-ci": "jest --json"
+ },
+ "dependencies": {
+ "@babel/plugin-proposal-async-generator-functions": "^7.2.0",
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
+ "@babel/plugin-proposal-optional-chaining": "^7.8.3",
+ "@babel/plugin-proposal-class-properties": "7.10.4",
+ "babel-plugin-transform-amd-to-commonjs": "1.4.0",
+ "devtools-modules": "1.1.5",
+ "enzyme": "^3.9.0",
+ "enzyme-adapter-react-16": "^1.13.2",
+ "enzyme-to-json": "^3.3.5",
+ "jest": "^24.6.0",
+ "react": "16.4.1",
+ "react-dom": "16.4.1",
+ "react-test-renderer": "16.4.1"
+ }
+}
diff --git a/devtools/client/accessibility/test/node/setup.js b/devtools/client/accessibility/test/node/setup.js
new file mode 100644
index 0000000000..570e4462ae
--- /dev/null
+++ b/devtools/client/accessibility/test/node/setup.js
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+// Configure enzyme with React 16 adapter.
+const Enzyme = require("enzyme");
+const Adapter = require("enzyme-adapter-react-16");
+Enzyme.configure({ adapter: new Adapter() });
+
+const {
+ setMocksInGlobal,
+} = require("resource://devtools/client/shared/test-helpers/shared-node-helpers.js");
+setMocksInGlobal();
diff --git a/devtools/client/accessibility/test/node/yarn.lock b/devtools/client/accessibility/test/node/yarn.lock
new file mode 100644
index 0000000000..b5f7cd09b0
--- /dev/null
+++ b/devtools/client/accessibility/test/node/yarn.lock
@@ -0,0 +1,4316 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@babel/code-frame@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8"
+ integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==
+ dependencies:
+ "@babel/highlight" "^7.0.0"
+
+"@babel/code-frame@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
+ integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==
+ dependencies:
+ "@babel/highlight" "^7.10.4"
+
+"@babel/core@^7.1.0":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a"
+ integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/generator" "^7.4.4"
+ "@babel/helpers" "^7.4.4"
+ "@babel/parser" "^7.4.5"
+ "@babel/template" "^7.4.4"
+ "@babel/traverse" "^7.4.5"
+ "@babel/types" "^7.4.4"
+ convert-source-map "^1.1.0"
+ debug "^4.1.0"
+ json5 "^2.1.0"
+ lodash "^4.17.11"
+ resolve "^1.3.2"
+ semver "^5.4.1"
+ source-map "^0.5.0"
+
+"@babel/generator@^7.11.5":
+ version "7.11.6"
+ resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620"
+ integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==
+ dependencies:
+ "@babel/types" "^7.11.5"
+ jsesc "^2.5.1"
+ source-map "^0.5.0"
+
+"@babel/generator@^7.4.0", "@babel/generator@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041"
+ integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==
+ dependencies:
+ "@babel/types" "^7.4.4"
+ jsesc "^2.5.1"
+ lodash "^4.17.11"
+ source-map "^0.5.0"
+ trim-right "^1.0.1"
+
+"@babel/helper-annotate-as-pure@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32"
+ integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-create-class-features-plugin@^7.10.4":
+ version "7.10.5"
+ resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz#9f61446ba80e8240b0a5c85c6fdac8459d6f259d"
+ integrity sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==
+ dependencies:
+ "@babel/helper-function-name" "^7.10.4"
+ "@babel/helper-member-expression-to-functions" "^7.10.5"
+ "@babel/helper-optimise-call-expression" "^7.10.4"
+ "@babel/helper-plugin-utils" "^7.10.4"
+ "@babel/helper-replace-supers" "^7.10.4"
+ "@babel/helper-split-export-declaration" "^7.10.4"
+
+"@babel/helper-function-name@^7.1.0":
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53"
+ integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==
+ dependencies:
+ "@babel/helper-get-function-arity" "^7.0.0"
+ "@babel/template" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-function-name@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a"
+ integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==
+ dependencies:
+ "@babel/helper-get-function-arity" "^7.10.4"
+ "@babel/template" "^7.10.4"
+ "@babel/types" "^7.10.4"
+
+"@babel/helper-get-function-arity@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3"
+ integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-get-function-arity@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2"
+ integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==
+ dependencies:
+ "@babel/types" "^7.10.4"
+
+"@babel/helper-member-expression-to-functions@^7.10.4", "@babel/helper-member-expression-to-functions@^7.10.5":
+ version "7.11.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz#ae69c83d84ee82f4b42f96e2a09410935a8f26df"
+ integrity sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==
+ dependencies:
+ "@babel/types" "^7.11.0"
+
+"@babel/helper-optimise-call-expression@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673"
+ integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==
+ dependencies:
+ "@babel/types" "^7.10.4"
+
+"@babel/helper-plugin-utils@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250"
+ integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==
+
+"@babel/helper-plugin-utils@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375"
+ integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==
+
+"@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670"
+ integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==
+
+"@babel/helper-remap-async-to-generator@^7.1.0":
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f"
+ integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.0.0"
+ "@babel/helper-wrap-function" "^7.1.0"
+ "@babel/template" "^7.1.0"
+ "@babel/traverse" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-replace-supers@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz#d585cd9388ea06e6031e4cd44b6713cbead9e6cf"
+ integrity sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==
+ dependencies:
+ "@babel/helper-member-expression-to-functions" "^7.10.4"
+ "@babel/helper-optimise-call-expression" "^7.10.4"
+ "@babel/traverse" "^7.10.4"
+ "@babel/types" "^7.10.4"
+
+"@babel/helper-split-export-declaration@^7.10.4", "@babel/helper-split-export-declaration@^7.11.0":
+ version "7.11.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f"
+ integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==
+ dependencies:
+ "@babel/types" "^7.11.0"
+
+"@babel/helper-split-export-declaration@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677"
+ integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==
+ dependencies:
+ "@babel/types" "^7.4.4"
+
+"@babel/helper-validator-identifier@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2"
+ integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==
+
+"@babel/helper-wrap-function@^7.1.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa"
+ integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==
+ dependencies:
+ "@babel/helper-function-name" "^7.1.0"
+ "@babel/template" "^7.1.0"
+ "@babel/traverse" "^7.1.0"
+ "@babel/types" "^7.2.0"
+
+"@babel/helpers@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5"
+ integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==
+ dependencies:
+ "@babel/template" "^7.4.4"
+ "@babel/traverse" "^7.4.4"
+ "@babel/types" "^7.4.4"
+
+"@babel/highlight@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4"
+ integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==
+ dependencies:
+ chalk "^2.0.0"
+ esutils "^2.0.2"
+ js-tokens "^4.0.0"
+
+"@babel/highlight@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143"
+ integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==
+ dependencies:
+ "@babel/helper-validator-identifier" "^7.10.4"
+ chalk "^2.0.0"
+ js-tokens "^4.0.0"
+
+"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872"
+ integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==
+
+"@babel/parser@^7.10.4", "@babel/parser@^7.11.5":
+ version "7.11.5"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037"
+ integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==
+
+"@babel/plugin-proposal-async-generator-functions@^7.2.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e"
+ integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+ "@babel/helper-remap-async-to-generator" "^7.1.0"
+ "@babel/plugin-syntax-async-generators" "^7.2.0"
+
+"@babel/plugin-proposal-class-properties@7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz#a33bf632da390a59c7a8c570045d1115cd778807"
+ integrity sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==
+ dependencies:
+ "@babel/helper-create-class-features-plugin" "^7.10.4"
+ "@babel/helper-plugin-utils" "^7.10.4"
+
+"@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz#e4572253fdeed65cddeecfdab3f928afeb2fd5d2"
+ integrity sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.3"
+ "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0"
+
+"@babel/plugin-proposal-optional-chaining@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.8.3.tgz#ae10b3214cb25f7adb1f3bc87ba42ca10b7e2543"
+ integrity sha512-QIoIR9abkVn+seDE3OjA08jWcs3eZ9+wJCKSRgo3WdEU2csFYgdScb+8qHB3+WXsGJD55u+5hWCISI7ejXS+kg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.3"
+ "@babel/plugin-syntax-optional-chaining" "^7.8.0"
+
+"@babel/plugin-syntax-async-generators@^7.2.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f"
+ integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+
+"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
+ integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/plugin-syntax-object-rest-spread@^7.0.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e"
+ integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+
+"@babel/plugin-syntax-optional-chaining@^7.8.0":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"
+ integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.8.0"
+
+"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
+ integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/parser" "^7.4.4"
+ "@babel/types" "^7.4.4"
+
+"@babel/template@^7.10.4":
+ version "7.10.4"
+ resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278"
+ integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==
+ dependencies:
+ "@babel/code-frame" "^7.10.4"
+ "@babel/parser" "^7.10.4"
+ "@babel/types" "^7.10.4"
+
+"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216"
+ integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/generator" "^7.4.4"
+ "@babel/helper-function-name" "^7.1.0"
+ "@babel/helper-split-export-declaration" "^7.4.4"
+ "@babel/parser" "^7.4.5"
+ "@babel/types" "^7.4.4"
+ debug "^4.1.0"
+ globals "^11.1.0"
+ lodash "^4.17.11"
+
+"@babel/traverse@^7.10.4":
+ version "7.11.5"
+ resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3"
+ integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==
+ dependencies:
+ "@babel/code-frame" "^7.10.4"
+ "@babel/generator" "^7.11.5"
+ "@babel/helper-function-name" "^7.10.4"
+ "@babel/helper-split-export-declaration" "^7.11.0"
+ "@babel/parser" "^7.11.5"
+ "@babel/types" "^7.11.5"
+ debug "^4.1.0"
+ globals "^11.1.0"
+ lodash "^4.17.19"
+
+"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0"
+ integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==
+ dependencies:
+ esutils "^2.0.2"
+ lodash "^4.17.11"
+ to-fast-properties "^2.0.0"
+
+"@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.11.5":
+ version "7.11.5"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.5.tgz#d9de577d01252d77c6800cee039ee64faf75662d"
+ integrity sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==
+ dependencies:
+ "@babel/helper-validator-identifier" "^7.10.4"
+ lodash "^4.17.19"
+ to-fast-properties "^2.0.0"
+
+"@cnakazawa/watch@^1.0.3":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef"
+ integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==
+ dependencies:
+ exec-sh "^0.3.2"
+ minimist "^1.2.0"
+
+"@jest/console@^24.7.1":
+ version "24.7.1"
+ resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"
+ integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==
+ dependencies:
+ "@jest/source-map" "^24.3.0"
+ chalk "^2.0.1"
+ slash "^2.0.0"
+
+"@jest/core@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b"
+ integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/reporters" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ graceful-fs "^4.1.15"
+ jest-changed-files "^24.8.0"
+ jest-config "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve-dependencies "^24.8.0"
+ jest-runner "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ jest-watcher "^24.8.0"
+ micromatch "^3.1.10"
+ p-each-series "^1.0.0"
+ pirates "^4.0.1"
+ realpath-native "^1.1.0"
+ rimraf "^2.5.4"
+ strip-ansi "^5.0.0"
+
+"@jest/environment@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac"
+ integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==
+ dependencies:
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+
+"@jest/fake-timers@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1"
+ integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-mock "^24.8.0"
+
+"@jest/reporters@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729"
+ integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ glob "^7.1.2"
+ istanbul-lib-coverage "^2.0.2"
+ istanbul-lib-instrument "^3.0.1"
+ istanbul-lib-report "^2.0.4"
+ istanbul-lib-source-maps "^3.0.1"
+ istanbul-reports "^2.1.1"
+ jest-haste-map "^24.8.0"
+ jest-resolve "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ node-notifier "^5.2.1"
+ slash "^2.0.0"
+ source-map "^0.6.0"
+ string-length "^2.0.0"
+
+"@jest/source-map@^24.3.0":
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28"
+ integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag==
+ dependencies:
+ callsites "^3.0.0"
+ graceful-fs "^4.1.15"
+ source-map "^0.6.0"
+
+"@jest/test-result@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3"
+ integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/types" "^24.8.0"
+ "@types/istanbul-lib-coverage" "^2.0.0"
+
+"@jest/test-sequencer@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b"
+ integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==
+ dependencies:
+ "@jest/test-result" "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-runner "^24.8.0"
+ jest-runtime "^24.8.0"
+
+"@jest/transform@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5"
+ integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==
+ dependencies:
+ "@babel/core" "^7.1.0"
+ "@jest/types" "^24.8.0"
+ babel-plugin-istanbul "^5.1.0"
+ chalk "^2.0.1"
+ convert-source-map "^1.4.0"
+ fast-json-stable-stringify "^2.0.0"
+ graceful-fs "^4.1.15"
+ jest-haste-map "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-util "^24.8.0"
+ micromatch "^3.1.10"
+ realpath-native "^1.1.0"
+ slash "^2.0.0"
+ source-map "^0.6.1"
+ write-file-atomic "2.4.1"
+
+"@jest/types@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad"
+ integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==
+ dependencies:
+ "@types/istanbul-lib-coverage" "^2.0.0"
+ "@types/istanbul-reports" "^1.1.1"
+ "@types/yargs" "^12.0.9"
+
+"@types/babel__core@^7.1.0":
+ version "7.1.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f"
+ integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+ "@types/babel__generator" "*"
+ "@types/babel__template" "*"
+ "@types/babel__traverse" "*"
+
+"@types/babel__generator@*":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc"
+ integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@types/babel__template@*":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307"
+ integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6":
+ version "7.0.7"
+ resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f"
+ integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==
+ dependencies:
+ "@babel/types" "^7.3.0"
+
+"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
+ integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==
+
+"@types/istanbul-lib-report@*":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c"
+ integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+
+"@types/istanbul-reports@^1.1.1":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a"
+ integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+ "@types/istanbul-lib-report" "*"
+
+"@types/node@*":
+ version "11.13.2"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.2.tgz#dc85dde46aa8740bb4aed54b8104250f8f849503"
+ integrity sha512-HOtU5KqROKT7qX/itKHuTtt5fV0iXbheQvrgbLNXFJQBY/eh+VS5vmmTAVlo3qIGMsypm0G4N1t2AXjy1ZicaQ==
+
+"@types/stack-utils@^1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
+ integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
+
+"@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
+ version "12.0.12"
+ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"
+ integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==
+
+abab@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f"
+ integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==
+
+abbrev@1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
+ integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
+
+acorn-globals@^4.1.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103"
+ integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==
+ dependencies:
+ acorn "^6.0.1"
+ acorn-walk "^6.0.1"
+
+acorn-walk@^6.0.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913"
+ integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==
+
+acorn@^5.5.3:
+ version "5.7.3"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
+ integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
+
+acorn@^6.0.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f"
+ integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==
+
+airbnb-prop-types@^2.13.2:
+ version "2.13.2"
+ resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc"
+ integrity sha512-2FN6DlHr6JCSxPPi25EnqGaXC4OC3/B3k1lCd6MMYrZ51/Gf/1qDfaR+JElzWa+Tl7cY2aYOlsYJGFeQyVHIeQ==
+ dependencies:
+ array.prototype.find "^2.0.4"
+ function.prototype.name "^1.1.0"
+ has "^1.0.3"
+ is-regex "^1.0.4"
+ object-is "^1.0.1"
+ object.assign "^4.1.0"
+ object.entries "^1.1.0"
+ prop-types "^15.7.2"
+ prop-types-exact "^1.2.0"
+ react-is "^16.8.6"
+
+ajv@^6.5.5:
+ version "6.10.0"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
+ integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==
+ dependencies:
+ fast-deep-equal "^2.0.1"
+ fast-json-stable-stringify "^2.0.0"
+ json-schema-traverse "^0.4.1"
+ uri-js "^4.2.2"
+
+ansi-escapes@^3.0.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
+ integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==
+
+ansi-regex@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
+ integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
+
+ansi-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
+ integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
+
+ansi-regex@^4.0.0, ansi-regex@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
+ integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
+
+ansi-styles@^3.2.0, ansi-styles@^3.2.1:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
+ integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
+ dependencies:
+ color-convert "^1.9.0"
+
+anymatch@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
+ integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==
+ dependencies:
+ micromatch "^3.1.4"
+ normalize-path "^2.1.1"
+
+aproba@^1.0.3:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
+ integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
+
+are-we-there-yet@~1.1.2:
+ version "1.1.5"
+ resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
+ integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==
+ dependencies:
+ delegates "^1.0.0"
+ readable-stream "^2.0.6"
+
+arr-diff@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
+ integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=
+
+arr-flatten@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
+ integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==
+
+arr-union@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
+ integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=
+
+array-equal@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
+ integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=
+
+array-filter@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
+ integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=
+
+array-unique@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
+ integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
+
+array.prototype.find@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90"
+ integrity sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.7.0"
+
+array.prototype.flat@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4"
+ integrity sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw==
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.10.0"
+ function-bind "^1.1.1"
+
+asap@~2.0.3:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
+ integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
+
+asn1@~0.2.3:
+ version "0.2.4"
+ resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
+ integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
+ dependencies:
+ safer-buffer "~2.1.0"
+
+assert-plus@1.0.0, assert-plus@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
+ integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
+
+assign-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
+ integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=
+
+astral-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
+ integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
+
+async-limiter@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
+ integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==
+
+asynckit@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
+ integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
+
+atob@^2.1.1:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
+ integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
+
+aws-sign2@~0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
+ integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
+
+aws4@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
+ integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
+
+babel-jest@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589"
+ integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==
+ dependencies:
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/babel__core" "^7.1.0"
+ babel-plugin-istanbul "^5.1.0"
+ babel-preset-jest "^24.6.0"
+ chalk "^2.4.2"
+ slash "^2.0.0"
+
+babel-plugin-istanbul@^5.1.0:
+ version "5.1.4"
+ resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba"
+ integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==
+ dependencies:
+ find-up "^3.0.0"
+ istanbul-lib-instrument "^3.3.0"
+ test-exclude "^5.2.3"
+
+babel-plugin-jest-hoist@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019"
+ integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==
+ dependencies:
+ "@types/babel__traverse" "^7.0.6"
+
+babel-plugin-transform-amd-to-commonjs@1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-transform-amd-to-commonjs/-/babel-plugin-transform-amd-to-commonjs-1.4.0.tgz#d9bc5003eaa26dbdd4e854e453f84903852af2ca"
+ integrity sha512-Xx0kYPn0LPyms+8n2KLn9yd2R5XMb2P1sNe4qn64/UQY5F2KFYlhhhyYUNm/BThfODAzl7rbaOsEfpU2M8iDKQ==
+
+babel-preset-jest@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984"
+ integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==
+ dependencies:
+ "@babel/plugin-syntax-object-rest-spread" "^7.0.0"
+ babel-plugin-jest-hoist "^24.6.0"
+
+balanced-match@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
+ integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
+
+base@^0.11.1:
+ version "0.11.2"
+ resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
+ integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==
+ dependencies:
+ cache-base "^1.0.1"
+ class-utils "^0.3.5"
+ component-emitter "^1.2.1"
+ define-property "^1.0.0"
+ isobject "^3.0.1"
+ mixin-deep "^1.2.0"
+ pascalcase "^0.1.1"
+
+bcrypt-pbkdf@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
+ integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
+ dependencies:
+ tweetnacl "^0.14.3"
+
+boolbase@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
+ integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
+
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+braces@^2.3.1:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
+ integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==
+ dependencies:
+ arr-flatten "^1.1.0"
+ array-unique "^0.3.2"
+ extend-shallow "^2.0.1"
+ fill-range "^4.0.0"
+ isobject "^3.0.1"
+ repeat-element "^1.1.2"
+ snapdragon "^0.8.1"
+ snapdragon-node "^2.0.1"
+ split-string "^3.0.2"
+ to-regex "^3.0.1"
+
+browser-process-hrtime@^0.1.2:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4"
+ integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==
+
+browser-resolve@^1.11.3:
+ version "1.11.3"
+ resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6"
+ integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==
+ dependencies:
+ resolve "1.1.7"
+
+bser@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
+ integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=
+ dependencies:
+ node-int64 "^0.4.0"
+
+buffer-from@^1.0.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
+ integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
+
+cache-base@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
+ integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==
+ dependencies:
+ collection-visit "^1.0.0"
+ component-emitter "^1.2.1"
+ get-value "^2.0.6"
+ has-value "^1.0.0"
+ isobject "^3.0.1"
+ set-value "^2.0.0"
+ to-object-path "^0.3.0"
+ union-value "^1.0.0"
+ unset-value "^1.0.0"
+
+callsites@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
+ integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
+
+camelcase@^5.0.0:
+ version "5.3.1"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
+ integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
+
+capture-exit@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4"
+ integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==
+ dependencies:
+ rsvp "^4.8.4"
+
+caseless@~0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
+ integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
+
+chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
+ integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
+ dependencies:
+ ansi-styles "^3.2.1"
+ escape-string-regexp "^1.0.5"
+ supports-color "^5.3.0"
+
+cheerio@^1.0.0-rc.2:
+ version "1.0.0-rc.3"
+ resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6"
+ integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==
+ dependencies:
+ css-select "~1.2.0"
+ dom-serializer "~0.1.1"
+ entities "~1.1.1"
+ htmlparser2 "^3.9.1"
+ lodash "^4.15.0"
+ parse5 "^3.0.1"
+
+chownr@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494"
+ integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==
+
+ci-info@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
+ integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
+
+class-utils@^0.3.5:
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
+ integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==
+ dependencies:
+ arr-union "^3.1.0"
+ define-property "^0.2.5"
+ isobject "^3.0.0"
+ static-extend "^0.1.1"
+
+cliui@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
+ integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==
+ dependencies:
+ string-width "^2.1.1"
+ strip-ansi "^4.0.0"
+ wrap-ansi "^2.0.0"
+
+co@^4.6.0:
+ version "4.6.0"
+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
+ integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
+
+code-point-at@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
+ integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
+
+collection-visit@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
+ integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=
+ dependencies:
+ map-visit "^1.0.0"
+ object-visit "^1.0.0"
+
+color-convert@^1.9.0:
+ version "1.9.3"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
+ integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
+ dependencies:
+ color-name "1.1.3"
+
+color-name@1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
+ integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
+
+combined-stream@^1.0.6, combined-stream@~1.0.6:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
+ integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
+ dependencies:
+ delayed-stream "~1.0.0"
+
+commander@^2.19.0:
+ version "2.20.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
+ integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
+
+commander@~2.19.0:
+ version "2.19.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
+ integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
+
+component-emitter@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
+ integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
+console-control-strings@^1.0.0, console-control-strings@~1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
+ integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
+
+convert-source-map@^1.1.0, convert-source-map@^1.4.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20"
+ integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==
+ dependencies:
+ safe-buffer "~5.1.1"
+
+copy-descriptor@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
+ integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
+
+core-js@^1.0.0:
+ version "1.2.7"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
+ integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=
+
+core-util-is@1.0.2, core-util-is@~1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
+ integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
+
+cross-spawn@^6.0.0:
+ version "6.0.5"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
+ integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
+ dependencies:
+ nice-try "^1.0.4"
+ path-key "^2.0.1"
+ semver "^5.5.0"
+ shebang-command "^1.2.0"
+ which "^1.2.9"
+
+css-select@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
+ integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
+ dependencies:
+ boolbase "~1.0.0"
+ css-what "2.1"
+ domutils "1.5.1"
+ nth-check "~1.0.1"
+
+css-what@2.1:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
+ integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
+
+cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad"
+ integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==
+
+cssstyle@^1.0.0:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077"
+ integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==
+ dependencies:
+ cssom "0.3.x"
+
+dashdash@^1.12.0:
+ version "1.14.1"
+ resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
+ integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
+ dependencies:
+ assert-plus "^1.0.0"
+
+data-urls@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe"
+ integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==
+ dependencies:
+ abab "^2.0.0"
+ whatwg-mimetype "^2.2.0"
+ whatwg-url "^7.0.0"
+
+debug@^2.1.2, debug@^2.2.0, debug@^2.3.3:
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+ integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
+ dependencies:
+ ms "2.0.0"
+
+debug@^4.1.0, debug@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
+ integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
+ dependencies:
+ ms "^2.1.1"
+
+decamelize@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
+ integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
+
+decode-uri-component@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
+ integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
+
+deep-extend@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
+ integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
+
+deep-is@~0.1.3:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
+ integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
+
+define-properties@^1.1.2, define-properties@^1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
+ integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
+ dependencies:
+ object-keys "^1.0.12"
+
+define-property@^0.2.5:
+ version "0.2.5"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
+ integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=
+ dependencies:
+ is-descriptor "^0.1.0"
+
+define-property@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
+ integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY=
+ dependencies:
+ is-descriptor "^1.0.0"
+
+define-property@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
+ integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==
+ dependencies:
+ is-descriptor "^1.0.2"
+ isobject "^3.0.1"
+
+delayed-stream@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
+ integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
+
+delegates@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
+ integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
+
+detect-libc@^1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
+ integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
+
+detect-newline@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2"
+ integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=
+
+devtools-modules@1.1.5:
+ version "1.1.5"
+ resolved "https://registry.yarnpkg.com/devtools-modules/-/devtools-modules-1.1.5.tgz#55e71233692b4095f0277a00e6bfe3ff374d37f1"
+ integrity sha512-JVdZeQNKhABOeED5tDF6dlQck9SIyR9mq78X13sF3rj1pM87UqP81gfY+ALUqwD3lME0aUpKb3BVIzpIwHuyjQ==
+ dependencies:
+ devtools-services "0.0.1"
+ punycode "^2.1.0"
+
+devtools-services@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/devtools-services/-/devtools-services-0.0.1.tgz#9042600c11d1f4d45cc6ca299588a86fac1fbdd5"
+ integrity sha512-1hq7u0743b5OADkSPc5j0qK6zLKilJdn6YYIt2yN/OvrTbSxeD6+CNquAoeP8q1j5oP8Psi79cTFW8SyIi0VBw==
+
+diff-sequences@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975"
+ integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==
+
+discontinuous-range@1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a"
+ integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=
+
+dom-serializer@0, dom-serializer@~0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
+ integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
+ dependencies:
+ domelementtype "^1.3.0"
+ entities "^1.1.1"
+
+domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
+ integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
+
+domexception@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"
+ integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==
+ dependencies:
+ webidl-conversions "^4.0.2"
+
+domhandler@^2.3.0:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
+ integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
+ dependencies:
+ domelementtype "1"
+
+domutils@1.5.1:
+ version "1.5.1"
+ resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
+ integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
+ dependencies:
+ dom-serializer "0"
+ domelementtype "1"
+
+domutils@^1.5.1:
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
+ integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
+ dependencies:
+ dom-serializer "0"
+ domelementtype "1"
+
+ecc-jsbn@~0.1.1:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
+ integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
+ dependencies:
+ jsbn "~0.1.0"
+ safer-buffer "^2.1.0"
+
+encoding@^0.1.11:
+ version "0.1.12"
+ resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
+ integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=
+ dependencies:
+ iconv-lite "~0.4.13"
+
+end-of-stream@^1.1.0:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
+ integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==
+ dependencies:
+ once "^1.4.0"
+
+entities@^1.1.1, entities@~1.1.1:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
+ integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
+
+enzyme-adapter-react-16@^1.13.2:
+ version "1.14.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.14.0.tgz#204722b769172bcf096cb250d33e6795c1f1858f"
+ integrity sha512-7PcOF7pb4hJUvjY7oAuPGpq3BmlCig3kxXGi2kFx0YzJHppqX1K8IIV9skT1IirxXlu8W7bneKi+oQ10QRnhcA==
+ dependencies:
+ enzyme-adapter-utils "^1.12.0"
+ has "^1.0.3"
+ object.assign "^4.1.0"
+ object.values "^1.1.0"
+ prop-types "^15.7.2"
+ react-is "^16.8.6"
+ react-test-renderer "^16.0.0-0"
+ semver "^5.7.0"
+
+enzyme-adapter-utils@^1.12.0:
+ version "1.12.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93"
+ integrity sha512-wkZvE0VxcFx/8ZsBw0iAbk3gR1d9hK447ebnSYBf95+r32ezBq+XDSAvRErkc4LZosgH8J7et7H7/7CtUuQfBA==
+ dependencies:
+ airbnb-prop-types "^2.13.2"
+ function.prototype.name "^1.1.0"
+ object.assign "^4.1.0"
+ object.fromentries "^2.0.0"
+ prop-types "^15.7.2"
+ semver "^5.6.0"
+
+enzyme-to-json@^3.3.5:
+ version "3.3.5"
+ resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.5.tgz#f8eb82bd3d5941c9d8bc6fd9140030777d17d0af"
+ integrity sha512-DmH1wJ68HyPqKSYXdQqB33ZotwfUhwQZW3IGXaNXgR69Iodaoj8TF/D9RjLdz4pEhGq2Tx2zwNUIjBuqoZeTgA==
+ dependencies:
+ lodash "^4.17.4"
+
+enzyme@^3.9.0:
+ version "3.10.0"
+ resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.10.0.tgz#7218e347c4a7746e133f8e964aada4a3523452f6"
+ integrity sha512-p2yy9Y7t/PFbPoTvrWde7JIYB2ZyGC+NgTNbVEGvZ5/EyoYSr9aG/2rSbVvyNvMHEhw9/dmGUJHWtfQIEiX9pg==
+ dependencies:
+ array.prototype.flat "^1.2.1"
+ cheerio "^1.0.0-rc.2"
+ function.prototype.name "^1.1.0"
+ has "^1.0.3"
+ html-element-map "^1.0.0"
+ is-boolean-object "^1.0.0"
+ is-callable "^1.1.4"
+ is-number-object "^1.0.3"
+ is-regex "^1.0.4"
+ is-string "^1.0.4"
+ is-subset "^0.1.1"
+ lodash.escape "^4.0.1"
+ lodash.isequal "^4.5.0"
+ object-inspect "^1.6.0"
+ object-is "^1.0.1"
+ object.assign "^4.1.0"
+ object.entries "^1.0.4"
+ object.values "^1.0.4"
+ raf "^3.4.0"
+ rst-selector-parser "^2.2.3"
+ string.prototype.trim "^1.1.2"
+
+error-ex@^1.3.1:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
+ integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
+ dependencies:
+ is-arrayish "^0.2.1"
+
+es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.0, es-abstract@^1.5.1, es-abstract@^1.7.0:
+ version "1.13.0"
+ resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
+ integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==
+ dependencies:
+ es-to-primitive "^1.2.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+ is-callable "^1.1.4"
+ is-regex "^1.0.4"
+ object-keys "^1.0.12"
+
+es-to-primitive@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377"
+ integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==
+ dependencies:
+ is-callable "^1.1.4"
+ is-date-object "^1.0.1"
+ is-symbol "^1.0.2"
+
+escape-string-regexp@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+ integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
+
+escodegen@^1.9.1:
+ version "1.11.1"
+ resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510"
+ integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==
+ dependencies:
+ esprima "^3.1.3"
+ estraverse "^4.2.0"
+ esutils "^2.0.2"
+ optionator "^0.8.1"
+ optionalDependencies:
+ source-map "~0.6.1"
+
+esprima@^3.1.3:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
+ integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=
+
+estraverse@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
+ integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=
+
+esutils@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
+ integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=
+
+exec-sh@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b"
+ integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==
+
+execa@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
+ integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
+ dependencies:
+ cross-spawn "^6.0.0"
+ get-stream "^4.0.0"
+ is-stream "^1.1.0"
+ npm-run-path "^2.0.0"
+ p-finally "^1.0.0"
+ signal-exit "^3.0.0"
+ strip-eof "^1.0.0"
+
+exit@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
+ integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=
+
+expand-brackets@^2.1.4:
+ version "2.1.4"
+ resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
+ integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI=
+ dependencies:
+ debug "^2.3.3"
+ define-property "^0.2.5"
+ extend-shallow "^2.0.1"
+ posix-character-classes "^0.1.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+expect@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d"
+ integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ ansi-styles "^3.2.0"
+ jest-get-type "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-regex-util "^24.3.0"
+
+extend-shallow@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
+ integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=
+ dependencies:
+ is-extendable "^0.1.0"
+
+extend-shallow@^3.0.0, extend-shallow@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
+ integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=
+ dependencies:
+ assign-symbols "^1.0.0"
+ is-extendable "^1.0.1"
+
+extend@~3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
+ integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
+
+extglob@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
+ integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==
+ dependencies:
+ array-unique "^0.3.2"
+ define-property "^1.0.0"
+ expand-brackets "^2.1.4"
+ extend-shallow "^2.0.1"
+ fragment-cache "^0.2.1"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+extsprintf@1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
+ integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
+
+extsprintf@^1.2.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
+ integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
+
+fast-deep-equal@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
+ integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
+
+fast-json-stable-stringify@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
+ integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I=
+
+fast-levenshtein@~2.0.4:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
+ integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
+
+fb-watchman@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58"
+ integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=
+ dependencies:
+ bser "^2.0.0"
+
+fbjs@^0.8.16:
+ version "0.8.17"
+ resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
+ integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
+ dependencies:
+ core-js "^1.0.0"
+ isomorphic-fetch "^2.1.1"
+ loose-envify "^1.0.0"
+ object-assign "^4.1.0"
+ promise "^7.1.1"
+ setimmediate "^1.0.5"
+ ua-parser-js "^0.7.18"
+
+fill-range@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
+ integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-number "^3.0.0"
+ repeat-string "^1.6.1"
+ to-regex-range "^2.1.0"
+
+find-up@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
+ integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
+ dependencies:
+ locate-path "^3.0.0"
+
+for-in@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
+ integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=
+
+forever-agent@~0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
+ integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
+
+form-data@~2.3.2:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
+ integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
+ dependencies:
+ asynckit "^0.4.0"
+ combined-stream "^1.0.6"
+ mime-types "^2.1.12"
+
+fragment-cache@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
+ integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=
+ dependencies:
+ map-cache "^0.2.2"
+
+fs-minipass@^1.2.5:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d"
+ integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==
+ dependencies:
+ minipass "^2.2.1"
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
+
+fsevents@^1.2.7:
+ version "1.2.9"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f"
+ integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==
+ dependencies:
+ nan "^2.12.1"
+ node-pre-gyp "^0.12.0"
+
+function-bind@^1.0.2, function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+
+function.prototype.name@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327"
+ integrity sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg==
+ dependencies:
+ define-properties "^1.1.2"
+ function-bind "^1.1.1"
+ is-callable "^1.1.3"
+
+gauge@~2.7.3:
+ version "2.7.4"
+ resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
+ integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=
+ dependencies:
+ aproba "^1.0.3"
+ console-control-strings "^1.0.0"
+ has-unicode "^2.0.0"
+ object-assign "^4.1.0"
+ signal-exit "^3.0.0"
+ string-width "^1.0.1"
+ strip-ansi "^3.0.1"
+ wide-align "^1.1.0"
+
+get-caller-file@^1.0.1:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
+ integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
+
+get-stream@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
+ integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
+ dependencies:
+ pump "^3.0.0"
+
+get-value@^2.0.3, get-value@^2.0.6:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
+ integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=
+
+getpass@^0.1.1:
+ version "0.1.7"
+ resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
+ integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
+ dependencies:
+ assert-plus "^1.0.0"
+
+glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
+ version "7.1.3"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
+ integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
+globals@^11.1.0:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
+ integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
+
+graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:
+ version "4.1.15"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
+ integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
+
+growly@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
+ integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=
+
+handlebars@^4.1.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67"
+ integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==
+ dependencies:
+ neo-async "^2.6.0"
+ optimist "^0.6.1"
+ source-map "^0.6.1"
+ optionalDependencies:
+ uglify-js "^3.1.4"
+
+har-schema@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
+ integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
+
+har-validator@~5.1.0:
+ version "5.1.3"
+ resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
+ integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
+ dependencies:
+ ajv "^6.5.5"
+ har-schema "^2.0.0"
+
+has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+ integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
+
+has-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
+ integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=
+
+has-unicode@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
+ integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
+
+has-value@^0.3.1:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
+ integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=
+ dependencies:
+ get-value "^2.0.3"
+ has-values "^0.1.4"
+ isobject "^2.0.0"
+
+has-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
+ integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=
+ dependencies:
+ get-value "^2.0.6"
+ has-values "^1.0.0"
+ isobject "^3.0.0"
+
+has-values@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
+ integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E=
+
+has-values@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
+ integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=
+ dependencies:
+ is-number "^3.0.0"
+ kind-of "^4.0.0"
+
+has@^1.0.1, has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
+ dependencies:
+ function-bind "^1.1.1"
+
+hosted-git-info@^2.1.4:
+ version "2.7.1"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
+ integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
+
+html-element-map@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.1.tgz#3c4fcb4874ebddfe4283b51c8994e7713782b592"
+ integrity sha512-BZSfdEm6n706/lBfXKWa4frZRZcT5k1cOusw95ijZsHlI+GdgY0v95h6IzO3iIDf2ROwq570YTwqNPqHcNMozw==
+ dependencies:
+ array-filter "^1.0.0"
+
+html-encoding-sniffer@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
+ integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==
+ dependencies:
+ whatwg-encoding "^1.0.1"
+
+htmlparser2@^3.9.1:
+ version "3.10.1"
+ resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
+ integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
+ dependencies:
+ domelementtype "^1.3.1"
+ domhandler "^2.3.0"
+ domutils "^1.5.1"
+ entities "^1.1.1"
+ inherits "^2.0.1"
+ readable-stream "^3.1.1"
+
+http-signature@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
+ integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
+ dependencies:
+ assert-plus "^1.0.0"
+ jsprim "^1.2.2"
+ sshpk "^1.7.0"
+
+iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
+ version "0.4.24"
+ resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+ integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
+ dependencies:
+ safer-buffer ">= 2.1.2 < 3"
+
+ignore-walk@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8"
+ integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==
+ dependencies:
+ minimatch "^3.0.4"
+
+import-local@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d"
+ integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==
+ dependencies:
+ pkg-dir "^3.0.0"
+ resolve-cwd "^2.0.0"
+
+imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
+
+inflight@^1.0.4:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
+ integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
+ dependencies:
+ once "^1.3.0"
+ wrappy "1"
+
+inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
+ integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
+
+ini@~1.3.0:
+ version "1.3.5"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
+ integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
+
+invariant@^2.2.4:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
+ integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
+ dependencies:
+ loose-envify "^1.0.0"
+
+invert-kv@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
+ integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
+
+is-accessor-descriptor@^0.1.6:
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
+ integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=
+ dependencies:
+ kind-of "^3.0.2"
+
+is-accessor-descriptor@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
+ integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==
+ dependencies:
+ kind-of "^6.0.0"
+
+is-arrayish@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
+ integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
+
+is-boolean-object@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93"
+ integrity sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M=
+
+is-buffer@^1.1.5:
+ version "1.1.6"
+ resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
+ integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
+
+is-callable@^1.1.3, is-callable@^1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
+ integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==
+
+is-ci@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
+ integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
+ dependencies:
+ ci-info "^2.0.0"
+
+is-data-descriptor@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
+ integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=
+ dependencies:
+ kind-of "^3.0.2"
+
+is-data-descriptor@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
+ integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==
+ dependencies:
+ kind-of "^6.0.0"
+
+is-date-object@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
+ integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=
+
+is-descriptor@^0.1.0:
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
+ integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==
+ dependencies:
+ is-accessor-descriptor "^0.1.6"
+ is-data-descriptor "^0.1.4"
+ kind-of "^5.0.0"
+
+is-descriptor@^1.0.0, is-descriptor@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
+ integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==
+ dependencies:
+ is-accessor-descriptor "^1.0.0"
+ is-data-descriptor "^1.0.0"
+ kind-of "^6.0.2"
+
+is-extendable@^0.1.0, is-extendable@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
+ integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=
+
+is-extendable@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
+ integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==
+ dependencies:
+ is-plain-object "^2.0.4"
+
+is-fullwidth-code-point@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
+ integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
+ dependencies:
+ number-is-nan "^1.0.0"
+
+is-fullwidth-code-point@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
+ integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
+
+is-generator-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118"
+ integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==
+
+is-number-object@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799"
+ integrity sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=
+
+is-number@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
+ integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=
+ dependencies:
+ kind-of "^3.0.2"
+
+is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
+ integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
+ dependencies:
+ isobject "^3.0.1"
+
+is-regex@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
+ integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=
+ dependencies:
+ has "^1.0.1"
+
+is-stream@^1.0.1, is-stream@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
+ integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
+
+is-string@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64"
+ integrity sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ=
+
+is-subset@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6"
+ integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=
+
+is-symbol@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
+ integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==
+ dependencies:
+ has-symbols "^1.0.0"
+
+is-typedarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
+ integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
+
+is-windows@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
+ integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
+
+is-wsl@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
+ integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=
+
+isarray@1.0.0, isarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
+ integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+
+isexe@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
+ integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
+
+isobject@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
+ integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=
+ dependencies:
+ isarray "1.0.0"
+
+isobject@^3.0.0, isobject@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
+ integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=
+
+isomorphic-fetch@^2.1.1:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
+ integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=
+ dependencies:
+ node-fetch "^1.0.1"
+ whatwg-fetch ">=0.10.0"
+
+isstream@~0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
+ integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
+
+istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49"
+ integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==
+
+istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630"
+ integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==
+ dependencies:
+ "@babel/generator" "^7.4.0"
+ "@babel/parser" "^7.4.3"
+ "@babel/template" "^7.4.0"
+ "@babel/traverse" "^7.4.3"
+ "@babel/types" "^7.4.0"
+ istanbul-lib-coverage "^2.0.5"
+ semver "^6.0.0"
+
+istanbul-lib-report@^2.0.4:
+ version "2.0.8"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33"
+ integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==
+ dependencies:
+ istanbul-lib-coverage "^2.0.5"
+ make-dir "^2.1.0"
+ supports-color "^6.1.0"
+
+istanbul-lib-source-maps@^3.0.1:
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8"
+ integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==
+ dependencies:
+ debug "^4.1.1"
+ istanbul-lib-coverage "^2.0.5"
+ make-dir "^2.1.0"
+ rimraf "^2.6.3"
+ source-map "^0.6.1"
+
+istanbul-reports@^2.1.1:
+ version "2.2.6"
+ resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af"
+ integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==
+ dependencies:
+ handlebars "^4.1.2"
+
+jest-changed-files@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b"
+ integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ execa "^1.0.0"
+ throat "^4.0.0"
+
+jest-cli@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989"
+ integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==
+ dependencies:
+ "@jest/core" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ import-local "^2.0.0"
+ is-ci "^2.0.0"
+ jest-config "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ prompts "^2.0.1"
+ realpath-native "^1.1.0"
+ yargs "^12.0.2"
+
+jest-config@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f"
+ integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==
+ dependencies:
+ "@babel/core" "^7.1.0"
+ "@jest/test-sequencer" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ babel-jest "^24.8.0"
+ chalk "^2.0.1"
+ glob "^7.1.1"
+ jest-environment-jsdom "^24.8.0"
+ jest-environment-node "^24.8.0"
+ jest-get-type "^24.8.0"
+ jest-jasmine2 "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ micromatch "^3.1.10"
+ pretty-format "^24.8.0"
+ realpath-native "^1.1.0"
+
+jest-diff@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172"
+ integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==
+ dependencies:
+ chalk "^2.0.1"
+ diff-sequences "^24.3.0"
+ jest-get-type "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-docblock@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd"
+ integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==
+ dependencies:
+ detect-newline "^2.1.0"
+
+jest-each@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775"
+ integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ jest-get-type "^24.8.0"
+ jest-util "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-environment-jsdom@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857"
+ integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-util "^24.8.0"
+ jsdom "^11.5.1"
+
+jest-environment-node@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231"
+ integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-util "^24.8.0"
+
+jest-get-type@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc"
+ integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==
+
+jest-haste-map@^24.8.0:
+ version "24.8.1"
+ resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982"
+ integrity sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ anymatch "^2.0.0"
+ fb-watchman "^2.0.0"
+ graceful-fs "^4.1.15"
+ invariant "^2.2.4"
+ jest-serializer "^24.4.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ micromatch "^3.1.10"
+ sane "^4.0.3"
+ walker "^1.0.7"
+ optionalDependencies:
+ fsevents "^1.2.7"
+
+jest-jasmine2@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898"
+ integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==
+ dependencies:
+ "@babel/traverse" "^7.1.0"
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ co "^4.6.0"
+ expect "^24.8.0"
+ is-generator-fn "^2.0.0"
+ jest-each "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ pretty-format "^24.8.0"
+ throat "^4.0.0"
+
+jest-leak-detector@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980"
+ integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==
+ dependencies:
+ pretty-format "^24.8.0"
+
+jest-matcher-utils@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495"
+ integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==
+ dependencies:
+ chalk "^2.0.1"
+ jest-diff "^24.8.0"
+ jest-get-type "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-message-util@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b"
+ integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/stack-utils" "^1.0.1"
+ chalk "^2.0.1"
+ micromatch "^3.1.10"
+ slash "^2.0.0"
+ stack-utils "^1.0.1"
+
+jest-mock@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56"
+ integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==
+ dependencies:
+ "@jest/types" "^24.8.0"
+
+jest-pnp-resolver@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a"
+ integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==
+
+jest-regex-util@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36"
+ integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==
+
+jest-resolve-dependencies@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0"
+ integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-snapshot "^24.8.0"
+
+jest-resolve@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f"
+ integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ browser-resolve "^1.11.3"
+ chalk "^2.0.1"
+ jest-pnp-resolver "^1.2.1"
+ realpath-native "^1.1.0"
+
+jest-runner@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb"
+ integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.4.2"
+ exit "^0.1.2"
+ graceful-fs "^4.1.15"
+ jest-config "^24.8.0"
+ jest-docblock "^24.3.0"
+ jest-haste-map "^24.8.0"
+ jest-jasmine2 "^24.8.0"
+ jest-leak-detector "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-resolve "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ source-map-support "^0.5.6"
+ throat "^4.0.0"
+
+jest-runtime@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620"
+ integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/environment" "^24.8.0"
+ "@jest/source-map" "^24.3.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/yargs" "^12.0.2"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ glob "^7.1.3"
+ graceful-fs "^4.1.15"
+ jest-config "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ realpath-native "^1.1.0"
+ slash "^2.0.0"
+ strip-bom "^3.0.0"
+ yargs "^12.0.2"
+
+jest-serializer@^24.4.0:
+ version "24.4.0"
+ resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3"
+ integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==
+
+jest-snapshot@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6"
+ integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==
+ dependencies:
+ "@babel/types" "^7.0.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ expect "^24.8.0"
+ jest-diff "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-resolve "^24.8.0"
+ mkdirp "^0.5.1"
+ natural-compare "^1.4.0"
+ pretty-format "^24.8.0"
+ semver "^5.5.0"
+
+jest-util@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1"
+ integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/source-map" "^24.3.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ callsites "^3.0.0"
+ chalk "^2.0.1"
+ graceful-fs "^4.1.15"
+ is-ci "^2.0.0"
+ mkdirp "^0.5.1"
+ slash "^2.0.0"
+ source-map "^0.6.0"
+
+jest-validate@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849"
+ integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ camelcase "^5.0.0"
+ chalk "^2.0.1"
+ jest-get-type "^24.8.0"
+ leven "^2.1.0"
+ pretty-format "^24.8.0"
+
+jest-watcher@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4"
+ integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==
+ dependencies:
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/yargs" "^12.0.9"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.1"
+ jest-util "^24.8.0"
+ string-length "^2.0.0"
+
+jest-worker@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3"
+ integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==
+ dependencies:
+ merge-stream "^1.0.1"
+ supports-color "^6.1.0"
+
+jest@^24.6.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081"
+ integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==
+ dependencies:
+ import-local "^2.0.0"
+ jest-cli "^24.8.0"
+
+"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
+ integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
+
+jsbn@~0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
+ integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
+
+jsdom@^11.5.1:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8"
+ integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==
+ dependencies:
+ abab "^2.0.0"
+ acorn "^5.5.3"
+ acorn-globals "^4.1.0"
+ array-equal "^1.0.0"
+ cssom ">= 0.3.2 < 0.4.0"
+ cssstyle "^1.0.0"
+ data-urls "^1.0.0"
+ domexception "^1.0.1"
+ escodegen "^1.9.1"
+ html-encoding-sniffer "^1.0.2"
+ left-pad "^1.3.0"
+ nwsapi "^2.0.7"
+ parse5 "4.0.0"
+ pn "^1.1.0"
+ request "^2.87.0"
+ request-promise-native "^1.0.5"
+ sax "^1.2.4"
+ symbol-tree "^3.2.2"
+ tough-cookie "^2.3.4"
+ w3c-hr-time "^1.0.1"
+ webidl-conversions "^4.0.2"
+ whatwg-encoding "^1.0.3"
+ whatwg-mimetype "^2.1.0"
+ whatwg-url "^6.4.1"
+ ws "^5.2.0"
+ xml-name-validator "^3.0.0"
+
+jsesc@^2.5.1:
+ version "2.5.2"
+ resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
+ integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
+
+json-parse-better-errors@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
+ integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
+
+json-schema-traverse@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
+ integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
+
+json-schema@0.2.3:
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
+ integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
+
+json-stringify-safe@~5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
+ integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
+
+json5@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850"
+ integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==
+ dependencies:
+ minimist "^1.2.0"
+
+jsprim@^1.2.2:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
+ integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
+ dependencies:
+ assert-plus "1.0.0"
+ extsprintf "1.3.0"
+ json-schema "0.2.3"
+ verror "1.10.0"
+
+kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
+ integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=
+ dependencies:
+ is-buffer "^1.1.5"
+
+kind-of@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
+ integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc=
+ dependencies:
+ is-buffer "^1.1.5"
+
+kind-of@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
+ integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==
+
+kind-of@^6.0.0, kind-of@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
+ integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==
+
+kleur@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
+ integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
+
+lcid@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf"
+ integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==
+ dependencies:
+ invert-kv "^2.0.0"
+
+left-pad@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
+ integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
+
+leven@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
+ integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA=
+
+levn@~0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
+ integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=
+ dependencies:
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+
+load-json-file@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
+ integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs=
+ dependencies:
+ graceful-fs "^4.1.2"
+ parse-json "^4.0.0"
+ pify "^3.0.0"
+ strip-bom "^3.0.0"
+
+locate-path@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
+ integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==
+ dependencies:
+ p-locate "^3.0.0"
+ path-exists "^3.0.0"
+
+lodash.escape@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98"
+ integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=
+
+lodash.flattendeep@^4.4.0:
+ version "4.4.0"
+ resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
+ integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=
+
+lodash.isequal@^4.5.0:
+ version "4.5.0"
+ resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
+ integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
+
+lodash.sortby@^4.7.0:
+ version "4.7.0"
+ resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
+ integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
+
+lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.4:
+ version "4.17.11"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
+ integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
+
+lodash@^4.17.19:
+ version "4.17.20"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
+ integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
+
+loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
+ integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
+ dependencies:
+ js-tokens "^3.0.0 || ^4.0.0"
+
+make-dir@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
+ integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==
+ dependencies:
+ pify "^4.0.1"
+ semver "^5.6.0"
+
+makeerror@1.0.x:
+ version "1.0.11"
+ resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c"
+ integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=
+ dependencies:
+ tmpl "1.0.x"
+
+map-age-cleaner@^0.1.1:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
+ integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==
+ dependencies:
+ p-defer "^1.0.0"
+
+map-cache@^0.2.2:
+ version "0.2.2"
+ resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
+ integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=
+
+map-visit@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
+ integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=
+ dependencies:
+ object-visit "^1.0.0"
+
+mem@^4.0.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178"
+ integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==
+ dependencies:
+ map-age-cleaner "^0.1.1"
+ mimic-fn "^2.0.0"
+ p-is-promise "^2.0.0"
+
+merge-stream@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
+ integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=
+ dependencies:
+ readable-stream "^2.0.1"
+
+micromatch@^3.1.10, micromatch@^3.1.4:
+ version "3.1.10"
+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
+ integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==
+ dependencies:
+ arr-diff "^4.0.0"
+ array-unique "^0.3.2"
+ braces "^2.3.1"
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ extglob "^2.0.4"
+ fragment-cache "^0.2.1"
+ kind-of "^6.0.2"
+ nanomatch "^1.2.9"
+ object.pick "^1.3.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.2"
+
+mime-db@~1.38.0:
+ version "1.38.0"
+ resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad"
+ integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==
+
+mime-types@^2.1.12, mime-types@~2.1.19:
+ version "2.1.22"
+ resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd"
+ integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==
+ dependencies:
+ mime-db "~1.38.0"
+
+mimic-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
+ integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
+
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
+ dependencies:
+ brace-expansion "^1.1.7"
+
+minimist@0.0.8:
+ version "0.0.8"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
+ integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
+
+minimist@^1.1.1, minimist@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
+ integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
+
+minimist@~0.0.1:
+ version "0.0.10"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
+ integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=
+
+minipass@^2.2.1, minipass@^2.3.4:
+ version "2.3.5"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848"
+ integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==
+ dependencies:
+ safe-buffer "^5.1.2"
+ yallist "^3.0.0"
+
+minizlib@^1.1.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614"
+ integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==
+ dependencies:
+ minipass "^2.2.1"
+
+mixin-deep@^1.2.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
+ integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==
+ dependencies:
+ for-in "^1.0.2"
+ is-extendable "^1.0.1"
+
+mkdirp@^0.5.0, mkdirp@^0.5.1:
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
+ integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
+ dependencies:
+ minimist "0.0.8"
+
+moo@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
+ integrity sha512-gFD2xGCl8YFgGHsqJ9NKRVdwlioeW3mI1iqfLNYQOv0+6JRwG58Zk9DIGQgyIaffSYaO1xsKnMaYzzNr1KyIAw==
+
+ms@2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
+ integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
+
+ms@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
+ integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
+
+nan@^2.12.1:
+ version "2.14.0"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
+ integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==
+
+nanomatch@^1.2.9:
+ version "1.2.13"
+ resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
+ integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==
+ dependencies:
+ arr-diff "^4.0.0"
+ array-unique "^0.3.2"
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ fragment-cache "^0.2.1"
+ is-windows "^1.0.2"
+ kind-of "^6.0.2"
+ object.pick "^1.3.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+natural-compare@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+ integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
+
+nearley@^2.7.10:
+ version "2.16.0"
+ resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.16.0.tgz#77c297d041941d268290ec84b739d0ee297e83a7"
+ integrity sha512-Tr9XD3Vt/EujXbZBv6UAHYoLUSMQAxSsTnm9K3koXzjzNWY195NqALeyrzLZBKzAkL3gl92BcSogqrHjD8QuUg==
+ dependencies:
+ commander "^2.19.0"
+ moo "^0.4.3"
+ railroad-diagrams "^1.0.0"
+ randexp "0.4.6"
+ semver "^5.4.1"
+
+needle@^2.2.1:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e"
+ integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==
+ dependencies:
+ debug "^2.1.2"
+ iconv-lite "^0.4.4"
+ sax "^1.2.4"
+
+neo-async@^2.6.0:
+ version "2.6.0"
+ resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835"
+ integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==
+
+nice-try@^1.0.4:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
+ integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
+
+node-fetch@^1.0.1:
+ version "1.7.3"
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
+ integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==
+ dependencies:
+ encoding "^0.1.11"
+ is-stream "^1.0.1"
+
+node-int64@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
+ integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=
+
+node-modules-regexp@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40"
+ integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=
+
+node-notifier@^5.2.1:
+ version "5.4.0"
+ resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a"
+ integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==
+ dependencies:
+ growly "^1.3.0"
+ is-wsl "^1.1.0"
+ semver "^5.5.0"
+ shellwords "^0.1.1"
+ which "^1.3.0"
+
+node-pre-gyp@^0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149"
+ integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==
+ dependencies:
+ detect-libc "^1.0.2"
+ mkdirp "^0.5.1"
+ needle "^2.2.1"
+ nopt "^4.0.1"
+ npm-packlist "^1.1.6"
+ npmlog "^4.0.2"
+ rc "^1.2.7"
+ rimraf "^2.6.1"
+ semver "^5.3.0"
+ tar "^4"
+
+nopt@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
+ integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=
+ dependencies:
+ abbrev "1"
+ osenv "^0.1.4"
+
+normalize-package-data@^2.3.2:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
+ integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==
+ dependencies:
+ hosted-git-info "^2.1.4"
+ resolve "^1.10.0"
+ semver "2 || 3 || 4 || 5"
+ validate-npm-package-license "^3.0.1"
+
+normalize-path@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
+ integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=
+ dependencies:
+ remove-trailing-separator "^1.0.1"
+
+npm-bundled@^1.0.1:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd"
+ integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==
+
+npm-packlist@^1.1.6:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc"
+ integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==
+ dependencies:
+ ignore-walk "^3.0.1"
+ npm-bundled "^1.0.1"
+
+npm-run-path@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
+ integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=
+ dependencies:
+ path-key "^2.0.0"
+
+npmlog@^4.0.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
+ integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
+ dependencies:
+ are-we-there-yet "~1.1.2"
+ console-control-strings "~1.1.0"
+ gauge "~2.7.3"
+ set-blocking "~2.0.0"
+
+nth-check@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
+ integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
+ dependencies:
+ boolbase "~1.0.0"
+
+number-is-nan@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
+ integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
+
+nwsapi@^2.0.7:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.3.tgz#25f3a5cec26c654f7376df6659cdf84b99df9558"
+ integrity sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A==
+
+oauth-sign@~0.9.0:
+ version "0.9.0"
+ resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
+ integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
+
+object-assign@^4.1.0, object-assign@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
+ integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
+
+object-copy@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
+ integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw=
+ dependencies:
+ copy-descriptor "^0.1.0"
+ define-property "^0.2.5"
+ kind-of "^3.0.3"
+
+object-inspect@^1.6.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
+ integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==
+
+object-is@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6"
+ integrity sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=
+
+object-keys@^1.0.11, object-keys@^1.0.12:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
+ integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
+
+object-visit@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
+ integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=
+ dependencies:
+ isobject "^3.0.0"
+
+object.assign@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
+ integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==
+ dependencies:
+ define-properties "^1.1.2"
+ function-bind "^1.1.1"
+ has-symbols "^1.0.0"
+ object-keys "^1.0.11"
+
+object.entries@^1.0.4, object.entries@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
+ integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.12.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
+object.fromentries@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
+ integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.11.0"
+ function-bind "^1.1.1"
+ has "^1.0.1"
+
+object.getownpropertydescriptors@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
+ integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.1"
+
+object.pick@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
+ integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=
+ dependencies:
+ isobject "^3.0.1"
+
+object.values@^1.0.4, object.values@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9"
+ integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.12.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
+once@^1.3.0, once@^1.3.1, once@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
+ dependencies:
+ wrappy "1"
+
+optimist@^0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
+ integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY=
+ dependencies:
+ minimist "~0.0.1"
+ wordwrap "~0.0.2"
+
+optionator@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
+ integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=
+ dependencies:
+ deep-is "~0.1.3"
+ fast-levenshtein "~2.0.4"
+ levn "~0.3.0"
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+ wordwrap "~1.0.0"
+
+os-homedir@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
+ integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
+
+os-locale@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
+ integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==
+ dependencies:
+ execa "^1.0.0"
+ lcid "^2.0.0"
+ mem "^4.0.0"
+
+os-tmpdir@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
+ integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
+
+osenv@^0.1.4:
+ version "0.1.5"
+ resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
+ integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
+ dependencies:
+ os-homedir "^1.0.0"
+ os-tmpdir "^1.0.0"
+
+p-defer@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
+ integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=
+
+p-each-series@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71"
+ integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=
+ dependencies:
+ p-reduce "^1.0.0"
+
+p-finally@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
+ integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
+
+p-is-promise@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
+ integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==
+
+p-limit@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
+ integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==
+ dependencies:
+ p-try "^2.0.0"
+
+p-locate@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
+ integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==
+ dependencies:
+ p-limit "^2.0.0"
+
+p-reduce@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa"
+ integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=
+
+p-try@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
+ integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
+
+parse-json@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
+ integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=
+ dependencies:
+ error-ex "^1.3.1"
+ json-parse-better-errors "^1.0.1"
+
+parse5@4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
+ integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==
+
+parse5@^3.0.1:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c"
+ integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==
+ dependencies:
+ "@types/node" "*"
+
+pascalcase@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
+ integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=
+
+path-exists@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
+ integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
+
+path-is-absolute@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+ integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
+
+path-key@^2.0.0, path-key@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
+ integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
+
+path-parse@^1.0.6:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
+ integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
+
+path-type@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
+ integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==
+ dependencies:
+ pify "^3.0.0"
+
+performance-now@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
+ integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
+
+pify@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
+ integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
+
+pify@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
+ integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==
+
+pirates@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"
+ integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==
+ dependencies:
+ node-modules-regexp "^1.0.0"
+
+pkg-dir@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
+ integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==
+ dependencies:
+ find-up "^3.0.0"
+
+pn@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
+ integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==
+
+posix-character-classes@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
+ integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
+
+prelude-ls@~1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
+ integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
+
+pretty-format@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
+ integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==
+ dependencies:
+ "@jest/types" "^24.8.0"
+ ansi-regex "^4.0.0"
+ ansi-styles "^3.2.0"
+ react-is "^16.8.4"
+
+process-nextick-args@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
+ integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
+
+promise@^7.1.1:
+ version "7.3.1"
+ resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
+ integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==
+ dependencies:
+ asap "~2.0.3"
+
+prompts@^2.0.1:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db"
+ integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==
+ dependencies:
+ kleur "^3.0.2"
+ sisteransi "^1.0.0"
+
+prop-types-exact@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869"
+ integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==
+ dependencies:
+ has "^1.0.3"
+ object.assign "^4.1.0"
+ reflect.ownkeys "^0.2.0"
+
+prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:
+ version "15.7.2"
+ resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
+ integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
+ dependencies:
+ loose-envify "^1.4.0"
+ object-assign "^4.1.1"
+ react-is "^16.8.1"
+
+psl@^1.1.24, psl@^1.1.28:
+ version "1.1.31"
+ resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
+ integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
+
+pump@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
+ integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
+ dependencies:
+ end-of-stream "^1.1.0"
+ once "^1.3.1"
+
+punycode@^1.4.1:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
+ integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
+
+punycode@^2.1.0, punycode@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
+ integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
+
+qs@~6.5.2:
+ version "6.5.2"
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
+ integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
+
+raf@^3.4.0:
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
+ integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
+ dependencies:
+ performance-now "^2.1.0"
+
+railroad-diagrams@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e"
+ integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234=
+
+randexp@0.4.6:
+ version "0.4.6"
+ resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3"
+ integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==
+ dependencies:
+ discontinuous-range "1.0.0"
+ ret "~0.1.10"
+
+rc@^1.2.7:
+ version "1.2.8"
+ resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
+ integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
+ dependencies:
+ deep-extend "^0.6.0"
+ ini "~1.3.0"
+ minimist "^1.2.0"
+ strip-json-comments "~2.0.1"
+
+react-dom@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6"
+ integrity sha512-1Gin+wghF/7gl4Cqcvr1DxFX2Osz7ugxSwl6gBqCMpdrxHjIFUS7GYxrFftZ9Ln44FHw0JxCFD9YtZsrbR5/4A==
+ dependencies:
+ fbjs "^0.8.16"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+
+react-is@^16.4.1, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
+ version "16.8.6"
+ resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
+ integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
+
+react-test-renderer@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.1.tgz#f2fb30c2c7b517db6e5b10ed20bb6b0a7ccd8d70"
+ integrity sha512-wyyiPxRZOTpKnNIgUBOB6xPLTpIzwcQMIURhZvzUqZzezvHjaGNsDPBhMac5fIY3Jf5NuKxoGvV64zDSOECPPQ==
+ dependencies:
+ fbjs "^0.8.16"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+ react-is "^16.4.1"
+
+react-test-renderer@^16.0.0-0:
+ version "16.8.6"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1"
+ integrity sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw==
+ dependencies:
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ react-is "^16.8.6"
+ scheduler "^0.13.6"
+
+react@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32"
+ integrity sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg==
+ dependencies:
+ fbjs "^0.8.16"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+
+read-pkg-up@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978"
+ integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==
+ dependencies:
+ find-up "^3.0.0"
+ read-pkg "^3.0.0"
+
+read-pkg@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
+ integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=
+ dependencies:
+ load-json-file "^4.0.0"
+ normalize-package-data "^2.3.2"
+ path-type "^3.0.0"
+
+readable-stream@^2.0.1, readable-stream@^2.0.6:
+ version "2.3.6"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
+ integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.3"
+ isarray "~1.0.0"
+ process-nextick-args "~2.0.0"
+ safe-buffer "~5.1.1"
+ string_decoder "~1.1.1"
+ util-deprecate "~1.0.1"
+
+readable-stream@^3.1.1:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.3.0.tgz#cb8011aad002eb717bf040291feba8569c986fb9"
+ integrity sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==
+ dependencies:
+ inherits "^2.0.3"
+ string_decoder "^1.1.1"
+ util-deprecate "^1.0.1"
+
+realpath-native@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c"
+ integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==
+ dependencies:
+ util.promisify "^1.0.0"
+
+reflect.ownkeys@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
+ integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=
+
+regex-not@^1.0.0, regex-not@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
+ integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==
+ dependencies:
+ extend-shallow "^3.0.2"
+ safe-regex "^1.1.0"
+
+remove-trailing-separator@^1.0.1:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
+ integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8=
+
+repeat-element@^1.1.2:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce"
+ integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==
+
+repeat-string@^1.6.1:
+ version "1.6.1"
+ resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
+ integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=
+
+request-promise-core@1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346"
+ integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==
+ dependencies:
+ lodash "^4.17.11"
+
+request-promise-native@^1.0.5:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59"
+ integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==
+ dependencies:
+ request-promise-core "1.1.2"
+ stealthy-require "^1.1.1"
+ tough-cookie "^2.3.3"
+
+request@^2.87.0:
+ version "2.88.0"
+ resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
+ integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
+ dependencies:
+ aws-sign2 "~0.7.0"
+ aws4 "^1.8.0"
+ caseless "~0.12.0"
+ combined-stream "~1.0.6"
+ extend "~3.0.2"
+ forever-agent "~0.6.1"
+ form-data "~2.3.2"
+ har-validator "~5.1.0"
+ http-signature "~1.2.0"
+ is-typedarray "~1.0.0"
+ isstream "~0.1.2"
+ json-stringify-safe "~5.0.1"
+ mime-types "~2.1.19"
+ oauth-sign "~0.9.0"
+ performance-now "^2.1.0"
+ qs "~6.5.2"
+ safe-buffer "^5.1.2"
+ tough-cookie "~2.4.3"
+ tunnel-agent "^0.6.0"
+ uuid "^3.3.2"
+
+require-directory@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
+ integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
+
+require-main-filename@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
+ integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=
+
+require-main-filename@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
+ integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
+
+resolve-cwd@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
+ integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=
+ dependencies:
+ resolve-from "^3.0.0"
+
+resolve-from@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
+ integrity sha1-six699nWiBvItuZTM17rywoYh0g=
+
+resolve-url@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
+ integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
+
+resolve@1.1.7:
+ version "1.1.7"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
+ integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
+
+resolve@^1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba"
+ integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==
+ dependencies:
+ path-parse "^1.0.6"
+
+resolve@^1.3.2:
+ version "1.11.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232"
+ integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==
+ dependencies:
+ path-parse "^1.0.6"
+
+ret@~0.1.10:
+ version "0.1.15"
+ resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
+ integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
+
+rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3:
+ version "2.6.3"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
+ integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
+ dependencies:
+ glob "^7.1.3"
+
+rst-selector-parser@^2.2.3:
+ version "2.2.3"
+ resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91"
+ integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE=
+ dependencies:
+ lodash.flattendeep "^4.4.0"
+ nearley "^2.7.10"
+
+rsvp@^4.8.4:
+ version "4.8.5"
+ resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
+ integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==
+
+safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
+ integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
+
+safe-regex@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
+ integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4=
+ dependencies:
+ ret "~0.1.10"
+
+"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
+ integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
+
+sane@^4.0.3:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded"
+ integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==
+ dependencies:
+ "@cnakazawa/watch" "^1.0.3"
+ anymatch "^2.0.0"
+ capture-exit "^2.0.0"
+ exec-sh "^0.3.2"
+ execa "^1.0.0"
+ fb-watchman "^2.0.0"
+ micromatch "^3.1.4"
+ minimist "^1.1.1"
+ walker "~1.0.5"
+
+sax@^1.2.4:
+ version "1.2.4"
+ resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
+ integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
+
+scheduler@^0.13.6:
+ version "0.13.6"
+ resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
+ integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+
+"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0:
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
+ integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
+
+semver@^6.0.0:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b"
+ integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==
+
+set-blocking@^2.0.0, set-blocking@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
+ integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
+
+set-value@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1"
+ integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE=
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-extendable "^0.1.1"
+ is-plain-object "^2.0.1"
+ to-object-path "^0.3.0"
+
+set-value@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274"
+ integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-extendable "^0.1.1"
+ is-plain-object "^2.0.3"
+ split-string "^3.0.1"
+
+setimmediate@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
+ integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
+
+shebang-command@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
+ integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=
+ dependencies:
+ shebang-regex "^1.0.0"
+
+shebang-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
+ integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
+
+shellwords@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
+ integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
+
+signal-exit@^3.0.0, signal-exit@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
+ integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
+
+sisteransi@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c"
+ integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ==
+
+slash@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
+ integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
+
+snapdragon-node@^2.0.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
+ integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==
+ dependencies:
+ define-property "^1.0.0"
+ isobject "^3.0.0"
+ snapdragon-util "^3.0.1"
+
+snapdragon-util@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
+ integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==
+ dependencies:
+ kind-of "^3.2.0"
+
+snapdragon@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d"
+ integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==
+ dependencies:
+ base "^0.11.1"
+ debug "^2.2.0"
+ define-property "^0.2.5"
+ extend-shallow "^2.0.1"
+ map-cache "^0.2.2"
+ source-map "^0.5.6"
+ source-map-resolve "^0.5.0"
+ use "^3.1.0"
+
+source-map-resolve@^0.5.0:
+ version "0.5.2"
+ resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259"
+ integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==
+ dependencies:
+ atob "^2.1.1"
+ decode-uri-component "^0.2.0"
+ resolve-url "^0.2.1"
+ source-map-url "^0.4.0"
+ urix "^0.1.0"
+
+source-map-support@^0.5.6:
+ version "0.5.12"
+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599"
+ integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==
+ dependencies:
+ buffer-from "^1.0.0"
+ source-map "^0.6.0"
+
+source-map-url@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
+ integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=
+
+source-map@^0.5.0, source-map@^0.5.6:
+ version "0.5.7"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
+ integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
+
+source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
+ integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
+
+spdx-correct@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4"
+ integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==
+ dependencies:
+ spdx-expression-parse "^3.0.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-exceptions@^2.1.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977"
+ integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==
+
+spdx-expression-parse@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
+ integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==
+ dependencies:
+ spdx-exceptions "^2.1.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-license-ids@^3.0.0:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1"
+ integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==
+
+split-string@^3.0.1, split-string@^3.0.2:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
+ integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==
+ dependencies:
+ extend-shallow "^3.0.0"
+
+sshpk@^1.7.0:
+ version "1.16.1"
+ resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
+ integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
+ dependencies:
+ asn1 "~0.2.3"
+ assert-plus "^1.0.0"
+ bcrypt-pbkdf "^1.0.0"
+ dashdash "^1.12.0"
+ ecc-jsbn "~0.1.1"
+ getpass "^0.1.1"
+ jsbn "~0.1.0"
+ safer-buffer "^2.0.2"
+ tweetnacl "~0.14.0"
+
+stack-utils@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8"
+ integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==
+
+static-extend@^0.1.1:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
+ integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=
+ dependencies:
+ define-property "^0.2.5"
+ object-copy "^0.1.0"
+
+stealthy-require@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
+ integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
+
+string-length@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
+ integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=
+ dependencies:
+ astral-regex "^1.0.0"
+ strip-ansi "^4.0.0"
+
+string-width@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
+ integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
+ dependencies:
+ code-point-at "^1.0.0"
+ is-fullwidth-code-point "^1.0.0"
+ strip-ansi "^3.0.0"
+
+"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
+ integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
+ dependencies:
+ is-fullwidth-code-point "^2.0.0"
+ strip-ansi "^4.0.0"
+
+string.prototype.trim@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
+ integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.0"
+ function-bind "^1.0.2"
+
+string_decoder@^1.1.1:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d"
+ integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==
+ dependencies:
+ safe-buffer "~5.1.0"
+
+string_decoder@~1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
+ integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
+ dependencies:
+ safe-buffer "~5.1.0"
+
+strip-ansi@^3.0.0, strip-ansi@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
+ integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
+ dependencies:
+ ansi-regex "^2.0.0"
+
+strip-ansi@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
+ integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
+ dependencies:
+ ansi-regex "^3.0.0"
+
+strip-ansi@^5.0.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
+ integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
+ dependencies:
+ ansi-regex "^4.1.0"
+
+strip-bom@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
+ integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
+
+strip-eof@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
+ integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=
+
+strip-json-comments@~2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+ integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
+
+supports-color@^5.3.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
+ dependencies:
+ has-flag "^3.0.0"
+
+supports-color@^6.1.0:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3"
+ integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==
+ dependencies:
+ has-flag "^3.0.0"
+
+symbol-tree@^3.2.2:
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
+ integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=
+
+tar@^4:
+ version "4.4.8"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d"
+ integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==
+ dependencies:
+ chownr "^1.1.1"
+ fs-minipass "^1.2.5"
+ minipass "^2.3.4"
+ minizlib "^1.1.1"
+ mkdirp "^0.5.0"
+ safe-buffer "^5.1.2"
+ yallist "^3.0.2"
+
+test-exclude@^5.2.3:
+ version "5.2.3"
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0"
+ integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==
+ dependencies:
+ glob "^7.1.3"
+ minimatch "^3.0.4"
+ read-pkg-up "^4.0.0"
+ require-main-filename "^2.0.0"
+
+throat@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
+ integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=
+
+tmpl@1.0.x:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
+ integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
+
+to-fast-properties@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
+ integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
+
+to-object-path@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
+ integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=
+ dependencies:
+ kind-of "^3.0.2"
+
+to-regex-range@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
+ integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=
+ dependencies:
+ is-number "^3.0.0"
+ repeat-string "^1.6.1"
+
+to-regex@^3.0.1, to-regex@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
+ integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==
+ dependencies:
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ regex-not "^1.0.2"
+ safe-regex "^1.1.0"
+
+tough-cookie@^2.3.3, tough-cookie@^2.3.4:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
+ integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
+ dependencies:
+ psl "^1.1.28"
+ punycode "^2.1.1"
+
+tough-cookie@~2.4.3:
+ version "2.4.3"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
+ integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
+ dependencies:
+ psl "^1.1.24"
+ punycode "^1.4.1"
+
+tr46@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
+ integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=
+ dependencies:
+ punycode "^2.1.0"
+
+trim-right@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
+ integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=
+
+tunnel-agent@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
+ integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
+ dependencies:
+ safe-buffer "^5.0.1"
+
+tweetnacl@^0.14.3, tweetnacl@~0.14.0:
+ version "0.14.5"
+ resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
+ integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
+
+type-check@~0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
+ integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=
+ dependencies:
+ prelude-ls "~1.1.2"
+
+ua-parser-js@^0.7.18:
+ version "0.7.19"
+ resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b"
+ integrity sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==
+
+uglify-js@^3.1.4:
+ version "3.5.3"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.3.tgz#d490bb5347f23025f0c1bc0dee901d98e4d6b063"
+ integrity sha512-rIQPT2UMDnk4jRX+w4WO84/pebU2jiLsjgIyrCktYgSvx28enOE3iYQMr+BD1rHiitWnDmpu0cY/LfIEpKcjcw==
+ dependencies:
+ commander "~2.19.0"
+ source-map "~0.6.1"
+
+union-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"
+ integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=
+ dependencies:
+ arr-union "^3.1.0"
+ get-value "^2.0.6"
+ is-extendable "^0.1.1"
+ set-value "^0.4.3"
+
+unset-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
+ integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=
+ dependencies:
+ has-value "^0.3.1"
+ isobject "^3.0.0"
+
+uri-js@^4.2.2:
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
+ integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
+ dependencies:
+ punycode "^2.1.0"
+
+urix@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
+ integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
+
+use@^3.1.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
+ integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==
+
+util-deprecate@^1.0.1, util-deprecate@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
+ integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
+
+util.promisify@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
+ integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==
+ dependencies:
+ define-properties "^1.1.2"
+ object.getownpropertydescriptors "^2.0.3"
+
+uuid@^3.3.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
+ integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
+
+validate-npm-package-license@^3.0.1:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
+ integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==
+ dependencies:
+ spdx-correct "^3.0.0"
+ spdx-expression-parse "^3.0.0"
+
+verror@1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
+ integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
+ dependencies:
+ assert-plus "^1.0.0"
+ core-util-is "1.0.2"
+ extsprintf "^1.2.0"
+
+w3c-hr-time@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
+ integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=
+ dependencies:
+ browser-process-hrtime "^0.1.2"
+
+walker@^1.0.7, walker@~1.0.5:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb"
+ integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=
+ dependencies:
+ makeerror "1.0.x"
+
+webidl-conversions@^4.0.2:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
+ integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
+
+whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"
+ integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==
+ dependencies:
+ iconv-lite "0.4.24"
+
+whatwg-fetch@>=0.10.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
+ integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
+
+whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
+ integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==
+
+whatwg-url@^6.4.1:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8"
+ integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==
+ dependencies:
+ lodash.sortby "^4.7.0"
+ tr46 "^1.0.1"
+ webidl-conversions "^4.0.2"
+
+whatwg-url@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd"
+ integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==
+ dependencies:
+ lodash.sortby "^4.7.0"
+ tr46 "^1.0.1"
+ webidl-conversions "^4.0.2"
+
+which-module@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
+ integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
+
+which@^1.2.9, which@^1.3.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
+ integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
+ dependencies:
+ isexe "^2.0.0"
+
+wide-align@^1.1.0:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
+ integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==
+ dependencies:
+ string-width "^1.0.2 || 2"
+
+wordwrap@~0.0.2:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
+ integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc=
+
+wordwrap@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
+ integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
+
+wrap-ansi@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
+ integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=
+ dependencies:
+ string-width "^1.0.1"
+ strip-ansi "^3.0.1"
+
+wrappy@1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+
+write-file-atomic@2.4.1:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529"
+ integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==
+ dependencies:
+ graceful-fs "^4.1.11"
+ imurmurhash "^0.1.4"
+ signal-exit "^3.0.2"
+
+ws@^5.2.0:
+ version "5.2.2"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f"
+ integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==
+ dependencies:
+ async-limiter "~1.0.0"
+
+xml-name-validator@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
+ integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==
+
+"y18n@^3.2.1 || ^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
+ integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
+
+yallist@^3.0.0, yallist@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9"
+ integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==
+
+yargs-parser@^11.1.1:
+ version "11.1.1"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4"
+ integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==
+ dependencies:
+ camelcase "^5.0.0"
+ decamelize "^1.2.0"
+
+yargs@^12.0.2:
+ version "12.0.5"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13"
+ integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==
+ dependencies:
+ cliui "^4.0.0"
+ decamelize "^1.2.0"
+ find-up "^3.0.0"
+ get-caller-file "^1.0.1"
+ os-locale "^3.0.0"
+ require-directory "^2.1.1"
+ require-main-filename "^1.0.1"
+ set-blocking "^2.0.0"
+ string-width "^2.0.0"
+ which-module "^2.0.0"
+ y18n "^3.2.1 || ^4.0.0"
+ yargs-parser "^11.1.1"
diff --git a/devtools/client/accessibility/utils/audit.js b/devtools/client/accessibility/utils/audit.js
new file mode 100644
index 0000000000..6234e711f1
--- /dev/null
+++ b/devtools/client/accessibility/utils/audit.js
@@ -0,0 +1,45 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/**
+ * A helper class that contains the state of the audit progress performed by
+ * the accessibility panel. Its onProgressForWalker function wraps around the
+ * onProgress function (see actions/audit.js) that updates the panel state. It
+ * combines the audits across multiple frames that happen asynchronously. It
+ * only starts dispatching/calling onProgress after we get an initial progress
+ * audit-event from all frames (and thus know the combined total).
+ */
+class CombinedProgress {
+ constructor({ onProgress, totalFrames }) {
+ this.onProgress = onProgress;
+ this.totalFrames = totalFrames;
+ this.combinedProgress = new Map();
+ }
+
+ onProgressForWalker(walker, progress) {
+ this.combinedProgress.set(walker, progress);
+ // We did not get all initial progress events from all frames, do not
+ // relay them to the client until we can calculate combined total below.
+ if (this.combinedProgress.size < this.totalFrames) {
+ return;
+ }
+
+ let combinedTotal = 0;
+ let combinedCompleted = 0;
+
+ for (const { completed, total } of this.combinedProgress.values()) {
+ combinedTotal += total;
+ combinedCompleted += completed;
+ }
+ this.onProgress({
+ total: combinedTotal,
+ percentage: Math.round((combinedCompleted / combinedTotal) * 100),
+ });
+ }
+}
+
+exports.CombinedProgress = CombinedProgress;
+exports.isFiltered = filters => Object.values(filters).some(active => active);
diff --git a/devtools/client/accessibility/utils/l10n.js b/devtools/client/accessibility/utils/l10n.js
new file mode 100644
index 0000000000..0b1052c4fc
--- /dev/null
+++ b/devtools/client/accessibility/utils/l10n.js
@@ -0,0 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { LocalizationHelper } = require("resource://devtools/shared/l10n.js");
+
+const A11Y_STRINGS_URI = "devtools/client/locales/accessibility.properties";
+
+exports.L10N = new LocalizationHelper(A11Y_STRINGS_URI);
diff --git a/devtools/client/accessibility/utils/moz.build b/devtools/client/accessibility/utils/moz.build
new file mode 100644
index 0000000000..8129eea8e5
--- /dev/null
+++ b/devtools/client/accessibility/utils/moz.build
@@ -0,0 +1,5 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules("audit.js", "l10n.js")
diff --git a/devtools/client/application/README.md b/devtools/client/application/README.md
new file mode 100644
index 0000000000..c7abb926f3
--- /dev/null
+++ b/devtools/client/application/README.md
@@ -0,0 +1,334 @@
+# Application
+
+## About the Application panel
+
+The Application panel is a Firefox Developer Tools panel meant to allow the inspection and debugging of features usually present in Progressive Web Apps, such as service workers or the Web App Manifest.
+
+## Technical overview
+
+The Application panel is a React + Redux web app.
+
+### Source directory structure
+
+The application panel lives in the `devtools/client/application` directory. Inside this root directory, the most relevant subdirectories and files are:
+
+```
+.
+├── application.css -> root CSS stylesheet
+├── initializer.js -> panel initialization
+├── src
+│ ├── actions -> Redux actions
+│ ├── components -> React components
+│ ├── modules -> Business logic and helpers
+│ └── reducers -> Redux reducers and states
+└── test
+ ├── browser -> mochitests (e2e/integration)
+ ├── node -> Jest unit tests
+ └── xpcshell -> xpcshell unit tests
+```
+
+### Panel registration
+
+The panel is defined in `devtools/client/application/panel.js` – which in turn calls the `.bootstrap()` method defined in `devtools/client/application/initializer.js`.
+
+The panel is registered along the rest of the Developer Tools panels, in `devtools/client/definitions.js`.
+
+### Localization
+
+The panel uses the [fluent-react](https://github.com/projectfluent/fluent.js/wiki/React-Bindings) library. The localization file is located at `devtools/client/locales/en-US/application.ftl` and it follows [Fluent syntax](https://projectfluent.org/fluent/guide/).
+
+You should read the [Fluent for Firefox developers](https://firefox-source-docs.mozilla.org/l10n/fluent/tutorial.html) and [Guidelines for Fluent Reviewers](https://firefox-source-docs.mozilla.org/intl/l10n/l10n/fluent_review.html) guides.
+
+#### Adding a new string
+
+If you need to localize a text, add a new message ID to the localization file (`devtoos/client/en-US/application.ftl`). Then you can use this ID as a prop for Fluent's `<Localized>` component or `getString()` function.
+
+When using ID's from the React code, always write the full ID instead of building it with concatenation, interpolation, etc. (this makes localing ID's easier afterwards). For instance, let's say you have two ID's, `error-message` and `warning-message`, and you need to use one or the other depending on a condition.
+
+✅ **Do:**
+
+```js
+const localizationIds = {
+ error: "error-message",
+ warning: "warning-message",
+};
+
+const id = localizationIds[messageLevel];
+```
+
+❌ **Don't:**
+
+```js
+const id = `${messageLevel}-message`;
+```
+
+#### Updating an existing string
+
+If you need to modify an existing string, you need to create a new ID and don't remove the previous one. For instance, if we had this string:
+
+```
+some-localized-string = This will be modified later
+```
+
+And we need to update the content, we would create a new ID and remove the previous one intact:
+
+```diff
+- some-localized-string = This will be modified later
++ some-localized-string2 = This is the updated string
+```
+
+Within the React component code, you would use the newly created ID.
+
+```js
+const localizedText = l10n.getString("some-localized-string2");
+```
+
+### React components
+
+Components are located in the `devtools/client/application/src/components` directory.
+
+Each component has a single `.js` file, plus an optional `.css` file, so each component is responsible of handling their own styles.
+
+- The `App` component is the root component of the Application panel.
+- In `components/service-workers` are the components that render all of the UI related to inspect and debug service workers.
+- In `components/manifest` are the components that render everything related to inspecting a Web App Manifest.
+- In the `components/routing` directory there are components related to switching from one section of the panel to the other, like a sidebar or a page switcher container.
+- Inside the `components/ui` directory there are generic UI components that can be reused from other parts of the panel.
+
+### Redux
+
+The Application panel uses Redux to handle app state and communication between components.
+
+#### Substates
+
+The Redux state is set up in `devtools/client/application/src/create-store.js`. The state contains the following substates:
+
+- `workers`: contains data related to inspecting and debugging service workers.
+- `manifest`: contains state related to inspecting the Web App Manifest.
+- `page`: contains general data related to the web page that is being inspected.
+- `ui`: contains data related to the UI that don't really fit any other state.
+
+#### Actions
+
+Synchronous actions are regular Redux actions. Their type is defined in the general constants file (`devtools/client/application/src/constants.js`).
+
+**Asynchronous** actions are achieved thanks to the **thunk middleware**. They follow a three-action pattern `*_START`, `*_SUCCESS`, `*_FAILURE`. For instance:
+
+```js
+function fooAction() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: FOO_START });
+
+ try {
+ const result = await foo();
+ dispatch({ type: FOO_SUCCESS });
+ }
+ catch (err) {
+ console.error(err);
+ dispatch({ type: FOO_FAILURE });
+ }
+ }
+}
+```
+
+#### Middleware
+
+We are using the following middlewares with Redux:
+
+- [redux-thunk](https://github.com/reduxjs/redux-thunk): This is a shared middleware used by other DevTools modules that allows to dispatch asynchronous actions.
+
+### Constants
+
+We are sharing some constants / enum-like constants across the source. They are located in `devtools/client/application/src/constants.js`. For values that are not shared, they should stay within their relevant scope/file.
+
+## Tests
+
+You should read DevTools' general [guidelines for automated tests](https://firefox-source-docs.mozilla.org/devtools/tests/README.html).
+
+### Mochitests (e2e / integration)
+
+End to end and integration tests are made with **Mochitests**. These tests open a browser and will load an HTML and open the toolbox with the Application panel.
+
+These tests are located in `devtools/client/application/test/browser`.
+
+Besides the usual DevTools test helpers, the Application panel adds some other helper functions in `devtools/client/application/test/browser/head.js`
+
+### Unit tests with xpcshell
+
+We are using xpcshell unit tests for the **Redux reducers** in `devtools/client/application/test/xpcshell`.
+
+Other unit tests that don't need Enzyme or other npm modules should be added here too.
+
+### Unit tests with Jest
+
+We are using Jest with Enzyme to test **React components** and **Redux actions** in `devtools/client/application/test/node`. Some considerations:
+
+- There are some **stubs/mocks** for some libraries and modules. These are placed in `devtools/client/application/test/node/fixtures`.
+- The **localization system is mocked**. For `<Localized>` components, the Enzyme snapshots will reflect the localization ID. Ex: `<Localized id="some-localization">`. The actual localized string will not be rendered with `.shallow()`. Calls to `getstring()` will return the string ID that we pass as an argument.
+- The **redux store is mocked** as well. To create a fake store to test a component that uses `connect()` to fetch data from the store, use the helper `setupStore()` included in `devtools/client/application/test/node/helpers.js`.
+
+#### Snapshots
+
+Most Jest tests will involve a snapshot matching expectation.
+
+**Snapshots should be produced with [`shallow()`](https://airbnb.io/enzyme/docs/api/shallow.html)** and _not_ `mount()`, to ensure that we are only testing the current component.
+
+**Components that are wrapped** with `connect()` or other wrapper components, need their snapshot to be rendered with [`dive()`](https://airbnb.io/enzyme/docs/api/ShallowWrapper/dive.html) (one call to `dive()` per wrapper component).
+
+## CSS
+
+We are using a BEM-like style for the following reasons:
+
+- To avoid collision between the styles of components.
+- To have a consistent methodology on how to use CSS.
+- To ensure we have rules with low specificity and thus styles are easier to override and maintain.
+
+### Stylesheet organization
+
+#### File structure
+
+**Each component has its own CSS stylesheet**, in the same directory and with the same name as the JavaScript file, only with a `.css` extension. So `Foo.js` would have a `Foo.css` stylesheet.
+
+These stylesheets are imported from `devtools/client/application/application.css` in alphabetical order –BEM-like naming and low specificity, when done right, should ensure that styles work regardless of the order the stylesheets are included.
+
+#### Base styles
+
+Another important stylesheet is `devtools/client/application/base.css`, which is the one that is imported first from `application.css`, regardless the alphabetical order. In this stylesheet we do:
+
+- Variables definitions
+- Utility classes
+- Some styles that are applied to the whole panel, like some resets or default values.
+
+#### External stylesheets imported in the panel
+
+Besides the usual user-agent styles, all DevTools panels automatically import the stylesheets located at `devtools/client/themes/`. The most relevant for the Application panel are:
+
+- `devtools/client/themes/variables.css`: variables are defined here
+- `devtools/client/themes/common.css`: rules that are applied to every panel
+
+In the Application panel, we are not using some of the classes and rules defined in `common.css`, since they don't follow the BEM convention and some of them have high specificity. However, there are rules defined at the element level and this will get applied to the markup we use.
+
+From `variables.css`, at the moment we mainly use color names. See the section below for details. Other variables available there that contain values for common elements (like heights, widths, etc.) should also be used when we implement those components.
+
+### Colors and themes
+
+All DevTools panels should support both **light and dark themes**. The active theme can be changed by the user at DevTools Settings.
+
+The way this is handled is that a `.theme-light` or `.theme-dark` class is automatically added to the root `<html>` element of each panel. Then, in `variables.css`, there are some CSS variables with different values depending on which of those classes the root element has.
+
+- We should use the colors defined in `variables.css`.
+- If the other panels are using a particular color for an element we also have, we should re-use the same color.
+- If needed, we can create a CSS variable in `base.css` that takes the value of another color variable defined in `variables.css`
+- If the desired color is not available in `variables.css`, we can create a new one, but we have to define values for both light and dark themes.
+
+#### Writing CSS selectors
+
+As mentioned earlier, we are using a system to create rules similar to [BEM](http://getbem.com/naming/), although not strictly identical.
+
+#### Low specificity rules
+
+Rules should have **the lowest specifity** that is possible. In practice, this means that we should try to use a **single class selector** for writing the rule. Ex:
+
+```css
+.manifest-item {
+ /* ... */
+}
+```
+
+Note that **pseudoclasses are pseudoselectors are OK** to use.
+
+#### Hierarchy
+
+When an element is semantically the child of another element, we should also use a single class selector. In BEM, this is achieved by separating potential class names with a double underscore `__`, so we have a single classname.
+
+✅ **Do:**
+
+```css
+.manifest-item { /* ... */ }
+.manifest-item__value { /* ... */ }
+```
+
+❌ **Don't:**
+
+```css
+.manifest-item { /* ... */ }
+.manifest-item .value { /* ... */ }
+```
+
+We should not go deeper than one level of `__`. We don't have to replicate the whole DOM structure:
+
+- If the style rule should be independent of the parent, it does not need to use an `__`.
+- If the style rule does not make sense on its own, and it will be scoped to a particular section of the DOM tree, don't replicate the whole DOM structure and use the top-level ancestor class name instead.
+
+For instance, if we have the following HTML markup and we have to choose a class name for the `<dt>` element:
+
+```html
+<li class="worker">
+ <dl class="worker__data">
+ <dt class="..."></dt>
+ <!-- ... -->
+```
+
+✅ **Do:**
+
+```css
+.worker__meta-name { /* ... */ }
+```
+
+❌ **Don't:**
+
+```css
+.worker__data__meta-name { /* ... */ }
+```
+
+#### Style variations
+
+Sometimes we have a component that should change its style depending on its state, or we have some rules that allow us to customize further how something looks. For instance, we could have a generic rule for buttons, and then some extra rules for primary buttons, or for tiny ones.
+
+In BEM, style variants are created with a double hyphen `--`. For example:
+
+```css
+.ui-button { /* styles for buttons */ }
+.ui-button--micro { /* specific styles for tiny buttons */ }
+```
+
+Then, in the component, _both_ classes are to be used.
+
+```html
+<button class="ui-button ui-button--micro">
+```
+
+#### Base size
+
+Photon has a base unit of `4px` for sizes, paddings, margins… This value is stored in the CSS variable `--base-unit`.
+
+Our sizes and other dimensions should be defined based on this variable. Since we are using raw CSS and not a pre/post processor, we need to use `calc()` to achieve this.
+
+✅ **Do:**
+
+```css
+.ui-button {
+ height: calc(var(--base-unit) * 6);
+ /* ... */
+}
+```
+
+❌ **Don't:**
+
+```css
+.ui-button {
+ height: 24px;
+ /* ... */
+}
+```
+
+---
+
+## Contact
+
+If you have questions about the code, features, planning, etc. the current active team is:
+
+- Product management: Harald Kischner (`:digitarald`)
+- Engineering management: Patrick Brosset (`:pbro`)
+- Engineering: Belén Albeza (`:ladybenko`)
+- Engineering: Ola Gasidlo (`:ola`)
diff --git a/devtools/client/application/application.css b/devtools/client/application/application.css
new file mode 100644
index 0000000000..61b616faec
--- /dev/null
+++ b/devtools/client/application/application.css
@@ -0,0 +1,36 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ /*
+* Global styles
+*/
+@import "chrome://devtools/content/application/src/base.css";
+
+
+/*
+* Components
+*/
+@import "chrome://devtools/content/application/src/components/App.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestColorItem.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestIconItem.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestIssue.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestIssueList.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestItem.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestJsonLink.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestLoader.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestSection.css";
+@import "chrome://devtools/content/application/src/components/manifest/ManifestUrlItem.css";
+@import "chrome://devtools/content/application/src/components/routing/PageSwitcher.css";
+@import "chrome://devtools/content/application/src/components/routing/Sidebar.css";
+@import "chrome://devtools/content/application/src/components/routing/SidebarItem.css";
+@import "chrome://devtools/content/application/src/components/service-workers/Registration.css";
+@import "chrome://devtools/content/application/src/components/service-workers/RegistrationList.css";
+@import "chrome://devtools/content/application/src/components/service-workers/Worker.css";
+@import "chrome://devtools/content/application/src/components/ui/UIButton.css";
+
+html,
+body,
+#mount {
+ height: 100vh;
+}
diff --git a/devtools/client/application/index.html b/devtools/client/application/index.html
new file mode 100644
index 0000000000..0b9bd03512
--- /dev/null
+++ b/devtools/client/application/index.html
@@ -0,0 +1,22 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE html>
+<html dir="">
+ <head>
+ <meta
+ http-equiv="Content-Security-Policy"
+ content="default-src chrome: resource:; img-src http: https: data: chrome:;"
+ />
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/application/application.css"
+ />
+ </head>
+ <body class="theme-body" role="application">
+ <div id="mount"></div>
+ <script src="chrome://devtools/content/shared/theme-switching.js"></script>
+ <script src="resource://devtools/client/application/initializer.js"></script>
+ </body>
+</html>
diff --git a/devtools/client/application/initializer.js b/devtools/client/application/initializer.js
new file mode 100644
index 0000000000..fbfcbc1edc
--- /dev/null
+++ b/devtools/client/application/initializer.js
@@ -0,0 +1,150 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { BrowserLoader } = ChromeUtils.import(
+ "resource://devtools/shared/loader/browser-loader.js"
+);
+const require = BrowserLoader({
+ baseURI: "resource://devtools/client/application/",
+ window,
+}).require;
+
+const {
+ createFactory,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ render,
+ unmountComponentAtNode,
+} = require("resource://devtools/client/shared/vendor/react-dom.js");
+const Provider = createFactory(
+ require("resource://devtools/client/shared/vendor/react-redux.js").Provider
+);
+const {
+ bindActionCreators,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+const {
+ l10n,
+} = require("resource://devtools/client/application/src/modules/l10n.js");
+
+const {
+ configureStore,
+} = require("resource://devtools/client/application/src/create-store.js");
+const actions = require("resource://devtools/client/application/src/actions/index.js");
+
+const {
+ WorkersListener,
+} = require("resource://devtools/client/shared/workers-listener.js");
+
+const {
+ services,
+} = require("resource://devtools/client/application/src/modules/application-services.js");
+
+const App = createFactory(
+ require("resource://devtools/client/application/src/components/App.js")
+);
+
+const {
+ safeAsyncMethod,
+} = require("resource://devtools/shared/async-utils.js");
+
+/**
+ * Global Application object in this panel. This object is expected by panel.js and is
+ * called to start the UI for the panel.
+ */
+window.Application = {
+ async bootstrap({ toolbox, commands, panel }) {
+ // bind event handlers to `this`
+ this.updateDomain = this.updateDomain.bind(this);
+
+ // wrap updateWorkers to swallow rejections occurring after destroy
+ this.safeUpdateWorkers = safeAsyncMethod(
+ () => this.updateWorkers(),
+ () => this._destroyed
+ );
+
+ this.toolbox = toolbox;
+ this._commands = commands;
+ this.client = commands.client;
+
+ this.store = configureStore(toolbox.telemetry);
+ this.actions = bindActionCreators(actions, this.store.dispatch);
+
+ services.init(this.toolbox);
+ await l10n.init(["devtools/client/application.ftl"]);
+
+ await this.updateWorkers();
+ this.workersListener = new WorkersListener(this.client.mainRoot);
+ this.workersListener.addListener(this.safeUpdateWorkers);
+
+ const deviceFront = await this.client.mainRoot.getFront("device");
+ const { canDebugServiceWorkers } = await deviceFront.getDescription();
+ this.actions.updateCanDebugWorkers(
+ canDebugServiceWorkers && services.features.doesDebuggerSupportWorkers
+ );
+
+ this.onResourceAvailable = this.onResourceAvailable.bind(this);
+ await this._commands.resourceCommand.watchResources(
+ [this._commands.resourceCommand.TYPES.DOCUMENT_EVENT],
+ {
+ onAvailable: this.onResourceAvailable,
+ }
+ );
+
+ // Render the root Application component.
+ this.mount = document.querySelector("#mount");
+ const app = App({
+ client: this.client,
+ fluentBundles: l10n.getBundles(),
+ });
+ render(Provider({ store: this.store }, app), this.mount);
+ },
+
+ async updateWorkers() {
+ const registrationsWithWorkers =
+ await this.client.mainRoot.listAllServiceWorkers();
+ this.actions.updateWorkers(registrationsWithWorkers);
+ },
+
+ updateDomain() {
+ this.actions.updateDomain(this.toolbox.target.url);
+ },
+
+ handleOnNavigate() {
+ this.updateDomain();
+ this.actions.resetManifest();
+ },
+
+ onResourceAvailable(resources) {
+ // Only consider top level document, and ignore remote iframes top document
+ const hasDocumentDomComplete = resources.some(
+ resource =>
+ resource.resourceType ===
+ this._commands.resourceCommand.TYPES.DOCUMENT_EVENT &&
+ resource.name === "dom-complete" &&
+ resource.targetFront.isTopLevel
+ );
+ if (hasDocumentDomComplete) {
+ this.handleOnNavigate(); // update domain and manifest for the new target
+ }
+ },
+
+ destroy() {
+ this.workersListener.removeListener();
+
+ this._commands.resourceCommand.unwatchResources(
+ [this._commands.resourceCommand.TYPES.DOCUMENT_EVENT],
+ { onAvailable: this.onResourceAvailable }
+ );
+
+ unmountComponentAtNode(this.mount);
+ this.mount = null;
+ this.toolbox = null;
+ this.client = null;
+ this._commands = null;
+ this.workersListener = null;
+ this._destroyed = true;
+ },
+};
diff --git a/devtools/client/application/moz.build b/devtools/client/application/moz.build
new file mode 100644
index 0000000000..7e1b0e26a3
--- /dev/null
+++ b/devtools/client/application/moz.build
@@ -0,0 +1,13 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "src",
+]
+
+DevToolsModules("initializer.js", "panel.js")
+
+BROWSER_CHROME_MANIFESTS += ["test/browser/browser.ini"]
+
+XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.ini"]
diff --git a/devtools/client/application/panel.js b/devtools/client/application/panel.js
new file mode 100644
index 0000000000..58316c53cd
--- /dev/null
+++ b/devtools/client/application/panel.js
@@ -0,0 +1,46 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/**
+ * DevTools panel responsible for the application tool, which lists and allows to debug
+ * service workers.
+ */
+class ApplicationPanel {
+ /**
+ * Constructor.
+ *
+ * @param {Window} panelWin
+ * The frame/window dedicated to this panel.
+ * @param {Toolbox} toolbox
+ * The toolbox instance responsible for this panel.
+ * @param {Object} commands
+ * The commands object with all interfaces defined from devtools/shared/commands/
+ */
+ constructor(panelWin, toolbox, commands) {
+ this.panelWin = panelWin;
+ this.toolbox = toolbox;
+ this.commands = commands;
+ }
+
+ async open() {
+ await this.panelWin.Application.bootstrap({
+ toolbox: this.toolbox,
+ commands: this.commands,
+ panel: this,
+ });
+
+ return this;
+ }
+
+ destroy() {
+ this.panelWin.Application.destroy();
+ this.panelWin = null;
+ this.toolbox = null;
+ this.emit("destroyed");
+ }
+}
+
+exports.ApplicationPanel = ApplicationPanel;
diff --git a/devtools/client/application/src/actions/index.js b/devtools/client/application/src/actions/index.js
new file mode 100644
index 0000000000..67e9cbfd88
--- /dev/null
+++ b/devtools/client/application/src/actions/index.js
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const workers = require("resource://devtools/client/application/src/actions/workers.js");
+const page = require("resource://devtools/client/application/src/actions/page.js");
+const ui = require("resource://devtools/client/application/src/actions/ui.js");
+const manifest = require("resource://devtools/client/application/src/actions/manifest.js");
+
+Object.assign(exports, workers, page, ui, manifest);
diff --git a/devtools/client/application/src/actions/manifest.js b/devtools/client/application/src/actions/manifest.js
new file mode 100644
index 0000000000..050fab2b89
--- /dev/null
+++ b/devtools/client/application/src/actions/manifest.js
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ l10n,
+} = require("resource://devtools/client/application/src/modules/l10n.js");
+
+const {
+ services,
+ ManifestDevToolsError,
+} = require("resource://devtools/client/application/src/modules/application-services.js");
+const {
+ FETCH_MANIFEST_FAILURE,
+ FETCH_MANIFEST_START,
+ FETCH_MANIFEST_SUCCESS,
+ RESET_MANIFEST,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function fetchManifest() {
+ return async ({ dispatch, getState }) => {
+ dispatch({ type: FETCH_MANIFEST_START });
+ try {
+ const manifest = await services.fetchManifest();
+ dispatch({ type: FETCH_MANIFEST_SUCCESS, manifest });
+ } catch (error) {
+ let errorMessage = error.message;
+
+ // since Firefox DevTools errors may not make sense for the user, swap
+ // their message for a generic one.
+ if (error instanceof ManifestDevToolsError) {
+ console.error(error);
+ errorMessage = l10n.getString("manifest-loaded-devtools-error");
+ }
+
+ dispatch({ type: FETCH_MANIFEST_FAILURE, error: errorMessage });
+ }
+ };
+}
+
+function resetManifest() {
+ return { type: RESET_MANIFEST };
+}
+
+module.exports = {
+ fetchManifest,
+ resetManifest,
+};
diff --git a/devtools/client/application/src/actions/moz.build b/devtools/client/application/src/actions/moz.build
new file mode 100644
index 0000000000..f2a41f8674
--- /dev/null
+++ b/devtools/client/application/src/actions/moz.build
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "index.js",
+ "manifest.js",
+ "page.js",
+ "ui.js",
+ "workers.js",
+)
diff --git a/devtools/client/application/src/actions/page.js b/devtools/client/application/src/actions/page.js
new file mode 100644
index 0000000000..1348a4aaa2
--- /dev/null
+++ b/devtools/client/application/src/actions/page.js
@@ -0,0 +1,20 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ UPDATE_DOMAIN,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function updateDomain(url) {
+ return {
+ type: UPDATE_DOMAIN,
+ url,
+ };
+}
+
+module.exports = {
+ updateDomain,
+};
diff --git a/devtools/client/application/src/actions/ui.js b/devtools/client/application/src/actions/ui.js
new file mode 100644
index 0000000000..92de169ab0
--- /dev/null
+++ b/devtools/client/application/src/actions/ui.js
@@ -0,0 +1,20 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ UPDATE_SELECTED_PAGE,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function updateSelectedPage(selectedPage) {
+ return {
+ type: UPDATE_SELECTED_PAGE,
+ selectedPage,
+ };
+}
+
+module.exports = {
+ updateSelectedPage,
+};
diff --git a/devtools/client/application/src/actions/workers.js b/devtools/client/application/src/actions/workers.js
new file mode 100644
index 0000000000..375dfe9ba7
--- /dev/null
+++ b/devtools/client/application/src/actions/workers.js
@@ -0,0 +1,51 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ START_WORKER,
+ UNREGISTER_WORKER,
+ UPDATE_CAN_DEBUG_WORKERS,
+ UPDATE_WORKERS,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function startWorker(worker) {
+ const { registrationFront } = worker;
+ registrationFront.start();
+
+ return {
+ type: START_WORKER,
+ };
+}
+
+function unregisterWorker(registration) {
+ const { registrationFront } = registration;
+ registrationFront.unregister();
+
+ return {
+ type: UNREGISTER_WORKER,
+ };
+}
+
+function updateWorkers(workers) {
+ return {
+ type: UPDATE_WORKERS,
+ workers,
+ };
+}
+
+function updateCanDebugWorkers(canDebugWorkers) {
+ return {
+ type: UPDATE_CAN_DEBUG_WORKERS,
+ canDebugWorkers,
+ };
+}
+
+module.exports = {
+ startWorker,
+ unregisterWorker,
+ updateCanDebugWorkers,
+ updateWorkers,
+};
diff --git a/devtools/client/application/src/base.css b/devtools/client/application/src/base.css
new file mode 100644
index 0000000000..4e7dcc8c2e
--- /dev/null
+++ b/devtools/client/application/src/base.css
@@ -0,0 +1,83 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+:root {
+ /* Typography from Photon */
+ /* See https://firefox-dev.tools/photon/visuals/typography.html */
+ --caption-10-font-size: 11px;
+ --caption-10-font-weight: 400;
+ --body-10-font-size: 13px;
+ --body-10-font-weight: 400;
+ --body-20-font-size: 15px;
+ --body-20-font-weight: 400;
+ --body-20-font-weight-bold: 700;
+ --title-10-font-size: 13px;
+ --title-10-font-weight: 600;
+ --title-20-font-size: 17px;
+ --title-20-font-weight: 400;
+ --title-30-font-size: 22px;
+
+ /* Global styles */
+ --base-line-height: 1.8;
+ --list-line-height: 1.25;
+
+ /* Global colours */
+ --separator-color: var(--theme-splitter-color);
+ --bg-color: var(--theme-toolbar-background);
+ --highlight-color: var(--theme-toolbar-background-hover);
+
+ /* extra, raw colors */
+ --blue-50-a30: rgba(10, 132, 255, 0.3);
+
+ /* Global layout vars */
+ --base-unit: 4px;
+
+ /* these are the color for icons in empty pages - note that these are not
+ available in devtools' variables.css */
+ --dimmed-icon-color: #d3d3d3;
+}
+
+:root.theme-dark {
+ --dimmed-icon-color: #484848;
+}
+
+/*
+* Reset some tags
+*/
+
+* {
+ box-sizing: border-box;
+}
+
+body {
+ margin: 0;
+ padding: 0;
+ line-height: var(--base-line-height);
+}
+
+ul {
+ line-height: var(--list-line-height);
+}
+
+a {
+ color: var(--theme-highlight-blue);
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+p {
+ margin: 0;
+}
+
+table {
+ border-spacing: 0;
+}
+
+/*
+ * utility classes
+ */
+
+.technical-text {
+ font-family: monospace;
+}
diff --git a/devtools/client/application/src/components/App.css b/devtools/client/application/src/components/App.css
new file mode 100644
index 0000000000..e0bcef7d2d
--- /dev/null
+++ b/devtools/client/application/src/components/App.css
@@ -0,0 +1,34 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * General styles
+ */
+
+a.disabled-link,
+a.disabled-link:hover,
+a.disabled-link:visited {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
+.app {
+ display: grid;
+ min-width: calc(var(--base-unit) * 90);
+}
+
+/* wide layout -> two columns, 1 row */
+@media(min-width: 701px) {
+ .app {
+ grid-template-columns: calc(var(--base-unit) * 50) auto;
+ height: 100vh;
+ }
+}
+
+/* vertical layout -> 1 column, 2 rows */
+@media(max-width: 700px) {
+ .app {
+ grid-template-rows: auto 1fr;
+ }
+}
diff --git a/devtools/client/application/src/components/App.js b/devtools/client/application/src/components/App.js
new file mode 100644
index 0000000000..eac53e0cf6
--- /dev/null
+++ b/devtools/client/application/src/components/App.js
@@ -0,0 +1,46 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ main,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+const PageSwitcher = createFactory(
+ require("resource://devtools/client/application/src/components/routing/PageSwitcher.js")
+);
+const Sidebar = createFactory(
+ require("resource://devtools/client/application/src/components/routing/Sidebar.js")
+);
+
+/**
+ * This is the main component for the application panel.
+ */
+class App extends PureComponent {
+ static get propTypes() {
+ return {
+ fluentBundles: PropTypes.array.isRequired,
+ };
+ }
+
+ render() {
+ const { fluentBundles } = this.props;
+
+ return LocalizationProvider(
+ { bundles: fluentBundles },
+ main({ className: `app` }, Sidebar({}), PageSwitcher({}))
+ );
+ }
+}
+
+module.exports = App;
diff --git a/devtools/client/application/src/components/manifest/Manifest.js b/devtools/client/application/src/components/manifest/Manifest.js
new file mode 100644
index 0000000000..f6b5f19b37
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/Manifest.js
@@ -0,0 +1,136 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ article,
+ h1,
+ table,
+ tbody,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+const {
+ l10n,
+} = require("resource://devtools/client/application/src/modules/l10n.js");
+
+const ManifestColorItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestColorItem.js")
+);
+const ManifestIconItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestIconItem.js")
+);
+const ManifestUrlItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestUrlItem.js")
+);
+const ManifestItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestItem.js")
+);
+const ManifestIssueList = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestIssueList.js")
+);
+const ManifestSection = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestSection.js")
+);
+const ManifestJsonLink = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestJsonLink.js")
+);
+
+const {
+ MANIFEST_MEMBER_VALUE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+/**
+ * A canonical manifest, splitted in different sections
+ */
+class Manifest extends PureComponent {
+ static get propTypes() {
+ return {
+ ...Types.manifest, // { identity, presentation, icons, validation, url }
+ };
+ }
+
+ renderIssueSection() {
+ const { validation } = this.props;
+ const shouldRender = validation && !!validation.length;
+
+ return shouldRender
+ ? ManifestSection(
+ {
+ key: `manifest-section-0`,
+ title: l10n.getString("manifest-item-warnings"),
+ },
+ ManifestIssueList({ issues: validation })
+ )
+ : null;
+ }
+
+ renderMember({ key, value, type }, index) {
+ let domKey = key;
+ switch (type) {
+ case MANIFEST_MEMBER_VALUE_TYPES.COLOR:
+ return ManifestColorItem({ label: key, key: domKey, value });
+ case MANIFEST_MEMBER_VALUE_TYPES.ICON:
+ // since the manifest may have keys with empty size/contentType,
+ // we cannot use them as unique IDs
+ domKey = index;
+ return ManifestIconItem({ label: key, key: domKey, value });
+ case MANIFEST_MEMBER_VALUE_TYPES.URL:
+ return ManifestUrlItem({ label: key, key: domKey, value });
+ case MANIFEST_MEMBER_VALUE_TYPES.STRING:
+ default:
+ return ManifestItem({ label: key, key: domKey }, value);
+ }
+ }
+
+ renderItemSections() {
+ const { identity, icons, presentation } = this.props;
+
+ const manifestMembers = [
+ { localizationId: "manifest-item-identity", items: identity },
+ { localizationId: "manifest-item-presentation", items: presentation },
+ { localizationId: "manifest-item-icons", items: icons },
+ ];
+
+ return manifestMembers.map(({ localizationId, items }, index) => {
+ return ManifestSection(
+ {
+ key: `manifest-section-${index + 1}`,
+ title: l10n.getString(localizationId),
+ },
+ // NOTE: this table should probably be its own component, to keep
+ // the same level of abstraction as with the validation issues
+ // Bug https://bugzilla.mozilla.org/show_bug.cgi?id=1577138
+ table({}, tbody({}, items.map(this.renderMember)))
+ );
+ });
+ }
+
+ render() {
+ const { url } = this.props;
+
+ return article(
+ { className: "js-manifest" },
+ Localized(
+ {
+ id: "manifest-view-header",
+ },
+ h1({ className: "app-page__title" })
+ ),
+ ManifestJsonLink({ url }),
+ this.renderIssueSection(),
+ this.renderItemSections()
+ );
+ }
+}
+
+// Exports
+module.exports = Manifest;
diff --git a/devtools/client/application/src/components/manifest/ManifestColorItem.css b/devtools/client/application/src/components/manifest/ManifestColorItem.css
new file mode 100644
index 0000000000..92dadec271
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestColorItem.css
@@ -0,0 +1,29 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-item__color {
+ /* NOTE: platform converts any color format that is in the manifest to
+ hexadecimal, so we can uppercase */
+ text-transform: uppercase;
+ direction: ltr; /* force LTR so the # stays at the beginning of the hex number */
+ display: inline-block;
+}
+
+.manifest-item__color::before {
+ display: inline-block;
+ content: '';
+ background-color: #fff;
+ background-image: linear-gradient(var(--color-value), var(--color-value)), /* injected via React */
+ linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
+ linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
+ background-size: 6px 6px;
+ background-position: 0 0, 3px 3px;
+ border-radius: 50%;
+ width: calc(var(--base-unit) * 3);
+ height: calc(var(--base-unit) * 3);
+ margin-block-start: calc(var(--base-unit) * -0.5);
+ margin-inline-end: var(--base-unit);
+ box-shadow: 0 0 0 1px var(--theme-splitter-color);
+ vertical-align: middle;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestColorItem.js b/devtools/client/application/src/components/manifest/ManifestColorItem.js
new file mode 100644
index 0000000000..ac4b54e82f
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestColorItem.js
@@ -0,0 +1,57 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+const ManifestItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestItem.js")
+);
+
+/**
+ * This component displays a Manifest member which holds a color value
+ */
+class ManifestColorItem extends PureComponent {
+ static get propTypes() {
+ return {
+ ...Types.manifestItemColor, // { label, value }
+ };
+ }
+
+ renderColor() {
+ let { value } = this.props;
+ if (!value) {
+ return null;
+ }
+
+ // Truncate colors in #rrggbbaa format to #rrggbb
+ if (value.length === 9 && value.toLowerCase().endsWith("ff")) {
+ value = value.slice(0, 7);
+ }
+
+ /* div instead of span because CSS `direction` works with block elements */
+ return div(
+ {
+ className: "manifest-item__color",
+ style: { "--color-value": value },
+ },
+ value
+ );
+ }
+
+ render() {
+ const { label } = this.props;
+ return ManifestItem({ label }, this.renderColor());
+ }
+}
+
+module.exports = ManifestColorItem;
diff --git a/devtools/client/application/src/components/manifest/ManifestEmpty.js b/devtools/client/application/src/components/manifest/ManifestEmpty.js
new file mode 100644
index 0000000000..3e0eb2de48
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestEmpty.js
@@ -0,0 +1,81 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ a,
+ article,
+ aside,
+ div,
+ h1,
+ img,
+ p,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const DOC_URL =
+ "https://developer.mozilla.org/en-US/docs/Web/Manifest" +
+ "?utm_source=devtools&utm_medium=sw-panel-blank";
+
+/**
+ * This component displays help information when no manifest is found for the
+ * current target.
+ */
+class ManifestEmpty extends PureComponent {
+ openDocumentation() {
+ openDocLink(DOC_URL);
+ }
+
+ render() {
+ return article(
+ { className: "app-page__icon-container js-manifest-empty" },
+ aside(
+ {},
+ Localized(
+ {
+ id: "sidebar-item-manifest",
+ attrs: {
+ alt: true,
+ },
+ },
+ img({
+ className: "app-page__icon",
+ src: "chrome://devtools/skin/images/application-manifest.svg",
+ })
+ )
+ ),
+ div(
+ {},
+ Localized(
+ {
+ id: "manifest-empty-intro2",
+ },
+ h1({ className: "app-page__title" })
+ ),
+ p(
+ {},
+ Localized(
+ { id: "manifest-empty-intro-link" },
+ a({
+ onClick: () => this.openDocumentation(),
+ })
+ )
+ ),
+ Localized({ id: "manifest-non-existing" }, p({}))
+ )
+ );
+ }
+}
+
+// Exports
+module.exports = ManifestEmpty;
diff --git a/devtools/client/application/src/components/manifest/ManifestIconItem.css b/devtools/client/application/src/components/manifest/ManifestIconItem.css
new file mode 100644
index 0000000000..a2bbfd9d34
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestIconItem.css
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-item__icon {
+ max-width: 100%;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestIconItem.js b/devtools/client/application/src/components/manifest/ManifestIconItem.js
new file mode 100644
index 0000000000..a525fbcdb9
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestIconItem.js
@@ -0,0 +1,98 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ br,
+ code,
+ img,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+const {
+ l10n,
+} = require("resource://devtools/client/application/src/modules/l10n.js");
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+const ManifestItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestItem.js")
+);
+
+/**
+ * This component displays a Manifest member which holds a color value
+ */
+class ManifestIconItem extends PureComponent {
+ static get propTypes() {
+ return {
+ // {
+ // label: { contentType, sizes },
+ // value: { src, purpose }
+ // }
+ ...Types.manifestItemIcon,
+ };
+ }
+
+ getLocalizedImgTitle() {
+ const { sizes } = this.props.label;
+
+ return sizes && sizes.length
+ ? l10n.getString("manifest-icon-img-title", { sizes })
+ : l10n.getString("manifest-icon-img-title-no-sizes");
+ }
+
+ renderLabel() {
+ const { contentType, sizes } = this.props.label;
+
+ // sinze both `contentType` and `sizes` may be undefined, we don't need to
+ // render the <br> if one –or both– are not to be displayed
+ const shallRenderBr = contentType && sizes;
+
+ return [
+ sizes ? sizes : null,
+ shallRenderBr ? br({ key: "label-br" }) : null,
+ contentType ? contentType : null,
+ ];
+ }
+
+ render() {
+ const { src, purpose } = this.props.value;
+
+ return ManifestItem(
+ {
+ label: this.renderLabel(),
+ },
+ Localized(
+ {
+ id: "manifest-icon-img",
+ attrs: {
+ alt: true,
+ },
+ },
+ img({
+ className: "manifest-item__icon",
+ src,
+ title: this.getLocalizedImgTitle(),
+ })
+ ),
+ br({}),
+ Localized(
+ {
+ id: "manifest-icon-purpose",
+ code: code({}),
+ $purpose: purpose,
+ },
+ span({})
+ )
+ );
+ }
+}
+
+module.exports = ManifestIconItem;
diff --git a/devtools/client/application/src/components/manifest/ManifestIssue.css b/devtools/client/application/src/components/manifest/ManifestIssue.css
new file mode 100644
index 0000000000..96bcdae5dd
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestIssue.css
@@ -0,0 +1,17 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-issue__icon {
+ -moz-context-properties: fill;
+ width: calc(var(--base-unit) * 3);
+ height: calc(var(--base-unit) * 3);
+}
+
+.manifest-issue__icon--warning {
+ fill: var(--theme-icon-warning-color);
+}
+
+.manifest-issue__icon--error {
+ fill: var(--theme-icon-error-color);
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestIssue.js b/devtools/client/application/src/components/manifest/ManifestIssue.js
new file mode 100644
index 0000000000..1cdf62ff8f
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestIssue.js
@@ -0,0 +1,72 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ img,
+ li,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ MANIFEST_ISSUE_LEVELS,
+} = require("resource://devtools/client/application/src/constants.js");
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+/**
+ * A Manifest validation issue (warning, error)
+ */
+class ManifestIssue extends PureComponent {
+ static get propTypes() {
+ return {
+ className: PropTypes.string,
+ ...Types.manifestIssue, // { level, message }
+ };
+ }
+
+ getIconData(level) {
+ switch (level) {
+ case MANIFEST_ISSUE_LEVELS.WARNING:
+ return {
+ src: "chrome://devtools/skin/images/alert-small.svg",
+ localizationId: "icon-warning",
+ };
+ case MANIFEST_ISSUE_LEVELS.ERROR:
+ default:
+ return {
+ src: "chrome://devtools/skin/images/error-small.svg",
+ localizationId: "icon-error",
+ };
+ }
+ }
+
+ render() {
+ const { level, message, className } = this.props;
+ const icon = this.getIconData(level);
+
+ return li(
+ { className: `js-manifest-issue ${className ? className : ""}` },
+ Localized(
+ { id: icon.localizationId, attrs: { alt: true, title: true } },
+ img({
+ className: `manifest-issue__icon manifest-issue__icon--${level}`,
+ src: icon.src,
+ })
+ ),
+ span({}, message)
+ );
+ }
+}
+
+// Exports
+module.exports = ManifestIssue;
diff --git a/devtools/client/application/src/components/manifest/ManifestIssueList.css b/devtools/client/application/src/components/manifest/ManifestIssueList.css
new file mode 100644
index 0000000000..ccb3f08df5
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestIssueList.css
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-issues {
+ list-style-type: none;
+ padding-inline-start: 0;
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-gap: var(--base-unit);
+}
+
+.manifest-issues__item {
+ display: contents;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestIssueList.js b/devtools/client/application/src/components/manifest/ManifestIssueList.js
new file mode 100644
index 0000000000..4b3d1f46c8
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestIssueList.js
@@ -0,0 +1,68 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ ul,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ MANIFEST_ISSUE_LEVELS,
+} = require("resource://devtools/client/application/src/constants.js");
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+const ManifestIssue = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestIssue.js")
+);
+
+/**
+ * A collection of manifest issues (errors, warnings)
+ */
+class ManifestIssueList extends PureComponent {
+ static get propTypes() {
+ return {
+ issues: Types.manifestIssueArray.isRequired,
+ };
+ }
+
+ // group the errors by level, and order by severity
+ groupIssuesByLevel() {
+ const { issues } = this.props;
+
+ const errors = issues.filter(x => x.level === MANIFEST_ISSUE_LEVELS.ERROR);
+ const warnings = issues.filter(
+ x => x.level === MANIFEST_ISSUE_LEVELS.WARNING
+ );
+
+ return [errors, warnings];
+ }
+
+ render() {
+ const groups = this.groupIssuesByLevel().filter(list => !!list.length);
+
+ return groups.map((list, listIndex) => {
+ return ul(
+ {
+ className: "manifest-issues js-manifest-issues",
+ key: `issuelist-${listIndex}`,
+ },
+ list.map((issue, issueIndex) =>
+ ManifestIssue({
+ className: "manifest-issues__item",
+ key: `issue-${issueIndex}`,
+ ...issue,
+ })
+ )
+ );
+ });
+ }
+}
+
+// Exports
+module.exports = ManifestIssueList;
diff --git a/devtools/client/application/src/components/manifest/ManifestItem.css b/devtools/client/application/src/components/manifest/ManifestItem.css
new file mode 100644
index 0000000000..94da03e9b9
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestItem.css
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-item {
+ vertical-align: baseline;
+}
+
+.manifest-item__label {
+ box-sizing: border-box;
+ min-width: calc(var(--base-unit) * 32);
+ padding-inline-end: calc(var(--base-unit) * 4);
+ padding-inline-start: 0;
+ vertical-align: top;
+ color: var(--theme-text-color-alt);
+ font-weight: inherit;
+ text-align: start;
+}
+
+.manifest-item__value {
+ word-break: break-all;
+ vertical-align: top;
+}
+
+.manifest-item__label,
+.manifest-item__value {
+ padding-block: calc(var(--base-unit) * 1);
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestItem.js b/devtools/client/application/src/components/manifest/ManifestItem.js
new file mode 100644
index 0000000000..96c47a1a7f
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestItem.js
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ tr,
+ td,
+ th,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+/**
+ * This component displays a key-value data pair from a manifest
+ */
+class ManifestItem extends PureComponent {
+ static get propTypes() {
+ return {
+ label: PropTypes.node.isRequired,
+ children: PropTypes.node,
+ };
+ }
+
+ render() {
+ const { children, label } = this.props;
+ return tr(
+ {
+ className: "manifest-item js-manifest-item",
+ },
+ th(
+ {
+ className: "manifest-item__label js-manifest-item-label",
+ scope: "row",
+ },
+ label
+ ),
+ td(
+ { className: "manifest-item__value js-manifest-item-content" },
+ children
+ )
+ );
+ }
+}
+
+// Exports
+module.exports = ManifestItem;
diff --git a/devtools/client/application/src/components/manifest/ManifestJsonLink.css b/devtools/client/application/src/components/manifest/ManifestJsonLink.css
new file mode 100644
index 0000000000..52343226f9
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestJsonLink.css
@@ -0,0 +1,9 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-json-link {
+ /* this is so it has an implicit width and the link inside gets to truncate
+ with an ellipsis */
+ display: grid;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestJsonLink.js b/devtools/client/application/src/components/manifest/ManifestJsonLink.js
new file mode 100644
index 0000000000..d35924b5c3
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestJsonLink.js
@@ -0,0 +1,67 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { openDocLink } = require("resource://devtools/client/shared/link.js");
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+
+const {
+ a,
+ p,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+/**
+ * This component displays an "Open JSON" link for the Manifest
+ */
+class ManifestJsonLink extends PureComponent {
+ static get propTypes() {
+ return {
+ url: PropTypes.string.isRequired,
+ };
+ }
+
+ get shouldRenderLink() {
+ const { url } = this.props;
+ // Firefox blocks the loading of Data URLs with mimetypes manifest+json unless
+ // explicitly typed by the user in the address bar.
+ // So we are not showing the link in this case.
+ // See more details in this post:
+ // https://blog.mozilla.org/security/2017/11/27/blocking-top-level-navigations-data-urls-firefox-59/
+ return !url.startsWith("data:");
+ }
+
+ renderLink() {
+ const { url } = this.props;
+
+ return a(
+ {
+ className: "js-manifest-json-link devtools-ellipsis-text",
+ href: "#",
+ title: url,
+ onClick: () => openDocLink(url),
+ },
+ url
+ );
+ }
+
+ render() {
+ return p(
+ { className: "manifest-json-link" },
+ this.shouldRenderLink
+ ? this.renderLink()
+ : Localized({ id: "manifest-json-link-data-url" })
+ );
+ }
+}
+
+module.exports = ManifestJsonLink;
diff --git a/devtools/client/application/src/components/manifest/ManifestLoader.css b/devtools/client/application/src/components/manifest/ManifestLoader.css
new file mode 100644
index 0000000000..4f728ff6e3
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestLoader.css
@@ -0,0 +1,14 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-loader {
+ font-size: var(--body-20-font-size);
+ font-weight: var(--body-20-font-weight);
+}
+
+.manifest-loader__load {
+ /* TODO: implement a spinner when tackling the UX review bug
+ https://bugzilla.mozilla.org/show_bug.cgi?id=1566023 */
+ text-align: center;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestLoader.js b/devtools/client/application/src/components/manifest/ManifestLoader.js
new file mode 100644
index 0000000000..9183b50ff3
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestLoader.js
@@ -0,0 +1,108 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ aside,
+ h1,
+ p,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const {
+ fetchManifest,
+} = require("resource://devtools/client/application/src/actions/manifest.js");
+
+class ManifestLoader extends PureComponent {
+ static get propTypes() {
+ return {
+ // these props get automatically injected via `connect`
+ dispatch: PropTypes.func.isRequired,
+ error: PropTypes.string,
+ hasFetchedManifest: PropTypes.bool.isRequired,
+ isLoading: PropTypes.bool.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.loadManifestIfNeeded();
+ }
+
+ componentDidUpdate() {
+ this.loadManifestIfNeeded();
+ }
+
+ loadManifestIfNeeded() {
+ const { isLoading, hasFetchedManifest } = this.props;
+ const shallLoad = !isLoading && !hasFetchedManifest;
+ if (shallLoad) {
+ this.props.dispatch(fetchManifest());
+ }
+ }
+
+ renderResult() {
+ return Localized(
+ { id: "manifest-loaded-ok" },
+ p({ className: "js-manifest-loaded-ok" })
+ );
+ }
+
+ renderError() {
+ const { error } = this.props;
+
+ return [
+ Localized(
+ {
+ id: "manifest-loaded-error",
+ key: "manifest-error-label",
+ },
+ h1({ className: "js-manifest-loaded-error app-page__title" })
+ ),
+ p({ className: "technical-text", key: "manifest-error-message" }, error),
+ ];
+ }
+
+ render() {
+ const { error, isLoading } = this.props;
+
+ const loadingDOM = isLoading
+ ? Localized(
+ { id: "manifest-loading" },
+ p({ className: "manifest-loader__load js-manifest-loading" })
+ )
+ : null;
+
+ const errorDOM = error ? this.renderError() : null;
+ const resultDOM = !isLoading && !error ? this.renderResult() : null;
+
+ return aside(
+ { className: "manifest-loader" },
+ loadingDOM,
+ errorDOM,
+ resultDOM
+ );
+ }
+}
+
+const mapDispatchToProps = dispatch => ({ dispatch });
+const mapStateToProps = state => ({
+ error: state.manifest.errorMessage,
+ hasFetchedManifest: typeof state.manifest.manifest !== "undefined",
+ isLoading: state.manifest.isLoading,
+});
+
+module.exports = connect(mapStateToProps, mapDispatchToProps)(ManifestLoader);
diff --git a/devtools/client/application/src/components/manifest/ManifestPage.js b/devtools/client/application/src/components/manifest/ManifestPage.js
new file mode 100644
index 0000000000..60caea591e
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestPage.js
@@ -0,0 +1,76 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ section,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+const ManifestLoader = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestLoader.js")
+);
+const Manifest = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/Manifest.js")
+);
+const ManifestEmpty = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestEmpty.js")
+);
+
+class ManifestPage extends PureComponent {
+ static get propTypes() {
+ return {
+ // these props are automatically injected via connect
+ hasLoadingFailed: PropTypes.bool.isRequired,
+ isManifestLoading: PropTypes.bool.isRequired,
+ manifest: PropTypes.shape(Types.manifest),
+ };
+ }
+
+ get shouldShowLoader() {
+ const { isManifestLoading, hasLoadingFailed } = this.props;
+ const mustLoadManifest = typeof this.props.manifest === "undefined";
+ return isManifestLoading || mustLoadManifest || hasLoadingFailed;
+ }
+
+ renderManifest() {
+ const { manifest } = this.props;
+ return manifest ? Manifest({ ...manifest }) : ManifestEmpty({});
+ }
+
+ render() {
+ const { manifest } = this.props;
+
+ return section(
+ {
+ className: `app-page js-manifest-page ${
+ !manifest ? "app-page--empty" : ""
+ }`,
+ },
+ this.shouldShowLoader ? ManifestLoader({}) : this.renderManifest()
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ hasLoadingFailed: !!state.manifest.errorMessage,
+ isManifestLoading: state.manifest.isLoading,
+ manifest: state.manifest.manifest,
+ };
+}
+
+// Exports
+module.exports = connect(mapStateToProps)(ManifestPage);
diff --git a/devtools/client/application/src/components/manifest/ManifestSection.css b/devtools/client/application/src/components/manifest/ManifestSection.css
new file mode 100644
index 0000000000..479a6d1f79
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestSection.css
@@ -0,0 +1,25 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-section {
+ padding-block: calc(var(--base-unit) * 2);
+ width: 100%;
+ border-spacing: calc(var(--base-unit) * 2) 0;
+ font-size: var(--body-10-font-size);
+ font-weight: var(--body-10-font-weight);
+}
+
+.manifest-section--empty {
+ padding-block-end: 0;
+}
+
+.manifest-section:not(:last-child) {
+ border-bottom: 1px solid var(--separator-color);
+}
+
+.manifest-section__title {
+ font-size: var(--title-10-font-size);
+ font-weight: var(--title-10-font-weight);
+ margin: 0;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestSection.js b/devtools/client/application/src/components/manifest/ManifestSection.js
new file mode 100644
index 0000000000..4aa92c6a15
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestSection.js
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ h2,
+ section,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+/**
+ * A section of a manifest in the form of a captioned table.
+ */
+class ManifestSection extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node,
+ title: PropTypes.string.isRequired,
+ };
+ }
+
+ render() {
+ const { children, title } = this.props;
+ const isEmpty = !children || children.length === 0;
+
+ return section(
+ {
+ className: `manifest-section ${
+ isEmpty ? "manifest-section--empty" : ""
+ }`,
+ },
+ h2({ className: "manifest-section__title" }, title),
+ children
+ );
+ }
+}
+
+// Exports
+module.exports = ManifestSection;
diff --git a/devtools/client/application/src/components/manifest/ManifestUrlItem.css b/devtools/client/application/src/components/manifest/ManifestUrlItem.css
new file mode 100644
index 0000000000..9702e7e261
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestUrlItem.css
@@ -0,0 +1,8 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.manifest-item__url {
+ direction: ltr; /* force LTR so the # stays at the beginning of the hex number */
+ display: inline-block;
+}
diff --git a/devtools/client/application/src/components/manifest/ManifestUrlItem.js b/devtools/client/application/src/components/manifest/ManifestUrlItem.js
new file mode 100644
index 0000000000..03705d441a
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/ManifestUrlItem.js
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ div,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+const ManifestItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestItem.js")
+);
+
+/**
+ * This component displays a Manifest member which holds a URL
+ */
+class ManifestUrlItem extends PureComponent {
+ static get propTypes() {
+ return {
+ ...Types.manifestItemUrl, // { label, value }
+ };
+ }
+
+ render() {
+ const { label, value } = this.props;
+ return ManifestItem(
+ { label },
+ div({ className: "manifest-item__url" }, value)
+ );
+ }
+}
+
+module.exports = ManifestUrlItem;
diff --git a/devtools/client/application/src/components/manifest/moz.build b/devtools/client/application/src/components/manifest/moz.build
new file mode 100644
index 0000000000..bb799cbfc4
--- /dev/null
+++ b/devtools/client/application/src/components/manifest/moz.build
@@ -0,0 +1,18 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "Manifest.js",
+ "ManifestColorItem.js",
+ "ManifestEmpty.js",
+ "ManifestIconItem.js",
+ "ManifestIssue.js",
+ "ManifestIssueList.js",
+ "ManifestItem.js",
+ "ManifestJsonLink.js",
+ "ManifestLoader.js",
+ "ManifestPage.js",
+ "ManifestSection.js",
+ "ManifestUrlItem.js",
+)
diff --git a/devtools/client/application/src/components/moz.build b/devtools/client/application/src/components/moz.build
new file mode 100644
index 0000000000..361ec01204
--- /dev/null
+++ b/devtools/client/application/src/components/moz.build
@@ -0,0 +1,14 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "routing",
+ "manifest",
+ "service-workers",
+ "ui",
+]
+
+DevToolsModules(
+ "App.js",
+)
diff --git a/devtools/client/application/src/components/routing/PageSwitcher.css b/devtools/client/application/src/components/routing/PageSwitcher.css
new file mode 100644
index 0000000000..e713adb1bf
--- /dev/null
+++ b/devtools/client/application/src/components/routing/PageSwitcher.css
@@ -0,0 +1,45 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/*
+ * Page container for worker + manifest views
+ */
+
+.app-page {
+ padding: calc(var(--base-unit) * 3) calc(var(--base-unit) * 8);
+ user-select: none;
+ overflow-y: auto;
+}
+
+.app-page--empty {
+ display: grid;
+ align-items: center;
+ justify-content: center;
+ font-size: var(--body-10-font-size);
+ color: var(--theme-toolbar-color);
+}
+
+.app-page__title {
+ font-size: var(--title-20-font-size);
+ font-weight: var(--title-20-font-weight);
+ margin: 0;
+}
+
+.app-page__icon-container {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-column-gap: calc(var(--base-unit) * 4);
+}
+
+.app-page__icon {
+ width: calc(var(--base-unit) * 10);
+ height: calc(var(--base-unit) * 10);
+
+ fill: var(--dimmed-icon-color);
+ -moz-context-properties: fill;
+
+ /* alignment fix for text to compensate for low baseline */
+ margin-block-start: var(--base-unit);
+}
diff --git a/devtools/client/application/src/components/routing/PageSwitcher.js b/devtools/client/application/src/components/routing/PageSwitcher.js
new file mode 100644
index 0000000000..9305744da9
--- /dev/null
+++ b/devtools/client/application/src/components/routing/PageSwitcher.js
@@ -0,0 +1,59 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+const ManifestPage = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestPage.js")
+);
+const WorkersPage = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/WorkersPage.js")
+);
+
+class PageSwitcher extends PureComponent {
+ static get propTypes() {
+ return {
+ page: Types.page.isRequired,
+ };
+ }
+
+ render() {
+ let component = null;
+
+ switch (this.props.page) {
+ case PAGE_TYPES.MANIFEST:
+ component = ManifestPage({});
+ break;
+ case PAGE_TYPES.SERVICE_WORKERS:
+ component = WorkersPage({});
+ break;
+ default:
+ console.error("Unknown path. Can not direct to a page.");
+ return null;
+ }
+
+ return component;
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ page: state.ui.selectedPage,
+ };
+}
+
+module.exports = connect(mapStateToProps)(PageSwitcher);
diff --git a/devtools/client/application/src/components/routing/Sidebar.css b/devtools/client/application/src/components/routing/Sidebar.css
new file mode 100644
index 0000000000..872f5cca86
--- /dev/null
+++ b/devtools/client/application/src/components/routing/Sidebar.css
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/*
+ * Sidebar list container
+ */
+.sidebar {
+ background-color: var(--bg-color);
+}
+
+/* vertical layout -> the sidebar is the first row */
+@media(max-width: 700px) {
+ .sidebar {
+ border-block-end: 1px solid var(--separator-color);
+ }
+}
+
+/* wide layout -> the sidebar occupies a whole column on the side */
+@media(min-width: 701px) {
+ .sidebar {
+ min-height: 100vh;
+ border-inline-end: 1px solid var(--separator-color);
+ }
+}
+
+.sidebar__list {
+ list-style: none;
+ padding: 0;
+ font-size: var(--body-10-font-size);
+ font-weight: var(--body-10-font-weight);
+}
diff --git a/devtools/client/application/src/components/routing/Sidebar.js b/devtools/client/application/src/components/routing/Sidebar.js
new file mode 100644
index 0000000000..99d260571e
--- /dev/null
+++ b/devtools/client/application/src/components/routing/Sidebar.js
@@ -0,0 +1,70 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ aside,
+ ul,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const SidebarItem = createFactory(
+ require("resource://devtools/client/application/src/components/routing/SidebarItem.js")
+);
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+class Sidebar extends PureComponent {
+ static get propTypes() {
+ return {
+ // this prop is automatically injected via connect
+ selectedPage: Types.page.isRequired,
+ };
+ }
+
+ render() {
+ const navItems = [PAGE_TYPES.SERVICE_WORKERS, PAGE_TYPES.MANIFEST];
+
+ const isSelected = page => {
+ return page === this.props.selectedPage;
+ };
+
+ return aside(
+ {
+ className: "sidebar js-sidebar",
+ },
+ ul(
+ {
+ className: "sidebar__list",
+ },
+ navItems.map(page => {
+ return SidebarItem({
+ page,
+ key: `sidebar-item-${page}`,
+ isSelected: isSelected(page),
+ });
+ })
+ )
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ selectedPage: state.ui.selectedPage,
+ };
+}
+
+module.exports = connect(mapStateToProps)(Sidebar);
diff --git a/devtools/client/application/src/components/routing/SidebarItem.css b/devtools/client/application/src/components/routing/SidebarItem.css
new file mode 100644
index 0000000000..f1852748ab
--- /dev/null
+++ b/devtools/client/application/src/components/routing/SidebarItem.css
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/*
+ * Sidebar list items
+ */
+
+.sidebar-item {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-gap: var(--base-unit);
+ padding: calc(var(--base-unit)) calc(var(--base-unit) * 6);
+ user-select: none;
+ cursor: pointer;
+}
+
+.sidebar-item--selected {
+ background-color: var(--theme-selection-background);
+ color: var(--theme-selection-color);
+}
+
+.sidebar-item:not(.sidebar-item--selected):hover {
+ background-color: var(--highlight-color);
+}
+
+.sidebar-item__icon {
+ height: calc(var(--base-unit) * 4);
+ width: calc(var(--base-unit) * 4);
+ -moz-context-properties: fill;
+ fill: currentColor;
+}
diff --git a/devtools/client/application/src/components/routing/SidebarItem.js b/devtools/client/application/src/components/routing/SidebarItem.js
new file mode 100644
index 0000000000..5683856aaf
--- /dev/null
+++ b/devtools/client/application/src/components/routing/SidebarItem.js
@@ -0,0 +1,95 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ img,
+ li,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const Actions = require("resource://devtools/client/application/src/actions/index.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+const ICONS = {
+ [PAGE_TYPES.MANIFEST]:
+ "chrome://devtools/skin/images/application-manifest.svg",
+ [PAGE_TYPES.SERVICE_WORKERS]:
+ "chrome://devtools/skin/images/debugging-workers.svg",
+};
+
+const LOCALIZATION_IDS = {
+ [PAGE_TYPES.MANIFEST]: "sidebar-item-manifest",
+ [PAGE_TYPES.SERVICE_WORKERS]: "sidebar-item-service-workers",
+};
+
+class SidebarItem extends PureComponent {
+ static get propTypes() {
+ return {
+ page: Types.page.isRequired,
+ isSelected: PropTypes.bool.isRequired,
+ // this prop is automatically injected via connect
+ dispatch: PropTypes.func.isRequired,
+ };
+ }
+
+ render() {
+ const { isSelected, page } = this.props;
+
+ return li(
+ {
+ className: `sidebar-item js-sidebar-${page} ${
+ isSelected ? "sidebar-item--selected" : ""
+ }`,
+ onClick: () => {
+ const { dispatch } = this.props;
+ dispatch(Actions.updateSelectedPage(page));
+ },
+ role: "link",
+ },
+ Localized(
+ {
+ id: LOCALIZATION_IDS[page],
+ attrs: {
+ alt: true,
+ title: true,
+ },
+ },
+ img({
+ src: ICONS[page],
+ className: "sidebar-item__icon",
+ })
+ ),
+ Localized(
+ {
+ id: LOCALIZATION_IDS[page],
+ attrs: {
+ title: true,
+ },
+ },
+ span({ className: "devtools-ellipsis-text" })
+ )
+ );
+ }
+}
+
+const mapDispatchToProps = dispatch => ({ dispatch });
+module.exports = connect(mapDispatchToProps)(SidebarItem);
diff --git a/devtools/client/application/src/components/routing/moz.build b/devtools/client/application/src/components/routing/moz.build
new file mode 100644
index 0000000000..7e22985614
--- /dev/null
+++ b/devtools/client/application/src/components/routing/moz.build
@@ -0,0 +1,5 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules("PageSwitcher.js", "Sidebar.js", "SidebarItem.js")
diff --git a/devtools/client/application/src/components/service-workers/Registration.css b/devtools/client/application/src/components/service-workers/Registration.css
new file mode 100644
index 0000000000..84b6de58e1
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/Registration.css
@@ -0,0 +1,73 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * The current layout of a registration is
+ *
+ * +------+----------------------+----------------+
+ * | Header - scope + timestamp | Unregister_btn |
+ * +------+----------------------+----------------|
+ * | worker 1 |
+ | worker 2 |
+ | ... |
+ +----------------------------------------------+
+ | Unregister btn |
+ +----------------------------------------------+
+ */
+
+.registration {
+ line-height: 1.5;
+ font-size: var(--body-10-font-size);
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto;
+ grid-template-rows: minmax(calc(var(--base-unit) * 6), auto) 1fr auto;
+ grid-column-gap: calc(4 * var(--base-unit));
+ grid-row-gap: calc(2 * var(--base-unit));
+ grid-template-areas: "header header-controls"
+ "workers workers"
+ "footer-controls footer-controls";
+}
+
+/* vertical layout */
+@media(max-width: 700px) {
+ .registration__controls {
+ grid-area: footer-controls;
+ justify-self: end;
+ }
+}
+
+/* wide layout */
+@media(min-width: 701px) {
+ .registration__controls {
+ grid-area: header-controls;
+ }
+}
+
+.registration__header {
+ grid-area: header;
+}
+
+.registration__scope {
+ font-size: var(--title-10-font-size);
+ font-weight: var(--title-10-font-weight);
+ user-select: text;
+ margin: 0;
+
+ grid-area: scope;
+}
+
+.registration__updated-time {
+ color: var(--theme-text-color-alt);
+ grid-area: timestamp;
+}
+
+.registration__workers {
+ grid-area: workers;
+ list-style-type: none;
+ padding: 0;
+}
+
+.registration__workers-item:not(:first-child) {
+ margin-block-start: calc(var(--base-unit) * 2);
+}
diff --git a/devtools/client/application/src/components/service-workers/Registration.js b/devtools/client/application/src/components/service-workers/Registration.js
new file mode 100644
index 0000000000..97569f57e2
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/Registration.js
@@ -0,0 +1,153 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ article,
+ aside,
+ h2,
+ header,
+ li,
+ p,
+ time,
+ ul,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ getUnicodeUrl,
+} = require("resource://devtools/client/shared/unicode-url.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+const {
+ unregisterWorker,
+} = require("resource://devtools/client/application/src/actions/workers.js");
+
+const UIButton = createFactory(
+ require("resource://devtools/client/application/src/components/ui/UIButton.js")
+);
+
+const Worker = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/Worker.js")
+);
+
+/**
+ * This component is dedicated to display a service worker registration, along
+ * the list of attached workers to it.
+ * It displays information about the registration as well as an Unregister
+ * button.
+ */
+class Registration extends PureComponent {
+ static get propTypes() {
+ return {
+ className: PropTypes.string,
+ isDebugEnabled: PropTypes.bool.isRequired,
+ registration: PropTypes.shape(Types.registration).isRequired,
+ // this prop get automatically injected via `connect`
+ dispatch: PropTypes.func.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.unregister = this.unregister.bind(this);
+ }
+
+ unregister() {
+ this.props.dispatch(unregisterWorker(this.props.registration));
+ }
+
+ isActive() {
+ const { workers } = this.props.registration;
+ return workers.some(
+ x => x.state === Ci.nsIServiceWorkerInfo.STATE_ACTIVATED
+ );
+ }
+
+ formatScope(scope) {
+ const [, remainder] = getUnicodeUrl(scope).split("://");
+ // remove the last slash from the url, if present
+ // or return the full scope if there's no remainder
+ return remainder ? remainder.replace(/\/$/, "") : scope;
+ }
+
+ render() {
+ const { registration, isDebugEnabled, className } = this.props;
+
+ const unregisterButton = this.isActive()
+ ? Localized(
+ { id: "serviceworker-worker-unregister" },
+ UIButton({
+ onClick: this.unregister,
+ className: "js-unregister-button",
+ })
+ )
+ : null;
+
+ const lastUpdated = registration.lastUpdateTime
+ ? Localized(
+ {
+ id: "serviceworker-worker-updated",
+ // XXX: $date should normally be a Date object, but we pass the timestamp as a
+ // workaround. See Bug 1465718. registration.lastUpdateTime is in microseconds,
+ // convert to a valid timestamp in milliseconds by dividing by 1000.
+ $date: registration.lastUpdateTime / 1000,
+ time: time({ className: "js-sw-updated" }),
+ },
+ p({ className: "registration__updated-time" })
+ )
+ : null;
+
+ const scope = h2(
+ {
+ title: registration.scope,
+ className: "registration__scope js-sw-scope devtools-ellipsis-text",
+ },
+ this.formatScope(registration.scope)
+ );
+
+ return li(
+ { className: className ? className : "" },
+ article(
+ { className: "registration js-sw-container" },
+ header({ className: "registration__header" }, scope, lastUpdated),
+ aside({ className: "registration__controls" }, unregisterButton),
+ // render list of workers
+ ul(
+ { className: "registration__workers" },
+ registration.workers.map(worker => {
+ return li(
+ {
+ key: worker.id,
+ className: "registration__workers-item",
+ },
+ Worker({
+ worker,
+ isDebugEnabled,
+ })
+ );
+ })
+ )
+ )
+ );
+ }
+}
+
+const mapDispatchToProps = dispatch => ({ dispatch });
+module.exports = connect(mapDispatchToProps)(Registration);
diff --git a/devtools/client/application/src/components/service-workers/RegistrationList.css b/devtools/client/application/src/components/service-workers/RegistrationList.css
new file mode 100644
index 0000000000..021ed7e351
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/RegistrationList.css
@@ -0,0 +1,54 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.aboutdebugging-plug {
+ padding-block: calc(var(--base-unit) * 3);
+ border-block-start: 1px solid var(--separator-color);
+
+ /* display flex to handle showing the icon with ::before */
+ display: flex;
+ flex-direction: row;
+ column-gap: calc(var(--base-unit) * 2);
+ align-items: baseline;
+ font-size: var(--body-10-font-size);
+ font-weight: var(--body-10-font-weight);
+}
+
+.aboutdebugging-plug::before {
+ flex: 0 0 auto;
+ width: calc(var(--base-unit) * 4);
+ height: calc(var(--base-unit) * 4);
+ content: "";
+ -moz-context-properties: fill;
+ fill: currentColor;
+ background-image: url(chrome://global/skin/icons/developer.svg);
+ /* the icon size is taller than the line-height of the text. Since the
+ text can occupy multiple lines, and we want to keep the icon aligned
+ with respect to the first line, instead of align-items: center in
+ .aboutdebugging-plug, we use baseline, and fine tune the position here. */
+ position: relative;
+ top: 3px;
+}
+
+.registrations-container {
+ flex-grow: 1;
+}
+
+.registrations-container__list {
+ padding-inline-start: 0;
+}
+
+.registrations-container__item {
+ list-style-type: none;
+ margin: 0;
+ padding: calc(var(--base-unit) * 5) 0;
+}
+
+.registrations-container__item:first-child {
+ padding-top: 0;
+}
+
+.registrations-container__item:not(:last-child) {
+ border-bottom: 1px solid var(--separator-color);
+}
diff --git a/devtools/client/application/src/components/service-workers/RegistrationList.js b/devtools/client/application/src/components/service-workers/RegistrationList.js
new file mode 100644
index 0000000000..ed89c9cff3
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/RegistrationList.js
@@ -0,0 +1,92 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ openTrustedLink,
+} = require("resource://devtools/client/shared/link.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ a,
+ article,
+ footer,
+ h1,
+ p,
+ ul,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+const Registration = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/Registration.js")
+);
+
+/**
+ * This component handles the list of service workers displayed in the application panel
+ * and also displays a suggestion to use about debugging for debugging other service
+ * workers.
+ */
+class RegistrationList extends PureComponent {
+ static get propTypes() {
+ return {
+ canDebugWorkers: PropTypes.bool.isRequired,
+ registrations: Types.registrationArray.isRequired,
+ };
+ }
+
+ render() {
+ const { canDebugWorkers, registrations } = this.props;
+
+ return [
+ article(
+ {
+ className: "registrations-container",
+ key: "registrations-container",
+ },
+ Localized(
+ { id: "serviceworker-list-header" },
+ h1({
+ className: "app-page__title",
+ })
+ ),
+ ul(
+ { className: "registrations-container__list" },
+ registrations.map(registration =>
+ Registration({
+ key: registration.id,
+ isDebugEnabled: canDebugWorkers,
+ registration,
+ className: "registrations-container__item",
+ })
+ )
+ )
+ ),
+
+ footer(
+ { className: "aboutdebugging-plug" },
+ Localized(
+ {
+ id: "serviceworker-list-aboutdebugging",
+ key: "serviceworkerlist-footer",
+ a: a({
+ className: "aboutdebugging-plug__link",
+ onClick: () => openTrustedLink("about:debugging#workers"),
+ }),
+ },
+ p({})
+ )
+ ),
+ ];
+ }
+}
+
+// Exports
+module.exports = RegistrationList;
diff --git a/devtools/client/application/src/components/service-workers/RegistrationListEmpty.js b/devtools/client/application/src/components/service-workers/RegistrationListEmpty.js
new file mode 100644
index 0000000000..2454f121e8
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/RegistrationListEmpty.js
@@ -0,0 +1,122 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ openDocLink,
+ openTrustedLink,
+} = require("resource://devtools/client/shared/link.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const {
+ a,
+ article,
+ aside,
+ div,
+ h1,
+ img,
+ p,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+
+const {
+ services,
+} = require("resource://devtools/client/application/src/modules/application-services.js");
+
+const DOC_URL =
+ "https://developer.mozilla.org/docs/Web/API/Service_Worker_API/Using_Service_Workers" +
+ "?utm_source=devtools&utm_medium=sw-panel-blank";
+
+/**
+ * This component displays help information when no service workers are found for the
+ * current target.
+ */
+class RegistrationListEmpty extends PureComponent {
+ switchToConsole() {
+ services.selectTool("webconsole");
+ }
+
+ switchToDebugger() {
+ services.selectTool("jsdebugger");
+ }
+
+ openAboutDebugging() {
+ openTrustedLink("about:debugging#workers");
+ }
+
+ openDocumentation() {
+ openDocLink(DOC_URL);
+ }
+
+ render() {
+ return article(
+ { className: "app-page__icon-container js-registration-list-empty" },
+ aside(
+ {},
+ Localized(
+ {
+ id: "sidebar-item-service-workers",
+ attrs: {
+ alt: true,
+ },
+ },
+ img({
+ className: "app-page__icon",
+ src: "chrome://devtools/skin/images/debugging-workers.svg",
+ })
+ )
+ ),
+ div(
+ {},
+ Localized(
+ {
+ id: "serviceworker-empty-intro2",
+ },
+ h1({ className: "app-page__title" })
+ ),
+ Localized(
+ {
+ id: "serviceworker-empty-suggestions2",
+ a: a({
+ onClick: () => this.switchToConsole(),
+ }),
+ // NOTE: for <Localized> to parse the markup in the string, the
+ // markup needs to be actual HTML elements
+ span: a({
+ onClick: () => this.switchToDebugger(),
+ }),
+ },
+ p({})
+ ),
+ p(
+ {},
+ Localized(
+ { id: "serviceworker-empty-intro-link" },
+ a({
+ onClick: () => this.openDocumentation(),
+ })
+ )
+ ),
+ p(
+ {},
+ Localized(
+ { id: "serviceworker-empty-suggestions-aboutdebugging2" },
+ a({
+ className: "js-trusted-link",
+ onClick: () => this.openAboutDebugging(),
+ })
+ )
+ )
+ )
+ );
+ }
+}
+
+// Exports
+module.exports = RegistrationListEmpty;
diff --git a/devtools/client/application/src/components/service-workers/Worker.css b/devtools/client/application/src/components/service-workers/Worker.css
new file mode 100644
index 0000000000..e44b49ef6b
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/Worker.css
@@ -0,0 +1,75 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ /*
+ * The current layout of a service worker item is
+ *
+ * +------------+------------------------------+
+ * | Worker | script_name |
+ * | Icon |------------------------------|
+ * | | status start_button |
+ * +------------+------------------------------+
+ */
+
+.worker {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-template-areas: "icon source"
+ "icon misc";
+ column-gap: calc(var(--base-unit) * 2);
+ row-gap: var(--base-unit);
+
+ line-height: calc(var(--base-unit) * 4);
+ font-size: var(--body-10-font-size);
+}
+
+.worker__icon {
+ grid-area: icon;
+}
+
+.worker__icon-image {
+ width: calc(var(--base-unit) * 4);
+ height: calc(var(--base-unit) * 4);
+}
+
+.worker__source {
+ grid-area: source;
+ user-select: text;
+}
+
+.worker__misc {
+ grid-area: misc;
+}
+
+.worker__status {
+ text-transform: capitalize;
+ --status-bg-color: transparent;
+ --status-border-color: transparent;
+}
+
+.worker__status::before {
+ content: "";
+ margin-inline-end: var(--base-unit);
+ width: calc(var(--base-unit) * 2);
+ height: calc(var(--base-unit) * 2);
+ display: inline-block;
+ background: var(--status-bg-color);
+ border: 1px solid var(--status-border-color);
+ border-radius: 100%;
+}
+
+.worker__status--active {
+ --status-bg-color: var(--green-60);
+ --status-border-color: var(--green-60);
+}
+
+.worker__status--waiting {
+ --status-bg-color: var(--theme-text-color-alt);
+ --status-border-color: var(--theme-text-color-alt);
+}
+
+.worker__status--installing, .worker__status--default {
+ --status-bg-color: transparent;
+ --status-border-color: var(--theme-text-color-alt);
+}
diff --git a/devtools/client/application/src/components/service-workers/Worker.js b/devtools/client/application/src/components/service-workers/Worker.js
new file mode 100644
index 0000000000..bc95e084a9
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/Worker.js
@@ -0,0 +1,225 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const {
+ a,
+ img,
+ p,
+ section,
+ span,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const {
+ getUnicodeUrlPath,
+} = require("resource://devtools/client/shared/unicode-url.js");
+
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const Localized = createFactory(FluentReact.Localized);
+const {
+ l10n,
+} = require("resource://devtools/client/application/src/modules/l10n.js");
+
+const {
+ services,
+} = require("resource://devtools/client/application/src/modules/application-services.js");
+const Types = require("resource://devtools/client/application/src/types/index.js");
+
+const {
+ startWorker,
+} = require("resource://devtools/client/application/src/actions/workers.js");
+
+const UIButton = createFactory(
+ require("resource://devtools/client/application/src/components/ui/UIButton.js")
+);
+
+/**
+ * This component is dedicated to display a worker, more accurately a service worker, in
+ * the list of workers displayed in the application panel. It displays information about
+ * the worker as well as action links and buttons to interact with the worker (e.g. debug,
+ * unregister, update etc...).
+ */
+class Worker extends PureComponent {
+ static get propTypes() {
+ return {
+ isDebugEnabled: PropTypes.bool.isRequired,
+ worker: PropTypes.shape(Types.worker).isRequired,
+ // this prop get automatically injected via `connect`
+ dispatch: PropTypes.func.isRequired,
+ };
+ }
+
+ constructor(props) {
+ super(props);
+
+ this.debug = this.debug.bind(this);
+ this.viewSource = this.viewSource.bind(this);
+ this.start = this.start.bind(this);
+ }
+
+ debug() {
+ if (!this.isRunning()) {
+ console.log("Service workers cannot be debugged if they are not running");
+ return;
+ }
+
+ services.openWorkerInDebugger(this.props.worker.workerDescriptorFront);
+ }
+
+ viewSource() {
+ if (!this.isRunning()) {
+ console.log(
+ "Service workers cannot be inspected if they are not running"
+ );
+ return;
+ }
+
+ services.viewWorkerSource(this.props.worker.workerDescriptorFront);
+ }
+
+ start() {
+ if (!this.isActive() || this.isRunning()) {
+ console.log("Running or inactive service workers cannot be started");
+ return;
+ }
+
+ this.props.dispatch(startWorker(this.props.worker));
+ }
+
+ isRunning() {
+ // We know the worker is running if it has a worker actor.
+ return !!this.props.worker.workerDescriptorFront;
+ }
+
+ isActive() {
+ return this.props.worker.state === Ci.nsIServiceWorkerInfo.STATE_ACTIVATED;
+ }
+
+ getLocalizedStatus() {
+ if (this.isActive() && this.isRunning()) {
+ return l10n.getString("serviceworker-worker-status-running");
+ } else if (this.isActive()) {
+ return l10n.getString("serviceworker-worker-status-stopped");
+ }
+ // NOTE: this is already localized by the service worker front
+ // (strings are in debugger.properties)
+ return this.props.worker.stateText;
+ }
+
+ getClassNameForStatus(baseClass) {
+ const { state } = this.props.worker;
+
+ switch (state) {
+ case Ci.nsIServiceWorkerInfo.STATE_PARSED:
+ case Ci.nsIServiceWorkerInfo.STATE_INSTALLING:
+ return "worker__status--installing";
+ case Ci.nsIServiceWorkerInfo.STATE_INSTALLED:
+ case Ci.nsIServiceWorkerInfo.STATE_ACTIVATING:
+ return "worker__status--waiting";
+ case Ci.nsIServiceWorkerInfo.STATE_ACTIVATED:
+ return "worker__status--active";
+ }
+
+ return "worker__status--default";
+ }
+
+ formatSource(source) {
+ const parts = source.split("/");
+ return getUnicodeUrlPath(parts[parts.length - 1]);
+ }
+
+ renderInspectLink(url) {
+ // avoid rendering the inspect link if sw is not running
+ const isDisabled = !this.isRunning();
+ // view source instead of debugging when debugging sw is not available
+ const callbackFn = this.props.isDebugEnabled ? this.debug : this.viewSource;
+
+ const sourceUrl = span(
+ { className: "js-source-url" },
+ this.formatSource(url)
+ );
+
+ return isDisabled
+ ? sourceUrl
+ : a(
+ {
+ onClick: callbackFn,
+ title: url,
+ href: "#",
+ className: "js-inspect-link",
+ },
+ sourceUrl,
+ "\u00A0", // &nbsp;
+ Localized(
+ {
+ id: "serviceworker-worker-inspect-icon",
+ attrs: {
+ alt: true,
+ },
+ },
+ img({
+ src: "chrome://devtools/skin/images/application-debug.svg",
+ })
+ )
+ );
+ }
+
+ renderStartButton() {
+ // avoid rendering the button at all for workers that are either running,
+ // or in a state that prevents them from starting (like waiting)
+ if (this.isRunning() || !this.isActive()) {
+ return null;
+ }
+
+ return Localized(
+ { id: "serviceworker-worker-start3" },
+ UIButton({
+ onClick: this.start,
+ className: `js-start-button`,
+ size: "micro",
+ })
+ );
+ }
+
+ render() {
+ const { worker } = this.props;
+ const statusText = this.getLocalizedStatus();
+ const statusClassName = this.getClassNameForStatus();
+
+ return section(
+ { className: "worker js-sw-worker" },
+ p(
+ { className: "worker__icon" },
+ img({
+ className: "worker__icon-image",
+ src: "chrome://devtools/skin/images/debugging-workers.svg",
+ })
+ ),
+ p({ className: "worker__source" }, this.renderInspectLink(worker.url)),
+ p(
+ { className: "worker__misc" },
+ span(
+ { className: `js-worker-status worker__status ${statusClassName}` },
+ statusText
+ ),
+ " ",
+ this.renderStartButton()
+ )
+ );
+ }
+}
+
+const mapDispatchToProps = dispatch => ({ dispatch });
+module.exports = connect(mapDispatchToProps)(Worker);
diff --git a/devtools/client/application/src/components/service-workers/WorkersPage.js b/devtools/client/application/src/components/service-workers/WorkersPage.js
new file mode 100644
index 0000000000..a44dd292f8
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/WorkersPage.js
@@ -0,0 +1,71 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ section,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+
+const Types = require("resource://devtools/client/application/src/types/index.js");
+const RegistrationList = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/RegistrationList.js")
+);
+const RegistrationListEmpty = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/RegistrationListEmpty.js")
+);
+
+class WorkersPage extends PureComponent {
+ static get propTypes() {
+ return {
+ // mapped from state
+ canDebugWorkers: PropTypes.bool.isRequired,
+ domain: PropTypes.string.isRequired,
+ registrations: Types.registrationArray.isRequired,
+ };
+ }
+
+ render() {
+ const { canDebugWorkers, domain, registrations } = this.props;
+
+ // Filter out workers from other domains
+ const domainWorkers = registrations.filter(
+ x => !!x.workers.length && new URL(x.workers[0].url).hostname === domain
+ );
+ const isListEmpty = domainWorkers.length === 0;
+
+ return section(
+ {
+ className: `app-page js-service-workers-page ${
+ isListEmpty ? "app-page--empty" : ""
+ }`,
+ },
+ isListEmpty
+ ? RegistrationListEmpty({})
+ : RegistrationList({
+ canDebugWorkers,
+ registrations: domainWorkers,
+ })
+ );
+ }
+}
+
+function mapStateToProps(state) {
+ return {
+ canDebugWorkers: state.workers.canDebugWorkers,
+ domain: state.page.domain,
+ registrations: state.workers.list,
+ };
+}
+
+// Exports
+module.exports = connect(mapStateToProps)(WorkersPage);
diff --git a/devtools/client/application/src/components/service-workers/moz.build b/devtools/client/application/src/components/service-workers/moz.build
new file mode 100644
index 0000000000..f9704b9df8
--- /dev/null
+++ b/devtools/client/application/src/components/service-workers/moz.build
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "Registration.js",
+ "RegistrationList.js",
+ "RegistrationListEmpty.js",
+ "Worker.js",
+ "WorkersPage.js",
+)
diff --git a/devtools/client/application/src/components/ui/UIButton.css b/devtools/client/application/src/components/ui/UIButton.css
new file mode 100644
index 0000000000..2d614e09b0
--- /dev/null
+++ b/devtools/client/application/src/components/ui/UIButton.css
@@ -0,0 +1,75 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* these styles com from Photon. Keep in mind that the "default" style is not used
+ in panels, and we should use the "micro" instead for default, stand-alone buttons. */
+
+:root.theme-light {
+ --button-text-color: var(--grey-90);
+ --button-text-hover-color: var(--grey-90);
+ --button-text-pressed-color: var(--grey-90);
+ --button-background-color: var(--grey-90-a10);
+ --button-background-hover-color: var(--grey-90-a20);
+ --button-background-pressed-color: var(--grey-90-a30);
+}
+
+:root.theme-dark {
+ --button-text-color: var(--grey-40);
+ --button-text-hover-color: var(--grey-30);
+ --button-text-pressed-color: var(--grey-30);
+ --button-background-color: var(--grey-10-a20);
+ --button-background-hover-color: var(--grey-10-a25);
+ --button-background-pressed-color: var(--grey-10-a30);
+}
+
+.ui-button {
+ appearance: none;
+ transition: background-color 0.05s ease-in-out;
+
+ margin: 0;
+ height: calc(var(--base-unit) * 6);
+ padding-inline-start: calc(2 * var(--base-unit));
+ padding-inline-end: calc(2 * var(--base-unit));
+ border: none;
+ border-radius: calc(var(--base-unit) / 2);
+
+ color: var(--button-text-color);
+ background: var(--button-background-color);
+ font-size: var(--caption-10-font-size);
+}
+
+.ui-button:-moz-focusring {
+ outline: none;
+}
+.ui-button::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+.ui-button:enabled:hover {
+ background: var(--button-background-hover-color);
+ color: var(--button-text-hover-color);
+}
+
+.ui-button:enabled:active {
+ background: var(--button-background-pressed-color);
+ color: var(--button-text-pressed-color);
+}
+
+.ui-button:focus {
+ box-shadow: 0 0 0 1px var(--blue-50) inset,
+ 0 0 0 1px var(--blue-50),
+ 0 0 0 4px var(--blue-50-a30);
+}
+
+.ui-button:disabled {
+ opacity: 0.4;
+}
+
+/* Note: this "micro" variant here is not the same as the "micro" variant
+ in Photon docs (since we are using that one for our default size) */
+.ui-button--micro {
+ height: auto;
+ padding: calc(var(--base-unit) * 0.5) var(--base-unit);
+}
diff --git a/devtools/client/application/src/components/ui/UIButton.js b/devtools/client/application/src/components/ui/UIButton.js
new file mode 100644
index 0000000000..bc3f297d85
--- /dev/null
+++ b/devtools/client/application/src/components/ui/UIButton.js
@@ -0,0 +1,41 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ button,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+class UIButton extends PureComponent {
+ static get propTypes() {
+ return {
+ children: PropTypes.node,
+ className: PropTypes.string,
+ disabled: PropTypes.bool,
+ onClick: PropTypes.func,
+ size: PropTypes.oneOf(["micro"]),
+ };
+ }
+
+ render() {
+ const { className, disabled, onClick, size } = this.props;
+ const sizeClass = size ? `ui-button--${size}` : "";
+
+ return button(
+ {
+ className: `ui-button ${className || ""} ${sizeClass}`,
+ onClick,
+ disabled,
+ },
+ this.props.children
+ );
+ }
+}
+
+module.exports = UIButton;
diff --git a/devtools/client/application/src/components/ui/moz.build b/devtools/client/application/src/components/ui/moz.build
new file mode 100644
index 0000000000..f62f66d310
--- /dev/null
+++ b/devtools/client/application/src/components/ui/moz.build
@@ -0,0 +1,7 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "UIButton.js",
+)
diff --git a/devtools/client/application/src/constants.js b/devtools/client/application/src/constants.js
new file mode 100644
index 0000000000..f7e34082a3
--- /dev/null
+++ b/devtools/client/application/src/constants.js
@@ -0,0 +1,61 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const actionTypes = {
+ // manifest substate
+ FETCH_MANIFEST_FAILURE: "FETCH_MANIFEST_FAILURE",
+ FETCH_MANIFEST_START: "FETCH_MANIFEST_START",
+ FETCH_MANIFEST_SUCCESS: "FETCH_MANIFEST_SUCCESS",
+ RESET_MANIFEST: "RESET_MANIFEST",
+ // page substate
+ UPDATE_DOMAIN: "UPDATE_DOMAIN",
+ // ui substate
+ UPDATE_SELECTED_PAGE: "UPDATE_SELECTED_PAGE",
+ // workers substate
+ START_WORKER: "START_WORKER",
+ UNREGISTER_WORKER: "UNREGISTER_WORKER",
+ UPDATE_CAN_DEBUG_WORKERS: "UPDATE_CAN_DEBUG_WORKERS",
+ UPDATE_WORKERS: "UPDATE_WORKERS",
+};
+
+// NOTE: these const values are used as part of CSS selectors - be mindful of the characters used
+const PAGE_TYPES = {
+ MANIFEST: "manifest",
+ SERVICE_WORKERS: "service-workers",
+};
+
+const DEFAULT_PAGE = PAGE_TYPES.SERVICE_WORKERS;
+
+const MANIFEST_CATEGORIES = {
+ IDENTITY: "identity",
+ PRESENTATION: "presentation",
+ ICONS: "icons",
+};
+
+const MANIFEST_MEMBER_VALUE_TYPES = {
+ COLOR: "color",
+ ICON: "icon",
+ STRING: "string",
+ URL: "url",
+};
+
+const MANIFEST_ISSUE_LEVELS = {
+ ERROR: "error",
+ WARNING: "warning",
+};
+
+// flatten constants
+module.exports = Object.assign(
+ {},
+ {
+ DEFAULT_PAGE,
+ PAGE_TYPES,
+ MANIFEST_CATEGORIES,
+ MANIFEST_ISSUE_LEVELS,
+ MANIFEST_MEMBER_VALUE_TYPES,
+ },
+ actionTypes
+);
diff --git a/devtools/client/application/src/create-store.js b/devtools/client/application/src/create-store.js
new file mode 100644
index 0000000000..7c89adece3
--- /dev/null
+++ b/devtools/client/application/src/create-store.js
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ thunk,
+} = require("resource://devtools/client/shared/redux/middleware/thunk.js");
+const eventTelemetryMiddleware = require("resource://devtools/client/application/src/middleware/event-telemetry.js");
+
+const {
+ applyMiddleware,
+ createStore,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+
+// Reducers
+
+const rootReducer = require("resource://devtools/client/application/src/reducers/index.js");
+const {
+ ManifestState,
+} = require("resource://devtools/client/application/src/reducers/manifest-state.js");
+const {
+ WorkersState,
+} = require("resource://devtools/client/application/src/reducers/workers-state.js");
+const {
+ PageState,
+} = require("resource://devtools/client/application/src/reducers/page-state.js");
+const {
+ UiState,
+} = require("resource://devtools/client/application/src/reducers/ui-state.js");
+
+function configureStore(telemetry) {
+ // Prepare initial state.
+ const initialState = {
+ manifest: new ManifestState(),
+ page: new PageState(),
+ ui: new UiState(),
+ workers: new WorkersState(),
+ };
+
+ const middleware = applyMiddleware(
+ thunk(),
+ eventTelemetryMiddleware(telemetry)
+ );
+
+ return createStore(rootReducer, initialState, middleware);
+}
+
+exports.configureStore = configureStore;
diff --git a/devtools/client/application/src/middleware/event-telemetry.js b/devtools/client/application/src/middleware/event-telemetry.js
new file mode 100644
index 0000000000..60129d2bde
--- /dev/null
+++ b/devtools/client/application/src/middleware/event-telemetry.js
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ START_WORKER,
+ UNREGISTER_WORKER,
+ UPDATE_SELECTED_PAGE,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function eventTelemetryMiddleware(telemetry) {
+ function recordEvent(method, details = {}) {
+ telemetry.recordEvent(method, "application", null, details);
+ }
+
+ return store => next => action => {
+ switch (action.type) {
+ // ui telemetry
+ case UPDATE_SELECTED_PAGE:
+ recordEvent("select_page", { page_type: action.selectedPage });
+ break;
+ // service-worker related telemetry
+ case UNREGISTER_WORKER:
+ recordEvent("unregister_worker");
+ break;
+ case START_WORKER:
+ recordEvent("start_worker");
+ break;
+ }
+
+ return next(action);
+ };
+}
+
+module.exports = eventTelemetryMiddleware;
diff --git a/devtools/client/application/src/middleware/moz.build b/devtools/client/application/src/middleware/moz.build
new file mode 100644
index 0000000000..5041f3ca13
--- /dev/null
+++ b/devtools/client/application/src/middleware/moz.build
@@ -0,0 +1,7 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "event-telemetry.js",
+)
diff --git a/devtools/client/application/src/modules/application-services.js b/devtools/client/application/src/modules/application-services.js
new file mode 100644
index 0000000000..e51caa585b
--- /dev/null
+++ b/devtools/client/application/src/modules/application-services.js
@@ -0,0 +1,85 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// keyword to use in telemetry, as `reason` parameter
+const REASON = "application";
+
+class ManifestDevToolsError extends Error {
+ constructor(...params) {
+ super(...params);
+
+ this.name = "ManifestDevToolsError";
+ }
+}
+
+class ApplicationServices {
+ init(toolbox) {
+ this._toolbox = toolbox;
+
+ this.features = {
+ doesDebuggerSupportWorkers: Services.prefs.getBoolPref(
+ "devtools.debugger.features.windowless-service-workers",
+ false
+ ),
+ };
+ }
+
+ selectTool(toolId) {
+ this._assertInit();
+ return this._toolbox.selectTool(toolId, REASON);
+ }
+
+ async openWorkerInDebugger(workerDescriptorFront) {
+ const debuggerPanel = await this.selectTool("jsdebugger");
+ debuggerPanel.selectWorker(workerDescriptorFront);
+ }
+
+ async viewWorkerSource(workerDescriptorFront) {
+ // NOTE: this falls back to view-source: if the source can't be inspected
+ // within the debugger.
+ this._toolbox.viewSourceInDebugger(
+ workerDescriptorFront.url,
+ 1,
+ 1,
+ null,
+ REASON
+ );
+ }
+
+ async fetchManifest() {
+ let response;
+
+ try {
+ this._assertInit();
+ const manifestFront = await this._toolbox.target.getFront("manifest");
+ response = await manifestFront.fetchCanonicalManifest();
+ } catch (error) {
+ throw new ManifestDevToolsError(
+ error.message,
+ error.fileName,
+ error.lineNumber
+ );
+ }
+
+ if (response.errorMessage) {
+ throw new Error(response.errorMessage);
+ }
+
+ return response.manifest;
+ }
+
+ _assertInit() {
+ if (!this._toolbox) {
+ throw new Error("Services singleton has not been initialized");
+ }
+ }
+}
+
+module.exports = {
+ ManifestDevToolsError,
+ // exports a singleton, which will be used across all application panel modules
+ services: new ApplicationServices(),
+};
diff --git a/devtools/client/application/src/modules/l10n.js b/devtools/client/application/src/modules/l10n.js
new file mode 100644
index 0000000000..21e300cb38
--- /dev/null
+++ b/devtools/client/application/src/modules/l10n.js
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ FluentL10n,
+} = require("resource://devtools/client/shared/fluent-l10n/fluent-l10n.js");
+
+// exports a singleton, which will be used across all application panel modules
+exports.l10n = new FluentL10n();
diff --git a/devtools/client/application/src/modules/moz.build b/devtools/client/application/src/modules/moz.build
new file mode 100644
index 0000000000..778345fb1f
--- /dev/null
+++ b/devtools/client/application/src/modules/moz.build
@@ -0,0 +1,8 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "application-services.js",
+ "l10n.js",
+)
diff --git a/devtools/client/application/src/moz.build b/devtools/client/application/src/moz.build
new file mode 100644
index 0000000000..58e6f92857
--- /dev/null
+++ b/devtools/client/application/src/moz.build
@@ -0,0 +1,17 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "actions",
+ "components",
+ "middleware",
+ "modules",
+ "reducers",
+ "types",
+]
+
+DevToolsModules(
+ "constants.js",
+ "create-store.js",
+)
diff --git a/devtools/client/application/src/reducers/index.js b/devtools/client/application/src/reducers/index.js
new file mode 100644
index 0000000000..8b93290d9d
--- /dev/null
+++ b/devtools/client/application/src/reducers/index.js
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ combineReducers,
+} = require("resource://devtools/client/shared/vendor/redux.js");
+const {
+ workersReducer,
+} = require("resource://devtools/client/application/src/reducers/workers-state.js");
+const {
+ pageReducer,
+} = require("resource://devtools/client/application/src/reducers/page-state.js");
+const {
+ uiReducer,
+} = require("resource://devtools/client/application/src/reducers/ui-state.js");
+const {
+ manifestReducer,
+} = require("resource://devtools/client/application/src/reducers/manifest-state.js");
+
+module.exports = combineReducers({
+ manifest: manifestReducer,
+ page: pageReducer,
+ workers: workersReducer,
+ ui: uiReducer,
+});
diff --git a/devtools/client/application/src/reducers/manifest-state.js b/devtools/client/application/src/reducers/manifest-state.js
new file mode 100644
index 0000000000..61a2fa6759
--- /dev/null
+++ b/devtools/client/application/src/reducers/manifest-state.js
@@ -0,0 +1,158 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ MANIFEST_CATEGORIES,
+ MANIFEST_ISSUE_LEVELS,
+ MANIFEST_MEMBER_VALUE_TYPES,
+ FETCH_MANIFEST_FAILURE,
+ FETCH_MANIFEST_START,
+ FETCH_MANIFEST_SUCCESS,
+ RESET_MANIFEST,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function _processRawManifestIcons(rawIcons) {
+ // NOTE: about `rawIcons` array we are getting from platform:
+ // - Icons that do not comform to the spec are filtered out
+ // - We will always get a `src`
+ // - We will always get `purpose` with a value (default is `["any"]`)
+ // - `sizes` may be undefined
+ // - `type` may be undefined
+ return rawIcons.map(icon => {
+ return {
+ key: {
+ sizes: Array.isArray(icon.sizes) ? icon.sizes.join(" ") : icon.sizes,
+ contentType: icon.type,
+ },
+ value: {
+ src: icon.src,
+ purpose: icon.purpose.join(" "),
+ },
+ type: MANIFEST_MEMBER_VALUE_TYPES.ICON,
+ };
+ });
+}
+
+function _processRawManifestMembers(rawManifest) {
+ function getCategoryForMember(key) {
+ switch (key) {
+ case "name":
+ case "short_name":
+ return MANIFEST_CATEGORIES.IDENTITY;
+ default:
+ return MANIFEST_CATEGORIES.PRESENTATION;
+ }
+ }
+
+ function getValueTypeForMember(key) {
+ switch (key) {
+ case "start_url":
+ case "scope":
+ return MANIFEST_MEMBER_VALUE_TYPES.URL;
+ case "theme_color":
+ case "background_color":
+ return MANIFEST_MEMBER_VALUE_TYPES.COLOR;
+ default:
+ return MANIFEST_MEMBER_VALUE_TYPES.STRING;
+ }
+ }
+
+ const res = {
+ [MANIFEST_CATEGORIES.IDENTITY]: [],
+ [MANIFEST_CATEGORIES.PRESENTATION]: [],
+ };
+
+ // filter out extra metadata members (those with moz_ prefix) and icons
+ const rawMembers = Object.entries(rawManifest).filter(
+ ([key, value]) => !key.startsWith("moz_") && !(key === "icons")
+ );
+
+ for (const [key, value] of rawMembers) {
+ const category = getCategoryForMember(key);
+ const type = getValueTypeForMember(key);
+ res[category].push({ key, value, type });
+ }
+
+ return res;
+}
+
+function _processRawManifestIssues(issues) {
+ return issues.map(x => {
+ return {
+ level: x.warn
+ ? MANIFEST_ISSUE_LEVELS.WARNING
+ : MANIFEST_ISSUE_LEVELS.ERROR,
+ message: x.warn || x.error,
+ type: x.type || null,
+ };
+ });
+}
+
+function _processRawManifest(rawManifest) {
+ const res = {
+ url: rawManifest.moz_manifest_url,
+ };
+
+ // group manifest members by category
+ Object.assign(res, _processRawManifestMembers(rawManifest));
+ // process icons
+ res.icons = _processRawManifestIcons(rawManifest.icons || []);
+ // process error messages
+ res.validation = _processRawManifestIssues(rawManifest.moz_validation || []);
+
+ return res;
+}
+
+function ManifestState() {
+ return {
+ errorMessage: "",
+ isLoading: false,
+ manifest: undefined,
+ };
+}
+
+function manifestReducer(state = ManifestState(), action) {
+ switch (action.type) {
+ case FETCH_MANIFEST_START:
+ return Object.assign({}, state, {
+ isLoading: true,
+ mustLoadManifest: false,
+ });
+
+ case FETCH_MANIFEST_FAILURE:
+ const { error } = action;
+ // If we add a redux middleware to log errors, we should move the
+ // console.error below there.
+ console.error(error);
+ return Object.assign({}, state, {
+ errorMessage: error,
+ isLoading: false,
+ manifest: null,
+ });
+
+ case FETCH_MANIFEST_SUCCESS:
+ // NOTE: we don't get an error when the page does not have a manifest,
+ // but a `null` value there.
+ const { manifest } = action;
+ return Object.assign({}, state, {
+ errorMessage: "",
+ isLoading: false,
+ manifest: manifest ? _processRawManifest(manifest) : null,
+ });
+
+ case RESET_MANIFEST:
+ const defaultState = ManifestState();
+ return defaultState;
+
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ ManifestState,
+ manifestReducer,
+};
diff --git a/devtools/client/application/src/reducers/moz.build b/devtools/client/application/src/reducers/moz.build
new file mode 100644
index 0000000000..752b27a685
--- /dev/null
+++ b/devtools/client/application/src/reducers/moz.build
@@ -0,0 +1,11 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "index.js",
+ "manifest-state.js",
+ "page-state.js",
+ "ui-state.js",
+ "workers-state.js",
+)
diff --git a/devtools/client/application/src/reducers/page-state.js b/devtools/client/application/src/reducers/page-state.js
new file mode 100644
index 0000000000..ef3b6c970d
--- /dev/null
+++ b/devtools/client/application/src/reducers/page-state.js
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ UPDATE_DOMAIN,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function PageState() {
+ return {
+ // Domain
+ domain: null,
+ };
+}
+
+function getDomainFromUrl(url) {
+ return new URL(url).hostname;
+}
+
+function pageReducer(state = PageState(), action) {
+ switch (action.type) {
+ case UPDATE_DOMAIN: {
+ const { url } = action;
+ return {
+ domain: getDomainFromUrl(url),
+ };
+ }
+
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ PageState,
+ pageReducer,
+};
diff --git a/devtools/client/application/src/reducers/ui-state.js b/devtools/client/application/src/reducers/ui-state.js
new file mode 100644
index 0000000000..81a57c8086
--- /dev/null
+++ b/devtools/client/application/src/reducers/ui-state.js
@@ -0,0 +1,30 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ DEFAULT_PAGE,
+ UPDATE_SELECTED_PAGE,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function UiState() {
+ return {
+ selectedPage: DEFAULT_PAGE,
+ };
+}
+
+function uiReducer(state = UiState(), action) {
+ switch (action.type) {
+ case UPDATE_SELECTED_PAGE:
+ return Object.assign({}, state, { selectedPage: action.selectedPage });
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ UiState,
+ uiReducer,
+};
diff --git a/devtools/client/application/src/reducers/workers-state.js b/devtools/client/application/src/reducers/workers-state.js
new file mode 100644
index 0000000000..004c25ddfa
--- /dev/null
+++ b/devtools/client/application/src/reducers/workers-state.js
@@ -0,0 +1,65 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ START_WORKER,
+ UNREGISTER_WORKER,
+ UPDATE_CAN_DEBUG_WORKERS,
+ UPDATE_WORKERS,
+} = require("resource://devtools/client/application/src/constants.js");
+
+function WorkersState() {
+ return {
+ // Array of all service worker registrations
+ list: [],
+ canDebugWorkers: false,
+ };
+}
+
+function buildWorkerDataFromFronts({ registration, workers }) {
+ return {
+ id: registration.id,
+ lastUpdateTime: registration.lastUpdateTime,
+ registrationFront: registration,
+ scope: registration.scope,
+ workers: workers.map(worker => ({
+ id: worker.id,
+ url: worker.url,
+ state: worker.state,
+ stateText: worker.stateText,
+ registrationFront: registration,
+ workerDescriptorFront: worker.workerDescriptorFront,
+ })),
+ };
+}
+
+function workersReducer(state = WorkersState(), action) {
+ switch (action.type) {
+ case UPDATE_CAN_DEBUG_WORKERS: {
+ return Object.assign({}, state, {
+ canDebugWorkers: action.canDebugWorkers,
+ });
+ }
+ case UPDATE_WORKERS: {
+ const { workers } = action;
+ return Object.assign({}, state, {
+ list: workers.map(buildWorkerDataFromFronts).flat(),
+ });
+ }
+ // these actions don't change the state, but get picked up by the
+ // telemetry middleware
+ case START_WORKER:
+ case UNREGISTER_WORKER:
+ return state;
+ default:
+ return state;
+ }
+}
+
+module.exports = {
+ WorkersState,
+ workersReducer,
+};
diff --git a/devtools/client/application/src/types/index.js b/devtools/client/application/src/types/index.js
new file mode 100644
index 0000000000..bf15f187a6
--- /dev/null
+++ b/devtools/client/application/src/types/index.js
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const manifestTypes = require("resource://devtools/client/application/src/types/manifest.js");
+const routingTypes = require("resource://devtools/client/application/src/types/routing.js");
+const workersTypes = require("resource://devtools/client/application/src/types/service-workers.js");
+
+module.exports = Object.assign(
+ {},
+ {
+ ...manifestTypes,
+ ...routingTypes,
+ ...workersTypes,
+ }
+);
diff --git a/devtools/client/application/src/types/manifest.js b/devtools/client/application/src/types/manifest.js
new file mode 100644
index 0000000000..7f49522a25
--- /dev/null
+++ b/devtools/client/application/src/types/manifest.js
@@ -0,0 +1,89 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const {
+ MANIFEST_ISSUE_LEVELS,
+} = require("resource://devtools/client/application/src/constants.js");
+const {
+ MANIFEST_MEMBER_VALUE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const manifestIssue = {
+ level: PropTypes.oneOf(Object.values(MANIFEST_ISSUE_LEVELS)).isRequired,
+ message: PropTypes.string.isRequired,
+ // NOTE: we are currently ignoring the 'type' field that platform adds to errors
+};
+
+const manifestIssueArray = PropTypes.arrayOf(PropTypes.shape(manifestIssue));
+
+const manifestItemColor = {
+ label: PropTypes.string.isRequired,
+ value: PropTypes.string,
+};
+
+const manifestItemIcon = {
+ label: PropTypes.shape({
+ contentType: PropTypes.string,
+ sizes: PropTypes.string,
+ }).isRequired,
+ value: PropTypes.shape({
+ src: PropTypes.string.isRequired,
+ purpose: PropTypes.string.isRequired,
+ }).isRequired,
+};
+
+const manifestItemUrl = {
+ label: PropTypes.string.isRequired,
+ value: PropTypes.string,
+};
+
+const manifestMemberColor = {
+ key: manifestItemColor.label,
+ value: manifestItemColor.value,
+ type: PropTypes.oneOf([MANIFEST_MEMBER_VALUE_TYPES.COLOR]),
+};
+
+const manifestMemberIcon = {
+ key: manifestItemIcon.label,
+ value: manifestItemIcon.value,
+ type: PropTypes.oneOf([MANIFEST_MEMBER_VALUE_TYPES.ICON]),
+};
+
+const manifestMemberString = {
+ key: PropTypes.string.isRequired,
+ value: PropTypes.string,
+ type: PropTypes.oneOf([MANIFEST_MEMBER_VALUE_TYPES.STRING]),
+};
+
+const manifest = {
+ // members
+ identity: PropTypes.arrayOf(PropTypes.shape(manifestMemberString)).isRequired,
+ presentation: PropTypes.arrayOf(
+ PropTypes.oneOfType([
+ PropTypes.shape(manifestMemberColor),
+ PropTypes.shape(manifestMemberString),
+ ])
+ ).isRequired,
+ icons: PropTypes.arrayOf(PropTypes.shape(manifestMemberIcon)).isRequired,
+ // validation issues
+ validation: manifestIssueArray.isRequired,
+ // misc
+ url: PropTypes.string.isRequired,
+};
+
+module.exports = {
+ // full manifest
+ manifest,
+ // specific manifest items
+ manifestItemColor,
+ manifestItemIcon,
+ manifestItemUrl,
+ // manifest issues
+ manifestIssue,
+ manifestIssueArray,
+};
diff --git a/devtools/client/application/src/types/moz.build b/devtools/client/application/src/types/moz.build
new file mode 100644
index 0000000000..c8161f448d
--- /dev/null
+++ b/devtools/client/application/src/types/moz.build
@@ -0,0 +1,10 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "index.js",
+ "manifest.js",
+ "routing.js",
+ "service-workers.js",
+)
diff --git a/devtools/client/application/src/types/routing.js b/devtools/client/application/src/types/routing.js
new file mode 100644
index 0000000000..a1d922ab3d
--- /dev/null
+++ b/devtools/client/application/src/types/routing.js
@@ -0,0 +1,16 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const page = PropTypes.oneOf(Object.values(PAGE_TYPES));
+
+module.exports = {
+ page,
+};
diff --git a/devtools/client/application/src/types/service-workers.js b/devtools/client/application/src/types/service-workers.js
new file mode 100644
index 0000000000..bf913fb264
--- /dev/null
+++ b/devtools/client/application/src/types/service-workers.js
@@ -0,0 +1,35 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const worker = {
+ id: PropTypes.string.isRequired,
+ state: PropTypes.number.isRequired,
+ stateText: PropTypes.string.isRequired,
+ url: PropTypes.string.isRequired,
+ workerDescriptorFront: PropTypes.object,
+ registrationFront: PropTypes.object,
+};
+
+const workerArray = PropTypes.arrayOf(PropTypes.shape(worker));
+
+const registration = {
+ id: PropTypes.string.isRequired,
+ lastUpdateTime: PropTypes.number,
+ registrationFront: PropTypes.object.isRequired,
+ scope: PropTypes.string.isRequired,
+ workers: workerArray.isRequired,
+};
+
+const registrationArray = PropTypes.arrayOf(PropTypes.shape(registration));
+
+module.exports = {
+ registration,
+ registrationArray,
+ worker,
+ workerArray,
+};
diff --git a/devtools/client/application/test/browser/browser.ini b/devtools/client/application/test/browser/browser.ini
new file mode 100644
index 0000000000..4150959be4
--- /dev/null
+++ b/devtools/client/application/test/browser/browser.ini
@@ -0,0 +1,80 @@
+[DEFAULT]
+tags = devtools
+subsuite = devtools
+support-files =
+ head.js
+ resources/manifest/icon.svg
+ resources/manifest/load-fail.html
+ resources/manifest/load-no-manifest.html
+ resources/manifest/load-ok-icons.html
+ resources/manifest/load-ok-json-error.html
+ resources/manifest/load-ok-manifest-link.html
+ resources/manifest/load-ok-warnings.html
+ resources/manifest/load-ok.html
+ resources/manifest/manifest.json
+ resources/service-workers/controlled-install-sw.js
+ resources/service-workers/controlled-install.html
+ resources/service-workers/debug-sw.js
+ resources/service-workers/debug.html
+ resources/service-workers/dynamic-registration.html
+ resources/service-workers/empty.html
+ resources/service-workers/empty-sw.js
+ resources/service-workers/scope-page.html
+ resources/service-workers/simple.html
+ resources/service-workers/simple-unicode.html
+ !/devtools/client/debugger/test/mochitest/shared-head.js
+ !/devtools/client/shared/test/shared-head.js
+ !/devtools/client/shared/test/telemetry-test-helpers.js
+
+# Worker-related tests
+[browser_application_panel_debug-service-worker.js]
+skip-if = debug || asan || !serviceworker_e10s # Bug 1559591, 1575578, 1588154
+[browser_application_panel_list-domain-workers.js]
+https_first_disabled = true
+skip-if = debug # Bug 1559591
+[browser_application_panel_list-multiple-workers-same-registration.js]
+https_first_disabled = true
+skip-if = debug # Bug 1559591
+[browser_application_panel_list-several-workers.js]
+https_first_disabled = true
+skip-if = debug # Bug 1559591
+[browser_application_panel_list-single-worker.js]
+https_first_disabled = true
+skip-if = debug # Bug 1559591
+[browser_application_panel_start-service-worker.js]
+skip-if = asan || debug || !serviceworker_e10s || tsan # Bug 1559487, 1559591, 1608640
+[browser_application_panel_list-workers-empty.js]
+[browser_application_panel_list-unicode.js]
+skip-if = debug # Bug 1559591
+[browser_application_panel_unregister-worker.js]
+skip-if = debug # Bug 1559591
+[browser_application_panel_viewsource-service-worker.js]
+https_first_disabled = true
+skip-if = debug || asan || !serviceworker_e10s # Bug 1559591, 1575578, 1588154
+[browser_application_panel_worker-states.js]
+skip-if = asan || debug || !serviceworker_e10s # Bug 1559487, 1559591, 1608640
+# Manifest-related tests
+[browser_application_panel_manifest-display.js]
+[browser_application_panel_manifest-load.js]
+[browser_application_panel_manifest-open-json.js]
+https_first_disabled = true
+[browser_application_panel_manifest-reload.js]
+https_first_disabled = true
+# Telemetry tests
+[browser_application_panel_telemetry-debug-worker.js]
+https_first_disabled = true
+skip-if =
+ asan || debug || !serviceworker_e10s # Bug 1559487, 1559591, 1608640
+ os == 'linux' && bits == 64 && !debug # Bug 1654354
+[browser_application_panel_telemetry-select-page.js]
+[browser_application_panel_telemetry-start-worker.js]
+skip-if = ccov || asan || debug || !serviceworker_e10s || tsan # Bug 1559487, 1559591, 1608640, 1654468
+[browser_application_panel_telemetry-unregister-worker.js]
+skip-if = asan || debug || !serviceworker_e10s # Bug 1559487, 1559591, 1608640
+# Misc tests
+[browser_application_panel_open-links.js]
+skip-if = true # Bug 1467256, 1559591
+[browser_application_panel_sidebar.js]
+[browser_application_panel_target-switching.js]
+https_first_disabled = true
+skip-if = (os == 'win') || (os == 'linux') # Bug 1640234
diff --git a/devtools/client/application/test/browser/browser_application_panel_debug-service-worker.js b/devtools/client/application/test/browser/browser_application_panel_debug-service-worker.js
new file mode 100644
index 0000000000..57dd000edb
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_debug-service-worker.js
@@ -0,0 +1,61 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/shared-head.js",
+ this
+);
+
+const TAB_URL = URL_ROOT + "resources/service-workers/debug.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab, toolbox, commands } = await openNewTabAndApplicationPanel(
+ TAB_URL
+ );
+
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ const container = getWorkerContainers(doc)[0];
+ info("Wait until the inspect link is displayed");
+ await waitUntil(() => {
+ return container.querySelector(".js-inspect-link");
+ });
+
+ info("Click on the inspect link and wait for debugger to be ready");
+ const debugLink = container.querySelector(".js-inspect-link");
+ debugLink.click();
+ await waitFor(() => toolbox.getPanel("jsdebugger"));
+
+ // add a breakpoint at line 11
+ const debuggerContext = createDebuggerContext(toolbox);
+ await waitForLoadedSource(debuggerContext, "debug-sw.js");
+ await addBreakpoint(debuggerContext, "debug-sw.js", 11);
+
+ // force a pause at the breakpoint
+ info("Invoke fetch, expect the service worker script to pause on line 11");
+ await ContentTask.spawn(tab.linkedBrowser, {}, async function () {
+ content.wrappedJSObject.fetchFromWorker();
+ });
+ await waitForPaused(debuggerContext);
+ const workerScript = findSource(debuggerContext, "debug-sw.js");
+ assertPausedAtSourceAndLine(debuggerContext, workerScript.id, 11);
+ await resume(debuggerContext);
+
+ // remove breakpoint
+ await removeBreakpoint(debuggerContext, workerScript.id, 11);
+
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_list-domain-workers.js b/devtools/client/application/test/browser/browser_application_panel_list-domain-workers.js
new file mode 100644
index 0000000000..ccb0884d0e
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_list-domain-workers.js
@@ -0,0 +1,70 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the application panel only displays service workers from the
+ * current domain.
+ */
+
+const SIMPLE_URL = URL_ROOT + "resources/service-workers/simple.html";
+const OTHER_URL = SIMPLE_URL.replace("example.com", "test1.example.com");
+const EMPTY_URL = (URL_ROOT + "resources/service-workers/empty.html").replace(
+ "example.com",
+ "test2.example.com"
+);
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, commands, tab } = await openNewTabAndApplicationPanel(
+ SIMPLE_URL
+ );
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ let scopeEl = getWorkerContainers(doc)[0].querySelector(".js-sw-scope");
+ ok(
+ scopeEl.textContent.startsWith("example.com"),
+ "First service worker registration is displayed for the correct domain"
+ );
+
+ info(
+ "Navigate to another page for a different domain with no service worker"
+ );
+
+ await navigateTo(EMPTY_URL);
+ info("Wait until the service worker list is updated");
+ await waitUntil(
+ () => doc.querySelector(".js-registration-list-empty") !== null
+ );
+ ok(
+ true,
+ "No service workers are shown for an empty page in a different domain."
+ );
+
+ info(
+ "Navigate to another page for a different domain with another service worker"
+ );
+ await navigateTo(OTHER_URL);
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ scopeEl = getWorkerContainers(doc)[0].querySelector(".js-sw-scope");
+ ok(
+ scopeEl.textContent.startsWith("test1.example.com"),
+ "Second service worker registration is displayed for the correct domain"
+ );
+
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_list-multiple-workers-same-registration.js b/devtools/client/application/test/browser/browser_application_panel_list-multiple-workers-same-registration.js
new file mode 100644
index 0000000000..8e117927d1
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_list-multiple-workers-same-registration.js
@@ -0,0 +1,64 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const WORKER1_URL = URL_ROOT + "resources/service-workers/simple.html";
+const WORKER2_URL = URL_ROOT + "resources/service-workers/debug.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ await openTabAndWaitForWorker(WORKER1_URL);
+ const { panel, tab, commands } = await openTabAndWaitForWorker(WORKER2_URL);
+
+ const doc = panel.panelWin.document;
+
+ let registrationContainer = getWorkerContainers(doc)[0];
+
+ info("Wait until the unregister button is displayed for the registration");
+ await waitUntil(() => {
+ registrationContainer = getWorkerContainers(doc)[0];
+ return registrationContainer.querySelector(".js-unregister-button");
+ });
+
+ const scopeEl = registrationContainer.querySelector(".js-sw-scope");
+ const expectedScope =
+ "example.com/browser/devtools/client/application/test/" +
+ "browser/resources/service-workers";
+ ok(
+ scopeEl.textContent.startsWith(expectedScope),
+ "Registration has the expected scope"
+ );
+
+ // check the workers data
+ // note that the worker from WORKER2_URL will appear second in the list with
+ // the "installed" state
+ info("Check the workers data for this registration");
+ const workers = registrationContainer.querySelectorAll(".js-sw-worker");
+ is(workers.length, 2, "Registration has two workers");
+ // check url for worker from WORKER1_URL
+ const url1El = workers[0].querySelector(".js-source-url");
+ is(url1El.textContent, "empty-sw.js", "First worker has correct URL");
+ // check url for worker from WORKER2_URL
+ const url2El = workers[1].querySelector(".js-source-url");
+ is(url2El.textContent, "debug-sw.js", "Second worker has correct URL");
+
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+async function openTabAndWaitForWorker(url) {
+ const { panel, commands, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ return { panel, commands, tab };
+}
diff --git a/devtools/client/application/test/browser/browser_application_panel_list-several-workers.js b/devtools/client/application/test/browser/browser_application_panel_list-several-workers.js
new file mode 100644
index 0000000000..4e1295082e
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_list-several-workers.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the application panel can display several service workers applying to the
+ * same domain.
+ */
+
+const SIMPLE_URL = URL_ROOT + "resources/service-workers/simple.html";
+const OTHER_SCOPE_URL = URL_ROOT + "resources/service-workers/scope-page.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, commands, tab } = await openNewTabAndApplicationPanel(
+ SIMPLE_URL
+ );
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ info("Wait until the unregister button is displayed for the service worker");
+ await waitUntil(() =>
+ getWorkerContainers(doc)[0].querySelector(".js-unregister-button")
+ );
+
+ ok(true, "First service worker registration is displayed");
+
+ info(
+ "Navigate to another page for the same domain with another service worker"
+ );
+ await navigateTo(OTHER_SCOPE_URL);
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 2);
+
+ info("Wait until the unregister button is displayed for the service worker");
+ await waitUntil(() =>
+ getWorkerContainers(doc)[1].querySelector(".js-unregister-button")
+ );
+
+ ok(true, "Second service worker registration is displayed");
+
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_list-single-worker.js b/devtools/client/application/test/browser/browser_application_panel_list-single-worker.js
new file mode 100644
index 0000000000..74cab13bf6
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_list-single-worker.js
@@ -0,0 +1,64 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL =
+ URL_ROOT + "resources/service-workers/dynamic-registration.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Check for non-existing service worker");
+ const isWorkerListEmpty = !!doc.querySelector(".js-registration-list-empty");
+ ok(isWorkerListEmpty, "No Service Worker displayed");
+
+ info("Register a service worker in the page.");
+ await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
+ content.wrappedJSObject.registerServiceWorker();
+ });
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => !!getWorkerContainers(doc).length);
+
+ let workerContainer = getWorkerContainers(doc)[0];
+
+ info("Wait until the unregister button is displayed for the service worker");
+ await waitUntil(() => {
+ workerContainer = getWorkerContainers(doc)[0];
+ return workerContainer.querySelector(".js-unregister-button");
+ });
+
+ const scopeEl = workerContainer.querySelector(".js-sw-scope");
+ const expectedScope =
+ "example.com/browser/devtools/client/application/test/" +
+ "browser/resources/service-workers";
+ ok(
+ scopeEl.textContent.startsWith(expectedScope),
+ "Service worker has the expected scope"
+ );
+
+ const updatedEl = workerContainer.querySelector(".js-sw-updated");
+ ok(
+ updatedEl.textContent.includes(`${new Date().getFullYear()}`),
+ "Service worker has a last updated time"
+ );
+
+ info("Unregister the service worker");
+ await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
+ const registration = await content.wrappedJSObject.sw;
+ registration.unregister();
+ });
+
+ info("Wait until the service worker is removed from the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 0);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_list-unicode.js b/devtools/client/application/test/browser/browser_application_panel_list-unicode.js
new file mode 100644
index 0000000000..c747fa9ae3
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_list-unicode.js
@@ -0,0 +1,47 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = (
+ URL_ROOT + "resources/service-workers/simple-unicode.html"
+).replace("example.com", "xn--hxajbheg2az3al.xn--jxalpdlp");
+
+/**
+ * Check that the application panel displays filenames and URL's in human-readable,
+ * Unicode characters, and not encoded URI's or punycode.
+ */
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ const workerContainer = getWorkerContainers(doc)[0];
+
+ const scopeEl = workerContainer.querySelector(".js-sw-scope");
+ ok(
+ scopeEl.textContent.startsWith(
+ "\u03C0\u03B1\u03C1\u03AC\u03B4\u03B5\u03B9\u03B3\u03BC\u03B1." +
+ "\u03B4\u03BF\u03BA\u03B9\u03BC\u03AE"
+ ),
+ "Service worker has the expected Unicode scope"
+ );
+ const urlEl = workerContainer.querySelector(".js-source-url");
+ ok(
+ urlEl.textContent.endsWith("\u65E5\u672C"),
+ "Service worker has the expected Unicode url"
+ );
+
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_list-workers-empty.js b/devtools/client/application/test/browser/browser_application_panel_list-workers-empty.js
new file mode 100644
index 0000000000..1bb75d2999
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_list-workers-empty.js
@@ -0,0 +1,29 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the application panel only displays service workers from the
+ * current domain.
+ */
+
+const EMPTY_URL = URL_ROOT + "resources/service-workers/empty.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab } = await openNewTabAndApplicationPanel(EMPTY_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ await waitUntil(
+ () => doc.querySelector(".js-registration-list-empty") !== null
+ );
+ ok(true, "No service workers are shown for an empty page");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_manifest-display.js b/devtools/client/application/test/browser/browser_application_panel_manifest-display.js
new file mode 100644
index 0000000000..714fcc276e
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_manifest-display.js
@@ -0,0 +1,145 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the manifest is being properly shown
+ */
+
+add_task(async function () {
+ info("Test that we are displaying correctly a valid manifest");
+ const url = URL_ROOT + "resources/manifest/load-ok.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to be displayed");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest is being displayed");
+
+ // assert manifest members are being properly displayed
+ checkManifestMember(doc, "name", "Foo");
+ checkManifestMember(doc, "background_color", "#ff0000");
+
+ ok(
+ doc.querySelector(".js-manifest-issues") === null,
+ "No validation issues are being displayed"
+ );
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info(
+ "Test that we are displaying correctly a manifest with validation warnings"
+ );
+ const url = URL_ROOT + "resources/manifest/load-ok-warnings.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to be displayed");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest is being displayed");
+
+ // assert manifest members are being properly displayed
+ checkManifestMember(doc, "name", "Foo");
+ checkManifestMember(doc, "background_color", "");
+
+ const issuesEl = doc.querySelector(".js-manifest-issues");
+ ok(issuesEl !== null, "Validation issues are displayed");
+
+ const warningEl = [...issuesEl.querySelectorAll(".js-manifest-issue")].find(
+ x => x.textContent.includes("background_color")
+ );
+ ok(warningEl !== null, "A warning about background_color is displayed");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info("Test that we are displaying correctly a manifest with JSON errors");
+ const url = URL_ROOT + "resources/manifest/load-ok-json-error.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to be displayed");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest is being displayed");
+
+ const issuesEl = doc.querySelector(".js-manifest-issues");
+ ok(issuesEl !== null, "Validation issues are displayed");
+
+ const errorEl = [...issuesEl.querySelectorAll(".js-manifest-issue")].find(x =>
+ x.textContent.includes("JSON")
+ );
+ ok(errorEl !== null, "An error about JSON parsing is displayed");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info("Test that we are displaying correctly a manifest with icons");
+ const url = URL_ROOT + "resources/manifest/load-ok-icons.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to be displayed");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest is being displayed");
+
+ // assert manifest icon is being displayed
+ const iconEl = findMemberByLabel(doc, "128x128image/svg");
+ ok(iconEl !== null, "Icon label is being displayed with size and image type");
+ const imgEl = iconEl.querySelector(".js-manifest-item-content img");
+ ok(imgEl !== null, "An image is displayed for the icon");
+ is(
+ imgEl.src,
+ URL_ROOT + "resources/manifest/icon.svg",
+ "The icon image has the the icon url as source"
+ );
+ const iconTextContent = iconEl.querySelector(
+ ".js-manifest-item-content"
+ ).textContent;
+ ok(iconTextContent.includes("any"), "Purpose is being displayed");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+function findMemberByLabel(doc, member) {
+ return [...doc.querySelectorAll(".js-manifest-item")].find(x =>
+ x.querySelector(".js-manifest-item-label").textContent.startsWith(member)
+ );
+}
+
+function checkManifestMember(doc, member, expectedValue) {
+ const itemEl = findMemberByLabel(doc, member);
+ is(
+ itemEl.querySelector(".js-manifest-item-content").textContent,
+ expectedValue,
+ `Manifest member ${member} displays the correct value`
+ );
+}
diff --git a/devtools/client/application/test/browser/browser_application_panel_manifest-load.js b/devtools/client/application/test/browser/browser_application_panel_manifest-load.js
new file mode 100644
index 0000000000..dd89fbc1a6
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_manifest-load.js
@@ -0,0 +1,67 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the application panel fetches a manifest when in the Manifest Page
+ */
+
+add_task(async function () {
+ info("Test that manifest page loads the manifest successfully");
+ const url = URL_ROOT + "resources/manifest/load-ok.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to load");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest loaded successfully");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info("Test that manifest page shows an error when failing to load");
+ const url = URL_ROOT + "resources/manifest/load-fail.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to fail to load");
+ await waitUntil(
+ () => doc.querySelector(".js-manifest-loaded-error") !== null
+ );
+ ok(true, "Manifest page displays loading error");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info("Test that manifest page shows a message when there is no manifest");
+ const url = URL_ROOT + "resources/manifest/load-no-manifest.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the 'no manifest' message to appear");
+ await waitUntil(() => doc.querySelector(".js-manifest-empty") !== null);
+ ok(true, "Manifest page displays a 'no manifest' message");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_manifest-open-json.js b/devtools/client/application/test/browser/browser_application_panel_manifest-open-json.js
new file mode 100644
index 0000000000..7869502d4b
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_manifest-open-json.js
@@ -0,0 +1,67 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the application panel fetches a manifest when in the Manifest Page
+ */
+
+add_task(async function () {
+ info("Test that manifest page has a link that opens the manifest JSON file");
+ const url = URL_ROOT_SSL + "resources/manifest/load-ok-manifest-link.html";
+ const manifestUrl = URL_ROOT_SSL + "resources/manifest/manifest.json";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest JSON link");
+ await waitUntil(() => doc.querySelector(".js-manifest-json-link") !== null);
+ ok(true, "Link to JSON is displayed");
+
+ info("Click on link and wait till the JSON is opened in a new tab");
+ // click on the link and wait for the new tab to open
+ const onTabLoaded = BrowserTestUtils.waitForNewTab(
+ gBrowser,
+ `${manifestUrl}`
+ );
+ const link = doc.querySelector(".js-manifest-json-link");
+ link.click();
+ const jsonTab = await onTabLoaded;
+ ok(jsonTab, "The manifest JSON was opened in a new tab");
+
+ // close the tabs
+ info("Closing the page tab.");
+ await BrowserTestUtils.removeTab(tab);
+ info("Closing the manifest JSON tab.");
+ await BrowserTestUtils.removeTab(jsonTab);
+});
+
+add_task(async function () {
+ info(
+ "Test that manifest page does not show a link for manifests embedded in a data url"
+ );
+ const url = URL_ROOT_SSL + "resources/manifest/load-ok.html";
+
+ await enableApplicationPanel();
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to load");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest loaded successfully");
+ is(
+ doc.querySelector(".js-manifest-json-link"),
+ null,
+ "No JSON link is shown"
+ );
+
+ // close tab
+ info("Closing the tab");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_manifest-reload.js b/devtools/client/application/test/browser/browser_application_panel_manifest-reload.js
new file mode 100644
index 0000000000..4b8ab50985
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_manifest-reload.js
@@ -0,0 +1,51 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the application panel refetches the page manifest when reloading
+ * or navigating to a new page
+ */
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ info("Loading a page with no manifest");
+ let url = URL_ROOT_SSL + "resources/manifest/load-no-manifest.html";
+ const { panel, tab } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the 'no manifest' message to appear");
+ await waitFor(() => doc.querySelector(".js-manifest-empty") !== null);
+ ok(true, "Manifest page displays a 'no manifest' message");
+
+ info("Navigating to a page with a manifest");
+ url = URL_ROOT_SSL + "resources/manifest/load-ok.html";
+ await navigateTo(url);
+
+ info("Waiting for the manifest to show up");
+ await waitFor(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest displayed successfully");
+
+ info("Navigating to a page with a manifest that fails to load");
+ url = URL_ROOT_SSL + "resources/manifest/load-fail.html";
+ await navigateTo(url);
+
+ info("Waiting for the manifest to fail to load");
+ await waitFor(() => doc.querySelector(".js-manifest-loaded-error") !== null);
+ ok(true, "Manifest page displays loading error");
+
+ info("Reloading");
+ await navigateTo(url);
+
+ info("Waiting for the manifest to fail to load");
+ await waitFor(() => doc.querySelector(".js-manifest-loaded-error") !== null);
+ ok(true, "Manifest page displays loading error");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_open-links.js b/devtools/client/application/test/browser/browser_application_panel_open-links.js
new file mode 100644
index 0000000000..d654873827
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_open-links.js
@@ -0,0 +1,48 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const { Toolbox } = require("resource://devtools/client/framework/toolbox.js");
+
+/**
+ * Check that links work when the devtools are detached in a separate window.
+ */
+
+const TAB_URL = URL_ROOT + "resources/service-workers/empty.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, toolbox } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ // detach devtools in a separate window
+ await toolbox.switchHost(Toolbox.HostType.WINDOW);
+
+ // click on the link and wait for the new tab to open
+ const onTabLoaded = BrowserTestUtils.waitForNewTab(
+ gBrowser,
+ "about:debugging#workers",
+ true
+ );
+ doc.querySelector(".js-trusted-link").click();
+ info("Opening link in a new tab.");
+ const newTab = await onTabLoaded;
+
+ // We only need to check that newTab is truthy since
+ // BrowserTestUtils.waitForNewTab checks the URL.
+ ok(newTab, "The expected tab was opened.");
+
+ info("Wait until the main about debugging container is available");
+ await waitUntil(() => {
+ const aboutDebuggingDoc = newTab.linkedBrowser.contentDocument;
+ return aboutDebuggingDoc.querySelector(".app");
+ });
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(newTab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_sidebar.js b/devtools/client/application/test/browser/browser_application_panel_sidebar.js
new file mode 100644
index 0000000000..80b2fbfe09
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_sidebar.js
@@ -0,0 +1,82 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Check that the manifest is being properly shown
+ */
+
+add_task(async function () {
+ info("Test that we are displaying correctly the sidebar");
+
+ await enableApplicationPanel();
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel();
+ const doc = panel.panelWin.document;
+
+ info("Waiting for the sidebar to be displayed");
+ await waitUntil(() => doc.querySelector(".js-sidebar") !== null);
+ ok(true, "Sidebar is being displayed");
+
+ await waitUntil(() => doc.querySelector(".js-service-workers-page") !== null);
+ ok(true, "Service Workers page was loaded per default.");
+
+ // close the tab
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info("Test that we are displaying correctly the selected page - manifest");
+
+ await enableApplicationPanel();
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel();
+ const doc = panel.panelWin.document;
+
+ info("Select service worker page");
+ selectPage(panel, "service-workers");
+ await waitUntil(() => doc.querySelector(".js-service-workers-page") !== null);
+ await unregisterAllWorkers(commands.client, doc);
+
+ info("Select manifest page in the sidebar");
+ const link = doc.querySelector(".js-sidebar-manifest");
+ link.click();
+
+ await waitUntil(() => doc.querySelector(".js-manifest-page") !== null);
+ ok(true, "Manifest page was selected.");
+
+ // close the tab
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
+
+add_task(async function () {
+ info(
+ "Test that we are displaying correctly the selected page - service workers"
+ );
+ const url = URL_ROOT + "resources/manifest/load-ok.html";
+
+ await enableApplicationPanel();
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(url);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "manifest");
+
+ info("Waiting for the manifest to load");
+ await waitUntil(() => doc.querySelector(".js-manifest-page") !== null);
+ ok(true, "Manifest page was selected.");
+
+ info("Select service worker page in the sidebar");
+ const link = doc.querySelector(".js-sidebar-service-workers");
+ link.click();
+
+ await waitUntil(() => doc.querySelector(".js-service-workers-page") !== null);
+ ok(true, "Service workers page was selected.");
+
+ // close the tab
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_start-service-worker.js b/devtools/client/application/test/browser/browser_application_panel_start-service-worker.js
new file mode 100644
index 0000000000..1070f0f5af
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_start-service-worker.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/simple.html";
+
+/**
+ * Tests that the Start button works for service workers who can be debugged
+ */
+add_task(async function () {
+ await enableApplicationPanel(); // this also enables SW debugging
+
+ // Setting a low idle_timeout and idle_extended_timeout will allow the service worker
+ // to reach the STOPPED state quickly, which will allow us to test the start button.
+ // The default value is 30000 milliseconds.
+ info("Set a low service worker idle timeout");
+ await pushPref("dom.serviceWorkers.idle_timeout", 1000);
+ await pushPref("dom.serviceWorkers.idle_extended_timeout", 1000);
+
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ await waitForWorkerRegistration(tab);
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ info("Wait until the start button is displayed and enabled");
+ const container = getWorkerContainers(doc)[0];
+ await waitUntil(() => {
+ const button = container.querySelector(".js-start-button");
+ return button && !button.disabled;
+ });
+
+ info("Click the button and wait for the worker to start");
+ const button = container.querySelector(".js-start-button");
+ button.click();
+
+ info("Wait until status 'Running' is displayed");
+ await waitUntil(() => {
+ const statusEl = container.querySelector(".js-worker-status");
+ return statusEl && statusEl.textContent === "Running";
+ });
+ ok(true, "Worker status is 'Running'");
+
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_target-switching.js b/devtools/client/application/test/browser/browser_application_panel_target-switching.js
new file mode 100644
index 0000000000..ff8d521e30
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_target-switching.js
@@ -0,0 +1,68 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+// Test switching for the top-level target.
+
+// We use about:robots, because this page will run in the parent process.
+// Navigating from about:robots to a regular content page will always trigger
+// a target switch, with or without fission.
+const PARENT_PROCESS_URI = "about:robots";
+const CONTENT_PROCESS_URI_WORKERS =
+ URL_ROOT + "resources/service-workers/simple.html";
+const CONTENT_PROCESS_URI_MANIFEST =
+ URL_ROOT + "resources/manifest/load-ok.html";
+
+// test workers when target switching
+add_task(async function () {
+ await enableApplicationPanel();
+
+ info("Open a page that runs in the parent process");
+ const { panel, commands, tab } = await openNewTabAndApplicationPanel(
+ PARENT_PROCESS_URI
+ );
+ const doc = panel.panelWin.document;
+
+ info("Check for non-existing service worker");
+ selectPage(panel, "service-workers");
+ const isWorkerListEmpty = !!doc.querySelector(".js-registration-list-empty");
+ ok(isWorkerListEmpty, "No Service Worker displayed");
+
+ info("Navigate to a page that runs in the child process");
+ await navigateTo(CONTENT_PROCESS_URI_WORKERS);
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ // close the tab
+ info("Closing the tab.");
+ await unregisterAllWorkers(commands.client, doc);
+ await BrowserTestUtils.removeTab(tab);
+});
+
+// test manifest when target switching
+add_task(async function () {
+ await enableApplicationPanel();
+
+ info("Open a page that runs in the parent process");
+ const { panel, tab } = await openNewTabAndApplicationPanel(
+ PARENT_PROCESS_URI
+ );
+ const doc = panel.panelWin.document;
+
+ info("Waiting for the 'no manifest' message to appear");
+ selectPage(panel, "manifest");
+ await waitUntil(() => doc.querySelector(".js-manifest-empty") !== null);
+
+ info("Navigate to a page that runs in the child process");
+ await navigateTo(CONTENT_PROCESS_URI_MANIFEST);
+
+ info("Waiting for the manifest to load");
+ selectPage(panel, "manifest");
+ await waitUntil(() => doc.querySelector(".js-manifest") !== null);
+ ok(true, "Manifest loaded successfully");
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_telemetry-debug-worker.js b/devtools/client/application/test/browser/browser_application_panel_telemetry-debug-worker.js
new file mode 100644
index 0000000000..fe95dabd5e
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_telemetry-debug-worker.js
@@ -0,0 +1,49 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/simple.html";
+
+// check telemetry for debugging a service worker
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab, toolbox, commands } = await openNewTabAndApplicationPanel(
+ TAB_URL
+ );
+
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+ setupTelemetryTest();
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ const container = getWorkerContainers(doc)[0];
+ info("Wait until the debug link is displayed");
+ await waitUntil(() => {
+ return container.querySelector(".js-inspect-link");
+ });
+
+ info("Click on the debug link and wait for debugger to be ready");
+ const debugLink = container.querySelector(".js-inspect-link");
+ debugLink.click();
+ await waitUntil(() => toolbox.getPanel("jsdebugger"));
+
+ const events = getTelemetryEvents("jsdebugger");
+ const openToolboxEvent = events.find(event => event.method == "enter");
+ ok(openToolboxEvent.session_id > 0, "Event has a valid session id");
+ is(
+ openToolboxEvent.start_state,
+ "application",
+ "Event has the 'application' start state"
+ );
+
+ // clean up and close the tab
+ await unregisterAllWorkers(commands.client, doc);
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_telemetry-select-page.js b/devtools/client/application/test/browser/browser_application_panel_telemetry-select-page.js
new file mode 100644
index 0000000000..c200c38c17
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_telemetry-select-page.js
@@ -0,0 +1,26 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const TAB_URL = URL_ROOT + "resources/service-workers/empty.html";
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ setupTelemetryTest();
+
+ // make sure the default page is opened and then select a different one
+ await waitUntil(() => doc.querySelector(".js-service-workers-page") !== null);
+ ok(true, "Service Workers page was loaded per default.");
+ selectPage(panel, "manifest");
+
+ checkTelemetryEvent({ method: "select_page", page_type: "manifest" });
+
+ // close the tab
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_telemetry-start-worker.js b/devtools/client/application/test/browser/browser_application_panel_telemetry-start-worker.js
new file mode 100644
index 0000000000..235ce3060d
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_telemetry-start-worker.js
@@ -0,0 +1,45 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/simple.html";
+
+// check telemetry for starting a service worker
+add_task(async function () {
+ info("Set a low service worker idle timeout");
+ await pushPref("dom.serviceWorkers.idle_timeout", 1000);
+ await pushPref("dom.serviceWorkers.idle_extended_timeout", 1000);
+
+ await enableApplicationPanel();
+
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+ await waitForWorkerRegistration(tab);
+
+ setupTelemetryTest();
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ info("Wait until the start button is displayed and enabled");
+ const container = getWorkerContainers(doc)[0];
+ await waitUntil(() => {
+ const button = container.querySelector(".js-start-button");
+ return button && !button.disabled;
+ });
+
+ info("Click the start button");
+ const button = container.querySelector(".js-start-button");
+ button.click();
+
+ checkTelemetryEvent({ method: "start_worker" });
+
+ // clean up and close the tab
+ await unregisterAllWorkers(commands.client, doc);
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_telemetry-unregister-worker.js b/devtools/client/application/test/browser/browser_application_panel_telemetry-unregister-worker.js
new file mode 100644
index 0000000000..aa6d35f946
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_telemetry-unregister-worker.js
@@ -0,0 +1,37 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/simple.html";
+
+// check telemetry for unregistering a service worker
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ setupTelemetryTest();
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ const workerContainer = getWorkerContainers(doc)[0];
+
+ info("Wait until the unregister button is displayed for the service worker");
+ await waitUntil(() => workerContainer.querySelector(".js-unregister-button"));
+ info("Click the unregister button");
+ const button = workerContainer.querySelector(".js-unregister-button");
+ button.click();
+
+ checkTelemetryEvent({ method: "unregister_worker" });
+
+ // clean up and close the tab
+ await unregisterAllWorkers(commands.client, doc);
+ info("Closing the tab.");
+ await commands.client.waitForRequestsToSettle();
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_unregister-worker.js b/devtools/client/application/test/browser/browser_application_panel_unregister-worker.js
new file mode 100644
index 0000000000..8f6c4a5793
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_unregister-worker.js
@@ -0,0 +1,36 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/simple.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ const workerContainer = getWorkerContainers(doc)[0];
+
+ info("Wait until the unregister button is displayed for the service worker");
+ await waitUntil(() => workerContainer.querySelector(".js-unregister-button"));
+ info("Click the unregister button");
+ const button = workerContainer.querySelector(".js-unregister-button");
+ button.click();
+ info("Wait until the service worker is removed from the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 0);
+ ok(true, "Service worker list is empty");
+
+ // just in case cleanup
+ await unregisterAllWorkers(commands.client, doc);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_viewsource-service-worker.js b/devtools/client/application/test/browser/browser_application_panel_viewsource-service-worker.js
new file mode 100644
index 0000000000..fc6f0819b6
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_viewsource-service-worker.js
@@ -0,0 +1,50 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/debug.html";
+const SW_URL = URL_ROOT + "resources/service-workers/debug-sw.js";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ // disable service worker debugging
+ await pushPref(
+ "devtools.debugger.features.windowless-service-workers",
+ false
+ );
+
+ const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 1);
+
+ const container = getWorkerContainers(doc)[0];
+ info("Wait until the inspect link is displayed");
+ await waitUntil(() => {
+ return container.querySelector(".js-inspect-link");
+ });
+
+ info("Click on the inspect link and wait for a new view-source: tab open");
+ // click on the link and wait for the new tab to open
+ const onTabLoaded = BrowserTestUtils.waitForNewTab(
+ gBrowser,
+ `view-source:${SW_URL}`
+ );
+ const inspectLink = container.querySelector(".js-inspect-link");
+ inspectLink.click();
+
+ const sourceTab = await onTabLoaded;
+ ok(sourceTab, "The service worker source was opened in a new tab");
+
+ // clean up
+ await unregisterAllWorkers(commands.client, doc);
+ // close the tabs
+ info("Closing the tabs.");
+ await BrowserTestUtils.removeTab(sourceTab);
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/browser_application_panel_worker-states.js b/devtools/client/application/test/browser/browser_application_panel_worker-states.js
new file mode 100644
index 0000000000..54446506fa
--- /dev/null
+++ b/devtools/client/application/test/browser/browser_application_panel_worker-states.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TAB_URL = URL_ROOT + "resources/service-workers/controlled-install.html";
+
+add_task(async function () {
+ await enableApplicationPanel();
+
+ const { panel, tab } = await openNewTabAndApplicationPanel(TAB_URL);
+ const doc = panel.panelWin.document;
+
+ selectPage(panel, "service-workers");
+
+ info("Check for non-existing service worker");
+ const isWorkerListEmpty = !!doc.querySelector(".js-registration-list-empty");
+ ok(isWorkerListEmpty, "No Service Worker displayed");
+
+ info("Register a service worker with a controlled install in the page.");
+ await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
+ content.wrappedJSObject.registerServiceWorker();
+ });
+
+ info("Wait until the service worker appears in the application panel");
+ await waitUntil(() => !!getWorkerContainers(doc).length);
+ info("Wait until the 'Installing' state is displayed");
+ await waitUntil(() => {
+ const containers = getWorkerContainers(doc);
+ if (containers.length === 0) {
+ return false;
+ }
+
+ const stateEl = containers[0].querySelector(".js-worker-status");
+ return stateEl.textContent.toLowerCase() === "installing";
+ });
+
+ info("Allow the service worker to complete installation");
+ await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
+ content.wrappedJSObject.installServiceWorker();
+ });
+
+ info("Wait until the 'running' state is displayed");
+ await waitUntil(() => {
+ const workerContainer = getWorkerContainers(doc)[0];
+ const stateEl = workerContainer.querySelector(".js-worker-status");
+ return stateEl.textContent.toLowerCase() === "running";
+ });
+
+ info("Unregister the service worker");
+ await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
+ const registration = await content.wrappedJSObject.sw;
+ registration.unregister();
+ });
+
+ info("Wait until the service worker is removed from the application panel");
+ await waitUntil(() => getWorkerContainers(doc).length === 0);
+
+ // close the tab
+ info("Closing the tab.");
+ await BrowserTestUtils.removeTab(tab);
+});
diff --git a/devtools/client/application/test/browser/head.js b/devtools/client/application/test/browser/head.js
new file mode 100644
index 0000000000..6b7e67ff8d
--- /dev/null
+++ b/devtools/client/application/test/browser/head.js
@@ -0,0 +1,134 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* eslint-env browser */
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+"use strict";
+
+// Load the shared-head file first.
+Services.scriptloader.loadSubScript(
+ "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js",
+ this
+);
+
+/**
+ * Set all preferences needed to enable service worker debugging and testing.
+ */
+async function enableServiceWorkerDebugging() {
+ // Enable service workers.
+ await pushPref("dom.serviceWorkers.enabled", true);
+ // Accept workers from mochitest's http.
+ await pushPref("dom.serviceWorkers.testing.enabled", true);
+ // Force single content process, see Bug 1231208 for the SW refactor that should enable
+ // SW debugging in multi-e10s.
+ await pushPref("dom.ipc.processCount", 1);
+
+ // Enable service workers in the debugger
+ await pushPref("devtools.debugger.features.windowless-service-workers", true);
+ // Disable randomly spawning processes during tests
+ await pushPref("dom.ipc.processPrelaunch.enabled", false);
+
+ // Wait for dom.ipc.processCount to be updated before releasing processes.
+ Services.ppmm.releaseCachedProcesses();
+}
+
+async function enableApplicationPanel() {
+ // FIXME bug 1575427 this rejection is very common.
+ const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+ );
+ PromiseTestUtils.allowMatchingRejectionsGlobally(
+ /this._frontCreationListeners is null/
+ );
+
+ // Enable all preferences related to service worker debugging.
+ await enableServiceWorkerDebugging();
+
+ // Enable web manifest processing.
+ Services.prefs.setBoolPref("dom.manifest.enabled", true);
+
+ // Enable application panel in DevTools.
+ await pushPref("devtools.application.enabled", true);
+}
+
+function setupTelemetryTest() {
+ // Reset all the counts
+ Services.telemetry.clearEvents();
+
+ // Ensure no events have been logged
+ const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS;
+ const snapshot = Services.telemetry.snapshotEvents(ALL_CHANNELS, true);
+ ok(!snapshot.parent, "No events have been logged for the main process");
+}
+
+function getTelemetryEvents(objectName) {
+ // read the requested events only
+ const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS;
+ const snapshot = Services.telemetry.snapshotEvents(ALL_CHANNELS, true);
+ // filter and transform the event data so the relevant info is in a single object:
+ // { method: "...", extraField: "...", anotherExtraField: "...", ... }
+ const events = snapshot.parent
+ .filter(event => event[1] === "devtools.main" && event[3] === objectName)
+ .map(event => ({ method: event[2], ...event[5] }));
+
+ return events;
+}
+
+function checkTelemetryEvent(expectedEvent, objectName = "application") {
+ info("Check telemetry event");
+ const events = getTelemetryEvents(objectName);
+
+ // assert we only got 1 event with a valid session ID
+ is(events.length, 1, "There was only 1 event logged");
+ const [event] = events;
+ ok(event.session_id > 0, "There is a valid session_id in the event");
+
+ // assert expected data
+ Assert.deepEqual(event, { ...expectedEvent, session_id: event.session_id });
+}
+
+function getWorkerContainers(doc) {
+ return doc.querySelectorAll(".js-sw-container");
+}
+
+async function openNewTabAndApplicationPanel(url) {
+ const tab = await addTab(url);
+
+ const toolbox = await gDevTools.showToolboxForTab(tab, {
+ toolId: "application",
+ });
+ const panel = toolbox.getCurrentPanel();
+ const target = toolbox.target;
+ const commands = toolbox.commands;
+ return { panel, tab, target, toolbox, commands };
+}
+
+async function unregisterAllWorkers(client, doc) {
+ // This method is declared in shared-head.js
+ await unregisterAllServiceWorkers(client);
+
+ info("Wait for service workers to disappear from the UI");
+ waitUntil(() => getWorkerContainers(doc).length === 0);
+}
+
+async function waitForWorkerRegistration(swTab) {
+ info("Wait until the registration appears on the window");
+ const swBrowser = swTab.linkedBrowser;
+ await asyncWaitUntil(async () =>
+ SpecialPowers.spawn(swBrowser, [], function () {
+ return !!content.wrappedJSObject.getRegistration();
+ })
+ );
+}
+
+function selectPage(panel, page) {
+ /**
+ * Select a page by simulating a user click in the sidebar.
+ * @param {string} page The page we want to select (see `PAGE_TYPES`)
+ **/
+ info(`Selecting application page: ${page}`);
+ const doc = panel.panelWin.document;
+ const navItem = doc.querySelector(`.js-sidebar-${page}`);
+ navItem.click();
+}
diff --git a/devtools/client/application/test/browser/resources/manifest/icon.svg b/devtools/client/application/test/browser/resources/manifest/icon.svg
new file mode 100644
index 0000000000..bfed2982bc
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/icon.svg
@@ -0,0 +1,4 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 953.37 984"><defs><linearGradient id="linear-gradient" x1="-14706.28" y1="9250.14" x2="-14443.04" y2="9250.14" gradientTransform="matrix(0.76, 0.03, 0.05, -1.12, 11485.47, 11148)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0083ff"/><stop offset="0.1" stop-color="#0092f8"/><stop offset="0.31" stop-color="#00abeb"/><stop offset="0.52" stop-color="#00bee1"/><stop offset="0.75" stop-color="#00c8dc"/><stop offset="1" stop-color="#00ccda"/></linearGradient><radialGradient id="radial-gradient" cx="-7588.66" cy="8866.53" r="791.23" gradientTransform="matrix(1.23, 0, 0, -1.22, 9958.21, 11048.11)" gradientUnits="userSpaceOnUse"><stop offset="0.02" stop-color="#005fe7"/><stop offset="0.18" stop-color="#0042b4"/><stop offset="0.32" stop-color="#002989"/><stop offset="0.4" stop-color="#002079"/><stop offset="0.47" stop-color="#131d78"/><stop offset="0.66" stop-color="#3b1676"/><stop offset="0.75" stop-color="#4a1475"/></radialGradient><linearGradient id="linear-gradient-2" x1="539.64" y1="254.8" x2="348.2" y2="881.03" gradientTransform="matrix(1, 0, 0, -1, 1, 984)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#000f43" stop-opacity="0.4"/><stop offset="0.48" stop-color="#001962" stop-opacity="0.17"/><stop offset="1" stop-color="#002079" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-3" x1="540.64" y1="254.8" x2="349.2" y2="881.03" gradientTransform="matrix(1, 0, 0, -1, 0, 984)" href="#linear-gradient-2"/><linearGradient id="linear-gradient-4" x1="-8367.12" y1="7348.87" x2="-8482.36" y2="7357.76" gradientTransform="matrix(1.22, 0.12, 0.12, -1.22, 10241.06, 10765.32)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#812cc9"/><stop offset="1" stop-color="#005fe7"/></linearGradient><linearGradient id="linear-gradient-5" x1="-8449.89" y1="7496.97" x2="-8341.94" y2="7609.09" gradientTransform="matrix(1.22, 0.12, 0.12, -1.22, 10241.06, 10765.32)" gradientUnits="userSpaceOnUse"><stop offset="0.05" stop-color="#005fe7"/><stop offset="0.18" stop-color="#065de6"/><stop offset="0.35" stop-color="#1856e1"/><stop offset="0.56" stop-color="#354adb"/><stop offset="0.78" stop-color="#5d3ad1"/><stop offset="0.95" stop-color="#812cc9"/></linearGradient><linearGradient id="linear-gradient-6" x1="-8653.41" y1="7245.3" x2="-8422.52" y2="7244.76" gradientTransform="matrix(1.22, 0.12, 0.12, -1.22, 10241.06, 10765.32)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#002079"/><stop offset="0.99" stop-color="#a238ff"/></linearGradient><radialGradient id="radial-gradient-2" cx="644.11" cy="599.83" fx="785.0454815336918" fy="470.6889181532662" r="793.95" gradientTransform="matrix(1, 0, 0, -1, 0, 984)" gradientUnits="userSpaceOnUse"><stop offset="0.2" stop-color="#00fdff"/><stop offset="0.26" stop-color="#0af1ff"/><stop offset="0.37" stop-color="#23d2ff"/><stop offset="0.52" stop-color="#4da0ff"/><stop offset="0.69" stop-color="#855bff"/><stop offset="0.77" stop-color="#a238ff"/><stop offset="0.81" stop-color="#a738fd"/><stop offset="0.86" stop-color="#b539f9"/><stop offset="0.9" stop-color="#cd39f1"/><stop offset="0.96" stop-color="#ee3ae6"/><stop offset="0.98" stop-color="#ff3be0"/></radialGradient><linearGradient id="linear-gradient-7" x1="-7458.97" y1="9093.17" x2="-7531.06" y2="8282.84" gradientTransform="matrix(1.23, 0, 0, -1.22, 9958.21, 11048.11)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#00ec00"/><stop offset="0.1" stop-color="#00e244"/><stop offset="0.22" stop-color="#00d694"/><stop offset="0.31" stop-color="#00cfc7"/><stop offset="0.35" stop-color="#00ccda"/><stop offset="0.42" stop-color="#0bc2dd" stop-opacity="0.92"/><stop offset="0.57" stop-color="#29a7e4" stop-opacity="0.72"/><stop offset="0.77" stop-color="#597df0" stop-opacity="0.4"/><stop offset="1" stop-color="#9448ff" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-8" x1="-8926.61" y1="7680.53" x2="-8790.14" y2="7680.53" gradientTransform="matrix(1.22, 0.12, 0.12, -1.22, 10241.06, 10765.32)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#005fe7"/><stop offset="0.46" stop-color="#0071f3" stop-opacity="0.51"/><stop offset="0.83" stop-color="#007efc" stop-opacity="0.14"/><stop offset="1" stop-color="#0083ff" stop-opacity="0"/></linearGradient><radialGradient id="radial-gradient-3" cx="-8914.62" cy="7721.05" r="165.97" gradientTransform="matrix(1.22, 0.12, 0.12, -1.22, 10241.06, 10765.32)" gradientUnits="userSpaceOnUse"><stop offset="0.63" stop-color="#ffe302" stop-opacity="0"/><stop offset="0.67" stop-color="#ffe302" stop-opacity="0.05"/><stop offset="0.75" stop-color="#ffe302" stop-opacity="0.19"/><stop offset="0.86" stop-color="#ffe302" stop-opacity="0.4"/><stop offset="0.99" stop-color="#ffe302" stop-opacity="0.7"/></radialGradient><linearGradient id="linear-gradient-9" x1="214.02" y1="2032.47" x2="96.19" y2="2284.31" gradientTransform="matrix(0.99, 0.1, 0.1, -0.99, -250.1, 2306.29)" gradientUnits="userSpaceOnUse"><stop offset="0.19" stop-color="#4a1475" stop-opacity="0.5"/><stop offset="0.62" stop-color="#2277ac" stop-opacity="0.23"/><stop offset="0.94" stop-color="#00ccda" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-10" x1="-38.44" y1="278.18" x2="55.67" y2="171.29" gradientTransform="matrix(0.99, 0.1, 0.1, -0.99, 229.04, 745.87)" gradientUnits="userSpaceOnUse"><stop offset="0.01" stop-color="#002079" stop-opacity="0.5"/><stop offset="1" stop-color="#0083ff" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-11" x1="142.45" y1="96.25" x2="142.5" y2="149.68" gradientTransform="matrix(0.99, 0.1, 0.1, -0.99, 229.04, 745.87)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4a1475" stop-opacity="0.9"/><stop offset="0.18" stop-color="#6720a2" stop-opacity="0.6"/><stop offset="0.38" stop-color="#812acb" stop-opacity="0.34"/><stop offset="0.57" stop-color="#9332e8" stop-opacity="0.15"/><stop offset="0.76" stop-color="#9e36f9" stop-opacity="0.04"/><stop offset="0.93" stop-color="#a238ff" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-12" x1="620.52" y1="947.88" x2="926.18" y2="264.39" gradientTransform="matrix(1, 0, 0, -1, 0, 984)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#00ec00" stop-opacity="0"/><stop offset="0.28" stop-color="#00dc6d" stop-opacity="0.5"/><stop offset="0.5" stop-color="#00d1bb" stop-opacity="0.86"/><stop offset="0.6" stop-color="#00ccda"/><stop offset="0.68" stop-color="#04c9db"/><stop offset="0.75" stop-color="#0fc1df"/><stop offset="0.83" stop-color="#23b2e6"/><stop offset="0.9" stop-color="#3e9ef0"/><stop offset="0.98" stop-color="#6184fc"/><stop offset="0.99" stop-color="#6680fe"/></linearGradient><linearGradient id="linear-gradient-13" x1="680.88" y1="554.79" x2="536.1" y2="166.04" gradientTransform="matrix(1, 0, 0, -1, 0, 984)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0083ff"/><stop offset="0.04" stop-color="#0083ff" stop-opacity="0.92"/><stop offset="0.14" stop-color="#0083ff" stop-opacity="0.71"/><stop offset="0.26" stop-color="#0083ff" stop-opacity="0.52"/><stop offset="0.37" stop-color="#0083ff" stop-opacity="0.36"/><stop offset="0.49" stop-color="#0083ff" stop-opacity="0.23"/><stop offset="0.61" stop-color="#0083ff" stop-opacity="0.13"/><stop offset="0.73" stop-color="#0083ff" stop-opacity="0.06"/><stop offset="0.86" stop-color="#0083ff" stop-opacity="0.01"/><stop offset="1" stop-color="#0083ff" stop-opacity="0"/></linearGradient></defs><title>firefox-logo-nightly</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><g id="Layer_2-2" data-name="Layer 2"><g id="Firefox"><path d="M770.28,91.56c-23.95,27.88-35.1,90.64-10.82,154.26s61.5,49.8,84.7,114.67c30.62,85.6,16.37,200.59,16.37,200.59s36.81,106.61,62.47-6.63C979.79,341.74,770.28,143.94,770.28,91.56Z" style="fill:url(#linear-gradient)"/><path id="_Path_" data-name=" Path " d="M476.92,972.83c245.24,0,443.9-199.74,443.9-446s-198.66-446-443.66-446S33.5,280.51,33.5,526.8C33,773.33,231.92,972.83,476.92,972.83Z" style="fill:url(#radial-gradient)"/><path d="M810.67,803.64a246.8,246.8,0,0,1-30.12,18.18,705.31,705.31,0,0,0,38.3-63c9.46-10.47,18.13-20.65,25.19-31.65,3.44-5.41,7.31-12.08,11.42-19.82,24.92-44.9,52.4-117.56,53.18-192.2v-5.66a257.25,257.25,0,0,0-5.71-55.75c.2,1.43.38,2.86.56,4.29-.22-1.1-.41-2.21-.64-3.31.37,2,.66,4,1,6,5.09,43.22,1.47,85.37-16.68,116.45-.29.45-.58.88-.87,1.32,9.41-47.23,12.56-99.39,2.09-151.6,0,0-4.19-25.38-35.38-102.44-18-44.35-49.83-80.72-78-107.21-24.69-30.55-47.11-51-59.47-64.06C689.72,126,678.9,105.61,674.45,92.31c-3.85-1.93-53.14-49.81-57.05-51.63-21.51,33.35-89.16,137.67-57,235.15,14.58,44.17,51.47,90,90.07,115.74,1.69,1.94,23,25,33.09,77.16,10.45,53.85,5,95.86-16.54,158C641.73,681.24,577,735.12,516.3,740.63c-129.67,11.78-177.15-65.11-177.15-65.11C385.49,694,436.72,690.17,467.87,671c31.4-19.43,50.39-33.83,65.81-28.15C548.86,648.43,561,632,550.1,615a78.5,78.5,0,0,0-79.4-34.57c-31.43,5.11-60.23,30-101.41,5.89a86.29,86.29,0,0,1-7.73-5.06c-2.71-1.79,8.83,2.72,6.13.69-8-4.35-22.2-13.84-25.88-17.22-.61-.56,6.22,2.18,5.61,1.62-38.51-31.71-33.7-53.13-32.49-66.57,1-10.75,8-24.52,19.75-30.11,5.69,3.11,9.24,5.48,9.24,5.48s-2.43-5-3.74-7.58c.46-.2.9-.15,1.36-.34,4.66,2.25,15,8.1,20.41,11.67,7.07,5,9.33,9.44,9.33,9.44s1.86-1,.48-5.37c-.5-1.78-2.65-7.45-9.65-13.17h.44A81.61,81.61,0,0,1,374.42,478c2-7.18,5.53-14.68,4.75-28.09-.48-9.43-.26-11.87-1.92-15.51-1.49-3.13.83-4.35,3.42-1.1a32.5,32.5,0,0,0-2.21-7.4v-.24c3.23-11.24,68.25-40.46,73-43.88A67.2,67.2,0,0,0,470.59,361c3.62-5.76,6.34-13.85,7-26.11.36-8.84-3.76-14.73-69.51-21.62-18-1.77-28.53-14.8-34.53-26.82-1.09-2.59-2.21-4.94-3.33-7.28a57.68,57.68,0,0,1-2.56-8.43c10.75-30.87,28.81-57,55.37-76.7,1.45-1.32-5.78.34-4.34-1,1.69-1.54,12.71-6,14.79-7,2.54-1.2-10.88-6.9-22.73-5.51-12.07,1.36-14.63,2.8-21.07,5.53,2.67-2.66,11.17-6.15,9.18-6.13-13,2-29.18,9.56-43,18.12a10.66,10.66,0,0,1,.83-4.35c-6.44,2.73-22.26,13.79-26.87,23.14a44.29,44.29,0,0,0,.27-5.4,84.17,84.17,0,0,0-13.19,13.82l-.24.22c-37.36-15-70.23-16-98.05-9.28-6.09-6.11-9.06-1.64-22.91-32.07-.94-1.83.72,1.81,0,0-2.28-5.9,1.39,7.87,0,0-23.28,18.37-53.92,39.19-68.63,53.89-.18.59,17.16-4.9,0,0-6,1.72-5.6,5.28-6.51,37.5-.22,2.44,0,5.18-.22,7.38-11.75,15-19.75,27.64-22.78,34.21-15.19,26.18-31.93,67-48.15,131.55A334.82,334.82,0,0,1,75.2,398.36C61.71,432.63,48.67,486.44,46.07,569.3A482.08,482.08,0,0,1,58.6,518.64,473,473,0,0,0,93.33,719.71c9.33,22.82,24.76,57.46,51,95.4C226.9,902,343.31,956,472.21,956,606.79,956,727.64,897.13,810.67,803.64Z" style="fill:url(#linear-gradient-2)"/><path d="M810.67,803.64a246.8,246.8,0,0,1-30.12,18.18,705.31,705.31,0,0,0,38.3-63c9.46-10.47,18.13-20.65,25.19-31.65,3.44-5.41,7.31-12.08,11.42-19.82,24.92-44.9,52.4-117.56,53.18-192.2v-5.66a257.25,257.25,0,0,0-5.71-55.75c.2,1.43.38,2.86.56,4.29-.22-1.1-.41-2.21-.64-3.31.37,2,.66,4,1,6,5.09,43.22,1.47,85.37-16.68,116.45-.29.45-.58.88-.87,1.32,9.41-47.23,12.56-99.39,2.09-151.6,0,0-4.19-25.38-35.38-102.44-18-44.35-49.83-80.72-78-107.21-24.69-30.55-47.11-51-59.47-64.06C689.72,126,678.9,105.61,674.45,92.31c-3.85-1.93-53.14-49.81-57.05-51.63-21.51,33.35-89.16,137.67-57,235.15,14.58,44.17,51.47,90,90.07,115.74,1.69,1.94,23,25,33.09,77.16,10.45,53.85,5,95.86-16.54,158C641.73,681.24,577,735.12,516.3,740.63c-129.67,11.78-177.15-65.11-177.15-65.11C385.49,694,436.72,690.17,467.87,671c31.4-19.43,50.39-33.83,65.81-28.15C548.86,648.43,561,632,550.1,615a78.5,78.5,0,0,0-79.4-34.57c-31.43,5.11-60.23,30-101.41,5.89a86.29,86.29,0,0,1-7.73-5.06c-2.71-1.79,8.83,2.72,6.13.69-8-4.35-22.2-13.84-25.88-17.22-.61-.56,6.22,2.18,5.61,1.62-38.51-31.71-33.7-53.13-32.49-66.57,1-10.75,8-24.52,19.75-30.11,5.69,3.11,9.24,5.48,9.24,5.48s-2.43-5-3.74-7.58c.46-.2.9-.15,1.36-.34,4.66,2.25,15,8.1,20.41,11.67,7.07,5,9.33,9.44,9.33,9.44s1.86-1,.48-5.37c-.5-1.78-2.65-7.45-9.65-13.17h.44A81.61,81.61,0,0,1,374.42,478c2-7.18,5.53-14.68,4.75-28.09-.48-9.43-.26-11.87-1.92-15.51-1.49-3.13.83-4.35,3.42-1.1a32.5,32.5,0,0,0-2.21-7.4v-.24c3.23-11.24,68.25-40.46,73-43.88A67.2,67.2,0,0,0,470.59,361c3.62-5.76,6.34-13.85,7-26.11.36-8.84-3.76-14.73-69.51-21.62-18-1.77-28.53-14.8-34.53-26.82-1.09-2.59-2.21-4.94-3.33-7.28a57.68,57.68,0,0,1-2.56-8.43c10.75-30.87,28.81-57,55.37-76.7,1.45-1.32-5.78.34-4.34-1,1.69-1.54,12.71-6,14.79-7,2.54-1.2-10.88-6.9-22.73-5.51-12.07,1.36-14.63,2.8-21.07,5.53,2.67-2.66,11.17-6.15,9.18-6.13-13,2-29.18,9.56-43,18.12a10.66,10.66,0,0,1,.83-4.35c-6.44,2.73-22.26,13.79-26.87,23.14a44.29,44.29,0,0,0,.27-5.4,84.17,84.17,0,0,0-13.19,13.82l-.24.22c-37.36-15-70.23-16-98.05-9.28-6.09-6.11-9.06-1.64-22.91-32.07-.94-1.83.72,1.81,0,0-2.28-5.9,1.39,7.87,0,0-23.28,18.37-53.92,39.19-68.63,53.89-.18.59,17.16-4.9,0,0-6,1.72-5.6,5.28-6.51,37.5-.22,2.44,0,5.18-.22,7.38-11.75,15-19.75,27.64-22.78,34.21-15.19,26.18-31.93,67-48.15,131.55A334.82,334.82,0,0,1,75.2,398.36C61.71,432.63,48.67,486.44,46.07,569.3A482.08,482.08,0,0,1,58.6,518.64,473,473,0,0,0,93.33,719.71c9.33,22.82,24.76,57.46,51,95.4C226.9,902,343.31,956,472.21,956,606.79,956,727.64,897.13,810.67,803.64Z" style="fill:url(#linear-gradient-3)"/><path d="M711.1,866.71c162.87-18.86,235-186.7,142.38-190C769.85,674,634,875.61,711.1,866.71Z" style="fill:url(#linear-gradient-4)"/><path d="M865.21,642.42C977.26,577.21,948,436.34,948,436.34s-43.25,50.24-72.62,130.32C846.4,646,797.84,681.81,865.21,642.42Z" style="fill:url(#linear-gradient-5)"/><path d="M509.47,950.06C665.7,999.91,800,876.84,717.21,835.74,642,798.68,435.32,926.49,509.47,950.06Z" style="fill:url(#linear-gradient-6)"/><path d="M638.58,21.42l.53-.57A1.7,1.7,0,0,0,638.58,21.42ZM876.85,702.23c3.8-5.36,8.94-22.53,13.48-30.21,27.58-44.52,27.78-80,27.78-80.84,16.66-83.22,15.15-117.2,4.9-180-8.25-50.6-44.32-123.09-75.57-158-32.2-36-9.51-24.25-40.69-50.52-27.33-30.29-53.82-60.29-68.25-72.36C634.22,43.09,636.57,24.58,638.58,21.42c-.34.37-.84.92-1.47,1.64C635.87,18.14,635,14,635,14s-57,57-69,152c-7.83,62,15.38,126.68,49,168a381.62,381.62,0,0,0,59,58h0c25.4,36.48,39.38,81.49,39.38,129.91,0,121.24-98.34,219.53-219.65,219.53a220.14,220.14,0,0,1-49.13-5.52c-57.24-10.92-90.3-39.8-106.78-59.41-9.45-11.23-13.46-19.42-13.46-19.42,51.28,18.37,108,14.53,142.47-4.52,34.75-19.26,55.77-33.55,72.84-27.92,16.82,5.61,30.21-10.67,18.2-27.54-11.77-16.85-42.4-41-87.88-34.29-34.79,5.07-66.66,29.76-112.24,5.84a97.34,97.34,0,0,1-8.55-5c-3-1.77,9.77,2.69,6.79.68-8.87-4.32-24.57-13.73-28.64-17.07-.68-.56,6.88,2.16,6.2,1.6-42.62-31.45-37.3-52.69-36-66,1.07-10.66,8.81-24.32,21.86-29.86,6.3,3.08,10.23,5.43,10.23,5.43s-2.69-4.92-4.14-7.51c.51-.19,1-.15,1.5-.34,5.16,2.23,16.58,8,22.59,11.57,7.83,4.95,10.32,9.36,10.32,9.36s2.06-1,.54-5.33c-.56-1.77-2.93-7.39-10.68-13.07h.48a91.65,91.65,0,0,1,13.13,8.17c2.19-7.12,6.12-14.56,5.25-27.86-.53-9.35-.28-11.78-2.12-15.39-1.65-3.1.92-4.31,3.78-1.09a29.73,29.73,0,0,0-2.44-7.34v-.24c3.57-11.14,75.53-40.12,80.77-43.51a70.24,70.24,0,0,0,21.17-20.63c4-5.72,7-13.73,7.75-25.89.25-5.48-1.44-9.82-20.5-14-11.44-2.49-29.14-4.91-56.43-7.47-19.9-1.76-31.58-14.68-38.21-26.6-1.21-2.57-2.45-4.9-3.68-7.22a53.41,53.41,0,0,1-2.83-8.36,158.47,158.47,0,0,1,61.28-76.06c1.6-1.31-6.4.33-4.8-1,1.87-1.52,14.06-5.93,16.37-6.92,2.81-1.19-12-6.84-25.16-5.47-13.36,1.35-16.19,2.78-23.32,5.49,3-2.64,12.37-6.1,10.16-6.08-14.4,2-32.3,9.48-47.6,18a9.72,9.72,0,0,1,.92-4.31c-7.13,2.71-24.64,13.67-29.73,23a39.79,39.79,0,0,0,.29-5.35,88.55,88.55,0,0,0-14.6,13.7l-.27.22C258.14,196,221.75,195,191,201.72c-6.74-6.06-17.57-15.23-32.89-45.4-1-1.82-1.6,3.75-2.4,2-6-13.81-9.55-36.44-9-52,0,0-12.32,5.61-22.51,29.06-1.89,4.21-3.11,6.54-4.32,8.87-.56.68,1.27-7.7,1-7.24-1.77,3-6.36,7.19-8.37,12.62-1.38,4-3.32,6.27-4.56,11.29l-.29.46c-.1-1.48.37-6.08,0-5.14A235.4,235.4,0,0,0,95.34,186c-5.49,18-11.88,42.61-12.89,74.57-.24,2.42,0,5.14-.25,7.32-13,14.83-21.86,27.39-25.2,33.91-16.81,26-35.33,66.44-53.29,130.46a319.35,319.35,0,0,1,28.54-50C17.32,416.25,2.89,469.62,0,551.8a436.92,436.92,0,0,1,13.87-50.24C11.29,556.36,17.68,624.3,52.32,701c20.57,45,67.92,136.6,183.62,208h0s39.36,29.3,107,51.26c5,1.81,10.06,3.6,15.23,5.33q-2.43-1-4.71-2A484.9,484.9,0,0,0,492.27,984c175.18.15,226.85-70.2,226.85-70.2l-.51.38q3.71-3.49,7.14-7.26c-27.64,26.08-90.75,27.84-114.3,26,40.22-11.81,66.69-21.81,118.17-41.52q9-3.36,18.48-7.64l2-.94c1.25-.58,2.49-1.13,3.75-1.74a349.3,349.3,0,0,0,70.26-44c51.7-41.3,63-81.56,68.83-108.1-.82,2.54-3.37,8.47-5.17,12.32-13.31,28.48-42.84,46-74.91,61a689.05,689.05,0,0,0,42.38-62.44C865.77,729.39,869,713.15,876.85,702.23Z" style="fill:url(#radial-gradient-2)"/><path d="M813.92,801c21.08-23.24,40-49.82,54.35-80,36.9-77.58,94-206.58,49-341.31C881.77,273.22,833,215,771.11,158.12,670.56,65.76,642.48,24.52,642.48,0c0,0-116.09,129.41-65.74,264.38s153.46,130,221.68,270.87c80.27,165.74-64.95,346.61-185,397.24,7.35-1.63,267-60.38,280.61-208.88C893.68,726.34,887.83,767.41,813.92,801Z" style="fill:url(#linear-gradient-7)"/><path d="M477.59,319.37c.39-8.77-4.16-14.66-76.68-21.46-29.84-2.76-41.26-30.33-44.75-41.94-10.61,27.56-15,56.49-12.64,91.48,1.61,22.92,17,47.52,24.37,62,0,0,1.64-2.13,2.39-2.91,13.86-14.43,71.94-36.42,77.39-39.54C453.69,363.16,476.58,346.44,477.59,319.37Z" style="fill:url(#linear-gradient-8)"/><path d="M477.59,319.37c.39-8.77-4.16-14.66-76.68-21.46-29.84-2.76-41.26-30.33-44.75-41.94-10.61,27.56-15,56.49-12.64,91.48,1.61,22.92,17,47.52,24.37,62,0,0,1.64-2.13,2.39-2.91,13.86-14.43,71.94-36.42,77.39-39.54C453.69,363.16,476.58,346.44,477.59,319.37Z" style="opacity:0.5;isolation:isolate;fill:url(#radial-gradient-3)"/><path d="M158.31,156.47c-1-1.82-1.6,3.75-2.4,2-6-13.81-9.58-36.2-8.72-52,0,0-12.32,5.61-22.51,29.06-1.89,4.21-3.11,6.54-4.32,8.86-.56.68,1.27-7.7,1-7.24-1.77,3-6.36,7.19-8.35,12.38-1.65,4.24-3.35,6.52-4.61,11.77-.39,1.43.39-6.32,0-5.38C84.72,201.68,80.19,271,82.69,268,133.17,214.14,191,201.36,191,201.36c-6.15-4.53-19.53-17.63-32.7-44.89Z" style="fill:url(#linear-gradient-9)"/><path d="M349.84,720.1c-69.72-29.77-149-71.75-146-167.14C207.92,427.35,321,452.18,321,452.18c-4.27,1-15.68,9.16-19.72,17.82-4.27,10.83-12.07,35.28,11.55,60.9,37.09,40.19-76.2,95.36,98.66,199.57,4.41,2.4-41-1.43-61.64-10.36Z" style="fill:url(#linear-gradient-10)"/><path d="M325.07,657.5c49.44,17.21,107,14.19,141.52-4.86,23.09-12.85,52.7-33.43,70.92-28.35-15.78-6.24-27.73-9.15-42.1-9.86-2.45,0-5.38,0-8-.32a136,136,0,0,0-15.76.86c-8.9.82-18.77,6.43-27.74,5.53-.48,0,8.7-3.77,8-3.61-4.75,1-9.92,1.21-15.37,1.88-3.47.39-6.45.82-9.89,1-103,8.73-190-55.81-190-55.81-7.41,25,33.17,74.3,88.52,93.57Z" style="opacity:0.5;isolation:isolate;fill:url(#linear-gradient-11)"/><path d="M813.74,801.65c104.16-102.27,156.86-226.58,134.58-366,0,0,8.9,71.5-24.85,144.63,16.21-71.39,18.1-160.11-25-252C841,205.64,746.45,141.11,710.35,114.19,655.66,73.4,633,31.87,632.57,23.3c-16.34,33.48-65.77,148.2-5.31,247,56.64,92.56,145.86,120,208.33,205C950.67,631.67,813.74,801.65,813.74,801.65Z" style="fill:url(#linear-gradient-12)"/><path d="M798.81,535.55C762.41,460.35,717,427.55,674,392c5,7,6.23,9.47,9,14,37.83,40.32,93.61,138.66,53.11,262.11C659.88,900.48,355,791.06,323,760.32,335.93,894.81,561,959.16,707.6,872,791,793,858.47,658.79,798.81,535.55Z" style="fill:url(#linear-gradient-13)"/></g></g></g></g></svg>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-fail.html b/devtools/client/application/test/browser/resources/manifest/load-fail.html
new file mode 100644
index 0000000000..180c42a7b5
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-fail.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>Manifest 404 not found</title>
+ <link rel="manifest" href='nowhere.json'>
+</head>
+<body>
+<h1>Manifest error 404 not found</h1>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-no-manifest.html b/devtools/client/application/test/browser/resources/manifest/load-no-manifest.html
new file mode 100644
index 0000000000..aeabc8a0cb
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-no-manifest.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>No manifest link</title>
+</head>
+<body>
+<h1>No manifest <code>link</code> tag.</h1>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-ok-icons.html b/devtools/client/application/test/browser/resources/manifest/load-ok-icons.html
new file mode 100644
index 0000000000..539e5d2247
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-ok-icons.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>Manifest successful load (with icons)</title>
+ <link rel="manifest" href='data:application/manifest+json,{"name": "Foo", "background_color": "%23ff0000", "icons": [{ "sizes": "128x128", "src": "http://example.com/browser/devtools/client/application/test/browser/resources/manifest/icon.svg", "type": "image/svg"}]}'>
+</head>
+<body>
+<h1>Manifest OK (with icons)</h1>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-ok-json-error.html b/devtools/client/application/test/browser/resources/manifest/load-ok-json-error.html
new file mode 100644
index 0000000000..95ad22b609
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-ok-json-error.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>Manifest successful load with a warning</title>
+ <link rel="manifest" href='data:application/manifest+json,{"name": "Foo}'>
+</head>
+<body>
+<h1>Manifest OK with validation errors</h1>
+<p>The manifest has invalid JSON</p>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-ok-manifest-link.html b/devtools/client/application/test/browser/resources/manifest/load-ok-manifest-link.html
new file mode 100644
index 0000000000..f336f409e3
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-ok-manifest-link.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>Successful load for a linked manifest</title>
+ <link rel="manifest" href='manifest.json'>
+</head>
+<body>
+<h1>Manifest OK (linked manifest)</h1>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-ok-warnings.html b/devtools/client/application/test/browser/resources/manifest/load-ok-warnings.html
new file mode 100644
index 0000000000..467d6c3e70
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-ok-warnings.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>Manifest successful load with a warning</title>
+ <link rel="manifest" href='data:application/manifest+json,{"name": "Foo", "background_color": 42}'>
+</head>
+<body>
+<h1>Manifest OK with validation warnings</h1>
+<p><code>background_color</code> does not contain a valid CSS color.</p>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/load-ok.html b/devtools/client/application/test/browser/resources/manifest/load-ok.html
new file mode 100644
index 0000000000..1e6f5de59e
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/load-ok.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>Manifest successful load</title>
+ <link rel="manifest" href='data:application/manifest+json,{"name": "Foo", "background_color": "%23ff0000"}'>
+</head>
+<body>
+<h1>Manifest OK</h1>
+</body>
diff --git a/devtools/client/application/test/browser/resources/manifest/manifest.json b/devtools/client/application/test/browser/resources/manifest/manifest.json
new file mode 100644
index 0000000000..0bc7bb50a3
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/manifest/manifest.json
@@ -0,0 +1,3 @@
+{
+ "name": "Foo"
+}
diff --git a/devtools/client/application/test/browser/resources/service-workers/controlled-install-sw.js b/devtools/client/application/test/browser/resources/service-workers/controlled-install-sw.js
new file mode 100644
index 0000000000..d0a70a5312
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/controlled-install-sw.js
@@ -0,0 +1,29 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Copied from shared-head.js
+function waitUntil(predicate, interval = 10) {
+ if (predicate()) {
+ return Promise.resolve(true);
+ }
+ return new Promise(resolve => {
+ setTimeout(function () {
+ waitUntil(predicate, interval).then(() => resolve(true));
+ }, interval);
+ });
+}
+
+// this flag will be flipped externally from controlled-install.html
+// by sending a message event to the worker
+let canInstall = false;
+self.addEventListener("message", event => {
+ if (event.data === "install-service-worker") {
+ canInstall = true;
+ }
+});
+
+self.addEventListener("install", event => {
+ event.waitUntil(waitUntil(() => canInstall));
+});
diff --git a/devtools/client/application/test/browser/resources/service-workers/controlled-install.html b/devtools/client/application/test/browser/resources/service-workers/controlled-install.html
new file mode 100644
index 0000000000..300ee1fde7
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/controlled-install.html
@@ -0,0 +1,27 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+let registration;
+
+window.registerServiceWorker = async function() {
+ registration = await navigator.serviceWorker.register(
+ "controlled-install-sw.js"
+ );
+ window.sw = registration;
+};
+
+window.installServiceWorker = function() {
+ registration.installing.postMessage("install-service-worker");
+};
+</script>
+</body>
+</html>
diff --git a/devtools/client/application/test/browser/resources/service-workers/debug-sw.js b/devtools/client/application/test/browser/resources/service-workers/debug-sw.js
new file mode 100644
index 0000000000..31f0b1bdd2
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/debug-sw.js
@@ -0,0 +1,18 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+self.addEventListener("activate", event => {
+ event.waitUntil(self.clients.claim());
+});
+
+self.onfetch = function (event) {
+ const url = event.request.url;
+
+ const response = url.endsWith("test")
+ ? new Response("lorem ipsum", { statusText: "OK" })
+ : fetch(event.request);
+
+ event.respondWith(response);
+};
diff --git a/devtools/client/application/test/browser/resources/service-workers/debug.html b/devtools/client/application/test/browser/resources/service-workers/debug.html
new file mode 100644
index 0000000000..f0f16858fd
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/debug.html
@@ -0,0 +1,25 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+window.sw = navigator.serviceWorker.register("debug-sw.js");
+
+/* exported fetchFromWorker */
+async function fetchFromWorker() {
+ const response = await fetch("test");
+ const text = await response.text();
+ console.log(`Response from worker: ${text}`);
+}
+</script>
+
+<p>This page has a <code>fetchFromWorker()</code> function.</p>
+</body>
+</html>
diff --git a/devtools/client/application/test/browser/resources/service-workers/dynamic-registration.html b/devtools/client/application/test/browser/resources/service-workers/dynamic-registration.html
new file mode 100644
index 0000000000..def300da65
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/dynamic-registration.html
@@ -0,0 +1,19 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+window.registerServiceWorker = function() {
+ window.sw = navigator.serviceWorker.register("empty-sw.js");
+};
+
+</script>
+</body>
+</html>
diff --git a/devtools/client/application/test/browser/resources/service-workers/empty-sw.js b/devtools/client/application/test/browser/resources/service-workers/empty-sw.js
new file mode 100644
index 0000000000..5d33297056
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/empty-sw.js
@@ -0,0 +1,4 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Empty, just test registering.
diff --git a/devtools/client/application/test/browser/resources/service-workers/empty.html b/devtools/client/application/test/browser/resources/service-workers/empty.html
new file mode 100644
index 0000000000..02373ca02e
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/empty.html
@@ -0,0 +1,11 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test (no worker, empty page)</title>
+</head>
+<body></body>
+</html>
diff --git a/devtools/client/application/test/browser/resources/service-workers/scope-page.html b/devtools/client/application/test/browser/resources/service-workers/scope-page.html
new file mode 100644
index 0000000000..eed5bc82ed
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/scope-page.html
@@ -0,0 +1,19 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+window.sw = navigator.serviceWorker.register("empty-sw.js", {
+ scope: "./scope-page.html",
+});
+
+</script>
+</body>
+</html>
diff --git a/devtools/client/application/test/browser/resources/service-workers/simple-unicode.html b/devtools/client/application/test/browser/resources/service-workers/simple-unicode.html
new file mode 100644
index 0000000000..51e17b7fec
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/simple-unicode.html
@@ -0,0 +1,15 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+window.sw = navigator.serviceWorker.register("empty-sw.js?q=日本");
+</script>
+</body>
+</html>
diff --git a/devtools/client/application/test/browser/resources/service-workers/simple.html b/devtools/client/application/test/browser/resources/service-workers/simple.html
new file mode 100644
index 0000000000..88dc00aff0
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/simple.html
@@ -0,0 +1,32 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+let registration;
+
+const registerServiceWorker = async function() {
+ try {
+ registration = await navigator.serviceWorker.register("empty-sw.js");
+ dump("Empty service worker registered\n");
+ } catch (e) {
+ dump("Empty service worker not registered: " + e + "\n");
+ }
+};
+
+// Helper called from head.js to unregister the service worker.
+window.getRegistration = function() {
+ return registration;
+};
+// Register the service worker.
+registerServiceWorker();
+</script>
+</body>
+</html>
diff --git a/devtools/client/application/test/node/.eslintrc.js b/devtools/client/application/test/node/.eslintrc.js
new file mode 100644
index 0000000000..ffb3e70473
--- /dev/null
+++ b/devtools/client/application/test/node/.eslintrc.js
@@ -0,0 +1,10 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+module.exports = {
+ env: {
+ jest: true,
+ },
+};
diff --git a/devtools/client/application/test/node/actions/actions_application_panel-manifest.test.js b/devtools/client/application/test/node/actions/actions_application_panel-manifest.test.js
new file mode 100644
index 0000000000..a8d4844f4c
--- /dev/null
+++ b/devtools/client/application/test/node/actions/actions_application_panel-manifest.test.js
@@ -0,0 +1,83 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ MANIFEST_NO_ISSUES,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+const {
+ ManifestDevToolsError,
+ services,
+} = require("resource://devtools/client/application/src/modules/application-services.js");
+
+const {
+ FETCH_MANIFEST_FAILURE,
+ FETCH_MANIFEST_START,
+ FETCH_MANIFEST_SUCCESS,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const {
+ fetchManifest,
+} = require("resource://devtools/client/application/src/actions/manifest.js");
+
+describe("Manifest actions: fetchManifest", () => {
+ it("dispatches a START - SUCCESS sequence when fetching is OK", async () => {
+ const fetchManifestSpy = jest
+ .spyOn(services, "fetchManifest")
+ .mockResolvedValue(MANIFEST_NO_ISSUES);
+
+ const store = setupStore({});
+ await store.dispatch(fetchManifest());
+
+ expect(store.getActions()).toEqual([
+ { type: FETCH_MANIFEST_START },
+ { type: FETCH_MANIFEST_SUCCESS, manifest: MANIFEST_NO_ISSUES },
+ ]);
+
+ fetchManifestSpy.mockRestore();
+ });
+
+ it("dispatches a START - FAILURE sequence when fetching fails", async () => {
+ const fetchManifestSpy = jest
+ .spyOn(services, "fetchManifest")
+ .mockRejectedValue(new Error("lorem ipsum"));
+
+ const store = setupStore({});
+ await store.dispatch(fetchManifest());
+
+ expect(store.getActions()).toEqual([
+ { type: FETCH_MANIFEST_START },
+ { type: FETCH_MANIFEST_FAILURE, error: "lorem ipsum" },
+ ]);
+
+ fetchManifestSpy.mockRestore();
+ });
+
+ it("dispatches a START - FAILURE sequence when fetching fails due to a devtools error", async () => {
+ const error = new ManifestDevToolsError(":(");
+ const fetchManifestSpy = jest
+ .spyOn(services, "fetchManifest")
+ .mockRejectedValue(error);
+ const consoleErrorSpy = jest
+ .spyOn(console, "error")
+ .mockImplementation(() => {});
+
+ const store = setupStore({});
+ await store.dispatch(fetchManifest());
+
+ expect(store.getActions()).toEqual([
+ { type: FETCH_MANIFEST_START },
+ { type: FETCH_MANIFEST_FAILURE, error: "manifest-loaded-devtools-error" },
+ ]);
+ expect(consoleErrorSpy).toHaveBeenCalledWith(error);
+
+ fetchManifestSpy.mockRestore();
+ consoleErrorSpy.mockRestore();
+ });
+});
diff --git a/devtools/client/application/test/node/babel.config.js b/devtools/client/application/test/node/babel.config.js
new file mode 100644
index 0000000000..a9e47ba7fb
--- /dev/null
+++ b/devtools/client/application/test/node/babel.config.js
@@ -0,0 +1,8 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+module.exports = {
+ plugins: ["@babel/plugin-proposal-async-generator-functions"],
+};
diff --git a/devtools/client/application/test/node/components/__snapshots__/components_application_panel-App.test.js.snap b/devtools/client/application/test/node/components/__snapshots__/components_application_panel-App.test.js.snap
new file mode 100644
index 0000000000..cef0e0a85d
--- /dev/null
+++ b/devtools/client/application/test/node/components/__snapshots__/components_application_panel-App.test.js.snap
@@ -0,0 +1,12 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`App renders the expected snapshot 1`] = `
+<LocalizationProvider>
+ <main
+ className="app"
+ >
+ <Connect(Sidebar) />
+ <Connect(PageSwitcher) />
+ </main>
+</LocalizationProvider>
+`;
diff --git a/devtools/client/application/test/node/components/components_application_panel-App.test.js b/devtools/client/application/test/node/components/components_application_panel-App.test.js
new file mode 100644
index 0000000000..fb003be26e
--- /dev/null
+++ b/devtools/client/application/test/node/components/components_application_panel-App.test.js
@@ -0,0 +1,26 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+// Import & init localization
+const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js");
+const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
+
+// Import component
+const App = createFactory(
+ require("resource://devtools/client/application/src/components/App.js")
+);
+
+describe("App", () => {
+ it("renders the expected snapshot", () => {
+ const wrapper = shallow(
+ LocalizationProvider({ bundles: [] }, App({}))
+ ).dive(); // dive to bypass the LocalizationProvider wrapper
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-Manifest.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-Manifest.test.js.snap
new file mode 100644
index 0000000000..d46eb63334
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-Manifest.test.js.snap
@@ -0,0 +1,396 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Manifest does not render the issues section when the manifest is valid 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody>
+ <ManifestItem
+ key="name"
+ label="name"
+ >
+ foo
+ </ManifestItem>
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody>
+ <ManifestItem
+ key="lorem"
+ label="lorem"
+ >
+ ipsum
+ </ManifestItem>
+ <ManifestItem
+ key="foo"
+ label="foo"
+ >
+ bar
+ </ManifestItem>
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+</article>
+`;
+
+exports[`Manifest does render the issues section when the manifest is not valid 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-0"
+ title="manifest-item-warnings"
+ >
+ <ManifestIssueList
+ issues={
+ Array [
+ Object {
+ "level": "warning",
+ "message": "This is a warning",
+ },
+ ]
+ }
+ />
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody>
+ <ManifestItem
+ key="name"
+ label="name"
+ >
+ foo
+ </ManifestItem>
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody>
+ <ManifestItem
+ key="lorem"
+ label="lorem"
+ >
+ ipsum
+ </ManifestItem>
+ <ManifestItem
+ key="foo"
+ label="foo"
+ >
+ bar
+ </ManifestItem>
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+</article>
+`;
+
+exports[`Manifest renders the expected snapshot for a manifest with color members 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody>
+ <ManifestColorItem
+ key="background_color"
+ label="background_color"
+ value="red"
+ />
+ <ManifestColorItem
+ key="theme_color"
+ label="theme_color"
+ value="rgb(0, 0, 0)"
+ />
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+</article>
+`;
+
+exports[`Manifest renders the expected snapshot for a manifest with icon members 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody>
+ <ManifestIconItem
+ key="0"
+ label={
+ Object {
+ "contentType": "image/png",
+ "sizes": "1x1",
+ }
+ }
+ value={
+ Object {
+ "purpose": "any",
+ "src": "something.png",
+ }
+ }
+ />
+ <ManifestIconItem
+ key="1"
+ label={
+ Object {
+ "contentType": "",
+ "sizes": "",
+ }
+ }
+ value={
+ Object {
+ "purpose": "any maskable",
+ "src": "something.svg",
+ }
+ }
+ />
+ </tbody>
+ </table>
+ </ManifestSection>
+</article>
+`;
+
+exports[`Manifest renders the expected snapshot for a manifest with string members 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody>
+ <ManifestItem
+ key="name"
+ label="name"
+ >
+ foo
+ </ManifestItem>
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+</article>
+`;
+
+exports[`Manifest renders the expected snapshot for a manifest with unknown types 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody>
+ <ManifestItem
+ key="lorem"
+ label="lorem"
+ >
+ ipsum
+ </ManifestItem>
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+</article>
+`;
+
+exports[`Manifest renders the expected snapshot for a manifest with url members 1`] = `
+<article
+ className="js-manifest"
+>
+ <Localized
+ id="manifest-view-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ManifestJsonLink />
+ <ManifestSection
+ key="manifest-section-1"
+ title="manifest-item-identity"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-2"
+ title="manifest-item-presentation"
+ >
+ <table>
+ <tbody>
+ <ManifestUrlItem
+ key="start_url"
+ label="start_url"
+ value="https://example.com/"
+ />
+ <ManifestUrlItem
+ key="scope"
+ label="scope"
+ value="https://example.com/"
+ />
+ </tbody>
+ </table>
+ </ManifestSection>
+ <ManifestSection
+ key="manifest-section-3"
+ title="manifest-item-icons"
+ >
+ <table>
+ <tbody />
+ </table>
+ </ManifestSection>
+</article>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestColorItem.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestColorItem.test.js.snap
new file mode 100644
index 0000000000..4f3e485084
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestColorItem.test.js.snap
@@ -0,0 +1,58 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestColorItem does not strip translucent alpha from the displayed color 1`] = `
+<ManifestItem
+ label="foo"
+>
+ <div
+ className="manifest-item__color"
+ style={
+ Object {
+ "--color-value": "#00FF00FA",
+ }
+ }
+ >
+ #00FF00FA
+ </div>
+</ManifestItem>
+`;
+
+exports[`ManifestColorItem renders the expected snapshot for a populated color item 1`] = `
+<ManifestItem
+ label="foo"
+>
+ <div
+ className="manifest-item__color"
+ style={
+ Object {
+ "--color-value": "#ff0000",
+ }
+ }
+ >
+ #ff0000
+ </div>
+</ManifestItem>
+`;
+
+exports[`ManifestColorItem renders the expected snapshot for an empty color item 1`] = `
+<ManifestItem
+ label="foo"
+/>
+`;
+
+exports[`ManifestColorItem strips opaque alpha from the displayed color 1`] = `
+<ManifestItem
+ label="foo"
+>
+ <div
+ className="manifest-item__color"
+ style={
+ Object {
+ "--color-value": "#00FF00",
+ }
+ }
+ >
+ #00FF00
+ </div>
+</ManifestItem>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestEmpty.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestEmpty.test.js.snap
new file mode 100644
index 0000000000..bdc5e9ed60
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestEmpty.test.js.snap
@@ -0,0 +1,46 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestEmpty renders the expected snapshot 1`] = `
+<article
+ className="app-page__icon-container js-manifest-empty"
+>
+ <aside>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="sidebar-item-manifest"
+ >
+ <img
+ className="app-page__icon"
+ src="chrome://devtools/skin/images/application-manifest.svg"
+ />
+ </Localized>
+ </aside>
+ <div>
+ <Localized
+ id="manifest-empty-intro2"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <p>
+ <Localized
+ id="manifest-empty-intro-link"
+ >
+ <a
+ onClick={[Function]}
+ />
+ </Localized>
+ </p>
+ <Localized
+ id="manifest-non-existing"
+ >
+ <p />
+ </Localized>
+ </div>
+</article>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIconItem.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIconItem.test.js.snap
new file mode 100644
index 0000000000..200c6306de
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIconItem.test.js.snap
@@ -0,0 +1,106 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestIconItem renders the expected snapshop when a label member is missing 1`] = `
+<ManifestItem
+ label={
+ Array [
+ null,
+ null,
+ "image/png",
+ ]
+ }
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="manifest-icon-img"
+ >
+ <img
+ className="manifest-item__icon"
+ src="icon.png"
+ title="manifest-icon-img-title-no-sizes"
+ />
+ </Localized>
+ <br />
+ <Localized
+ $purpose="any"
+ code={<code />}
+ id="manifest-icon-purpose"
+ >
+ <span />
+ </Localized>
+</ManifestItem>
+`;
+
+exports[`ManifestIconItem renders the expected snapshop when all label members are missing 1`] = `
+<ManifestItem
+ label={
+ Array [
+ null,
+ null,
+ null,
+ ]
+ }
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="manifest-icon-img"
+ >
+ <img
+ className="manifest-item__icon"
+ src="icon.png"
+ title="manifest-icon-img-title-no-sizes"
+ />
+ </Localized>
+ <br />
+ <Localized
+ $purpose="any"
+ code={<code />}
+ id="manifest-icon-purpose"
+ >
+ <span />
+ </Localized>
+</ManifestItem>
+`;
+
+exports[`ManifestIconItem renders the expected snapshot for a fully populated icon item 1`] = `
+<ManifestItem
+ label={
+ Array [
+ "128x128",
+ <br />,
+ "image/png",
+ ]
+ }
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="manifest-icon-img"
+ >
+ <img
+ className="manifest-item__icon"
+ src="icon.png"
+ title="manifest-icon-img-title__{\\"sizes\\":\\"128x128\\"}"
+ />
+ </Localized>
+ <br />
+ <Localized
+ $purpose="any"
+ code={<code />}
+ id="manifest-icon-purpose"
+ >
+ <span />
+ </Localized>
+</ManifestItem>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssue.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssue.test.js.snap
new file mode 100644
index 0000000000..3cf46f07b1
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssue.test.js.snap
@@ -0,0 +1,49 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestIssue renders the expected snapshot for a warning 1`] = `
+<li
+ className="js-manifest-issue "
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ "title": true,
+ }
+ }
+ id="icon-warning"
+ >
+ <img
+ className="manifest-issue__icon manifest-issue__icon--warning"
+ src="chrome://devtools/skin/images/alert-small.svg"
+ />
+ </Localized>
+ <span>
+ Lorem ipsum
+ </span>
+</li>
+`;
+
+exports[`ManifestIssue renders the expected snapshot for an error 1`] = `
+<li
+ className="js-manifest-issue "
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ "title": true,
+ }
+ }
+ id="icon-error"
+ >
+ <img
+ className="manifest-issue__icon manifest-issue__icon--error"
+ src="chrome://devtools/skin/images/error-small.svg"
+ />
+ </Localized>
+ <span>
+ Lorem ipsum
+ </span>
+</li>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssueList.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssueList.test.js.snap
new file mode 100644
index 0000000000..edbf2d07c9
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestIssueList.test.js.snap
@@ -0,0 +1,89 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestIssueList groups issues by level and shows errors first 1`] = `
+Array [
+ <ul
+ className="manifest-issues js-manifest-issues"
+ key="issuelist-0"
+ >
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-0"
+ level="error"
+ message="An error"
+ />
+ </ul>,
+ <ul
+ className="manifest-issues js-manifest-issues"
+ key="issuelist-1"
+ >
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-0"
+ level="warning"
+ message="A warning"
+ />
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-1"
+ level="warning"
+ message="Another warning"
+ />
+ </ul>,
+]
+`;
+
+exports[`ManifestIssueList renders nothing for empty issues 1`] = `null`;
+
+exports[`ManifestIssueList renders the expected snapshot for a populated list 1`] = `
+Array [
+ <ul
+ className="manifest-issues js-manifest-issues"
+ key="issuelist-0"
+ >
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-0"
+ level="error"
+ message="Foo"
+ />
+ </ul>,
+ <ul
+ className="manifest-issues js-manifest-issues"
+ key="issuelist-1"
+ >
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-0"
+ level="warning"
+ message="Foo"
+ />
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-1"
+ level="warning"
+ message="Bar"
+ />
+ </ul>,
+]
+`;
+
+exports[`ManifestIssueList skips rendering empty level groups 1`] = `
+<ul
+ className="manifest-issues js-manifest-issues"
+ key="issuelist-0"
+>
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-0"
+ level="warning"
+ message="A warning"
+ />
+ <ManifestIssue
+ className="manifest-issues__item"
+ key="issue-1"
+ level="warning"
+ message="Another warning"
+ />
+</ul>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestItem.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestItem.test.js.snap
new file mode 100644
index 0000000000..69d983d308
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestItem.test.js.snap
@@ -0,0 +1,35 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestItem renders the expected snapshot for a populated item 1`] = `
+<tr
+ className="manifest-item js-manifest-item"
+>
+ <th
+ className="manifest-item__label js-manifest-item-label"
+ scope="row"
+ >
+ foo
+ </th>
+ <td
+ className="manifest-item__value js-manifest-item-content"
+ >
+ bar
+ </td>
+</tr>
+`;
+
+exports[`ManifestItem renders the expected snapshot for an empty item 1`] = `
+<tr
+ className="manifest-item js-manifest-item"
+>
+ <th
+ className="manifest-item__label js-manifest-item-label"
+ scope="row"
+ >
+ foo
+ </th>
+ <td
+ className="manifest-item__value js-manifest-item-content"
+ />
+</tr>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestJsonLink.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestJsonLink.test.js.snap
new file mode 100644
index 0000000000..061578b846
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestJsonLink.test.js.snap
@@ -0,0 +1,26 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestJsonLink renders the expected snapshot when given a data URL 1`] = `
+<p
+ className="manifest-json-link"
+>
+ <Localized
+ id="manifest-json-link-data-url"
+ />
+</p>
+`;
+
+exports[`ManifestJsonLink renders the expected snapshot when given a regular URL 1`] = `
+<p
+ className="manifest-json-link"
+>
+ <a
+ className="js-manifest-json-link devtools-ellipsis-text"
+ href="#"
+ onClick={[Function]}
+ title="https://example.com/manifest.json"
+ >
+ https://example.com/manifest.json
+ </a>
+</p>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestLoader.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestLoader.test.js.snap
new file mode 100644
index 0000000000..16c885cf80
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestLoader.test.js.snap
@@ -0,0 +1,50 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestLoader renders a message when it is loading 1`] = `
+<aside
+ className="manifest-loader"
+>
+ <Localized
+ id="manifest-loading"
+ >
+ <p
+ className="manifest-loader__load js-manifest-loading"
+ />
+ </Localized>
+</aside>
+`;
+
+exports[`ManifestLoader renders a message when manifest has failed to load 1`] = `
+<aside
+ className="manifest-loader"
+>
+ <Localized
+ id="manifest-loaded-error"
+ key="manifest-error-label"
+ >
+ <h1
+ className="js-manifest-loaded-error app-page__title"
+ />
+ </Localized>
+ <p
+ className="technical-text"
+ key="manifest-error-message"
+ >
+ lorem ipsum
+ </p>
+</aside>
+`;
+
+exports[`ManifestLoader renders a message when manifest has loaded OK 1`] = `
+<aside
+ className="manifest-loader"
+>
+ <Localized
+ id="manifest-loaded-ok"
+ >
+ <p
+ className="js-manifest-loaded-ok"
+ />
+ </Localized>
+</aside>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestPage.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestPage.test.js.snap
new file mode 100644
index 0000000000..4700ccf935
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestPage.test.js.snap
@@ -0,0 +1,80 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestPage renders the expected snapshot when the manifest is loading 1`] = `
+<section
+ className="app-page js-manifest-page app-page--empty"
+>
+ <Connect(ManifestLoader) />
+</section>
+`;
+
+exports[`ManifestPage renders the expected snapshot when the manifest needs to load 1`] = `
+<section
+ className="app-page js-manifest-page app-page--empty"
+>
+ <Connect(ManifestLoader) />
+</section>
+`;
+
+exports[`ManifestPage renders the expected snapshot when there is a manifest 1`] = `
+<section
+ className="app-page js-manifest-page "
+>
+ <Manifest
+ icons={
+ Array [
+ Object {
+ "key": Object {
+ "contentType": "image/png",
+ "sizes": "1x1",
+ },
+ "type": "icon",
+ "value": Object {
+ "purpose": "any",
+ "src": "something.png",
+ },
+ },
+ ]
+ }
+ identity={
+ Array [
+ Object {
+ "key": "name",
+ "type": "string",
+ "value": "foo",
+ },
+ ]
+ }
+ presentation={
+ Array [
+ Object {
+ "key": "lorem",
+ "type": "string",
+ "value": "ipsum",
+ },
+ Object {
+ "key": "foo",
+ "type": "string",
+ "value": "bar",
+ },
+ ]
+ }
+ validation={
+ Array [
+ Object {
+ "level": "warning",
+ "message": "This is a warning",
+ },
+ ]
+ }
+ />
+</section>
+`;
+
+exports[`ManifestPage renders the expected snapshot when there is no manifest 1`] = `
+<section
+ className="app-page js-manifest-page app-page--empty"
+>
+ <ManifestEmpty />
+</section>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestSection.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestSection.test.js.snap
new file mode 100644
index 0000000000..e8ea10867f
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestSection.test.js.snap
@@ -0,0 +1,30 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestSection renders the expected snapshot for a populated section 1`] = `
+<section
+ className="manifest-section "
+>
+ <h2
+ className="manifest-section__title"
+ >
+ Lorem ipsum
+ </h2>
+ <tr>
+ <td>
+ foo
+ </td>
+ </tr>
+</section>
+`;
+
+exports[`ManifestSection renders the expected snapshot for a section with no children 1`] = `
+<section
+ className="manifest-section manifest-section--empty"
+>
+ <h2
+ className="manifest-section__title"
+ >
+ Lorem ipsum
+ </h2>
+</section>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestUrlItem.test.js.snap b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestUrlItem.test.js.snap
new file mode 100644
index 0000000000..62f4fdfe11
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/__snapshots__/components_application_panel-ManifestUrlItem.test.js.snap
@@ -0,0 +1,21 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ManifestUrlItem renders the expected snapshot for a populated url 1`] = `
+<ManifestItem
+ label="foo"
+>
+ <div
+ className="manifest-item__url"
+ />
+</ManifestItem>
+`;
+
+exports[`ManifestUrlItem renders the expected snapshot for an empty url 1`] = `
+<ManifestItem
+ label="foo"
+>
+ <div
+ className="manifest-item__url"
+ />
+</ManifestItem>
+`;
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-Manifest.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-Manifest.test.js
new file mode 100644
index 0000000000..0b554fbdd2
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-Manifest.test.js
@@ -0,0 +1,73 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const Manifest = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/Manifest.js")
+);
+
+const {
+ MANIFEST_COLOR_MEMBERS,
+ MANIFEST_ICON_MEMBERS,
+ MANIFEST_STRING_MEMBERS,
+ MANIFEST_UNKNOWN_TYPE_MEMBERS,
+ MANIFEST_URL_MEMBERS,
+ MANIFEST_NO_ISSUES,
+ MANIFEST_WITH_ISSUES,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+/*
+ * Test for Manifest component
+ */
+
+describe("Manifest", () => {
+ it("renders the expected snapshot for a manifest with string members", () => {
+ const wrapper = shallow(Manifest(MANIFEST_STRING_MEMBERS));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for a manifest with color members", () => {
+ const wrapper = shallow(Manifest(MANIFEST_COLOR_MEMBERS));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for a manifest with unknown types", () => {
+ const wrapper = shallow(Manifest(MANIFEST_UNKNOWN_TYPE_MEMBERS));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for a manifest with icon members", () => {
+ const wrapper = shallow(Manifest(MANIFEST_ICON_MEMBERS));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for a manifest with url members", () => {
+ const wrapper = shallow(Manifest(MANIFEST_URL_MEMBERS));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("does render the issues section when the manifest is not valid", () => {
+ const wrapper = shallow(Manifest(MANIFEST_WITH_ISSUES));
+ expect(wrapper).toMatchSnapshot();
+
+ const sections = wrapper.find("ManifestSection");
+ expect(sections).toHaveLength(4);
+ expect(sections.get(0).props.title).toBe("manifest-item-warnings");
+ expect(sections.find("ManifestIssueList")).toHaveLength(1);
+ });
+
+ it("does not render the issues section when the manifest is valid", () => {
+ const wrapper = shallow(Manifest(MANIFEST_NO_ISSUES));
+ expect(wrapper).toMatchSnapshot();
+
+ const sections = wrapper.find("ManifestSection");
+ expect(sections).toHaveLength(3);
+ expect(sections.get(0).props.title).not.toBe("manifest-item-warnings");
+ expect(sections.find("ManifestIssueList")).toHaveLength(0);
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestColorItem.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestColorItem.test.js
new file mode 100644
index 0000000000..eac67ec195
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestColorItem.test.js
@@ -0,0 +1,48 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestColorItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestColorItem.js")
+);
+
+/*
+ * Unit tests for the ManifestItem component
+ */
+
+describe("ManifestColorItem", () => {
+ it("renders the expected snapshot for a populated color item", () => {
+ const wrapper = shallow(
+ ManifestColorItem({ label: "foo", value: "#ff0000" })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for an empty color item", () => {
+ const wrapper = shallow(ManifestColorItem({ label: "foo" }));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("strips opaque alpha from the displayed color", () => {
+ const wrapper = shallow(
+ ManifestColorItem({ label: "foo", value: "#00FF00FF" })
+ );
+ expect(wrapper).toMatchSnapshot();
+
+ expect(wrapper.find(".manifest-item__color").text()).toBe("#00FF00");
+ });
+
+ it("does not strip translucent alpha from the displayed color", () => {
+ const wrapper = shallow(
+ ManifestColorItem({ label: "foo", value: "#00FF00FA" })
+ );
+ expect(wrapper).toMatchSnapshot();
+
+ expect(wrapper.find(".manifest-item__color").text()).toBe("#00FF00FA");
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestEmpty.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestEmpty.test.js
new file mode 100644
index 0000000000..de27a56ec5
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestEmpty.test.js
@@ -0,0 +1,23 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestEmpty = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestEmpty.js")
+);
+
+/**
+ * Test for ManifestEmpty component
+ */
+
+describe("ManifestEmpty", () => {
+ it("renders the expected snapshot", () => {
+ const wrapper = shallow(ManifestEmpty({}));
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIconItem.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIconItem.test.js
new file mode 100644
index 0000000000..e3ea293c82
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIconItem.test.js
@@ -0,0 +1,48 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestIconItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestIconItem.js")
+);
+
+/*
+ * Unit tests for the ManifestIconItem component
+ */
+
+describe("ManifestIconItem", () => {
+ it("renders the expected snapshot for a fully populated icon item", () => {
+ const wrapper = shallow(
+ ManifestIconItem({
+ label: { sizes: "128x128", contentType: "image/png" },
+ value: { src: "icon.png", purpose: "any" },
+ })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshop when a label member is missing", () => {
+ const wrapper = shallow(
+ ManifestIconItem({
+ label: { sizes: undefined, contentType: "image/png" },
+ value: { src: "icon.png", purpose: "any" },
+ })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshop when all label members are missing", () => {
+ const wrapper = shallow(
+ ManifestIconItem({
+ label: { sizes: undefined, contentType: undefined },
+ value: { src: "icon.png", purpose: "any" },
+ })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssue.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssue.test.js
new file mode 100644
index 0000000000..41350557be
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssue.test.js
@@ -0,0 +1,30 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestIssue = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestIssue.js")
+);
+
+/*
+ * Tests for the ManifestIssue component
+ */
+
+describe("ManifestIssue", () => {
+ it("renders the expected snapshot for a warning", () => {
+ const issue = { level: "warning", message: "Lorem ipsum" };
+ const wrapper = shallow(ManifestIssue(issue));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for an error", () => {
+ const issue = { level: "error", message: "Lorem ipsum" };
+ const wrapper = shallow(ManifestIssue(issue));
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssueList.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssueList.test.js
new file mode 100644
index 0000000000..71d59d3e07
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestIssueList.test.js
@@ -0,0 +1,59 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestIssueList = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestIssueList.js")
+);
+
+/*
+ * Tests for the ManifestIssue component
+ */
+
+describe("ManifestIssueList", () => {
+ it("renders the expected snapshot for a populated list", () => {
+ const issues = [
+ { level: "error", message: "Foo" },
+ { level: "warning", message: "Foo" },
+ { level: "warning", message: "Bar" },
+ ];
+ const wrapper = shallow(ManifestIssueList({ issues }));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("groups issues by level and shows errors first", () => {
+ const issues = [
+ { level: "warning", message: "A warning" },
+ { level: "error", message: "An error" },
+ { level: "warning", message: "Another warning" },
+ ];
+ const wrapper = shallow(ManifestIssueList({ issues }));
+ expect(wrapper).toMatchSnapshot();
+
+ expect(wrapper.find("ManifestIssue").get(0).props.level).toBe("error");
+ expect(wrapper.find("ManifestIssue").get(1).props.level).toBe("warning");
+ expect(wrapper.find("ManifestIssue").get(2).props.level).toBe("warning");
+ });
+
+ it("skips rendering empty level groups", () => {
+ const issues = [
+ { level: "warning", message: "A warning" },
+ { level: "warning", message: "Another warning" },
+ ];
+ const wrapper = shallow(ManifestIssueList({ issues }));
+ expect(wrapper).toMatchSnapshot();
+
+ const lists = wrapper.find(".js-manifest-issues");
+ expect(lists).toHaveLength(1);
+ });
+
+ it("renders nothing for empty issues", () => {
+ const wrapper = shallow(ManifestIssueList({ issues: [] }));
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestItem.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestItem.test.js
new file mode 100644
index 0000000000..ca9303aab4
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestItem.test.js
@@ -0,0 +1,28 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestItem.js")
+);
+
+/*
+ * Unit tests for the ManifestItem component
+ */
+
+describe("ManifestItem", () => {
+ it("renders the expected snapshot for a populated item", () => {
+ const wrapper = shallow(ManifestItem({ label: "foo" }, "bar"));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for an empty item", () => {
+ const wrapper = shallow(ManifestItem({ label: "foo" }));
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestJsonLink.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestJsonLink.test.js
new file mode 100644
index 0000000000..fccab31b9d
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestJsonLink.test.js
@@ -0,0 +1,36 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestJsonLink = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestJsonLink.js")
+);
+
+/*
+ * Test for the ManifestJsonLink component
+ */
+
+describe("ManifestJsonLink", () => {
+ it("renders the expected snapshot when given a regular URL", () => {
+ const wrapper = shallow(
+ ManifestJsonLink({ url: "https://example.com/manifest.json" })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when given a data URL", () => {
+ const wrapper = shallow(
+ ManifestJsonLink({
+ url: `data:application/manifest+json,{"name": "Foo"}`,
+ })
+ );
+ expect(wrapper).toMatchSnapshot();
+ // assert there's no link for data URLs
+ expect(wrapper.find("a").length).toBe(0);
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestLoader.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestLoader.test.js
new file mode 100644
index 0000000000..d3cc8595ce
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestLoader.test.js
@@ -0,0 +1,82 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+// Import test helpers
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+// Import fixtures
+const {
+ MANIFEST_NO_ISSUES,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const manifestActions = require("resource://devtools/client/application/src/actions/manifest.js");
+// NOTE: we need to spy on the action before we load the component, so it gets
+// bound to the spy, not the original implementation
+const fetchManifestActionSpy = jest.spyOn(manifestActions, "fetchManifest");
+
+const ManifestLoader = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestLoader.js")
+);
+
+describe("ManifestLoader", () => {
+ function buildStore({ manifest, errorMessage, isLoading }) {
+ const manifestState = Object.assign(
+ {
+ manifest: null,
+ errorMessage: "",
+ isLoading: false,
+ },
+ { manifest, errorMessage, isLoading }
+ );
+
+ return setupStore({ manifest: manifestState });
+ }
+
+ afterAll(() => {
+ fetchManifestActionSpy.mockRestore();
+ });
+
+ it("loads a manifest when mounted", async () => {
+ fetchManifestActionSpy.mockReturnValue({ type: "foo" });
+
+ const store = buildStore({});
+
+ shallow(ManifestLoader({ store })).dive();
+
+ expect(manifestActions.fetchManifest).toHaveBeenCalled();
+ fetchManifestActionSpy.mockReset();
+ });
+
+ it("renders a message when it is loading", async () => {
+ const store = buildStore({ isLoading: true });
+ const wrapper = shallow(ManifestLoader({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders a message when manifest has loaded OK", async () => {
+ const store = buildStore({
+ isLoading: false,
+ manifest: MANIFEST_NO_ISSUES,
+ errorMessage: "",
+ });
+ const wrapper = shallow(ManifestLoader({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders a message when manifest has failed to load", async () => {
+ const store = buildStore({
+ manifest: null,
+ isLoading: false,
+ errorMessage: "lorem ipsum",
+ });
+ const wrapper = shallow(ManifestLoader({ store })).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js
new file mode 100644
index 0000000000..b479882924
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js
@@ -0,0 +1,59 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+const {
+ MANIFEST_SIMPLE,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const ManifestPage = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestPage.js")
+);
+
+/**
+ * Test for ManifestPage.js component
+ */
+
+describe("ManifestPage", () => {
+ function buildStoreWithManifest(manifest, isLoading = false) {
+ return setupStore({
+ manifest: {
+ manifest,
+ errorMessage: "",
+ isLoading,
+ },
+ });
+ }
+
+ it("renders the expected snapshot when there is a manifest", () => {
+ const store = buildStoreWithManifest(MANIFEST_SIMPLE);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the manifest needs to load", () => {
+ const store = buildStoreWithManifest(undefined);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the manifest is loading", () => {
+ const store = buildStoreWithManifest(undefined, true);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when there is no manifest", () => {
+ const store = buildStoreWithManifest(null);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestSection.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestSection.test.js
new file mode 100644
index 0000000000..c117febb57
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestSection.test.js
@@ -0,0 +1,34 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+const {
+ td,
+ tr,
+} = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+
+const ManifestSection = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestSection.js")
+);
+
+/*
+ * Unit tests for the ManifestSection component
+ */
+
+describe("ManifestSection", () => {
+ it("renders the expected snapshot for a populated section", () => {
+ const content = tr({}, td({}, "foo"));
+ const wrapper = shallow(ManifestSection({ title: "Lorem ipsum" }, content));
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for a section with no children", () => {
+ const wrapper = shallow(ManifestSection({ title: "Lorem ipsum" }));
+ expect(wrapper).toMatchSnapshot();
+ expect(wrapper.find(".manifest-section--empty"));
+ });
+});
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestUrlItem.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestUrlItem.test.js
new file mode 100644
index 0000000000..1ef1504a3f
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestUrlItem.test.js
@@ -0,0 +1,30 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const ManifestUrlItem = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestUrlItem.js")
+);
+
+/*
+ * Unit tests for the ManifestUrlItem component
+ */
+
+describe("ManifestUrlItem", () => {
+ it("renders the expected snapshot for a populated url", () => {
+ const wrapper = shallow(
+ ManifestUrlItem({ label: "foo" }, "https://example.com")
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for an empty url", () => {
+ const wrapper = shallow(ManifestUrlItem({ label: "foo" }));
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-PageSwitcher.test.js.snap b/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-PageSwitcher.test.js.snap
new file mode 100644
index 0000000000..4fc899a511
--- /dev/null
+++ b/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-PageSwitcher.test.js.snap
@@ -0,0 +1,9 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`PageSwitcher renders nothing when an invalid page is selected 1`] = `""`;
+
+exports[`PageSwitcher renders nothing when no page is selected 1`] = `""`;
+
+exports[`PageSwitcher renders the ManifestPage component when manifest page is selected 1`] = `<Connect(ManifestPage) />`;
+
+exports[`PageSwitcher renders the WorkersPage component when workers page is selected 1`] = `<Connect(WorkersPage) />`;
diff --git a/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-Sidebar.test.js.snap b/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-Sidebar.test.js.snap
new file mode 100644
index 0000000000..4348d7c5b9
--- /dev/null
+++ b/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-Sidebar.test.js.snap
@@ -0,0 +1,64 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Sidebar renders the expected snapshot when no page is selected 1`] = `
+<aside
+ className="sidebar js-sidebar"
+>
+ <ul
+ className="sidebar__list"
+ >
+ <Connect(SidebarItem)
+ isSelected={false}
+ key="sidebar-item-service-workers"
+ page="service-workers"
+ />
+ <Connect(SidebarItem)
+ isSelected={false}
+ key="sidebar-item-manifest"
+ page="manifest"
+ />
+ </ul>
+</aside>
+`;
+
+exports[`Sidebar renders the expected snapshot when the manifest page is selected 1`] = `
+<aside
+ className="sidebar js-sidebar"
+>
+ <ul
+ className="sidebar__list"
+ >
+ <Connect(SidebarItem)
+ isSelected={false}
+ key="sidebar-item-service-workers"
+ page="service-workers"
+ />
+ <Connect(SidebarItem)
+ isSelected={true}
+ key="sidebar-item-manifest"
+ page="manifest"
+ />
+ </ul>
+</aside>
+`;
+
+exports[`Sidebar renders the expected snapshot when the service workers page is selected 1`] = `
+<aside
+ className="sidebar js-sidebar"
+>
+ <ul
+ className="sidebar__list"
+ >
+ <Connect(SidebarItem)
+ isSelected={true}
+ key="sidebar-item-service-workers"
+ page="service-workers"
+ />
+ <Connect(SidebarItem)
+ isSelected={false}
+ key="sidebar-item-manifest"
+ page="manifest"
+ />
+ </ul>
+</aside>
+`;
diff --git a/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-SidebarItem.test.js.snap b/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-SidebarItem.test.js.snap
new file mode 100644
index 0000000000..c5f3122e6c
--- /dev/null
+++ b/devtools/client/application/test/node/components/routing/__snapshots__/components_application_panel-SidebarItem.test.js.snap
@@ -0,0 +1,141 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`SidebarItem renders the expected snapshot when the manifest page is not selected 1`] = `
+<li
+ className="sidebar-item js-sidebar-manifest "
+ onClick={[Function]}
+ role="link"
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ "title": true,
+ }
+ }
+ id="sidebar-item-manifest"
+ >
+ <img
+ className="sidebar-item__icon"
+ src="chrome://devtools/skin/images/application-manifest.svg"
+ />
+ </Localized>
+ <Localized
+ attrs={
+ Object {
+ "title": true,
+ }
+ }
+ id="sidebar-item-manifest"
+ >
+ <span
+ className="devtools-ellipsis-text"
+ />
+ </Localized>
+</li>
+`;
+
+exports[`SidebarItem renders the expected snapshot when the manifest page is selected 1`] = `
+<li
+ className="sidebar-item js-sidebar-manifest sidebar-item--selected"
+ onClick={[Function]}
+ role="link"
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ "title": true,
+ }
+ }
+ id="sidebar-item-manifest"
+ >
+ <img
+ className="sidebar-item__icon"
+ src="chrome://devtools/skin/images/application-manifest.svg"
+ />
+ </Localized>
+ <Localized
+ attrs={
+ Object {
+ "title": true,
+ }
+ }
+ id="sidebar-item-manifest"
+ >
+ <span
+ className="devtools-ellipsis-text"
+ />
+ </Localized>
+</li>
+`;
+
+exports[`SidebarItem renders the expected snapshot when the service-workers page is not selected 1`] = `
+<li
+ className="sidebar-item js-sidebar-service-workers "
+ onClick={[Function]}
+ role="link"
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ "title": true,
+ }
+ }
+ id="sidebar-item-service-workers"
+ >
+ <img
+ className="sidebar-item__icon"
+ src="chrome://devtools/skin/images/debugging-workers.svg"
+ />
+ </Localized>
+ <Localized
+ attrs={
+ Object {
+ "title": true,
+ }
+ }
+ id="sidebar-item-service-workers"
+ >
+ <span
+ className="devtools-ellipsis-text"
+ />
+ </Localized>
+</li>
+`;
+
+exports[`SidebarItem renders the expected snapshot when the service-workers page is selected 1`] = `
+<li
+ className="sidebar-item js-sidebar-service-workers sidebar-item--selected"
+ onClick={[Function]}
+ role="link"
+>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ "title": true,
+ }
+ }
+ id="sidebar-item-service-workers"
+ >
+ <img
+ className="sidebar-item__icon"
+ src="chrome://devtools/skin/images/debugging-workers.svg"
+ />
+ </Localized>
+ <Localized
+ attrs={
+ Object {
+ "title": true,
+ }
+ }
+ id="sidebar-item-service-workers"
+ >
+ <span
+ className="devtools-ellipsis-text"
+ />
+ </Localized>
+</li>
+`;
diff --git a/devtools/client/application/test/node/components/routing/components_application_panel-PageSwitcher.test.js b/devtools/client/application/test/node/components/routing/components_application_panel-PageSwitcher.test.js
new file mode 100644
index 0000000000..1e69aa6869
--- /dev/null
+++ b/devtools/client/application/test/node/components/routing/components_application_panel-PageSwitcher.test.js
@@ -0,0 +1,73 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+// Import setupStore with imported & combined reducers
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+const PageSwitcher = createFactory(
+ require("resource://devtools/client/application/src/components/routing/PageSwitcher.js")
+);
+
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+/**
+ * Test for workerListEmpty.js component
+ */
+
+describe("PageSwitcher", () => {
+ function buildStoreWithSelectedPage(selectedPage) {
+ return setupStore({
+ ui: {
+ selectedPage,
+ },
+ });
+ }
+
+ const consoleErrorSpy = jest
+ .spyOn(console, "error")
+ .mockImplementation(() => {});
+
+ beforeEach(() => {
+ console.error.mockClear();
+ });
+
+ afterAll(() => {
+ consoleErrorSpy.mockRestore();
+ });
+
+ it("renders the ManifestPage component when manifest page is selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.MANIFEST);
+ const wrapper = shallow(PageSwitcher({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the WorkersPage component when workers page is selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.SERVICE_WORKERS);
+ const wrapper = shallow(PageSwitcher({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders nothing when no page is selected", () => {
+ const store = buildStoreWithSelectedPage(null);
+ const wrapper = shallow(PageSwitcher({ store })).dive();
+ expect(console.error).toHaveBeenCalledTimes(1);
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders nothing when an invalid page is selected", () => {
+ const store = buildStoreWithSelectedPage("foo");
+ const wrapper = shallow(PageSwitcher({ store })).dive();
+ expect(console.error).toHaveBeenCalledTimes(1);
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/routing/components_application_panel-Sidebar.test.js b/devtools/client/application/test/node/components/routing/components_application_panel-Sidebar.test.js
new file mode 100644
index 0000000000..4593f702bc
--- /dev/null
+++ b/devtools/client/application/test/node/components/routing/components_application_panel-Sidebar.test.js
@@ -0,0 +1,51 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const Sidebar = createFactory(
+ require("resource://devtools/client/application/src/components/routing/Sidebar.js")
+);
+
+/**
+ * Test for Sidebar.js component
+ */
+
+describe("Sidebar", () => {
+ function buildStoreWithSelectedPage(selectedPage) {
+ return setupStore({
+ ui: {
+ selectedPage,
+ },
+ });
+ }
+ it("renders the expected snapshot when the manifest page is selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.MANIFEST);
+ const wrapper = shallow(Sidebar({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the service workers page is selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.SERVICE_WORKERS);
+ const wrapper = shallow(Sidebar({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when no page is selected", () => {
+ const store = buildStoreWithSelectedPage();
+ const wrapper = shallow(Sidebar({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/routing/components_application_panel-SidebarItem.test.js b/devtools/client/application/test/node/components/routing/components_application_panel-SidebarItem.test.js
new file mode 100644
index 0000000000..955c97acd2
--- /dev/null
+++ b/devtools/client/application/test/node/components/routing/components_application_panel-SidebarItem.test.js
@@ -0,0 +1,82 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+const {
+ PAGE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const SidebarItem = createFactory(
+ require("resource://devtools/client/application/src/components/routing/SidebarItem.js")
+);
+
+/**
+ * Test for SidebarItem.js component
+ */
+
+describe("SidebarItem", () => {
+ function buildStoreWithSelectedPage(selectedPage) {
+ return setupStore({
+ ui: {
+ selectedPage,
+ },
+ });
+ }
+
+ it("renders the expected snapshot when the manifest page is selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.MANIFEST);
+ const wrapper = shallow(
+ SidebarItem({
+ store,
+ page: "manifest",
+ isSelected: true,
+ })
+ ).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the service-workers page is selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.SERVICE_WORKERS);
+ const wrapper = shallow(
+ SidebarItem({
+ store,
+ isSelected: true,
+ page: "service-workers",
+ })
+ ).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the manifest page is not selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.MANIFEST);
+ const wrapper = shallow(
+ SidebarItem({
+ store,
+ isSelected: false,
+ page: "manifest",
+ })
+ ).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the service-workers page is not selected", () => {
+ const store = buildStoreWithSelectedPage(PAGE_TYPES.SERVICE_WORKERS);
+ const wrapper = shallow(
+ SidebarItem({
+ store,
+ isSelected: false,
+ page: "service-workers",
+ })
+ ).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Registration.test.js.snap b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Registration.test.js.snap
new file mode 100644
index 0000000000..f85bf8b2a1
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Registration.test.js.snap
@@ -0,0 +1,180 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Registration Renders the expected snapshot for a registration with a worker 1`] = `
+<li
+ className=""
+>
+ <article
+ className="registration js-sw-container"
+ >
+ <header
+ className="registration__header"
+ >
+ <h2
+ className="registration__scope js-sw-scope devtools-ellipsis-text"
+ title="SCOPE 123"
+ >
+ SCOPE 123
+ </h2>
+ </header>
+ <aside
+ className="registration__controls"
+ >
+ <Localized
+ id="serviceworker-worker-unregister"
+ >
+ <UIButton
+ className="js-unregister-button"
+ onClick={[Function]}
+ />
+ </Localized>
+ </aside>
+ <ul
+ className="registration__workers"
+ >
+ <li
+ className="registration__workers-item"
+ key="id-worker-1-example"
+ >
+ <Connect(Worker)
+ isDebugEnabled={true}
+ worker={
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ }
+ }
+ />
+ </li>
+ </ul>
+ </article>
+</li>
+`;
+
+exports[`Registration Renders the expected snapshot for a registration with multiple workers 1`] = `
+<li
+ className=""
+>
+ <article
+ className="registration js-sw-container"
+ >
+ <header
+ className="registration__header"
+ >
+ <h2
+ className="registration__scope js-sw-scope devtools-ellipsis-text"
+ title="SCOPE 123"
+ >
+ SCOPE 123
+ </h2>
+ </header>
+ <aside
+ className="registration__controls"
+ >
+ <Localized
+ id="serviceworker-worker-unregister"
+ >
+ <UIButton
+ className="js-unregister-button"
+ onClick={[Function]}
+ />
+ </Localized>
+ </aside>
+ <ul
+ className="registration__workers"
+ >
+ <li
+ className="registration__workers-item"
+ key="id-worker-1-example"
+ >
+ <Connect(Worker)
+ isDebugEnabled={true}
+ worker={
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ }
+ }
+ />
+ </li>
+ <li
+ className="registration__workers-item"
+ key="id-worker-2-example"
+ >
+ <Connect(Worker)
+ isDebugEnabled={true}
+ worker={
+ Object {
+ "id": "id-worker-2-example",
+ "state": 2,
+ "stateText": "installed",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ }
+ }
+ />
+ </li>
+ </ul>
+ </article>
+</li>
+`;
+
+exports[`Registration Renders the expected snapshot when sw debugging is disabled 1`] = `
+<li
+ className=""
+>
+ <article
+ className="registration js-sw-container"
+ >
+ <header
+ className="registration__header"
+ >
+ <h2
+ className="registration__scope js-sw-scope devtools-ellipsis-text"
+ title="SCOPE 123"
+ >
+ SCOPE 123
+ </h2>
+ </header>
+ <aside
+ className="registration__controls"
+ >
+ <Localized
+ id="serviceworker-worker-unregister"
+ >
+ <UIButton
+ className="js-unregister-button"
+ onClick={[Function]}
+ />
+ </Localized>
+ </aside>
+ <ul
+ className="registration__workers"
+ >
+ <li
+ className="registration__workers-item"
+ key="id-worker-1-example"
+ >
+ <Connect(Worker)
+ isDebugEnabled={false}
+ worker={
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ }
+ }
+ />
+ </li>
+ </ul>
+ </article>
+</li>
+`;
diff --git a/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationList.test.js.snap b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationList.test.js.snap
new file mode 100644
index 0000000000..160bff7c8c
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationList.test.js.snap
@@ -0,0 +1,159 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`RegistrationList renders the expected snapshot for a list with a single registration 1`] = `
+Array [
+ <article
+ className="registrations-container"
+ key="registrations-container"
+ >
+ <Localized
+ id="serviceworker-list-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ul
+ className="registrations-container__list"
+ >
+ <Connect(Registration)
+ className="registrations-container__item"
+ isDebugEnabled={true}
+ key="id-reg-1-example"
+ registration={
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE 123",
+ "workers": Array [
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ }
+ }
+ />
+ </ul>
+ </article>,
+ <footer
+ className="aboutdebugging-plug"
+ >
+ <Localized
+ a={
+ <a
+ className="aboutdebugging-plug__link"
+ onClick={[Function]}
+ />
+ }
+ id="serviceworker-list-aboutdebugging"
+ key="serviceworkerlist-footer"
+ >
+ <p />
+ </Localized>
+ </footer>,
+]
+`;
+
+exports[`RegistrationList renders the expected snapshot for a multiple registration list 1`] = `
+Array [
+ <article
+ className="registrations-container"
+ key="registrations-container"
+ >
+ <Localized
+ id="serviceworker-list-header"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <ul
+ className="registrations-container__list"
+ >
+ <Connect(Registration)
+ className="registrations-container__item"
+ isDebugEnabled={true}
+ key="id-reg-1-example"
+ registration={
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE1",
+ "workers": Array [
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ }
+ }
+ />
+ <Connect(Registration)
+ className="registrations-container__item"
+ isDebugEnabled={true}
+ key="id-reg-1-example"
+ registration={
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE2",
+ "workers": Array [
+ Object {
+ "id": "id-worker-2-example",
+ "state": 2,
+ "stateText": "installed",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ }
+ }
+ />
+ <Connect(Registration)
+ className="registrations-container__item"
+ isDebugEnabled={true}
+ key="id-reg-3-example"
+ registration={
+ Object {
+ "id": "id-reg-3-example",
+ "registrationFront": "",
+ "scope": "SCOPE3",
+ "workers": Array [
+ Object {
+ "id": "id-worker-3-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ }
+ }
+ />
+ </ul>
+ </article>,
+ <footer
+ className="aboutdebugging-plug"
+ >
+ <Localized
+ a={
+ <a
+ className="aboutdebugging-plug__link"
+ onClick={[Function]}
+ />
+ }
+ id="serviceworker-list-aboutdebugging"
+ key="serviceworkerlist-footer"
+ >
+ <p />
+ </Localized>
+ </footer>,
+]
+`;
diff --git a/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationListEmpty.test.js.snap b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationListEmpty.test.js.snap
new file mode 100644
index 0000000000..657c7164d7
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-RegistrationListEmpty.test.js.snap
@@ -0,0 +1,66 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`RegistrationListEmpty renders the expected snapshot 1`] = `
+<article
+ className="app-page__icon-container js-registration-list-empty"
+>
+ <aside>
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="sidebar-item-service-workers"
+ >
+ <img
+ className="app-page__icon"
+ src="chrome://devtools/skin/images/debugging-workers.svg"
+ />
+ </Localized>
+ </aside>
+ <div>
+ <Localized
+ id="serviceworker-empty-intro2"
+ >
+ <h1
+ className="app-page__title"
+ />
+ </Localized>
+ <Localized
+ a={
+ <a
+ onClick={[Function]}
+ />
+ }
+ id="serviceworker-empty-suggestions2"
+ span={
+ <a
+ onClick={[Function]}
+ />
+ }
+ >
+ <p />
+ </Localized>
+ <p>
+ <Localized
+ id="serviceworker-empty-intro-link"
+ >
+ <a
+ onClick={[Function]}
+ />
+ </Localized>
+ </p>
+ <p>
+ <Localized
+ id="serviceworker-empty-suggestions-aboutdebugging2"
+ >
+ <a
+ className="js-trusted-link"
+ onClick={[Function]}
+ />
+ </Localized>
+ </p>
+ </div>
+</article>
+`;
diff --git a/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Worker.test.js.snap b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Worker.test.js.snap
new file mode 100644
index 0000000000..7e71765e90
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-Worker.test.js.snap
@@ -0,0 +1,132 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Worker Renders the expected snapshot for a non-active worker 1`] = `
+<section
+ className="worker js-sw-worker"
+>
+ <p
+ className="worker__icon"
+ >
+ <img
+ className="worker__icon-image"
+ src="chrome://devtools/skin/images/debugging-workers.svg"
+ />
+ </p>
+ <p
+ className="worker__source"
+ >
+ <span
+ className="js-source-url"
+ >
+ worker.js
+ </span>
+ </p>
+ <p
+ className="worker__misc"
+ >
+ <span
+ className="js-worker-status worker__status worker__status--waiting"
+ >
+ installed
+ </span>
+
+ </p>
+</section>
+`;
+
+exports[`Worker Renders the expected snapshot for a running worker 1`] = `
+<section
+ className="worker js-sw-worker"
+>
+ <p
+ className="worker__icon"
+ >
+ <img
+ className="worker__icon-image"
+ src="chrome://devtools/skin/images/debugging-workers.svg"
+ />
+ </p>
+ <p
+ className="worker__source"
+ >
+ <a
+ className="js-inspect-link"
+ href="#"
+ onClick={[Function]}
+ title="http://example.com/worker.js"
+ >
+ <span
+ className="js-source-url"
+ >
+ worker.js
+ </span>
+  
+ <Localized
+ attrs={
+ Object {
+ "alt": true,
+ }
+ }
+ id="serviceworker-worker-inspect-icon"
+ >
+ <img
+ src="chrome://devtools/skin/images/application-debug.svg"
+ />
+ </Localized>
+ </a>
+ </p>
+ <p
+ className="worker__misc"
+ >
+ <span
+ className="js-worker-status worker__status worker__status--active"
+ >
+ serviceworker-worker-status-running
+ </span>
+
+ </p>
+</section>
+`;
+
+exports[`Worker Renders the expected snapshot for a stopped worker 1`] = `
+<section
+ className="worker js-sw-worker"
+>
+ <p
+ className="worker__icon"
+ >
+ <img
+ className="worker__icon-image"
+ src="chrome://devtools/skin/images/debugging-workers.svg"
+ />
+ </p>
+ <p
+ className="worker__source"
+ >
+ <span
+ className="js-source-url"
+ >
+ worker.js
+ </span>
+ </p>
+ <p
+ className="worker__misc"
+ >
+ <span
+ className="js-worker-status worker__status worker__status--active"
+ >
+ serviceworker-worker-status-stopped
+ </span>
+
+ <Localized
+ id="serviceworker-worker-start3"
+ >
+ <UIButton
+ className="js-start-button"
+ onClick={[Function]}
+ size="micro"
+ />
+ </Localized>
+ </p>
+</section>
+`;
diff --git a/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-WorkersPage.test.js.snap b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-WorkersPage.test.js.snap
new file mode 100644
index 0000000000..5de3e33b4e
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/__snapshots__/components_application_panel-WorkersPage.test.js.snap
@@ -0,0 +1,143 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`WorkersPage filters out workers from diferent domains 1`] = `
+<section
+ className="app-page js-service-workers-page "
+>
+ <RegistrationList
+ canDebugWorkers={true}
+ registrations={
+ Array [
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE1",
+ "workers": Array [
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ },
+ Object {
+ "id": "id-reg-2-example",
+ "registrationFront": "",
+ "scope": "SCOPE2",
+ "workers": Array [
+ Object {
+ "id": "id-worker-2-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ },
+ ]
+ }
+ />
+</section>
+`;
+
+exports[`WorkersPage filters out workers from different domains and renders an empty list when there is none left 1`] = `
+<section
+ className="app-page js-service-workers-page app-page--empty"
+>
+ <RegistrationListEmpty />
+</section>
+`;
+
+exports[`WorkersPage it renders a list with a single element if there's just 1 worker 1`] = `
+<section
+ className="app-page js-service-workers-page "
+>
+ <RegistrationList
+ canDebugWorkers={true}
+ registrations={
+ Array [
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE 123",
+ "workers": Array [
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ },
+ ]
+ }
+ />
+</section>
+`;
+
+exports[`WorkersPage renders a list with multiple elements when there are multiple workers 1`] = `
+<section
+ className="app-page js-service-workers-page "
+>
+ <RegistrationList
+ canDebugWorkers={true}
+ registrations={
+ Array [
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE1",
+ "workers": Array [
+ Object {
+ "id": "id-worker-1-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ },
+ Object {
+ "id": "id-reg-1-example",
+ "registrationFront": "",
+ "scope": "SCOPE2",
+ "workers": Array [
+ Object {
+ "id": "id-worker-2-example",
+ "state": 2,
+ "stateText": "installed",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ },
+ Object {
+ "id": "id-reg-3-example",
+ "registrationFront": "",
+ "scope": "SCOPE3",
+ "workers": Array [
+ Object {
+ "id": "id-worker-3-example",
+ "state": 4,
+ "stateText": "activated",
+ "url": "http://example.com/worker.js",
+ "workerDescriptorFront": "",
+ },
+ ],
+ },
+ ]
+ }
+ />
+</section>
+`;
+
+exports[`WorkersPage renders an empty list if there are no workers 1`] = `
+<section
+ className="app-page js-service-workers-page app-page--empty"
+>
+ <RegistrationListEmpty />
+</section>
+`;
diff --git a/devtools/client/application/test/node/components/service-workers/components_application_panel-Registration.test.js b/devtools/client/application/test/node/components/service-workers/components_application_panel-Registration.test.js
new file mode 100644
index 0000000000..7473a61d23
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/components_application_panel-Registration.test.js
@@ -0,0 +1,88 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+// Import test helpers
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+const {
+ REGISTRATION_SINGLE_WORKER,
+ REGISTRATION_MULTIPLE_WORKERS,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const Registration = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/Registration.js")
+);
+
+describe("Registration", () => {
+ it("Renders the expected snapshot for a registration with a worker", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Registration({
+ isDebugEnabled: true,
+ registration: REGISTRATION_SINGLE_WORKER,
+ store,
+ })
+ ).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ // ensure that we do have the proper amount of workers
+ expect(wrapper.find("Connect(Worker)")).toHaveLength(1);
+ });
+
+ it("Renders the expected snapshot for a registration with multiple workers", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Registration({
+ isDebugEnabled: true,
+ registration: REGISTRATION_MULTIPLE_WORKERS,
+ store,
+ })
+ ).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ // ensure that we do have the proper amount of workers
+ expect(wrapper.find("Connect(Worker)")).toHaveLength(2);
+ });
+
+ it("Renders the expected snapshot when sw debugging is disabled", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Registration({
+ isDebugEnabled: false,
+ registration: REGISTRATION_SINGLE_WORKER,
+ store,
+ })
+ ).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("Removes the ending forward slash from the scope, when present", () => {
+ const store = setupStore({});
+
+ const registration = Object.assign({}, REGISTRATION_SINGLE_WORKER, {
+ scope: "https://example.com/something/",
+ });
+
+ const wrapper = shallow(
+ Registration({
+ isDebugEnabled: false,
+ registration,
+ store,
+ })
+ ).dive();
+
+ const scopeEl = wrapper.find(".js-sw-scope");
+ expect(scopeEl.text()).toBe("example.com/something");
+ });
+});
diff --git a/devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationList.test.js b/devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationList.test.js
new file mode 100644
index 0000000000..6bb202cd25
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationList.test.js
@@ -0,0 +1,43 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+// Import constants
+const {
+ SINGLE_WORKER_DEFAULT_DOMAIN_LIST,
+ MULTIPLE_WORKER_LIST,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const RegistrationList = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/RegistrationList.js")
+);
+
+/**
+ * Test for RegistrationList.js component
+ */
+describe("RegistrationList", () => {
+ it("renders the expected snapshot for a list with a single registration", () => {
+ const wrapper = shallow(
+ RegistrationList({
+ registrations: SINGLE_WORKER_DEFAULT_DOMAIN_LIST,
+ canDebugWorkers: true,
+ })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot for a multiple registration list", () => {
+ const wrapper = shallow(
+ RegistrationList({
+ registrations: MULTIPLE_WORKER_LIST,
+ canDebugWorkers: true,
+ })
+ );
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationListEmpty.test.js b/devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationListEmpty.test.js
new file mode 100644
index 0000000000..811535facc
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/components_application_panel-RegistrationListEmpty.test.js
@@ -0,0 +1,23 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const RegistrationListEmpty = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/RegistrationListEmpty.js")
+);
+
+/**
+ * Test for RegistrationListEmpty.js component
+ */
+
+describe("RegistrationListEmpty", () => {
+ it("renders the expected snapshot", () => {
+ const wrapper = shallow(RegistrationListEmpty({}));
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/service-workers/components_application_panel-Worker.test.js b/devtools/client/application/test/node/components/service-workers/components_application_panel-Worker.test.js
new file mode 100644
index 0000000000..36a6acda0c
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/components_application_panel-Worker.test.js
@@ -0,0 +1,110 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+// Import test helpers
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+const {
+ WORKER_RUNNING,
+ WORKER_STOPPED,
+ WORKER_WAITING,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const Worker = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/Worker.js")
+);
+
+describe("Worker", () => {
+ it("Renders the expected snapshot for a running worker", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Worker({
+ isDebugEnabled: true,
+ worker: WORKER_RUNNING,
+ store,
+ })
+ ).dive();
+
+ // ensure proper status
+ expect(wrapper.find(".js-worker-status").text()).toBe(
+ "serviceworker-worker-status-running"
+ );
+ // check that Start button is not available
+ expect(wrapper.find(".js-start-button")).toHaveLength(0);
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("Renders the expected snapshot for a stopped worker", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Worker({
+ isDebugEnabled: true,
+ worker: WORKER_STOPPED,
+ store,
+ })
+ ).dive();
+
+ // ensure proper status
+ expect(wrapper.find(".js-worker-status").text()).toBe(
+ "serviceworker-worker-status-stopped"
+ );
+ // check that Start button is available
+ expect(wrapper.find(".js-start-button")).toHaveLength(1);
+ // check that inspect link does not exist
+ expect(wrapper.find(".js-inspect-link")).toHaveLength(0);
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("Renders the start button even if debugging workers is disabled", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Worker({
+ isDebugEnabled: false,
+ worker: WORKER_STOPPED,
+ store,
+ })
+ ).dive();
+
+ // ensure proper status
+ expect(wrapper.find(".js-worker-status").text()).toBe(
+ "serviceworker-worker-status-stopped"
+ );
+ // check that Start button is available
+ expect(wrapper.find(".js-start-button")).toHaveLength(1);
+ });
+
+ it("Renders the expected snapshot for a non-active worker", () => {
+ const store = setupStore({});
+
+ const wrapper = shallow(
+ Worker({
+ isDebugEnabled: true,
+ worker: WORKER_WAITING,
+ store,
+ })
+ ).dive();
+
+ // ensure proper status
+ // NOTE: since non-active status are localized directly in the front, not
+ // in the panel, we don't expect a localization ID here
+ expect(wrapper.find(".js-worker-status").text()).toBe("installed");
+ // check that Start button is not available
+ expect(wrapper.find(".js-start-button")).toHaveLength(0);
+ // check that Debug link does not exist
+ expect(wrapper.find(".js-inspect-link")).toHaveLength(0);
+
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/application/test/node/components/service-workers/components_application_panel-WorkersPage.test.js b/devtools/client/application/test/node/components/service-workers/components_application_panel-WorkersPage.test.js
new file mode 100644
index 0000000000..be1b14f216
--- /dev/null
+++ b/devtools/client/application/test/node/components/service-workers/components_application_panel-WorkersPage.test.js
@@ -0,0 +1,82 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+// Import fixtures
+const {
+ EMPTY_WORKER_LIST,
+ SINGLE_WORKER_DEFAULT_DOMAIN_LIST,
+ SINGLE_WORKER_DIFFERENT_DOMAIN_LIST,
+ MULTIPLE_WORKER_LIST,
+ MULTIPLE_WORKER_MIXED_DOMAINS_LIST,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+// Import setupStore with imported & combined reducers
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+
+// Import component
+const WorkersPage = createFactory(
+ require("resource://devtools/client/application/src/components/service-workers/WorkersPage.js")
+);
+
+/**
+ * Test for App.js component
+ */
+describe("WorkersPage", () => {
+ const baseState = {
+ workers: { list: [], canDebugWorkers: true },
+ page: { domain: "example.com" },
+ };
+
+ function buildStoreWithWorkers(workerList) {
+ const workers = { list: workerList, canDebugWorkers: true };
+ const state = Object.assign({}, baseState, { workers });
+ return setupStore(state);
+ }
+
+ it("renders an empty list if there are no workers", () => {
+ const store = buildStoreWithWorkers(EMPTY_WORKER_LIST);
+ const wrapper = shallow(WorkersPage({ store })).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("it renders a list with a single element if there's just 1 worker", () => {
+ const store = buildStoreWithWorkers(SINGLE_WORKER_DEFAULT_DOMAIN_LIST);
+ const wrapper = shallow(WorkersPage({ store })).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders a list with multiple elements when there are multiple workers", () => {
+ const store = buildStoreWithWorkers(MULTIPLE_WORKER_LIST);
+ const wrapper = shallow(WorkersPage({ store })).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("filters out workers from diferent domains", () => {
+ const store = buildStoreWithWorkers(MULTIPLE_WORKER_MIXED_DOMAINS_LIST);
+ const wrapper = shallow(WorkersPage({ store })).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it(
+ "filters out workers from different domains and renders an empty list when " +
+ "there is none left",
+ () => {
+ const store = buildStoreWithWorkers(SINGLE_WORKER_DIFFERENT_DOMAIN_LIST);
+ const wrapper = shallow(WorkersPage({ store })).dive();
+
+ expect(wrapper).toMatchSnapshot();
+ }
+ );
+});
diff --git a/devtools/client/application/test/node/fixtures/data/constants.js b/devtools/client/application/test/node/fixtures/data/constants.js
new file mode 100644
index 0000000000..795324525c
--- /dev/null
+++ b/devtools/client/application/test/node/fixtures/data/constants.js
@@ -0,0 +1,312 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// NOTE: worker state values are defined in an enum in nsIServiceWorkerManager
+// https://searchfox.org/mozilla-central/source/dom/interfaces/base/nsIServiceWorkerManager.idl
+
+const EMPTY_WORKER_LIST = [];
+
+const WORKER_RUNNING = {
+ id: "id-worker-1-example",
+ workerDescriptorFront: true,
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+};
+
+const WORKER_STOPPED = {
+ id: "id-worker-1-example",
+ workerDescriptorFront: false,
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+};
+
+const WORKER_WAITING = {
+ id: "id-worker-1-example",
+ workerDescriptorFront: false,
+ url: "http://example.com/worker.js",
+ state: 2,
+ stateText: "installed",
+};
+
+const REGISTRATION_SINGLE_WORKER = {
+ id: "id-reg-1-example",
+ scope: "SCOPE 123",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-1-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+};
+
+const REGISTRATION_MULTIPLE_WORKERS = {
+ id: "id-reg-1-example",
+ scope: "SCOPE 123",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-1-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ {
+ id: "id-worker-2-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 2,
+ stateText: "installed",
+ },
+ ],
+};
+
+const SINGLE_WORKER_DEFAULT_DOMAIN_LIST = [
+ {
+ id: "id-reg-1-example",
+ scope: "SCOPE 123",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-1-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+];
+
+const SINGLE_WORKER_DIFFERENT_DOMAIN_LIST = [
+ {
+ id: "id-reg-1-example",
+ scope: "SCOPE 123",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-1-example",
+ workerDescriptorFront: "",
+ url: "http://different-example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+];
+
+const MULTIPLE_WORKER_LIST = [
+ {
+ id: "id-reg-1-example",
+ scope: "SCOPE1",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-1-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+ {
+ id: "id-reg-1-example",
+ scope: "SCOPE2",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-2-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 2,
+ stateText: "installed",
+ },
+ ],
+ },
+ {
+ id: "id-reg-3-example",
+ scope: "SCOPE3",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-3-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+];
+
+const MULTIPLE_WORKER_MIXED_DOMAINS_LIST = [
+ {
+ id: "id-reg-1-example",
+ scope: "SCOPE1",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-1-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+ {
+ id: "id-reg-2-example",
+ scope: "SCOPE2",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-2-example",
+ workerDescriptorFront: "",
+ url: "http://example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+ {
+ id: "id-reg-3-example",
+ scope: "SCOPE3",
+ registrationFront: "",
+ workers: [
+ {
+ id: "id-worker-3-example",
+ workerDescriptorFront: "",
+ url: "http://different-example.com/worker.js",
+ state: 4,
+ stateText: "activated",
+ },
+ ],
+ },
+];
+
+// props for a simple manifest
+const MANIFEST_SIMPLE = {
+ icons: [
+ {
+ key: { sizes: "1x1", contentType: "image/png" },
+ value: { src: "something.png", purpose: "any" },
+ type: "icon",
+ },
+ ],
+ identity: [{ key: "name", value: "foo", type: "string" }],
+ presentation: [
+ { key: "lorem", value: "ipsum", type: "string" },
+ { key: "foo", value: "bar", type: "string" },
+ ],
+ validation: [{ level: "warning", message: "This is a warning" }],
+};
+
+// props for a manifest with string values
+const MANIFEST_STRING_MEMBERS = {
+ icons: [],
+ identity: [{ key: "name", value: "foo", type: "string" }],
+ presentation: [],
+ validation: [],
+};
+
+// props for a manifest with color values
+const MANIFEST_COLOR_MEMBERS = {
+ icons: [],
+ identity: [],
+ presentation: [
+ { key: "background_color", value: "red", type: "color" },
+ { key: "theme_color", value: "rgb(0, 0, 0)", type: "color" },
+ ],
+ validation: [],
+};
+
+// props for a manifest with icon values
+const MANIFEST_ICON_MEMBERS = {
+ icons: [
+ {
+ key: { sizes: "1x1", contentType: "image/png" },
+ value: { src: "something.png", purpose: "any" },
+ type: "icon",
+ },
+ {
+ key: { sizes: "", contentType: "" },
+ value: { src: "something.svg", purpose: "any maskable" },
+ type: "icon",
+ },
+ ],
+ identity: [],
+ presentation: [],
+ validation: [],
+};
+
+// props for a manifest with values that have an unrecognized type
+const MANIFEST_UNKNOWN_TYPE_MEMBERS = {
+ icons: [],
+ identity: [{ key: "lorem", value: "ipsum", type: "foo" }],
+ presentation: [],
+ validation: [],
+};
+
+// props for a manifest with url values
+const MANIFEST_URL_MEMBERS = {
+ icons: [],
+ identity: [],
+ presentation: [
+ { key: "start_url", value: "https://example.com/", type: "url" },
+ { key: "scope", value: "https://example.com/", type: "url" },
+ ],
+};
+
+const MANIFEST_WITH_ISSUES = {
+ icons: [],
+ identity: [{ key: "name", value: "foo", type: "string" }],
+ presentation: [
+ { key: "lorem", value: "ipsum", type: "string" },
+ { key: "foo", value: "bar", type: "string" },
+ ],
+ validation: [{ level: "warning", message: "This is a warning" }],
+};
+
+// props for a manifest with no validation issues
+const MANIFEST_NO_ISSUES = {
+ icons: [],
+ identity: [{ key: "name", value: "foo", type: "string" }],
+ presentation: [
+ { key: "lorem", value: "ipsum", type: "string" },
+ { key: "foo", value: "bar", type: "string" },
+ ],
+ validation: [],
+};
+
+module.exports = {
+ // service worker related fixtures
+ EMPTY_WORKER_LIST,
+ MULTIPLE_WORKER_LIST,
+ MULTIPLE_WORKER_MIXED_DOMAINS_LIST,
+ REGISTRATION_MULTIPLE_WORKERS,
+ REGISTRATION_SINGLE_WORKER,
+ SINGLE_WORKER_DEFAULT_DOMAIN_LIST,
+ SINGLE_WORKER_DIFFERENT_DOMAIN_LIST,
+ WORKER_RUNNING,
+ WORKER_STOPPED,
+ WORKER_WAITING,
+ // manifest related fixtures
+ MANIFEST_NO_ISSUES,
+ MANIFEST_WITH_ISSUES,
+ MANIFEST_SIMPLE,
+ MANIFEST_COLOR_MEMBERS,
+ MANIFEST_ICON_MEMBERS,
+ MANIFEST_STRING_MEMBERS,
+ MANIFEST_UNKNOWN_TYPE_MEMBERS,
+ MANIFEST_URL_MEMBERS,
+};
diff --git a/devtools/client/application/test/node/helpers.js b/devtools/client/application/test/node/helpers.js
new file mode 100644
index 0000000000..6699549a15
--- /dev/null
+++ b/devtools/client/application/test/node/helpers.js
@@ -0,0 +1,31 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ thunk,
+} = require("resource://devtools/client/shared/redux/middleware/thunk.js");
+const configureStore = require("redux-mock-store").default;
+
+/**
+ * Prepare the store for use in testing.
+ */
+function setupStore(preloadedState = {}) {
+ const middleware = [thunk()];
+ const mockStore = configureStore(middleware);
+ return mockStore(preloadedState);
+}
+
+/**
+ * This gives an opportunity to Promises to resolve in tests
+ * (since they are microtasks)
+ */
+async function flushPromises() {
+ await new Promise(r => setTimeout(r, 0));
+}
+
+module.exports = {
+ flushPromises,
+ setupStore,
+};
diff --git a/devtools/client/application/test/node/jest.config.js b/devtools/client/application/test/node/jest.config.js
new file mode 100644
index 0000000000..e114658f88
--- /dev/null
+++ b/devtools/client/application/test/node/jest.config.js
@@ -0,0 +1,14 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* global __dirname */
+
+const sharedJestConfig = require(`${__dirname}/../../../shared/test-helpers/shared-jest.config`);
+
+module.exports = {
+ ...sharedJestConfig,
+ setupFiles: ["<rootDir>setup.js"],
+ snapshotSerializers: ["enzyme-to-json/serializer"],
+};
diff --git a/devtools/client/application/test/node/package.json b/devtools/client/application/test/node/package.json
new file mode 100644
index 0000000000..3bfea24f40
--- /dev/null
+++ b/devtools/client/application/test/node/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "application-panel-tests",
+ "license": "MPL-2.0",
+ "version": "0.0.1",
+ "engines": {
+ "node": ">=8.9.4"
+ },
+ "scripts": {
+ "test": "jest",
+ "test-ci": "jest --json"
+ },
+ "dependencies": {
+ "@babel/plugin-proposal-async-generator-functions": "^7.2.0",
+ "enzyme": "^3.9.0",
+ "enzyme-adapter-react-16": "^1.13.2",
+ "enzyme-to-json": "^3.3.5",
+ "jest": "^24.6",
+ "react": "16.4.1",
+ "react-dom": "16",
+ "react-test-renderer": "16.4.1",
+ "redux": "^4.0.4",
+ "redux-mock-store": "^1.5.3"
+ },
+ "devDependencies": {}
+}
diff --git a/devtools/client/application/test/node/setup.js b/devtools/client/application/test/node/setup.js
new file mode 100644
index 0000000000..570e4462ae
--- /dev/null
+++ b/devtools/client/application/test/node/setup.js
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+// Configure enzyme with React 16 adapter.
+const Enzyme = require("enzyme");
+const Adapter = require("enzyme-adapter-react-16");
+Enzyme.configure({ adapter: new Adapter() });
+
+const {
+ setMocksInGlobal,
+} = require("resource://devtools/client/shared/test-helpers/shared-node-helpers.js");
+setMocksInGlobal();
diff --git a/devtools/client/application/test/node/yarn.lock b/devtools/client/application/test/node/yarn.lock
new file mode 100644
index 0000000000..91f1c4660c
--- /dev/null
+++ b/devtools/client/application/test/node/yarn.lock
@@ -0,0 +1,3563 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@babel/code-frame@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8"
+ dependencies:
+ "@babel/highlight" "^7.0.0"
+
+"@babel/core@^7.1.0":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a"
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/generator" "^7.4.4"
+ "@babel/helpers" "^7.4.4"
+ "@babel/parser" "^7.4.5"
+ "@babel/template" "^7.4.4"
+ "@babel/traverse" "^7.4.5"
+ "@babel/types" "^7.4.4"
+ convert-source-map "^1.1.0"
+ debug "^4.1.0"
+ json5 "^2.1.0"
+ lodash "^4.17.11"
+ resolve "^1.3.2"
+ semver "^5.4.1"
+ source-map "^0.5.0"
+
+"@babel/generator@^7.4.0", "@babel/generator@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041"
+ dependencies:
+ "@babel/types" "^7.4.4"
+ jsesc "^2.5.1"
+ lodash "^4.17.11"
+ source-map "^0.5.0"
+ trim-right "^1.0.1"
+
+"@babel/helper-annotate-as-pure@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32"
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-function-name@^7.1.0":
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53"
+ dependencies:
+ "@babel/helper-get-function-arity" "^7.0.0"
+ "@babel/template" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-get-function-arity@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3"
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-plugin-utils@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250"
+
+"@babel/helper-remap-async-to-generator@^7.1.0":
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f"
+ dependencies:
+ "@babel/helper-annotate-as-pure" "^7.0.0"
+ "@babel/helper-wrap-function" "^7.1.0"
+ "@babel/template" "^7.1.0"
+ "@babel/traverse" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@babel/helper-split-export-declaration@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677"
+ dependencies:
+ "@babel/types" "^7.4.4"
+
+"@babel/helper-wrap-function@^7.1.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa"
+ dependencies:
+ "@babel/helper-function-name" "^7.1.0"
+ "@babel/template" "^7.1.0"
+ "@babel/traverse" "^7.1.0"
+ "@babel/types" "^7.2.0"
+
+"@babel/helpers@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5"
+ dependencies:
+ "@babel/template" "^7.4.4"
+ "@babel/traverse" "^7.4.4"
+ "@babel/types" "^7.4.4"
+
+"@babel/highlight@^7.0.0":
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4"
+ dependencies:
+ chalk "^2.0.0"
+ esutils "^2.0.2"
+ js-tokens "^4.0.0"
+
+"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872"
+
+"@babel/plugin-proposal-async-generator-functions@^7.2.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e"
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+ "@babel/helper-remap-async-to-generator" "^7.1.0"
+ "@babel/plugin-syntax-async-generators" "^7.2.0"
+
+"@babel/plugin-syntax-async-generators@^7.2.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f"
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+
+"@babel/plugin-syntax-object-rest-spread@^7.0.0":
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e"
+ dependencies:
+ "@babel/helper-plugin-utils" "^7.0.0"
+
+"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/parser" "^7.4.4"
+ "@babel/types" "^7.4.4"
+
+"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5":
+ version "7.4.5"
+ resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216"
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@babel/generator" "^7.4.4"
+ "@babel/helper-function-name" "^7.1.0"
+ "@babel/helper-split-export-declaration" "^7.4.4"
+ "@babel/parser" "^7.4.5"
+ "@babel/types" "^7.4.4"
+ debug "^4.1.0"
+ globals "^11.1.0"
+ lodash "^4.17.11"
+
+"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4":
+ version "7.4.4"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0"
+ dependencies:
+ esutils "^2.0.2"
+ lodash "^4.17.11"
+ to-fast-properties "^2.0.0"
+
+"@cnakazawa/watch@^1.0.3":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef"
+ dependencies:
+ exec-sh "^0.3.2"
+ minimist "^1.2.0"
+
+"@jest/console@^24.7.1":
+ version "24.7.1"
+ resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"
+ dependencies:
+ "@jest/source-map" "^24.3.0"
+ chalk "^2.0.1"
+ slash "^2.0.0"
+
+"@jest/core@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b"
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/reporters" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ graceful-fs "^4.1.15"
+ jest-changed-files "^24.8.0"
+ jest-config "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve-dependencies "^24.8.0"
+ jest-runner "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ jest-watcher "^24.8.0"
+ micromatch "^3.1.10"
+ p-each-series "^1.0.0"
+ pirates "^4.0.1"
+ realpath-native "^1.1.0"
+ rimraf "^2.5.4"
+ strip-ansi "^5.0.0"
+
+"@jest/environment@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac"
+ dependencies:
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+
+"@jest/fake-timers@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-mock "^24.8.0"
+
+"@jest/reporters@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729"
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ glob "^7.1.2"
+ istanbul-lib-coverage "^2.0.2"
+ istanbul-lib-instrument "^3.0.1"
+ istanbul-lib-report "^2.0.4"
+ istanbul-lib-source-maps "^3.0.1"
+ istanbul-reports "^2.1.1"
+ jest-haste-map "^24.8.0"
+ jest-resolve "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ node-notifier "^5.2.1"
+ slash "^2.0.0"
+ source-map "^0.6.0"
+ string-length "^2.0.0"
+
+"@jest/source-map@^24.3.0":
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28"
+ dependencies:
+ callsites "^3.0.0"
+ graceful-fs "^4.1.15"
+ source-map "^0.6.0"
+
+"@jest/test-result@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3"
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/types" "^24.8.0"
+ "@types/istanbul-lib-coverage" "^2.0.0"
+
+"@jest/test-sequencer@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b"
+ dependencies:
+ "@jest/test-result" "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-runner "^24.8.0"
+ jest-runtime "^24.8.0"
+
+"@jest/transform@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5"
+ dependencies:
+ "@babel/core" "^7.1.0"
+ "@jest/types" "^24.8.0"
+ babel-plugin-istanbul "^5.1.0"
+ chalk "^2.0.1"
+ convert-source-map "^1.4.0"
+ fast-json-stable-stringify "^2.0.0"
+ graceful-fs "^4.1.15"
+ jest-haste-map "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-util "^24.8.0"
+ micromatch "^3.1.10"
+ realpath-native "^1.1.0"
+ slash "^2.0.0"
+ source-map "^0.6.1"
+ write-file-atomic "2.4.1"
+
+"@jest/types@^24.8.0":
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad"
+ dependencies:
+ "@types/istanbul-lib-coverage" "^2.0.0"
+ "@types/istanbul-reports" "^1.1.1"
+ "@types/yargs" "^12.0.9"
+
+"@types/babel__core@^7.1.0":
+ version "7.1.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f"
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+ "@types/babel__generator" "*"
+ "@types/babel__template" "*"
+ "@types/babel__traverse" "*"
+
+"@types/babel__generator@*":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc"
+ dependencies:
+ "@babel/types" "^7.0.0"
+
+"@types/babel__template@*":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307"
+ dependencies:
+ "@babel/parser" "^7.1.0"
+ "@babel/types" "^7.0.0"
+
+"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6":
+ version "7.0.7"
+ resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f"
+ dependencies:
+ "@babel/types" "^7.3.0"
+
+"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
+
+"@types/istanbul-lib-report@*":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c"
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+
+"@types/istanbul-reports@^1.1.1":
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a"
+ dependencies:
+ "@types/istanbul-lib-coverage" "*"
+ "@types/istanbul-lib-report" "*"
+
+"@types/node@*":
+ version "12.0.8"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.8.tgz#551466be11b2adc3f3d47156758f610bd9f6b1d8"
+
+"@types/stack-utils@^1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
+
+"@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
+ version "12.0.12"
+ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"
+
+abab@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f"
+
+abbrev@1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
+
+acorn-globals@^4.1.0:
+ version "4.3.2"
+ resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006"
+ dependencies:
+ acorn "^6.0.1"
+ acorn-walk "^6.0.1"
+
+acorn-walk@^6.0.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913"
+
+acorn@^5.5.3:
+ version "5.7.3"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
+
+acorn@^6.0.1:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f"
+
+airbnb-prop-types@^2.13.2:
+ version "2.13.2"
+ resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc"
+ dependencies:
+ array.prototype.find "^2.0.4"
+ function.prototype.name "^1.1.0"
+ has "^1.0.3"
+ is-regex "^1.0.4"
+ object-is "^1.0.1"
+ object.assign "^4.1.0"
+ object.entries "^1.1.0"
+ prop-types "^15.7.2"
+ prop-types-exact "^1.2.0"
+ react-is "^16.8.6"
+
+ajv@^6.5.5:
+ version "6.10.0"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
+ dependencies:
+ fast-deep-equal "^2.0.1"
+ fast-json-stable-stringify "^2.0.0"
+ json-schema-traverse "^0.4.1"
+ uri-js "^4.2.2"
+
+ansi-escapes@^3.0.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
+
+ansi-regex@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
+
+ansi-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
+
+ansi-regex@^4.0.0, ansi-regex@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
+
+ansi-styles@^3.2.0, ansi-styles@^3.2.1:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
+ dependencies:
+ color-convert "^1.9.0"
+
+anymatch@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
+ dependencies:
+ micromatch "^3.1.4"
+ normalize-path "^2.1.1"
+
+aproba@^1.0.3:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
+
+are-we-there-yet@~1.1.2:
+ version "1.1.5"
+ resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
+ dependencies:
+ delegates "^1.0.0"
+ readable-stream "^2.0.6"
+
+arr-diff@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
+
+arr-flatten@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
+
+arr-union@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
+
+array-equal@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
+
+array-filter@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
+
+array-unique@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
+
+array.prototype.find@^2.0.4:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7"
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.13.0"
+
+array.prototype.flat@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4"
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.10.0"
+ function-bind "^1.1.1"
+
+asap@~2.0.3:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
+
+asn1@~0.2.3:
+ version "0.2.4"
+ resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
+ dependencies:
+ safer-buffer "~2.1.0"
+
+assert-plus@1.0.0, assert-plus@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
+
+assign-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
+
+astral-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
+
+async-limiter@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
+
+asynckit@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
+
+atob@^2.1.1:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
+
+aws-sign2@~0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
+
+aws4@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
+
+babel-jest@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589"
+ dependencies:
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/babel__core" "^7.1.0"
+ babel-plugin-istanbul "^5.1.0"
+ babel-preset-jest "^24.6.0"
+ chalk "^2.4.2"
+ slash "^2.0.0"
+
+babel-plugin-istanbul@^5.1.0:
+ version "5.1.4"
+ resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba"
+ dependencies:
+ find-up "^3.0.0"
+ istanbul-lib-instrument "^3.3.0"
+ test-exclude "^5.2.3"
+
+babel-plugin-jest-hoist@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019"
+ dependencies:
+ "@types/babel__traverse" "^7.0.6"
+
+babel-preset-jest@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984"
+ dependencies:
+ "@babel/plugin-syntax-object-rest-spread" "^7.0.0"
+ babel-plugin-jest-hoist "^24.6.0"
+
+balanced-match@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
+
+base@^0.11.1:
+ version "0.11.2"
+ resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
+ dependencies:
+ cache-base "^1.0.1"
+ class-utils "^0.3.5"
+ component-emitter "^1.2.1"
+ define-property "^1.0.0"
+ isobject "^3.0.1"
+ mixin-deep "^1.2.0"
+ pascalcase "^0.1.1"
+
+bcrypt-pbkdf@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
+ dependencies:
+ tweetnacl "^0.14.3"
+
+boolbase@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
+
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+braces@^2.3.1:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
+ dependencies:
+ arr-flatten "^1.1.0"
+ array-unique "^0.3.2"
+ extend-shallow "^2.0.1"
+ fill-range "^4.0.0"
+ isobject "^3.0.1"
+ repeat-element "^1.1.2"
+ snapdragon "^0.8.1"
+ snapdragon-node "^2.0.1"
+ split-string "^3.0.2"
+ to-regex "^3.0.1"
+
+browser-process-hrtime@^0.1.2:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4"
+
+browser-resolve@^1.11.3:
+ version "1.11.3"
+ resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6"
+ dependencies:
+ resolve "1.1.7"
+
+bser@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
+ dependencies:
+ node-int64 "^0.4.0"
+
+buffer-from@^1.0.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
+
+cache-base@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
+ dependencies:
+ collection-visit "^1.0.0"
+ component-emitter "^1.2.1"
+ get-value "^2.0.6"
+ has-value "^1.0.0"
+ isobject "^3.0.1"
+ set-value "^2.0.0"
+ to-object-path "^0.3.0"
+ union-value "^1.0.0"
+ unset-value "^1.0.0"
+
+callsites@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
+
+camelcase@^5.0.0:
+ version "5.3.1"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
+
+capture-exit@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4"
+ dependencies:
+ rsvp "^4.8.4"
+
+caseless@~0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
+
+chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
+ dependencies:
+ ansi-styles "^3.2.1"
+ escape-string-regexp "^1.0.5"
+ supports-color "^5.3.0"
+
+cheerio@^1.0.0-rc.2:
+ version "1.0.0-rc.3"
+ resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6"
+ dependencies:
+ css-select "~1.2.0"
+ dom-serializer "~0.1.1"
+ entities "~1.1.1"
+ htmlparser2 "^3.9.1"
+ lodash "^4.15.0"
+ parse5 "^3.0.1"
+
+chownr@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494"
+
+ci-info@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
+
+class-utils@^0.3.5:
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
+ dependencies:
+ arr-union "^3.1.0"
+ define-property "^0.2.5"
+ isobject "^3.0.0"
+ static-extend "^0.1.1"
+
+cliui@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
+ dependencies:
+ string-width "^2.1.1"
+ strip-ansi "^4.0.0"
+ wrap-ansi "^2.0.0"
+
+co@^4.6.0:
+ version "4.6.0"
+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
+
+code-point-at@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
+
+collection-visit@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
+ dependencies:
+ map-visit "^1.0.0"
+ object-visit "^1.0.0"
+
+color-convert@^1.9.0:
+ version "1.9.3"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
+ dependencies:
+ color-name "1.1.3"
+
+color-name@1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
+
+combined-stream@^1.0.6, combined-stream@~1.0.6:
+ version "1.0.8"
+ resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
+ dependencies:
+ delayed-stream "~1.0.0"
+
+commander@^2.19.0, commander@~2.20.0:
+ version "2.20.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
+
+component-emitter@^1.2.1:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+
+console-control-strings@^1.0.0, console-control-strings@~1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
+
+convert-source-map@^1.1.0, convert-source-map@^1.4.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20"
+ dependencies:
+ safe-buffer "~5.1.1"
+
+copy-descriptor@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
+
+core-js@^1.0.0:
+ version "1.2.7"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
+
+core-util-is@1.0.2, core-util-is@~1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
+
+cross-spawn@^6.0.0:
+ version "6.0.5"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
+ dependencies:
+ nice-try "^1.0.4"
+ path-key "^2.0.1"
+ semver "^5.5.0"
+ shebang-command "^1.2.0"
+ which "^1.2.9"
+
+css-select@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
+ dependencies:
+ boolbase "~1.0.0"
+ css-what "2.1"
+ domutils "1.5.1"
+ nth-check "~1.0.1"
+
+css-what@2.1:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
+
+cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad"
+
+cssstyle@^1.0.0:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077"
+ dependencies:
+ cssom "0.3.x"
+
+dashdash@^1.12.0:
+ version "1.14.1"
+ resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
+ dependencies:
+ assert-plus "^1.0.0"
+
+data-urls@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe"
+ dependencies:
+ abab "^2.0.0"
+ whatwg-mimetype "^2.2.0"
+ whatwg-url "^7.0.0"
+
+debug@^2.2.0, debug@^2.3.3:
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+ dependencies:
+ ms "2.0.0"
+
+debug@^3.2.6:
+ version "3.2.6"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
+ dependencies:
+ ms "^2.1.1"
+
+debug@^4.1.0, debug@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
+ dependencies:
+ ms "^2.1.1"
+
+decamelize@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
+
+decode-uri-component@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
+
+deep-extend@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
+
+deep-is@~0.1.3:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
+
+define-properties@^1.1.2, define-properties@^1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
+ dependencies:
+ object-keys "^1.0.12"
+
+define-property@^0.2.5:
+ version "0.2.5"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
+ dependencies:
+ is-descriptor "^0.1.0"
+
+define-property@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
+ dependencies:
+ is-descriptor "^1.0.0"
+
+define-property@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
+ dependencies:
+ is-descriptor "^1.0.2"
+ isobject "^3.0.1"
+
+delayed-stream@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
+
+delegates@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
+
+detect-libc@^1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
+
+detect-newline@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2"
+
+diff-sequences@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975"
+
+discontinuous-range@1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a"
+
+dom-serializer@0, dom-serializer@~0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
+ dependencies:
+ domelementtype "^1.3.0"
+ entities "^1.1.1"
+
+domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
+
+domexception@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"
+ dependencies:
+ webidl-conversions "^4.0.2"
+
+domhandler@^2.3.0:
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
+ dependencies:
+ domelementtype "1"
+
+domutils@1.5.1, domutils@^1.5.1:
+ version "1.5.1"
+ resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
+ dependencies:
+ dom-serializer "0"
+ domelementtype "1"
+
+ecc-jsbn@~0.1.1:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
+ dependencies:
+ jsbn "~0.1.0"
+ safer-buffer "^2.1.0"
+
+encoding@^0.1.11:
+ version "0.1.12"
+ resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
+ dependencies:
+ iconv-lite "~0.4.13"
+
+end-of-stream@^1.1.0:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
+ dependencies:
+ once "^1.4.0"
+
+entities@^1.1.1, entities@~1.1.1:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
+
+enzyme-adapter-react-16@^1.13.2:
+ version "1.14.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.14.0.tgz#204722b769172bcf096cb250d33e6795c1f1858f"
+ dependencies:
+ enzyme-adapter-utils "^1.12.0"
+ has "^1.0.3"
+ object.assign "^4.1.0"
+ object.values "^1.1.0"
+ prop-types "^15.7.2"
+ react-is "^16.8.6"
+ react-test-renderer "^16.0.0-0"
+ semver "^5.7.0"
+
+enzyme-adapter-utils@^1.12.0:
+ version "1.12.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93"
+ dependencies:
+ airbnb-prop-types "^2.13.2"
+ function.prototype.name "^1.1.0"
+ object.assign "^4.1.0"
+ object.fromentries "^2.0.0"
+ prop-types "^15.7.2"
+ semver "^5.6.0"
+
+enzyme-to-json@^3.3.5:
+ version "3.3.5"
+ resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.5.tgz#f8eb82bd3d5941c9d8bc6fd9140030777d17d0af"
+ dependencies:
+ lodash "^4.17.4"
+
+enzyme@^3.9.0:
+ version "3.10.0"
+ resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.10.0.tgz#7218e347c4a7746e133f8e964aada4a3523452f6"
+ dependencies:
+ array.prototype.flat "^1.2.1"
+ cheerio "^1.0.0-rc.2"
+ function.prototype.name "^1.1.0"
+ has "^1.0.3"
+ html-element-map "^1.0.0"
+ is-boolean-object "^1.0.0"
+ is-callable "^1.1.4"
+ is-number-object "^1.0.3"
+ is-regex "^1.0.4"
+ is-string "^1.0.4"
+ is-subset "^0.1.1"
+ lodash.escape "^4.0.1"
+ lodash.isequal "^4.5.0"
+ object-inspect "^1.6.0"
+ object-is "^1.0.1"
+ object.assign "^4.1.0"
+ object.entries "^1.0.4"
+ object.values "^1.0.4"
+ raf "^3.4.0"
+ rst-selector-parser "^2.2.3"
+ string.prototype.trim "^1.1.2"
+
+error-ex@^1.3.1:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
+ dependencies:
+ is-arrayish "^0.2.1"
+
+es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13.0, es-abstract@^1.5.0, es-abstract@^1.5.1:
+ version "1.13.0"
+ resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
+ dependencies:
+ es-to-primitive "^1.2.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+ is-callable "^1.1.4"
+ is-regex "^1.0.4"
+ object-keys "^1.0.12"
+
+es-to-primitive@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377"
+ dependencies:
+ is-callable "^1.1.4"
+ is-date-object "^1.0.1"
+ is-symbol "^1.0.2"
+
+escape-string-regexp@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+
+escodegen@^1.9.1:
+ version "1.11.1"
+ resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510"
+ dependencies:
+ esprima "^3.1.3"
+ estraverse "^4.2.0"
+ esutils "^2.0.2"
+ optionator "^0.8.1"
+ optionalDependencies:
+ source-map "~0.6.1"
+
+esprima@^3.1.3:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
+
+estraverse@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
+
+esutils@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
+
+exec-sh@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b"
+
+execa@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
+ dependencies:
+ cross-spawn "^6.0.0"
+ get-stream "^4.0.0"
+ is-stream "^1.1.0"
+ npm-run-path "^2.0.0"
+ p-finally "^1.0.0"
+ signal-exit "^3.0.0"
+ strip-eof "^1.0.0"
+
+exit@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
+
+expand-brackets@^2.1.4:
+ version "2.1.4"
+ resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
+ dependencies:
+ debug "^2.3.3"
+ define-property "^0.2.5"
+ extend-shallow "^2.0.1"
+ posix-character-classes "^0.1.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+expect@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ ansi-styles "^3.2.0"
+ jest-get-type "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-regex-util "^24.3.0"
+
+extend-shallow@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
+ dependencies:
+ is-extendable "^0.1.0"
+
+extend-shallow@^3.0.0, extend-shallow@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
+ dependencies:
+ assign-symbols "^1.0.0"
+ is-extendable "^1.0.1"
+
+extend@~3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
+
+extglob@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
+ dependencies:
+ array-unique "^0.3.2"
+ define-property "^1.0.0"
+ expand-brackets "^2.1.4"
+ extend-shallow "^2.0.1"
+ fragment-cache "^0.2.1"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+extsprintf@1.3.0, extsprintf@^1.2.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
+
+fast-deep-equal@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
+
+fast-json-stable-stringify@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
+
+fast-levenshtein@~2.0.4:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
+
+fb-watchman@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58"
+ dependencies:
+ bser "^2.0.0"
+
+fbjs@^0.8.16:
+ version "0.8.17"
+ resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
+ dependencies:
+ core-js "^1.0.0"
+ isomorphic-fetch "^2.1.1"
+ loose-envify "^1.0.0"
+ object-assign "^4.1.0"
+ promise "^7.1.1"
+ setimmediate "^1.0.5"
+ ua-parser-js "^0.7.18"
+
+fill-range@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-number "^3.0.0"
+ repeat-string "^1.6.1"
+ to-regex-range "^2.1.0"
+
+find-up@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
+ dependencies:
+ locate-path "^3.0.0"
+
+for-in@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
+
+forever-agent@~0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
+
+form-data@~2.3.2:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
+ dependencies:
+ asynckit "^0.4.0"
+ combined-stream "^1.0.6"
+ mime-types "^2.1.12"
+
+fragment-cache@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
+ dependencies:
+ map-cache "^0.2.2"
+
+fs-minipass@^1.2.5:
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07"
+ dependencies:
+ minipass "^2.2.1"
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+
+fsevents@^1.2.7:
+ version "1.2.9"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f"
+ dependencies:
+ nan "^2.12.1"
+ node-pre-gyp "^0.12.0"
+
+function-bind@^1.0.2, function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+
+function.prototype.name@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327"
+ dependencies:
+ define-properties "^1.1.2"
+ function-bind "^1.1.1"
+ is-callable "^1.1.3"
+
+gauge@~2.7.3:
+ version "2.7.4"
+ resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
+ dependencies:
+ aproba "^1.0.3"
+ console-control-strings "^1.0.0"
+ has-unicode "^2.0.0"
+ object-assign "^4.1.0"
+ signal-exit "^3.0.0"
+ string-width "^1.0.1"
+ strip-ansi "^3.0.1"
+ wide-align "^1.1.0"
+
+get-caller-file@^1.0.1:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
+
+get-stream@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
+ dependencies:
+ pump "^3.0.0"
+
+get-value@^2.0.3, get-value@^2.0.6:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
+
+getpass@^0.1.1:
+ version "0.1.7"
+ resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
+ dependencies:
+ assert-plus "^1.0.0"
+
+glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
+ version "7.1.4"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
+globals@^11.1.0:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
+
+graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:
+ version "4.1.15"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
+
+growly@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
+
+handlebars@^4.1.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67"
+ dependencies:
+ neo-async "^2.6.0"
+ optimist "^0.6.1"
+ source-map "^0.6.1"
+ optionalDependencies:
+ uglify-js "^3.1.4"
+
+har-schema@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
+
+har-validator@~5.1.0:
+ version "5.1.3"
+ resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
+ dependencies:
+ ajv "^6.5.5"
+ har-schema "^2.0.0"
+
+has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+
+has-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
+
+has-unicode@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
+
+has-value@^0.3.1:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
+ dependencies:
+ get-value "^2.0.3"
+ has-values "^0.1.4"
+ isobject "^2.0.0"
+
+has-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
+ dependencies:
+ get-value "^2.0.6"
+ has-values "^1.0.0"
+ isobject "^3.0.0"
+
+has-values@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
+
+has-values@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
+ dependencies:
+ is-number "^3.0.0"
+ kind-of "^4.0.0"
+
+has@^1.0.1, has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ dependencies:
+ function-bind "^1.1.1"
+
+hosted-git-info@^2.1.4:
+ version "2.7.1"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
+
+html-element-map@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.1.tgz#3c4fcb4874ebddfe4283b51c8994e7713782b592"
+ dependencies:
+ array-filter "^1.0.0"
+
+html-encoding-sniffer@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
+ dependencies:
+ whatwg-encoding "^1.0.1"
+
+htmlparser2@^3.9.1:
+ version "3.10.1"
+ resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
+ dependencies:
+ domelementtype "^1.3.1"
+ domhandler "^2.3.0"
+ domutils "^1.5.1"
+ entities "^1.1.1"
+ inherits "^2.0.1"
+ readable-stream "^3.1.1"
+
+http-signature@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
+ dependencies:
+ assert-plus "^1.0.0"
+ jsprim "^1.2.2"
+ sshpk "^1.7.0"
+
+iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
+ version "0.4.24"
+ resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+ dependencies:
+ safer-buffer ">= 2.1.2 < 3"
+
+ignore-walk@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8"
+ dependencies:
+ minimatch "^3.0.4"
+
+import-local@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d"
+ dependencies:
+ pkg-dir "^3.0.0"
+ resolve-cwd "^2.0.0"
+
+imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+
+inflight@^1.0.4:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
+ dependencies:
+ once "^1.3.0"
+ wrappy "1"
+
+inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
+
+ini@~1.3.0:
+ version "1.3.5"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
+
+invariant@^2.2.4:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
+ dependencies:
+ loose-envify "^1.0.0"
+
+invert-kv@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
+
+is-accessor-descriptor@^0.1.6:
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
+ dependencies:
+ kind-of "^3.0.2"
+
+is-accessor-descriptor@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
+ dependencies:
+ kind-of "^6.0.0"
+
+is-arrayish@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
+
+is-boolean-object@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93"
+
+is-buffer@^1.1.5:
+ version "1.1.6"
+ resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
+
+is-callable@^1.1.3, is-callable@^1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
+
+is-ci@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
+ dependencies:
+ ci-info "^2.0.0"
+
+is-data-descriptor@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
+ dependencies:
+ kind-of "^3.0.2"
+
+is-data-descriptor@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
+ dependencies:
+ kind-of "^6.0.0"
+
+is-date-object@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
+
+is-descriptor@^0.1.0:
+ version "0.1.6"
+ resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
+ dependencies:
+ is-accessor-descriptor "^0.1.6"
+ is-data-descriptor "^0.1.4"
+ kind-of "^5.0.0"
+
+is-descriptor@^1.0.0, is-descriptor@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
+ dependencies:
+ is-accessor-descriptor "^1.0.0"
+ is-data-descriptor "^1.0.0"
+ kind-of "^6.0.2"
+
+is-extendable@^0.1.0, is-extendable@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
+
+is-extendable@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
+ dependencies:
+ is-plain-object "^2.0.4"
+
+is-fullwidth-code-point@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
+ dependencies:
+ number-is-nan "^1.0.0"
+
+is-fullwidth-code-point@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
+
+is-generator-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118"
+
+is-number-object@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799"
+
+is-number@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
+ dependencies:
+ kind-of "^3.0.2"
+
+is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
+ dependencies:
+ isobject "^3.0.1"
+
+is-regex@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
+ dependencies:
+ has "^1.0.1"
+
+is-stream@^1.0.1, is-stream@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
+
+is-string@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64"
+
+is-subset@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6"
+
+is-symbol@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
+ dependencies:
+ has-symbols "^1.0.0"
+
+is-typedarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
+
+is-windows@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
+
+is-wsl@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
+
+isarray@1.0.0, isarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
+
+isexe@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
+
+isobject@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
+ dependencies:
+ isarray "1.0.0"
+
+isobject@^3.0.0, isobject@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
+
+isomorphic-fetch@^2.1.1:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
+ dependencies:
+ node-fetch "^1.0.1"
+ whatwg-fetch ">=0.10.0"
+
+isstream@~0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
+
+istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49"
+
+istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630"
+ dependencies:
+ "@babel/generator" "^7.4.0"
+ "@babel/parser" "^7.4.3"
+ "@babel/template" "^7.4.0"
+ "@babel/traverse" "^7.4.3"
+ "@babel/types" "^7.4.0"
+ istanbul-lib-coverage "^2.0.5"
+ semver "^6.0.0"
+
+istanbul-lib-report@^2.0.4:
+ version "2.0.8"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33"
+ dependencies:
+ istanbul-lib-coverage "^2.0.5"
+ make-dir "^2.1.0"
+ supports-color "^6.1.0"
+
+istanbul-lib-source-maps@^3.0.1:
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8"
+ dependencies:
+ debug "^4.1.1"
+ istanbul-lib-coverage "^2.0.5"
+ make-dir "^2.1.0"
+ rimraf "^2.6.3"
+ source-map "^0.6.1"
+
+istanbul-reports@^2.1.1:
+ version "2.2.6"
+ resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af"
+ dependencies:
+ handlebars "^4.1.2"
+
+jest-changed-files@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ execa "^1.0.0"
+ throat "^4.0.0"
+
+jest-cli@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989"
+ dependencies:
+ "@jest/core" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ import-local "^2.0.0"
+ is-ci "^2.0.0"
+ jest-config "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ prompts "^2.0.1"
+ realpath-native "^1.1.0"
+ yargs "^12.0.2"
+
+jest-config@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f"
+ dependencies:
+ "@babel/core" "^7.1.0"
+ "@jest/test-sequencer" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ babel-jest "^24.8.0"
+ chalk "^2.0.1"
+ glob "^7.1.1"
+ jest-environment-jsdom "^24.8.0"
+ jest-environment-node "^24.8.0"
+ jest-get-type "^24.8.0"
+ jest-jasmine2 "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ micromatch "^3.1.10"
+ pretty-format "^24.8.0"
+ realpath-native "^1.1.0"
+
+jest-diff@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172"
+ dependencies:
+ chalk "^2.0.1"
+ diff-sequences "^24.3.0"
+ jest-get-type "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-docblock@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd"
+ dependencies:
+ detect-newline "^2.1.0"
+
+jest-each@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ jest-get-type "^24.8.0"
+ jest-util "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-environment-jsdom@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857"
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-util "^24.8.0"
+ jsdom "^11.5.1"
+
+jest-environment-node@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231"
+ dependencies:
+ "@jest/environment" "^24.8.0"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-util "^24.8.0"
+
+jest-get-type@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc"
+
+jest-haste-map@^24.8.0:
+ version "24.8.1"
+ resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ anymatch "^2.0.0"
+ fb-watchman "^2.0.0"
+ graceful-fs "^4.1.15"
+ invariant "^2.2.4"
+ jest-serializer "^24.4.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ micromatch "^3.1.10"
+ sane "^4.0.3"
+ walker "^1.0.7"
+ optionalDependencies:
+ fsevents "^1.2.7"
+
+jest-jasmine2@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898"
+ dependencies:
+ "@babel/traverse" "^7.1.0"
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ co "^4.6.0"
+ expect "^24.8.0"
+ is-generator-fn "^2.0.0"
+ jest-each "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ pretty-format "^24.8.0"
+ throat "^4.0.0"
+
+jest-leak-detector@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980"
+ dependencies:
+ pretty-format "^24.8.0"
+
+jest-matcher-utils@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495"
+ dependencies:
+ chalk "^2.0.1"
+ jest-diff "^24.8.0"
+ jest-get-type "^24.8.0"
+ pretty-format "^24.8.0"
+
+jest-message-util@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b"
+ dependencies:
+ "@babel/code-frame" "^7.0.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/stack-utils" "^1.0.1"
+ chalk "^2.0.1"
+ micromatch "^3.1.10"
+ slash "^2.0.0"
+ stack-utils "^1.0.1"
+
+jest-mock@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56"
+ dependencies:
+ "@jest/types" "^24.8.0"
+
+jest-pnp-resolver@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a"
+
+jest-regex-util@^24.3.0:
+ version "24.3.0"
+ resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36"
+
+jest-resolve-dependencies@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-snapshot "^24.8.0"
+
+jest-resolve@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ browser-resolve "^1.11.3"
+ chalk "^2.0.1"
+ jest-pnp-resolver "^1.2.1"
+ realpath-native "^1.1.0"
+
+jest-runner@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb"
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/environment" "^24.8.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.4.2"
+ exit "^0.1.2"
+ graceful-fs "^4.1.15"
+ jest-config "^24.8.0"
+ jest-docblock "^24.3.0"
+ jest-haste-map "^24.8.0"
+ jest-jasmine2 "^24.8.0"
+ jest-leak-detector "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-resolve "^24.8.0"
+ jest-runtime "^24.8.0"
+ jest-util "^24.8.0"
+ jest-worker "^24.6.0"
+ source-map-support "^0.5.6"
+ throat "^4.0.0"
+
+jest-runtime@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620"
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/environment" "^24.8.0"
+ "@jest/source-map" "^24.3.0"
+ "@jest/transform" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/yargs" "^12.0.2"
+ chalk "^2.0.1"
+ exit "^0.1.2"
+ glob "^7.1.3"
+ graceful-fs "^4.1.15"
+ jest-config "^24.8.0"
+ jest-haste-map "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-mock "^24.8.0"
+ jest-regex-util "^24.3.0"
+ jest-resolve "^24.8.0"
+ jest-snapshot "^24.8.0"
+ jest-util "^24.8.0"
+ jest-validate "^24.8.0"
+ realpath-native "^1.1.0"
+ slash "^2.0.0"
+ strip-bom "^3.0.0"
+ yargs "^12.0.2"
+
+jest-serializer@^24.4.0:
+ version "24.4.0"
+ resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3"
+
+jest-snapshot@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6"
+ dependencies:
+ "@babel/types" "^7.0.0"
+ "@jest/types" "^24.8.0"
+ chalk "^2.0.1"
+ expect "^24.8.0"
+ jest-diff "^24.8.0"
+ jest-matcher-utils "^24.8.0"
+ jest-message-util "^24.8.0"
+ jest-resolve "^24.8.0"
+ mkdirp "^0.5.1"
+ natural-compare "^1.4.0"
+ pretty-format "^24.8.0"
+ semver "^5.5.0"
+
+jest-util@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1"
+ dependencies:
+ "@jest/console" "^24.7.1"
+ "@jest/fake-timers" "^24.8.0"
+ "@jest/source-map" "^24.3.0"
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ callsites "^3.0.0"
+ chalk "^2.0.1"
+ graceful-fs "^4.1.15"
+ is-ci "^2.0.0"
+ mkdirp "^0.5.1"
+ slash "^2.0.0"
+ source-map "^0.6.0"
+
+jest-validate@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ camelcase "^5.0.0"
+ chalk "^2.0.1"
+ jest-get-type "^24.8.0"
+ leven "^2.1.0"
+ pretty-format "^24.8.0"
+
+jest-watcher@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4"
+ dependencies:
+ "@jest/test-result" "^24.8.0"
+ "@jest/types" "^24.8.0"
+ "@types/yargs" "^12.0.9"
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.1"
+ jest-util "^24.8.0"
+ string-length "^2.0.0"
+
+jest-worker@^24.6.0:
+ version "24.6.0"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3"
+ dependencies:
+ merge-stream "^1.0.1"
+ supports-color "^6.1.0"
+
+jest@^24.6:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081"
+ dependencies:
+ import-local "^2.0.0"
+ jest-cli "^24.8.0"
+
+"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
+
+jsbn@~0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
+
+jsdom@^11.5.1:
+ version "11.12.0"
+ resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8"
+ dependencies:
+ abab "^2.0.0"
+ acorn "^5.5.3"
+ acorn-globals "^4.1.0"
+ array-equal "^1.0.0"
+ cssom ">= 0.3.2 < 0.4.0"
+ cssstyle "^1.0.0"
+ data-urls "^1.0.0"
+ domexception "^1.0.1"
+ escodegen "^1.9.1"
+ html-encoding-sniffer "^1.0.2"
+ left-pad "^1.3.0"
+ nwsapi "^2.0.7"
+ parse5 "4.0.0"
+ pn "^1.1.0"
+ request "^2.87.0"
+ request-promise-native "^1.0.5"
+ sax "^1.2.4"
+ symbol-tree "^3.2.2"
+ tough-cookie "^2.3.4"
+ w3c-hr-time "^1.0.1"
+ webidl-conversions "^4.0.2"
+ whatwg-encoding "^1.0.3"
+ whatwg-mimetype "^2.1.0"
+ whatwg-url "^6.4.1"
+ ws "^5.2.0"
+ xml-name-validator "^3.0.0"
+
+jsesc@^2.5.1:
+ version "2.5.2"
+ resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
+
+json-parse-better-errors@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
+
+json-schema-traverse@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
+
+json-schema@0.2.3:
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
+
+json-stringify-safe@~5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
+
+json5@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850"
+ dependencies:
+ minimist "^1.2.0"
+
+jsprim@^1.2.2:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
+ dependencies:
+ assert-plus "1.0.0"
+ extsprintf "1.3.0"
+ json-schema "0.2.3"
+ verror "1.10.0"
+
+kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
+ dependencies:
+ is-buffer "^1.1.5"
+
+kind-of@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
+ dependencies:
+ is-buffer "^1.1.5"
+
+kind-of@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
+
+kind-of@^6.0.0, kind-of@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
+
+kleur@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
+
+lcid@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf"
+ dependencies:
+ invert-kv "^2.0.0"
+
+left-pad@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
+
+leven@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
+
+levn@~0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
+ dependencies:
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+
+load-json-file@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
+ dependencies:
+ graceful-fs "^4.1.2"
+ parse-json "^4.0.0"
+ pify "^3.0.0"
+ strip-bom "^3.0.0"
+
+locate-path@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
+ dependencies:
+ p-locate "^3.0.0"
+ path-exists "^3.0.0"
+
+lodash.escape@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98"
+
+lodash.flattendeep@^4.4.0:
+ version "4.4.0"
+ resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
+
+lodash.isequal@^4.5.0:
+ version "4.5.0"
+ resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
+
+lodash.isplainobject@^4.0.6:
+ version "4.0.6"
+ resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
+
+lodash.sortby@^4.7.0:
+ version "4.7.0"
+ resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
+
+lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.4:
+ version "4.17.11"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
+
+loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
+ dependencies:
+ js-tokens "^3.0.0 || ^4.0.0"
+
+make-dir@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
+ dependencies:
+ pify "^4.0.1"
+ semver "^5.6.0"
+
+makeerror@1.0.x:
+ version "1.0.11"
+ resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c"
+ dependencies:
+ tmpl "1.0.x"
+
+map-age-cleaner@^0.1.1:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
+ dependencies:
+ p-defer "^1.0.0"
+
+map-cache@^0.2.2:
+ version "0.2.2"
+ resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
+
+map-visit@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
+ dependencies:
+ object-visit "^1.0.0"
+
+mem@^4.0.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178"
+ dependencies:
+ map-age-cleaner "^0.1.1"
+ mimic-fn "^2.0.0"
+ p-is-promise "^2.0.0"
+
+merge-stream@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
+ dependencies:
+ readable-stream "^2.0.1"
+
+micromatch@^3.1.10, micromatch@^3.1.4:
+ version "3.1.10"
+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
+ dependencies:
+ arr-diff "^4.0.0"
+ array-unique "^0.3.2"
+ braces "^2.3.1"
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ extglob "^2.0.4"
+ fragment-cache "^0.2.1"
+ kind-of "^6.0.2"
+ nanomatch "^1.2.9"
+ object.pick "^1.3.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.2"
+
+mime-db@1.40.0:
+ version "1.40.0"
+ resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32"
+
+mime-types@^2.1.12, mime-types@~2.1.19:
+ version "2.1.24"
+ resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81"
+ dependencies:
+ mime-db "1.40.0"
+
+mimic-fn@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
+
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ dependencies:
+ brace-expansion "^1.1.7"
+
+minimist@0.0.8, minimist@~0.0.1:
+ version "0.0.8"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
+
+minimist@^1.1.1, minimist@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
+
+minipass@^2.2.1, minipass@^2.3.5:
+ version "2.3.5"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848"
+ dependencies:
+ safe-buffer "^5.1.2"
+ yallist "^3.0.0"
+
+minizlib@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614"
+ dependencies:
+ minipass "^2.2.1"
+
+mixin-deep@^1.2.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
+ dependencies:
+ for-in "^1.0.2"
+ is-extendable "^1.0.1"
+
+mkdirp@^0.5.0, mkdirp@^0.5.1:
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
+ dependencies:
+ minimist "0.0.8"
+
+moo@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
+
+ms@2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
+
+ms@^2.1.1:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
+
+nan@^2.12.1:
+ version "2.14.0"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
+
+nanomatch@^1.2.9:
+ version "1.2.13"
+ resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
+ dependencies:
+ arr-diff "^4.0.0"
+ array-unique "^0.3.2"
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ fragment-cache "^0.2.1"
+ is-windows "^1.0.2"
+ kind-of "^6.0.2"
+ object.pick "^1.3.0"
+ regex-not "^1.0.0"
+ snapdragon "^0.8.1"
+ to-regex "^3.0.1"
+
+natural-compare@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+
+nearley@^2.7.10:
+ version "2.16.0"
+ resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.16.0.tgz#77c297d041941d268290ec84b739d0ee297e83a7"
+ dependencies:
+ commander "^2.19.0"
+ moo "^0.4.3"
+ railroad-diagrams "^1.0.0"
+ randexp "0.4.6"
+ semver "^5.4.1"
+
+needle@^2.2.1:
+ version "2.4.0"
+ resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c"
+ dependencies:
+ debug "^3.2.6"
+ iconv-lite "^0.4.4"
+ sax "^1.2.4"
+
+neo-async@^2.6.0:
+ version "2.6.1"
+ resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
+
+nice-try@^1.0.4:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
+
+node-fetch@^1.0.1:
+ version "1.7.3"
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
+ dependencies:
+ encoding "^0.1.11"
+ is-stream "^1.0.1"
+
+node-int64@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
+
+node-modules-regexp@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40"
+
+node-notifier@^5.2.1:
+ version "5.4.0"
+ resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a"
+ dependencies:
+ growly "^1.3.0"
+ is-wsl "^1.1.0"
+ semver "^5.5.0"
+ shellwords "^0.1.1"
+ which "^1.3.0"
+
+node-pre-gyp@^0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149"
+ dependencies:
+ detect-libc "^1.0.2"
+ mkdirp "^0.5.1"
+ needle "^2.2.1"
+ nopt "^4.0.1"
+ npm-packlist "^1.1.6"
+ npmlog "^4.0.2"
+ rc "^1.2.7"
+ rimraf "^2.6.1"
+ semver "^5.3.0"
+ tar "^4"
+
+nopt@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
+ dependencies:
+ abbrev "1"
+ osenv "^0.1.4"
+
+normalize-package-data@^2.3.2:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
+ dependencies:
+ hosted-git-info "^2.1.4"
+ resolve "^1.10.0"
+ semver "2 || 3 || 4 || 5"
+ validate-npm-package-license "^3.0.1"
+
+normalize-path@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
+ dependencies:
+ remove-trailing-separator "^1.0.1"
+
+npm-bundled@^1.0.1:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd"
+
+npm-packlist@^1.1.6:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc"
+ dependencies:
+ ignore-walk "^3.0.1"
+ npm-bundled "^1.0.1"
+
+npm-run-path@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
+ dependencies:
+ path-key "^2.0.0"
+
+npmlog@^4.0.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
+ dependencies:
+ are-we-there-yet "~1.1.2"
+ console-control-strings "~1.1.0"
+ gauge "~2.7.3"
+ set-blocking "~2.0.0"
+
+nth-check@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
+ dependencies:
+ boolbase "~1.0.0"
+
+number-is-nan@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
+
+nwsapi@^2.0.7:
+ version "2.1.4"
+ resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f"
+
+oauth-sign@~0.9.0:
+ version "0.9.0"
+ resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
+
+object-assign@^4.1.0, object-assign@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
+
+object-copy@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
+ dependencies:
+ copy-descriptor "^0.1.0"
+ define-property "^0.2.5"
+ kind-of "^3.0.3"
+
+object-inspect@^1.6.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
+
+object-is@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6"
+
+object-keys@^1.0.11, object-keys@^1.0.12:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
+
+object-visit@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
+ dependencies:
+ isobject "^3.0.0"
+
+object.assign@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
+ dependencies:
+ define-properties "^1.1.2"
+ function-bind "^1.1.1"
+ has-symbols "^1.0.0"
+ object-keys "^1.0.11"
+
+object.entries@^1.0.4, object.entries@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.12.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
+object.fromentries@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.11.0"
+ function-bind "^1.1.1"
+ has "^1.0.1"
+
+object.getownpropertydescriptors@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.1"
+
+object.pick@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
+ dependencies:
+ isobject "^3.0.1"
+
+object.values@^1.0.4, object.values@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9"
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.12.0"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
+once@^1.3.0, once@^1.3.1, once@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ dependencies:
+ wrappy "1"
+
+optimist@^0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
+ dependencies:
+ minimist "~0.0.1"
+ wordwrap "~0.0.2"
+
+optionator@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
+ dependencies:
+ deep-is "~0.1.3"
+ fast-levenshtein "~2.0.4"
+ levn "~0.3.0"
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+ wordwrap "~1.0.0"
+
+os-homedir@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
+
+os-locale@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
+ dependencies:
+ execa "^1.0.0"
+ lcid "^2.0.0"
+ mem "^4.0.0"
+
+os-tmpdir@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
+
+osenv@^0.1.4:
+ version "0.1.5"
+ resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
+ dependencies:
+ os-homedir "^1.0.0"
+ os-tmpdir "^1.0.0"
+
+p-defer@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
+
+p-each-series@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71"
+ dependencies:
+ p-reduce "^1.0.0"
+
+p-finally@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
+
+p-is-promise@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
+
+p-limit@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
+ dependencies:
+ p-try "^2.0.0"
+
+p-locate@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
+ dependencies:
+ p-limit "^2.0.0"
+
+p-reduce@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa"
+
+p-try@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
+
+parse-json@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
+ dependencies:
+ error-ex "^1.3.1"
+ json-parse-better-errors "^1.0.1"
+
+parse5@4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
+
+parse5@^3.0.1:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c"
+ dependencies:
+ "@types/node" "*"
+
+pascalcase@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
+
+path-exists@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
+
+path-is-absolute@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+
+path-key@^2.0.0, path-key@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
+
+path-parse@^1.0.6:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
+
+path-type@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
+ dependencies:
+ pify "^3.0.0"
+
+performance-now@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
+
+pify@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
+
+pify@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
+
+pirates@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"
+ dependencies:
+ node-modules-regexp "^1.0.0"
+
+pkg-dir@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
+ dependencies:
+ find-up "^3.0.0"
+
+pn@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
+
+posix-character-classes@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
+
+prelude-ls@~1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
+
+pretty-format@^24.8.0:
+ version "24.8.0"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
+ dependencies:
+ "@jest/types" "^24.8.0"
+ ansi-regex "^4.0.0"
+ ansi-styles "^3.2.0"
+ react-is "^16.8.4"
+
+process-nextick-args@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
+
+promise@^7.1.1:
+ version "7.3.1"
+ resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
+ dependencies:
+ asap "~2.0.3"
+
+prompts@^2.0.1:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db"
+ dependencies:
+ kleur "^3.0.2"
+ sisteransi "^1.0.0"
+
+prop-types-exact@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869"
+ dependencies:
+ has "^1.0.3"
+ object.assign "^4.1.0"
+ reflect.ownkeys "^0.2.0"
+
+prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:
+ version "15.7.2"
+ resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
+ dependencies:
+ loose-envify "^1.4.0"
+ object-assign "^4.1.1"
+ react-is "^16.8.1"
+
+psl@^1.1.24, psl@^1.1.28:
+ version "1.1.32"
+ resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.32.tgz#3f132717cf2f9c169724b2b6caf373cf694198db"
+
+pump@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
+ dependencies:
+ end-of-stream "^1.1.0"
+ once "^1.3.1"
+
+punycode@^1.4.1:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
+
+punycode@^2.1.0, punycode@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
+
+qs@~6.5.2:
+ version "6.5.2"
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
+
+raf@^3.4.0:
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
+ dependencies:
+ performance-now "^2.1.0"
+
+railroad-diagrams@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e"
+
+randexp@0.4.6:
+ version "0.4.6"
+ resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3"
+ dependencies:
+ discontinuous-range "1.0.0"
+ ret "~0.1.10"
+
+rc@^1.2.7:
+ version "1.2.8"
+ resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
+ dependencies:
+ deep-extend "^0.6.0"
+ ini "~1.3.0"
+ minimist "^1.2.0"
+ strip-json-comments "~2.0.1"
+
+react-dom@16:
+ version "16.8.6"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ scheduler "^0.13.6"
+
+react-is@^16.4.1, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
+ version "16.8.6"
+ resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
+
+react-test-renderer@16.4.1, react-test-renderer@^16.0.0-0:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.1.tgz#f2fb30c2c7b517db6e5b10ed20bb6b0a7ccd8d70"
+ dependencies:
+ fbjs "^0.8.16"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+ react-is "^16.4.1"
+
+react@16.4.1:
+ version "16.4.1"
+ resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32"
+ dependencies:
+ fbjs "^0.8.16"
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.0"
+
+read-pkg-up@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978"
+ dependencies:
+ find-up "^3.0.0"
+ read-pkg "^3.0.0"
+
+read-pkg@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
+ dependencies:
+ load-json-file "^4.0.0"
+ normalize-package-data "^2.3.2"
+ path-type "^3.0.0"
+
+readable-stream@^2.0.1, readable-stream@^2.0.6:
+ version "2.3.6"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.3"
+ isarray "~1.0.0"
+ process-nextick-args "~2.0.0"
+ safe-buffer "~5.1.1"
+ string_decoder "~1.1.1"
+ util-deprecate "~1.0.1"
+
+readable-stream@^3.1.1:
+ version "3.4.0"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc"
+ dependencies:
+ inherits "^2.0.3"
+ string_decoder "^1.1.1"
+ util-deprecate "^1.0.1"
+
+realpath-native@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c"
+ dependencies:
+ util.promisify "^1.0.0"
+
+redux-mock-store@^1.5.3:
+ version "1.5.3"
+ resolved "https://registry.yarnpkg.com/redux-mock-store/-/redux-mock-store-1.5.3.tgz#1f10528949b7ce8056c2532624f7cafa98576c6d"
+ dependencies:
+ lodash.isplainobject "^4.0.6"
+
+redux@^4.0.4:
+ version "4.0.4"
+ resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
+ dependencies:
+ loose-envify "^1.4.0"
+ symbol-observable "^1.2.0"
+
+reflect.ownkeys@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
+
+regex-not@^1.0.0, regex-not@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
+ dependencies:
+ extend-shallow "^3.0.2"
+ safe-regex "^1.1.0"
+
+remove-trailing-separator@^1.0.1:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
+
+repeat-element@^1.1.2:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce"
+
+repeat-string@^1.6.1:
+ version "1.6.1"
+ resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
+
+request-promise-core@1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346"
+ dependencies:
+ lodash "^4.17.11"
+
+request-promise-native@^1.0.5:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59"
+ dependencies:
+ request-promise-core "1.1.2"
+ stealthy-require "^1.1.1"
+ tough-cookie "^2.3.3"
+
+request@^2.87.0:
+ version "2.88.0"
+ resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
+ dependencies:
+ aws-sign2 "~0.7.0"
+ aws4 "^1.8.0"
+ caseless "~0.12.0"
+ combined-stream "~1.0.6"
+ extend "~3.0.2"
+ forever-agent "~0.6.1"
+ form-data "~2.3.2"
+ har-validator "~5.1.0"
+ http-signature "~1.2.0"
+ is-typedarray "~1.0.0"
+ isstream "~0.1.2"
+ json-stringify-safe "~5.0.1"
+ mime-types "~2.1.19"
+ oauth-sign "~0.9.0"
+ performance-now "^2.1.0"
+ qs "~6.5.2"
+ safe-buffer "^5.1.2"
+ tough-cookie "~2.4.3"
+ tunnel-agent "^0.6.0"
+ uuid "^3.3.2"
+
+require-directory@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
+
+require-main-filename@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
+
+require-main-filename@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
+
+resolve-cwd@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
+ dependencies:
+ resolve-from "^3.0.0"
+
+resolve-from@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
+
+resolve-url@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
+
+resolve@1.1.7:
+ version "1.1.7"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
+
+resolve@^1.10.0, resolve@^1.3.2:
+ version "1.11.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232"
+ dependencies:
+ path-parse "^1.0.6"
+
+ret@~0.1.10:
+ version "0.1.15"
+ resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
+
+rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3:
+ version "2.6.3"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
+ dependencies:
+ glob "^7.1.3"
+
+rst-selector-parser@^2.2.3:
+ version "2.2.3"
+ resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91"
+ dependencies:
+ lodash.flattendeep "^4.4.0"
+ nearley "^2.7.10"
+
+rsvp@^4.8.4:
+ version "4.8.5"
+ resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
+
+safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
+
+safe-regex@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
+ dependencies:
+ ret "~0.1.10"
+
+"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
+
+sane@^4.0.3:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded"
+ dependencies:
+ "@cnakazawa/watch" "^1.0.3"
+ anymatch "^2.0.0"
+ capture-exit "^2.0.0"
+ exec-sh "^0.3.2"
+ execa "^1.0.0"
+ fb-watchman "^2.0.0"
+ micromatch "^3.1.4"
+ minimist "^1.1.1"
+ walker "~1.0.5"
+
+sax@^1.2.4:
+ version "1.2.4"
+ resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
+
+scheduler@^0.13.6:
+ version "0.13.6"
+ resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
+ dependencies:
+ loose-envify "^1.1.0"
+ object-assign "^4.1.1"
+
+"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0:
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
+
+semver@^6.0.0:
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b"
+
+set-blocking@^2.0.0, set-blocking@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
+
+set-value@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1"
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-extendable "^0.1.1"
+ is-plain-object "^2.0.1"
+ to-object-path "^0.3.0"
+
+set-value@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274"
+ dependencies:
+ extend-shallow "^2.0.1"
+ is-extendable "^0.1.1"
+ is-plain-object "^2.0.3"
+ split-string "^3.0.1"
+
+setimmediate@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
+
+shebang-command@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
+ dependencies:
+ shebang-regex "^1.0.0"
+
+shebang-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
+
+shellwords@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
+
+signal-exit@^3.0.0, signal-exit@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
+
+sisteransi@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c"
+
+slash@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
+
+snapdragon-node@^2.0.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
+ dependencies:
+ define-property "^1.0.0"
+ isobject "^3.0.0"
+ snapdragon-util "^3.0.1"
+
+snapdragon-util@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
+ dependencies:
+ kind-of "^3.2.0"
+
+snapdragon@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d"
+ dependencies:
+ base "^0.11.1"
+ debug "^2.2.0"
+ define-property "^0.2.5"
+ extend-shallow "^2.0.1"
+ map-cache "^0.2.2"
+ source-map "^0.5.6"
+ source-map-resolve "^0.5.0"
+ use "^3.1.0"
+
+source-map-resolve@^0.5.0:
+ version "0.5.2"
+ resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259"
+ dependencies:
+ atob "^2.1.1"
+ decode-uri-component "^0.2.0"
+ resolve-url "^0.2.1"
+ source-map-url "^0.4.0"
+ urix "^0.1.0"
+
+source-map-support@^0.5.6:
+ version "0.5.12"
+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599"
+ dependencies:
+ buffer-from "^1.0.0"
+ source-map "^0.6.0"
+
+source-map-url@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
+
+source-map@^0.5.0, source-map@^0.5.6:
+ version "0.5.7"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
+
+source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
+
+spdx-correct@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4"
+ dependencies:
+ spdx-expression-parse "^3.0.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-exceptions@^2.1.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977"
+
+spdx-expression-parse@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
+ dependencies:
+ spdx-exceptions "^2.1.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-license-ids@^3.0.0:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1"
+
+split-string@^3.0.1, split-string@^3.0.2:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
+ dependencies:
+ extend-shallow "^3.0.0"
+
+sshpk@^1.7.0:
+ version "1.16.1"
+ resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
+ dependencies:
+ asn1 "~0.2.3"
+ assert-plus "^1.0.0"
+ bcrypt-pbkdf "^1.0.0"
+ dashdash "^1.12.0"
+ ecc-jsbn "~0.1.1"
+ getpass "^0.1.1"
+ jsbn "~0.1.0"
+ safer-buffer "^2.0.2"
+ tweetnacl "~0.14.0"
+
+stack-utils@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8"
+
+static-extend@^0.1.1:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
+ dependencies:
+ define-property "^0.2.5"
+ object-copy "^0.1.0"
+
+stealthy-require@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
+
+string-length@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
+ dependencies:
+ astral-regex "^1.0.0"
+ strip-ansi "^4.0.0"
+
+string-width@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
+ dependencies:
+ code-point-at "^1.0.0"
+ is-fullwidth-code-point "^1.0.0"
+ strip-ansi "^3.0.0"
+
+"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
+ dependencies:
+ is-fullwidth-code-point "^2.0.0"
+ strip-ansi "^4.0.0"
+
+string.prototype.trim@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.0"
+ function-bind "^1.0.2"
+
+string_decoder@^1.1.1:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d"
+ dependencies:
+ safe-buffer "~5.1.0"
+
+string_decoder@~1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
+ dependencies:
+ safe-buffer "~5.1.0"
+
+strip-ansi@^3.0.0, strip-ansi@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
+ dependencies:
+ ansi-regex "^2.0.0"
+
+strip-ansi@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
+ dependencies:
+ ansi-regex "^3.0.0"
+
+strip-ansi@^5.0.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
+ dependencies:
+ ansi-regex "^4.1.0"
+
+strip-bom@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
+
+strip-eof@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
+
+strip-json-comments@~2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+
+supports-color@^5.3.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ dependencies:
+ has-flag "^3.0.0"
+
+supports-color@^6.1.0:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3"
+ dependencies:
+ has-flag "^3.0.0"
+
+symbol-observable@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
+
+symbol-tree@^3.2.2:
+ version "3.2.4"
+ resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
+
+tar@^4:
+ version "4.4.10"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1"
+ dependencies:
+ chownr "^1.1.1"
+ fs-minipass "^1.2.5"
+ minipass "^2.3.5"
+ minizlib "^1.2.1"
+ mkdirp "^0.5.0"
+ safe-buffer "^5.1.2"
+ yallist "^3.0.3"
+
+test-exclude@^5.2.3:
+ version "5.2.3"
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0"
+ dependencies:
+ glob "^7.1.3"
+ minimatch "^3.0.4"
+ read-pkg-up "^4.0.0"
+ require-main-filename "^2.0.0"
+
+throat@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
+
+tmpl@1.0.x:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
+
+to-fast-properties@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
+
+to-object-path@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
+ dependencies:
+ kind-of "^3.0.2"
+
+to-regex-range@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
+ dependencies:
+ is-number "^3.0.0"
+ repeat-string "^1.6.1"
+
+to-regex@^3.0.1, to-regex@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
+ dependencies:
+ define-property "^2.0.2"
+ extend-shallow "^3.0.2"
+ regex-not "^1.0.2"
+ safe-regex "^1.1.0"
+
+tough-cookie@^2.3.3, tough-cookie@^2.3.4:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
+ dependencies:
+ psl "^1.1.28"
+ punycode "^2.1.1"
+
+tough-cookie@~2.4.3:
+ version "2.4.3"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
+ dependencies:
+ psl "^1.1.24"
+ punycode "^1.4.1"
+
+tr46@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
+ dependencies:
+ punycode "^2.1.0"
+
+trim-right@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
+
+tunnel-agent@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
+ dependencies:
+ safe-buffer "^5.0.1"
+
+tweetnacl@^0.14.3, tweetnacl@~0.14.0:
+ version "0.14.5"
+ resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
+
+type-check@~0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
+ dependencies:
+ prelude-ls "~1.1.2"
+
+ua-parser-js@^0.7.18:
+ version "0.7.20"
+ resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.20.tgz#7527178b82f6a62a0f243d1f94fd30e3e3c21098"
+
+uglify-js@^3.1.4:
+ version "3.6.0"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"
+ dependencies:
+ commander "~2.20.0"
+ source-map "~0.6.1"
+
+union-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4"
+ dependencies:
+ arr-union "^3.1.0"
+ get-value "^2.0.6"
+ is-extendable "^0.1.1"
+ set-value "^0.4.3"
+
+unset-value@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
+ dependencies:
+ has-value "^0.3.1"
+ isobject "^3.0.0"
+
+uri-js@^4.2.2:
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
+ dependencies:
+ punycode "^2.1.0"
+
+urix@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
+
+use@^3.1.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
+
+util-deprecate@^1.0.1, util-deprecate@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
+
+util.promisify@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
+ dependencies:
+ define-properties "^1.1.2"
+ object.getownpropertydescriptors "^2.0.3"
+
+uuid@^3.3.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
+
+validate-npm-package-license@^3.0.1:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
+ dependencies:
+ spdx-correct "^3.0.0"
+ spdx-expression-parse "^3.0.0"
+
+verror@1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
+ dependencies:
+ assert-plus "^1.0.0"
+ core-util-is "1.0.2"
+ extsprintf "^1.2.0"
+
+w3c-hr-time@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
+ dependencies:
+ browser-process-hrtime "^0.1.2"
+
+walker@^1.0.7, walker@~1.0.5:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb"
+ dependencies:
+ makeerror "1.0.x"
+
+webidl-conversions@^4.0.2:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
+
+whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"
+ dependencies:
+ iconv-lite "0.4.24"
+
+whatwg-fetch@>=0.10.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
+
+whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
+
+whatwg-url@^6.4.1:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8"
+ dependencies:
+ lodash.sortby "^4.7.0"
+ tr46 "^1.0.1"
+ webidl-conversions "^4.0.2"
+
+whatwg-url@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd"
+ dependencies:
+ lodash.sortby "^4.7.0"
+ tr46 "^1.0.1"
+ webidl-conversions "^4.0.2"
+
+which-module@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
+
+which@^1.2.9, which@^1.3.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
+ dependencies:
+ isexe "^2.0.0"
+
+wide-align@^1.1.0:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
+ dependencies:
+ string-width "^1.0.2 || 2"
+
+wordwrap@~0.0.2:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
+
+wordwrap@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
+
+wrap-ansi@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
+ dependencies:
+ string-width "^1.0.1"
+ strip-ansi "^3.0.1"
+
+wrappy@1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+
+write-file-atomic@2.4.1:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529"
+ dependencies:
+ graceful-fs "^4.1.11"
+ imurmurhash "^0.1.4"
+ signal-exit "^3.0.2"
+
+ws@^5.2.0:
+ version "5.2.2"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f"
+ dependencies:
+ async-limiter "~1.0.0"
+
+xml-name-validator@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
+
+"y18n@^3.2.1 || ^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
+
+yallist@^3.0.0, yallist@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9"
+
+yargs-parser@^11.1.1:
+ version "11.1.1"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4"
+ dependencies:
+ camelcase "^5.0.0"
+ decamelize "^1.2.0"
+
+yargs@^12.0.2:
+ version "12.0.5"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13"
+ dependencies:
+ cliui "^4.0.0"
+ decamelize "^1.2.0"
+ find-up "^3.0.0"
+ get-caller-file "^1.0.1"
+ os-locale "^3.0.0"
+ require-directory "^2.1.1"
+ require-main-filename "^1.0.1"
+ set-blocking "^2.0.0"
+ string-width "^2.0.0"
+ which-module "^2.0.0"
+ y18n "^3.2.1 || ^4.0.0"
+ yargs-parser "^11.1.1"
diff --git a/devtools/client/application/test/xpcshell/.eslintrc.js b/devtools/client/application/test/xpcshell/.eslintrc.js
new file mode 100644
index 0000000000..8611c174f5
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/.eslintrc.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = {
+ // Extend from the common devtools xpcshell eslintrc config.
+ extends: "../../../../.eslintrc.xpcshell.js",
+};
diff --git a/devtools/client/application/test/xpcshell/test_manifest_reducer.js b/devtools/client/application/test/xpcshell/test_manifest_reducer.js
new file mode 100644
index 0000000000..2e91b57442
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/test_manifest_reducer.js
@@ -0,0 +1,201 @@
+/* Any copyright is dedicated to the Public Domain.
+http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ FETCH_MANIFEST_FAILURE,
+ FETCH_MANIFEST_START,
+ FETCH_MANIFEST_SUCCESS,
+ RESET_MANIFEST,
+ MANIFEST_MEMBER_VALUE_TYPES,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const { ICON, COLOR, STRING, URL } = MANIFEST_MEMBER_VALUE_TYPES;
+
+const {
+ manifestReducer,
+ ManifestState,
+} = require("resource://devtools/client/application/src/reducers/manifest-state.js");
+
+const MANIFEST_PROCESSING = [
+ // empty manifest
+ {
+ source: {},
+ processed: {},
+ },
+ // manifest with just one member
+ {
+ source: { name: "Foo" },
+ processed: {
+ identity: [{ key: "name", value: "Foo", type: STRING }],
+ },
+ },
+ // manifest with two members from the same category
+ {
+ source: {
+ short_name: "Short Foo",
+ name: "Long Foo",
+ },
+ processed: {
+ identity: [
+ { key: "short_name", value: "Short Foo", type: STRING },
+ { key: "name", value: "Long Foo", type: STRING },
+ ],
+ },
+ },
+ // manifest with members from two different categories
+ {
+ source: {
+ name: "Foo",
+ background_color: "#FF0000",
+ start_url: "https://example.com/?q=foo",
+ scope: "https://example.com",
+ },
+ processed: {
+ identity: [{ key: "name", value: "Foo", type: STRING }],
+ presentation: [
+ { key: "background_color", value: "#FF0000", type: COLOR },
+ { key: "start_url", value: "https://example.com/?q=foo", type: URL },
+ { key: "scope", value: "https://example.com", type: URL },
+ ],
+ },
+ },
+ // manifest with icons
+ {
+ source: {
+ icons: [
+ {
+ src: "something.png",
+ type: "image/png",
+ sizes: ["16x16", "32x32"],
+ purpose: ["any"],
+ },
+ {
+ src: "another.svg",
+ type: "image/svg",
+ sizes: ["any"],
+ purpose: ["any maskable"],
+ },
+ {
+ src: "something.png",
+ type: undefined,
+ sizes: undefined,
+ purpose: ["any"],
+ },
+ ],
+ },
+ processed: {
+ icons: [
+ {
+ key: { sizes: "16x16 32x32", contentType: "image/png" },
+ value: { src: "something.png", purpose: "any" },
+ type: ICON,
+ },
+ {
+ key: { sizes: "any", contentType: "image/svg" },
+ value: { src: "another.svg", purpose: "any maskable" },
+ type: ICON,
+ },
+ {
+ key: { sizes: undefined, contentType: undefined },
+ value: { src: "something.png", purpose: "any" },
+ type: ICON,
+ },
+ ],
+ },
+ },
+ // manifest with issues
+ {
+ source: {
+ moz_validation: [
+ { warn: "A warning" },
+ { error: "An error", type: "json" },
+ ],
+ },
+ processed: {
+ validation: [
+ { level: "warning", message: "A warning", type: null },
+ { level: "error", message: "An error", type: "json" },
+ ],
+ },
+ },
+ // manifest with URL
+ {
+ source: {
+ moz_manifest_url: "https://example.com/manifest.json",
+ },
+ processed: {
+ url: "https://example.com/manifest.json",
+ },
+ },
+];
+
+add_task(async function () {
+ info("Test manifest reducer: FETCH_MANIFEST_START action");
+
+ const state = ManifestState();
+ const action = { type: FETCH_MANIFEST_START };
+ const newState = manifestReducer(state, action);
+
+ equal(newState.isLoading, true, "Loading flag is true");
+});
+
+add_task(async function () {
+ info("Test manifest reducer: FETCH_MANIFEST_FAILURE action");
+
+ const state = Object.assign(ManifestState(), { isLoading: true });
+ const action = { type: FETCH_MANIFEST_FAILURE, error: "some error" };
+ const newState = manifestReducer(state, action);
+
+ equal(newState.errorMessage, "some error", "Error message is as expected");
+ equal(newState.isLoading, false, "Loading flag is false");
+ equal(newState.manifest, null, "Manifest is null");
+});
+
+add_task(async function () {
+ info("Test manifest reducer: FETCH_MANIFEST_SUCCESS action");
+
+ // test manifest processing
+ MANIFEST_PROCESSING.forEach(({ source, processed }) => {
+ test_manifest_processing(source, processed);
+ });
+});
+
+add_task(async function () {
+ info("Test manifest reducer: RESET_MANIFEST action");
+
+ const state = Object.assign(ManifestState(), {
+ isLoading: true,
+ manifest: { identity: [{ key: "name", value: "Foo" }] },
+ errorMessage: "some error",
+ });
+ const action = { type: RESET_MANIFEST };
+ const newState = manifestReducer(state, action);
+
+ deepEqual(newState, ManifestState(), "Manifest has been reset to defaults");
+});
+
+function test_manifest_processing(source, processed) {
+ const state = ManifestState();
+ state.isLoading = true;
+
+ const action = { type: FETCH_MANIFEST_SUCCESS, manifest: source };
+ const newState = manifestReducer(state, action);
+
+ // merge the expected processed manifst with some default values
+ const expected = Object.assign(
+ {
+ icons: [],
+ identity: [],
+ presentation: [],
+ url: undefined,
+ validation: [],
+ },
+ processed
+ );
+
+ deepEqual(newState.manifest, expected, "Processed manifest as expected");
+ equal(newState.errorMessage, "", "Error message is empty");
+ equal(newState.isLoading, false, "Loading flag is false");
+}
diff --git a/devtools/client/application/test/xpcshell/test_page_reducer.js b/devtools/client/application/test/xpcshell/test_page_reducer.js
new file mode 100644
index 0000000000..9aecfc67bb
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/test_page_reducer.js
@@ -0,0 +1,22 @@
+/* Any copyright is dedicated to the Public Domain.
+http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ updateDomain,
+} = require("resource://devtools/client/application/src/actions/page.js");
+
+const {
+ pageReducer,
+ PageState,
+} = require("resource://devtools/client/application/src/reducers/page-state.js");
+
+add_task(async function () {
+ info("Test page reducer: UPDATE_DOMAIN action");
+ const state = PageState();
+ const action = updateDomain("https://example.com/foo/#bar");
+
+ const newState = pageReducer(state, action);
+ equal(newState.domain, "example.com");
+});
diff --git a/devtools/client/application/test/xpcshell/test_ui_reducer.js b/devtools/client/application/test/xpcshell/test_ui_reducer.js
new file mode 100644
index 0000000000..22c1844238
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/test_ui_reducer.js
@@ -0,0 +1,22 @@
+/* Any copyright is dedicated to the Public Domain.
+http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ updateSelectedPage,
+} = require("resource://devtools/client/application/src/actions/ui.js");
+
+const {
+ uiReducer,
+ UiState,
+} = require("resource://devtools/client/application/src/reducers/ui-state.js");
+
+add_task(async function () {
+ info("Test ui reducer: UPDATE_SELECTED_PAGE action");
+ const state = UiState();
+ const action = updateSelectedPage("foo");
+
+ const newState = uiReducer(state, action);
+ equal(newState.selectedPage, "foo");
+});
diff --git a/devtools/client/application/test/xpcshell/test_workers_reducer.js b/devtools/client/application/test/xpcshell/test_workers_reducer.js
new file mode 100644
index 0000000000..a662c313df
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/test_workers_reducer.js
@@ -0,0 +1,115 @@
+/* Any copyright is dedicated to the Public Domain.
+http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {
+ updateCanDebugWorkers,
+ updateWorkers,
+} = require("resource://devtools/client/application/src/actions/workers.js");
+
+const {
+ START_WORKER,
+ UNREGISTER_WORKER,
+} = require("resource://devtools/client/application/src/constants.js");
+
+const {
+ workersReducer,
+ WorkersState,
+} = require("resource://devtools/client/application/src/reducers/workers-state.js");
+
+add_task(async function () {
+ info("Test workers reducer: UPDATE_CAN_DEBUG_WORKERS action");
+
+ function testUpdateCanDebugWorkers(flagValue) {
+ const state = WorkersState();
+ const action = updateCanDebugWorkers(flagValue);
+ const newState = workersReducer(state, action);
+ equal(
+ newState.canDebugWorkers,
+ flagValue,
+ "canDebugWorkers contains the expected value"
+ );
+ }
+
+ testUpdateCanDebugWorkers(false);
+ testUpdateCanDebugWorkers(true);
+});
+
+add_task(async function () {
+ info("Test workers reducer: UPDATE_WORKERS action");
+ const state = WorkersState();
+
+ const rawData = [
+ {
+ registration: {
+ scope: "lorem-ipsum",
+ lastUpdateTime: 42,
+ id: "r1",
+ },
+ workers: [
+ {
+ id: "w1",
+ state: Ci.nsIServiceWorkerInfo.STATE_ACTIVATED,
+ url: "https://example.com/w1.js",
+ workerDescriptorFront: { foo: "bar" },
+ stateText: "activated",
+ },
+ {
+ id: "w2",
+ state: Ci.nsIServiceWorkerInfo.STATE_INSTALLED,
+ url: "https://example.com/w2.js",
+ workerDescriptorFront: undefined,
+ stateText: "installed",
+ },
+ ],
+ },
+ ];
+
+ const expectedData = [
+ {
+ id: "r1",
+ lastUpdateTime: 42,
+ registrationFront: rawData[0].registration,
+ scope: "lorem-ipsum",
+ workers: [
+ {
+ id: "w1",
+ url: "https://example.com/w1.js",
+ workerDescriptorFront: rawData[0].workers[0].workerDescriptorFront,
+ registrationFront: rawData[0].registration,
+ state: Ci.nsIServiceWorkerInfo.STATE_ACTIVATED,
+ stateText: "activated",
+ },
+ {
+ id: "w2",
+ url: "https://example.com/w2.js",
+ workerDescriptorFront: undefined,
+ registrationFront: rawData[0].registration,
+ state: Ci.nsIServiceWorkerInfo.STATE_INSTALLED,
+ stateText: "installed",
+ },
+ ],
+ },
+ ];
+
+ const action = updateWorkers(rawData);
+ const newState = workersReducer(state, action);
+ deepEqual(newState.list, expectedData, "workers contains the expected list");
+});
+
+add_task(async function () {
+ info("Test workers reducer: START_WORKER action");
+ const state = WorkersState();
+ const action = { type: START_WORKER };
+ const newState = workersReducer(state, action);
+ deepEqual(state, newState, "workers state stays the same");
+});
+
+add_task(async function () {
+ info("Test workers reducer: UNREGISTER_WORKER action");
+ const state = WorkersState();
+ const action = { type: UNREGISTER_WORKER };
+ const newState = workersReducer(state, action);
+ deepEqual(state, newState, "workers state stays the same");
+});
diff --git a/devtools/client/application/test/xpcshell/xpcshell-head.js b/devtools/client/application/test/xpcshell/xpcshell-head.js
new file mode 100644
index 0000000000..733c0400da
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/xpcshell-head.js
@@ -0,0 +1,10 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+const { require } = ChromeUtils.importESModule(
+ "resource://devtools/shared/loader/Loader.sys.mjs"
+);
diff --git a/devtools/client/application/test/xpcshell/xpcshell.ini b/devtools/client/application/test/xpcshell/xpcshell.ini
new file mode 100644
index 0000000000..824750f9f5
--- /dev/null
+++ b/devtools/client/application/test/xpcshell/xpcshell.ini
@@ -0,0 +1,10 @@
+[DEFAULT]
+tags = devtools
+head = xpcshell-head.js
+firefox-appdir = browser
+skip-if = toolkit == 'android'
+
+[test_manifest_reducer.js]
+[test_page_reducer.js]
+[test_ui_reducer.js]
+[test_workers_reducer.js]
diff --git a/devtools/client/bin/devtools-node-test-runner.js b/devtools/client/bin/devtools-node-test-runner.js
new file mode 100644
index 0000000000..e347ee5855
--- /dev/null
+++ b/devtools/client/bin/devtools-node-test-runner.js
@@ -0,0 +1,322 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/* global __dirname, process */
+
+"use strict";
+
+/**
+ * This is a test runner dedicated to run DevTools node tests continuous integration
+ * platforms. It will parse the logs to output errors compliant with treeherder tooling.
+ *
+ * See taskcluster/ci/source-test/node.yml for the definition of the task running those
+ * tests on try.
+ */
+
+const { execFileSync } = require("child_process");
+const { writeFileSync } = require("fs");
+const { chdir } = require("process");
+const path = require("path");
+const os = require("os");
+
+const REPOSITORY_ROOT = __dirname.replace("devtools/client/bin", "");
+
+// All Windows platforms report "win32", even for 64bit editions.
+const isWin = os.platform() === "win32";
+
+// On Windows, the ".cmd" suffix is mandatory to invoke yarn ; or executables in
+// general.
+const YARN_PROCESS = isWin ? "yarn.cmd" : "yarn";
+
+// Supported node test suites for DevTools
+const TEST_TYPES = {
+ JEST: "jest",
+ TYPESCRIPT: "typescript",
+};
+
+const SUITES = {
+ aboutdebugging: {
+ path: "../aboutdebugging/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ accessibility: {
+ path: "../accessibility/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ application: {
+ path: "../application/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ compatibility: {
+ path: "../inspector/compatibility/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ debugger: {
+ path: "../debugger",
+ type: TEST_TYPES.JEST,
+ },
+ framework: {
+ path: "../framework/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ netmonitor: {
+ path: "../netmonitor/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ performance: {
+ path: "../performance-new",
+ type: TEST_TYPES.TYPESCRIPT,
+ },
+ shared_components: {
+ path: "../shared/components/test/node",
+ type: TEST_TYPES.JEST,
+ },
+ webconsole: {
+ path: "../webconsole/test/node",
+ type: TEST_TYPES.JEST,
+ dependencies: ["../debugger"],
+ },
+};
+
+function execOut(...args) {
+ let out;
+ let err;
+ try {
+ out = execFileSync(...args);
+ } catch (e) {
+ out = e.stdout;
+ err = e.stderr;
+ }
+ return { out: out.toString(), err: err && err.toString() };
+}
+
+function getErrors(suite, out, err, testPath) {
+ switch (SUITES[suite].type) {
+ case TEST_TYPES.JEST:
+ return getJestErrors(out, err);
+ case TEST_TYPES.TYPESCRIPT:
+ return getTypescriptErrors(out, err, testPath);
+ default:
+ throw new Error("Unsupported suite type: " + SUITES[suite].type);
+ }
+}
+
+const JEST_ERROR_SUMMARY_REGEX = /\s●\s/;
+
+function getJestErrors(out, err) {
+ // The string out has extra content before the JSON object starts.
+ const jestJsonOut = out.substring(out.indexOf("{"), out.lastIndexOf("}") + 1);
+ const results = JSON.parse(jestJsonOut);
+
+ /**
+ * We don't have individual information, but a multiple line string in testResult.message,
+ * which looks like
+ *
+ * ● Simple function
+ *
+ * expect(received).toEqual(expected) // deep equality
+ *
+ * Expected: false
+ * Received: true
+ *
+ * 391 | url: "test.js",
+ * 392 | });
+ * > 393 | expect(true).toEqual(false);
+ * | ^
+ * 394 | expect(actual.code).toMatchSnapshot();
+ * 395 |
+ * 396 | const smc = await new SourceMapConsumer(actual.map.toJSON());
+ *
+ * at Object.<anonymous> (src/workers/pretty-print/tests/prettyFast.spec.js:393:18)
+ * at asyncGeneratorStep (src/workers/pretty-print/tests/prettyFast.spec.js:7:103)
+ * at _next (src/workers/pretty-print/tests/prettyFast.spec.js:9:194)
+ * at src/workers/pretty-print/tests/prettyFast.spec.js:9:364
+ * at Object.<anonymous> (src/workers/pretty-print/tests/prettyFast.spec.js:9:97)
+ *
+ */
+
+ const errors = [];
+ for (const testResult of results.testResults) {
+ if (testResult.status != "failed") {
+ continue;
+ }
+ let currentError;
+ let errorLine;
+
+ const lines = testResult.message.split("\n");
+ lines.forEach((line, i) => {
+ if (line.match(JEST_ERROR_SUMMARY_REGEX) || i == lines.length - 1) {
+ // This is the name of the test, if we were gathering information from a previous
+ // error, we add it to the errors
+ if (currentError) {
+ errors.push({
+ // The file should be relative from the repository
+ file: testResult.name.replace(REPOSITORY_ROOT, ""),
+ line: errorLine,
+ // we don't have information for the column
+ column: 0,
+ message: currentError.trim(),
+ });
+ }
+
+ // Handle the new error
+ currentError = line;
+ } else {
+ // We put any line that is not a test name in the error message as it may be
+ // valuable for the user.
+ currentError += "\n" + line;
+
+ // The actual line of the error is marked with " > XXX |"
+ const res = line.match(/> (?<line>\d+) \|/);
+ if (res) {
+ errorLine = parseInt(res.groups.line, 10);
+ }
+ }
+ });
+ }
+
+ return errors;
+}
+
+function getTypescriptErrors(out, err, testPath) {
+ console.log(out);
+ // Typescript error lines look like:
+ // popup/panel.jsm.js(103,7): error TS2531: Object is possibly 'null'.
+ // Which means:
+ // {file_path}({line},{col}): error TS{error_code}: {message}
+ const tsErrorRegex =
+ /(?<file>(\w|\/|\.)+)\((?<line>\d+),(?<column>\d+)\): (?<message>error TS\d+\:.*)/;
+ const errors = [];
+ for (const line of out.split("\n")) {
+ const res = line.match(tsErrorRegex);
+ if (!res) {
+ continue;
+ }
+ // TypeScript gives us the path from the directory the command is executed in, so we
+ // need to prepend the directory path.
+ const fileAbsPath = testPath + res.groups.file;
+ errors.push({
+ // The file should be relative from the repository.
+ file: fileAbsPath.replace(REPOSITORY_ROOT, ""),
+ line: parseInt(res.groups.line, 10),
+ column: parseInt(res.groups.column, 10),
+ message: res.groups.message.trim(),
+ });
+ }
+ return errors;
+}
+
+function runTests() {
+ console.log("[devtools-node-test-runner] Extract suite argument");
+ const suiteArg = process.argv.find(arg => arg.includes("suite="));
+ const suite = suiteArg.split("=")[1];
+ if (suite !== "all" && !SUITES[suite]) {
+ throw new Error(
+ "Invalid suite argument to devtools-node-test-runner: " + suite
+ );
+ }
+
+ console.log("[devtools-node-test-runner] Check `yarn` is available");
+ try {
+ // This will throw if yarn is unavailable
+ execFileSync(YARN_PROCESS, ["--version"]);
+ } catch (e) {
+ console.log(
+ "[devtools-node-test-runner] ERROR: `yarn` is not installed. " +
+ "See https://yarnpkg.com/docs/install/ "
+ );
+ return false;
+ }
+
+ const artifactArg = process.argv.find(arg => arg.includes("artifact="));
+ const artifactFilePath = artifactArg && artifactArg.split("=")[1];
+ const artifactErrors = {};
+
+ const failedSuites = [];
+ const suites = suite == "all" ? SUITES : { [suite]: SUITES[suite] };
+ for (const [suiteName, suiteData] of Object.entries(suites)) {
+ console.log("[devtools-node-test-runner] Running suite: " + suiteName);
+
+ if (suiteData.dependencies) {
+ console.log(
+ "[devtools-node-test-runner] Running `yarn` for dependencies"
+ );
+ for (const dep of suiteData.dependencies) {
+ const depPath = path.join(__dirname, dep);
+ chdir(depPath);
+
+ console.log("[devtools-node-test-runner] Run `yarn` in " + depPath);
+ execOut(YARN_PROCESS);
+ }
+ }
+
+ const testPath = path.join(__dirname, suiteData.path);
+ chdir(testPath);
+
+ console.log("[devtools-node-test-runner] Run `yarn` in test folder");
+ execOut(YARN_PROCESS);
+
+ console.log(`TEST START | ${suiteData.type} | ${suiteName}`);
+
+ console.log("[devtools-node-test-runner] Run `yarn test` in test folder");
+ const { out, err } = execOut(YARN_PROCESS, ["test-ci"]);
+
+ if (err) {
+ console.log("[devtools-node-test-runner] Error log");
+ console.log(err);
+ }
+
+ console.log("[devtools-node-test-runner] Parse errors from the test logs");
+ const errors = getErrors(suiteName, out, err, testPath) || [];
+ if (errors.length) {
+ failedSuites.push(suiteName);
+ }
+ for (const error of errors) {
+ if (!artifactErrors[error.file]) {
+ artifactErrors[error.file] = [];
+ }
+ artifactErrors[error.file].push({
+ path: error.file,
+ line: error.line,
+ column: error.column,
+ level: "error",
+ message: error.message,
+ analyzer: suiteName,
+ });
+
+ console.log(
+ `TEST-UNEXPECTED-FAIL | ${suiteData.type} | ${suiteName} | ${error.file}:${error.line}: ${error.message}`
+ );
+ }
+ }
+
+ if (artifactFilePath) {
+ console.log(
+ `[devtools-node-test-runner] Writing artifact to ${artifactFilePath}`
+ );
+ writeFileSync(artifactFilePath, JSON.stringify(artifactErrors, null, 2));
+ }
+
+ const success = failedSuites.length === 0;
+ if (success) {
+ console.log(
+ `[devtools-node-test-runner] Test suites [${Object.keys(suites).join(
+ ", "
+ )}] succeeded`
+ );
+ } else {
+ console.log(
+ `[devtools-node-test-runner] Test suites [${failedSuites.join(
+ ", "
+ )}] failed`
+ );
+ console.log(
+ "[devtools-node-test-runner] You can find documentation about the " +
+ "devtools node tests at https://firefox-source-docs.mozilla.org/devtools/tests/node-tests.html"
+ );
+ }
+ return success;
+}
+
+process.exitCode = runTests() ? 0 : 1;
diff --git a/devtools/client/constants.js b/devtools/client/constants.js
new file mode 100644
index 0000000000..37acfa214e
--- /dev/null
+++ b/devtools/client/constants.js
@@ -0,0 +1,29 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/**
+ * Set of protocol messages that affect thread state, and the
+ * state the actor is in after each message.
+ */
+const ThreadStateTypes = {
+ paused: "paused",
+ resumed: "attached",
+ running: "attached",
+};
+
+/**
+ * Set of protocol messages that are sent by the server without a prior request
+ * by the client. This only applies to Actors for which we are not using a
+ * protocol.js Front and instead use DevToolsClient directly.
+ */
+const UnsolicitedNotifications = {
+ networkEventUpdate: "networkEventUpdate",
+};
+
+module.exports = {
+ ThreadStateTypes,
+ UnsolicitedNotifications,
+};
diff --git a/devtools/client/debugger/.remarkignore b/devtools/client/debugger/.remarkignore
new file mode 100644
index 0000000000..7453613c87
--- /dev/null
+++ b/devtools/client/debugger/.remarkignore
@@ -0,0 +1,2 @@
+src/utils/pause/mapScopes/README.md
+src/test/mochitest/examples/sourcemapped/README.md
diff --git a/devtools/client/debugger/.remarkrc b/devtools/client/debugger/.remarkrc
new file mode 100644
index 0000000000..4970e65248
--- /dev/null
+++ b/devtools/client/debugger/.remarkrc
@@ -0,0 +1,17 @@
+{
+ "plugins": [
+ "preset-lint-recommended",
+ ["lint-list-item-bullet-indent", false],
+ ["lint-list-item-indent", false],
+ ["lint-ordered-list-marker-style", false],
+ ["lint-no-unused-definitions", false],
+ ["lint-no-shortcut-reference-link", false],
+ ["lint-no-shortcut-reference-image", false],
+ ["lint-no-table-indentation", true],
+ ["lint-table-cell-padding", "consistent"],
+ ["lint-table-pipes", false],
+ ["validate-links", {
+ "repository": ""
+ }]
+ ]
+}
diff --git a/devtools/client/debugger/babel.config.js b/devtools/client/debugger/babel.config.js
new file mode 100644
index 0000000000..b7aa764535
--- /dev/null
+++ b/devtools/client/debugger/babel.config.js
@@ -0,0 +1,90 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+/* global __dirname */
+
+/**
+ * NOTE: This file does not apply to builds in MC. This config is used for
+ * our Jest tests and for webpack bundle builds.
+ */
+module.exports = {
+ sourceType: "unambiguous",
+ overrides: [
+ {
+ test: [
+ "./src",
+ "./packages/*/index.js",
+ "./packages/*/src",
+ /[/\\]node_modules[/\\]devtools-/,
+ /[/\\]node_modules[/\\]react-aria-components[/\\]/,
+ "../../shared",
+ "../shared/worker-utils.js",
+ ],
+ presets: [
+ "@babel/preset-react",
+ [
+ "@babel/preset-env",
+ {
+ targets: {
+ browsers: ["last 1 Chrome version", "last 1 Firefox version"],
+ },
+ modules: "commonjs",
+ },
+ ],
+ ],
+ plugins: [
+ "@babel/plugin-proposal-class-static-block",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-optional-chaining",
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-private-methods",
+ "@babel/plugin-proposal-private-property-in-object",
+ [
+ "module-resolver",
+ {
+ alias: {
+ "devtools/client/shared/vendor/react": "react",
+ "devtools/client/shared/vendor/react-dom": "react-dom",
+ "devtools/client/shared/vendor/react-dom-factories":
+ "react-dom-factories",
+ "devtools/client/shared/vendor/react-prop-types": "prop-types",
+ // Map all require("devtools/...") to the real devtools root.
+ "^devtools\\/(.*)": `${__dirname}/../../\\1`,
+ "^resource://devtools/(.*)": `${__dirname}/../../\\1`,
+ },
+ },
+ ],
+ ],
+ env: {
+ test: {
+ presets: [
+ [
+ "@babel/preset-env",
+ {
+ targets: {
+ node: 7,
+ },
+ modules: "commonjs",
+ },
+ ],
+ ],
+ },
+ },
+ },
+ {
+ test: ["../shared/components"],
+ plugins: [
+ "@babel/plugin-proposal-class-static-block",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-optional-chaining",
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-private-methods",
+ "@babel/plugin-proposal-private-property-in-object",
+ "transform-amd-to-commonjs",
+ ],
+ },
+ ],
+};
diff --git a/devtools/client/debugger/bin/bundle.js b/devtools/client/debugger/bin/bundle.js
new file mode 100644
index 0000000000..ed36ea1810
--- /dev/null
+++ b/devtools/client/debugger/bin/bundle.js
@@ -0,0 +1,125 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+const path = require("path");
+const { rollup } = require("rollup");
+const nodeResolve = require("@rollup/plugin-node-resolve");
+const commonjs = require("@rollup/plugin-commonjs");
+const injectProcessEnv = require("rollup-plugin-inject-process-env");
+const nodePolyfills = require("rollup-plugin-node-polyfills");
+
+const webpack = require("webpack");
+
+const projectPath = path.resolve(__dirname, "..");
+const bundlePath = path.join(projectPath, "./dist");
+
+process.env.NODE_ENV = "production";
+
+function getEntry(filename) {
+ return path.join(__dirname, "..", filename);
+}
+
+/**
+ * The `bundle` module will build the following:
+ * - vendors.js and vendors.css:
+ * Bundle for all the external packages still used by the Debugger frontend.
+ * Source at devtools/client/debugger/src/vendors.js
+ * - parser-worker.js, pretty-print-worker.js, search-worker:
+ * Workers used only by the debugger.
+ * Sources at devtools/client/debugger/src/workers/*
+ */
+(async function bundle() {
+ const rollupSucceeded = await bundleRollup();
+ const webpackSucceeded = await bundleWebpack();
+ const failed = !rollupSucceeded || !webpackSucceeded;
+ process.exit(failed ? 1 : 0);
+})();
+
+/**
+ * Generates all dist/*-worker.js files
+ */
+async function bundleRollup() {
+ console.log(`[bundle|rollup] Start bundling…`);
+
+ let success = true;
+
+ // We need to handle workers 1 by 1 to be able to generate umd bundles.
+ const entries = {
+ "parser-worker": getEntry("src/workers/parser/worker.js"),
+ "pretty-print-worker": getEntry("src/workers/pretty-print/worker.js"),
+ "search-worker": getEntry("src/workers/search/worker.js"),
+ };
+
+ for (const [entryName, input] of Object.entries(entries)) {
+ let bundle;
+ try {
+ // create a bundle
+ bundle = await rollup({
+ input: {
+ [entryName]: input,
+ },
+ plugins: [
+ commonjs({
+ transformMixedEsModules: true,
+ }),
+ injectProcessEnv({ NODE_ENV: "production" }),
+ nodeResolve(),
+ // read-wasm.js is part of source-map and is only for Node environment.
+ // we need to ignore it, otherwise __dirname is inlined with the path the bundle
+ // is generated from, which makes the verify-bundle task fail
+ nodePolyfills({ exclude: [/read-wasm\.js/] }),
+ ],
+ });
+ await bundle.write({
+ dir: bundlePath,
+ entryFileNames: "[name].js",
+ format: "umd",
+ });
+ } catch (error) {
+ success = false;
+ // do some error reporting
+ console.error("[bundle|rollup] Something went wrong.", error);
+ }
+ if (bundle) {
+ // closes the bundle
+ await bundle.close();
+ }
+ }
+
+ console.log(`[bundle|rollup] Done bundling`);
+ return success;
+}
+
+/**
+ * Generates vendors.js and vendors.css
+ * Should be removed in Bug 1826501
+ */
+async function bundleWebpack() {
+ let success = true;
+ console.log(`[bundle|webpack] Start bundling…`);
+ process.env.TARGET = "firefox-panel";
+ process.env.OUTPUT_PATH = bundlePath;
+
+ const webpackConfig = require(path.resolve(projectPath, "webpack.config.js"));
+ const webpackCompiler = webpack(webpackConfig);
+
+ const result = await new Promise(resolve => {
+ webpackCompiler.run((error, stats) => resolve(stats));
+ });
+
+ if (result?.hasErrors()) {
+ success = false;
+ console.log(
+ "[bundle|webpack] Something went wrong. The error was written to assets-error.log"
+ );
+
+ fs.writeFileSync(
+ "assets-error.log",
+ JSON.stringify(result.toJson("verbose"), null, 2)
+ );
+ }
+
+ console.log(`[bundle|webpack] Done bundling`);
+ return success;
+}
diff --git a/devtools/client/debugger/bin/module-manifest.json b/devtools/client/debugger/bin/module-manifest.json
new file mode 100644
index 0000000000..4a812a746e
--- /dev/null
+++ b/devtools/client/debugger/bin/module-manifest.json
@@ -0,0 +1,2565 @@
+{
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-splitter/src/SplitBox.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-splitter/src/SplitBox.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab-list.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab-list.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../devtools-contextmenu/menu.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../devtools-contextmenu/menu.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-components/src/tree.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-components/src/tree.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/object-inspector/components/ObjectInspector.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/object-inspector/components/ObjectInspector.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/reps/reps.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/reps/reps.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ }
+ }
+ ],
+ "modules": {
+ "byIdentifier": {
+ "external \"devtools/client/shared/vendor/react-prop-types\"": 0,
+ "external \"devtools/client/shared/vendor/react-dom-factories\"": 1,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/rep-utils.js": 2,
+ "../../@babel/types/lib/index.js": 3,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/constants.js": 4,
+ "../../@babel/types/lib/validators/generated/index.js": 5,
+ "external \"devtools/client/shared/vendor/react\"": 6,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-utils/index.js": 7,
+ "../../lodash/_root.js": 8,
+ "../../lodash/isArray.js": 9,
+ "../../@babel/types/lib/builders/generated/index.js": 10,
+ "../../lodash/isObjectLike.js": 11,
+ "../../source-map/lib/util.js": 12,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-utils/src/privileged-network-request.js": 13,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-utils/src/worker-utils.js": 14,
+ "../../webpack/buildin/global.js": 15,
+ "../../@babel/types/lib/definitions/index.js": 16,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/url-state-machine.js": 17,
+ "../../lodash/_baseGetTag.js": 18,
+ "../../lodash/_Symbol.js": 19,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/ast.js": 20,
+ "../../lodash/isObject.js": 21,
+ "../../webpack/buildin/module.js": 22,
+ "../../@babel/types/lib/definitions/utils.js": 23,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/rep.js": 24,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/string.js": 25,
+ "../../lodash/_getNative.js": 26,
+ "../../@babel/types/lib/constants/index.js": 27,
+ "../../lodash/isSymbol.js": 28,
+ "../../lodash/_getTag.js": 29,
+ "../../@babel/types/lib/validators/isValidIdentifier.js": 30,
+ "../../@babel/types/lib/clone/cloneNode.js": 31,
+ "../../source-map/lib/source-map-generator.js": 32,
+ "../../source-map/lib/base64-vlq.js": 33,
+ "../../source-map/lib/array-set.js": 34,
+ "../../process/browser.js": 35,
+ "../../charenc/charenc.js": 36,
+ "external \"Services\"": 37,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/array.js": 38,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/prop-rep.js": 39,
+ "../../lodash/_ListCache.js": 40,
+ "../../lodash/_assocIndexOf.js": 41,
+ "../../lodash/eq.js": 42,
+ "../../lodash/_freeGlobal.js": 43,
+ "../../lodash/_nativeCreate.js": 44,
+ "../../lodash/_getMapData.js": 45,
+ "../../lodash/_copyObject.js": 46,
+ "../../lodash/keys.js": 47,
+ "../../lodash/isBuffer.js": 48,
+ "../../lodash/_baseUnary.js": 49,
+ "../../lodash/_nodeUtil.js": 50,
+ "../../lodash/_isPrototype.js": 51,
+ "../../lodash/isArrayLike.js": 52,
+ "../../@babel/types/lib/retrievers/getBindingIdentifiers.js": 53,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/helpers.js": 54,
+ "../../@babel/generator/lib/index.js": 55,
+ "../../lodash/toInteger.js": 56,
+ "../../lodash/toString.js": 57,
+ "../../buffer/index.js": 58,
+ "../../lodash/_toKey.js": 59,
+ "../../../packages/devtools-source-map/node_modules/source-map/source-map.js": 60,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/util.js": 61,
+ "../../node-libs-browser/node_modules/punycode/punycode.js": 62,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/urlencoded.js": 63,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/index.js": 64,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/utils/event-emitter.js": 65,
+ "../../fuzzaldrin-plus/lib/scorer.js": 66,
+ "../../@babel/types/lib/utils/shallowEqual.js": 68,
+ "../../lodash/_Stack.js": 69,
+ "../../lodash/_Map.js": 70,
+ "../../lodash/_getRawTag.js": 71,
+ "../../lodash/_objectToString.js": 72,
+ "../../lodash/_MapCache.js": 73,
+ "../../lodash/isArguments.js": 74,
+ "../../lodash/_isIndex.js": 75,
+ "../../lodash/isTypedArray.js": 76,
+ "../../lodash/isLength.js": 77,
+ "../../lodash/_getSymbols.js": 78,
+ "../../lodash/_getPrototype.js": 79,
+ "../../lodash/_cloneArrayBuffer.js": 80,
+ "../../@babel/types/lib/definitions/core.js": 81,
+ "../../@babel/types/lib/validators/is.js": 82,
+ "../../@babel/types/lib/validators/isType.js": 83,
+ "../../@babel/types/lib/definitions/es2015.js": 84,
+ "../../@babel/types/lib/utils/inherit.js": 85,
+ "../../lodash/_baseFindIndex.js": 86,
+ "../../lodash/_setToArray.js": 87,
+ "../../source-map/source-map.js": 88,
+ "../../source-map/lib/base64.js": 89,
+ "../../source-map/lib/mapping-list.js": 90,
+ "../../source-map/lib/source-map-consumer.js": 91,
+ "../../source-map/lib/binary-search.js": 92,
+ "../../source-map/lib/quick-sort.js": 93,
+ "../../source-map/lib/source-node.js": 94,
+ "../../lodash/_baseToString.js": 95,
+ "../../lodash/_arrayMap.js": 96,
+ "../../@babel/generator/lib/generators/types.js": 97,
+ "../../base64-js/index.js": 98,
+ "../../ieee754/index.js": 99,
+ "../../isarray/index.js": 100,
+ "../../lodash/_isKey.js": 101,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-environment/index.js": 102,
+ "external \"devtools/shared/flags\"": 103,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/sourceMapRequests.js": 104,
+ "../../md5/md5.js": 105,
+ "../../crypt/crypt.js": 106,
+ "../../is-buffer/index.js": 107,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-components/index.js": 108,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-components/src/tree.js": 109,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-components/src/tree.css": 110,
+ "../../fuzzaldrin-plus/lib/pathScorer.js": 111,
+ "external \"devtools/client/shared/vendor/react-dom\"": 112,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/grip.js": 113,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/utils/node.js": 114,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/reducer.js": 115,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/utils/index.js": 116,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/getSymbols.js": 117,
+ "../../@babel/types/lib/validators/buildMatchMemberExpression.js": 118,
+ "../../@babel/types/lib/validators/matchesPattern.js": 119,
+ "../../lodash/isFunction.js": 120,
+ "../../lodash/_toSource.js": 121,
+ "../../lodash/_assignValue.js": 122,
+ "../../lodash/_baseAssignValue.js": 123,
+ "../../lodash/_arrayLikeKeys.js": 124,
+ "../../lodash/_baseKeys.js": 125,
+ "../../lodash/_overArg.js": 126,
+ "../../lodash/keysIn.js": 127,
+ "../../lodash/stubArray.js": 128,
+ "../../lodash/_getSymbolsIn.js": 129,
+ "../../lodash/_arrayPush.js": 130,
+ "../../lodash/_getAllKeys.js": 131,
+ "../../lodash/_baseGetAllKeys.js": 132,
+ "../../lodash/_Set.js": 133,
+ "../../lodash/_Uint8Array.js": 134,
+ "../../esutils/lib/code.js": 135,
+ "../../@babel/types/lib/validators/validate.js": 136,
+ "../../@babel/types/lib/validators/isNode.js": 137,
+ "../../@babel/types/lib/modifications/flow/removeTypeDuplicates.js": 138,
+ "../../@babel/types/lib/clone/clone.js": 139,
+ "../../@babel/types/lib/comments/addComments.js": 140,
+ "../../@babel/types/lib/comments/inheritInnerComments.js": 141,
+ "../../lodash/_SetCache.js": 142,
+ "../../lodash/_cacheHas.js": 143,
+ "../../@babel/types/lib/comments/inheritLeadingComments.js": 144,
+ "../../@babel/types/lib/comments/inheritsComments.js": 145,
+ "../../@babel/types/lib/comments/inheritTrailingComments.js": 146,
+ "../../@babel/types/lib/converters/toBlock.js": 147,
+ "../../@babel/types/lib/converters/toIdentifier.js": 148,
+ "../../@babel/types/lib/modifications/removePropertiesDeep.js": 149,
+ "../../@babel/types/lib/traverse/traverseFast.js": 150,
+ "../../@babel/types/lib/modifications/removeProperties.js": 151,
+ "../../@babel/types/lib/validators/isLet.js": 152,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/simple-path.js": 153,
+ "../../lodash/isEmpty.js": 154,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/sources.js": 155,
+ "../../@babel/generator/lib/node/index.js": 156,
+ "../../@babel/generator/lib/generators/modules.js": 157,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/getFunctionName.js": 158,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/frameworks.js": 159,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/getScopes/index.js": 160,
+ "../../lodash/get.js": 161,
+ "../../lodash/_baseGet.js": 162,
+ "../../lodash/_castPath.js": 163,
+ "../../lodash/_baseIteratee.js": 164,
+ "../../lodash/_baseIsEqual.js": 165,
+ "../../lodash/_equalArrays.js": 166,
+ "../../lodash/_isStrictComparable.js": 167,
+ "../../lodash/_matchesStrictComparable.js": 168,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/contains.js": 169,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/search/get-matches.js": 170,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/source-map-generator.js": 171,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/base64-vlq.js": 172,
+ "../../webidl-conversions/lib/index.js": 173,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/utils.js": 174,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/infra.js": 175,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/URLSearchParams.js": 176,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/array-set.js": 177,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/read-wasm-browser.js": 178,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/createConsumer.js": 179,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/wasmAssetBrowser.js": 180,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/wasmXScopes.js": 181,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/index.js": 182,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/index.js": 183,
+ "../../fuzzaldrin-plus/lib/query.js": 184,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/tabs/tab-list.js": 185,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/tabs/tab.js": 186,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/tabs/tab-panels.js": 187,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/big-int.js": 188,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/function.js": 189,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/shared/dom-node-constants.js": 190,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/error.js": 191,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/grip-array.js": 192,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/shared/grip-length-bubble.js": 193,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/grip-map.js": 194,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/grip-map-entry.js": 195,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/utils/load-properties.js": 196,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/utils/client.js": 197,
+ "multi ../../../src/workers/parser/worker.js": 198,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/worker.js": 199,
+ "../../@babel/types/lib/validators/react/isReactComponent.js": 200,
+ "../../@babel/types/lib/validators/react/isCompatTag.js": 201,
+ "../../@babel/types/lib/builders/react/buildChildren.js": 202,
+ "../../@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js": 203,
+ "../../@babel/types/lib/builders/builder.js": 204,
+ "../../lodash/clone.js": 205,
+ "../../lodash/_baseClone.js": 206,
+ "../../lodash/_listCacheClear.js": 207,
+ "../../lodash/_listCacheDelete.js": 208,
+ "../../lodash/_listCacheGet.js": 209,
+ "../../lodash/_listCacheHas.js": 210,
+ "../../lodash/_listCacheSet.js": 211,
+ "../../lodash/_stackClear.js": 212,
+ "../../lodash/_stackDelete.js": 213,
+ "../../lodash/_stackGet.js": 214,
+ "../../lodash/_stackHas.js": 215,
+ "../../lodash/_stackSet.js": 216,
+ "../../lodash/_baseIsNative.js": 217,
+ "../../lodash/_isMasked.js": 218,
+ "../../lodash/_coreJsData.js": 219,
+ "../../lodash/_getValue.js": 220,
+ "../../lodash/_mapCacheClear.js": 221,
+ "../../lodash/_Hash.js": 222,
+ "../../lodash/_hashClear.js": 223,
+ "../../lodash/_hashDelete.js": 224,
+ "../../lodash/_hashGet.js": 225,
+ "../../lodash/_hashHas.js": 226,
+ "../../lodash/_hashSet.js": 227,
+ "../../lodash/_mapCacheDelete.js": 228,
+ "../../lodash/_isKeyable.js": 229,
+ "../../lodash/_mapCacheGet.js": 230,
+ "../../lodash/_mapCacheHas.js": 231,
+ "../../lodash/_mapCacheSet.js": 232,
+ "../../lodash/_arrayEach.js": 233,
+ "../../lodash/_defineProperty.js": 234,
+ "../../lodash/_baseAssign.js": 235,
+ "../../lodash/_baseTimes.js": 236,
+ "../../lodash/_baseIsArguments.js": 237,
+ "../../lodash/stubFalse.js": 238,
+ "../../lodash/_baseIsTypedArray.js": 239,
+ "../../lodash/_nativeKeys.js": 240,
+ "../../lodash/_baseAssignIn.js": 241,
+ "../../lodash/_baseKeysIn.js": 242,
+ "../../lodash/_nativeKeysIn.js": 243,
+ "../../lodash/_cloneBuffer.js": 244,
+ "../../lodash/_copyArray.js": 245,
+ "../../lodash/_copySymbols.js": 246,
+ "../../lodash/_arrayFilter.js": 247,
+ "../../lodash/_copySymbolsIn.js": 248,
+ "../../lodash/_getAllKeysIn.js": 249,
+ "../../lodash/_DataView.js": 250,
+ "../../lodash/_Promise.js": 251,
+ "../../lodash/_WeakMap.js": 252,
+ "../../lodash/_initCloneArray.js": 253,
+ "../../lodash/_initCloneByTag.js": 254,
+ "../../lodash/_cloneDataView.js": 255,
+ "../../lodash/_cloneRegExp.js": 256,
+ "../../lodash/_cloneSymbol.js": 257,
+ "../../lodash/_cloneTypedArray.js": 258,
+ "../../lodash/_initCloneObject.js": 259,
+ "../../lodash/_baseCreate.js": 260,
+ "../../lodash/isMap.js": 261,
+ "../../lodash/_baseIsMap.js": 262,
+ "../../lodash/isSet.js": 263,
+ "../../lodash/_baseIsSet.js": 264,
+ "../../to-fast-properties/index.js": 265,
+ "../../esutils/lib/utils.js": 266,
+ "../../esutils/lib/ast.js": 267,
+ "../../esutils/lib/keyword.js": 268,
+ "../../@babel/types/lib/definitions/flow.js": 269,
+ "../../@babel/types/lib/definitions/jsx.js": 270,
+ "../../@babel/types/lib/definitions/misc.js": 271,
+ "../../@babel/types/lib/definitions/experimental.js": 272,
+ "../../@babel/types/lib/definitions/typescript.js": 273,
+ "../../@babel/types/lib/asserts/assertNode.js": 274,
+ "../../@babel/types/lib/asserts/generated/index.js": 275,
+ "../../@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js": 276,
+ "../../@babel/types/lib/builders/flow/createUnionTypeAnnotation.js": 277,
+ "../../@babel/types/lib/clone/cloneDeep.js": 278,
+ "../../@babel/types/lib/clone/cloneWithoutLoc.js": 279,
+ "../../@babel/types/lib/comments/addComment.js": 280,
+ "../../lodash/uniq.js": 281,
+ "../../lodash/_baseUniq.js": 282,
+ "../../lodash/_setCacheAdd.js": 283,
+ "../../lodash/_setCacheHas.js": 284,
+ "../../lodash/_arrayIncludes.js": 285,
+ "../../lodash/_baseIndexOf.js": 286,
+ "../../lodash/_baseIsNaN.js": 287,
+ "../../lodash/_strictIndexOf.js": 288,
+ "../../lodash/_arrayIncludesWith.js": 289,
+ "../../lodash/_createSet.js": 290,
+ "../../lodash/noop.js": 291,
+ "../../@babel/types/lib/comments/removeComments.js": 292,
+ "../../@babel/types/lib/constants/generated/index.js": 293,
+ "../../@babel/types/lib/converters/ensureBlock.js": 294,
+ "../../@babel/types/lib/converters/toBindingIdentifierName.js": 295,
+ "../../@babel/types/lib/converters/toComputedKey.js": 296,
+ "../../@babel/types/lib/converters/toExpression.js": 297,
+ "../../@babel/types/lib/converters/toKeyAlias.js": 298,
+ "../../@babel/types/lib/converters/toSequenceExpression.js": 299,
+ "../../@babel/types/lib/converters/gatherSequenceExpressions.js": 300,
+ "../../@babel/types/lib/converters/toStatement.js": 301,
+ "../../@babel/types/lib/converters/valueToNode.js": 302,
+ "../../lodash/isPlainObject.js": 303,
+ "../../lodash/isRegExp.js": 304,
+ "../../lodash/_baseIsRegExp.js": 305,
+ "../../@babel/types/lib/modifications/appendToMemberExpression.js": 306,
+ "../../@babel/types/lib/modifications/inherits.js": 307,
+ "../../@babel/types/lib/modifications/prependToMemberExpression.js": 308,
+ "../../@babel/types/lib/retrievers/getOuterBindingIdentifiers.js": 309,
+ "../../@babel/types/lib/traverse/traverse.js": 310,
+ "../../@babel/types/lib/validators/isBinding.js": 311,
+ "../../@babel/types/lib/validators/isBlockScoped.js": 312,
+ "../../@babel/types/lib/validators/isImmutable.js": 313,
+ "../../@babel/types/lib/validators/isNodesEquivalent.js": 314,
+ "../../@babel/types/lib/validators/isReferenced.js": 315,
+ "../../@babel/types/lib/validators/isScope.js": 316,
+ "../../@babel/types/lib/validators/isSpecifierDefault.js": 317,
+ "../../@babel/types/lib/validators/isValidES3Identifier.js": 318,
+ "../../@babel/types/lib/validators/isVar.js": 319,
+ "../../parse-script-tags/dist/index.js": 320,
+ "../../parse-script-tags/node_modules/babylon/lib/index.js": 321,
+ "../../parse-script-tags/dist/customParse.js": 322,
+ "../../parse-script-tags/dist/parseScriptFragment.js": 323,
+ "../../@babel/parser/lib/index.js": 324,
+ "../../@babel/generator/lib/source-map.js": 325,
+ "../../@babel/generator/lib/printer.js": 326,
+ "../../lodash/isInteger.js": 327,
+ "../../lodash/toFinite.js": 328,
+ "../../lodash/toNumber.js": 329,
+ "../../lodash/repeat.js": 330,
+ "../../lodash/_baseRepeat.js": 331,
+ "../../lodash/_isIterateeCall.js": 332,
+ "../../@babel/generator/lib/buffer.js": 333,
+ "../../trim-right/index.js": 334,
+ "../../@babel/generator/lib/node/whitespace.js": 335,
+ "../../@babel/generator/lib/node/parentheses.js": 336,
+ "../../@babel/generator/lib/generators/index.js": 337,
+ "../../@babel/generator/lib/generators/template-literals.js": 338,
+ "../../@babel/generator/lib/generators/expressions.js": 339,
+ "../../@babel/generator/lib/generators/statements.js": 340,
+ "../../@babel/generator/lib/generators/classes.js": 341,
+ "../../@babel/generator/lib/generators/methods.js": 342,
+ "../../@babel/generator/node_modules/jsesc/jsesc.js": 343,
+ "../../@babel/generator/lib/generators/flow.js": 344,
+ "../../@babel/generator/lib/generators/base.js": 345,
+ "../../@babel/generator/lib/generators/jsx.js": 346,
+ "../../@babel/generator/lib/generators/typescript.js": 347,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/inferClassName.js": 348,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/getScopes/visitor.js": 349,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/findOutOfScopeLocations.js": 350,
+ "../../lodash/_stringToPath.js": 351,
+ "../../lodash/_memoizeCapped.js": 352,
+ "../../lodash/memoize.js": 353,
+ "../../lodash/findIndex.js": 354,
+ "../../lodash/_baseMatches.js": 355,
+ "../../lodash/_baseIsMatch.js": 356,
+ "../../lodash/_baseIsEqualDeep.js": 357,
+ "../../lodash/_arraySome.js": 358,
+ "../../lodash/_equalByTag.js": 359,
+ "../../lodash/_mapToArray.js": 360,
+ "../../lodash/_equalObjects.js": 361,
+ "../../lodash/_getMatchData.js": 362,
+ "../../lodash/_baseMatchesProperty.js": 363,
+ "../../lodash/hasIn.js": 364,
+ "../../lodash/_baseHasIn.js": 365,
+ "../../lodash/_hasPath.js": 366,
+ "../../lodash/identity.js": 367,
+ "../../lodash/property.js": 368,
+ "../../lodash/_baseProperty.js": 369,
+ "../../lodash/_basePropertyDeep.js": 370,
+ "../../lodash/findLastIndex.js": 371,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/steps.js": 372,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/utils/closest.js": 373,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/validate.js": 374,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/mapExpression.js": 375,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/mapOriginalExpression.js": 376,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/mapBindings.js": 377,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/parser/mapAwaitExpression.js": 378,
+ "multi ../../../src/workers/pretty-print/worker.js": 379,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/pretty-print/worker.js": 380,
+ "../../pretty-fast/pretty-fast.js": 381,
+ "../../pretty-fast/node_modules/acorn/dist/acorn.js": 382,
+ "multi ../../../src/workers/search/worker.js": 383,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/search/worker.js": 384,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/utils/assert.js": 385,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/utils/build-query.js": 386,
+ "../../lodash/escapeRegExp.js": 387,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/workers/search/project-search.js": 388,
+ "multi ../../../packages/devtools-source-map/src/worker.js": 389,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/worker.js": 390,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/source-map.js": 391,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/base64.js": 392,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/url-browser.js": 393,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/public-api.js": 394,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/URL.js": 395,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/URL-impl.js": 396,
+ "../../tr46/index.js": 397,
+ "../../tr46/lib/regexes.js": 398,
+ "../../json-loader/index.js!../../tr46/lib/mappingTable.json": 399,
+ "../../../packages/devtools-source-map/node_modules/whatwg-url/lib/URLSearchParams-impl.js": 400,
+ "../../lodash.sortby/index.js": 401,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/mapping-list.js": 402,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/source-map-consumer.js": 403,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/binary-search.js": 404,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/wasm.js": 405,
+ "../../../packages/devtools-source-map/node_modules/source-map/lib/source-node.js": 406,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/assert.js": 407,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/fetchSourceMap.js": 408,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/wasmRemap.js": 409,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/convertToJSON.js": 410,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/getOriginalStackFrames.js": 411,
+ "multi ../../../packages/devtools-source-map/src/index.js": 412,
+ "multi ../../../src/vendors.js": 413,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/vendors.js": 414,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-config/index.js": 415,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-config/src/feature.js": 416,
+ "external \"devtools/client/shared/vendor/lodash\"": 417,
+ "../../node-libs-browser/mock/empty.js": 418,
+ "../../path-browserify/index.js": 419,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-contextmenu/menu.js": 420,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/menu/index.js": 421,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/utils/promise.js": 422,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/menu/menu-item.js": 423,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/prefs.js": 424,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/key-shortcuts.js": 425,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/zoom-keys.js": 426,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/async-storage.js": 427,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/source-utils.js": 428,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/utils/telemetry.js": 429,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/unicode-url.js": 430,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../devtools-contextmenu/menu.css": 431,
+ "../../fuzzaldrin-plus/lib/fuzzaldrin.js": 432,
+ "../../fuzzaldrin-plus/lib/filter.js": 433,
+ "../../fuzzaldrin-plus/lib/matcher.js": 434,
+ "../../react-transition-group/Transition.js": 435,
+ "../../react-lifecycles-compat/react-lifecycles-compat.es.js": 436,
+ "../../react-transition-group/utils/PropTypes.js": 437,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/tabs/index.js": 438,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/prop-types/ref.js": 439,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab.css": 440,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab-list.css": 441,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/tabs/tabs.js": 442,
+ "../../babel-loader/lib/index.js??ref--1!../../react-aria-components/src/utils/unique-id.js": 443,
+ "../../reselect/es/index.js": 444,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-splitter/index.js": 445,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-splitter/src/SplitBox.js": 446,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-splitter/src/Draggable.js": 447,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-splitter/src/SplitBox.css": 448,
+ "../../lodash-move/lib/index.js": 449,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/components/shared/Svg.js": 450,
+ "../../babel-loader/lib/index.js??ref--1!../../../images/Svg.js": 451,
+ "../../svg-inline-react/lib/index.js": 452,
+ "../../svg-inline-react/lib/util.js": 453,
+ "../../svg-inline-loader/index.js!../../../images/breakpoint.svg": 454,
+ "../../svg-inline-loader/index.js!../../../images/column-marker.svg": 455,
+ "multi ../../../packages/devtools-reps/src/index.js": 456,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/index.js": 457,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/reps/reps.css": 458,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/undefined.js": 459,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/null.js": 460,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/number.js": 461,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/object.js": 462,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/symbol.js": 463,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/infinity.js": 464,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/nan.js": 465,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/accessor.js": 466,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/accessible.js": 467,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/attribute.js": 468,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/date-time.js": 469,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/document.js": 470,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/document-type.js": 471,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/event.js": 472,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/promise.js": 473,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/regexp.js": 474,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/stylesheet.js": 475,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/comment-node.js": 476,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/element-node.js": 477,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/text-node.js": 478,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/window.js": 479,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/object-with-text.js": 480,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/reps/object-with-url.js": 481,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/index.js": 482,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/components/ObjectInspector.js": 483,
+ "external \"devtools/client/shared/vendor/react-redux\"": 484,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/actions.js": 485,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/object-inspector/components/ObjectInspector.css": 486,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/components/ObjectInspectorItem.js": 487,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-reps/src/object-inspector/utils/selection.js": 488,
+ "../../css-loader/lib/css-base.js": 489,
+ "external \"devtools/client/framework/menu\"": 490,
+ "external \"devtools/client/framework/menu-item\"": 491,
+ "../../whatwg-url/lib/url-state-machine.js": 492,
+ "../../whatwg-url/lib/urlencoded.js": 493,
+ "../../whatwg-url/lib/utils.js": 494,
+ "../../whatwg-url/lib/infra.js": 495,
+ "../../whatwg-url/lib/URLSearchParams.js": 496,
+ "../../whatwg-url/lib/public-api.js": 497,
+ "../../whatwg-url/lib/URL.js": 498,
+ "../../whatwg-url/lib/URL-impl.js": 499,
+ "../../whatwg-url/lib/URLSearchParams-impl.js": 500,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/plural-form.js": 501,
+ "multi ../../whatwg-url/lib/public-api.js": 502,
+ "external \"devtools/client/shared/vendor/whatwg-url\"": 503,
+ "external \"resource://devtools/client/shared/vendor/whatwg-url\"": 504,
+ "external \"\\n(() => { \\n importScripts \\\"resource://devtools/client/shared/vendor/whatwg-url\\\";\\n return { URL: self.URL }\\n})()\\n\"": 505,
+ "external \"\\n(() => { \\n importScripts(\\\"resource://devtools/client/shared/vendor/whatwg-url.js\\\");\\n return { URL: self.URL }\\n})()\\n\"": 506,
+ "external \"\\n(() => { \\n importScripts(\\\"resource://devtools/client/shared/vendor/whatwg-url.js\\\");\\n return { URL }\\n})()\\n\"": 507,
+ "external \"\\n(() => { \\n console.log('>> yo',importScripts(\\\"resource://devtools/client/shared/vendor/whatwg-url.js\\\"));\\n return { URL }\\n})()\\n\"": 508,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/wasmDwarfExpressions.js": 509,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-wasm-dwarf/index.js": 510,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-wasm-dwarf/src/wasmAssetBrowser.js": 511,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-wasm-dwarf/src/convertToJSON.js": 512,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-wasm-dwarf/src/wasmXScopes.js": 513,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-wasm-dwarf/src/wasmDwarfExpressions.js": 514,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-source-map/src/utils/assetRootBrowser.js": 515,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/async-store-helper.js": 516,
+ "../../@babel/types/lib/validators/isPlaceholderType.js": 517,
+ "../../@babel/types/lib/definitions/placeholders.js": 518,
+ "../../webpack/buildin/harmony-module.js": 519,
+ "../../babel-loader/lib/index.js??ref--1!../../devtools-modules/src/saveAs.js": 520,
+ "../../punycode/punycode.js": 521,
+ "../../babel-loader/lib/index.js??ref--1!../../../../../shared/dom-node-constants.js": 522,
+ "../../@babel/helper-validator-identifier/lib/index.js": 523,
+ "../../@babel/helper-validator-identifier/lib/identifier.js": 524,
+ "../../@babel/helper-validator-identifier/lib/keyword.js": 525,
+ "../../@babel/types/lib/clone/cloneDeepWithoutLoc.js": 526,
+ "../../../packages/devtools-reps/node_modules/React/index.js": 527,
+ "../../../packages/devtools-reps/node_modules/React/cjs/react.production.min.js": 528,
+ "../../object-assign/index.js": 529,
+ "../../fbjs/lib/invariant.js": 530,
+ "../../fbjs/lib/emptyObject.js": 531,
+ "../../fbjs/lib/emptyFunction.js": 532,
+ "external \"\\n(() => {\\n let factory;\\n function define(...args) {\\n if (factory) {\\n throw new Error(\\\"expected a single define call\\\");\\n }\\n\\n if (\\n args.length !== 2 ||\\n !Array.isArray(args[0]) ||\\n args[0].length !== 0 ||\\n typeof args[1] !== \\\"function\\\"\\n ) {\\n throw new Error(\\\"whatwg-url had unexpected factory arguments.\\\");\\n }\\n\\n factory = args[1];\\n }\\n define.amd = true;\\n\\n const existingDefine = Object.getOwnPropertyDescriptor(globalThis, \\\"define\\\");\\n globalThis.define = define;\\n let err;\\n try {\\n importScripts(\\\"resource://devtools/client/shared/vendor/whatwg-url.js\\\");\\n\\n if (!factory) {\\n throw new Error(\\\"Failed to load whatwg-url factory\\\");\\n }\\n } finally {\\n if (existingDefine) {\\n Object.defineProperty(globalThis, \\\"define\\\", existingDefine);\\n } else {\\n delete globalThis.define;\\n }\\n\\n }\\n\\n return factory();\\n})()\\n\"": 533,
+ "../../@babel/types/lib/builders/flow/createFlowUnionType.js": 534,
+ "../../@babel/types/lib/builders/typescript/createTSUnionType.js": 535,
+ "../../@babel/types/lib/modifications/typescript/removeTypeDuplicates.js": 536,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/utils/event-emitter.js": 537,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/index.js": 538,
+ "../../../packages/devtools-modules/src/prefs.js": 539,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/utils/promise.js": 540,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/key-shortcuts.js": 541,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/zoom-keys.js": 542,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/async-storage.js": 543,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/source-utils.js": 544,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/utils/telemetry.js": 545,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/unicode-url.js": 546,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/plural-form.js": 547,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/saveAs.js": 548,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-modules/src/async-store-helper.js": 549,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-config/index.js": 550,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-config/src/feature.js": 551,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-contextmenu/menu.js": 552,
+ "../../extract-text-webpack-plugin/dist/loader.js??ref--3-0!../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-contextmenu/menu.css": 553,
+ "../../babel-loader/lib/index.js??ref--1!../../../packages/devtools-environment/index.js": 554,
+ "../../babel-loader/lib/index.js??ref--1!../../../src/context-menu/menu.js": 555,
+ "../../babel-loader/lib/index.js??ref--1!../../../../framework/menu.js": 556,
+ "../../babel-loader/lib/index.js??ref--1!../../../../framework/menu-item.js": 557,
+ "../../babel-loader/lib/index.js??ref--1!../../../../shared/telemetry.js": 558,
+ "../node_modules/@babel/types/lib/index.js": 2,
+ "../node_modules/@babel/types/lib/validators/generated/index.js": 559,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-utils/index.js": 560,
+ "../node_modules/@babel/types/lib/builders/generated/index.js": 561,
+ "../node_modules/lodash/_root.js": 562,
+ "../node_modules/lodash/isArray.js": 563,
+ "../node_modules/@babel/types/lib/definitions/index.js": 564,
+ "../node_modules/lodash/isObjectLike.js": 565,
+ "../node_modules/source-map/lib/util.js": 566,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-utils/src/privileged-network-request.js": 567,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-utils/src/worker-utils.js": 568,
+ "../node_modules/lodash/_baseGetTag.js": 569,
+ "../node_modules/lodash/_Symbol.js": 570,
+ "../node_modules/@babel/types/lib/definitions/utils.js": 571,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/ast.js": 572,
+ "../node_modules/lodash/isObject.js": 573,
+ "../node_modules/lodash/_getNative.js": 574,
+ "../node_modules/@babel/types/lib/constants/index.js": 575,
+ "../node_modules/@babel/types/lib/clone/cloneNode.js": 576,
+ "../node_modules/lodash/isSymbol.js": 577,
+ "../node_modules/lodash/_getTag.js": 578,
+ "../node_modules/@babel/types/lib/validators/is.js": 579,
+ "../node_modules/@babel/types/lib/validators/isValidIdentifier.js": 580,
+ "../node_modules/source-map/lib/source-map-generator.js": 581,
+ "../node_modules/source-map/lib/base64-vlq.js": 582,
+ "../node_modules/source-map/lib/array-set.js": 583,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/index.js": 584,
+ "../node_modules/charenc/charenc.js": 585,
+ "../node_modules/lodash/_ListCache.js": 586,
+ "../node_modules/lodash/_assocIndexOf.js": 587,
+ "../node_modules/lodash/eq.js": 588,
+ "../node_modules/lodash/_freeGlobal.js": 589,
+ "../node_modules/webpack/buildin/global.js": 590,
+ "../node_modules/lodash/_nativeCreate.js": 591,
+ "../node_modules/lodash/_getMapData.js": 592,
+ "../node_modules/lodash/_copyObject.js": 593,
+ "../node_modules/lodash/keys.js": 594,
+ "../node_modules/lodash/isBuffer.js": 595,
+ "../node_modules/lodash/_baseUnary.js": 596,
+ "../node_modules/lodash/_nodeUtil.js": 597,
+ "../node_modules/lodash/_isPrototype.js": 598,
+ "../node_modules/lodash/isArrayLike.js": 599,
+ "../node_modules/@babel/types/lib/definitions/core.js": 600,
+ "../node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js": 601,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/helpers.js": 602,
+ "../node_modules/@babel/generator/lib/index.js": 603,
+ "../node_modules/lodash/toInteger.js": 604,
+ "../node_modules/lodash/toString.js": 605,
+ "../node_modules/lodash/_toKey.js": 606,
+ "../node_modules/process/browser.js": 607,
+ "../packages/devtools-source-map/node_modules/source-map/source-map.js": 608,
+ "../packages/devtools-source-map/node_modules/source-map/lib/util.js": 609,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-wasm-dwarf/index.js": 610,
+ "../node_modules/fuzzaldrin-plus/lib/scorer.js": 611,
+ "../node_modules/@babel/types/lib/utils/shallowEqual.js": 612,
+ "../node_modules/lodash/_Stack.js": 613,
+ "../node_modules/lodash/_Map.js": 614,
+ "../node_modules/lodash/_getRawTag.js": 615,
+ "../node_modules/lodash/_objectToString.js": 616,
+ "../node_modules/lodash/_MapCache.js": 617,
+ "../node_modules/lodash/isArguments.js": 618,
+ "../node_modules/webpack/buildin/module.js": 619,
+ "../node_modules/lodash/_isIndex.js": 620,
+ "../node_modules/lodash/isTypedArray.js": 621,
+ "../node_modules/lodash/isLength.js": 622,
+ "../node_modules/lodash/_getSymbols.js": 623,
+ "../node_modules/lodash/_getPrototype.js": 624,
+ "../node_modules/lodash/_cloneArrayBuffer.js": 625,
+ "../node_modules/@babel/types/lib/validators/isType.js": 626,
+ "../node_modules/@babel/types/lib/validators/validate.js": 627,
+ "../node_modules/@babel/types/lib/definitions/es2015.js": 628,
+ "../node_modules/@babel/types/lib/utils/inherit.js": 629,
+ "../node_modules/lodash/_baseFindIndex.js": 630,
+ "../node_modules/lodash/_setToArray.js": 631,
+ "../node_modules/source-map/source-map.js": 632,
+ "../node_modules/source-map/lib/base64.js": 633,
+ "../node_modules/source-map/lib/mapping-list.js": 634,
+ "../node_modules/source-map/lib/source-map-consumer.js": 635,
+ "../node_modules/source-map/lib/binary-search.js": 636,
+ "../node_modules/source-map/lib/quick-sort.js": 637,
+ "../node_modules/source-map/lib/source-node.js": 638,
+ "../node_modules/lodash/_baseToString.js": 639,
+ "../node_modules/lodash/_arrayMap.js": 640,
+ "../node_modules/lodash/_isKey.js": 641,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-environment/index.js": 642,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/sourceMapRequests.js": 643,
+ "../node_modules/md5/md5.js": 644,
+ "../node_modules/crypt/crypt.js": 645,
+ "../node_modules/is-buffer/index.js": 646,
+ "../node_modules/fuzzaldrin-plus/lib/pathScorer.js": 647,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/getSymbols.js": 648,
+ "../node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js": 649,
+ "../node_modules/@babel/types/lib/validators/matchesPattern.js": 650,
+ "../node_modules/lodash/isFunction.js": 651,
+ "../node_modules/lodash/_toSource.js": 652,
+ "../node_modules/lodash/_assignValue.js": 653,
+ "../node_modules/lodash/_baseAssignValue.js": 654,
+ "../node_modules/lodash/_arrayLikeKeys.js": 655,
+ "../node_modules/lodash/_baseKeys.js": 656,
+ "../node_modules/lodash/_overArg.js": 657,
+ "../node_modules/lodash/keysIn.js": 658,
+ "../node_modules/lodash/stubArray.js": 659,
+ "../node_modules/lodash/_getSymbolsIn.js": 660,
+ "../node_modules/lodash/_arrayPush.js": 661,
+ "../node_modules/lodash/_getAllKeys.js": 662,
+ "../node_modules/lodash/_baseGetAllKeys.js": 663,
+ "../node_modules/lodash/_Set.js": 664,
+ "../node_modules/lodash/_Uint8Array.js": 665,
+ "../node_modules/@babel/types/lib/validators/isPlaceholderType.js": 666,
+ "../node_modules/@babel/helper-validator-identifier/lib/index.js": 667,
+ "../node_modules/@babel/types/lib/definitions/placeholders.js": 668,
+ "../node_modules/@babel/types/lib/validators/isNode.js": 669,
+ "../node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js": 670,
+ "../node_modules/@babel/types/lib/comments/addComments.js": 671,
+ "../node_modules/@babel/types/lib/comments/inheritInnerComments.js": 672,
+ "../node_modules/lodash/_SetCache.js": 673,
+ "../node_modules/lodash/_cacheHas.js": 674,
+ "../node_modules/@babel/types/lib/comments/inheritLeadingComments.js": 675,
+ "../node_modules/@babel/types/lib/comments/inheritsComments.js": 676,
+ "../node_modules/@babel/types/lib/comments/inheritTrailingComments.js": 677,
+ "../node_modules/@babel/types/lib/converters/toBlock.js": 678,
+ "../node_modules/@babel/types/lib/converters/toIdentifier.js": 679,
+ "../node_modules/@babel/types/lib/modifications/removePropertiesDeep.js": 680,
+ "../node_modules/@babel/types/lib/traverse/traverseFast.js": 681,
+ "../node_modules/@babel/types/lib/modifications/removeProperties.js": 682,
+ "../node_modules/@babel/types/lib/validators/isLet.js": 683,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/simple-path.js": 684,
+ "../node_modules/@babel/parser/lib/index.js": 685,
+ "../node_modules/lodash/isEmpty.js": 686,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/sources.js": 687,
+ "../node_modules/@babel/generator/lib/node/index.js": 688,
+ "../node_modules/@babel/generator/lib/generators/modules.js": 689,
+ "../node_modules/@babel/generator/lib/generators/types.js": 690,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/getFunctionName.js": 691,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/getScopes/index.js": 692,
+ "../node_modules/lodash/_baseIteratee.js": 693,
+ "../node_modules/lodash/_baseIsEqual.js": 694,
+ "../node_modules/lodash/_equalArrays.js": 695,
+ "../node_modules/lodash/_isStrictComparable.js": 696,
+ "../node_modules/lodash/_matchesStrictComparable.js": 697,
+ "../node_modules/lodash/_baseGet.js": 698,
+ "../node_modules/lodash/_castPath.js": 699,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/contains.js": 700,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/search/get-matches.js": 701,
+ "../packages/devtools-source-map/node_modules/source-map/lib/source-map-generator.js": 702,
+ "../packages/devtools-source-map/node_modules/source-map/lib/base64-vlq.js": 703,
+ "../packages/devtools-source-map/node_modules/source-map/lib/array-set.js": 704,
+ "../packages/devtools-source-map/node_modules/source-map/lib/read-wasm-browser.js": 705,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/createConsumer.js": 706,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-wasm-dwarf/src/wasmAssetBrowser.js": 707,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/index.js": 708,
+ "../node_modules/fuzzaldrin-plus/lib/query.js": 709,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/tabs/tab-list.js": 710,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/tabs/tab.js": 711,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/tabs/tab-panels.js": 712,
+ "multi workers/parser/worker.js": 713,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/worker.js": 714,
+ "../node_modules/@babel/types/lib/validators/react/isReactComponent.js": 715,
+ "../node_modules/@babel/types/lib/validators/react/isCompatTag.js": 716,
+ "../node_modules/@babel/types/lib/builders/react/buildChildren.js": 717,
+ "../node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js": 718,
+ "../node_modules/@babel/types/lib/builders/builder.js": 719,
+ "../node_modules/lodash/clone.js": 720,
+ "../node_modules/lodash/_baseClone.js": 721,
+ "../node_modules/lodash/_listCacheClear.js": 722,
+ "../node_modules/lodash/_listCacheDelete.js": 723,
+ "../node_modules/lodash/_listCacheGet.js": 724,
+ "../node_modules/lodash/_listCacheHas.js": 725,
+ "../node_modules/lodash/_listCacheSet.js": 726,
+ "../node_modules/lodash/_stackClear.js": 727,
+ "../node_modules/lodash/_stackDelete.js": 728,
+ "../node_modules/lodash/_stackGet.js": 729,
+ "../node_modules/lodash/_stackHas.js": 730,
+ "../node_modules/lodash/_stackSet.js": 731,
+ "../node_modules/lodash/_baseIsNative.js": 732,
+ "../node_modules/lodash/_isMasked.js": 733,
+ "../node_modules/lodash/_coreJsData.js": 734,
+ "../node_modules/lodash/_getValue.js": 735,
+ "../node_modules/lodash/_mapCacheClear.js": 736,
+ "../node_modules/lodash/_Hash.js": 737,
+ "../node_modules/lodash/_hashClear.js": 738,
+ "../node_modules/lodash/_hashDelete.js": 739,
+ "../node_modules/lodash/_hashGet.js": 740,
+ "../node_modules/lodash/_hashHas.js": 741,
+ "../node_modules/lodash/_hashSet.js": 742,
+ "../node_modules/lodash/_mapCacheDelete.js": 743,
+ "../node_modules/lodash/_isKeyable.js": 744,
+ "../node_modules/lodash/_mapCacheGet.js": 745,
+ "../node_modules/lodash/_mapCacheHas.js": 746,
+ "../node_modules/lodash/_mapCacheSet.js": 747,
+ "../node_modules/lodash/_arrayEach.js": 748,
+ "../node_modules/lodash/_defineProperty.js": 749,
+ "../node_modules/lodash/_baseAssign.js": 750,
+ "../node_modules/lodash/_baseTimes.js": 751,
+ "../node_modules/lodash/_baseIsArguments.js": 752,
+ "../node_modules/lodash/stubFalse.js": 753,
+ "../node_modules/lodash/_baseIsTypedArray.js": 754,
+ "../node_modules/lodash/_nativeKeys.js": 755,
+ "../node_modules/lodash/_baseAssignIn.js": 756,
+ "../node_modules/lodash/_baseKeysIn.js": 757,
+ "../node_modules/lodash/_nativeKeysIn.js": 758,
+ "../node_modules/lodash/_cloneBuffer.js": 759,
+ "../node_modules/lodash/_copyArray.js": 760,
+ "../node_modules/lodash/_copySymbols.js": 761,
+ "../node_modules/lodash/_arrayFilter.js": 762,
+ "../node_modules/lodash/_copySymbolsIn.js": 763,
+ "../node_modules/lodash/_getAllKeysIn.js": 764,
+ "../node_modules/lodash/_DataView.js": 765,
+ "../node_modules/lodash/_Promise.js": 766,
+ "../node_modules/lodash/_WeakMap.js": 767,
+ "../node_modules/lodash/_initCloneArray.js": 768,
+ "../node_modules/lodash/_initCloneByTag.js": 769,
+ "../node_modules/lodash/_cloneDataView.js": 770,
+ "../node_modules/lodash/_cloneRegExp.js": 771,
+ "../node_modules/lodash/_cloneSymbol.js": 772,
+ "../node_modules/lodash/_cloneTypedArray.js": 773,
+ "../node_modules/lodash/_initCloneObject.js": 774,
+ "../node_modules/lodash/_baseCreate.js": 775,
+ "../node_modules/lodash/isMap.js": 776,
+ "../node_modules/lodash/_baseIsMap.js": 777,
+ "../node_modules/lodash/isSet.js": 778,
+ "../node_modules/lodash/_baseIsSet.js": 779,
+ "../node_modules/to-fast-properties/index.js": 780,
+ "../node_modules/@babel/helper-validator-identifier/lib/identifier.js": 781,
+ "../node_modules/@babel/helper-validator-identifier/lib/keyword.js": 782,
+ "../node_modules/@babel/types/lib/definitions/flow.js": 783,
+ "../node_modules/@babel/types/lib/definitions/jsx.js": 784,
+ "../node_modules/@babel/types/lib/definitions/misc.js": 785,
+ "../node_modules/@babel/types/lib/definitions/experimental.js": 786,
+ "../node_modules/@babel/types/lib/definitions/typescript.js": 787,
+ "../node_modules/@babel/types/lib/asserts/assertNode.js": 788,
+ "../node_modules/@babel/types/lib/asserts/generated/index.js": 789,
+ "../node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js": 790,
+ "../node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js": 791,
+ "../node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js": 792,
+ "../node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js": 793,
+ "../node_modules/@babel/types/lib/clone/clone.js": 794,
+ "../node_modules/@babel/types/lib/clone/cloneDeep.js": 795,
+ "../node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js": 796,
+ "../node_modules/@babel/types/lib/clone/cloneWithoutLoc.js": 797,
+ "../node_modules/@babel/types/lib/comments/addComment.js": 798,
+ "../node_modules/lodash/uniq.js": 799,
+ "../node_modules/lodash/_baseUniq.js": 800,
+ "../node_modules/lodash/_setCacheAdd.js": 801,
+ "../node_modules/lodash/_setCacheHas.js": 802,
+ "../node_modules/lodash/_arrayIncludes.js": 803,
+ "../node_modules/lodash/_baseIndexOf.js": 804,
+ "../node_modules/lodash/_baseIsNaN.js": 805,
+ "../node_modules/lodash/_strictIndexOf.js": 806,
+ "../node_modules/lodash/_arrayIncludesWith.js": 807,
+ "../node_modules/lodash/_createSet.js": 808,
+ "../node_modules/lodash/noop.js": 809,
+ "../node_modules/@babel/types/lib/comments/removeComments.js": 810,
+ "../node_modules/@babel/types/lib/constants/generated/index.js": 811,
+ "../node_modules/@babel/types/lib/converters/ensureBlock.js": 812,
+ "../node_modules/@babel/types/lib/converters/toBindingIdentifierName.js": 813,
+ "../node_modules/@babel/types/lib/converters/toComputedKey.js": 814,
+ "../node_modules/@babel/types/lib/converters/toExpression.js": 815,
+ "../node_modules/@babel/types/lib/converters/toKeyAlias.js": 816,
+ "../node_modules/@babel/types/lib/converters/toSequenceExpression.js": 817,
+ "../node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js": 818,
+ "../node_modules/@babel/types/lib/converters/toStatement.js": 819,
+ "../node_modules/@babel/types/lib/converters/valueToNode.js": 820,
+ "../node_modules/lodash/isPlainObject.js": 821,
+ "../node_modules/lodash/isRegExp.js": 822,
+ "../node_modules/lodash/_baseIsRegExp.js": 823,
+ "../node_modules/@babel/types/lib/modifications/appendToMemberExpression.js": 824,
+ "../node_modules/@babel/types/lib/modifications/inherits.js": 825,
+ "../node_modules/@babel/types/lib/modifications/prependToMemberExpression.js": 826,
+ "../node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js": 827,
+ "../node_modules/@babel/types/lib/traverse/traverse.js": 828,
+ "../node_modules/@babel/types/lib/validators/isBinding.js": 829,
+ "../node_modules/@babel/types/lib/validators/isBlockScoped.js": 830,
+ "../node_modules/@babel/types/lib/validators/isImmutable.js": 831,
+ "../node_modules/@babel/types/lib/validators/isNodesEquivalent.js": 832,
+ "../node_modules/@babel/types/lib/validators/isReferenced.js": 833,
+ "../node_modules/@babel/types/lib/validators/isScope.js": 834,
+ "../node_modules/@babel/types/lib/validators/isSpecifierDefault.js": 835,
+ "../node_modules/@babel/types/lib/validators/isValidES3Identifier.js": 836,
+ "../node_modules/@babel/types/lib/validators/isVar.js": 837,
+ "../node_modules/parse-script-tags/dist/index.js": 838,
+ "../node_modules/parse-script-tags/dist/customParse.js": 839,
+ "../node_modules/parse-script-tags/dist/parseScriptFragment.js": 840,
+ "../node_modules/@babel/generator/lib/source-map.js": 841,
+ "../node_modules/@babel/generator/lib/printer.js": 842,
+ "../node_modules/lodash/isInteger.js": 843,
+ "../node_modules/lodash/toFinite.js": 844,
+ "../node_modules/lodash/toNumber.js": 845,
+ "../node_modules/lodash/repeat.js": 846,
+ "../node_modules/lodash/_baseRepeat.js": 847,
+ "../node_modules/lodash/_isIterateeCall.js": 848,
+ "../node_modules/@babel/generator/lib/buffer.js": 849,
+ "../node_modules/@babel/generator/lib/node/whitespace.js": 850,
+ "../node_modules/@babel/generator/lib/node/parentheses.js": 851,
+ "../node_modules/@babel/generator/lib/generators/index.js": 852,
+ "../node_modules/@babel/generator/lib/generators/template-literals.js": 853,
+ "../node_modules/@babel/generator/lib/generators/expressions.js": 854,
+ "../node_modules/@babel/generator/lib/generators/statements.js": 855,
+ "../node_modules/@babel/generator/lib/generators/classes.js": 856,
+ "../node_modules/@babel/generator/lib/generators/methods.js": 857,
+ "../node_modules/jsesc/jsesc.js": 858,
+ "../node_modules/buffer/index.js": 859,
+ "../node_modules/base64-js/index.js": 860,
+ "../node_modules/ieee754/index.js": 861,
+ "../node_modules/isarray/index.js": 862,
+ "../node_modules/@babel/generator/lib/generators/flow.js": 863,
+ "../node_modules/@babel/generator/lib/generators/base.js": 864,
+ "../node_modules/@babel/generator/lib/generators/jsx.js": 865,
+ "../node_modules/@babel/generator/lib/generators/typescript.js": 866,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/inferClassName.js": 867,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/frameworks.js": 868,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/getScopes/visitor.js": 869,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/findOutOfScopeLocations.js": 870,
+ "../node_modules/lodash/findIndex.js": 871,
+ "../node_modules/lodash/_baseMatches.js": 872,
+ "../node_modules/lodash/_baseIsMatch.js": 873,
+ "../node_modules/lodash/_baseIsEqualDeep.js": 874,
+ "../node_modules/lodash/_arraySome.js": 875,
+ "../node_modules/lodash/_equalByTag.js": 876,
+ "../node_modules/lodash/_mapToArray.js": 877,
+ "../node_modules/lodash/_equalObjects.js": 878,
+ "../node_modules/lodash/_getMatchData.js": 879,
+ "../node_modules/lodash/_baseMatchesProperty.js": 880,
+ "../node_modules/lodash/get.js": 881,
+ "../node_modules/lodash/_stringToPath.js": 882,
+ "../node_modules/lodash/_memoizeCapped.js": 883,
+ "../node_modules/lodash/memoize.js": 884,
+ "../node_modules/lodash/hasIn.js": 885,
+ "../node_modules/lodash/_baseHasIn.js": 886,
+ "../node_modules/lodash/_hasPath.js": 887,
+ "../node_modules/lodash/identity.js": 888,
+ "../node_modules/lodash/property.js": 889,
+ "../node_modules/lodash/_baseProperty.js": 890,
+ "../node_modules/lodash/_basePropertyDeep.js": 891,
+ "../node_modules/lodash/findLastIndex.js": 892,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/steps.js": 893,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/utils/closest.js": 894,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/validate.js": 895,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/mapExpression.js": 896,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/mapOriginalExpression.js": 897,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/mapBindings.js": 898,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/parser/mapAwaitExpression.js": 899,
+ "multi workers/pretty-print/worker.js": 900,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/pretty-print/worker.js": 901,
+ "../node_modules/pretty-fast/pretty-fast.js": 902,
+ "../node_modules/pretty-fast/node_modules/acorn/dist/acorn.js": 903,
+ "multi workers/search/worker.js": 904,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/search/worker.js": 905,
+ "../node_modules/babel-loader/lib/index.js??ref--1!utils/assert.js": 906,
+ "../node_modules/babel-loader/lib/index.js??ref--1!utils/build-query.js": 907,
+ "../node_modules/lodash/escapeRegExp.js": 908,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/search/project-search.js": 909,
+ "multi ../packages/devtools-source-map/src/worker.js": 910,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/worker.js": 911,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/source-map.js": 912,
+ "../packages/devtools-source-map/node_modules/source-map/lib/base64.js": 913,
+ "../packages/devtools-source-map/node_modules/source-map/lib/url-browser.js": 914,
+ "../packages/devtools-source-map/node_modules/source-map/lib/mapping-list.js": 915,
+ "../packages/devtools-source-map/node_modules/source-map/lib/source-map-consumer.js": 916,
+ "../packages/devtools-source-map/node_modules/source-map/lib/binary-search.js": 917,
+ "../packages/devtools-source-map/node_modules/source-map/lib/wasm.js": 918,
+ "../packages/devtools-source-map/node_modules/source-map/lib/source-node.js": 919,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/assert.js": 920,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/fetchSourceMap.js": 921,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/wasmRemap.js": 922,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-wasm-dwarf/src/convertToJSON.js": 923,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-wasm-dwarf/src/wasmXScopes.js": 924,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-wasm-dwarf/src/wasmDwarfExpressions.js": 925,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/getOriginalStackFrames.js": 926,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/assetRootBrowser.js": 927,
+ "multi ../packages/devtools-source-map/src/index.js": 928,
+ "multi vendors.js": 929,
+ "../node_modules/babel-loader/lib/index.js??ref--1!vendors.js": 930,
+ "../node_modules/fuzzaldrin-plus/lib/fuzzaldrin.js": 931,
+ "../node_modules/fuzzaldrin-plus/lib/filter.js": 932,
+ "../node_modules/fuzzaldrin-plus/lib/matcher.js": 933,
+ "../node_modules/react-transition-group/Transition.js": 934,
+ "../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js": 935,
+ "../node_modules/react-transition-group/utils/PropTypes.js": 936,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/tabs/index.js": 937,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/prop-types/ref.js": 938,
+ "../node_modules/extract-text-webpack-plugin/dist/loader.js??ref--3-0!../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../node_modules/react-aria-components/src/tabs/tab.css": 939,
+ "../node_modules/extract-text-webpack-plugin/dist/loader.js??ref--3-0!../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../node_modules/react-aria-components/src/tabs/tab-list.css": 940,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/tabs/tabs.js": 941,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../node_modules/react-aria-components/src/utils/unique-id.js": 942,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-splitter/index.js": 944,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-splitter/src/SplitBox.js": 945,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-splitter/src/Draggable.js": 946,
+ "../node_modules/extract-text-webpack-plugin/dist/loader.js??ref--3-0!../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../packages/devtools-splitter/src/SplitBox.css": 947,
+ "../node_modules/lodash-move/lib/index.js": 948,
+ "../node_modules/css-loader/lib/css-base.js": 949,
+ "../node_modules/babel-loader/lib/index.js?ignore=src/lib!workers/parser/worker.js": 950,
+ "../node_modules/babel-loader/lib/index.js?ignore=src/lib!workers/pretty-print/worker.js": 951,
+ "../node_modules/babel-loader/lib/index.js?ignore=src/lib!workers/search/worker.js": 952,
+ "../node_modules/babel-loader/lib/index.js?ignore=src/lib!../packages/devtools-source-map/src/worker.js": 953,
+ "../node_modules/babel-loader/lib/index.js?ignore=src/lib!../packages/devtools-source-map/src/index.js": 954,
+ "../node_modules/babel-loader/lib/index.js?ignore=src/lib!vendors.js": 955,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-utils/src/network-request.js": 956,
+ "../node_modules/extract-text-webpack-plugin/dist/loader.js??ref--3-0!../node_modules/css-loader/index.js??ref--3-1!../node_modules/react-aria-components/src/tabs/tab.css": 957,
+ "../node_modules/extract-text-webpack-plugin/dist/loader.js??ref--3-0!../node_modules/css-loader/index.js??ref--3-1!../node_modules/react-aria-components/src/tabs/tab-list.css": 958,
+ "../node_modules/extract-text-webpack-plugin/dist/loader.js??ref--3-0!../node_modules/css-loader/index.js??ref--3-1!../packages/devtools-splitter/src/SplitBox.css": 959,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../../shared/DevToolsUtils.js": 960,
+ "../node_modules/babel-loader/lib/index.js??ref--1!utils/utils.js": 961,
+ "../node_modules/timers-browserify/main.js": 962,
+ "../node_modules/setimmediate/setImmediate.js": 963,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../../shared/flags.js": 964,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../../shared/platform/stack.js": 965,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../../shared/ThreadSafeDevToolsUtils.js": 966,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../../shared/webconsole/network-helper.js": 967,
+ "../node_modules/babel-loader/lib/index.js??ref--1!utils/environment.js": 968,
+ "../node_modules/pretty-fast/node_modules/acorn/dist/acorn.mjs": 969,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/generated/index.js": 970,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/builders/generated/index.js": 971,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/index.js": 972,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/utils.js": 973,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/constants/index.js": 974,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/clone/cloneNode.js": 975,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/is.js": 976,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isValidIdentifier.js": 977,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/core.js": 978,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js": 979,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/utils/shallowEqual.js": 980,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isType.js": 981,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/validate.js": 982,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/es2015.js": 983,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/utils/inherit.js": 984,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/index.js": 985,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js": 986,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/matchesPattern.js": 987,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isPlaceholderType.js": 988,
+ "../node_modules/parse-script-tags/node_modules/@babel/helper-validator-identifier/lib/index.js": 989,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/placeholders.js": 990,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isNode.js": 991,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js": 992,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/addComments.js": 993,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/inheritInnerComments.js": 994,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/inheritLeadingComments.js": 995,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/inheritsComments.js": 996,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/inheritTrailingComments.js": 997,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toBlock.js": 998,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toIdentifier.js": 999,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js": 1000,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/traverse/traverseFast.js": 1001,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/removeProperties.js": 1002,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isLet.js": 1003,
+ "../node_modules/@babel/types/lib/builders/generated/uppercase.js": 1004,
+ "../node_modules/@babel/types/lib/ast-types/generated/index.js": 1005,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/react/isReactComponent.js": 1006,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/react/isCompatTag.js": 1007,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/builders/react/buildChildren.js": 1008,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js": 1009,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/builders/builder.js": 1010,
+ "../node_modules/parse-script-tags/node_modules/@babel/helper-validator-identifier/lib/identifier.js": 1011,
+ "../node_modules/parse-script-tags/node_modules/@babel/helper-validator-identifier/lib/keyword.js": 1012,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/flow.js": 1013,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/jsx.js": 1014,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/misc.js": 1015,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/experimental.js": 1016,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/definitions/typescript.js": 1017,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/asserts/assertNode.js": 1018,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/asserts/generated/index.js": 1019,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js": 1020,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js": 1021,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js": 1022,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js": 1023,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/clone/clone.js": 1024,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/clone/cloneDeep.js": 1025,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js": 1026,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js": 1027,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/addComment.js": 1028,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/comments/removeComments.js": 1029,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/constants/generated/index.js": 1030,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/ensureBlock.js": 1031,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js": 1032,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toComputedKey.js": 1033,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toExpression.js": 1034,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toKeyAlias.js": 1035,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toSequenceExpression.js": 1036,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js": 1037,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/toStatement.js": 1038,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/converters/valueToNode.js": 1039,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js": 1040,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/inherits.js": 1041,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js": 1042,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js": 1043,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/traverse/traverse.js": 1044,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isBinding.js": 1045,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isBlockScoped.js": 1046,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isImmutable.js": 1047,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isNodesEquivalent.js": 1048,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isReferenced.js": 1049,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isScope.js": 1050,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isSpecifierDefault.js": 1051,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isValidES3Identifier.js": 1052,
+ "../node_modules/parse-script-tags/node_modules/@babel/types/lib/validators/isVar.js": 1053,
+ "../node_modules/parse-script-tags/node_modules/@babel/parser/lib/index.js": 1054,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/worker-handler.js": 1055,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/network-request.js": 1056,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/worker-dispatcher.js": 1057,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/utils/privileged-network-request.js": 1058,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/worker-utils.js": 1059,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/url-state-machine.js": 1060,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/urlencoded.js": 1061,
+ "../packages/devtools-source-map/node_modules/webidl-conversions/lib/index.js": 1062,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/utils.js": 1063,
+ "../node_modules/node-libs-browser/node_modules/punycode/punycode.js": 1064,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/infra.js": 1065,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/URLSearchParams.js": 1066,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/public-api.js": 1067,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/URL.js": 1068,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/URL-impl.js": 1069,
+ "../packages/devtools-source-map/node_modules/tr46/index.js": 1070,
+ "../packages/devtools-source-map/node_modules/tr46/lib/regexes.js": 1071,
+ "../node_modules/json-loader/index.js!../packages/devtools-source-map/node_modules/tr46/lib/mappingTable.json": 1072,
+ "../packages/devtools-source-map/node_modules/whatwg-url/lib/URLSearchParams-impl.js": 1073,
+ "../node_modules/lodash.sortby/index.js": 1074,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/wasm-dwarf/wasmXScopes.js": 1075,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/wasm-dwarf/wasmDwarfExpressions.js": 1076,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/wasm-dwarf/wasmAsset.js": 1077,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/wasm-dwarf/convertToJSON.js": 1078,
+ "../node_modules/node-libs-browser/mock/empty.js": 1079,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/assets.js": 1080,
+ "../packages/devtools-source-map/node_modules/source-map/lib/mappings.wasm": 1081,
+ "../packages/devtools-source-map/wasm/dwarf_to_json.wasm": 1082,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/devtools-source-map/src/wasm-dwarf/wasmAssetBrowser.js": 1083,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/md5.js": 1084,
+ "../../../../node_modules/is-buffer/index.js": 1085,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/util.js": 1086,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/source-map.js": 1087,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/source-map-generator.js": 1088,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/base64-vlq.js": 1089,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/array-set.js": 1090,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/read-wasm-browser.js": 1091,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/base64.js": 1092,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/mapping-list.js": 1093,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/source-map-consumer.js": 1094,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/binary-search.js": 1095,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/wasm.js": 1096,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/source-node.js": 1097,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/read-wasm.js": 1098,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/source-map/lib/url.js": 1099,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../../shared/vendor/whatwg-url.js": 1100,
+ "../node_modules/path-browserify/index.js": 1101,
+ "../node_modules/babel-loader/lib/index.js??ref--1!../packages/pretty-fast/pretty-fast.js": 1102,
+ "../node_modules/acorn/dist/acorn.mjs": 1103,
+ "../packages/pretty-fast/node_modules/acorn/dist/acorn.mjs": 1104,
+ "../node_modules/babel-loader/lib/index.js??ref--1!workers/pretty-print/pretty-fast.js": 1105,
+ "../node_modules/acorn/dist/acorn.es.js": 1106,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/util.js": 1107,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/source-map-generator.js": 1108,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/base64-vlq.js": 1109,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/array-set.js": 1110,
+ "../node_modules/source-map/lib/read-wasm.js": 1111,
+ "../node_modules/@babel/generator/node_modules/source-map/source-map.js": 1112,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/base64.js": 1113,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/mapping-list.js": 1114,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/source-map-consumer.js": 1115,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/binary-search.js": 1116,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/quick-sort.js": 1117,
+ "../node_modules/@babel/generator/node_modules/source-map/lib/source-node.js": 1118,
+ "../node_modules/source-map/lib/wasm.js": 1119,
+ "external \"devtools/client/shared/vendor/micromatch/micromatch\"": 1120,
+ "../node_modules/node-libs-browser/node_modules/buffer/index.js": 1121,
+ "../node_modules/node-libs-browser/node_modules/base64-js/index.js": 1122,
+ "../node_modules/node-libs-browser/node_modules/ieee754/index.js": 1123
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1,
+ "2": 2,
+ "3": 3,
+ "4": 4,
+ "5": 5,
+ "6": 6,
+ "7": 7,
+ "8": 8,
+ "9": 9,
+ "10": 10,
+ "11": 11,
+ "12": 12,
+ "13": 13,
+ "14": 14,
+ "15": 15,
+ "16": 16,
+ "17": 17,
+ "18": 18,
+ "19": 19,
+ "20": 20,
+ "21": 21,
+ "22": 22,
+ "23": 23,
+ "24": 24,
+ "25": 25,
+ "26": 26,
+ "27": 27,
+ "28": 28,
+ "29": 29,
+ "30": 30,
+ "31": 31,
+ "32": 32,
+ "33": 33,
+ "34": 34,
+ "35": 35,
+ "36": 36,
+ "37": 37,
+ "38": 38,
+ "39": 39,
+ "40": 40,
+ "41": 41,
+ "42": 42,
+ "43": 43,
+ "44": 44,
+ "45": 45,
+ "46": 46,
+ "47": 47,
+ "48": 48,
+ "49": 49,
+ "50": 50,
+ "51": 51,
+ "52": 52,
+ "53": 53,
+ "54": 54,
+ "55": 55,
+ "56": 56,
+ "57": 57,
+ "58": 58,
+ "59": 59,
+ "60": 60,
+ "61": 61,
+ "62": 62,
+ "63": 63,
+ "64": 64,
+ "65": 65,
+ "66": 66,
+ "67": 67,
+ "68": 68,
+ "69": 69,
+ "70": 70,
+ "71": 71,
+ "72": 72,
+ "73": 73,
+ "74": 74,
+ "75": 75,
+ "76": 76,
+ "77": 77,
+ "78": 78,
+ "79": 79,
+ "80": 80,
+ "81": 81,
+ "82": 82,
+ "83": 83,
+ "84": 84,
+ "85": 85,
+ "86": 86,
+ "87": 87,
+ "88": 88,
+ "89": 89,
+ "90": 90,
+ "91": 91,
+ "92": 92,
+ "93": 93,
+ "94": 94,
+ "95": 95,
+ "96": 96,
+ "97": 97,
+ "98": 98,
+ "99": 99,
+ "100": 100,
+ "101": 101,
+ "102": 102,
+ "103": 103,
+ "104": 104,
+ "105": 105,
+ "106": 106,
+ "107": 107,
+ "108": 108,
+ "109": 109,
+ "110": 110,
+ "111": 111,
+ "112": 112,
+ "113": 113,
+ "114": 114,
+ "115": 115,
+ "116": 116,
+ "117": 117,
+ "118": 118,
+ "119": 119,
+ "120": 120,
+ "121": 121,
+ "122": 122,
+ "123": 123,
+ "124": 124,
+ "125": 125,
+ "126": 126,
+ "127": 127,
+ "128": 128,
+ "129": 129,
+ "130": 130,
+ "131": 131,
+ "132": 132,
+ "133": 133,
+ "134": 134,
+ "135": 135,
+ "136": 136,
+ "137": 137,
+ "138": 138,
+ "139": 139,
+ "140": 140,
+ "141": 141,
+ "142": 142,
+ "143": 143,
+ "144": 144,
+ "145": 145,
+ "146": 146,
+ "147": 147,
+ "148": 148,
+ "149": 149,
+ "150": 150,
+ "151": 151,
+ "152": 152,
+ "153": 153,
+ "154": 154,
+ "155": 155,
+ "156": 156,
+ "157": 157,
+ "158": 158,
+ "159": 159,
+ "160": 160,
+ "161": 161,
+ "162": 162,
+ "163": 163,
+ "164": 164,
+ "165": 165,
+ "166": 166,
+ "167": 167,
+ "168": 168,
+ "169": 169,
+ "170": 170,
+ "171": 171,
+ "172": 172,
+ "173": 173,
+ "174": 174,
+ "175": 175,
+ "176": 176,
+ "177": 177,
+ "178": 178,
+ "179": 179,
+ "180": 180,
+ "181": 181,
+ "182": 182,
+ "183": 183,
+ "184": 184,
+ "185": 185,
+ "186": 186,
+ "187": 187,
+ "188": 188,
+ "189": 189,
+ "190": 190,
+ "191": 191,
+ "192": 192,
+ "193": 193,
+ "194": 194,
+ "195": 195,
+ "196": 196,
+ "197": 197,
+ "198": 198,
+ "199": 199,
+ "200": 200,
+ "201": 201,
+ "202": 202,
+ "203": 203,
+ "204": 204,
+ "205": 205,
+ "206": 206,
+ "207": 207,
+ "208": 208,
+ "209": 209,
+ "210": 210,
+ "211": 211,
+ "212": 212,
+ "213": 213,
+ "214": 214,
+ "215": 215,
+ "216": 216,
+ "217": 217,
+ "218": 218,
+ "219": 219,
+ "220": 220,
+ "221": 221,
+ "222": 222,
+ "223": 223,
+ "224": 224,
+ "225": 225,
+ "226": 226,
+ "227": 227,
+ "228": 228,
+ "229": 229,
+ "230": 230,
+ "231": 231,
+ "232": 232,
+ "233": 233,
+ "234": 234,
+ "235": 235,
+ "236": 236,
+ "237": 237,
+ "238": 238,
+ "239": 239,
+ "240": 240,
+ "241": 241,
+ "242": 242,
+ "243": 243,
+ "244": 244,
+ "245": 245,
+ "246": 246,
+ "247": 247,
+ "248": 248,
+ "249": 249,
+ "250": 250,
+ "251": 251,
+ "252": 252,
+ "253": 253,
+ "254": 254,
+ "255": 255,
+ "256": 256,
+ "257": 257,
+ "258": 258,
+ "259": 259,
+ "260": 260,
+ "261": 261,
+ "262": 262,
+ "263": 263,
+ "264": 264,
+ "265": 265,
+ "266": 266,
+ "267": 267,
+ "268": 268,
+ "269": 269,
+ "270": 270,
+ "271": 271,
+ "272": 272,
+ "273": 273,
+ "274": 274,
+ "275": 275,
+ "276": 276,
+ "277": 277,
+ "278": 278,
+ "279": 279,
+ "280": 280,
+ "281": 281,
+ "282": 282,
+ "283": 283,
+ "284": 284,
+ "285": 285,
+ "286": 286,
+ "287": 287,
+ "288": 288,
+ "289": 289,
+ "290": 290,
+ "291": 291,
+ "292": 292,
+ "293": 293,
+ "294": 294,
+ "295": 295,
+ "296": 296,
+ "297": 297,
+ "298": 298,
+ "299": 299,
+ "300": 300,
+ "301": 301,
+ "302": 302,
+ "303": 303,
+ "304": 304,
+ "305": 305,
+ "306": 306,
+ "307": 307,
+ "308": 308,
+ "309": 309,
+ "310": 310,
+ "311": 311,
+ "312": 312,
+ "313": 313,
+ "314": 314,
+ "315": 315,
+ "316": 316,
+ "317": 317,
+ "318": 318,
+ "319": 319,
+ "320": 320,
+ "321": 321,
+ "322": 322,
+ "323": 323,
+ "324": 324,
+ "325": 325,
+ "326": 326,
+ "327": 327,
+ "328": 328,
+ "329": 329,
+ "330": 330,
+ "331": 331,
+ "332": 332,
+ "333": 333,
+ "334": 334,
+ "335": 335,
+ "336": 336,
+ "337": 337,
+ "338": 338,
+ "339": 339,
+ "340": 340,
+ "341": 341,
+ "342": 342,
+ "343": 343,
+ "344": 344,
+ "345": 345,
+ "346": 346,
+ "347": 347,
+ "348": 348,
+ "349": 349,
+ "350": 350,
+ "351": 351,
+ "352": 352,
+ "353": 353,
+ "354": 354,
+ "355": 355,
+ "356": 356,
+ "357": 357,
+ "358": 358,
+ "359": 359,
+ "360": 360,
+ "361": 361,
+ "362": 362,
+ "363": 363,
+ "364": 364,
+ "365": 365,
+ "366": 366,
+ "367": 367,
+ "368": 368,
+ "369": 369,
+ "370": 370,
+ "371": 371,
+ "372": 372,
+ "373": 373,
+ "374": 374,
+ "375": 375,
+ "376": 376,
+ "377": 377,
+ "378": 378,
+ "379": 379,
+ "380": 380,
+ "381": 381,
+ "382": 382,
+ "383": 383,
+ "384": 384,
+ "385": 385,
+ "386": 386,
+ "387": 387,
+ "388": 388,
+ "389": 389,
+ "390": 390,
+ "391": 391,
+ "392": 392,
+ "393": 393,
+ "394": 394,
+ "395": 395,
+ "396": 396,
+ "397": 397,
+ "398": 398,
+ "399": 399,
+ "400": 400,
+ "401": 401,
+ "402": 402,
+ "403": 403,
+ "404": 404,
+ "405": 405,
+ "406": 406,
+ "407": 407,
+ "408": 408,
+ "409": 409,
+ "410": 410,
+ "411": 411,
+ "412": 412,
+ "413": 413,
+ "414": 414,
+ "415": 415,
+ "416": 416,
+ "417": 417,
+ "418": 418,
+ "419": 419,
+ "420": 420,
+ "421": 421,
+ "422": 422,
+ "423": 423,
+ "424": 424,
+ "425": 425,
+ "426": 426,
+ "427": 427,
+ "428": 428,
+ "429": 429,
+ "430": 430,
+ "431": 431,
+ "432": 432,
+ "433": 433,
+ "434": 434,
+ "435": 435,
+ "436": 436,
+ "437": 437,
+ "438": 438,
+ "439": 439,
+ "440": 440,
+ "441": 441,
+ "442": 442,
+ "443": 443,
+ "444": 444,
+ "445": 445,
+ "446": 446,
+ "447": 447,
+ "448": 448,
+ "449": 449,
+ "450": 450,
+ "451": 451,
+ "452": 452,
+ "453": 453,
+ "454": 454,
+ "455": 455,
+ "456": 456,
+ "457": 457,
+ "458": 458,
+ "459": 459,
+ "460": 460,
+ "461": 461,
+ "462": 462,
+ "463": 463,
+ "464": 464,
+ "465": 465,
+ "466": 466,
+ "467": 467,
+ "468": 468,
+ "469": 469,
+ "470": 470,
+ "471": 471,
+ "472": 472,
+ "473": 473,
+ "474": 474,
+ "475": 475,
+ "476": 476,
+ "477": 477,
+ "478": 478,
+ "479": 479,
+ "480": 480,
+ "481": 481,
+ "482": 482,
+ "483": 483,
+ "484": 484,
+ "485": 485,
+ "486": 486,
+ "487": 487,
+ "488": 488,
+ "489": 489,
+ "490": 490,
+ "491": 491,
+ "492": 492,
+ "493": 493,
+ "494": 494,
+ "495": 495,
+ "496": 496,
+ "497": 497,
+ "498": 498,
+ "499": 499,
+ "500": 500,
+ "501": 501,
+ "502": 502,
+ "503": 503,
+ "504": 504,
+ "505": 505,
+ "506": 506,
+ "507": 507,
+ "508": 508,
+ "509": 509,
+ "510": 510,
+ "511": 511,
+ "512": 512,
+ "513": 513,
+ "514": 514,
+ "515": 515,
+ "516": 516,
+ "517": 517,
+ "518": 518,
+ "519": 519,
+ "520": 520,
+ "521": 521,
+ "522": 522,
+ "523": 523,
+ "524": 524,
+ "525": 525,
+ "526": 526,
+ "527": 527,
+ "528": 528,
+ "529": 529,
+ "530": 530,
+ "531": 531,
+ "532": 532,
+ "533": 533,
+ "534": 534,
+ "535": 535,
+ "536": 536,
+ "537": 537,
+ "538": 538,
+ "539": 539,
+ "540": 540,
+ "541": 541,
+ "542": 542,
+ "543": 543,
+ "544": 544,
+ "545": 545,
+ "546": 546,
+ "547": 547,
+ "548": 548,
+ "549": 549,
+ "550": 550,
+ "551": 551,
+ "552": 552,
+ "553": 553,
+ "554": 554,
+ "555": 555,
+ "556": 556,
+ "557": 557,
+ "558": 558,
+ "559": 559,
+ "560": 560,
+ "561": 561,
+ "562": 562,
+ "563": 563,
+ "564": 564,
+ "565": 565,
+ "566": 566,
+ "567": 567,
+ "568": 568,
+ "569": 569,
+ "570": 570,
+ "571": 571,
+ "572": 572,
+ "573": 573,
+ "574": 574,
+ "575": 575,
+ "576": 576,
+ "577": 577,
+ "578": 578,
+ "579": 579,
+ "580": 580,
+ "581": 581,
+ "582": 582,
+ "583": 583,
+ "584": 584,
+ "585": 585,
+ "586": 586,
+ "587": 587,
+ "588": 588,
+ "589": 589,
+ "590": 590,
+ "591": 591,
+ "592": 592,
+ "593": 593,
+ "594": 594,
+ "595": 595,
+ "596": 596,
+ "597": 597,
+ "598": 598,
+ "599": 599,
+ "600": 600,
+ "601": 601,
+ "602": 602,
+ "603": 603,
+ "604": 604,
+ "605": 605,
+ "606": 606,
+ "607": 607,
+ "608": 608,
+ "609": 609,
+ "610": 610,
+ "611": 611,
+ "612": 612,
+ "613": 613,
+ "614": 614,
+ "615": 615,
+ "616": 616,
+ "617": 617,
+ "618": 618,
+ "619": 619,
+ "620": 620,
+ "621": 621,
+ "622": 622,
+ "623": 623,
+ "624": 624,
+ "625": 625,
+ "626": 626,
+ "627": 627,
+ "628": 628,
+ "629": 629,
+ "630": 630,
+ "631": 631,
+ "632": 632,
+ "633": 633,
+ "634": 634,
+ "635": 635,
+ "636": 636,
+ "637": 637,
+ "638": 638,
+ "639": 639,
+ "640": 640,
+ "641": 641,
+ "642": 642,
+ "643": 643,
+ "644": 644,
+ "645": 645,
+ "646": 646,
+ "647": 647,
+ "648": 648,
+ "649": 649,
+ "650": 650,
+ "651": 651,
+ "652": 652,
+ "653": 653,
+ "654": 654,
+ "655": 655,
+ "656": 656,
+ "657": 657,
+ "658": 658,
+ "659": 659,
+ "660": 660,
+ "661": 661,
+ "662": 662,
+ "663": 663,
+ "664": 664,
+ "665": 665,
+ "666": 666,
+ "667": 667,
+ "668": 668,
+ "669": 669,
+ "670": 670,
+ "671": 671,
+ "672": 672,
+ "673": 673,
+ "674": 674,
+ "675": 675,
+ "676": 676,
+ "677": 677,
+ "678": 678,
+ "679": 679,
+ "680": 680,
+ "681": 681,
+ "682": 682,
+ "683": 683,
+ "684": 684,
+ "685": 685,
+ "686": 686,
+ "687": 687,
+ "688": 688,
+ "689": 689,
+ "690": 690,
+ "691": 691,
+ "692": 692,
+ "693": 693,
+ "694": 694,
+ "695": 695,
+ "696": 696,
+ "697": 697,
+ "698": 698,
+ "699": 699,
+ "700": 700,
+ "701": 701,
+ "702": 702,
+ "703": 703,
+ "704": 704,
+ "705": 705,
+ "706": 706,
+ "707": 707,
+ "708": 708,
+ "709": 709,
+ "710": 710,
+ "711": 711,
+ "712": 712,
+ "713": 713,
+ "714": 714,
+ "715": 715,
+ "716": 716,
+ "717": 717,
+ "718": 718,
+ "719": 719,
+ "720": 720,
+ "721": 721,
+ "722": 722,
+ "723": 723,
+ "724": 724,
+ "725": 725,
+ "726": 726,
+ "727": 727,
+ "728": 728,
+ "729": 729,
+ "730": 730,
+ "731": 731,
+ "732": 732,
+ "733": 733,
+ "734": 734,
+ "735": 735,
+ "736": 736,
+ "737": 737,
+ "738": 738,
+ "739": 739,
+ "740": 740,
+ "741": 741,
+ "742": 742,
+ "743": 743,
+ "744": 744,
+ "745": 745,
+ "746": 746,
+ "747": 747,
+ "748": 748,
+ "749": 749,
+ "750": 750,
+ "751": 751,
+ "752": 752,
+ "753": 753,
+ "754": 754,
+ "755": 755,
+ "756": 756,
+ "757": 757,
+ "758": 758,
+ "759": 759,
+ "760": 760,
+ "761": 761,
+ "762": 762,
+ "763": 763,
+ "764": 764,
+ "765": 765,
+ "766": 766,
+ "767": 767,
+ "768": 768,
+ "769": 769,
+ "770": 770,
+ "771": 771,
+ "772": 772,
+ "773": 773,
+ "774": 774,
+ "775": 775,
+ "776": 776,
+ "777": 777,
+ "778": 778,
+ "779": 779,
+ "780": 780,
+ "781": 781,
+ "782": 782,
+ "783": 783,
+ "784": 784,
+ "785": 785,
+ "786": 786,
+ "787": 787,
+ "788": 788,
+ "789": 789,
+ "790": 790,
+ "791": 791,
+ "792": 792,
+ "793": 793,
+ "794": 794,
+ "795": 795,
+ "796": 796,
+ "797": 797,
+ "798": 798,
+ "799": 799,
+ "800": 800,
+ "801": 801,
+ "802": 802,
+ "803": 803,
+ "804": 804,
+ "805": 805,
+ "806": 806,
+ "807": 807,
+ "808": 808,
+ "809": 809,
+ "810": 810,
+ "811": 811,
+ "812": 812,
+ "813": 813,
+ "814": 814,
+ "815": 815,
+ "816": 816,
+ "817": 817,
+ "818": 818,
+ "819": 819,
+ "820": 820,
+ "821": 821,
+ "822": 822,
+ "823": 823,
+ "824": 824,
+ "825": 825,
+ "826": 826,
+ "827": 827,
+ "828": 828,
+ "829": 829,
+ "830": 830,
+ "831": 831,
+ "832": 832,
+ "833": 833,
+ "834": 834,
+ "835": 835,
+ "836": 836,
+ "837": 837,
+ "838": 838,
+ "839": 839,
+ "840": 840,
+ "841": 841,
+ "842": 842,
+ "843": 843,
+ "844": 844,
+ "845": 845,
+ "846": 846,
+ "847": 847,
+ "848": 848,
+ "849": 849,
+ "850": 850,
+ "851": 851,
+ "852": 852,
+ "853": 853,
+ "854": 854,
+ "855": 855,
+ "856": 856,
+ "857": 857,
+ "858": 858,
+ "859": 859,
+ "860": 860,
+ "861": 861,
+ "862": 862,
+ "863": 863,
+ "864": 864,
+ "865": 865,
+ "866": 866,
+ "867": 867,
+ "868": 868,
+ "869": 869,
+ "870": 870,
+ "871": 871,
+ "872": 872,
+ "873": 873,
+ "874": 874,
+ "875": 875,
+ "876": 876,
+ "877": 877,
+ "878": 878,
+ "879": 879,
+ "880": 880,
+ "881": 881,
+ "882": 882,
+ "883": 883,
+ "884": 884,
+ "885": 885,
+ "886": 886,
+ "887": 887,
+ "888": 888,
+ "889": 889,
+ "890": 890,
+ "891": 891,
+ "892": 892,
+ "893": 893,
+ "894": 894,
+ "895": 895,
+ "896": 896,
+ "897": 897,
+ "898": 898,
+ "899": 899,
+ "900": 900,
+ "901": 901,
+ "902": 902,
+ "903": 903,
+ "904": 904,
+ "905": 905,
+ "906": 906,
+ "907": 907,
+ "908": 908,
+ "909": 909,
+ "910": 910,
+ "911": 911,
+ "912": 912,
+ "913": 913,
+ "914": 914,
+ "915": 915,
+ "916": 916,
+ "917": 917,
+ "918": 918,
+ "919": 919,
+ "920": 920,
+ "921": 921,
+ "922": 922,
+ "923": 923,
+ "924": 924,
+ "925": 925,
+ "926": 926,
+ "927": 927,
+ "928": 928,
+ "929": 929,
+ "930": 930,
+ "931": 931,
+ "932": 932,
+ "933": 933,
+ "934": 934,
+ "935": 935,
+ "936": 936,
+ "937": 937,
+ "938": 938,
+ "939": 939,
+ "940": 940,
+ "941": 941,
+ "942": 942,
+ "943": 943,
+ "944": 944,
+ "945": 945,
+ "946": 946,
+ "947": 947,
+ "948": 948,
+ "949": 949,
+ "950": 950,
+ "951": 951,
+ "952": 952,
+ "953": 953,
+ "954": 954,
+ "955": 955,
+ "956": 956,
+ "957": 957,
+ "958": 958,
+ "959": 959,
+ "960": 960,
+ "961": 961,
+ "962": 962,
+ "963": 963,
+ "964": 964,
+ "965": 965,
+ "966": 966,
+ "967": 967,
+ "968": 968,
+ "969": 969,
+ "970": 970,
+ "971": 971,
+ "972": 972,
+ "973": 973,
+ "974": 974,
+ "975": 975,
+ "976": 976,
+ "977": 977,
+ "978": 978,
+ "979": 979,
+ "980": 980,
+ "981": 981,
+ "982": 982,
+ "983": 983,
+ "984": 984,
+ "985": 985,
+ "986": 986,
+ "987": 987,
+ "988": 988,
+ "989": 989,
+ "990": 990,
+ "991": 991,
+ "992": 992,
+ "993": 993,
+ "994": 994,
+ "995": 995,
+ "996": 996,
+ "997": 997,
+ "998": 998,
+ "999": 999,
+ "1000": 1000,
+ "1001": 1001,
+ "1002": 1002,
+ "1003": 1003,
+ "1004": 1004,
+ "1005": 1005,
+ "1006": 1006,
+ "1007": 1007,
+ "1008": 1008,
+ "1009": 1009,
+ "1010": 1010,
+ "1011": 1011,
+ "1012": 1012,
+ "1013": 1013,
+ "1014": 1014,
+ "1015": 1015,
+ "1016": 1016,
+ "1017": 1017,
+ "1018": 1018,
+ "1019": 1019,
+ "1020": 1020,
+ "1021": 1021,
+ "1022": 1022,
+ "1023": 1023,
+ "1024": 1024,
+ "1025": 1025,
+ "1026": 1026,
+ "1027": 1027,
+ "1028": 1028,
+ "1029": 1029,
+ "1030": 1030,
+ "1031": 1031,
+ "1032": 1032,
+ "1033": 1033,
+ "1034": 1034,
+ "1035": 1035,
+ "1036": 1036,
+ "1037": 1037,
+ "1038": 1038,
+ "1039": 1039,
+ "1040": 1040,
+ "1041": 1041,
+ "1042": 1042,
+ "1043": 1043,
+ "1044": 1044,
+ "1045": 1045,
+ "1046": 1046,
+ "1047": 1047,
+ "1048": 1048,
+ "1049": 1049,
+ "1050": 1050,
+ "1051": 1051,
+ "1052": 1052,
+ "1053": 1053,
+ "1054": 1054,
+ "1055": 1055,
+ "1056": 1056,
+ "1057": 1057,
+ "1058": 1058,
+ "1059": 1059,
+ "1060": 1060,
+ "1061": 1061,
+ "1062": 1062,
+ "1063": 1063,
+ "1064": 1064,
+ "1065": 1065,
+ "1066": 1066,
+ "1067": 1067,
+ "1068": 1068,
+ "1069": 1069,
+ "1070": 1070,
+ "1071": 1071,
+ "1072": 1072,
+ "1073": 1073,
+ "1074": 1074,
+ "1075": 1075,
+ "1076": 1076,
+ "1077": 1077,
+ "1078": 1078,
+ "1079": 1079,
+ "1080": 1080,
+ "1081": 1081,
+ "1082": 1082,
+ "1083": 1083,
+ "1084": 1084,
+ "1085": 1085,
+ "1086": 1086,
+ "1087": 1087,
+ "1088": 1088,
+ "1089": 1089,
+ "1090": 1090,
+ "1091": 1091,
+ "1092": 1092,
+ "1093": 1093,
+ "1094": 1094,
+ "1095": 1095,
+ "1096": 1096,
+ "1097": 1097,
+ "1098": 1098,
+ "1099": 1099,
+ "1100": 1100,
+ "1101": 1101,
+ "1102": 1102,
+ "1103": 1103,
+ "1104": 1104,
+ "1105": 1105,
+ "1106": 1106,
+ "1107": 1107,
+ "1108": 1108,
+ "1109": 1109,
+ "1110": 1110,
+ "1111": 1111,
+ "1112": 1112,
+ "1113": 1113,
+ "1114": 1114,
+ "1115": 1115,
+ "1116": 1116,
+ "1117": 1117,
+ "1118": 1118,
+ "1119": 1119,
+ "1120": 1120,
+ "1121": 1121,
+ "1122": 1122,
+ "1123": 1123
+ }
+ },
+ "chunks": {
+ "byName": {
+ "parser-worker": 0,
+ "vendors": 1,
+ "reps": 2,
+ "source-map-worker": 3,
+ "search-worker": 4,
+ "pretty-print-worker": 5,
+ "source-map-index": 6,
+ "whatwg-url": 7
+ },
+ "byBlocks": {},
+ "usedIds": {
+ "1": 1
+ }
+ },
+ "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-contextmenu/menu.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-contextmenu/menu.css": 0,
+ "../../css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../packages/devtools-splitter/src/SplitBox.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../packages/devtools-splitter/src/SplitBox.css": 0,
+ "../node_modules/css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../node_modules/react-aria-components/src/tabs/tab.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../node_modules/react-aria-components/src/tabs/tab.css": 0,
+ "../node_modules/css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../node_modules/react-aria-components/src/tabs/tab-list.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../node_modules/css-loader/index.js??ref--3-1!../node_modules/postcss-loader/lib/index.js!../node_modules/react-aria-components/src/tabs/tab-list.css": 0,
+ "../node_modules/css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js??ref--3-1!../packages/devtools-splitter/src/SplitBox.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../node_modules/css-loader/index.js??ref--3-1!../packages/devtools-splitter/src/SplitBox.css": 0,
+ "../node_modules/css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js??ref--3-1!../node_modules/react-aria-components/src/tabs/tab.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../node_modules/css-loader/index.js??ref--3-1!../node_modules/react-aria-components/src/tabs/tab.css": 0,
+ "../node_modules/css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ],
+ "extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js??ref--3-1!../node_modules/react-aria-components/src/tabs/tab-list.css": [
+ {
+ "modules": {
+ "byIdentifier": {
+ "../node_modules/css-loader/index.js??ref--3-1!../node_modules/react-aria-components/src/tabs/tab-list.css": 0,
+ "../node_modules/css-loader/lib/css-base.js": 1
+ },
+ "usedIds": {
+ "0": 0,
+ "1": 1
+ }
+ },
+ "chunks": {
+ "byName": {},
+ "byBlocks": {},
+ "usedIds": {
+ "0": 0
+ }
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/devtools/client/debugger/bin/watch.js b/devtools/client/debugger/bin/watch.js
new file mode 100644
index 0000000000..d4d02e18ca
--- /dev/null
+++ b/devtools/client/debugger/bin/watch.js
@@ -0,0 +1,31 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+var chokidar = require("chokidar");
+var shell = require("shelljs");
+var path = require("path");
+
+const geckoPath = path.join(__dirname, "../../../..");
+const srcPath = path.join(__dirname, "../src");
+function watch() {
+ console.log("Watching for src changes");
+ const watcher = chokidar.watch(srcPath);
+ let working = false;
+ watcher.on("change", filePath => {
+ const relPath = path.relative(srcPath, filePath);
+ console.log(`Updating ${relPath}`);
+ if (working) {
+ return;
+ }
+ working = true;
+ const start = new Date();
+
+ shell.exec(`cd ${geckoPath}; ./mach build faster; cd -;`, { silent: true });
+ working = false;
+ const end = Math.round((new Date() - start) / 1000);
+ console.log(` Built in ${end}s`);
+ });
+}
+
+watch();
diff --git a/devtools/client/debugger/configs/mozilla-central-mappings.js b/devtools/client/debugger/configs/mozilla-central-mappings.js
new file mode 100644
index 0000000000..d82b50bae3
--- /dev/null
+++ b/devtools/client/debugger/configs/mozilla-central-mappings.js
@@ -0,0 +1,19 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+module.exports = {
+ "./source-editor": "devtools/client/sourceeditor/editor",
+ "../editor/source-editor": "devtools/client/sourceeditor/editor",
+ react: "devtools/client/shared/vendor/react",
+ "react-dom": "devtools/client/shared/vendor/react-dom",
+ "react-dom-factories": "devtools/client/shared/vendor/react-dom-factories",
+ "react-redux": "devtools/client/shared/vendor/react-redux",
+ redux: "devtools/client/shared/vendor/redux",
+ "prop-types": "devtools/client/shared/vendor/react-prop-types",
+ "devtools-modules/src/menu": "devtools/client/framework/menu",
+ "devtools-modules/src/menu/menu-item": "devtools/client/framework/menu-item",
+ "wasmparser/dist/cjs/WasmParser": "devtools/client/shared/vendor/WasmParser",
+ "wasmparser/dist/cjs/WasmDis": "devtools/client/shared/vendor/WasmDis",
+ "devtools/client/shared/vendor/micromatch/micromatch": "devtools/client/shared/vendor/micromatch/micromatch",
+};
diff --git a/devtools/client/debugger/dist/moz.build b/devtools/client/debugger/dist/moz.build
new file mode 100644
index 0000000000..64187f8ff6
--- /dev/null
+++ b/devtools/client/debugger/dist/moz.build
@@ -0,0 +1,11 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "parser-worker.js",
+ "pretty-print-worker.js",
+ "search-worker.js",
+ "vendors.js",
+)
diff --git a/devtools/client/debugger/dist/parser-worker.js b/devtools/client/debugger/dist/parser-worker.js
new file mode 100644
index 0000000000..1fd38ba914
--- /dev/null
+++ b/devtools/client/debugger/dist/parser-worker.js
@@ -0,0 +1,73552 @@
+(function (factory) {
+ typeof define === 'function' && define.amd ? define(factory) :
+ factory();
+})((function () { 'use strict';
+
+ (function() {
+ const env = {"NODE_ENV":"production"};
+ try {
+ if (process) {
+ process.env = Object.assign({}, process.env);
+ Object.assign(process.env, env);
+ return;
+ }
+ } catch (e) {} // avoid ReferenceError: process is not defined
+ globalThis.process = { env:env };
+ })();
+
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
+
+ var lib$6 = {};
+
+ var isReactComponent$4 = {};
+
+ var buildMatchMemberExpression$3 = {};
+
+ var matchesPattern$3 = {};
+
+ var generated$8 = {};
+
+ var shallowEqual$3 = {};
+
+ Object.defineProperty(shallowEqual$3, "__esModule", {
+ value: true
+ });
+ shallowEqual$3.default = shallowEqual$2;
+
+ function shallowEqual$2(actual, expected) {
+ const keys = Object.keys(expected);
+
+ for (const key of keys) {
+ if (actual[key] !== expected[key]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ Object.defineProperty(generated$8, "__esModule", {
+ value: true
+ });
+ generated$8.isArrayExpression = isArrayExpression$2;
+ generated$8.isAssignmentExpression = isAssignmentExpression$3;
+ generated$8.isBinaryExpression = isBinaryExpression$2;
+ generated$8.isInterpreterDirective = isInterpreterDirective$1;
+ generated$8.isDirective = isDirective$1;
+ generated$8.isDirectiveLiteral = isDirectiveLiteral$1;
+ generated$8.isBlockStatement = isBlockStatement$2;
+ generated$8.isBreakStatement = isBreakStatement$1;
+ generated$8.isCallExpression = isCallExpression$5;
+ generated$8.isCatchClause = isCatchClause$1;
+ generated$8.isConditionalExpression = isConditionalExpression$2;
+ generated$8.isContinueStatement = isContinueStatement$1;
+ generated$8.isDebuggerStatement = isDebuggerStatement$1;
+ generated$8.isDoWhileStatement = isDoWhileStatement$1;
+ generated$8.isEmptyStatement = isEmptyStatement$2;
+ generated$8.isExpressionStatement = isExpressionStatement$3;
+ generated$8.isFile = isFile$2;
+ generated$8.isForInStatement = isForInStatement$2;
+ generated$8.isForStatement = isForStatement$3;
+ generated$8.isFunctionDeclaration = isFunctionDeclaration$1;
+ generated$8.isFunctionExpression = isFunctionExpression$1;
+ generated$8.isIdentifier = isIdentifier$4;
+ generated$8.isIfStatement = isIfStatement$3;
+ generated$8.isLabeledStatement = isLabeledStatement$1;
+ generated$8.isStringLiteral = isStringLiteral$2;
+ generated$8.isNumericLiteral = isNumericLiteral$1;
+ generated$8.isNullLiteral = isNullLiteral$1;
+ generated$8.isBooleanLiteral = isBooleanLiteral$1;
+ generated$8.isRegExpLiteral = isRegExpLiteral$1;
+ generated$8.isLogicalExpression = isLogicalExpression$2;
+ generated$8.isMemberExpression = isMemberExpression$5;
+ generated$8.isNewExpression = isNewExpression$4;
+ generated$8.isProgram = isProgram$2;
+ generated$8.isObjectExpression = isObjectExpression$2;
+ generated$8.isObjectMethod = isObjectMethod$1;
+ generated$8.isObjectProperty = isObjectProperty$1;
+ generated$8.isRestElement = isRestElement$1;
+ generated$8.isReturnStatement = isReturnStatement$2;
+ generated$8.isSequenceExpression = isSequenceExpression$2;
+ generated$8.isParenthesizedExpression = isParenthesizedExpression$1;
+ generated$8.isSwitchCase = isSwitchCase$1;
+ generated$8.isSwitchStatement = isSwitchStatement$2;
+ generated$8.isThisExpression = isThisExpression$1;
+ generated$8.isThrowStatement = isThrowStatement$2;
+ generated$8.isTryStatement = isTryStatement$1;
+ generated$8.isUnaryExpression = isUnaryExpression$1;
+ generated$8.isUpdateExpression = isUpdateExpression$1;
+ generated$8.isVariableDeclaration = isVariableDeclaration$1;
+ generated$8.isVariableDeclarator = isVariableDeclarator$2;
+ generated$8.isWhileStatement = isWhileStatement$2;
+ generated$8.isWithStatement = isWithStatement$1;
+ generated$8.isAssignmentPattern = isAssignmentPattern$2;
+ generated$8.isArrayPattern = isArrayPattern$1;
+ generated$8.isArrowFunctionExpression = isArrowFunctionExpression$2;
+ generated$8.isClassBody = isClassBody$1;
+ generated$8.isClassExpression = isClassExpression$2;
+ generated$8.isClassDeclaration = isClassDeclaration$3;
+ generated$8.isExportAllDeclaration = isExportAllDeclaration$1;
+ generated$8.isExportDefaultDeclaration = isExportDefaultDeclaration$3;
+ generated$8.isExportNamedDeclaration = isExportNamedDeclaration$2;
+ generated$8.isExportSpecifier = isExportSpecifier$1;
+ generated$8.isForOfStatement = isForOfStatement$2;
+ generated$8.isImportDeclaration = isImportDeclaration$1;
+ generated$8.isImportDefaultSpecifier = isImportDefaultSpecifier$2;
+ generated$8.isImportNamespaceSpecifier = isImportNamespaceSpecifier$2;
+ generated$8.isImportSpecifier = isImportSpecifier$1;
+ generated$8.isMetaProperty = isMetaProperty$1;
+ generated$8.isClassMethod = isClassMethod$1;
+ generated$8.isObjectPattern = isObjectPattern$2;
+ generated$8.isSpreadElement = isSpreadElement$1;
+ generated$8.isSuper = isSuper$1;
+ generated$8.isTaggedTemplateExpression = isTaggedTemplateExpression$2;
+ generated$8.isTemplateElement = isTemplateElement$1;
+ generated$8.isTemplateLiteral = isTemplateLiteral$1;
+ generated$8.isYieldExpression = isYieldExpression$2;
+ generated$8.isAwaitExpression = isAwaitExpression$2;
+ generated$8.isImport = isImport$1;
+ generated$8.isBigIntLiteral = isBigIntLiteral$1;
+ generated$8.isExportNamespaceSpecifier = isExportNamespaceSpecifier$2;
+ generated$8.isOptionalMemberExpression = isOptionalMemberExpression$3;
+ generated$8.isOptionalCallExpression = isOptionalCallExpression$3;
+ generated$8.isClassProperty = isClassProperty$1;
+ generated$8.isClassPrivateProperty = isClassPrivateProperty$1;
+ generated$8.isClassPrivateMethod = isClassPrivateMethod$1;
+ generated$8.isPrivateName = isPrivateName$1;
+ generated$8.isAnyTypeAnnotation = isAnyTypeAnnotation$1;
+ generated$8.isArrayTypeAnnotation = isArrayTypeAnnotation$2;
+ generated$8.isBooleanTypeAnnotation = isBooleanTypeAnnotation$1;
+ generated$8.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation$1;
+ generated$8.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation$1;
+ generated$8.isClassImplements = isClassImplements$1;
+ generated$8.isDeclareClass = isDeclareClass$1;
+ generated$8.isDeclareFunction = isDeclareFunction$1;
+ generated$8.isDeclareInterface = isDeclareInterface$1;
+ generated$8.isDeclareModule = isDeclareModule$1;
+ generated$8.isDeclareModuleExports = isDeclareModuleExports$1;
+ generated$8.isDeclareTypeAlias = isDeclareTypeAlias$1;
+ generated$8.isDeclareOpaqueType = isDeclareOpaqueType$1;
+ generated$8.isDeclareVariable = isDeclareVariable$1;
+ generated$8.isDeclareExportDeclaration = isDeclareExportDeclaration$1;
+ generated$8.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration$1;
+ generated$8.isDeclaredPredicate = isDeclaredPredicate$1;
+ generated$8.isExistsTypeAnnotation = isExistsTypeAnnotation$1;
+ generated$8.isFunctionTypeAnnotation = isFunctionTypeAnnotation$1;
+ generated$8.isFunctionTypeParam = isFunctionTypeParam$1;
+ generated$8.isGenericTypeAnnotation = isGenericTypeAnnotation$1;
+ generated$8.isInferredPredicate = isInferredPredicate$1;
+ generated$8.isInterfaceExtends = isInterfaceExtends$1;
+ generated$8.isInterfaceDeclaration = isInterfaceDeclaration$1;
+ generated$8.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation$1;
+ generated$8.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation$2;
+ generated$8.isMixedTypeAnnotation = isMixedTypeAnnotation$1;
+ generated$8.isEmptyTypeAnnotation = isEmptyTypeAnnotation$1;
+ generated$8.isNullableTypeAnnotation = isNullableTypeAnnotation$2;
+ generated$8.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation$1;
+ generated$8.isNumberTypeAnnotation = isNumberTypeAnnotation$1;
+ generated$8.isObjectTypeAnnotation = isObjectTypeAnnotation$1;
+ generated$8.isObjectTypeInternalSlot = isObjectTypeInternalSlot$1;
+ generated$8.isObjectTypeCallProperty = isObjectTypeCallProperty$1;
+ generated$8.isObjectTypeIndexer = isObjectTypeIndexer$1;
+ generated$8.isObjectTypeProperty = isObjectTypeProperty$1;
+ generated$8.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty$1;
+ generated$8.isOpaqueType = isOpaqueType$1;
+ generated$8.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier$1;
+ generated$8.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation$1;
+ generated$8.isStringTypeAnnotation = isStringTypeAnnotation$1;
+ generated$8.isSymbolTypeAnnotation = isSymbolTypeAnnotation$1;
+ generated$8.isThisTypeAnnotation = isThisTypeAnnotation$1;
+ generated$8.isTupleTypeAnnotation = isTupleTypeAnnotation$1;
+ generated$8.isTypeofTypeAnnotation = isTypeofTypeAnnotation$1;
+ generated$8.isTypeAlias = isTypeAlias$1;
+ generated$8.isTypeAnnotation = isTypeAnnotation$2;
+ generated$8.isTypeCastExpression = isTypeCastExpression$1;
+ generated$8.isTypeParameter = isTypeParameter$1;
+ generated$8.isTypeParameterDeclaration = isTypeParameterDeclaration$1;
+ generated$8.isTypeParameterInstantiation = isTypeParameterInstantiation$1;
+ generated$8.isUnionTypeAnnotation = isUnionTypeAnnotation$2;
+ generated$8.isVariance = isVariance$1;
+ generated$8.isVoidTypeAnnotation = isVoidTypeAnnotation$1;
+ generated$8.isEnumDeclaration = isEnumDeclaration$1;
+ generated$8.isEnumBooleanBody = isEnumBooleanBody$1;
+ generated$8.isEnumNumberBody = isEnumNumberBody$1;
+ generated$8.isEnumStringBody = isEnumStringBody$1;
+ generated$8.isEnumSymbolBody = isEnumSymbolBody$1;
+ generated$8.isEnumBooleanMember = isEnumBooleanMember$1;
+ generated$8.isEnumNumberMember = isEnumNumberMember$1;
+ generated$8.isEnumStringMember = isEnumStringMember$1;
+ generated$8.isEnumDefaultedMember = isEnumDefaultedMember$1;
+ generated$8.isIndexedAccessType = isIndexedAccessType$1;
+ generated$8.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
+ generated$8.isJSXAttribute = isJSXAttribute$1;
+ generated$8.isJSXClosingElement = isJSXClosingElement$1;
+ generated$8.isJSXElement = isJSXElement$1;
+ generated$8.isJSXEmptyExpression = isJSXEmptyExpression$1;
+ generated$8.isJSXExpressionContainer = isJSXExpressionContainer$1;
+ generated$8.isJSXSpreadChild = isJSXSpreadChild$1;
+ generated$8.isJSXIdentifier = isJSXIdentifier$1;
+ generated$8.isJSXMemberExpression = isJSXMemberExpression$1;
+ generated$8.isJSXNamespacedName = isJSXNamespacedName$1;
+ generated$8.isJSXOpeningElement = isJSXOpeningElement$1;
+ generated$8.isJSXSpreadAttribute = isJSXSpreadAttribute$1;
+ generated$8.isJSXText = isJSXText$1;
+ generated$8.isJSXFragment = isJSXFragment$1;
+ generated$8.isJSXOpeningFragment = isJSXOpeningFragment$1;
+ generated$8.isJSXClosingFragment = isJSXClosingFragment$1;
+ generated$8.isNoop = isNoop$1;
+ generated$8.isPlaceholder = isPlaceholder$1;
+ generated$8.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier$1;
+ generated$8.isArgumentPlaceholder = isArgumentPlaceholder$1;
+ generated$8.isBindExpression = isBindExpression$1;
+ generated$8.isImportAttribute = isImportAttribute$1;
+ generated$8.isDecorator = isDecorator$1;
+ generated$8.isDoExpression = isDoExpression$1;
+ generated$8.isExportDefaultSpecifier = isExportDefaultSpecifier$2;
+ generated$8.isRecordExpression = isRecordExpression$1;
+ generated$8.isTupleExpression = isTupleExpression$1;
+ generated$8.isDecimalLiteral = isDecimalLiteral;
+ generated$8.isStaticBlock = isStaticBlock;
+ generated$8.isModuleExpression = isModuleExpression;
+ generated$8.isTopicReference = isTopicReference;
+ generated$8.isPipelineTopicExpression = isPipelineTopicExpression$1;
+ generated$8.isPipelineBareFunction = isPipelineBareFunction$1;
+ generated$8.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference$1;
+ generated$8.isTSParameterProperty = isTSParameterProperty$1;
+ generated$8.isTSDeclareFunction = isTSDeclareFunction$1;
+ generated$8.isTSDeclareMethod = isTSDeclareMethod$1;
+ generated$8.isTSQualifiedName = isTSQualifiedName$1;
+ generated$8.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration$1;
+ generated$8.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration$1;
+ generated$8.isTSPropertySignature = isTSPropertySignature$1;
+ generated$8.isTSMethodSignature = isTSMethodSignature$1;
+ generated$8.isTSIndexSignature = isTSIndexSignature$1;
+ generated$8.isTSAnyKeyword = isTSAnyKeyword$1;
+ generated$8.isTSBooleanKeyword = isTSBooleanKeyword$1;
+ generated$8.isTSBigIntKeyword = isTSBigIntKeyword$1;
+ generated$8.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
+ generated$8.isTSNeverKeyword = isTSNeverKeyword$1;
+ generated$8.isTSNullKeyword = isTSNullKeyword$1;
+ generated$8.isTSNumberKeyword = isTSNumberKeyword$1;
+ generated$8.isTSObjectKeyword = isTSObjectKeyword$1;
+ generated$8.isTSStringKeyword = isTSStringKeyword$1;
+ generated$8.isTSSymbolKeyword = isTSSymbolKeyword$1;
+ generated$8.isTSUndefinedKeyword = isTSUndefinedKeyword$1;
+ generated$8.isTSUnknownKeyword = isTSUnknownKeyword$1;
+ generated$8.isTSVoidKeyword = isTSVoidKeyword$1;
+ generated$8.isTSThisType = isTSThisType$1;
+ generated$8.isTSFunctionType = isTSFunctionType$1;
+ generated$8.isTSConstructorType = isTSConstructorType$1;
+ generated$8.isTSTypeReference = isTSTypeReference$1;
+ generated$8.isTSTypePredicate = isTSTypePredicate$1;
+ generated$8.isTSTypeQuery = isTSTypeQuery$1;
+ generated$8.isTSTypeLiteral = isTSTypeLiteral$1;
+ generated$8.isTSArrayType = isTSArrayType$2;
+ generated$8.isTSTupleType = isTSTupleType$1;
+ generated$8.isTSOptionalType = isTSOptionalType$2;
+ generated$8.isTSRestType = isTSRestType$2;
+ generated$8.isTSNamedTupleMember = isTSNamedTupleMember;
+ generated$8.isTSUnionType = isTSUnionType$2;
+ generated$8.isTSIntersectionType = isTSIntersectionType$2;
+ generated$8.isTSConditionalType = isTSConditionalType$1;
+ generated$8.isTSInferType = isTSInferType$1;
+ generated$8.isTSParenthesizedType = isTSParenthesizedType$1;
+ generated$8.isTSTypeOperator = isTSTypeOperator$1;
+ generated$8.isTSIndexedAccessType = isTSIndexedAccessType$1;
+ generated$8.isTSMappedType = isTSMappedType$1;
+ generated$8.isTSLiteralType = isTSLiteralType$1;
+ generated$8.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments$1;
+ generated$8.isTSInterfaceDeclaration = isTSInterfaceDeclaration$1;
+ generated$8.isTSInterfaceBody = isTSInterfaceBody$1;
+ generated$8.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration$1;
+ generated$8.isTSAsExpression = isTSAsExpression$2;
+ generated$8.isTSTypeAssertion = isTSTypeAssertion$2;
+ generated$8.isTSEnumDeclaration = isTSEnumDeclaration$1;
+ generated$8.isTSEnumMember = isTSEnumMember$1;
+ generated$8.isTSModuleDeclaration = isTSModuleDeclaration$1;
+ generated$8.isTSModuleBlock = isTSModuleBlock$1;
+ generated$8.isTSImportType = isTSImportType$1;
+ generated$8.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration$1;
+ generated$8.isTSExternalModuleReference = isTSExternalModuleReference$1;
+ generated$8.isTSNonNullExpression = isTSNonNullExpression$2;
+ generated$8.isTSExportAssignment = isTSExportAssignment$1;
+ generated$8.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration$1;
+ generated$8.isTSTypeAnnotation = isTSTypeAnnotation$1;
+ generated$8.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation$1;
+ generated$8.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration$1;
+ generated$8.isTSTypeParameter = isTSTypeParameter$1;
+ generated$8.isExpression = isExpression$1;
+ generated$8.isBinary = isBinary$3;
+ generated$8.isScopable = isScopable$1;
+ generated$8.isBlockParent = isBlockParent$1;
+ generated$8.isBlock = isBlock$1;
+ generated$8.isStatement = isStatement$3;
+ generated$8.isTerminatorless = isTerminatorless$1;
+ generated$8.isCompletionStatement = isCompletionStatement$1;
+ generated$8.isConditional = isConditional$2;
+ generated$8.isLoop = isLoop$3;
+ generated$8.isWhile = isWhile$1;
+ generated$8.isExpressionWrapper = isExpressionWrapper$1;
+ generated$8.isFor = isFor$3;
+ generated$8.isForXStatement = isForXStatement$1;
+ generated$8.isFunction = isFunction$7;
+ generated$8.isFunctionParent = isFunctionParent$1;
+ generated$8.isPureish = isPureish$1;
+ generated$8.isDeclaration = isDeclaration$1;
+ generated$8.isPatternLike = isPatternLike$1;
+ generated$8.isLVal = isLVal$1;
+ generated$8.isTSEntityName = isTSEntityName$1;
+ generated$8.isLiteral = isLiteral$3;
+ generated$8.isImmutable = isImmutable$5;
+ generated$8.isUserWhitespacable = isUserWhitespacable$1;
+ generated$8.isMethod = isMethod$1;
+ generated$8.isObjectMember = isObjectMember$1;
+ generated$8.isProperty = isProperty$1;
+ generated$8.isUnaryLike = isUnaryLike$2;
+ generated$8.isPattern = isPattern$1;
+ generated$8.isClass = isClass$1;
+ generated$8.isModuleDeclaration = isModuleDeclaration$1;
+ generated$8.isExportDeclaration = isExportDeclaration$2;
+ generated$8.isModuleSpecifier = isModuleSpecifier$1;
+ generated$8.isPrivate = isPrivate$1;
+ generated$8.isFlow = isFlow$1;
+ generated$8.isFlowType = isFlowType$1;
+ generated$8.isFlowBaseAnnotation = isFlowBaseAnnotation$1;
+ generated$8.isFlowDeclaration = isFlowDeclaration$1;
+ generated$8.isFlowPredicate = isFlowPredicate$1;
+ generated$8.isEnumBody = isEnumBody$1;
+ generated$8.isEnumMember = isEnumMember$1;
+ generated$8.isJSX = isJSX$1;
+ generated$8.isTSTypeElement = isTSTypeElement$1;
+ generated$8.isTSType = isTSType$1;
+ generated$8.isTSBaseType = isTSBaseType$1;
+ generated$8.isNumberLiteral = isNumberLiteral$1;
+ generated$8.isRegexLiteral = isRegexLiteral$1;
+ generated$8.isRestProperty = isRestProperty$1;
+ generated$8.isSpreadProperty = isSpreadProperty$1;
+
+ var _shallowEqual$1 = shallowEqual$3;
+
+ function isArrayExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAssignmentExpression$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AssignmentExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBinaryExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BinaryExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterpreterDirective$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterpreterDirective") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDirective$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Directive") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDirectiveLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DirectiveLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBlockStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BlockStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBreakStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BreakStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isCallExpression$5(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CallExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isCatchClause$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CatchClause") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isConditionalExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ConditionalExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isContinueStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ContinueStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDebuggerStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DebuggerStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDoWhileStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DoWhileStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEmptyStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EmptyStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExpressionStatement$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExpressionStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFile$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "File") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForInStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForInStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForStatement$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIdentifier$4(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Identifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIfStatement$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IfStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLabeledStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LabeledStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStringLiteral$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumericLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumericLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNullLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBooleanLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRegExpLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RegExpLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLogicalExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LogicalExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMemberExpression$5(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNewExpression$4(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NewExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isProgram$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Program") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectMethod$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRestElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RestElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isReturnStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ReturnStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSequenceExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SequenceExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isParenthesizedExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ParenthesizedExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSwitchCase$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SwitchCase") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSwitchStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SwitchStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isThisExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThisExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isThrowStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThrowStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTryStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TryStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUnaryExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnaryExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUpdateExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UpdateExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVariableDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VariableDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVariableDeclarator$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VariableDeclarator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isWhileStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "WhileStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isWithStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "WithStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAssignmentPattern$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AssignmentPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArrayPattern$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArrowFunctionExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrowFunctionExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassDeclaration$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportAllDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportAllDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportDefaultDeclaration$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDefaultDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportNamedDeclaration$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportNamedDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForOfStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForOfStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportDefaultSpecifier$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportDefaultSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportNamespaceSpecifier$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportNamespaceSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMetaProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MetaProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassMethod$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectPattern$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSpreadElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SpreadElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSuper$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Super") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTaggedTemplateExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TaggedTemplateExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTemplateElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TemplateElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTemplateLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TemplateLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isYieldExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "YieldExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAwaitExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AwaitExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImport$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Import") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBigIntLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BigIntLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportNamespaceSpecifier$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportNamespaceSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOptionalMemberExpression$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalMemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOptionalCallExpression$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalCallExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassPrivateProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassPrivateProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassPrivateMethod$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassPrivateMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPrivateName$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PrivateName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAnyTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AnyTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArrayTypeAnnotation$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBooleanTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBooleanLiteralTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNullLiteralTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassImplements$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassImplements") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareClass$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareClass") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareFunction$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareInterface$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareInterface") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareModule$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareModule") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareModuleExports$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareModuleExports") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareTypeAlias$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareTypeAlias") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareOpaqueType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareOpaqueType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareVariable$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareVariable") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareExportDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareExportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareExportAllDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareExportAllDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclaredPredicate$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclaredPredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExistsTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExistsTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionTypeParam$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionTypeParam") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isGenericTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "GenericTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInferredPredicate$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InferredPredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterfaceExtends$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceExtends") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterfaceDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterfaceTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIntersectionTypeAnnotation$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IntersectionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMixedTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MixedTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEmptyTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EmptyTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNullableTypeAnnotation$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullableTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumberLiteralTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumberTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeInternalSlot$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeInternalSlot") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeCallProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeCallProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeIndexer$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeIndexer") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeSpreadProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeSpreadProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOpaqueType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OpaqueType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isQualifiedTypeIdentifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "QualifiedTypeIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStringLiteralTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStringTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSymbolTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SymbolTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isThisTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThisTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTupleTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeofTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeofTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeAlias$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeAlias") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeAnnotation$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeCastExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeCastExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeParameter$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameter") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeParameterDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameterDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeParameterInstantiation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameterInstantiation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUnionTypeAnnotation$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVariance$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Variance") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVoidTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VoidTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumBooleanBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumNumberBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumStringBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumSymbolBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumSymbolBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumBooleanMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumNumberMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumStringMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumDefaultedMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDefaultedMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIndexedAccessType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOptionalIndexedAccessType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalIndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXAttribute$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXClosingElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXClosingElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXEmptyExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXEmptyExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXExpressionContainer$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXExpressionContainer") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXSpreadChild$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXSpreadChild") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXIdentifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXMemberExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXMemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXNamespacedName$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXNamespacedName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXOpeningElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXOpeningElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXSpreadAttribute$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXSpreadAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXText$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXText") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXFragment$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXOpeningFragment$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXOpeningFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXClosingFragment$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXClosingFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNoop$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Noop") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPlaceholder$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Placeholder") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isV8IntrinsicIdentifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "V8IntrinsicIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArgumentPlaceholder$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArgumentPlaceholder") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBindExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BindExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportAttribute$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDecorator$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Decorator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDoExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DoExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportDefaultSpecifier$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDefaultSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRecordExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RecordExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTupleExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDecimalLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DecimalLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStaticBlock(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StaticBlock") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isModuleExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ModuleExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTopicReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TopicReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPipelineTopicExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelineTopicExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPipelineBareFunction$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelineBareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPipelinePrimaryTopicReference$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelinePrimaryTopicReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSParameterProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSParameterProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSDeclareFunction$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSDeclareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSDeclareMethod$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSDeclareMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSQualifiedName$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSQualifiedName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSCallSignatureDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSCallSignatureDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSConstructSignatureDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConstructSignatureDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSPropertySignature$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSPropertySignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSMethodSignature$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSMethodSignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIndexSignature$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIndexSignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSAnyKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSAnyKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSBooleanKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBooleanKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSBigIntKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBigIntKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIntrinsicKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIntrinsicKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNeverKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNeverKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNullKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNullKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNumberKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNumberKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSObjectKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSObjectKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSStringKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSStringKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSSymbolKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSSymbolKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSUndefinedKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUndefinedKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSUnknownKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUnknownKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSVoidKeyword$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSVoidKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSThisType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSThisType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSFunctionType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSFunctionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSConstructorType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConstructorType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeReference$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypePredicate$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypePredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeQuery$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeQuery") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSArrayType$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSArrayType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTupleType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTupleType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSOptionalType$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSOptionalType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSRestType$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSRestType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNamedTupleMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNamedTupleMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSUnionType$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUnionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIntersectionType$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIntersectionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSConditionalType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConditionalType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSInferType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInferType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSParenthesizedType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSParenthesizedType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeOperator$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeOperator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIndexedAccessType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSMappedType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSMappedType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSLiteralType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSLiteralType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSExpressionWithTypeArguments$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExpressionWithTypeArguments") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSInterfaceDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInterfaceDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSInterfaceBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInterfaceBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeAliasDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAliasDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSAsExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSAsExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeAssertion$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAssertion") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSEnumDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSEnumMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEnumMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSModuleDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSModuleDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSModuleBlock$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSModuleBlock") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSImportType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSImportType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSImportEqualsDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSImportEqualsDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSExternalModuleReference$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExternalModuleReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNonNullExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNonNullExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSExportAssignment$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExportAssignment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNamespaceExportDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNamespaceExportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeParameterInstantiation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameterInstantiation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeParameterDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameterDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeParameter$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameter") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "ModuleExpression" === nodeType || "TopicReference" === nodeType || "PipelineTopicExpression" === nodeType || "PipelineBareFunction" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBinary$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isScopable$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBlockParent$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBlock$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStatement$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTerminatorless$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isCompletionStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isConditional$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLoop$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isWhile$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExpressionWrapper$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFor$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForXStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunction$7(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionParent$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPureish$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPatternLike$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLVal$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSEntityName$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLiteral$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImmutable$5(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUserWhitespacable$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMethod$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isProperty$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUnaryLike$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPattern$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClass$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isModuleDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportDeclaration$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isModuleSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPrivate$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlow$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowBaseAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowPredicate$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumBody$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumMember$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSX$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeElement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSBaseType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumberLiteral$1(node, opts) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRegexLiteral$1(node, opts) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RegexLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRestProperty$1(node, opts) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RestProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSpreadProperty$1(node, opts) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SpreadProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual$1.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ Object.defineProperty(matchesPattern$3, "__esModule", {
+ value: true
+ });
+ matchesPattern$3.default = matchesPattern$2;
+
+ var _generated$M = generated$8;
+
+ function matchesPattern$2(member, match, allowPartial) {
+ if (!(0, _generated$M.isMemberExpression)(member)) return false;
+ const parts = Array.isArray(match) ? match : match.split(".");
+ const nodes = [];
+ let node;
+
+ for (node = member; (0, _generated$M.isMemberExpression)(node); node = node.object) {
+ nodes.push(node.property);
+ }
+
+ nodes.push(node);
+ if (nodes.length < parts.length) return false;
+ if (!allowPartial && nodes.length > parts.length) return false;
+
+ for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
+ const node = nodes[j];
+ let value;
+
+ if ((0, _generated$M.isIdentifier)(node)) {
+ value = node.name;
+ } else if ((0, _generated$M.isStringLiteral)(node)) {
+ value = node.value;
+ } else if ((0, _generated$M.isThisExpression)(node)) {
+ value = "this";
+ } else {
+ return false;
+ }
+
+ if (parts[i] !== value) return false;
+ }
+
+ return true;
+ }
+
+ Object.defineProperty(buildMatchMemberExpression$3, "__esModule", {
+ value: true
+ });
+ buildMatchMemberExpression$3.default = buildMatchMemberExpression$2;
+
+ var _matchesPattern$1 = matchesPattern$3;
+
+ function buildMatchMemberExpression$2(match, allowPartial) {
+ const parts = match.split(".");
+ return member => (0, _matchesPattern$1.default)(member, parts, allowPartial);
+ }
+
+ Object.defineProperty(isReactComponent$4, "__esModule", {
+ value: true
+ });
+ isReactComponent$4.default = void 0;
+
+ var _buildMatchMemberExpression$1 = buildMatchMemberExpression$3;
+
+ const isReactComponent$3 = (0, _buildMatchMemberExpression$1.default)("React.Component");
+ var _default$8 = isReactComponent$3;
+ isReactComponent$4.default = _default$8;
+
+ var isCompatTag$3 = {};
+
+ Object.defineProperty(isCompatTag$3, "__esModule", {
+ value: true
+ });
+ isCompatTag$3.default = isCompatTag$2;
+
+ function isCompatTag$2(tagName) {
+ return !!tagName && /^[a-z]/.test(tagName);
+ }
+
+ var buildChildren$3 = {};
+
+ var cleanJSXElementLiteralChild$3 = {};
+
+ var generated$7 = {};
+
+ var builder$3 = {};
+
+ var definitions$1 = {};
+
+ let fastProto = null;
+
+ // Creates an object with permanently fast properties in V8. See Toon Verwaest's
+ // post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62
+ // for more details. Use %HasFastProperties(object) and the Node.js flag
+ // --allow-natives-syntax to check whether an object has fast properties.
+ function FastObject(o) {
+ // A prototype object will have "fast properties" enabled once it is checked
+ // against the inline property cache of a function, e.g. fastProto.property:
+ // https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63
+ if (fastProto !== null && typeof fastProto.property) {
+ const result = fastProto;
+ fastProto = FastObject.prototype = null;
+ return result;
+ }
+ fastProto = FastObject.prototype = o == null ? Object.create(null) : o;
+ return new FastObject;
+ }
+
+ // Initialize the inline property cache of FastObject
+ FastObject();
+
+ var toFastProperties = function toFastproperties(o) {
+ return FastObject(o);
+ };
+
+ var global$1 = (typeof global !== "undefined" ? global :
+ typeof self !== "undefined" ? self :
+ typeof window !== "undefined" ? window : {});
+
+ // shim for using process in browser
+ // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
+
+ function defaultSetTimout() {
+ throw new Error('setTimeout has not been defined');
+ }
+ function defaultClearTimeout () {
+ throw new Error('clearTimeout has not been defined');
+ }
+ var cachedSetTimeout = defaultSetTimout;
+ var cachedClearTimeout = defaultClearTimeout;
+ if (typeof global$1.setTimeout === 'function') {
+ cachedSetTimeout = setTimeout;
+ }
+ if (typeof global$1.clearTimeout === 'function') {
+ cachedClearTimeout = clearTimeout;
+ }
+
+ function runTimeout(fun) {
+ if (cachedSetTimeout === setTimeout) {
+ //normal enviroments in sane situations
+ return setTimeout(fun, 0);
+ }
+ // if setTimeout wasn't available but was latter defined
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+ cachedSetTimeout = setTimeout;
+ return setTimeout(fun, 0);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedSetTimeout(fun, 0);
+ } catch(e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedSetTimeout.call(null, fun, 0);
+ } catch(e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+ return cachedSetTimeout.call(this, fun, 0);
+ }
+ }
+
+
+ }
+ function runClearTimeout(marker) {
+ if (cachedClearTimeout === clearTimeout) {
+ //normal enviroments in sane situations
+ return clearTimeout(marker);
+ }
+ // if clearTimeout wasn't available but was latter defined
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+ cachedClearTimeout = clearTimeout;
+ return clearTimeout(marker);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedClearTimeout(marker);
+ } catch (e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedClearTimeout.call(null, marker);
+ } catch (e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+ return cachedClearTimeout.call(this, marker);
+ }
+ }
+
+
+
+ }
+ var queue = [];
+ var draining = false;
+ var currentQueue;
+ var queueIndex = -1;
+
+ function cleanUpNextTick() {
+ if (!draining || !currentQueue) {
+ return;
+ }
+ draining = false;
+ if (currentQueue.length) {
+ queue = currentQueue.concat(queue);
+ } else {
+ queueIndex = -1;
+ }
+ if (queue.length) {
+ drainQueue();
+ }
+ }
+
+ function drainQueue() {
+ if (draining) {
+ return;
+ }
+ var timeout = runTimeout(cleanUpNextTick);
+ draining = true;
+
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ while (++queueIndex < len) {
+ if (currentQueue) {
+ currentQueue[queueIndex].run();
+ }
+ }
+ queueIndex = -1;
+ len = queue.length;
+ }
+ currentQueue = null;
+ draining = false;
+ runClearTimeout(timeout);
+ }
+ function nextTick(fun) {
+ var args = new Array(arguments.length - 1);
+ if (arguments.length > 1) {
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i];
+ }
+ }
+ queue.push(new Item(fun, args));
+ if (queue.length === 1 && !draining) {
+ runTimeout(drainQueue);
+ }
+ }
+ // v8 likes predictible objects
+ function Item(fun, array) {
+ this.fun = fun;
+ this.array = array;
+ }
+ Item.prototype.run = function () {
+ this.fun.apply(null, this.array);
+ };
+ var title = 'browser';
+ var platform = 'browser';
+ var browser = true;
+ var env = {};
+ var argv = [];
+ var version = ''; // empty string to avoid regexp issues
+ var versions = {};
+ var release = {};
+ var config = {};
+
+ function noop$3() {}
+
+ var on = noop$3;
+ var addListener = noop$3;
+ var once = noop$3;
+ var off = noop$3;
+ var removeListener = noop$3;
+ var removeAllListeners = noop$3;
+ var emit = noop$3;
+
+ function binding(name) {
+ throw new Error('process.binding is not supported');
+ }
+
+ function cwd () { return '/' }
+ function chdir (dir) {
+ throw new Error('process.chdir is not supported');
+ }function umask() { return 0; }
+
+ // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
+ var performance = global$1.performance || {};
+ var performanceNow =
+ performance.now ||
+ performance.mozNow ||
+ performance.msNow ||
+ performance.oNow ||
+ performance.webkitNow ||
+ function(){ return (new Date()).getTime() };
+
+ // generate timestamp or delta
+ // see http://nodejs.org/api/process.html#process_process_hrtime
+ function hrtime(previousTimestamp){
+ var clocktime = performanceNow.call(performance)*1e-3;
+ var seconds = Math.floor(clocktime);
+ var nanoseconds = Math.floor((clocktime%1)*1e9);
+ if (previousTimestamp) {
+ seconds = seconds - previousTimestamp[0];
+ nanoseconds = nanoseconds - previousTimestamp[1];
+ if (nanoseconds<0) {
+ seconds--;
+ nanoseconds += 1e9;
+ }
+ }
+ return [seconds,nanoseconds]
+ }
+
+ var startTime = new Date();
+ function uptime() {
+ var currentTime = new Date();
+ var dif = currentTime - startTime;
+ return dif / 1000;
+ }
+
+ var browser$1 = {
+ nextTick: nextTick,
+ title: title,
+ browser: browser,
+ env: env,
+ argv: argv,
+ version: version,
+ versions: versions,
+ on: on,
+ addListener: addListener,
+ once: once,
+ off: off,
+ removeListener: removeListener,
+ removeAllListeners: removeAllListeners,
+ emit: emit,
+ binding: binding,
+ cwd: cwd,
+ chdir: chdir,
+ umask: umask,
+ hrtime: hrtime,
+ platform: platform,
+ release: release,
+ config: config,
+ uptime: uptime
+ };
+
+ var process$1 = browser$1;
+
+ var core$1 = {};
+
+ var is$1 = {};
+
+ var isType$2 = {};
+
+ var hasRequiredIsType$1;
+
+ function requireIsType$1 () {
+ if (hasRequiredIsType$1) return isType$2;
+ hasRequiredIsType$1 = 1;
+
+ Object.defineProperty(isType$2, "__esModule", {
+ value: true
+ });
+ isType$2.default = isType;
+
+ var _definitions = requireDefinitions$1();
+
+ function isType(nodeType, targetType) {
+ if (nodeType === targetType) return true;
+ if (_definitions.ALIAS_KEYS[targetType]) return false;
+ const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
+
+ if (aliases) {
+ if (aliases[0] === nodeType) return true;
+
+ for (const alias of aliases) {
+ if (nodeType === alias) return true;
+ }
+ }
+
+ return false;
+ }
+ return isType$2;
+ }
+
+ var isPlaceholderType$1 = {};
+
+ var hasRequiredIsPlaceholderType$1;
+
+ function requireIsPlaceholderType$1 () {
+ if (hasRequiredIsPlaceholderType$1) return isPlaceholderType$1;
+ hasRequiredIsPlaceholderType$1 = 1;
+
+ Object.defineProperty(isPlaceholderType$1, "__esModule", {
+ value: true
+ });
+ isPlaceholderType$1.default = isPlaceholderType;
+
+ var _definitions = requireDefinitions$1();
+
+ function isPlaceholderType(placeholderType, targetType) {
+ if (placeholderType === targetType) return true;
+ const aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType];
+
+ if (aliases) {
+ for (const alias of aliases) {
+ if (targetType === alias) return true;
+ }
+ }
+
+ return false;
+ }
+ return isPlaceholderType$1;
+ }
+
+ var hasRequiredIs$1;
+
+ function requireIs$1 () {
+ if (hasRequiredIs$1) return is$1;
+ hasRequiredIs$1 = 1;
+
+ Object.defineProperty(is$1, "__esModule", {
+ value: true
+ });
+ is$1.default = is;
+
+ var _shallowEqual = shallowEqual$3;
+
+ var _isType = requireIsType$1();
+
+ var _isPlaceholderType = requireIsPlaceholderType$1();
+
+ var _definitions = requireDefinitions$1();
+
+ function is(type, node, opts) {
+ if (!node) return false;
+ const matches = (0, _isType.default)(node.type, type);
+
+ if (!matches) {
+ if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
+ return (0, _isPlaceholderType.default)(node.expectedNode, type);
+ }
+
+ return false;
+ }
+
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+ return is$1;
+ }
+
+ var isValidIdentifier$3 = {};
+
+ var lib$5 = {};
+
+ var identifier$2 = {};
+
+ Object.defineProperty(identifier$2, "__esModule", {
+ value: true
+ });
+ identifier$2.isIdentifierStart = isIdentifierStart$3;
+ identifier$2.isIdentifierChar = isIdentifierChar$3;
+ identifier$2.isIdentifierName = isIdentifierName$1;
+ let nonASCIIidentifierStartChars$3 = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+ let nonASCIIidentifierChars$3 = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+ const nonASCIIidentifierStart$3 = new RegExp("[" + nonASCIIidentifierStartChars$3 + "]");
+ const nonASCIIidentifier$3 = new RegExp("[" + nonASCIIidentifierStartChars$3 + nonASCIIidentifierChars$3 + "]");
+ nonASCIIidentifierStartChars$3 = nonASCIIidentifierChars$3 = null;
+ const astralIdentifierStartCodes$3 = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+ const astralIdentifierCodes$3 = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+ function isInAstralSet$3(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+ }
+
+ function isIdentifierStart$3(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart$3.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet$3(code, astralIdentifierStartCodes$3);
+ }
+
+ function isIdentifierChar$3(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier$3.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet$3(code, astralIdentifierStartCodes$3) || isInAstralSet$3(code, astralIdentifierCodes$3);
+ }
+
+ function isIdentifierName$1(name) {
+ let isFirst = true;
+
+ for (let i = 0; i < name.length; i++) {
+ let cp = name.charCodeAt(i);
+
+ if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
+ const trail = name.charCodeAt(++i);
+
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+
+ if (isFirst) {
+ isFirst = false;
+
+ if (!isIdentifierStart$3(cp)) {
+ return false;
+ }
+ } else if (!isIdentifierChar$3(cp)) {
+ return false;
+ }
+ }
+
+ return !isFirst;
+ }
+
+ var keyword$1 = {};
+
+ Object.defineProperty(keyword$1, "__esModule", {
+ value: true
+ });
+ keyword$1.isReservedWord = isReservedWord$3;
+ keyword$1.isStrictReservedWord = isStrictReservedWord$3;
+ keyword$1.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord$3;
+ keyword$1.isStrictBindReservedWord = isStrictBindReservedWord$3;
+ keyword$1.isKeyword = isKeyword$3;
+ const reservedWords$3 = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+ };
+ const keywords$4 = new Set(reservedWords$3.keyword);
+ const reservedWordsStrictSet$3 = new Set(reservedWords$3.strict);
+ const reservedWordsStrictBindSet$3 = new Set(reservedWords$3.strictBind);
+
+ function isReservedWord$3(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+ }
+
+ function isStrictReservedWord$3(word, inModule) {
+ return isReservedWord$3(word, inModule) || reservedWordsStrictSet$3.has(word);
+ }
+
+ function isStrictBindOnlyReservedWord$3(word) {
+ return reservedWordsStrictBindSet$3.has(word);
+ }
+
+ function isStrictBindReservedWord$3(word, inModule) {
+ return isStrictReservedWord$3(word, inModule) || isStrictBindOnlyReservedWord$3(word);
+ }
+
+ function isKeyword$3(word) {
+ return keywords$4.has(word);
+ }
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.defineProperty(exports, "isIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierName;
+ }
+ });
+ Object.defineProperty(exports, "isIdentifierChar", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierChar;
+ }
+ });
+ Object.defineProperty(exports, "isIdentifierStart", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierStart;
+ }
+ });
+ Object.defineProperty(exports, "isReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindOnlyReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isStrictBindReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isStrictReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isKeyword", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isKeyword;
+ }
+ });
+
+ var _identifier = identifier$2;
+
+ var _keyword = keyword$1;
+ } (lib$5));
+
+ Object.defineProperty(isValidIdentifier$3, "__esModule", {
+ value: true
+ });
+ isValidIdentifier$3.default = isValidIdentifier$2;
+
+ var _helperValidatorIdentifier$2 = lib$5;
+
+ function isValidIdentifier$2(name, reserved = true) {
+ if (typeof name !== "string") return false;
+
+ if (reserved) {
+ if ((0, _helperValidatorIdentifier$2.isKeyword)(name) || (0, _helperValidatorIdentifier$2.isStrictReservedWord)(name, true)) {
+ return false;
+ }
+ }
+
+ return (0, _helperValidatorIdentifier$2.isIdentifierName)(name);
+ }
+
+ var constants$1 = {};
+
+ Object.defineProperty(constants$1, "__esModule", {
+ value: true
+ });
+ constants$1.NOT_LOCAL_BINDING = constants$1.BLOCK_SCOPED_SYMBOL = constants$1.INHERIT_KEYS = constants$1.UNARY_OPERATORS = constants$1.STRING_UNARY_OPERATORS = constants$1.NUMBER_UNARY_OPERATORS = constants$1.BOOLEAN_UNARY_OPERATORS = constants$1.ASSIGNMENT_OPERATORS = constants$1.BINARY_OPERATORS = constants$1.NUMBER_BINARY_OPERATORS = constants$1.BOOLEAN_BINARY_OPERATORS = constants$1.COMPARISON_BINARY_OPERATORS = constants$1.EQUALITY_BINARY_OPERATORS = constants$1.BOOLEAN_NUMBER_BINARY_OPERATORS = constants$1.UPDATE_OPERATORS = constants$1.LOGICAL_OPERATORS = constants$1.COMMENT_KEYS = constants$1.FOR_INIT_KEYS = constants$1.FLATTENABLE_KEYS = constants$1.STATEMENT_OR_BLOCK_KEYS = void 0;
+ const STATEMENT_OR_BLOCK_KEYS$1 = ["consequent", "body", "alternate"];
+ constants$1.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS$1;
+ const FLATTENABLE_KEYS$1 = ["body", "expressions"];
+ constants$1.FLATTENABLE_KEYS = FLATTENABLE_KEYS$1;
+ const FOR_INIT_KEYS$1 = ["left", "init"];
+ constants$1.FOR_INIT_KEYS = FOR_INIT_KEYS$1;
+ const COMMENT_KEYS$1 = ["leadingComments", "trailingComments", "innerComments"];
+ constants$1.COMMENT_KEYS = COMMENT_KEYS$1;
+ const LOGICAL_OPERATORS$1 = ["||", "&&", "??"];
+ constants$1.LOGICAL_OPERATORS = LOGICAL_OPERATORS$1;
+ const UPDATE_OPERATORS$1 = ["++", "--"];
+ constants$1.UPDATE_OPERATORS = UPDATE_OPERATORS$1;
+ const BOOLEAN_NUMBER_BINARY_OPERATORS$1 = [">", "<", ">=", "<="];
+ constants$1.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS$1;
+ const EQUALITY_BINARY_OPERATORS$1 = ["==", "===", "!=", "!=="];
+ constants$1.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS$1;
+ const COMPARISON_BINARY_OPERATORS$1 = [...EQUALITY_BINARY_OPERATORS$1, "in", "instanceof"];
+ constants$1.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS$1;
+ const BOOLEAN_BINARY_OPERATORS$1 = [...COMPARISON_BINARY_OPERATORS$1, ...BOOLEAN_NUMBER_BINARY_OPERATORS$1];
+ constants$1.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS$1;
+ const NUMBER_BINARY_OPERATORS$1 = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
+ constants$1.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS$1;
+ const BINARY_OPERATORS$1 = ["+", ...NUMBER_BINARY_OPERATORS$1, ...BOOLEAN_BINARY_OPERATORS$1];
+ constants$1.BINARY_OPERATORS = BINARY_OPERATORS$1;
+ const ASSIGNMENT_OPERATORS$1 = ["=", "+=", ...NUMBER_BINARY_OPERATORS$1.map(op => op + "="), ...LOGICAL_OPERATORS$1.map(op => op + "=")];
+ constants$1.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS$1;
+ const BOOLEAN_UNARY_OPERATORS$1 = ["delete", "!"];
+ constants$1.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS$1;
+ const NUMBER_UNARY_OPERATORS$1 = ["+", "-", "~"];
+ constants$1.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS$1;
+ const STRING_UNARY_OPERATORS$1 = ["typeof"];
+ constants$1.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS$1;
+ const UNARY_OPERATORS$1 = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS$1, ...NUMBER_UNARY_OPERATORS$1, ...STRING_UNARY_OPERATORS$1];
+ constants$1.UNARY_OPERATORS = UNARY_OPERATORS$1;
+ const INHERIT_KEYS$1 = {
+ optional: ["typeAnnotation", "typeParameters", "returnType"],
+ force: ["start", "loc", "end"]
+ };
+ constants$1.INHERIT_KEYS = INHERIT_KEYS$1;
+ const BLOCK_SCOPED_SYMBOL$1 = Symbol.for("var used to be block scoped");
+ constants$1.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL$1;
+ const NOT_LOCAL_BINDING$1 = Symbol.for("should not be considered a local binding");
+ constants$1.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING$1;
+
+ var utils$1 = {};
+
+ var validate$1 = {};
+
+ var hasRequiredValidate$1;
+
+ function requireValidate$1 () {
+ if (hasRequiredValidate$1) return validate$1;
+ hasRequiredValidate$1 = 1;
+
+ Object.defineProperty(validate$1, "__esModule", {
+ value: true
+ });
+ validate$1.default = validate;
+ validate$1.validateField = validateField;
+ validate$1.validateChild = validateChild;
+
+ var _definitions = requireDefinitions$1();
+
+ function validate(node, key, val) {
+ if (!node) return;
+ const fields = _definitions.NODE_FIELDS[node.type];
+ if (!fields) return;
+ const field = fields[key];
+ validateField(node, key, val, field);
+ validateChild(node, key, val);
+ }
+
+ function validateField(node, key, val, field) {
+ if (!(field != null && field.validate)) return;
+ if (field.optional && val == null) return;
+ field.validate(node, key, val);
+ }
+
+ function validateChild(node, key, val) {
+ if (val == null) return;
+ const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];
+ if (!validate) return;
+ validate(node, key, val);
+ }
+ return validate$1;
+ }
+
+ var hasRequiredUtils$1;
+
+ function requireUtils$1 () {
+ if (hasRequiredUtils$1) return utils$1;
+ hasRequiredUtils$1 = 1;
+
+ Object.defineProperty(utils$1, "__esModule", {
+ value: true
+ });
+ utils$1.validate = validate;
+ utils$1.typeIs = typeIs;
+ utils$1.validateType = validateType;
+ utils$1.validateOptional = validateOptional;
+ utils$1.validateOptionalType = validateOptionalType;
+ utils$1.arrayOf = arrayOf;
+ utils$1.arrayOfType = arrayOfType;
+ utils$1.validateArrayOfType = validateArrayOfType;
+ utils$1.assertEach = assertEach;
+ utils$1.assertOneOf = assertOneOf;
+ utils$1.assertNodeType = assertNodeType;
+ utils$1.assertNodeOrValueType = assertNodeOrValueType;
+ utils$1.assertValueType = assertValueType;
+ utils$1.assertShape = assertShape;
+ utils$1.assertOptionalChainStart = assertOptionalChainStart;
+ utils$1.chain = chain;
+ utils$1.default = defineType;
+ utils$1.NODE_PARENT_VALIDATIONS = utils$1.DEPRECATED_KEYS = utils$1.BUILDER_KEYS = utils$1.NODE_FIELDS = utils$1.FLIPPED_ALIAS_KEYS = utils$1.ALIAS_KEYS = utils$1.VISITOR_KEYS = void 0;
+
+ var _is = requireIs$1();
+
+ var _validate = requireValidate$1();
+
+ const VISITOR_KEYS = {};
+ utils$1.VISITOR_KEYS = VISITOR_KEYS;
+ const ALIAS_KEYS = {};
+ utils$1.ALIAS_KEYS = ALIAS_KEYS;
+ const FLIPPED_ALIAS_KEYS = {};
+ utils$1.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
+ const NODE_FIELDS = {};
+ utils$1.NODE_FIELDS = NODE_FIELDS;
+ const BUILDER_KEYS = {};
+ utils$1.BUILDER_KEYS = BUILDER_KEYS;
+ const DEPRECATED_KEYS = {};
+ utils$1.DEPRECATED_KEYS = DEPRECATED_KEYS;
+ const NODE_PARENT_VALIDATIONS = {};
+ utils$1.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
+
+ function getType(val) {
+ if (Array.isArray(val)) {
+ return "array";
+ } else if (val === null) {
+ return "null";
+ } else {
+ return typeof val;
+ }
+ }
+
+ function validate(validate) {
+ return {
+ validate
+ };
+ }
+
+ function typeIs(typeName) {
+ return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
+ }
+
+ function validateType(typeName) {
+ return validate(typeIs(typeName));
+ }
+
+ function validateOptional(validate) {
+ return {
+ validate,
+ optional: true
+ };
+ }
+
+ function validateOptionalType(typeName) {
+ return {
+ validate: typeIs(typeName),
+ optional: true
+ };
+ }
+
+ function arrayOf(elementType) {
+ return chain(assertValueType("array"), assertEach(elementType));
+ }
+
+ function arrayOfType(typeName) {
+ return arrayOf(typeIs(typeName));
+ }
+
+ function validateArrayOfType(typeName) {
+ return validate(arrayOfType(typeName));
+ }
+
+ function assertEach(callback) {
+ function validator(node, key, val) {
+ if (!Array.isArray(val)) return;
+
+ for (let i = 0; i < val.length; i++) {
+ const subkey = `${key}[${i}]`;
+ const v = val[i];
+ callback(node, subkey, v);
+ if (process$1.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v);
+ }
+ }
+
+ validator.each = callback;
+ return validator;
+ }
+
+ function assertOneOf(...values) {
+ function validate(node, key, val) {
+ if (values.indexOf(val) < 0) {
+ throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
+ }
+ }
+
+ validate.oneOf = values;
+ return validate;
+ }
+
+ function assertNodeType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if ((0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeTypes = types;
+ return validate;
+ }
+
+ function assertNodeOrValueType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if (getType(val) === type || (0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeOrValueTypes = types;
+ return validate;
+ }
+
+ function assertValueType(type) {
+ function validate(node, key, val) {
+ const valid = getType(val) === type;
+
+ if (!valid) {
+ throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
+ }
+ }
+
+ validate.type = type;
+ return validate;
+ }
+
+ function assertShape(shape) {
+ function validate(node, key, val) {
+ const errors = [];
+
+ for (const property of Object.keys(shape)) {
+ try {
+ (0, _validate.validateField)(node, property, val[property], shape[property]);
+ } catch (error) {
+ if (error instanceof TypeError) {
+ errors.push(error.message);
+ continue;
+ }
+
+ throw error;
+ }
+ }
+
+ if (errors.length) {
+ throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
+ }
+ }
+
+ validate.shapeOf = shape;
+ return validate;
+ }
+
+ function assertOptionalChainStart() {
+ function validate(node) {
+ var _current;
+
+ let current = node;
+
+ while (node) {
+ const {
+ type
+ } = current;
+
+ if (type === "OptionalCallExpression") {
+ if (current.optional) return;
+ current = current.callee;
+ continue;
+ }
+
+ if (type === "OptionalMemberExpression") {
+ if (current.optional) return;
+ current = current.object;
+ continue;
+ }
+
+ break;
+ }
+
+ throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
+ }
+
+ return validate;
+ }
+
+ function chain(...fns) {
+ function validate(...args) {
+ for (const fn of fns) {
+ fn(...args);
+ }
+ }
+
+ validate.chainOf = fns;
+
+ if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
+ throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);
+ }
+
+ return validate;
+ }
+
+ const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
+ const validFieldKeys = ["default", "optional", "validate"];
+
+ function defineType(type, opts = {}) {
+ const inherits = opts.inherits && store[opts.inherits] || {};
+ let fields = opts.fields;
+
+ if (!fields) {
+ fields = {};
+
+ if (inherits.fields) {
+ const keys = Object.getOwnPropertyNames(inherits.fields);
+
+ for (const key of keys) {
+ const field = inherits.fields[key];
+ const def = field.default;
+
+ if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
+ throw new Error("field defaults can only be primitives or empty arrays currently");
+ }
+
+ fields[key] = {
+ default: Array.isArray(def) ? [] : def,
+ optional: field.optional,
+ validate: field.validate
+ };
+ }
+ }
+ }
+
+ const visitor = opts.visitor || inherits.visitor || [];
+ const aliases = opts.aliases || inherits.aliases || [];
+ const builder = opts.builder || inherits.builder || opts.visitor || [];
+
+ for (const k of Object.keys(opts)) {
+ if (validTypeOpts.indexOf(k) === -1) {
+ throw new Error(`Unknown type option "${k}" on ${type}`);
+ }
+ }
+
+ if (opts.deprecatedAlias) {
+ DEPRECATED_KEYS[opts.deprecatedAlias] = type;
+ }
+
+ for (const key of visitor.concat(builder)) {
+ fields[key] = fields[key] || {};
+ }
+
+ for (const key of Object.keys(fields)) {
+ const field = fields[key];
+
+ if (field.default !== undefined && builder.indexOf(key) === -1) {
+ field.optional = true;
+ }
+
+ if (field.default === undefined) {
+ field.default = null;
+ } else if (!field.validate && field.default != null) {
+ field.validate = assertValueType(getType(field.default));
+ }
+
+ for (const k of Object.keys(field)) {
+ if (validFieldKeys.indexOf(k) === -1) {
+ throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
+ }
+ }
+ }
+
+ VISITOR_KEYS[type] = opts.visitor = visitor;
+ BUILDER_KEYS[type] = opts.builder = builder;
+ NODE_FIELDS[type] = opts.fields = fields;
+ ALIAS_KEYS[type] = opts.aliases = aliases;
+ aliases.forEach(alias => {
+ FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
+ FLIPPED_ALIAS_KEYS[alias].push(type);
+ });
+
+ if (opts.validate) {
+ NODE_PARENT_VALIDATIONS[type] = opts.validate;
+ }
+
+ store[type] = opts;
+ }
+
+ const store = {};
+ return utils$1;
+ }
+
+ var hasRequiredCore$1;
+
+ function requireCore$1 () {
+ if (hasRequiredCore$1) return core$1;
+ hasRequiredCore$1 = 1;
+
+ Object.defineProperty(core$1, "__esModule", {
+ value: true
+ });
+ core$1.classMethodOrDeclareMethodCommon = core$1.classMethodOrPropertyCommon = core$1.patternLikeCommon = core$1.functionDeclarationCommon = core$1.functionTypeAnnotationCommon = core$1.functionCommon = void 0;
+
+ var _is = requireIs$1();
+
+ var _isValidIdentifier = isValidIdentifier$3;
+
+ var _helperValidatorIdentifier = lib$5;
+
+ var _constants = constants$1;
+
+ var _utils = requireUtils$1();
+
+ (0, _utils.default)("ArrayExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
+ default: !process$1.env.BABEL_TYPES_8_BREAKING ? [] : undefined
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("AssignmentExpression", {
+ fields: {
+ operator: {
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertValueType)("string");
+ }
+
+ const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS);
+ const pattern = (0, _utils.assertOneOf)("=");
+ return function (node, key, val) {
+ const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier;
+ validator(node, key, val);
+ };
+ }()
+ },
+ left: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ builder: ["operator", "left", "right"],
+ visitor: ["left", "right"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("BinaryExpression", {
+ builder: ["operator", "left", "right"],
+ fields: {
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS)
+ },
+ left: {
+ validate: function () {
+ const expression = (0, _utils.assertNodeType)("Expression");
+ const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName");
+
+ const validator = function (node, key, val) {
+ const validator = node.operator === "in" ? inOp : expression;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "PrivateName"];
+ return validator;
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ visitor: ["left", "right"],
+ aliases: ["Binary", "Expression"]
+ });
+ (0, _utils.default)("InterpreterDirective", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("Directive", {
+ visitor: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertNodeType)("DirectiveLiteral")
+ }
+ }
+ });
+ (0, _utils.default)("DirectiveLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("BlockStatement", {
+ builder: ["body", "directives"],
+ visitor: ["directives", "body"],
+ fields: {
+ directives: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
+ default: []
+ },
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent", "Block", "Statement"]
+ });
+ (0, _utils.default)("BreakStatement", {
+ visitor: ["label"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ },
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"]
+ });
+ (0, _utils.default)("CallExpression", {
+ visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
+ builder: ["callee", "arguments"],
+ aliases: ["Expression"],
+ fields: Object.assign({
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
+ }
+ }, !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ optional: {
+ validate: (0, _utils.assertOneOf)(true, false),
+ optional: true
+ }
+ } : {}, {
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("CatchClause", {
+ visitor: ["param", "body"],
+ fields: {
+ param: {
+ validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ },
+ aliases: ["Scopable", "BlockParent"]
+ });
+ (0, _utils.default)("ConditionalExpression", {
+ visitor: ["test", "consequent", "alternate"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ consequent: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ alternate: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression", "Conditional"]
+ });
+ (0, _utils.default)("ContinueStatement", {
+ visitor: ["label"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ },
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"]
+ });
+ (0, _utils.default)("DebuggerStatement", {
+ aliases: ["Statement"]
+ });
+ (0, _utils.default)("DoWhileStatement", {
+ visitor: ["test", "body"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ },
+ aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
+ });
+ (0, _utils.default)("EmptyStatement", {
+ aliases: ["Statement"]
+ });
+ (0, _utils.default)("ExpressionStatement", {
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Statement", "ExpressionWrapper"]
+ });
+ (0, _utils.default)("File", {
+ builder: ["program", "comments", "tokens"],
+ visitor: ["program"],
+ fields: {
+ program: {
+ validate: (0, _utils.assertNodeType)("Program")
+ },
+ comments: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
+ each: {
+ oneOfNodeTypes: ["CommentBlock", "CommentLine"]
+ }
+ }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")),
+ optional: true
+ },
+ tokens: {
+ validate: (0, _utils.assertEach)(Object.assign(() => {}, {
+ type: "any"
+ })),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ForInStatement", {
+ visitor: ["left", "right", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("ForStatement", {
+ visitor: ["init", "test", "update", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
+ fields: {
+ init: {
+ validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"),
+ optional: true
+ },
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ update: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ const functionCommon = {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement")))
+ },
+ generator: {
+ default: false
+ },
+ async: {
+ default: false
+ }
+ };
+ core$1.functionCommon = functionCommon;
+ const functionTypeAnnotationCommon = {
+ returnType: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ }
+ };
+ core$1.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
+ const functionDeclarationCommon = Object.assign({}, functionCommon, {
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ });
+ core$1.functionDeclarationCommon = functionDeclarationCommon;
+ (0, _utils.default)("FunctionDeclaration", {
+ builder: ["id", "params", "body", "generator", "async"],
+ visitor: ["id", "params", "body", "returnType", "typeParameters"],
+ fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }),
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return () => {};
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+ });
+ (0, _utils.default)("FunctionExpression", {
+ inherits: "FunctionDeclaration",
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+ });
+ const patternLikeCommon = {
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
+ }
+ };
+ core$1.patternLikeCommon = patternLikeCommon;
+ (0, _utils.default)("Identifier", {
+ builder: ["name"],
+ visitor: ["typeAnnotation", "decorators"],
+ aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
+ fields: Object.assign({}, patternLikeCommon, {
+ name: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _isValidIdentifier.default)(val, false)) {
+ throw new TypeError(`"${val}" is not a valid identifier name`);
+ }
+ }, {
+ type: "string"
+ }))
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }),
+
+ validate(parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const match = /\.(\w+)$/.exec(key);
+ if (!match) return;
+ const [, parentKey] = match;
+ const nonComp = {
+ computed: false
+ };
+
+ if (parentKey === "property") {
+ if ((0, _is.default)("MemberExpression", parent, nonComp)) return;
+ if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return;
+ } else if (parentKey === "key") {
+ if ((0, _is.default)("Property", parent, nonComp)) return;
+ if ((0, _is.default)("Method", parent, nonComp)) return;
+ } else if (parentKey === "exported") {
+ if ((0, _is.default)("ExportSpecifier", parent)) return;
+ } else if (parentKey === "imported") {
+ if ((0, _is.default)("ImportSpecifier", parent, {
+ imported: node
+ })) return;
+ } else if (parentKey === "meta") {
+ if ((0, _is.default)("MetaProperty", parent, {
+ meta: node
+ })) return;
+ }
+
+ if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name, false)) && node.name !== "this") {
+ throw new TypeError(`"${node.name}" is not a valid identifier`);
+ }
+ }
+
+ });
+ (0, _utils.default)("IfStatement", {
+ visitor: ["test", "consequent", "alternate"],
+ aliases: ["Statement", "Conditional"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ consequent: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ alternate: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("LabeledStatement", {
+ visitor: ["label", "body"],
+ aliases: ["Statement"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("StringLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("NumericLiteral", {
+ builder: ["value"],
+ deprecatedAlias: "NumberLiteral",
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("number")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("NullLiteral", {
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("BooleanLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("boolean")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("RegExpLiteral", {
+ builder: ["pattern", "flags"],
+ deprecatedAlias: "RegexLiteral",
+ aliases: ["Expression", "Pureish", "Literal"],
+ fields: {
+ pattern: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ flags: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const invalid = /[^gimsuy]/.exec(val);
+
+ if (invalid) {
+ throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
+ }
+ }, {
+ type: "string"
+ })),
+ default: ""
+ }
+ }
+ });
+ (0, _utils.default)("LogicalExpression", {
+ builder: ["operator", "left", "right"],
+ visitor: ["left", "right"],
+ aliases: ["Binary", "Expression"],
+ fields: {
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS)
+ },
+ left: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("MemberExpression", {
+ builder: ["object", "property", "computed", ...(!process$1.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])],
+ visitor: ["object", "property"],
+ aliases: ["Expression", "LVal"],
+ fields: Object.assign({
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ }
+ }, !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ optional: {
+ validate: (0, _utils.assertOneOf)(true, false),
+ optional: true
+ }
+ } : {})
+ });
+ (0, _utils.default)("NewExpression", {
+ inherits: "CallExpression"
+ });
+ (0, _utils.default)("Program", {
+ visitor: ["directives", "body"],
+ builder: ["body", "directives", "sourceType", "interpreter"],
+ fields: {
+ sourceFile: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ sourceType: {
+ validate: (0, _utils.assertOneOf)("script", "module"),
+ default: "script"
+ },
+ interpreter: {
+ validate: (0, _utils.assertNodeType)("InterpreterDirective"),
+ default: null,
+ optional: true
+ },
+ directives: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
+ default: []
+ },
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent", "Block"]
+ });
+ (0, _utils.default)("ObjectExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
+ }
+ }
+ });
+ (0, _utils.default)("ObjectMethod", {
+ builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ kind: Object.assign({
+ validate: (0, _utils.assertOneOf)("method", "get", "set")
+ }, !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ default: "method"
+ } : {}),
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }),
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
+ });
+ (0, _utils.default)("ObjectProperty", {
+ builder: ["key", "value", "computed", "shorthand", ...(!process$1.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
+ fields: {
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
+ },
+ shorthand: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.computed) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
+ }
+ }, {
+ type: "boolean"
+ }), function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !(0, _is.default)("Identifier", node.key)) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
+ }
+ }),
+ default: false
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ },
+ visitor: ["key", "value", "decorators"],
+ aliases: ["UserWhitespacable", "Property", "ObjectMember"],
+ validate: function () {
+ const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern");
+ const expression = (0, _utils.assertNodeType)("Expression");
+ return function (parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression;
+ validator(node, "value", node.value);
+ };
+ }()
+ });
+ (0, _utils.default)("RestElement", {
+ visitor: ["argument", "typeAnnotation"],
+ builder: ["argument"],
+ aliases: ["LVal", "PatternLike"],
+ deprecatedAlias: "RestProperty",
+ fields: Object.assign({}, patternLikeCommon, {
+ argument: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression")
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }),
+
+ validate(parent, key) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const match = /(\w+)\[(\d+)\]/.exec(key);
+ if (!match) throw new Error("Internal Babel error: malformed key.");
+ const [, listKey, index] = match;
+
+ if (parent[listKey].length > index + 1) {
+ throw new TypeError(`RestElement must be last element of ${listKey}`);
+ }
+ }
+
+ });
+ (0, _utils.default)("ReturnStatement", {
+ visitor: ["argument"],
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("SequenceExpression", {
+ visitor: ["expressions"],
+ fields: {
+ expressions: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
+ }
+ },
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("ParenthesizedExpression", {
+ visitor: ["expression"],
+ aliases: ["Expression", "ExpressionWrapper"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("SwitchCase", {
+ visitor: ["test", "consequent"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ consequent: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ }
+ });
+ (0, _utils.default)("SwitchStatement", {
+ visitor: ["discriminant", "cases"],
+ aliases: ["Statement", "BlockParent", "Scopable"],
+ fields: {
+ discriminant: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ cases: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase")))
+ }
+ }
+ });
+ (0, _utils.default)("ThisExpression", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("ThrowStatement", {
+ visitor: ["argument"],
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("TryStatement", {
+ visitor: ["block", "handler", "finalizer"],
+ aliases: ["Statement"],
+ fields: {
+ block: {
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!node.handler && !node.finalizer) {
+ throw new TypeError("TryStatement expects either a handler or finalizer, or both");
+ }
+ }, {
+ oneOfNodeTypes: ["BlockStatement"]
+ }))
+ },
+ handler: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("CatchClause")
+ },
+ finalizer: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }
+ });
+ (0, _utils.default)("UnaryExpression", {
+ builder: ["operator", "argument", "prefix"],
+ fields: {
+ prefix: {
+ default: true
+ },
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS)
+ }
+ },
+ visitor: ["argument"],
+ aliases: ["UnaryLike", "Expression"]
+ });
+ (0, _utils.default)("UpdateExpression", {
+ builder: ["operator", "argument", "prefix"],
+ fields: {
+ prefix: {
+ default: false
+ },
+ argument: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression")
+ },
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS)
+ }
+ },
+ visitor: ["argument"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("VariableDeclaration", {
+ builder: ["kind", "declarations"],
+ visitor: ["declarations"],
+ aliases: ["Statement", "Declaration"],
+ fields: {
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ kind: {
+ validate: (0, _utils.assertOneOf)("var", "let", "const")
+ },
+ declarations: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
+ }
+ },
+
+ validate(parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ if (!(0, _is.default)("ForXStatement", parent, {
+ left: node
+ })) return;
+
+ if (node.declarations.length !== 1) {
+ throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
+ }
+ }
+
+ });
+ (0, _utils.default)("VariableDeclarator", {
+ visitor: ["id", "init"],
+ fields: {
+ id: {
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("LVal");
+ }
+
+ const normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
+ const without = (0, _utils.assertNodeType)("Identifier");
+ return function (node, key, val) {
+ const validator = node.init ? normal : without;
+ validator(node, key, val);
+ };
+ }()
+ },
+ definite: {
+ optional: true,
+ validate: (0, _utils.assertValueType)("boolean")
+ },
+ init: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("WhileStatement", {
+ visitor: ["test", "body"],
+ aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("WithStatement", {
+ visitor: ["object", "body"],
+ aliases: ["Statement"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("AssignmentPattern", {
+ visitor: ["left", "right", "decorators"],
+ builder: ["left", "right"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, patternLikeCommon, {
+ left: {
+ validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("ArrayPattern", {
+ visitor: ["elements", "typeAnnotation"],
+ builder: ["elements"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, patternLikeCommon, {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike")))
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("ArrowFunctionExpression", {
+ builder: ["params", "body", "async"],
+ visitor: ["params", "body", "returnType", "typeParameters"],
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ expression: {
+ validate: (0, _utils.assertValueType)("boolean")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
+ }
+ })
+ });
+ (0, _utils.default)("ClassBody", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
+ }
+ }
+ });
+ (0, _utils.default)("ClassExpression", {
+ builder: ["id", "superClass", "body", "decorators"],
+ visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
+ aliases: ["Scopable", "Class", "Expression"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("ClassBody")
+ },
+ superClass: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ superTypeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ },
+ implements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ClassDeclaration", {
+ inherits: "ClassExpression",
+ aliases: ["Scopable", "Class", "Statement", "Declaration"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("ClassBody")
+ },
+ superClass: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ superTypeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ },
+ implements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ },
+ validate: function () {
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+ });
+ (0, _utils.default)("ExportAllDeclaration", {
+ visitor: ["source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")),
+ assertions: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
+ }
+ }
+ });
+ (0, _utils.default)("ExportDefaultDeclaration", {
+ visitor: ["declaration"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ declaration: {
+ validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("value"))
+ }
+ });
+ (0, _utils.default)("ExportNamedDeclaration", {
+ visitor: ["declaration", "specifiers", "source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ declaration: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.specifiers.length) {
+ throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
+ }
+ }, {
+ oneOfNodeTypes: ["Declaration"]
+ }), function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.source) {
+ throw new TypeError("Cannot export a declaration from a source");
+ }
+ })
+ },
+ assertions: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
+ },
+ specifiers: {
+ default: [],
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function () {
+ const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
+ const sourceless = (0, _utils.assertNodeType)("ExportSpecifier");
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return sourced;
+ return function (node, key, val) {
+ const validator = node.source ? sourced : sourceless;
+ validator(node, key, val);
+ };
+ }()))
+ },
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral"),
+ optional: true
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
+ }
+ });
+ (0, _utils.default)("ExportSpecifier", {
+ visitor: ["local", "exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
+ }
+ }
+ });
+ (0, _utils.default)("ForOfStatement", {
+ visitor: ["left", "right", "body"],
+ builder: ["left", "right", "body", "await"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("VariableDeclaration", "LVal");
+ }
+
+ const declaration = (0, _utils.assertNodeType)("VariableDeclaration");
+ const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
+ return function (node, key, val) {
+ if ((0, _is.default)("VariableDeclaration", val)) {
+ declaration(node, key, val);
+ } else {
+ lval(node, key, val);
+ }
+ };
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ await: {
+ default: false
+ }
+ }
+ });
+ (0, _utils.default)("ImportDeclaration", {
+ visitor: ["specifiers", "source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration"],
+ fields: {
+ assertions: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
+ },
+ specifiers: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
+ },
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ },
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ImportDefaultSpecifier", {
+ visitor: ["local"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("ImportNamespaceSpecifier", {
+ visitor: ["local"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("ImportSpecifier", {
+ visitor: ["local", "imported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ imported: {
+ validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
+ },
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "typeof"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("MetaProperty", {
+ visitor: ["meta", "property"],
+ aliases: ["Expression"],
+ fields: {
+ meta: {
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ let property;
+
+ switch (val.name) {
+ case "function":
+ property = "sent";
+ break;
+
+ case "new":
+ property = "target";
+ break;
+
+ case "import":
+ property = "meta";
+ break;
+ }
+
+ if (!(0, _is.default)("Identifier", node.property, {
+ name: property
+ })) {
+ throw new TypeError("Unrecognised MetaProperty");
+ }
+ }, {
+ oneOfNodeTypes: ["Identifier"]
+ }))
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ const classMethodOrPropertyCommon = {
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ static: {
+ default: false
+ },
+ override: {
+ default: false
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ key: {
+ validate: (0, _utils.chain)(function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+ return function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+ }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
+ }
+ };
+ core$1.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
+ const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
+ },
+ kind: {
+ validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"),
+ default: "method"
+ },
+ access: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ });
+ core$1.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
+ (0, _utils.default)("ClassMethod", {
+ aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
+ builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+ });
+ (0, _utils.default)("ObjectPattern", {
+ visitor: ["properties", "typeAnnotation", "decorators"],
+ builder: ["properties"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, patternLikeCommon, {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty")))
+ }
+ })
+ });
+ (0, _utils.default)("SpreadElement", {
+ visitor: ["argument"],
+ aliases: ["UnaryLike"],
+ deprecatedAlias: "SpreadProperty",
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("Super", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("TaggedTemplateExpression", {
+ visitor: ["tag", "quasi", "typeParameters"],
+ builder: ["tag", "quasi"],
+ aliases: ["Expression"],
+ fields: {
+ tag: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ quasi: {
+ validate: (0, _utils.assertNodeType)("TemplateLiteral")
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("TemplateElement", {
+ builder: ["value", "tail"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertShape)({
+ raw: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ cooked: {
+ validate: (0, _utils.assertValueType)("string"),
+ optional: true
+ }
+ })
+ },
+ tail: {
+ default: false
+ }
+ }
+ });
+ (0, _utils.default)("TemplateLiteral", {
+ visitor: ["quasis", "expressions"],
+ aliases: ["Expression", "Literal"],
+ fields: {
+ quasis: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement")))
+ },
+ expressions: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function (node, key, val) {
+ if (node.quasis.length !== val.length + 1) {
+ throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
+ }
+ })
+ }
+ }
+ });
+ (0, _utils.default)("YieldExpression", {
+ builder: ["argument", "delegate"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ delegate: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !node.argument) {
+ throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
+ }
+ }, {
+ type: "boolean"
+ })),
+ default: false
+ },
+ argument: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("AwaitExpression", {
+ builder: ["argument"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("Import", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("BigIntLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("ExportNamespaceSpecifier", {
+ visitor: ["exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("OptionalMemberExpression", {
+ builder: ["object", "property", "computed", "optional"],
+ visitor: ["object", "property"],
+ aliases: ["Expression"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ }
+ }
+ });
+ (0, _utils.default)("OptionalCallExpression", {
+ visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
+ builder: ["callee", "arguments", "optional"],
+ aliases: ["Expression"],
+ fields: {
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
+ },
+ optional: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ },
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ClassProperty", {
+ visitor: ["key", "value", "typeAnnotation", "decorators"],
+ builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
+ aliases: ["Property"],
+ fields: Object.assign({}, classMethodOrPropertyCommon, {
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ definite: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ variance: {
+ validate: (0, _utils.assertNodeType)("Variance"),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("ClassPrivateProperty", {
+ visitor: ["key", "value", "decorators", "typeAnnotation"],
+ builder: ["key", "value", "decorators", "static"],
+ aliases: ["Property", "Private"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ definite: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ variance: {
+ validate: (0, _utils.assertNodeType)("Variance"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ClassPrivateMethod", {
+ builder: ["kind", "key", "params", "body", "static"],
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
+ fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+ });
+ (0, _utils.default)("PrivateName", {
+ visitor: ["id"],
+ aliases: ["Private"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ return core$1;
+ }
+
+ var flow$4 = {};
+
+ var hasRequiredFlow$1;
+
+ function requireFlow$1 () {
+ if (hasRequiredFlow$1) return flow$4;
+ hasRequiredFlow$1 = 1;
+
+ var _utils = requireUtils$1();
+
+ const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
+ (0, _utils.default)(name, {
+ builder: ["id", "typeParameters", "extends", "body"],
+ visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)(typeParameterType),
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")),
+ body: (0, _utils.validateType)("ObjectTypeAnnotation")
+ }
+ });
+ };
+
+ (0, _utils.default)("AnyTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ArrayTypeAnnotation", {
+ visitor: ["elementType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ elementType: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("BooleanTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("BooleanLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("NullLiteralTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ClassImplements", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+ });
+ defineInterfaceishType("DeclareClass");
+ (0, _utils.default)("DeclareFunction", {
+ visitor: ["id"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ predicate: (0, _utils.validateOptionalType)("DeclaredPredicate")
+ }
+ });
+ defineInterfaceishType("DeclareInterface");
+ (0, _utils.default)("DeclareModule", {
+ builder: ["id", "body", "kind"],
+ visitor: ["id", "body"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ body: (0, _utils.validateType)("BlockStatement"),
+ kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES"))
+ }
+ });
+ (0, _utils.default)("DeclareModuleExports", {
+ visitor: ["typeAnnotation"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
+ }
+ });
+ (0, _utils.default)("DeclareTypeAlias", {
+ visitor: ["id", "typeParameters", "right"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ right: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("DeclareOpaqueType", {
+ visitor: ["id", "typeParameters", "supertype"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ supertype: (0, _utils.validateOptionalType)("FlowType"),
+ impltype: (0, _utils.validateOptionalType)("FlowType")
+ }
+ });
+ (0, _utils.default)("DeclareVariable", {
+ visitor: ["id"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+ });
+ (0, _utils.default)("DeclareExportDeclaration", {
+ visitor: ["declaration", "specifiers", "source"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ declaration: (0, _utils.validateOptionalType)("Flow"),
+ specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
+ source: (0, _utils.validateOptionalType)("StringLiteral"),
+ default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("DeclareExportAllDeclaration", {
+ visitor: ["source"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ source: (0, _utils.validateType)("StringLiteral"),
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
+ }
+ });
+ (0, _utils.default)("DeclaredPredicate", {
+ visitor: ["value"],
+ aliases: ["Flow", "FlowPredicate"],
+ fields: {
+ value: (0, _utils.validateType)("Flow")
+ }
+ });
+ (0, _utils.default)("ExistsTypeAnnotation", {
+ aliases: ["Flow", "FlowType"]
+ });
+ (0, _utils.default)("FunctionTypeAnnotation", {
+ visitor: ["typeParameters", "params", "rest", "returnType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")),
+ rest: (0, _utils.validateOptionalType)("FunctionTypeParam"),
+ this: (0, _utils.validateOptionalType)("FunctionTypeParam"),
+ returnType: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("FunctionTypeParam", {
+ visitor: ["name", "typeAnnotation"],
+ aliases: ["Flow"],
+ fields: {
+ name: (0, _utils.validateOptionalType)("Identifier"),
+ typeAnnotation: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("GenericTypeAnnotation", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("InferredPredicate", {
+ aliases: ["Flow", "FlowPredicate"]
+ });
+ (0, _utils.default)("InterfaceExtends", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+ });
+ defineInterfaceishType("InterfaceDeclaration");
+ (0, _utils.default)("InterfaceTypeAnnotation", {
+ visitor: ["extends", "body"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ body: (0, _utils.validateType)("ObjectTypeAnnotation")
+ }
+ });
+ (0, _utils.default)("IntersectionTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("MixedTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("EmptyTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("NullableTypeAnnotation", {
+ visitor: ["typeAnnotation"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("NumberLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("number"))
+ }
+ });
+ (0, _utils.default)("NumberTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ObjectTypeAnnotation", {
+ visitor: ["properties", "indexers", "callProperties", "internalSlots"],
+ aliases: ["Flow", "FlowType"],
+ builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
+ fields: {
+ properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
+ indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")),
+ callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")),
+ internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")),
+ exact: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ default: false
+ },
+ inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeInternalSlot", {
+ visitor: ["id", "value", "optional", "static", "method"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ value: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeCallProperty", {
+ visitor: ["value"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ value: (0, _utils.validateType)("FlowType"),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeIndexer", {
+ visitor: ["id", "key", "value", "variance"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ id: (0, _utils.validateOptionalType)("Identifier"),
+ key: (0, _utils.validateType)("FlowType"),
+ value: (0, _utils.validateType)("FlowType"),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+ });
+ (0, _utils.default)("ObjectTypeProperty", {
+ visitor: ["key", "value", "variance"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ key: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ value: (0, _utils.validateType)("FlowType"),
+ kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ variance: (0, _utils.validateOptionalType)("Variance"),
+ method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeSpreadProperty", {
+ visitor: ["argument"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ argument: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("OpaqueType", {
+ visitor: ["id", "typeParameters", "supertype", "impltype"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ supertype: (0, _utils.validateOptionalType)("FlowType"),
+ impltype: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("QualifiedTypeIdentifier", {
+ visitor: ["id", "qualification"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"])
+ }
+ });
+ (0, _utils.default)("StringLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("string"))
+ }
+ });
+ (0, _utils.default)("StringTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("SymbolTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ThisTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("TupleTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("TypeofTypeAnnotation", {
+ visitor: ["argument"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ argument: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("TypeAlias", {
+ visitor: ["id", "typeParameters", "right"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ right: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("TypeAnnotation", {
+ aliases: ["Flow"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("TypeCastExpression", {
+ visitor: ["expression", "typeAnnotation"],
+ aliases: ["Flow", "ExpressionWrapper", "Expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression"),
+ typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
+ }
+ });
+ (0, _utils.default)("TypeParameter", {
+ aliases: ["Flow"],
+ visitor: ["bound", "default", "variance"],
+ fields: {
+ name: (0, _utils.validate)((0, _utils.assertValueType)("string")),
+ bound: (0, _utils.validateOptionalType)("TypeAnnotation"),
+ default: (0, _utils.validateOptionalType)("FlowType"),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+ });
+ (0, _utils.default)("TypeParameterDeclaration", {
+ aliases: ["Flow"],
+ visitor: ["params"],
+ fields: {
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter"))
+ }
+ });
+ (0, _utils.default)("TypeParameterInstantiation", {
+ aliases: ["Flow"],
+ visitor: ["params"],
+ fields: {
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("UnionTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("Variance", {
+ aliases: ["Flow"],
+ builder: ["kind"],
+ fields: {
+ kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus"))
+ }
+ });
+ (0, _utils.default)("VoidTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("EnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
+ }
+ });
+ (0, _utils.default)("EnumBooleanBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumBooleanMember"),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("EnumNumberBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumNumberMember"),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("EnumStringBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("EnumSymbolBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("EnumDefaultedMember"),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("EnumBooleanMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("BooleanLiteral")
+ }
+ });
+ (0, _utils.default)("EnumNumberMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("NumericLiteral")
+ }
+ });
+ (0, _utils.default)("EnumStringMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("StringLiteral")
+ }
+ });
+ (0, _utils.default)("EnumDefaultedMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+ });
+ (0, _utils.default)("IndexedAccessType", {
+ visitor: ["objectType", "indexType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ objectType: (0, _utils.validateType)("FlowType"),
+ indexType: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("OptionalIndexedAccessType", {
+ visitor: ["objectType", "indexType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ objectType: (0, _utils.validateType)("FlowType"),
+ indexType: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ return flow$4;
+ }
+
+ var jsx$4 = {};
+
+ var hasRequiredJsx$1;
+
+ function requireJsx$1 () {
+ if (hasRequiredJsx$1) return jsx$4;
+ hasRequiredJsx$1 = 1;
+
+ var _utils = requireUtils$1();
+
+ (0, _utils.default)("JSXAttribute", {
+ visitor: ["name", "value"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
+ },
+ value: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
+ }
+ }
+ });
+ (0, _utils.default)("JSXClosingElement", {
+ visitor: ["name"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
+ }
+ }
+ });
+ (0, _utils.default)("JSXElement", {
+ builder: ["openingElement", "closingElement", "children", "selfClosing"],
+ visitor: ["openingElement", "children", "closingElement"],
+ aliases: ["JSX", "Immutable", "Expression"],
+ fields: {
+ openingElement: {
+ validate: (0, _utils.assertNodeType)("JSXOpeningElement")
+ },
+ closingElement: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("JSXClosingElement")
+ },
+ children: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
+ },
+ selfClosing: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("JSXEmptyExpression", {
+ aliases: ["JSX"]
+ });
+ (0, _utils.default)("JSXExpressionContainer", {
+ visitor: ["expression"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression")
+ }
+ }
+ });
+ (0, _utils.default)("JSXSpreadChild", {
+ visitor: ["expression"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("JSXIdentifier", {
+ builder: ["name"],
+ aliases: ["JSX"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("JSXMemberExpression", {
+ visitor: ["object", "property"],
+ aliases: ["JSX"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ }
+ }
+ });
+ (0, _utils.default)("JSXNamespacedName", {
+ visitor: ["namespace", "name"],
+ aliases: ["JSX"],
+ fields: {
+ namespace: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ },
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ }
+ }
+ });
+ (0, _utils.default)("JSXOpeningElement", {
+ builder: ["name", "attributes", "selfClosing"],
+ visitor: ["name", "attributes"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
+ },
+ selfClosing: {
+ default: false
+ },
+ attributes: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("JSXSpreadAttribute", {
+ visitor: ["argument"],
+ aliases: ["JSX"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("JSXText", {
+ aliases: ["JSX", "Immutable"],
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("JSXFragment", {
+ builder: ["openingFragment", "closingFragment", "children"],
+ visitor: ["openingFragment", "children", "closingFragment"],
+ aliases: ["JSX", "Immutable", "Expression"],
+ fields: {
+ openingFragment: {
+ validate: (0, _utils.assertNodeType)("JSXOpeningFragment")
+ },
+ closingFragment: {
+ validate: (0, _utils.assertNodeType)("JSXClosingFragment")
+ },
+ children: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
+ }
+ }
+ });
+ (0, _utils.default)("JSXOpeningFragment", {
+ aliases: ["JSX", "Immutable"]
+ });
+ (0, _utils.default)("JSXClosingFragment", {
+ aliases: ["JSX", "Immutable"]
+ });
+ return jsx$4;
+ }
+
+ var misc$1 = {};
+
+ var placeholders$3 = {};
+
+ var hasRequiredPlaceholders$1;
+
+ function requirePlaceholders$1 () {
+ if (hasRequiredPlaceholders$1) return placeholders$3;
+ hasRequiredPlaceholders$1 = 1;
+
+ Object.defineProperty(placeholders$3, "__esModule", {
+ value: true
+ });
+ placeholders$3.PLACEHOLDERS_FLIPPED_ALIAS = placeholders$3.PLACEHOLDERS_ALIAS = placeholders$3.PLACEHOLDERS = void 0;
+
+ var _utils = requireUtils$1();
+
+ const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
+ placeholders$3.PLACEHOLDERS = PLACEHOLDERS;
+ const PLACEHOLDERS_ALIAS = {
+ Declaration: ["Statement"],
+ Pattern: ["PatternLike", "LVal"]
+ };
+ placeholders$3.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
+
+ for (const type of PLACEHOLDERS) {
+ const alias = _utils.ALIAS_KEYS[type];
+ if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
+ }
+
+ const PLACEHOLDERS_FLIPPED_ALIAS = {};
+ placeholders$3.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
+ Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
+ PLACEHOLDERS_ALIAS[type].forEach(alias => {
+ if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
+ PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
+ }
+
+ PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
+ });
+ });
+ return placeholders$3;
+ }
+
+ var hasRequiredMisc$1;
+
+ function requireMisc$1 () {
+ if (hasRequiredMisc$1) return misc$1;
+ hasRequiredMisc$1 = 1;
+
+ var _utils = requireUtils$1();
+
+ var _placeholders = requirePlaceholders$1();
+
+ {
+ (0, _utils.default)("Noop", {
+ visitor: []
+ });
+ }
+ (0, _utils.default)("Placeholder", {
+ visitor: [],
+ builder: ["expectedNode", "name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ expectedNode: {
+ validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
+ }
+ }
+ });
+ (0, _utils.default)("V8IntrinsicIdentifier", {
+ builder: ["name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ return misc$1;
+ }
+
+ var experimental$1 = {};
+
+ var hasRequiredExperimental$1;
+
+ function requireExperimental$1 () {
+ if (hasRequiredExperimental$1) return experimental$1;
+ hasRequiredExperimental$1 = 1;
+
+ var _utils = requireUtils$1();
+
+ (0, _utils.default)("ArgumentPlaceholder", {});
+ (0, _utils.default)("BindExpression", {
+ visitor: ["object", "callee"],
+ aliases: ["Expression"],
+ fields: !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ object: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ },
+ callee: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ }
+ } : {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("ImportAttribute", {
+ visitor: ["key", "value"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ }
+ }
+ });
+ (0, _utils.default)("Decorator", {
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("DoExpression", {
+ visitor: ["body"],
+ builder: ["body", "async"],
+ aliases: ["Expression"],
+ fields: {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ },
+ async: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ default: false
+ }
+ }
+ });
+ (0, _utils.default)("ExportDefaultSpecifier", {
+ visitor: ["exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("RecordExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement")))
+ }
+ }
+ });
+ (0, _utils.default)("TupleExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))),
+ default: []
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("DecimalLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("StaticBlock", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent"]
+ });
+ (0, _utils.default)("ModuleExpression", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.assertNodeType)("Program")
+ }
+ },
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("TopicReference", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("PipelineTopicExpression", {
+ builder: ["expression"],
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("PipelineBareFunction", {
+ builder: ["callee"],
+ visitor: ["callee"],
+ fields: {
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("PipelinePrimaryTopicReference", {
+ aliases: ["Expression"]
+ });
+ return experimental$1;
+ }
+
+ var typescript$4 = {};
+
+ var hasRequiredTypescript$1;
+
+ function requireTypescript$1 () {
+ if (hasRequiredTypescript$1) return typescript$4;
+ hasRequiredTypescript$1 = 1;
+
+ var _utils = requireUtils$1();
+
+ var _core = requireCore$1();
+
+ var _is = requireIs$1();
+
+ const bool = (0, _utils.assertValueType)("boolean");
+ const tSFunctionTypeAnnotationCommon = {
+ returnType: {
+ validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ }
+ };
+ (0, _utils.default)("TSParameterProperty", {
+ aliases: ["LVal"],
+ visitor: ["parameter"],
+ fields: {
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ parameter: {
+ validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
+ },
+ override: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("TSDeclareFunction", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "params", "returnType"],
+ fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
+ });
+ (0, _utils.default)("TSDeclareMethod", {
+ visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
+ fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
+ });
+ (0, _utils.default)("TSQualifiedName", {
+ aliases: ["TSEntityName"],
+ visitor: ["left", "right"],
+ fields: {
+ left: (0, _utils.validateType)("TSEntityName"),
+ right: (0, _utils.validateType)("Identifier")
+ }
+ });
+ const signatureDeclarationCommon = {
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
+ };
+ const callConstructSignatureDeclaration = {
+ aliases: ["TSTypeElement"],
+ visitor: ["typeParameters", "parameters", "typeAnnotation"],
+ fields: signatureDeclarationCommon
+ };
+ (0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
+ (0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
+ const namedTypeElementCommon = {
+ key: (0, _utils.validateType)("Expression"),
+ computed: (0, _utils.validate)(bool),
+ optional: (0, _utils.validateOptional)(bool)
+ };
+ (0, _utils.default)("TSPropertySignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["key", "typeAnnotation", "initializer"],
+ fields: Object.assign({}, namedTypeElementCommon, {
+ readonly: (0, _utils.validateOptional)(bool),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ initializer: (0, _utils.validateOptionalType)("Expression"),
+ kind: {
+ validate: (0, _utils.assertOneOf)("get", "set")
+ }
+ })
+ });
+ (0, _utils.default)("TSMethodSignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
+ fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, {
+ kind: {
+ validate: (0, _utils.assertOneOf)("method", "get", "set")
+ }
+ })
+ });
+ (0, _utils.default)("TSIndexSignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["parameters", "typeAnnotation"],
+ fields: {
+ readonly: (0, _utils.validateOptional)(bool),
+ static: (0, _utils.validateOptional)(bool),
+ parameters: (0, _utils.validateArrayOfType)("Identifier"),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
+ }
+ });
+ const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
+
+ for (const type of tsKeywordTypes) {
+ (0, _utils.default)(type, {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+ });
+ }
+
+ (0, _utils.default)("TSThisType", {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+ });
+ const fnOrCtrBase = {
+ aliases: ["TSType"],
+ visitor: ["typeParameters", "parameters", "typeAnnotation"]
+ };
+ (0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, {
+ fields: signatureDeclarationCommon
+ }));
+ (0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, {
+ fields: Object.assign({}, signatureDeclarationCommon, {
+ abstract: (0, _utils.validateOptional)(bool)
+ })
+ }));
+ (0, _utils.default)("TSTypeReference", {
+ aliases: ["TSType"],
+ visitor: ["typeName", "typeParameters"],
+ fields: {
+ typeName: (0, _utils.validateType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("TSTypePredicate", {
+ aliases: ["TSType"],
+ visitor: ["parameterName", "typeAnnotation"],
+ builder: ["parameterName", "typeAnnotation", "asserts"],
+ fields: {
+ parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ asserts: (0, _utils.validateOptional)(bool)
+ }
+ });
+ (0, _utils.default)("TSTypeQuery", {
+ aliases: ["TSType"],
+ visitor: ["exprName"],
+ fields: {
+ exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
+ }
+ });
+ (0, _utils.default)("TSTypeLiteral", {
+ aliases: ["TSType"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("TSTypeElement")
+ }
+ });
+ (0, _utils.default)("TSArrayType", {
+ aliases: ["TSType"],
+ visitor: ["elementType"],
+ fields: {
+ elementType: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSTupleType", {
+ aliases: ["TSType"],
+ visitor: ["elementTypes"],
+ fields: {
+ elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"])
+ }
+ });
+ (0, _utils.default)("TSOptionalType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSRestType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSNamedTupleMember", {
+ visitor: ["label", "elementType"],
+ builder: ["label", "elementType", "optional"],
+ fields: {
+ label: (0, _utils.validateType)("Identifier"),
+ optional: {
+ validate: bool,
+ default: false
+ },
+ elementType: (0, _utils.validateType)("TSType")
+ }
+ });
+ const unionOrIntersection = {
+ aliases: ["TSType"],
+ visitor: ["types"],
+ fields: {
+ types: (0, _utils.validateArrayOfType)("TSType")
+ }
+ };
+ (0, _utils.default)("TSUnionType", unionOrIntersection);
+ (0, _utils.default)("TSIntersectionType", unionOrIntersection);
+ (0, _utils.default)("TSConditionalType", {
+ aliases: ["TSType"],
+ visitor: ["checkType", "extendsType", "trueType", "falseType"],
+ fields: {
+ checkType: (0, _utils.validateType)("TSType"),
+ extendsType: (0, _utils.validateType)("TSType"),
+ trueType: (0, _utils.validateType)("TSType"),
+ falseType: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSInferType", {
+ aliases: ["TSType"],
+ visitor: ["typeParameter"],
+ fields: {
+ typeParameter: (0, _utils.validateType)("TSTypeParameter")
+ }
+ });
+ (0, _utils.default)("TSParenthesizedType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSTypeOperator", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSIndexedAccessType", {
+ aliases: ["TSType"],
+ visitor: ["objectType", "indexType"],
+ fields: {
+ objectType: (0, _utils.validateType)("TSType"),
+ indexType: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSMappedType", {
+ aliases: ["TSType"],
+ visitor: ["typeParameter", "typeAnnotation", "nameType"],
+ fields: {
+ readonly: (0, _utils.validateOptional)(bool),
+ typeParameter: (0, _utils.validateType)("TSTypeParameter"),
+ optional: (0, _utils.validateOptional)(bool),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
+ nameType: (0, _utils.validateOptionalType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSLiteralType", {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: ["literal"],
+ fields: {
+ literal: {
+ validate: function () {
+ const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
+ const unaryOperator = (0, _utils.assertOneOf)("-");
+ const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral");
+
+ function validator(parent, key, node) {
+ if ((0, _is.default)("UnaryExpression", node)) {
+ unaryOperator(node, "operator", node.operator);
+ unaryExpression(node, "argument", node.argument);
+ } else {
+ literal(parent, key, node);
+ }
+ }
+
+ validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "UnaryExpression"];
+ return validator;
+ }()
+ }
+ }
+ });
+ (0, _utils.default)("TSExpressionWithTypeArguments", {
+ aliases: ["TSType"],
+ visitor: ["expression", "typeParameters"],
+ fields: {
+ expression: (0, _utils.validateType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("TSInterfaceDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "extends", "body"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
+ body: (0, _utils.validateType)("TSInterfaceBody")
+ }
+ });
+ (0, _utils.default)("TSInterfaceBody", {
+ visitor: ["body"],
+ fields: {
+ body: (0, _utils.validateArrayOfType)("TSTypeElement")
+ }
+ });
+ (0, _utils.default)("TSTypeAliasDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "typeAnnotation"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSAsExpression", {
+ aliases: ["Expression"],
+ visitor: ["expression", "typeAnnotation"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression"),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSTypeAssertion", {
+ aliases: ["Expression"],
+ visitor: ["typeAnnotation", "expression"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType"),
+ expression: (0, _utils.validateType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSEnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "members"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ const: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ members: (0, _utils.validateArrayOfType)("TSEnumMember"),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSEnumMember", {
+ visitor: ["id", "initializer"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSModuleDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ global: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
+ }
+ });
+ (0, _utils.default)("TSModuleBlock", {
+ aliases: ["Scopable", "Block", "BlockParent"],
+ visitor: ["body"],
+ fields: {
+ body: (0, _utils.validateArrayOfType)("Statement")
+ }
+ });
+ (0, _utils.default)("TSImportType", {
+ aliases: ["TSType"],
+ visitor: ["argument", "qualifier", "typeParameters"],
+ fields: {
+ argument: (0, _utils.validateType)("StringLiteral"),
+ qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("TSImportEqualsDeclaration", {
+ aliases: ["Statement"],
+ visitor: ["id", "moduleReference"],
+ fields: {
+ isExport: (0, _utils.validate)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]),
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "value"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("TSExternalModuleReference", {
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("StringLiteral")
+ }
+ });
+ (0, _utils.default)("TSNonNullExpression", {
+ aliases: ["Expression"],
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSExportAssignment", {
+ aliases: ["Statement"],
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSNamespaceExportDeclaration", {
+ aliases: ["Statement"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+ });
+ (0, _utils.default)("TSTypeAnnotation", {
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TSType")
+ }
+ }
+ });
+ (0, _utils.default)("TSTypeParameterInstantiation", {
+ visitor: ["params"],
+ fields: {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
+ }
+ }
+ });
+ (0, _utils.default)("TSTypeParameterDeclaration", {
+ visitor: ["params"],
+ fields: {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
+ }
+ }
+ });
+ (0, _utils.default)("TSTypeParameter", {
+ builder: ["constraint", "default", "name"],
+ visitor: ["constraint", "default"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ constraint: {
+ validate: (0, _utils.assertNodeType)("TSType"),
+ optional: true
+ },
+ default: {
+ validate: (0, _utils.assertNodeType)("TSType"),
+ optional: true
+ }
+ }
+ });
+ return typescript$4;
+ }
+
+ var hasRequiredDefinitions$1;
+
+ function requireDefinitions$1 () {
+ if (hasRequiredDefinitions$1) return definitions$1;
+ hasRequiredDefinitions$1 = 1;
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.defineProperty(exports, "VISITOR_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.VISITOR_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "ALIAS_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.ALIAS_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.FLIPPED_ALIAS_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "NODE_FIELDS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_FIELDS;
+ }
+ });
+ Object.defineProperty(exports, "BUILDER_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.BUILDER_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "DEPRECATED_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.DEPRECATED_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_PARENT_VALIDATIONS;
+ }
+ });
+ Object.defineProperty(exports, "PLACEHOLDERS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS;
+ }
+ });
+ Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS_ALIAS;
+ }
+ });
+ Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
+ }
+ });
+ exports.TYPES = void 0;
+
+ var _toFastProperties = toFastProperties;
+
+ requireCore$1();
+
+ requireFlow$1();
+
+ requireJsx$1();
+
+ requireMisc$1();
+
+ requireExperimental$1();
+
+ requireTypescript$1();
+
+ var _utils = requireUtils$1();
+
+ var _placeholders = requirePlaceholders$1();
+
+ _toFastProperties(_utils.VISITOR_KEYS);
+
+ _toFastProperties(_utils.ALIAS_KEYS);
+
+ _toFastProperties(_utils.FLIPPED_ALIAS_KEYS);
+
+ _toFastProperties(_utils.NODE_FIELDS);
+
+ _toFastProperties(_utils.BUILDER_KEYS);
+
+ _toFastProperties(_utils.DEPRECATED_KEYS);
+
+ _toFastProperties(_placeholders.PLACEHOLDERS_ALIAS);
+
+ _toFastProperties(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS);
+
+ const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
+ exports.TYPES = TYPES;
+ } (definitions$1));
+ return definitions$1;
+ }
+
+ Object.defineProperty(builder$3, "__esModule", {
+ value: true
+ });
+ builder$3.default = builder$2;
+
+ var _definitions$d = requireDefinitions$1();
+
+ var _validate$1 = requireValidate$1();
+
+ function builder$2(type, ...args) {
+ const keys = _definitions$d.BUILDER_KEYS[type];
+ const countArgs = args.length;
+
+ if (countArgs > keys.length) {
+ throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
+ }
+
+ const node = {
+ type
+ };
+ let i = 0;
+ keys.forEach(key => {
+ const field = _definitions$d.NODE_FIELDS[type][key];
+ let arg;
+ if (i < countArgs) arg = args[i];
+
+ if (arg === undefined) {
+ arg = Array.isArray(field.default) ? [] : field.default;
+ }
+
+ node[key] = arg;
+ i++;
+ });
+
+ for (const key of Object.keys(node)) {
+ (0, _validate$1.default)(node, key, node[key]);
+ }
+
+ return node;
+ }
+
+ Object.defineProperty(generated$7, "__esModule", {
+ value: true
+ });
+ generated$7.arrayExpression = arrayExpression;
+ generated$7.assignmentExpression = assignmentExpression;
+ generated$7.binaryExpression = binaryExpression;
+ generated$7.interpreterDirective = interpreterDirective;
+ generated$7.directive = directive;
+ generated$7.directiveLiteral = directiveLiteral;
+ generated$7.blockStatement = blockStatement;
+ generated$7.breakStatement = breakStatement;
+ generated$7.callExpression = callExpression;
+ generated$7.catchClause = catchClause;
+ generated$7.conditionalExpression = conditionalExpression;
+ generated$7.continueStatement = continueStatement;
+ generated$7.debuggerStatement = debuggerStatement;
+ generated$7.doWhileStatement = doWhileStatement;
+ generated$7.emptyStatement = emptyStatement;
+ generated$7.expressionStatement = expressionStatement;
+ generated$7.file = file;
+ generated$7.forInStatement = forInStatement;
+ generated$7.forStatement = forStatement;
+ generated$7.functionDeclaration = functionDeclaration;
+ generated$7.functionExpression = functionExpression;
+ generated$7.identifier = identifier$1;
+ generated$7.ifStatement = ifStatement;
+ generated$7.labeledStatement = labeledStatement;
+ generated$7.stringLiteral = stringLiteral;
+ generated$7.numericLiteral = numericLiteral;
+ generated$7.nullLiteral = nullLiteral;
+ generated$7.booleanLiteral = booleanLiteral;
+ generated$7.regExpLiteral = regExpLiteral;
+ generated$7.logicalExpression = logicalExpression;
+ generated$7.memberExpression = memberExpression;
+ generated$7.newExpression = newExpression;
+ generated$7.program = program;
+ generated$7.objectExpression = objectExpression;
+ generated$7.objectMethod = objectMethod;
+ generated$7.objectProperty = objectProperty;
+ generated$7.restElement = restElement;
+ generated$7.returnStatement = returnStatement;
+ generated$7.sequenceExpression = sequenceExpression;
+ generated$7.parenthesizedExpression = parenthesizedExpression;
+ generated$7.switchCase = switchCase;
+ generated$7.switchStatement = switchStatement;
+ generated$7.thisExpression = thisExpression;
+ generated$7.throwStatement = throwStatement;
+ generated$7.tryStatement = tryStatement;
+ generated$7.unaryExpression = unaryExpression;
+ generated$7.updateExpression = updateExpression;
+ generated$7.variableDeclaration = variableDeclaration;
+ generated$7.variableDeclarator = variableDeclarator;
+ generated$7.whileStatement = whileStatement;
+ generated$7.withStatement = withStatement;
+ generated$7.assignmentPattern = assignmentPattern;
+ generated$7.arrayPattern = arrayPattern;
+ generated$7.arrowFunctionExpression = arrowFunctionExpression;
+ generated$7.classBody = classBody;
+ generated$7.classExpression = classExpression;
+ generated$7.classDeclaration = classDeclaration;
+ generated$7.exportAllDeclaration = exportAllDeclaration;
+ generated$7.exportDefaultDeclaration = exportDefaultDeclaration;
+ generated$7.exportNamedDeclaration = exportNamedDeclaration;
+ generated$7.exportSpecifier = exportSpecifier;
+ generated$7.forOfStatement = forOfStatement;
+ generated$7.importDeclaration = importDeclaration;
+ generated$7.importDefaultSpecifier = importDefaultSpecifier;
+ generated$7.importNamespaceSpecifier = importNamespaceSpecifier;
+ generated$7.importSpecifier = importSpecifier;
+ generated$7.metaProperty = metaProperty;
+ generated$7.classMethod = classMethod;
+ generated$7.objectPattern = objectPattern;
+ generated$7.spreadElement = spreadElement;
+ generated$7.super = _super;
+ generated$7.taggedTemplateExpression = taggedTemplateExpression;
+ generated$7.templateElement = templateElement;
+ generated$7.templateLiteral = templateLiteral;
+ generated$7.yieldExpression = yieldExpression;
+ generated$7.awaitExpression = awaitExpression;
+ generated$7.import = _import;
+ generated$7.bigIntLiteral = bigIntLiteral;
+ generated$7.exportNamespaceSpecifier = exportNamespaceSpecifier;
+ generated$7.optionalMemberExpression = optionalMemberExpression;
+ generated$7.optionalCallExpression = optionalCallExpression;
+ generated$7.classProperty = classProperty;
+ generated$7.classPrivateProperty = classPrivateProperty;
+ generated$7.classPrivateMethod = classPrivateMethod;
+ generated$7.privateName = privateName;
+ generated$7.anyTypeAnnotation = anyTypeAnnotation;
+ generated$7.arrayTypeAnnotation = arrayTypeAnnotation;
+ generated$7.booleanTypeAnnotation = booleanTypeAnnotation;
+ generated$7.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
+ generated$7.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
+ generated$7.classImplements = classImplements;
+ generated$7.declareClass = declareClass;
+ generated$7.declareFunction = declareFunction;
+ generated$7.declareInterface = declareInterface;
+ generated$7.declareModule = declareModule;
+ generated$7.declareModuleExports = declareModuleExports;
+ generated$7.declareTypeAlias = declareTypeAlias;
+ generated$7.declareOpaqueType = declareOpaqueType;
+ generated$7.declareVariable = declareVariable;
+ generated$7.declareExportDeclaration = declareExportDeclaration;
+ generated$7.declareExportAllDeclaration = declareExportAllDeclaration;
+ generated$7.declaredPredicate = declaredPredicate;
+ generated$7.existsTypeAnnotation = existsTypeAnnotation;
+ generated$7.functionTypeAnnotation = functionTypeAnnotation;
+ generated$7.functionTypeParam = functionTypeParam;
+ generated$7.genericTypeAnnotation = genericTypeAnnotation;
+ generated$7.inferredPredicate = inferredPredicate;
+ generated$7.interfaceExtends = interfaceExtends;
+ generated$7.interfaceDeclaration = interfaceDeclaration;
+ generated$7.interfaceTypeAnnotation = interfaceTypeAnnotation;
+ generated$7.intersectionTypeAnnotation = intersectionTypeAnnotation;
+ generated$7.mixedTypeAnnotation = mixedTypeAnnotation;
+ generated$7.emptyTypeAnnotation = emptyTypeAnnotation;
+ generated$7.nullableTypeAnnotation = nullableTypeAnnotation;
+ generated$7.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
+ generated$7.numberTypeAnnotation = numberTypeAnnotation;
+ generated$7.objectTypeAnnotation = objectTypeAnnotation;
+ generated$7.objectTypeInternalSlot = objectTypeInternalSlot;
+ generated$7.objectTypeCallProperty = objectTypeCallProperty;
+ generated$7.objectTypeIndexer = objectTypeIndexer;
+ generated$7.objectTypeProperty = objectTypeProperty;
+ generated$7.objectTypeSpreadProperty = objectTypeSpreadProperty;
+ generated$7.opaqueType = opaqueType;
+ generated$7.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
+ generated$7.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
+ generated$7.stringTypeAnnotation = stringTypeAnnotation;
+ generated$7.symbolTypeAnnotation = symbolTypeAnnotation;
+ generated$7.thisTypeAnnotation = thisTypeAnnotation;
+ generated$7.tupleTypeAnnotation = tupleTypeAnnotation;
+ generated$7.typeofTypeAnnotation = typeofTypeAnnotation;
+ generated$7.typeAlias = typeAlias;
+ generated$7.typeAnnotation = typeAnnotation;
+ generated$7.typeCastExpression = typeCastExpression;
+ generated$7.typeParameter = typeParameter;
+ generated$7.typeParameterDeclaration = typeParameterDeclaration;
+ generated$7.typeParameterInstantiation = typeParameterInstantiation;
+ generated$7.unionTypeAnnotation = unionTypeAnnotation;
+ generated$7.variance = variance;
+ generated$7.voidTypeAnnotation = voidTypeAnnotation;
+ generated$7.enumDeclaration = enumDeclaration;
+ generated$7.enumBooleanBody = enumBooleanBody;
+ generated$7.enumNumberBody = enumNumberBody;
+ generated$7.enumStringBody = enumStringBody;
+ generated$7.enumSymbolBody = enumSymbolBody;
+ generated$7.enumBooleanMember = enumBooleanMember;
+ generated$7.enumNumberMember = enumNumberMember;
+ generated$7.enumStringMember = enumStringMember;
+ generated$7.enumDefaultedMember = enumDefaultedMember;
+ generated$7.indexedAccessType = indexedAccessType;
+ generated$7.optionalIndexedAccessType = optionalIndexedAccessType;
+ generated$7.jSXAttribute = generated$7.jsxAttribute = jsxAttribute;
+ generated$7.jSXClosingElement = generated$7.jsxClosingElement = jsxClosingElement;
+ generated$7.jSXElement = generated$7.jsxElement = jsxElement;
+ generated$7.jSXEmptyExpression = generated$7.jsxEmptyExpression = jsxEmptyExpression;
+ generated$7.jSXExpressionContainer = generated$7.jsxExpressionContainer = jsxExpressionContainer;
+ generated$7.jSXSpreadChild = generated$7.jsxSpreadChild = jsxSpreadChild;
+ generated$7.jSXIdentifier = generated$7.jsxIdentifier = jsxIdentifier;
+ generated$7.jSXMemberExpression = generated$7.jsxMemberExpression = jsxMemberExpression;
+ generated$7.jSXNamespacedName = generated$7.jsxNamespacedName = jsxNamespacedName;
+ generated$7.jSXOpeningElement = generated$7.jsxOpeningElement = jsxOpeningElement;
+ generated$7.jSXSpreadAttribute = generated$7.jsxSpreadAttribute = jsxSpreadAttribute;
+ generated$7.jSXText = generated$7.jsxText = jsxText;
+ generated$7.jSXFragment = generated$7.jsxFragment = jsxFragment;
+ generated$7.jSXOpeningFragment = generated$7.jsxOpeningFragment = jsxOpeningFragment;
+ generated$7.jSXClosingFragment = generated$7.jsxClosingFragment = jsxClosingFragment;
+ generated$7.noop = noop$2;
+ generated$7.placeholder = placeholder;
+ generated$7.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
+ generated$7.argumentPlaceholder = argumentPlaceholder;
+ generated$7.bindExpression = bindExpression;
+ generated$7.importAttribute = importAttribute;
+ generated$7.decorator = decorator;
+ generated$7.doExpression = doExpression;
+ generated$7.exportDefaultSpecifier = exportDefaultSpecifier;
+ generated$7.recordExpression = recordExpression;
+ generated$7.tupleExpression = tupleExpression;
+ generated$7.decimalLiteral = decimalLiteral;
+ generated$7.staticBlock = staticBlock;
+ generated$7.moduleExpression = moduleExpression;
+ generated$7.topicReference = topicReference;
+ generated$7.pipelineTopicExpression = pipelineTopicExpression;
+ generated$7.pipelineBareFunction = pipelineBareFunction;
+ generated$7.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
+ generated$7.tSParameterProperty = generated$7.tsParameterProperty = tsParameterProperty;
+ generated$7.tSDeclareFunction = generated$7.tsDeclareFunction = tsDeclareFunction;
+ generated$7.tSDeclareMethod = generated$7.tsDeclareMethod = tsDeclareMethod;
+ generated$7.tSQualifiedName = generated$7.tsQualifiedName = tsQualifiedName;
+ generated$7.tSCallSignatureDeclaration = generated$7.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
+ generated$7.tSConstructSignatureDeclaration = generated$7.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
+ generated$7.tSPropertySignature = generated$7.tsPropertySignature = tsPropertySignature;
+ generated$7.tSMethodSignature = generated$7.tsMethodSignature = tsMethodSignature;
+ generated$7.tSIndexSignature = generated$7.tsIndexSignature = tsIndexSignature;
+ generated$7.tSAnyKeyword = generated$7.tsAnyKeyword = tsAnyKeyword;
+ generated$7.tSBooleanKeyword = generated$7.tsBooleanKeyword = tsBooleanKeyword;
+ generated$7.tSBigIntKeyword = generated$7.tsBigIntKeyword = tsBigIntKeyword;
+ generated$7.tSIntrinsicKeyword = generated$7.tsIntrinsicKeyword = tsIntrinsicKeyword;
+ generated$7.tSNeverKeyword = generated$7.tsNeverKeyword = tsNeverKeyword;
+ generated$7.tSNullKeyword = generated$7.tsNullKeyword = tsNullKeyword;
+ generated$7.tSNumberKeyword = generated$7.tsNumberKeyword = tsNumberKeyword;
+ generated$7.tSObjectKeyword = generated$7.tsObjectKeyword = tsObjectKeyword;
+ generated$7.tSStringKeyword = generated$7.tsStringKeyword = tsStringKeyword;
+ generated$7.tSSymbolKeyword = generated$7.tsSymbolKeyword = tsSymbolKeyword;
+ generated$7.tSUndefinedKeyword = generated$7.tsUndefinedKeyword = tsUndefinedKeyword;
+ generated$7.tSUnknownKeyword = generated$7.tsUnknownKeyword = tsUnknownKeyword;
+ generated$7.tSVoidKeyword = generated$7.tsVoidKeyword = tsVoidKeyword;
+ generated$7.tSThisType = generated$7.tsThisType = tsThisType;
+ generated$7.tSFunctionType = generated$7.tsFunctionType = tsFunctionType;
+ generated$7.tSConstructorType = generated$7.tsConstructorType = tsConstructorType;
+ generated$7.tSTypeReference = generated$7.tsTypeReference = tsTypeReference;
+ generated$7.tSTypePredicate = generated$7.tsTypePredicate = tsTypePredicate;
+ generated$7.tSTypeQuery = generated$7.tsTypeQuery = tsTypeQuery;
+ generated$7.tSTypeLiteral = generated$7.tsTypeLiteral = tsTypeLiteral;
+ generated$7.tSArrayType = generated$7.tsArrayType = tsArrayType;
+ generated$7.tSTupleType = generated$7.tsTupleType = tsTupleType;
+ generated$7.tSOptionalType = generated$7.tsOptionalType = tsOptionalType;
+ generated$7.tSRestType = generated$7.tsRestType = tsRestType;
+ generated$7.tSNamedTupleMember = generated$7.tsNamedTupleMember = tsNamedTupleMember;
+ generated$7.tSUnionType = generated$7.tsUnionType = tsUnionType;
+ generated$7.tSIntersectionType = generated$7.tsIntersectionType = tsIntersectionType;
+ generated$7.tSConditionalType = generated$7.tsConditionalType = tsConditionalType;
+ generated$7.tSInferType = generated$7.tsInferType = tsInferType;
+ generated$7.tSParenthesizedType = generated$7.tsParenthesizedType = tsParenthesizedType;
+ generated$7.tSTypeOperator = generated$7.tsTypeOperator = tsTypeOperator;
+ generated$7.tSIndexedAccessType = generated$7.tsIndexedAccessType = tsIndexedAccessType;
+ generated$7.tSMappedType = generated$7.tsMappedType = tsMappedType;
+ generated$7.tSLiteralType = generated$7.tsLiteralType = tsLiteralType;
+ generated$7.tSExpressionWithTypeArguments = generated$7.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
+ generated$7.tSInterfaceDeclaration = generated$7.tsInterfaceDeclaration = tsInterfaceDeclaration;
+ generated$7.tSInterfaceBody = generated$7.tsInterfaceBody = tsInterfaceBody;
+ generated$7.tSTypeAliasDeclaration = generated$7.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
+ generated$7.tSAsExpression = generated$7.tsAsExpression = tsAsExpression;
+ generated$7.tSTypeAssertion = generated$7.tsTypeAssertion = tsTypeAssertion;
+ generated$7.tSEnumDeclaration = generated$7.tsEnumDeclaration = tsEnumDeclaration;
+ generated$7.tSEnumMember = generated$7.tsEnumMember = tsEnumMember;
+ generated$7.tSModuleDeclaration = generated$7.tsModuleDeclaration = tsModuleDeclaration;
+ generated$7.tSModuleBlock = generated$7.tsModuleBlock = tsModuleBlock;
+ generated$7.tSImportType = generated$7.tsImportType = tsImportType;
+ generated$7.tSImportEqualsDeclaration = generated$7.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
+ generated$7.tSExternalModuleReference = generated$7.tsExternalModuleReference = tsExternalModuleReference;
+ generated$7.tSNonNullExpression = generated$7.tsNonNullExpression = tsNonNullExpression;
+ generated$7.tSExportAssignment = generated$7.tsExportAssignment = tsExportAssignment;
+ generated$7.tSNamespaceExportDeclaration = generated$7.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
+ generated$7.tSTypeAnnotation = generated$7.tsTypeAnnotation = tsTypeAnnotation;
+ generated$7.tSTypeParameterInstantiation = generated$7.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
+ generated$7.tSTypeParameterDeclaration = generated$7.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
+ generated$7.tSTypeParameter = generated$7.tsTypeParameter = tsTypeParameter;
+ generated$7.numberLiteral = NumberLiteral$1;
+ generated$7.regexLiteral = RegexLiteral$1;
+ generated$7.restProperty = RestProperty$1;
+ generated$7.spreadProperty = SpreadProperty$1;
+
+ var _builder$1 = builder$3;
+
+ function arrayExpression(elements) {
+ return (0, _builder$1.default)("ArrayExpression", ...arguments);
+ }
+
+ function assignmentExpression(operator, left, right) {
+ return (0, _builder$1.default)("AssignmentExpression", ...arguments);
+ }
+
+ function binaryExpression(operator, left, right) {
+ return (0, _builder$1.default)("BinaryExpression", ...arguments);
+ }
+
+ function interpreterDirective(value) {
+ return (0, _builder$1.default)("InterpreterDirective", ...arguments);
+ }
+
+ function directive(value) {
+ return (0, _builder$1.default)("Directive", ...arguments);
+ }
+
+ function directiveLiteral(value) {
+ return (0, _builder$1.default)("DirectiveLiteral", ...arguments);
+ }
+
+ function blockStatement(body, directives) {
+ return (0, _builder$1.default)("BlockStatement", ...arguments);
+ }
+
+ function breakStatement(label) {
+ return (0, _builder$1.default)("BreakStatement", ...arguments);
+ }
+
+ function callExpression(callee, _arguments) {
+ return (0, _builder$1.default)("CallExpression", ...arguments);
+ }
+
+ function catchClause(param, body) {
+ return (0, _builder$1.default)("CatchClause", ...arguments);
+ }
+
+ function conditionalExpression(test, consequent, alternate) {
+ return (0, _builder$1.default)("ConditionalExpression", ...arguments);
+ }
+
+ function continueStatement(label) {
+ return (0, _builder$1.default)("ContinueStatement", ...arguments);
+ }
+
+ function debuggerStatement() {
+ return (0, _builder$1.default)("DebuggerStatement", ...arguments);
+ }
+
+ function doWhileStatement(test, body) {
+ return (0, _builder$1.default)("DoWhileStatement", ...arguments);
+ }
+
+ function emptyStatement() {
+ return (0, _builder$1.default)("EmptyStatement", ...arguments);
+ }
+
+ function expressionStatement(expression) {
+ return (0, _builder$1.default)("ExpressionStatement", ...arguments);
+ }
+
+ function file(program, comments, tokens) {
+ return (0, _builder$1.default)("File", ...arguments);
+ }
+
+ function forInStatement(left, right, body) {
+ return (0, _builder$1.default)("ForInStatement", ...arguments);
+ }
+
+ function forStatement(init, test, update, body) {
+ return (0, _builder$1.default)("ForStatement", ...arguments);
+ }
+
+ function functionDeclaration(id, params, body, generator, async) {
+ return (0, _builder$1.default)("FunctionDeclaration", ...arguments);
+ }
+
+ function functionExpression(id, params, body, generator, async) {
+ return (0, _builder$1.default)("FunctionExpression", ...arguments);
+ }
+
+ function identifier$1(name) {
+ return (0, _builder$1.default)("Identifier", ...arguments);
+ }
+
+ function ifStatement(test, consequent, alternate) {
+ return (0, _builder$1.default)("IfStatement", ...arguments);
+ }
+
+ function labeledStatement(label, body) {
+ return (0, _builder$1.default)("LabeledStatement", ...arguments);
+ }
+
+ function stringLiteral(value) {
+ return (0, _builder$1.default)("StringLiteral", ...arguments);
+ }
+
+ function numericLiteral(value) {
+ return (0, _builder$1.default)("NumericLiteral", ...arguments);
+ }
+
+ function nullLiteral() {
+ return (0, _builder$1.default)("NullLiteral", ...arguments);
+ }
+
+ function booleanLiteral(value) {
+ return (0, _builder$1.default)("BooleanLiteral", ...arguments);
+ }
+
+ function regExpLiteral(pattern, flags) {
+ return (0, _builder$1.default)("RegExpLiteral", ...arguments);
+ }
+
+ function logicalExpression(operator, left, right) {
+ return (0, _builder$1.default)("LogicalExpression", ...arguments);
+ }
+
+ function memberExpression(object, property, computed, optional) {
+ return (0, _builder$1.default)("MemberExpression", ...arguments);
+ }
+
+ function newExpression(callee, _arguments) {
+ return (0, _builder$1.default)("NewExpression", ...arguments);
+ }
+
+ function program(body, directives, sourceType, interpreter) {
+ return (0, _builder$1.default)("Program", ...arguments);
+ }
+
+ function objectExpression(properties) {
+ return (0, _builder$1.default)("ObjectExpression", ...arguments);
+ }
+
+ function objectMethod(kind, key, params, body, computed, generator, async) {
+ return (0, _builder$1.default)("ObjectMethod", ...arguments);
+ }
+
+ function objectProperty(key, value, computed, shorthand, decorators) {
+ return (0, _builder$1.default)("ObjectProperty", ...arguments);
+ }
+
+ function restElement(argument) {
+ return (0, _builder$1.default)("RestElement", ...arguments);
+ }
+
+ function returnStatement(argument) {
+ return (0, _builder$1.default)("ReturnStatement", ...arguments);
+ }
+
+ function sequenceExpression(expressions) {
+ return (0, _builder$1.default)("SequenceExpression", ...arguments);
+ }
+
+ function parenthesizedExpression(expression) {
+ return (0, _builder$1.default)("ParenthesizedExpression", ...arguments);
+ }
+
+ function switchCase(test, consequent) {
+ return (0, _builder$1.default)("SwitchCase", ...arguments);
+ }
+
+ function switchStatement(discriminant, cases) {
+ return (0, _builder$1.default)("SwitchStatement", ...arguments);
+ }
+
+ function thisExpression() {
+ return (0, _builder$1.default)("ThisExpression", ...arguments);
+ }
+
+ function throwStatement(argument) {
+ return (0, _builder$1.default)("ThrowStatement", ...arguments);
+ }
+
+ function tryStatement(block, handler, finalizer) {
+ return (0, _builder$1.default)("TryStatement", ...arguments);
+ }
+
+ function unaryExpression(operator, argument, prefix) {
+ return (0, _builder$1.default)("UnaryExpression", ...arguments);
+ }
+
+ function updateExpression(operator, argument, prefix) {
+ return (0, _builder$1.default)("UpdateExpression", ...arguments);
+ }
+
+ function variableDeclaration(kind, declarations) {
+ return (0, _builder$1.default)("VariableDeclaration", ...arguments);
+ }
+
+ function variableDeclarator(id, init) {
+ return (0, _builder$1.default)("VariableDeclarator", ...arguments);
+ }
+
+ function whileStatement(test, body) {
+ return (0, _builder$1.default)("WhileStatement", ...arguments);
+ }
+
+ function withStatement(object, body) {
+ return (0, _builder$1.default)("WithStatement", ...arguments);
+ }
+
+ function assignmentPattern(left, right) {
+ return (0, _builder$1.default)("AssignmentPattern", ...arguments);
+ }
+
+ function arrayPattern(elements) {
+ return (0, _builder$1.default)("ArrayPattern", ...arguments);
+ }
+
+ function arrowFunctionExpression(params, body, async) {
+ return (0, _builder$1.default)("ArrowFunctionExpression", ...arguments);
+ }
+
+ function classBody(body) {
+ return (0, _builder$1.default)("ClassBody", ...arguments);
+ }
+
+ function classExpression(id, superClass, body, decorators) {
+ return (0, _builder$1.default)("ClassExpression", ...arguments);
+ }
+
+ function classDeclaration(id, superClass, body, decorators) {
+ return (0, _builder$1.default)("ClassDeclaration", ...arguments);
+ }
+
+ function exportAllDeclaration(source) {
+ return (0, _builder$1.default)("ExportAllDeclaration", ...arguments);
+ }
+
+ function exportDefaultDeclaration(declaration) {
+ return (0, _builder$1.default)("ExportDefaultDeclaration", ...arguments);
+ }
+
+ function exportNamedDeclaration(declaration, specifiers, source) {
+ return (0, _builder$1.default)("ExportNamedDeclaration", ...arguments);
+ }
+
+ function exportSpecifier(local, exported) {
+ return (0, _builder$1.default)("ExportSpecifier", ...arguments);
+ }
+
+ function forOfStatement(left, right, body, _await) {
+ return (0, _builder$1.default)("ForOfStatement", ...arguments);
+ }
+
+ function importDeclaration(specifiers, source) {
+ return (0, _builder$1.default)("ImportDeclaration", ...arguments);
+ }
+
+ function importDefaultSpecifier(local) {
+ return (0, _builder$1.default)("ImportDefaultSpecifier", ...arguments);
+ }
+
+ function importNamespaceSpecifier(local) {
+ return (0, _builder$1.default)("ImportNamespaceSpecifier", ...arguments);
+ }
+
+ function importSpecifier(local, imported) {
+ return (0, _builder$1.default)("ImportSpecifier", ...arguments);
+ }
+
+ function metaProperty(meta, property) {
+ return (0, _builder$1.default)("MetaProperty", ...arguments);
+ }
+
+ function classMethod(kind, key, params, body, computed, _static, generator, async) {
+ return (0, _builder$1.default)("ClassMethod", ...arguments);
+ }
+
+ function objectPattern(properties) {
+ return (0, _builder$1.default)("ObjectPattern", ...arguments);
+ }
+
+ function spreadElement(argument) {
+ return (0, _builder$1.default)("SpreadElement", ...arguments);
+ }
+
+ function _super() {
+ return (0, _builder$1.default)("Super", ...arguments);
+ }
+
+ function taggedTemplateExpression(tag, quasi) {
+ return (0, _builder$1.default)("TaggedTemplateExpression", ...arguments);
+ }
+
+ function templateElement(value, tail) {
+ return (0, _builder$1.default)("TemplateElement", ...arguments);
+ }
+
+ function templateLiteral(quasis, expressions) {
+ return (0, _builder$1.default)("TemplateLiteral", ...arguments);
+ }
+
+ function yieldExpression(argument, delegate) {
+ return (0, _builder$1.default)("YieldExpression", ...arguments);
+ }
+
+ function awaitExpression(argument) {
+ return (0, _builder$1.default)("AwaitExpression", ...arguments);
+ }
+
+ function _import() {
+ return (0, _builder$1.default)("Import", ...arguments);
+ }
+
+ function bigIntLiteral(value) {
+ return (0, _builder$1.default)("BigIntLiteral", ...arguments);
+ }
+
+ function exportNamespaceSpecifier(exported) {
+ return (0, _builder$1.default)("ExportNamespaceSpecifier", ...arguments);
+ }
+
+ function optionalMemberExpression(object, property, computed, optional) {
+ return (0, _builder$1.default)("OptionalMemberExpression", ...arguments);
+ }
+
+ function optionalCallExpression(callee, _arguments, optional) {
+ return (0, _builder$1.default)("OptionalCallExpression", ...arguments);
+ }
+
+ function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
+ return (0, _builder$1.default)("ClassProperty", ...arguments);
+ }
+
+ function classPrivateProperty(key, value, decorators, _static) {
+ return (0, _builder$1.default)("ClassPrivateProperty", ...arguments);
+ }
+
+ function classPrivateMethod(kind, key, params, body, _static) {
+ return (0, _builder$1.default)("ClassPrivateMethod", ...arguments);
+ }
+
+ function privateName(id) {
+ return (0, _builder$1.default)("PrivateName", ...arguments);
+ }
+
+ function anyTypeAnnotation() {
+ return (0, _builder$1.default)("AnyTypeAnnotation", ...arguments);
+ }
+
+ function arrayTypeAnnotation(elementType) {
+ return (0, _builder$1.default)("ArrayTypeAnnotation", ...arguments);
+ }
+
+ function booleanTypeAnnotation() {
+ return (0, _builder$1.default)("BooleanTypeAnnotation", ...arguments);
+ }
+
+ function booleanLiteralTypeAnnotation(value) {
+ return (0, _builder$1.default)("BooleanLiteralTypeAnnotation", ...arguments);
+ }
+
+ function nullLiteralTypeAnnotation() {
+ return (0, _builder$1.default)("NullLiteralTypeAnnotation", ...arguments);
+ }
+
+ function classImplements(id, typeParameters) {
+ return (0, _builder$1.default)("ClassImplements", ...arguments);
+ }
+
+ function declareClass(id, typeParameters, _extends, body) {
+ return (0, _builder$1.default)("DeclareClass", ...arguments);
+ }
+
+ function declareFunction(id) {
+ return (0, _builder$1.default)("DeclareFunction", ...arguments);
+ }
+
+ function declareInterface(id, typeParameters, _extends, body) {
+ return (0, _builder$1.default)("DeclareInterface", ...arguments);
+ }
+
+ function declareModule(id, body, kind) {
+ return (0, _builder$1.default)("DeclareModule", ...arguments);
+ }
+
+ function declareModuleExports(typeAnnotation) {
+ return (0, _builder$1.default)("DeclareModuleExports", ...arguments);
+ }
+
+ function declareTypeAlias(id, typeParameters, right) {
+ return (0, _builder$1.default)("DeclareTypeAlias", ...arguments);
+ }
+
+ function declareOpaqueType(id, typeParameters, supertype) {
+ return (0, _builder$1.default)("DeclareOpaqueType", ...arguments);
+ }
+
+ function declareVariable(id) {
+ return (0, _builder$1.default)("DeclareVariable", ...arguments);
+ }
+
+ function declareExportDeclaration(declaration, specifiers, source) {
+ return (0, _builder$1.default)("DeclareExportDeclaration", ...arguments);
+ }
+
+ function declareExportAllDeclaration(source) {
+ return (0, _builder$1.default)("DeclareExportAllDeclaration", ...arguments);
+ }
+
+ function declaredPredicate(value) {
+ return (0, _builder$1.default)("DeclaredPredicate", ...arguments);
+ }
+
+ function existsTypeAnnotation() {
+ return (0, _builder$1.default)("ExistsTypeAnnotation", ...arguments);
+ }
+
+ function functionTypeAnnotation(typeParameters, params, rest, returnType) {
+ return (0, _builder$1.default)("FunctionTypeAnnotation", ...arguments);
+ }
+
+ function functionTypeParam(name, typeAnnotation) {
+ return (0, _builder$1.default)("FunctionTypeParam", ...arguments);
+ }
+
+ function genericTypeAnnotation(id, typeParameters) {
+ return (0, _builder$1.default)("GenericTypeAnnotation", ...arguments);
+ }
+
+ function inferredPredicate() {
+ return (0, _builder$1.default)("InferredPredicate", ...arguments);
+ }
+
+ function interfaceExtends(id, typeParameters) {
+ return (0, _builder$1.default)("InterfaceExtends", ...arguments);
+ }
+
+ function interfaceDeclaration(id, typeParameters, _extends, body) {
+ return (0, _builder$1.default)("InterfaceDeclaration", ...arguments);
+ }
+
+ function interfaceTypeAnnotation(_extends, body) {
+ return (0, _builder$1.default)("InterfaceTypeAnnotation", ...arguments);
+ }
+
+ function intersectionTypeAnnotation(types) {
+ return (0, _builder$1.default)("IntersectionTypeAnnotation", ...arguments);
+ }
+
+ function mixedTypeAnnotation() {
+ return (0, _builder$1.default)("MixedTypeAnnotation", ...arguments);
+ }
+
+ function emptyTypeAnnotation() {
+ return (0, _builder$1.default)("EmptyTypeAnnotation", ...arguments);
+ }
+
+ function nullableTypeAnnotation(typeAnnotation) {
+ return (0, _builder$1.default)("NullableTypeAnnotation", ...arguments);
+ }
+
+ function numberLiteralTypeAnnotation(value) {
+ return (0, _builder$1.default)("NumberLiteralTypeAnnotation", ...arguments);
+ }
+
+ function numberTypeAnnotation() {
+ return (0, _builder$1.default)("NumberTypeAnnotation", ...arguments);
+ }
+
+ function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) {
+ return (0, _builder$1.default)("ObjectTypeAnnotation", ...arguments);
+ }
+
+ function objectTypeInternalSlot(id, value, optional, _static, method) {
+ return (0, _builder$1.default)("ObjectTypeInternalSlot", ...arguments);
+ }
+
+ function objectTypeCallProperty(value) {
+ return (0, _builder$1.default)("ObjectTypeCallProperty", ...arguments);
+ }
+
+ function objectTypeIndexer(id, key, value, variance) {
+ return (0, _builder$1.default)("ObjectTypeIndexer", ...arguments);
+ }
+
+ function objectTypeProperty(key, value, variance) {
+ return (0, _builder$1.default)("ObjectTypeProperty", ...arguments);
+ }
+
+ function objectTypeSpreadProperty(argument) {
+ return (0, _builder$1.default)("ObjectTypeSpreadProperty", ...arguments);
+ }
+
+ function opaqueType(id, typeParameters, supertype, impltype) {
+ return (0, _builder$1.default)("OpaqueType", ...arguments);
+ }
+
+ function qualifiedTypeIdentifier(id, qualification) {
+ return (0, _builder$1.default)("QualifiedTypeIdentifier", ...arguments);
+ }
+
+ function stringLiteralTypeAnnotation(value) {
+ return (0, _builder$1.default)("StringLiteralTypeAnnotation", ...arguments);
+ }
+
+ function stringTypeAnnotation() {
+ return (0, _builder$1.default)("StringTypeAnnotation", ...arguments);
+ }
+
+ function symbolTypeAnnotation() {
+ return (0, _builder$1.default)("SymbolTypeAnnotation", ...arguments);
+ }
+
+ function thisTypeAnnotation() {
+ return (0, _builder$1.default)("ThisTypeAnnotation", ...arguments);
+ }
+
+ function tupleTypeAnnotation(types) {
+ return (0, _builder$1.default)("TupleTypeAnnotation", ...arguments);
+ }
+
+ function typeofTypeAnnotation(argument) {
+ return (0, _builder$1.default)("TypeofTypeAnnotation", ...arguments);
+ }
+
+ function typeAlias(id, typeParameters, right) {
+ return (0, _builder$1.default)("TypeAlias", ...arguments);
+ }
+
+ function typeAnnotation(typeAnnotation) {
+ return (0, _builder$1.default)("TypeAnnotation", ...arguments);
+ }
+
+ function typeCastExpression(expression, typeAnnotation) {
+ return (0, _builder$1.default)("TypeCastExpression", ...arguments);
+ }
+
+ function typeParameter(bound, _default, variance) {
+ return (0, _builder$1.default)("TypeParameter", ...arguments);
+ }
+
+ function typeParameterDeclaration(params) {
+ return (0, _builder$1.default)("TypeParameterDeclaration", ...arguments);
+ }
+
+ function typeParameterInstantiation(params) {
+ return (0, _builder$1.default)("TypeParameterInstantiation", ...arguments);
+ }
+
+ function unionTypeAnnotation(types) {
+ return (0, _builder$1.default)("UnionTypeAnnotation", ...arguments);
+ }
+
+ function variance(kind) {
+ return (0, _builder$1.default)("Variance", ...arguments);
+ }
+
+ function voidTypeAnnotation() {
+ return (0, _builder$1.default)("VoidTypeAnnotation", ...arguments);
+ }
+
+ function enumDeclaration(id, body) {
+ return (0, _builder$1.default)("EnumDeclaration", ...arguments);
+ }
+
+ function enumBooleanBody(members) {
+ return (0, _builder$1.default)("EnumBooleanBody", ...arguments);
+ }
+
+ function enumNumberBody(members) {
+ return (0, _builder$1.default)("EnumNumberBody", ...arguments);
+ }
+
+ function enumStringBody(members) {
+ return (0, _builder$1.default)("EnumStringBody", ...arguments);
+ }
+
+ function enumSymbolBody(members) {
+ return (0, _builder$1.default)("EnumSymbolBody", ...arguments);
+ }
+
+ function enumBooleanMember(id) {
+ return (0, _builder$1.default)("EnumBooleanMember", ...arguments);
+ }
+
+ function enumNumberMember(id, init) {
+ return (0, _builder$1.default)("EnumNumberMember", ...arguments);
+ }
+
+ function enumStringMember(id, init) {
+ return (0, _builder$1.default)("EnumStringMember", ...arguments);
+ }
+
+ function enumDefaultedMember(id) {
+ return (0, _builder$1.default)("EnumDefaultedMember", ...arguments);
+ }
+
+ function indexedAccessType(objectType, indexType) {
+ return (0, _builder$1.default)("IndexedAccessType", ...arguments);
+ }
+
+ function optionalIndexedAccessType(objectType, indexType) {
+ return (0, _builder$1.default)("OptionalIndexedAccessType", ...arguments);
+ }
+
+ function jsxAttribute(name, value) {
+ return (0, _builder$1.default)("JSXAttribute", ...arguments);
+ }
+
+ function jsxClosingElement(name) {
+ return (0, _builder$1.default)("JSXClosingElement", ...arguments);
+ }
+
+ function jsxElement(openingElement, closingElement, children, selfClosing) {
+ return (0, _builder$1.default)("JSXElement", ...arguments);
+ }
+
+ function jsxEmptyExpression() {
+ return (0, _builder$1.default)("JSXEmptyExpression", ...arguments);
+ }
+
+ function jsxExpressionContainer(expression) {
+ return (0, _builder$1.default)("JSXExpressionContainer", ...arguments);
+ }
+
+ function jsxSpreadChild(expression) {
+ return (0, _builder$1.default)("JSXSpreadChild", ...arguments);
+ }
+
+ function jsxIdentifier(name) {
+ return (0, _builder$1.default)("JSXIdentifier", ...arguments);
+ }
+
+ function jsxMemberExpression(object, property) {
+ return (0, _builder$1.default)("JSXMemberExpression", ...arguments);
+ }
+
+ function jsxNamespacedName(namespace, name) {
+ return (0, _builder$1.default)("JSXNamespacedName", ...arguments);
+ }
+
+ function jsxOpeningElement(name, attributes, selfClosing) {
+ return (0, _builder$1.default)("JSXOpeningElement", ...arguments);
+ }
+
+ function jsxSpreadAttribute(argument) {
+ return (0, _builder$1.default)("JSXSpreadAttribute", ...arguments);
+ }
+
+ function jsxText(value) {
+ return (0, _builder$1.default)("JSXText", ...arguments);
+ }
+
+ function jsxFragment(openingFragment, closingFragment, children) {
+ return (0, _builder$1.default)("JSXFragment", ...arguments);
+ }
+
+ function jsxOpeningFragment() {
+ return (0, _builder$1.default)("JSXOpeningFragment", ...arguments);
+ }
+
+ function jsxClosingFragment() {
+ return (0, _builder$1.default)("JSXClosingFragment", ...arguments);
+ }
+
+ function noop$2() {
+ return (0, _builder$1.default)("Noop", ...arguments);
+ }
+
+ function placeholder(expectedNode, name) {
+ return (0, _builder$1.default)("Placeholder", ...arguments);
+ }
+
+ function v8IntrinsicIdentifier(name) {
+ return (0, _builder$1.default)("V8IntrinsicIdentifier", ...arguments);
+ }
+
+ function argumentPlaceholder() {
+ return (0, _builder$1.default)("ArgumentPlaceholder", ...arguments);
+ }
+
+ function bindExpression(object, callee) {
+ return (0, _builder$1.default)("BindExpression", ...arguments);
+ }
+
+ function importAttribute(key, value) {
+ return (0, _builder$1.default)("ImportAttribute", ...arguments);
+ }
+
+ function decorator(expression) {
+ return (0, _builder$1.default)("Decorator", ...arguments);
+ }
+
+ function doExpression(body, async) {
+ return (0, _builder$1.default)("DoExpression", ...arguments);
+ }
+
+ function exportDefaultSpecifier(exported) {
+ return (0, _builder$1.default)("ExportDefaultSpecifier", ...arguments);
+ }
+
+ function recordExpression(properties) {
+ return (0, _builder$1.default)("RecordExpression", ...arguments);
+ }
+
+ function tupleExpression(elements) {
+ return (0, _builder$1.default)("TupleExpression", ...arguments);
+ }
+
+ function decimalLiteral(value) {
+ return (0, _builder$1.default)("DecimalLiteral", ...arguments);
+ }
+
+ function staticBlock(body) {
+ return (0, _builder$1.default)("StaticBlock", ...arguments);
+ }
+
+ function moduleExpression(body) {
+ return (0, _builder$1.default)("ModuleExpression", ...arguments);
+ }
+
+ function topicReference() {
+ return (0, _builder$1.default)("TopicReference", ...arguments);
+ }
+
+ function pipelineTopicExpression(expression) {
+ return (0, _builder$1.default)("PipelineTopicExpression", ...arguments);
+ }
+
+ function pipelineBareFunction(callee) {
+ return (0, _builder$1.default)("PipelineBareFunction", ...arguments);
+ }
+
+ function pipelinePrimaryTopicReference() {
+ return (0, _builder$1.default)("PipelinePrimaryTopicReference", ...arguments);
+ }
+
+ function tsParameterProperty(parameter) {
+ return (0, _builder$1.default)("TSParameterProperty", ...arguments);
+ }
+
+ function tsDeclareFunction(id, typeParameters, params, returnType) {
+ return (0, _builder$1.default)("TSDeclareFunction", ...arguments);
+ }
+
+ function tsDeclareMethod(decorators, key, typeParameters, params, returnType) {
+ return (0, _builder$1.default)("TSDeclareMethod", ...arguments);
+ }
+
+ function tsQualifiedName(left, right) {
+ return (0, _builder$1.default)("TSQualifiedName", ...arguments);
+ }
+
+ function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSCallSignatureDeclaration", ...arguments);
+ }
+
+ function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSConstructSignatureDeclaration", ...arguments);
+ }
+
+ function tsPropertySignature(key, typeAnnotation, initializer) {
+ return (0, _builder$1.default)("TSPropertySignature", ...arguments);
+ }
+
+ function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSMethodSignature", ...arguments);
+ }
+
+ function tsIndexSignature(parameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSIndexSignature", ...arguments);
+ }
+
+ function tsAnyKeyword() {
+ return (0, _builder$1.default)("TSAnyKeyword", ...arguments);
+ }
+
+ function tsBooleanKeyword() {
+ return (0, _builder$1.default)("TSBooleanKeyword", ...arguments);
+ }
+
+ function tsBigIntKeyword() {
+ return (0, _builder$1.default)("TSBigIntKeyword", ...arguments);
+ }
+
+ function tsIntrinsicKeyword() {
+ return (0, _builder$1.default)("TSIntrinsicKeyword", ...arguments);
+ }
+
+ function tsNeverKeyword() {
+ return (0, _builder$1.default)("TSNeverKeyword", ...arguments);
+ }
+
+ function tsNullKeyword() {
+ return (0, _builder$1.default)("TSNullKeyword", ...arguments);
+ }
+
+ function tsNumberKeyword() {
+ return (0, _builder$1.default)("TSNumberKeyword", ...arguments);
+ }
+
+ function tsObjectKeyword() {
+ return (0, _builder$1.default)("TSObjectKeyword", ...arguments);
+ }
+
+ function tsStringKeyword() {
+ return (0, _builder$1.default)("TSStringKeyword", ...arguments);
+ }
+
+ function tsSymbolKeyword() {
+ return (0, _builder$1.default)("TSSymbolKeyword", ...arguments);
+ }
+
+ function tsUndefinedKeyword() {
+ return (0, _builder$1.default)("TSUndefinedKeyword", ...arguments);
+ }
+
+ function tsUnknownKeyword() {
+ return (0, _builder$1.default)("TSUnknownKeyword", ...arguments);
+ }
+
+ function tsVoidKeyword() {
+ return (0, _builder$1.default)("TSVoidKeyword", ...arguments);
+ }
+
+ function tsThisType() {
+ return (0, _builder$1.default)("TSThisType", ...arguments);
+ }
+
+ function tsFunctionType(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSFunctionType", ...arguments);
+ }
+
+ function tsConstructorType(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSConstructorType", ...arguments);
+ }
+
+ function tsTypeReference(typeName, typeParameters) {
+ return (0, _builder$1.default)("TSTypeReference", ...arguments);
+ }
+
+ function tsTypePredicate(parameterName, typeAnnotation, asserts) {
+ return (0, _builder$1.default)("TSTypePredicate", ...arguments);
+ }
+
+ function tsTypeQuery(exprName) {
+ return (0, _builder$1.default)("TSTypeQuery", ...arguments);
+ }
+
+ function tsTypeLiteral(members) {
+ return (0, _builder$1.default)("TSTypeLiteral", ...arguments);
+ }
+
+ function tsArrayType(elementType) {
+ return (0, _builder$1.default)("TSArrayType", ...arguments);
+ }
+
+ function tsTupleType(elementTypes) {
+ return (0, _builder$1.default)("TSTupleType", ...arguments);
+ }
+
+ function tsOptionalType(typeAnnotation) {
+ return (0, _builder$1.default)("TSOptionalType", ...arguments);
+ }
+
+ function tsRestType(typeAnnotation) {
+ return (0, _builder$1.default)("TSRestType", ...arguments);
+ }
+
+ function tsNamedTupleMember(label, elementType, optional) {
+ return (0, _builder$1.default)("TSNamedTupleMember", ...arguments);
+ }
+
+ function tsUnionType(types) {
+ return (0, _builder$1.default)("TSUnionType", ...arguments);
+ }
+
+ function tsIntersectionType(types) {
+ return (0, _builder$1.default)("TSIntersectionType", ...arguments);
+ }
+
+ function tsConditionalType(checkType, extendsType, trueType, falseType) {
+ return (0, _builder$1.default)("TSConditionalType", ...arguments);
+ }
+
+ function tsInferType(typeParameter) {
+ return (0, _builder$1.default)("TSInferType", ...arguments);
+ }
+
+ function tsParenthesizedType(typeAnnotation) {
+ return (0, _builder$1.default)("TSParenthesizedType", ...arguments);
+ }
+
+ function tsTypeOperator(typeAnnotation) {
+ return (0, _builder$1.default)("TSTypeOperator", ...arguments);
+ }
+
+ function tsIndexedAccessType(objectType, indexType) {
+ return (0, _builder$1.default)("TSIndexedAccessType", ...arguments);
+ }
+
+ function tsMappedType(typeParameter, typeAnnotation, nameType) {
+ return (0, _builder$1.default)("TSMappedType", ...arguments);
+ }
+
+ function tsLiteralType(literal) {
+ return (0, _builder$1.default)("TSLiteralType", ...arguments);
+ }
+
+ function tsExpressionWithTypeArguments(expression, typeParameters) {
+ return (0, _builder$1.default)("TSExpressionWithTypeArguments", ...arguments);
+ }
+
+ function tsInterfaceDeclaration(id, typeParameters, _extends, body) {
+ return (0, _builder$1.default)("TSInterfaceDeclaration", ...arguments);
+ }
+
+ function tsInterfaceBody(body) {
+ return (0, _builder$1.default)("TSInterfaceBody", ...arguments);
+ }
+
+ function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) {
+ return (0, _builder$1.default)("TSTypeAliasDeclaration", ...arguments);
+ }
+
+ function tsAsExpression(expression, typeAnnotation) {
+ return (0, _builder$1.default)("TSAsExpression", ...arguments);
+ }
+
+ function tsTypeAssertion(typeAnnotation, expression) {
+ return (0, _builder$1.default)("TSTypeAssertion", ...arguments);
+ }
+
+ function tsEnumDeclaration(id, members) {
+ return (0, _builder$1.default)("TSEnumDeclaration", ...arguments);
+ }
+
+ function tsEnumMember(id, initializer) {
+ return (0, _builder$1.default)("TSEnumMember", ...arguments);
+ }
+
+ function tsModuleDeclaration(id, body) {
+ return (0, _builder$1.default)("TSModuleDeclaration", ...arguments);
+ }
+
+ function tsModuleBlock(body) {
+ return (0, _builder$1.default)("TSModuleBlock", ...arguments);
+ }
+
+ function tsImportType(argument, qualifier, typeParameters) {
+ return (0, _builder$1.default)("TSImportType", ...arguments);
+ }
+
+ function tsImportEqualsDeclaration(id, moduleReference) {
+ return (0, _builder$1.default)("TSImportEqualsDeclaration", ...arguments);
+ }
+
+ function tsExternalModuleReference(expression) {
+ return (0, _builder$1.default)("TSExternalModuleReference", ...arguments);
+ }
+
+ function tsNonNullExpression(expression) {
+ return (0, _builder$1.default)("TSNonNullExpression", ...arguments);
+ }
+
+ function tsExportAssignment(expression) {
+ return (0, _builder$1.default)("TSExportAssignment", ...arguments);
+ }
+
+ function tsNamespaceExportDeclaration(id) {
+ return (0, _builder$1.default)("TSNamespaceExportDeclaration", ...arguments);
+ }
+
+ function tsTypeAnnotation(typeAnnotation) {
+ return (0, _builder$1.default)("TSTypeAnnotation", ...arguments);
+ }
+
+ function tsTypeParameterInstantiation(params) {
+ return (0, _builder$1.default)("TSTypeParameterInstantiation", ...arguments);
+ }
+
+ function tsTypeParameterDeclaration(params) {
+ return (0, _builder$1.default)("TSTypeParameterDeclaration", ...arguments);
+ }
+
+ function tsTypeParameter(constraint, _default, name) {
+ return (0, _builder$1.default)("TSTypeParameter", ...arguments);
+ }
+
+ function NumberLiteral$1(...args) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ return (0, _builder$1.default)("NumberLiteral", ...args);
+ }
+
+ function RegexLiteral$1(...args) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ return (0, _builder$1.default)("RegexLiteral", ...args);
+ }
+
+ function RestProperty$1(...args) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ return (0, _builder$1.default)("RestProperty", ...args);
+ }
+
+ function SpreadProperty$1(...args) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ return (0, _builder$1.default)("SpreadProperty", ...args);
+ }
+
+ Object.defineProperty(cleanJSXElementLiteralChild$3, "__esModule", {
+ value: true
+ });
+ cleanJSXElementLiteralChild$3.default = cleanJSXElementLiteralChild$2;
+
+ var _generated$L = generated$7;
+
+ function cleanJSXElementLiteralChild$2(child, args) {
+ const lines = child.value.split(/\r\n|\n|\r/);
+ let lastNonEmptyLine = 0;
+
+ for (let i = 0; i < lines.length; i++) {
+ if (lines[i].match(/[^ \t]/)) {
+ lastNonEmptyLine = i;
+ }
+ }
+
+ let str = "";
+
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ const isFirstLine = i === 0;
+ const isLastLine = i === lines.length - 1;
+ const isLastNonEmptyLine = i === lastNonEmptyLine;
+ let trimmedLine = line.replace(/\t/g, " ");
+
+ if (!isFirstLine) {
+ trimmedLine = trimmedLine.replace(/^[ ]+/, "");
+ }
+
+ if (!isLastLine) {
+ trimmedLine = trimmedLine.replace(/[ ]+$/, "");
+ }
+
+ if (trimmedLine) {
+ if (!isLastNonEmptyLine) {
+ trimmedLine += " ";
+ }
+
+ str += trimmedLine;
+ }
+ }
+
+ if (str) args.push((0, _generated$L.stringLiteral)(str));
+ }
+
+ Object.defineProperty(buildChildren$3, "__esModule", {
+ value: true
+ });
+ buildChildren$3.default = buildChildren$2;
+
+ var _generated$K = generated$8;
+
+ var _cleanJSXElementLiteralChild$1 = cleanJSXElementLiteralChild$3;
+
+ function buildChildren$2(node) {
+ const elements = [];
+
+ for (let i = 0; i < node.children.length; i++) {
+ let child = node.children[i];
+
+ if ((0, _generated$K.isJSXText)(child)) {
+ (0, _cleanJSXElementLiteralChild$1.default)(child, elements);
+ continue;
+ }
+
+ if ((0, _generated$K.isJSXExpressionContainer)(child)) child = child.expression;
+ if ((0, _generated$K.isJSXEmptyExpression)(child)) continue;
+ elements.push(child);
+ }
+
+ return elements;
+ }
+
+ var assertNode$3 = {};
+
+ var isNode$4 = {};
+
+ Object.defineProperty(isNode$4, "__esModule", {
+ value: true
+ });
+ isNode$4.default = isNode$3;
+
+ var _definitions$c = requireDefinitions$1();
+
+ function isNode$3(node) {
+ return !!(node && _definitions$c.VISITOR_KEYS[node.type]);
+ }
+
+ Object.defineProperty(assertNode$3, "__esModule", {
+ value: true
+ });
+ assertNode$3.default = assertNode$2;
+
+ var _isNode$1 = isNode$4;
+
+ function assertNode$2(node) {
+ if (!(0, _isNode$1.default)(node)) {
+ var _node$type;
+
+ const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
+ throw new TypeError(`Not a valid node of type "${type}"`);
+ }
+ }
+
+ var generated$6 = {};
+
+ Object.defineProperty(generated$6, "__esModule", {
+ value: true
+ });
+ generated$6.assertArrayExpression = assertArrayExpression$1;
+ generated$6.assertAssignmentExpression = assertAssignmentExpression$1;
+ generated$6.assertBinaryExpression = assertBinaryExpression$1;
+ generated$6.assertInterpreterDirective = assertInterpreterDirective$1;
+ generated$6.assertDirective = assertDirective$1;
+ generated$6.assertDirectiveLiteral = assertDirectiveLiteral$1;
+ generated$6.assertBlockStatement = assertBlockStatement$1;
+ generated$6.assertBreakStatement = assertBreakStatement$1;
+ generated$6.assertCallExpression = assertCallExpression$1;
+ generated$6.assertCatchClause = assertCatchClause$1;
+ generated$6.assertConditionalExpression = assertConditionalExpression$1;
+ generated$6.assertContinueStatement = assertContinueStatement$1;
+ generated$6.assertDebuggerStatement = assertDebuggerStatement$1;
+ generated$6.assertDoWhileStatement = assertDoWhileStatement$1;
+ generated$6.assertEmptyStatement = assertEmptyStatement$1;
+ generated$6.assertExpressionStatement = assertExpressionStatement$1;
+ generated$6.assertFile = assertFile$1;
+ generated$6.assertForInStatement = assertForInStatement$1;
+ generated$6.assertForStatement = assertForStatement$1;
+ generated$6.assertFunctionDeclaration = assertFunctionDeclaration$1;
+ generated$6.assertFunctionExpression = assertFunctionExpression$1;
+ generated$6.assertIdentifier = assertIdentifier$1;
+ generated$6.assertIfStatement = assertIfStatement$1;
+ generated$6.assertLabeledStatement = assertLabeledStatement$1;
+ generated$6.assertStringLiteral = assertStringLiteral$1;
+ generated$6.assertNumericLiteral = assertNumericLiteral$1;
+ generated$6.assertNullLiteral = assertNullLiteral$1;
+ generated$6.assertBooleanLiteral = assertBooleanLiteral$1;
+ generated$6.assertRegExpLiteral = assertRegExpLiteral$1;
+ generated$6.assertLogicalExpression = assertLogicalExpression$1;
+ generated$6.assertMemberExpression = assertMemberExpression$1;
+ generated$6.assertNewExpression = assertNewExpression$1;
+ generated$6.assertProgram = assertProgram$1;
+ generated$6.assertObjectExpression = assertObjectExpression$1;
+ generated$6.assertObjectMethod = assertObjectMethod$1;
+ generated$6.assertObjectProperty = assertObjectProperty$1;
+ generated$6.assertRestElement = assertRestElement$1;
+ generated$6.assertReturnStatement = assertReturnStatement$1;
+ generated$6.assertSequenceExpression = assertSequenceExpression$1;
+ generated$6.assertParenthesizedExpression = assertParenthesizedExpression$1;
+ generated$6.assertSwitchCase = assertSwitchCase$1;
+ generated$6.assertSwitchStatement = assertSwitchStatement$1;
+ generated$6.assertThisExpression = assertThisExpression$1;
+ generated$6.assertThrowStatement = assertThrowStatement$1;
+ generated$6.assertTryStatement = assertTryStatement$1;
+ generated$6.assertUnaryExpression = assertUnaryExpression$1;
+ generated$6.assertUpdateExpression = assertUpdateExpression$1;
+ generated$6.assertVariableDeclaration = assertVariableDeclaration$1;
+ generated$6.assertVariableDeclarator = assertVariableDeclarator$1;
+ generated$6.assertWhileStatement = assertWhileStatement$1;
+ generated$6.assertWithStatement = assertWithStatement$1;
+ generated$6.assertAssignmentPattern = assertAssignmentPattern$1;
+ generated$6.assertArrayPattern = assertArrayPattern$1;
+ generated$6.assertArrowFunctionExpression = assertArrowFunctionExpression$1;
+ generated$6.assertClassBody = assertClassBody$1;
+ generated$6.assertClassExpression = assertClassExpression$1;
+ generated$6.assertClassDeclaration = assertClassDeclaration$1;
+ generated$6.assertExportAllDeclaration = assertExportAllDeclaration$1;
+ generated$6.assertExportDefaultDeclaration = assertExportDefaultDeclaration$1;
+ generated$6.assertExportNamedDeclaration = assertExportNamedDeclaration$1;
+ generated$6.assertExportSpecifier = assertExportSpecifier$1;
+ generated$6.assertForOfStatement = assertForOfStatement$1;
+ generated$6.assertImportDeclaration = assertImportDeclaration$1;
+ generated$6.assertImportDefaultSpecifier = assertImportDefaultSpecifier$1;
+ generated$6.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier$1;
+ generated$6.assertImportSpecifier = assertImportSpecifier$1;
+ generated$6.assertMetaProperty = assertMetaProperty$1;
+ generated$6.assertClassMethod = assertClassMethod$1;
+ generated$6.assertObjectPattern = assertObjectPattern$1;
+ generated$6.assertSpreadElement = assertSpreadElement$1;
+ generated$6.assertSuper = assertSuper$1;
+ generated$6.assertTaggedTemplateExpression = assertTaggedTemplateExpression$1;
+ generated$6.assertTemplateElement = assertTemplateElement$1;
+ generated$6.assertTemplateLiteral = assertTemplateLiteral$1;
+ generated$6.assertYieldExpression = assertYieldExpression$1;
+ generated$6.assertAwaitExpression = assertAwaitExpression$1;
+ generated$6.assertImport = assertImport$1;
+ generated$6.assertBigIntLiteral = assertBigIntLiteral$1;
+ generated$6.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier$1;
+ generated$6.assertOptionalMemberExpression = assertOptionalMemberExpression$1;
+ generated$6.assertOptionalCallExpression = assertOptionalCallExpression$1;
+ generated$6.assertClassProperty = assertClassProperty$1;
+ generated$6.assertClassPrivateProperty = assertClassPrivateProperty$1;
+ generated$6.assertClassPrivateMethod = assertClassPrivateMethod$1;
+ generated$6.assertPrivateName = assertPrivateName$1;
+ generated$6.assertAnyTypeAnnotation = assertAnyTypeAnnotation$1;
+ generated$6.assertArrayTypeAnnotation = assertArrayTypeAnnotation$1;
+ generated$6.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation$1;
+ generated$6.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation$1;
+ generated$6.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation$1;
+ generated$6.assertClassImplements = assertClassImplements$1;
+ generated$6.assertDeclareClass = assertDeclareClass$1;
+ generated$6.assertDeclareFunction = assertDeclareFunction$1;
+ generated$6.assertDeclareInterface = assertDeclareInterface$1;
+ generated$6.assertDeclareModule = assertDeclareModule$1;
+ generated$6.assertDeclareModuleExports = assertDeclareModuleExports$1;
+ generated$6.assertDeclareTypeAlias = assertDeclareTypeAlias$1;
+ generated$6.assertDeclareOpaqueType = assertDeclareOpaqueType$1;
+ generated$6.assertDeclareVariable = assertDeclareVariable$1;
+ generated$6.assertDeclareExportDeclaration = assertDeclareExportDeclaration$1;
+ generated$6.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration$1;
+ generated$6.assertDeclaredPredicate = assertDeclaredPredicate$1;
+ generated$6.assertExistsTypeAnnotation = assertExistsTypeAnnotation$1;
+ generated$6.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation$1;
+ generated$6.assertFunctionTypeParam = assertFunctionTypeParam$1;
+ generated$6.assertGenericTypeAnnotation = assertGenericTypeAnnotation$1;
+ generated$6.assertInferredPredicate = assertInferredPredicate$1;
+ generated$6.assertInterfaceExtends = assertInterfaceExtends$1;
+ generated$6.assertInterfaceDeclaration = assertInterfaceDeclaration$1;
+ generated$6.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation$1;
+ generated$6.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation$1;
+ generated$6.assertMixedTypeAnnotation = assertMixedTypeAnnotation$1;
+ generated$6.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation$1;
+ generated$6.assertNullableTypeAnnotation = assertNullableTypeAnnotation$1;
+ generated$6.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation$1;
+ generated$6.assertNumberTypeAnnotation = assertNumberTypeAnnotation$1;
+ generated$6.assertObjectTypeAnnotation = assertObjectTypeAnnotation$1;
+ generated$6.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot$1;
+ generated$6.assertObjectTypeCallProperty = assertObjectTypeCallProperty$1;
+ generated$6.assertObjectTypeIndexer = assertObjectTypeIndexer$1;
+ generated$6.assertObjectTypeProperty = assertObjectTypeProperty$1;
+ generated$6.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty$1;
+ generated$6.assertOpaqueType = assertOpaqueType$1;
+ generated$6.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier$1;
+ generated$6.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation$1;
+ generated$6.assertStringTypeAnnotation = assertStringTypeAnnotation$1;
+ generated$6.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation$1;
+ generated$6.assertThisTypeAnnotation = assertThisTypeAnnotation$1;
+ generated$6.assertTupleTypeAnnotation = assertTupleTypeAnnotation$1;
+ generated$6.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation$1;
+ generated$6.assertTypeAlias = assertTypeAlias$1;
+ generated$6.assertTypeAnnotation = assertTypeAnnotation$1;
+ generated$6.assertTypeCastExpression = assertTypeCastExpression$1;
+ generated$6.assertTypeParameter = assertTypeParameter$1;
+ generated$6.assertTypeParameterDeclaration = assertTypeParameterDeclaration$1;
+ generated$6.assertTypeParameterInstantiation = assertTypeParameterInstantiation$1;
+ generated$6.assertUnionTypeAnnotation = assertUnionTypeAnnotation$1;
+ generated$6.assertVariance = assertVariance$1;
+ generated$6.assertVoidTypeAnnotation = assertVoidTypeAnnotation$1;
+ generated$6.assertEnumDeclaration = assertEnumDeclaration$1;
+ generated$6.assertEnumBooleanBody = assertEnumBooleanBody$1;
+ generated$6.assertEnumNumberBody = assertEnumNumberBody$1;
+ generated$6.assertEnumStringBody = assertEnumStringBody$1;
+ generated$6.assertEnumSymbolBody = assertEnumSymbolBody$1;
+ generated$6.assertEnumBooleanMember = assertEnumBooleanMember$1;
+ generated$6.assertEnumNumberMember = assertEnumNumberMember$1;
+ generated$6.assertEnumStringMember = assertEnumStringMember$1;
+ generated$6.assertEnumDefaultedMember = assertEnumDefaultedMember$1;
+ generated$6.assertIndexedAccessType = assertIndexedAccessType;
+ generated$6.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
+ generated$6.assertJSXAttribute = assertJSXAttribute$1;
+ generated$6.assertJSXClosingElement = assertJSXClosingElement$1;
+ generated$6.assertJSXElement = assertJSXElement$1;
+ generated$6.assertJSXEmptyExpression = assertJSXEmptyExpression$1;
+ generated$6.assertJSXExpressionContainer = assertJSXExpressionContainer$1;
+ generated$6.assertJSXSpreadChild = assertJSXSpreadChild$1;
+ generated$6.assertJSXIdentifier = assertJSXIdentifier$1;
+ generated$6.assertJSXMemberExpression = assertJSXMemberExpression$1;
+ generated$6.assertJSXNamespacedName = assertJSXNamespacedName$1;
+ generated$6.assertJSXOpeningElement = assertJSXOpeningElement$1;
+ generated$6.assertJSXSpreadAttribute = assertJSXSpreadAttribute$1;
+ generated$6.assertJSXText = assertJSXText$1;
+ generated$6.assertJSXFragment = assertJSXFragment$1;
+ generated$6.assertJSXOpeningFragment = assertJSXOpeningFragment$1;
+ generated$6.assertJSXClosingFragment = assertJSXClosingFragment$1;
+ generated$6.assertNoop = assertNoop$1;
+ generated$6.assertPlaceholder = assertPlaceholder$1;
+ generated$6.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier$1;
+ generated$6.assertArgumentPlaceholder = assertArgumentPlaceholder$1;
+ generated$6.assertBindExpression = assertBindExpression$1;
+ generated$6.assertImportAttribute = assertImportAttribute$1;
+ generated$6.assertDecorator = assertDecorator$1;
+ generated$6.assertDoExpression = assertDoExpression$1;
+ generated$6.assertExportDefaultSpecifier = assertExportDefaultSpecifier$1;
+ generated$6.assertRecordExpression = assertRecordExpression$1;
+ generated$6.assertTupleExpression = assertTupleExpression$1;
+ generated$6.assertDecimalLiteral = assertDecimalLiteral;
+ generated$6.assertStaticBlock = assertStaticBlock;
+ generated$6.assertModuleExpression = assertModuleExpression;
+ generated$6.assertTopicReference = assertTopicReference;
+ generated$6.assertPipelineTopicExpression = assertPipelineTopicExpression$1;
+ generated$6.assertPipelineBareFunction = assertPipelineBareFunction$1;
+ generated$6.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference$1;
+ generated$6.assertTSParameterProperty = assertTSParameterProperty$1;
+ generated$6.assertTSDeclareFunction = assertTSDeclareFunction$1;
+ generated$6.assertTSDeclareMethod = assertTSDeclareMethod$1;
+ generated$6.assertTSQualifiedName = assertTSQualifiedName$1;
+ generated$6.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration$1;
+ generated$6.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration$1;
+ generated$6.assertTSPropertySignature = assertTSPropertySignature$1;
+ generated$6.assertTSMethodSignature = assertTSMethodSignature$1;
+ generated$6.assertTSIndexSignature = assertTSIndexSignature$1;
+ generated$6.assertTSAnyKeyword = assertTSAnyKeyword$1;
+ generated$6.assertTSBooleanKeyword = assertTSBooleanKeyword$1;
+ generated$6.assertTSBigIntKeyword = assertTSBigIntKeyword$1;
+ generated$6.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
+ generated$6.assertTSNeverKeyword = assertTSNeverKeyword$1;
+ generated$6.assertTSNullKeyword = assertTSNullKeyword$1;
+ generated$6.assertTSNumberKeyword = assertTSNumberKeyword$1;
+ generated$6.assertTSObjectKeyword = assertTSObjectKeyword$1;
+ generated$6.assertTSStringKeyword = assertTSStringKeyword$1;
+ generated$6.assertTSSymbolKeyword = assertTSSymbolKeyword$1;
+ generated$6.assertTSUndefinedKeyword = assertTSUndefinedKeyword$1;
+ generated$6.assertTSUnknownKeyword = assertTSUnknownKeyword$1;
+ generated$6.assertTSVoidKeyword = assertTSVoidKeyword$1;
+ generated$6.assertTSThisType = assertTSThisType$1;
+ generated$6.assertTSFunctionType = assertTSFunctionType$1;
+ generated$6.assertTSConstructorType = assertTSConstructorType$1;
+ generated$6.assertTSTypeReference = assertTSTypeReference$1;
+ generated$6.assertTSTypePredicate = assertTSTypePredicate$1;
+ generated$6.assertTSTypeQuery = assertTSTypeQuery$1;
+ generated$6.assertTSTypeLiteral = assertTSTypeLiteral$1;
+ generated$6.assertTSArrayType = assertTSArrayType$1;
+ generated$6.assertTSTupleType = assertTSTupleType$1;
+ generated$6.assertTSOptionalType = assertTSOptionalType$1;
+ generated$6.assertTSRestType = assertTSRestType$1;
+ generated$6.assertTSNamedTupleMember = assertTSNamedTupleMember;
+ generated$6.assertTSUnionType = assertTSUnionType$1;
+ generated$6.assertTSIntersectionType = assertTSIntersectionType$1;
+ generated$6.assertTSConditionalType = assertTSConditionalType$1;
+ generated$6.assertTSInferType = assertTSInferType$1;
+ generated$6.assertTSParenthesizedType = assertTSParenthesizedType$1;
+ generated$6.assertTSTypeOperator = assertTSTypeOperator$1;
+ generated$6.assertTSIndexedAccessType = assertTSIndexedAccessType$1;
+ generated$6.assertTSMappedType = assertTSMappedType$1;
+ generated$6.assertTSLiteralType = assertTSLiteralType$1;
+ generated$6.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments$1;
+ generated$6.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration$1;
+ generated$6.assertTSInterfaceBody = assertTSInterfaceBody$1;
+ generated$6.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration$1;
+ generated$6.assertTSAsExpression = assertTSAsExpression$1;
+ generated$6.assertTSTypeAssertion = assertTSTypeAssertion$1;
+ generated$6.assertTSEnumDeclaration = assertTSEnumDeclaration$1;
+ generated$6.assertTSEnumMember = assertTSEnumMember$1;
+ generated$6.assertTSModuleDeclaration = assertTSModuleDeclaration$1;
+ generated$6.assertTSModuleBlock = assertTSModuleBlock$1;
+ generated$6.assertTSImportType = assertTSImportType$1;
+ generated$6.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration$1;
+ generated$6.assertTSExternalModuleReference = assertTSExternalModuleReference$1;
+ generated$6.assertTSNonNullExpression = assertTSNonNullExpression$1;
+ generated$6.assertTSExportAssignment = assertTSExportAssignment$1;
+ generated$6.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration$1;
+ generated$6.assertTSTypeAnnotation = assertTSTypeAnnotation$1;
+ generated$6.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation$1;
+ generated$6.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration$1;
+ generated$6.assertTSTypeParameter = assertTSTypeParameter$1;
+ generated$6.assertExpression = assertExpression$1;
+ generated$6.assertBinary = assertBinary$1;
+ generated$6.assertScopable = assertScopable$1;
+ generated$6.assertBlockParent = assertBlockParent$1;
+ generated$6.assertBlock = assertBlock$1;
+ generated$6.assertStatement = assertStatement$1;
+ generated$6.assertTerminatorless = assertTerminatorless$1;
+ generated$6.assertCompletionStatement = assertCompletionStatement$1;
+ generated$6.assertConditional = assertConditional$1;
+ generated$6.assertLoop = assertLoop$1;
+ generated$6.assertWhile = assertWhile$1;
+ generated$6.assertExpressionWrapper = assertExpressionWrapper$1;
+ generated$6.assertFor = assertFor$1;
+ generated$6.assertForXStatement = assertForXStatement$1;
+ generated$6.assertFunction = assertFunction$1;
+ generated$6.assertFunctionParent = assertFunctionParent$1;
+ generated$6.assertPureish = assertPureish$1;
+ generated$6.assertDeclaration = assertDeclaration$1;
+ generated$6.assertPatternLike = assertPatternLike$1;
+ generated$6.assertLVal = assertLVal$1;
+ generated$6.assertTSEntityName = assertTSEntityName$1;
+ generated$6.assertLiteral = assertLiteral$1;
+ generated$6.assertImmutable = assertImmutable$1;
+ generated$6.assertUserWhitespacable = assertUserWhitespacable$1;
+ generated$6.assertMethod = assertMethod$1;
+ generated$6.assertObjectMember = assertObjectMember$1;
+ generated$6.assertProperty = assertProperty$1;
+ generated$6.assertUnaryLike = assertUnaryLike$1;
+ generated$6.assertPattern = assertPattern$1;
+ generated$6.assertClass = assertClass$1;
+ generated$6.assertModuleDeclaration = assertModuleDeclaration$1;
+ generated$6.assertExportDeclaration = assertExportDeclaration$1;
+ generated$6.assertModuleSpecifier = assertModuleSpecifier$1;
+ generated$6.assertPrivate = assertPrivate$1;
+ generated$6.assertFlow = assertFlow$1;
+ generated$6.assertFlowType = assertFlowType$1;
+ generated$6.assertFlowBaseAnnotation = assertFlowBaseAnnotation$1;
+ generated$6.assertFlowDeclaration = assertFlowDeclaration$1;
+ generated$6.assertFlowPredicate = assertFlowPredicate$1;
+ generated$6.assertEnumBody = assertEnumBody$1;
+ generated$6.assertEnumMember = assertEnumMember$1;
+ generated$6.assertJSX = assertJSX$1;
+ generated$6.assertTSTypeElement = assertTSTypeElement$1;
+ generated$6.assertTSType = assertTSType$1;
+ generated$6.assertTSBaseType = assertTSBaseType$1;
+ generated$6.assertNumberLiteral = assertNumberLiteral$1;
+ generated$6.assertRegexLiteral = assertRegexLiteral$1;
+ generated$6.assertRestProperty = assertRestProperty$1;
+ generated$6.assertSpreadProperty = assertSpreadProperty$1;
+
+ var _is$1 = requireIs$1();
+
+ function assert$3(type, node, opts) {
+ if (!(0, _is$1.default)(type, node, opts)) {
+ throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`);
+ }
+ }
+
+ function assertArrayExpression$1(node, opts) {
+ assert$3("ArrayExpression", node, opts);
+ }
+
+ function assertAssignmentExpression$1(node, opts) {
+ assert$3("AssignmentExpression", node, opts);
+ }
+
+ function assertBinaryExpression$1(node, opts) {
+ assert$3("BinaryExpression", node, opts);
+ }
+
+ function assertInterpreterDirective$1(node, opts) {
+ assert$3("InterpreterDirective", node, opts);
+ }
+
+ function assertDirective$1(node, opts) {
+ assert$3("Directive", node, opts);
+ }
+
+ function assertDirectiveLiteral$1(node, opts) {
+ assert$3("DirectiveLiteral", node, opts);
+ }
+
+ function assertBlockStatement$1(node, opts) {
+ assert$3("BlockStatement", node, opts);
+ }
+
+ function assertBreakStatement$1(node, opts) {
+ assert$3("BreakStatement", node, opts);
+ }
+
+ function assertCallExpression$1(node, opts) {
+ assert$3("CallExpression", node, opts);
+ }
+
+ function assertCatchClause$1(node, opts) {
+ assert$3("CatchClause", node, opts);
+ }
+
+ function assertConditionalExpression$1(node, opts) {
+ assert$3("ConditionalExpression", node, opts);
+ }
+
+ function assertContinueStatement$1(node, opts) {
+ assert$3("ContinueStatement", node, opts);
+ }
+
+ function assertDebuggerStatement$1(node, opts) {
+ assert$3("DebuggerStatement", node, opts);
+ }
+
+ function assertDoWhileStatement$1(node, opts) {
+ assert$3("DoWhileStatement", node, opts);
+ }
+
+ function assertEmptyStatement$1(node, opts) {
+ assert$3("EmptyStatement", node, opts);
+ }
+
+ function assertExpressionStatement$1(node, opts) {
+ assert$3("ExpressionStatement", node, opts);
+ }
+
+ function assertFile$1(node, opts) {
+ assert$3("File", node, opts);
+ }
+
+ function assertForInStatement$1(node, opts) {
+ assert$3("ForInStatement", node, opts);
+ }
+
+ function assertForStatement$1(node, opts) {
+ assert$3("ForStatement", node, opts);
+ }
+
+ function assertFunctionDeclaration$1(node, opts) {
+ assert$3("FunctionDeclaration", node, opts);
+ }
+
+ function assertFunctionExpression$1(node, opts) {
+ assert$3("FunctionExpression", node, opts);
+ }
+
+ function assertIdentifier$1(node, opts) {
+ assert$3("Identifier", node, opts);
+ }
+
+ function assertIfStatement$1(node, opts) {
+ assert$3("IfStatement", node, opts);
+ }
+
+ function assertLabeledStatement$1(node, opts) {
+ assert$3("LabeledStatement", node, opts);
+ }
+
+ function assertStringLiteral$1(node, opts) {
+ assert$3("StringLiteral", node, opts);
+ }
+
+ function assertNumericLiteral$1(node, opts) {
+ assert$3("NumericLiteral", node, opts);
+ }
+
+ function assertNullLiteral$1(node, opts) {
+ assert$3("NullLiteral", node, opts);
+ }
+
+ function assertBooleanLiteral$1(node, opts) {
+ assert$3("BooleanLiteral", node, opts);
+ }
+
+ function assertRegExpLiteral$1(node, opts) {
+ assert$3("RegExpLiteral", node, opts);
+ }
+
+ function assertLogicalExpression$1(node, opts) {
+ assert$3("LogicalExpression", node, opts);
+ }
+
+ function assertMemberExpression$1(node, opts) {
+ assert$3("MemberExpression", node, opts);
+ }
+
+ function assertNewExpression$1(node, opts) {
+ assert$3("NewExpression", node, opts);
+ }
+
+ function assertProgram$1(node, opts) {
+ assert$3("Program", node, opts);
+ }
+
+ function assertObjectExpression$1(node, opts) {
+ assert$3("ObjectExpression", node, opts);
+ }
+
+ function assertObjectMethod$1(node, opts) {
+ assert$3("ObjectMethod", node, opts);
+ }
+
+ function assertObjectProperty$1(node, opts) {
+ assert$3("ObjectProperty", node, opts);
+ }
+
+ function assertRestElement$1(node, opts) {
+ assert$3("RestElement", node, opts);
+ }
+
+ function assertReturnStatement$1(node, opts) {
+ assert$3("ReturnStatement", node, opts);
+ }
+
+ function assertSequenceExpression$1(node, opts) {
+ assert$3("SequenceExpression", node, opts);
+ }
+
+ function assertParenthesizedExpression$1(node, opts) {
+ assert$3("ParenthesizedExpression", node, opts);
+ }
+
+ function assertSwitchCase$1(node, opts) {
+ assert$3("SwitchCase", node, opts);
+ }
+
+ function assertSwitchStatement$1(node, opts) {
+ assert$3("SwitchStatement", node, opts);
+ }
+
+ function assertThisExpression$1(node, opts) {
+ assert$3("ThisExpression", node, opts);
+ }
+
+ function assertThrowStatement$1(node, opts) {
+ assert$3("ThrowStatement", node, opts);
+ }
+
+ function assertTryStatement$1(node, opts) {
+ assert$3("TryStatement", node, opts);
+ }
+
+ function assertUnaryExpression$1(node, opts) {
+ assert$3("UnaryExpression", node, opts);
+ }
+
+ function assertUpdateExpression$1(node, opts) {
+ assert$3("UpdateExpression", node, opts);
+ }
+
+ function assertVariableDeclaration$1(node, opts) {
+ assert$3("VariableDeclaration", node, opts);
+ }
+
+ function assertVariableDeclarator$1(node, opts) {
+ assert$3("VariableDeclarator", node, opts);
+ }
+
+ function assertWhileStatement$1(node, opts) {
+ assert$3("WhileStatement", node, opts);
+ }
+
+ function assertWithStatement$1(node, opts) {
+ assert$3("WithStatement", node, opts);
+ }
+
+ function assertAssignmentPattern$1(node, opts) {
+ assert$3("AssignmentPattern", node, opts);
+ }
+
+ function assertArrayPattern$1(node, opts) {
+ assert$3("ArrayPattern", node, opts);
+ }
+
+ function assertArrowFunctionExpression$1(node, opts) {
+ assert$3("ArrowFunctionExpression", node, opts);
+ }
+
+ function assertClassBody$1(node, opts) {
+ assert$3("ClassBody", node, opts);
+ }
+
+ function assertClassExpression$1(node, opts) {
+ assert$3("ClassExpression", node, opts);
+ }
+
+ function assertClassDeclaration$1(node, opts) {
+ assert$3("ClassDeclaration", node, opts);
+ }
+
+ function assertExportAllDeclaration$1(node, opts) {
+ assert$3("ExportAllDeclaration", node, opts);
+ }
+
+ function assertExportDefaultDeclaration$1(node, opts) {
+ assert$3("ExportDefaultDeclaration", node, opts);
+ }
+
+ function assertExportNamedDeclaration$1(node, opts) {
+ assert$3("ExportNamedDeclaration", node, opts);
+ }
+
+ function assertExportSpecifier$1(node, opts) {
+ assert$3("ExportSpecifier", node, opts);
+ }
+
+ function assertForOfStatement$1(node, opts) {
+ assert$3("ForOfStatement", node, opts);
+ }
+
+ function assertImportDeclaration$1(node, opts) {
+ assert$3("ImportDeclaration", node, opts);
+ }
+
+ function assertImportDefaultSpecifier$1(node, opts) {
+ assert$3("ImportDefaultSpecifier", node, opts);
+ }
+
+ function assertImportNamespaceSpecifier$1(node, opts) {
+ assert$3("ImportNamespaceSpecifier", node, opts);
+ }
+
+ function assertImportSpecifier$1(node, opts) {
+ assert$3("ImportSpecifier", node, opts);
+ }
+
+ function assertMetaProperty$1(node, opts) {
+ assert$3("MetaProperty", node, opts);
+ }
+
+ function assertClassMethod$1(node, opts) {
+ assert$3("ClassMethod", node, opts);
+ }
+
+ function assertObjectPattern$1(node, opts) {
+ assert$3("ObjectPattern", node, opts);
+ }
+
+ function assertSpreadElement$1(node, opts) {
+ assert$3("SpreadElement", node, opts);
+ }
+
+ function assertSuper$1(node, opts) {
+ assert$3("Super", node, opts);
+ }
+
+ function assertTaggedTemplateExpression$1(node, opts) {
+ assert$3("TaggedTemplateExpression", node, opts);
+ }
+
+ function assertTemplateElement$1(node, opts) {
+ assert$3("TemplateElement", node, opts);
+ }
+
+ function assertTemplateLiteral$1(node, opts) {
+ assert$3("TemplateLiteral", node, opts);
+ }
+
+ function assertYieldExpression$1(node, opts) {
+ assert$3("YieldExpression", node, opts);
+ }
+
+ function assertAwaitExpression$1(node, opts) {
+ assert$3("AwaitExpression", node, opts);
+ }
+
+ function assertImport$1(node, opts) {
+ assert$3("Import", node, opts);
+ }
+
+ function assertBigIntLiteral$1(node, opts) {
+ assert$3("BigIntLiteral", node, opts);
+ }
+
+ function assertExportNamespaceSpecifier$1(node, opts) {
+ assert$3("ExportNamespaceSpecifier", node, opts);
+ }
+
+ function assertOptionalMemberExpression$1(node, opts) {
+ assert$3("OptionalMemberExpression", node, opts);
+ }
+
+ function assertOptionalCallExpression$1(node, opts) {
+ assert$3("OptionalCallExpression", node, opts);
+ }
+
+ function assertClassProperty$1(node, opts) {
+ assert$3("ClassProperty", node, opts);
+ }
+
+ function assertClassPrivateProperty$1(node, opts) {
+ assert$3("ClassPrivateProperty", node, opts);
+ }
+
+ function assertClassPrivateMethod$1(node, opts) {
+ assert$3("ClassPrivateMethod", node, opts);
+ }
+
+ function assertPrivateName$1(node, opts) {
+ assert$3("PrivateName", node, opts);
+ }
+
+ function assertAnyTypeAnnotation$1(node, opts) {
+ assert$3("AnyTypeAnnotation", node, opts);
+ }
+
+ function assertArrayTypeAnnotation$1(node, opts) {
+ assert$3("ArrayTypeAnnotation", node, opts);
+ }
+
+ function assertBooleanTypeAnnotation$1(node, opts) {
+ assert$3("BooleanTypeAnnotation", node, opts);
+ }
+
+ function assertBooleanLiteralTypeAnnotation$1(node, opts) {
+ assert$3("BooleanLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertNullLiteralTypeAnnotation$1(node, opts) {
+ assert$3("NullLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertClassImplements$1(node, opts) {
+ assert$3("ClassImplements", node, opts);
+ }
+
+ function assertDeclareClass$1(node, opts) {
+ assert$3("DeclareClass", node, opts);
+ }
+
+ function assertDeclareFunction$1(node, opts) {
+ assert$3("DeclareFunction", node, opts);
+ }
+
+ function assertDeclareInterface$1(node, opts) {
+ assert$3("DeclareInterface", node, opts);
+ }
+
+ function assertDeclareModule$1(node, opts) {
+ assert$3("DeclareModule", node, opts);
+ }
+
+ function assertDeclareModuleExports$1(node, opts) {
+ assert$3("DeclareModuleExports", node, opts);
+ }
+
+ function assertDeclareTypeAlias$1(node, opts) {
+ assert$3("DeclareTypeAlias", node, opts);
+ }
+
+ function assertDeclareOpaqueType$1(node, opts) {
+ assert$3("DeclareOpaqueType", node, opts);
+ }
+
+ function assertDeclareVariable$1(node, opts) {
+ assert$3("DeclareVariable", node, opts);
+ }
+
+ function assertDeclareExportDeclaration$1(node, opts) {
+ assert$3("DeclareExportDeclaration", node, opts);
+ }
+
+ function assertDeclareExportAllDeclaration$1(node, opts) {
+ assert$3("DeclareExportAllDeclaration", node, opts);
+ }
+
+ function assertDeclaredPredicate$1(node, opts) {
+ assert$3("DeclaredPredicate", node, opts);
+ }
+
+ function assertExistsTypeAnnotation$1(node, opts) {
+ assert$3("ExistsTypeAnnotation", node, opts);
+ }
+
+ function assertFunctionTypeAnnotation$1(node, opts) {
+ assert$3("FunctionTypeAnnotation", node, opts);
+ }
+
+ function assertFunctionTypeParam$1(node, opts) {
+ assert$3("FunctionTypeParam", node, opts);
+ }
+
+ function assertGenericTypeAnnotation$1(node, opts) {
+ assert$3("GenericTypeAnnotation", node, opts);
+ }
+
+ function assertInferredPredicate$1(node, opts) {
+ assert$3("InferredPredicate", node, opts);
+ }
+
+ function assertInterfaceExtends$1(node, opts) {
+ assert$3("InterfaceExtends", node, opts);
+ }
+
+ function assertInterfaceDeclaration$1(node, opts) {
+ assert$3("InterfaceDeclaration", node, opts);
+ }
+
+ function assertInterfaceTypeAnnotation$1(node, opts) {
+ assert$3("InterfaceTypeAnnotation", node, opts);
+ }
+
+ function assertIntersectionTypeAnnotation$1(node, opts) {
+ assert$3("IntersectionTypeAnnotation", node, opts);
+ }
+
+ function assertMixedTypeAnnotation$1(node, opts) {
+ assert$3("MixedTypeAnnotation", node, opts);
+ }
+
+ function assertEmptyTypeAnnotation$1(node, opts) {
+ assert$3("EmptyTypeAnnotation", node, opts);
+ }
+
+ function assertNullableTypeAnnotation$1(node, opts) {
+ assert$3("NullableTypeAnnotation", node, opts);
+ }
+
+ function assertNumberLiteralTypeAnnotation$1(node, opts) {
+ assert$3("NumberLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertNumberTypeAnnotation$1(node, opts) {
+ assert$3("NumberTypeAnnotation", node, opts);
+ }
+
+ function assertObjectTypeAnnotation$1(node, opts) {
+ assert$3("ObjectTypeAnnotation", node, opts);
+ }
+
+ function assertObjectTypeInternalSlot$1(node, opts) {
+ assert$3("ObjectTypeInternalSlot", node, opts);
+ }
+
+ function assertObjectTypeCallProperty$1(node, opts) {
+ assert$3("ObjectTypeCallProperty", node, opts);
+ }
+
+ function assertObjectTypeIndexer$1(node, opts) {
+ assert$3("ObjectTypeIndexer", node, opts);
+ }
+
+ function assertObjectTypeProperty$1(node, opts) {
+ assert$3("ObjectTypeProperty", node, opts);
+ }
+
+ function assertObjectTypeSpreadProperty$1(node, opts) {
+ assert$3("ObjectTypeSpreadProperty", node, opts);
+ }
+
+ function assertOpaqueType$1(node, opts) {
+ assert$3("OpaqueType", node, opts);
+ }
+
+ function assertQualifiedTypeIdentifier$1(node, opts) {
+ assert$3("QualifiedTypeIdentifier", node, opts);
+ }
+
+ function assertStringLiteralTypeAnnotation$1(node, opts) {
+ assert$3("StringLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertStringTypeAnnotation$1(node, opts) {
+ assert$3("StringTypeAnnotation", node, opts);
+ }
+
+ function assertSymbolTypeAnnotation$1(node, opts) {
+ assert$3("SymbolTypeAnnotation", node, opts);
+ }
+
+ function assertThisTypeAnnotation$1(node, opts) {
+ assert$3("ThisTypeAnnotation", node, opts);
+ }
+
+ function assertTupleTypeAnnotation$1(node, opts) {
+ assert$3("TupleTypeAnnotation", node, opts);
+ }
+
+ function assertTypeofTypeAnnotation$1(node, opts) {
+ assert$3("TypeofTypeAnnotation", node, opts);
+ }
+
+ function assertTypeAlias$1(node, opts) {
+ assert$3("TypeAlias", node, opts);
+ }
+
+ function assertTypeAnnotation$1(node, opts) {
+ assert$3("TypeAnnotation", node, opts);
+ }
+
+ function assertTypeCastExpression$1(node, opts) {
+ assert$3("TypeCastExpression", node, opts);
+ }
+
+ function assertTypeParameter$1(node, opts) {
+ assert$3("TypeParameter", node, opts);
+ }
+
+ function assertTypeParameterDeclaration$1(node, opts) {
+ assert$3("TypeParameterDeclaration", node, opts);
+ }
+
+ function assertTypeParameterInstantiation$1(node, opts) {
+ assert$3("TypeParameterInstantiation", node, opts);
+ }
+
+ function assertUnionTypeAnnotation$1(node, opts) {
+ assert$3("UnionTypeAnnotation", node, opts);
+ }
+
+ function assertVariance$1(node, opts) {
+ assert$3("Variance", node, opts);
+ }
+
+ function assertVoidTypeAnnotation$1(node, opts) {
+ assert$3("VoidTypeAnnotation", node, opts);
+ }
+
+ function assertEnumDeclaration$1(node, opts) {
+ assert$3("EnumDeclaration", node, opts);
+ }
+
+ function assertEnumBooleanBody$1(node, opts) {
+ assert$3("EnumBooleanBody", node, opts);
+ }
+
+ function assertEnumNumberBody$1(node, opts) {
+ assert$3("EnumNumberBody", node, opts);
+ }
+
+ function assertEnumStringBody$1(node, opts) {
+ assert$3("EnumStringBody", node, opts);
+ }
+
+ function assertEnumSymbolBody$1(node, opts) {
+ assert$3("EnumSymbolBody", node, opts);
+ }
+
+ function assertEnumBooleanMember$1(node, opts) {
+ assert$3("EnumBooleanMember", node, opts);
+ }
+
+ function assertEnumNumberMember$1(node, opts) {
+ assert$3("EnumNumberMember", node, opts);
+ }
+
+ function assertEnumStringMember$1(node, opts) {
+ assert$3("EnumStringMember", node, opts);
+ }
+
+ function assertEnumDefaultedMember$1(node, opts) {
+ assert$3("EnumDefaultedMember", node, opts);
+ }
+
+ function assertIndexedAccessType(node, opts) {
+ assert$3("IndexedAccessType", node, opts);
+ }
+
+ function assertOptionalIndexedAccessType(node, opts) {
+ assert$3("OptionalIndexedAccessType", node, opts);
+ }
+
+ function assertJSXAttribute$1(node, opts) {
+ assert$3("JSXAttribute", node, opts);
+ }
+
+ function assertJSXClosingElement$1(node, opts) {
+ assert$3("JSXClosingElement", node, opts);
+ }
+
+ function assertJSXElement$1(node, opts) {
+ assert$3("JSXElement", node, opts);
+ }
+
+ function assertJSXEmptyExpression$1(node, opts) {
+ assert$3("JSXEmptyExpression", node, opts);
+ }
+
+ function assertJSXExpressionContainer$1(node, opts) {
+ assert$3("JSXExpressionContainer", node, opts);
+ }
+
+ function assertJSXSpreadChild$1(node, opts) {
+ assert$3("JSXSpreadChild", node, opts);
+ }
+
+ function assertJSXIdentifier$1(node, opts) {
+ assert$3("JSXIdentifier", node, opts);
+ }
+
+ function assertJSXMemberExpression$1(node, opts) {
+ assert$3("JSXMemberExpression", node, opts);
+ }
+
+ function assertJSXNamespacedName$1(node, opts) {
+ assert$3("JSXNamespacedName", node, opts);
+ }
+
+ function assertJSXOpeningElement$1(node, opts) {
+ assert$3("JSXOpeningElement", node, opts);
+ }
+
+ function assertJSXSpreadAttribute$1(node, opts) {
+ assert$3("JSXSpreadAttribute", node, opts);
+ }
+
+ function assertJSXText$1(node, opts) {
+ assert$3("JSXText", node, opts);
+ }
+
+ function assertJSXFragment$1(node, opts) {
+ assert$3("JSXFragment", node, opts);
+ }
+
+ function assertJSXOpeningFragment$1(node, opts) {
+ assert$3("JSXOpeningFragment", node, opts);
+ }
+
+ function assertJSXClosingFragment$1(node, opts) {
+ assert$3("JSXClosingFragment", node, opts);
+ }
+
+ function assertNoop$1(node, opts) {
+ assert$3("Noop", node, opts);
+ }
+
+ function assertPlaceholder$1(node, opts) {
+ assert$3("Placeholder", node, opts);
+ }
+
+ function assertV8IntrinsicIdentifier$1(node, opts) {
+ assert$3("V8IntrinsicIdentifier", node, opts);
+ }
+
+ function assertArgumentPlaceholder$1(node, opts) {
+ assert$3("ArgumentPlaceholder", node, opts);
+ }
+
+ function assertBindExpression$1(node, opts) {
+ assert$3("BindExpression", node, opts);
+ }
+
+ function assertImportAttribute$1(node, opts) {
+ assert$3("ImportAttribute", node, opts);
+ }
+
+ function assertDecorator$1(node, opts) {
+ assert$3("Decorator", node, opts);
+ }
+
+ function assertDoExpression$1(node, opts) {
+ assert$3("DoExpression", node, opts);
+ }
+
+ function assertExportDefaultSpecifier$1(node, opts) {
+ assert$3("ExportDefaultSpecifier", node, opts);
+ }
+
+ function assertRecordExpression$1(node, opts) {
+ assert$3("RecordExpression", node, opts);
+ }
+
+ function assertTupleExpression$1(node, opts) {
+ assert$3("TupleExpression", node, opts);
+ }
+
+ function assertDecimalLiteral(node, opts) {
+ assert$3("DecimalLiteral", node, opts);
+ }
+
+ function assertStaticBlock(node, opts) {
+ assert$3("StaticBlock", node, opts);
+ }
+
+ function assertModuleExpression(node, opts) {
+ assert$3("ModuleExpression", node, opts);
+ }
+
+ function assertTopicReference(node, opts) {
+ assert$3("TopicReference", node, opts);
+ }
+
+ function assertPipelineTopicExpression$1(node, opts) {
+ assert$3("PipelineTopicExpression", node, opts);
+ }
+
+ function assertPipelineBareFunction$1(node, opts) {
+ assert$3("PipelineBareFunction", node, opts);
+ }
+
+ function assertPipelinePrimaryTopicReference$1(node, opts) {
+ assert$3("PipelinePrimaryTopicReference", node, opts);
+ }
+
+ function assertTSParameterProperty$1(node, opts) {
+ assert$3("TSParameterProperty", node, opts);
+ }
+
+ function assertTSDeclareFunction$1(node, opts) {
+ assert$3("TSDeclareFunction", node, opts);
+ }
+
+ function assertTSDeclareMethod$1(node, opts) {
+ assert$3("TSDeclareMethod", node, opts);
+ }
+
+ function assertTSQualifiedName$1(node, opts) {
+ assert$3("TSQualifiedName", node, opts);
+ }
+
+ function assertTSCallSignatureDeclaration$1(node, opts) {
+ assert$3("TSCallSignatureDeclaration", node, opts);
+ }
+
+ function assertTSConstructSignatureDeclaration$1(node, opts) {
+ assert$3("TSConstructSignatureDeclaration", node, opts);
+ }
+
+ function assertTSPropertySignature$1(node, opts) {
+ assert$3("TSPropertySignature", node, opts);
+ }
+
+ function assertTSMethodSignature$1(node, opts) {
+ assert$3("TSMethodSignature", node, opts);
+ }
+
+ function assertTSIndexSignature$1(node, opts) {
+ assert$3("TSIndexSignature", node, opts);
+ }
+
+ function assertTSAnyKeyword$1(node, opts) {
+ assert$3("TSAnyKeyword", node, opts);
+ }
+
+ function assertTSBooleanKeyword$1(node, opts) {
+ assert$3("TSBooleanKeyword", node, opts);
+ }
+
+ function assertTSBigIntKeyword$1(node, opts) {
+ assert$3("TSBigIntKeyword", node, opts);
+ }
+
+ function assertTSIntrinsicKeyword(node, opts) {
+ assert$3("TSIntrinsicKeyword", node, opts);
+ }
+
+ function assertTSNeverKeyword$1(node, opts) {
+ assert$3("TSNeverKeyword", node, opts);
+ }
+
+ function assertTSNullKeyword$1(node, opts) {
+ assert$3("TSNullKeyword", node, opts);
+ }
+
+ function assertTSNumberKeyword$1(node, opts) {
+ assert$3("TSNumberKeyword", node, opts);
+ }
+
+ function assertTSObjectKeyword$1(node, opts) {
+ assert$3("TSObjectKeyword", node, opts);
+ }
+
+ function assertTSStringKeyword$1(node, opts) {
+ assert$3("TSStringKeyword", node, opts);
+ }
+
+ function assertTSSymbolKeyword$1(node, opts) {
+ assert$3("TSSymbolKeyword", node, opts);
+ }
+
+ function assertTSUndefinedKeyword$1(node, opts) {
+ assert$3("TSUndefinedKeyword", node, opts);
+ }
+
+ function assertTSUnknownKeyword$1(node, opts) {
+ assert$3("TSUnknownKeyword", node, opts);
+ }
+
+ function assertTSVoidKeyword$1(node, opts) {
+ assert$3("TSVoidKeyword", node, opts);
+ }
+
+ function assertTSThisType$1(node, opts) {
+ assert$3("TSThisType", node, opts);
+ }
+
+ function assertTSFunctionType$1(node, opts) {
+ assert$3("TSFunctionType", node, opts);
+ }
+
+ function assertTSConstructorType$1(node, opts) {
+ assert$3("TSConstructorType", node, opts);
+ }
+
+ function assertTSTypeReference$1(node, opts) {
+ assert$3("TSTypeReference", node, opts);
+ }
+
+ function assertTSTypePredicate$1(node, opts) {
+ assert$3("TSTypePredicate", node, opts);
+ }
+
+ function assertTSTypeQuery$1(node, opts) {
+ assert$3("TSTypeQuery", node, opts);
+ }
+
+ function assertTSTypeLiteral$1(node, opts) {
+ assert$3("TSTypeLiteral", node, opts);
+ }
+
+ function assertTSArrayType$1(node, opts) {
+ assert$3("TSArrayType", node, opts);
+ }
+
+ function assertTSTupleType$1(node, opts) {
+ assert$3("TSTupleType", node, opts);
+ }
+
+ function assertTSOptionalType$1(node, opts) {
+ assert$3("TSOptionalType", node, opts);
+ }
+
+ function assertTSRestType$1(node, opts) {
+ assert$3("TSRestType", node, opts);
+ }
+
+ function assertTSNamedTupleMember(node, opts) {
+ assert$3("TSNamedTupleMember", node, opts);
+ }
+
+ function assertTSUnionType$1(node, opts) {
+ assert$3("TSUnionType", node, opts);
+ }
+
+ function assertTSIntersectionType$1(node, opts) {
+ assert$3("TSIntersectionType", node, opts);
+ }
+
+ function assertTSConditionalType$1(node, opts) {
+ assert$3("TSConditionalType", node, opts);
+ }
+
+ function assertTSInferType$1(node, opts) {
+ assert$3("TSInferType", node, opts);
+ }
+
+ function assertTSParenthesizedType$1(node, opts) {
+ assert$3("TSParenthesizedType", node, opts);
+ }
+
+ function assertTSTypeOperator$1(node, opts) {
+ assert$3("TSTypeOperator", node, opts);
+ }
+
+ function assertTSIndexedAccessType$1(node, opts) {
+ assert$3("TSIndexedAccessType", node, opts);
+ }
+
+ function assertTSMappedType$1(node, opts) {
+ assert$3("TSMappedType", node, opts);
+ }
+
+ function assertTSLiteralType$1(node, opts) {
+ assert$3("TSLiteralType", node, opts);
+ }
+
+ function assertTSExpressionWithTypeArguments$1(node, opts) {
+ assert$3("TSExpressionWithTypeArguments", node, opts);
+ }
+
+ function assertTSInterfaceDeclaration$1(node, opts) {
+ assert$3("TSInterfaceDeclaration", node, opts);
+ }
+
+ function assertTSInterfaceBody$1(node, opts) {
+ assert$3("TSInterfaceBody", node, opts);
+ }
+
+ function assertTSTypeAliasDeclaration$1(node, opts) {
+ assert$3("TSTypeAliasDeclaration", node, opts);
+ }
+
+ function assertTSAsExpression$1(node, opts) {
+ assert$3("TSAsExpression", node, opts);
+ }
+
+ function assertTSTypeAssertion$1(node, opts) {
+ assert$3("TSTypeAssertion", node, opts);
+ }
+
+ function assertTSEnumDeclaration$1(node, opts) {
+ assert$3("TSEnumDeclaration", node, opts);
+ }
+
+ function assertTSEnumMember$1(node, opts) {
+ assert$3("TSEnumMember", node, opts);
+ }
+
+ function assertTSModuleDeclaration$1(node, opts) {
+ assert$3("TSModuleDeclaration", node, opts);
+ }
+
+ function assertTSModuleBlock$1(node, opts) {
+ assert$3("TSModuleBlock", node, opts);
+ }
+
+ function assertTSImportType$1(node, opts) {
+ assert$3("TSImportType", node, opts);
+ }
+
+ function assertTSImportEqualsDeclaration$1(node, opts) {
+ assert$3("TSImportEqualsDeclaration", node, opts);
+ }
+
+ function assertTSExternalModuleReference$1(node, opts) {
+ assert$3("TSExternalModuleReference", node, opts);
+ }
+
+ function assertTSNonNullExpression$1(node, opts) {
+ assert$3("TSNonNullExpression", node, opts);
+ }
+
+ function assertTSExportAssignment$1(node, opts) {
+ assert$3("TSExportAssignment", node, opts);
+ }
+
+ function assertTSNamespaceExportDeclaration$1(node, opts) {
+ assert$3("TSNamespaceExportDeclaration", node, opts);
+ }
+
+ function assertTSTypeAnnotation$1(node, opts) {
+ assert$3("TSTypeAnnotation", node, opts);
+ }
+
+ function assertTSTypeParameterInstantiation$1(node, opts) {
+ assert$3("TSTypeParameterInstantiation", node, opts);
+ }
+
+ function assertTSTypeParameterDeclaration$1(node, opts) {
+ assert$3("TSTypeParameterDeclaration", node, opts);
+ }
+
+ function assertTSTypeParameter$1(node, opts) {
+ assert$3("TSTypeParameter", node, opts);
+ }
+
+ function assertExpression$1(node, opts) {
+ assert$3("Expression", node, opts);
+ }
+
+ function assertBinary$1(node, opts) {
+ assert$3("Binary", node, opts);
+ }
+
+ function assertScopable$1(node, opts) {
+ assert$3("Scopable", node, opts);
+ }
+
+ function assertBlockParent$1(node, opts) {
+ assert$3("BlockParent", node, opts);
+ }
+
+ function assertBlock$1(node, opts) {
+ assert$3("Block", node, opts);
+ }
+
+ function assertStatement$1(node, opts) {
+ assert$3("Statement", node, opts);
+ }
+
+ function assertTerminatorless$1(node, opts) {
+ assert$3("Terminatorless", node, opts);
+ }
+
+ function assertCompletionStatement$1(node, opts) {
+ assert$3("CompletionStatement", node, opts);
+ }
+
+ function assertConditional$1(node, opts) {
+ assert$3("Conditional", node, opts);
+ }
+
+ function assertLoop$1(node, opts) {
+ assert$3("Loop", node, opts);
+ }
+
+ function assertWhile$1(node, opts) {
+ assert$3("While", node, opts);
+ }
+
+ function assertExpressionWrapper$1(node, opts) {
+ assert$3("ExpressionWrapper", node, opts);
+ }
+
+ function assertFor$1(node, opts) {
+ assert$3("For", node, opts);
+ }
+
+ function assertForXStatement$1(node, opts) {
+ assert$3("ForXStatement", node, opts);
+ }
+
+ function assertFunction$1(node, opts) {
+ assert$3("Function", node, opts);
+ }
+
+ function assertFunctionParent$1(node, opts) {
+ assert$3("FunctionParent", node, opts);
+ }
+
+ function assertPureish$1(node, opts) {
+ assert$3("Pureish", node, opts);
+ }
+
+ function assertDeclaration$1(node, opts) {
+ assert$3("Declaration", node, opts);
+ }
+
+ function assertPatternLike$1(node, opts) {
+ assert$3("PatternLike", node, opts);
+ }
+
+ function assertLVal$1(node, opts) {
+ assert$3("LVal", node, opts);
+ }
+
+ function assertTSEntityName$1(node, opts) {
+ assert$3("TSEntityName", node, opts);
+ }
+
+ function assertLiteral$1(node, opts) {
+ assert$3("Literal", node, opts);
+ }
+
+ function assertImmutable$1(node, opts) {
+ assert$3("Immutable", node, opts);
+ }
+
+ function assertUserWhitespacable$1(node, opts) {
+ assert$3("UserWhitespacable", node, opts);
+ }
+
+ function assertMethod$1(node, opts) {
+ assert$3("Method", node, opts);
+ }
+
+ function assertObjectMember$1(node, opts) {
+ assert$3("ObjectMember", node, opts);
+ }
+
+ function assertProperty$1(node, opts) {
+ assert$3("Property", node, opts);
+ }
+
+ function assertUnaryLike$1(node, opts) {
+ assert$3("UnaryLike", node, opts);
+ }
+
+ function assertPattern$1(node, opts) {
+ assert$3("Pattern", node, opts);
+ }
+
+ function assertClass$1(node, opts) {
+ assert$3("Class", node, opts);
+ }
+
+ function assertModuleDeclaration$1(node, opts) {
+ assert$3("ModuleDeclaration", node, opts);
+ }
+
+ function assertExportDeclaration$1(node, opts) {
+ assert$3("ExportDeclaration", node, opts);
+ }
+
+ function assertModuleSpecifier$1(node, opts) {
+ assert$3("ModuleSpecifier", node, opts);
+ }
+
+ function assertPrivate$1(node, opts) {
+ assert$3("Private", node, opts);
+ }
+
+ function assertFlow$1(node, opts) {
+ assert$3("Flow", node, opts);
+ }
+
+ function assertFlowType$1(node, opts) {
+ assert$3("FlowType", node, opts);
+ }
+
+ function assertFlowBaseAnnotation$1(node, opts) {
+ assert$3("FlowBaseAnnotation", node, opts);
+ }
+
+ function assertFlowDeclaration$1(node, opts) {
+ assert$3("FlowDeclaration", node, opts);
+ }
+
+ function assertFlowPredicate$1(node, opts) {
+ assert$3("FlowPredicate", node, opts);
+ }
+
+ function assertEnumBody$1(node, opts) {
+ assert$3("EnumBody", node, opts);
+ }
+
+ function assertEnumMember$1(node, opts) {
+ assert$3("EnumMember", node, opts);
+ }
+
+ function assertJSX$1(node, opts) {
+ assert$3("JSX", node, opts);
+ }
+
+ function assertTSTypeElement$1(node, opts) {
+ assert$3("TSTypeElement", node, opts);
+ }
+
+ function assertTSType$1(node, opts) {
+ assert$3("TSType", node, opts);
+ }
+
+ function assertTSBaseType$1(node, opts) {
+ assert$3("TSBaseType", node, opts);
+ }
+
+ function assertNumberLiteral$1(node, opts) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ assert$3("NumberLiteral", node, opts);
+ }
+
+ function assertRegexLiteral$1(node, opts) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ assert$3("RegexLiteral", node, opts);
+ }
+
+ function assertRestProperty$1(node, opts) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ assert$3("RestProperty", node, opts);
+ }
+
+ function assertSpreadProperty$1(node, opts) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ assert$3("SpreadProperty", node, opts);
+ }
+
+ var createTypeAnnotationBasedOnTypeof$3 = {};
+
+ Object.defineProperty(createTypeAnnotationBasedOnTypeof$3, "__esModule", {
+ value: true
+ });
+ createTypeAnnotationBasedOnTypeof$3.default = createTypeAnnotationBasedOnTypeof$2;
+
+ var _generated$J = generated$7;
+
+ function createTypeAnnotationBasedOnTypeof$2(type) {
+ if (type === "string") {
+ return (0, _generated$J.stringTypeAnnotation)();
+ } else if (type === "number") {
+ return (0, _generated$J.numberTypeAnnotation)();
+ } else if (type === "undefined") {
+ return (0, _generated$J.voidTypeAnnotation)();
+ } else if (type === "boolean") {
+ return (0, _generated$J.booleanTypeAnnotation)();
+ } else if (type === "function") {
+ return (0, _generated$J.genericTypeAnnotation)((0, _generated$J.identifier)("Function"));
+ } else if (type === "object") {
+ return (0, _generated$J.genericTypeAnnotation)((0, _generated$J.identifier)("Object"));
+ } else if (type === "symbol") {
+ return (0, _generated$J.genericTypeAnnotation)((0, _generated$J.identifier)("Symbol"));
+ } else if (type === "bigint") {
+ return (0, _generated$J.anyTypeAnnotation)();
+ } else {
+ throw new Error("Invalid typeof value: " + type);
+ }
+ }
+
+ var createFlowUnionType$3 = {};
+
+ var removeTypeDuplicates$7 = {};
+
+ Object.defineProperty(removeTypeDuplicates$7, "__esModule", {
+ value: true
+ });
+ removeTypeDuplicates$7.default = removeTypeDuplicates$6;
+
+ var _generated$I = generated$8;
+
+ function getQualifiedName(node) {
+ return (0, _generated$I.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
+ }
+
+ function removeTypeDuplicates$6(nodes) {
+ const generics = {};
+ const bases = {};
+ const typeGroups = new Set();
+ const types = [];
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+
+ if (types.indexOf(node) >= 0) {
+ continue;
+ }
+
+ if ((0, _generated$I.isAnyTypeAnnotation)(node)) {
+ return [node];
+ }
+
+ if ((0, _generated$I.isFlowBaseAnnotation)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated$I.isUnionTypeAnnotation)(node)) {
+ if (!typeGroups.has(node.types)) {
+ nodes = nodes.concat(node.types);
+ typeGroups.add(node.types);
+ }
+
+ continue;
+ }
+
+ if ((0, _generated$I.isGenericTypeAnnotation)(node)) {
+ const name = getQualifiedName(node.id);
+
+ if (generics[name]) {
+ let existing = generics[name];
+
+ if (existing.typeParameters) {
+ if (node.typeParameters) {
+ existing.typeParameters.params = removeTypeDuplicates$6(existing.typeParameters.params.concat(node.typeParameters.params));
+ }
+ } else {
+ existing = node.typeParameters;
+ }
+ } else {
+ generics[name] = node;
+ }
+
+ continue;
+ }
+
+ types.push(node);
+ }
+
+ for (const type of Object.keys(bases)) {
+ types.push(bases[type]);
+ }
+
+ for (const name of Object.keys(generics)) {
+ types.push(generics[name]);
+ }
+
+ return types;
+ }
+
+ Object.defineProperty(createFlowUnionType$3, "__esModule", {
+ value: true
+ });
+ createFlowUnionType$3.default = createFlowUnionType$2;
+
+ var _generated$H = generated$7;
+
+ var _removeTypeDuplicates$3 = removeTypeDuplicates$7;
+
+ function createFlowUnionType$2(types) {
+ const flattened = (0, _removeTypeDuplicates$3.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated$H.unionTypeAnnotation)(flattened);
+ }
+ }
+
+ var createTSUnionType$3 = {};
+
+ var removeTypeDuplicates$5 = {};
+
+ Object.defineProperty(removeTypeDuplicates$5, "__esModule", {
+ value: true
+ });
+ removeTypeDuplicates$5.default = removeTypeDuplicates$4;
+
+ var _generated$G = generated$8;
+
+ function removeTypeDuplicates$4(nodes) {
+ const generics = {};
+ const bases = {};
+ const typeGroups = new Set();
+ const types = [];
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+
+ if (types.indexOf(node) >= 0) {
+ continue;
+ }
+
+ if ((0, _generated$G.isTSAnyKeyword)(node)) {
+ return [node];
+ }
+
+ if ((0, _generated$G.isTSBaseType)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated$G.isTSUnionType)(node)) {
+ if (!typeGroups.has(node.types)) {
+ nodes.push(...node.types);
+ typeGroups.add(node.types);
+ }
+
+ continue;
+ }
+
+ types.push(node);
+ }
+
+ for (const type of Object.keys(bases)) {
+ types.push(bases[type]);
+ }
+
+ for (const name of Object.keys(generics)) {
+ types.push(generics[name]);
+ }
+
+ return types;
+ }
+
+ Object.defineProperty(createTSUnionType$3, "__esModule", {
+ value: true
+ });
+ createTSUnionType$3.default = createTSUnionType$2;
+
+ var _generated$F = generated$7;
+
+ var _removeTypeDuplicates$2 = removeTypeDuplicates$5;
+
+ function createTSUnionType$2(typeAnnotations) {
+ const types = typeAnnotations.map(type => type.typeAnnotation);
+ const flattened = (0, _removeTypeDuplicates$2.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated$F.tsUnionType)(flattened);
+ }
+ }
+
+ var uppercase = {};
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.defineProperty(exports, "ArrayExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.arrayExpression;
+ }
+ });
+ Object.defineProperty(exports, "AssignmentExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.assignmentExpression;
+ }
+ });
+ Object.defineProperty(exports, "BinaryExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.binaryExpression;
+ }
+ });
+ Object.defineProperty(exports, "InterpreterDirective", {
+ enumerable: true,
+ get: function () {
+ return _index.interpreterDirective;
+ }
+ });
+ Object.defineProperty(exports, "Directive", {
+ enumerable: true,
+ get: function () {
+ return _index.directive;
+ }
+ });
+ Object.defineProperty(exports, "DirectiveLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.directiveLiteral;
+ }
+ });
+ Object.defineProperty(exports, "BlockStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.blockStatement;
+ }
+ });
+ Object.defineProperty(exports, "BreakStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.breakStatement;
+ }
+ });
+ Object.defineProperty(exports, "CallExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.callExpression;
+ }
+ });
+ Object.defineProperty(exports, "CatchClause", {
+ enumerable: true,
+ get: function () {
+ return _index.catchClause;
+ }
+ });
+ Object.defineProperty(exports, "ConditionalExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.conditionalExpression;
+ }
+ });
+ Object.defineProperty(exports, "ContinueStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.continueStatement;
+ }
+ });
+ Object.defineProperty(exports, "DebuggerStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.debuggerStatement;
+ }
+ });
+ Object.defineProperty(exports, "DoWhileStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.doWhileStatement;
+ }
+ });
+ Object.defineProperty(exports, "EmptyStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.emptyStatement;
+ }
+ });
+ Object.defineProperty(exports, "ExpressionStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.expressionStatement;
+ }
+ });
+ Object.defineProperty(exports, "File", {
+ enumerable: true,
+ get: function () {
+ return _index.file;
+ }
+ });
+ Object.defineProperty(exports, "ForInStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.forInStatement;
+ }
+ });
+ Object.defineProperty(exports, "ForStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.forStatement;
+ }
+ });
+ Object.defineProperty(exports, "FunctionDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.functionDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "FunctionExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.functionExpression;
+ }
+ });
+ Object.defineProperty(exports, "Identifier", {
+ enumerable: true,
+ get: function () {
+ return _index.identifier;
+ }
+ });
+ Object.defineProperty(exports, "IfStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.ifStatement;
+ }
+ });
+ Object.defineProperty(exports, "LabeledStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.labeledStatement;
+ }
+ });
+ Object.defineProperty(exports, "StringLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.stringLiteral;
+ }
+ });
+ Object.defineProperty(exports, "NumericLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.numericLiteral;
+ }
+ });
+ Object.defineProperty(exports, "NullLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.nullLiteral;
+ }
+ });
+ Object.defineProperty(exports, "BooleanLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.booleanLiteral;
+ }
+ });
+ Object.defineProperty(exports, "RegExpLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.regExpLiteral;
+ }
+ });
+ Object.defineProperty(exports, "LogicalExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.logicalExpression;
+ }
+ });
+ Object.defineProperty(exports, "MemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.memberExpression;
+ }
+ });
+ Object.defineProperty(exports, "NewExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.newExpression;
+ }
+ });
+ Object.defineProperty(exports, "Program", {
+ enumerable: true,
+ get: function () {
+ return _index.program;
+ }
+ });
+ Object.defineProperty(exports, "ObjectExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.objectExpression;
+ }
+ });
+ Object.defineProperty(exports, "ObjectMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.objectMethod;
+ }
+ });
+ Object.defineProperty(exports, "ObjectProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectProperty;
+ }
+ });
+ Object.defineProperty(exports, "RestElement", {
+ enumerable: true,
+ get: function () {
+ return _index.restElement;
+ }
+ });
+ Object.defineProperty(exports, "ReturnStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.returnStatement;
+ }
+ });
+ Object.defineProperty(exports, "SequenceExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.sequenceExpression;
+ }
+ });
+ Object.defineProperty(exports, "ParenthesizedExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.parenthesizedExpression;
+ }
+ });
+ Object.defineProperty(exports, "SwitchCase", {
+ enumerable: true,
+ get: function () {
+ return _index.switchCase;
+ }
+ });
+ Object.defineProperty(exports, "SwitchStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.switchStatement;
+ }
+ });
+ Object.defineProperty(exports, "ThisExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.thisExpression;
+ }
+ });
+ Object.defineProperty(exports, "ThrowStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.throwStatement;
+ }
+ });
+ Object.defineProperty(exports, "TryStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.tryStatement;
+ }
+ });
+ Object.defineProperty(exports, "UnaryExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.unaryExpression;
+ }
+ });
+ Object.defineProperty(exports, "UpdateExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.updateExpression;
+ }
+ });
+ Object.defineProperty(exports, "VariableDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.variableDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "VariableDeclarator", {
+ enumerable: true,
+ get: function () {
+ return _index.variableDeclarator;
+ }
+ });
+ Object.defineProperty(exports, "WhileStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.whileStatement;
+ }
+ });
+ Object.defineProperty(exports, "WithStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.withStatement;
+ }
+ });
+ Object.defineProperty(exports, "AssignmentPattern", {
+ enumerable: true,
+ get: function () {
+ return _index.assignmentPattern;
+ }
+ });
+ Object.defineProperty(exports, "ArrayPattern", {
+ enumerable: true,
+ get: function () {
+ return _index.arrayPattern;
+ }
+ });
+ Object.defineProperty(exports, "ArrowFunctionExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.arrowFunctionExpression;
+ }
+ });
+ Object.defineProperty(exports, "ClassBody", {
+ enumerable: true,
+ get: function () {
+ return _index.classBody;
+ }
+ });
+ Object.defineProperty(exports, "ClassExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.classExpression;
+ }
+ });
+ Object.defineProperty(exports, "ClassDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.classDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "ExportAllDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.exportAllDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "ExportDefaultDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.exportDefaultDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "ExportNamedDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.exportNamedDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "ExportSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.exportSpecifier;
+ }
+ });
+ Object.defineProperty(exports, "ForOfStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.forOfStatement;
+ }
+ });
+ Object.defineProperty(exports, "ImportDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.importDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "ImportDefaultSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.importDefaultSpecifier;
+ }
+ });
+ Object.defineProperty(exports, "ImportNamespaceSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.importNamespaceSpecifier;
+ }
+ });
+ Object.defineProperty(exports, "ImportSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.importSpecifier;
+ }
+ });
+ Object.defineProperty(exports, "MetaProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.metaProperty;
+ }
+ });
+ Object.defineProperty(exports, "ClassMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.classMethod;
+ }
+ });
+ Object.defineProperty(exports, "ObjectPattern", {
+ enumerable: true,
+ get: function () {
+ return _index.objectPattern;
+ }
+ });
+ Object.defineProperty(exports, "SpreadElement", {
+ enumerable: true,
+ get: function () {
+ return _index.spreadElement;
+ }
+ });
+ Object.defineProperty(exports, "Super", {
+ enumerable: true,
+ get: function () {
+ return _index.super;
+ }
+ });
+ Object.defineProperty(exports, "TaggedTemplateExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.taggedTemplateExpression;
+ }
+ });
+ Object.defineProperty(exports, "TemplateElement", {
+ enumerable: true,
+ get: function () {
+ return _index.templateElement;
+ }
+ });
+ Object.defineProperty(exports, "TemplateLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.templateLiteral;
+ }
+ });
+ Object.defineProperty(exports, "YieldExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.yieldExpression;
+ }
+ });
+ Object.defineProperty(exports, "AwaitExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.awaitExpression;
+ }
+ });
+ Object.defineProperty(exports, "Import", {
+ enumerable: true,
+ get: function () {
+ return _index.import;
+ }
+ });
+ Object.defineProperty(exports, "BigIntLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.bigIntLiteral;
+ }
+ });
+ Object.defineProperty(exports, "ExportNamespaceSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.exportNamespaceSpecifier;
+ }
+ });
+ Object.defineProperty(exports, "OptionalMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.optionalMemberExpression;
+ }
+ });
+ Object.defineProperty(exports, "OptionalCallExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.optionalCallExpression;
+ }
+ });
+ Object.defineProperty(exports, "ClassProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.classProperty;
+ }
+ });
+ Object.defineProperty(exports, "ClassPrivateProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.classPrivateProperty;
+ }
+ });
+ Object.defineProperty(exports, "ClassPrivateMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.classPrivateMethod;
+ }
+ });
+ Object.defineProperty(exports, "PrivateName", {
+ enumerable: true,
+ get: function () {
+ return _index.privateName;
+ }
+ });
+ Object.defineProperty(exports, "AnyTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.anyTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "ArrayTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.arrayTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "BooleanTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.booleanTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.booleanLiteralTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "NullLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.nullLiteralTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "ClassImplements", {
+ enumerable: true,
+ get: function () {
+ return _index.classImplements;
+ }
+ });
+ Object.defineProperty(exports, "DeclareClass", {
+ enumerable: true,
+ get: function () {
+ return _index.declareClass;
+ }
+ });
+ Object.defineProperty(exports, "DeclareFunction", {
+ enumerable: true,
+ get: function () {
+ return _index.declareFunction;
+ }
+ });
+ Object.defineProperty(exports, "DeclareInterface", {
+ enumerable: true,
+ get: function () {
+ return _index.declareInterface;
+ }
+ });
+ Object.defineProperty(exports, "DeclareModule", {
+ enumerable: true,
+ get: function () {
+ return _index.declareModule;
+ }
+ });
+ Object.defineProperty(exports, "DeclareModuleExports", {
+ enumerable: true,
+ get: function () {
+ return _index.declareModuleExports;
+ }
+ });
+ Object.defineProperty(exports, "DeclareTypeAlias", {
+ enumerable: true,
+ get: function () {
+ return _index.declareTypeAlias;
+ }
+ });
+ Object.defineProperty(exports, "DeclareOpaqueType", {
+ enumerable: true,
+ get: function () {
+ return _index.declareOpaqueType;
+ }
+ });
+ Object.defineProperty(exports, "DeclareVariable", {
+ enumerable: true,
+ get: function () {
+ return _index.declareVariable;
+ }
+ });
+ Object.defineProperty(exports, "DeclareExportDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.declareExportDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "DeclareExportAllDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.declareExportAllDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "DeclaredPredicate", {
+ enumerable: true,
+ get: function () {
+ return _index.declaredPredicate;
+ }
+ });
+ Object.defineProperty(exports, "ExistsTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.existsTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "FunctionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.functionTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "FunctionTypeParam", {
+ enumerable: true,
+ get: function () {
+ return _index.functionTypeParam;
+ }
+ });
+ Object.defineProperty(exports, "GenericTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.genericTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "InferredPredicate", {
+ enumerable: true,
+ get: function () {
+ return _index.inferredPredicate;
+ }
+ });
+ Object.defineProperty(exports, "InterfaceExtends", {
+ enumerable: true,
+ get: function () {
+ return _index.interfaceExtends;
+ }
+ });
+ Object.defineProperty(exports, "InterfaceDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.interfaceDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "InterfaceTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.interfaceTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "IntersectionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.intersectionTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "MixedTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.mixedTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "EmptyTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.emptyTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "NullableTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.nullableTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.numberLiteralTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "NumberTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.numberTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "ObjectTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "ObjectTypeInternalSlot", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeInternalSlot;
+ }
+ });
+ Object.defineProperty(exports, "ObjectTypeCallProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeCallProperty;
+ }
+ });
+ Object.defineProperty(exports, "ObjectTypeIndexer", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeIndexer;
+ }
+ });
+ Object.defineProperty(exports, "ObjectTypeProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeProperty;
+ }
+ });
+ Object.defineProperty(exports, "ObjectTypeSpreadProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeSpreadProperty;
+ }
+ });
+ Object.defineProperty(exports, "OpaqueType", {
+ enumerable: true,
+ get: function () {
+ return _index.opaqueType;
+ }
+ });
+ Object.defineProperty(exports, "QualifiedTypeIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _index.qualifiedTypeIdentifier;
+ }
+ });
+ Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.stringLiteralTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "StringTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.stringTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "SymbolTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.symbolTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "ThisTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.thisTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "TupleTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.tupleTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "TypeofTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.typeofTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "TypeAlias", {
+ enumerable: true,
+ get: function () {
+ return _index.typeAlias;
+ }
+ });
+ Object.defineProperty(exports, "TypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.typeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "TypeCastExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.typeCastExpression;
+ }
+ });
+ Object.defineProperty(exports, "TypeParameter", {
+ enumerable: true,
+ get: function () {
+ return _index.typeParameter;
+ }
+ });
+ Object.defineProperty(exports, "TypeParameterDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.typeParameterDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TypeParameterInstantiation", {
+ enumerable: true,
+ get: function () {
+ return _index.typeParameterInstantiation;
+ }
+ });
+ Object.defineProperty(exports, "UnionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.unionTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "Variance", {
+ enumerable: true,
+ get: function () {
+ return _index.variance;
+ }
+ });
+ Object.defineProperty(exports, "VoidTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.voidTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "EnumDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.enumDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "EnumBooleanBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumBooleanBody;
+ }
+ });
+ Object.defineProperty(exports, "EnumNumberBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumNumberBody;
+ }
+ });
+ Object.defineProperty(exports, "EnumStringBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumStringBody;
+ }
+ });
+ Object.defineProperty(exports, "EnumSymbolBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumSymbolBody;
+ }
+ });
+ Object.defineProperty(exports, "EnumBooleanMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumBooleanMember;
+ }
+ });
+ Object.defineProperty(exports, "EnumNumberMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumNumberMember;
+ }
+ });
+ Object.defineProperty(exports, "EnumStringMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumStringMember;
+ }
+ });
+ Object.defineProperty(exports, "EnumDefaultedMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumDefaultedMember;
+ }
+ });
+ Object.defineProperty(exports, "IndexedAccessType", {
+ enumerable: true,
+ get: function () {
+ return _index.indexedAccessType;
+ }
+ });
+ Object.defineProperty(exports, "OptionalIndexedAccessType", {
+ enumerable: true,
+ get: function () {
+ return _index.optionalIndexedAccessType;
+ }
+ });
+ Object.defineProperty(exports, "JSXAttribute", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxAttribute;
+ }
+ });
+ Object.defineProperty(exports, "JSXClosingElement", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxClosingElement;
+ }
+ });
+ Object.defineProperty(exports, "JSXElement", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxElement;
+ }
+ });
+ Object.defineProperty(exports, "JSXEmptyExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxEmptyExpression;
+ }
+ });
+ Object.defineProperty(exports, "JSXExpressionContainer", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxExpressionContainer;
+ }
+ });
+ Object.defineProperty(exports, "JSXSpreadChild", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxSpreadChild;
+ }
+ });
+ Object.defineProperty(exports, "JSXIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxIdentifier;
+ }
+ });
+ Object.defineProperty(exports, "JSXMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxMemberExpression;
+ }
+ });
+ Object.defineProperty(exports, "JSXNamespacedName", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxNamespacedName;
+ }
+ });
+ Object.defineProperty(exports, "JSXOpeningElement", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxOpeningElement;
+ }
+ });
+ Object.defineProperty(exports, "JSXSpreadAttribute", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxSpreadAttribute;
+ }
+ });
+ Object.defineProperty(exports, "JSXText", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxText;
+ }
+ });
+ Object.defineProperty(exports, "JSXFragment", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxFragment;
+ }
+ });
+ Object.defineProperty(exports, "JSXOpeningFragment", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxOpeningFragment;
+ }
+ });
+ Object.defineProperty(exports, "JSXClosingFragment", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxClosingFragment;
+ }
+ });
+ Object.defineProperty(exports, "Noop", {
+ enumerable: true,
+ get: function () {
+ return _index.noop;
+ }
+ });
+ Object.defineProperty(exports, "Placeholder", {
+ enumerable: true,
+ get: function () {
+ return _index.placeholder;
+ }
+ });
+ Object.defineProperty(exports, "V8IntrinsicIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _index.v8IntrinsicIdentifier;
+ }
+ });
+ Object.defineProperty(exports, "ArgumentPlaceholder", {
+ enumerable: true,
+ get: function () {
+ return _index.argumentPlaceholder;
+ }
+ });
+ Object.defineProperty(exports, "BindExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.bindExpression;
+ }
+ });
+ Object.defineProperty(exports, "ImportAttribute", {
+ enumerable: true,
+ get: function () {
+ return _index.importAttribute;
+ }
+ });
+ Object.defineProperty(exports, "Decorator", {
+ enumerable: true,
+ get: function () {
+ return _index.decorator;
+ }
+ });
+ Object.defineProperty(exports, "DoExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.doExpression;
+ }
+ });
+ Object.defineProperty(exports, "ExportDefaultSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.exportDefaultSpecifier;
+ }
+ });
+ Object.defineProperty(exports, "RecordExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.recordExpression;
+ }
+ });
+ Object.defineProperty(exports, "TupleExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.tupleExpression;
+ }
+ });
+ Object.defineProperty(exports, "DecimalLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.decimalLiteral;
+ }
+ });
+ Object.defineProperty(exports, "StaticBlock", {
+ enumerable: true,
+ get: function () {
+ return _index.staticBlock;
+ }
+ });
+ Object.defineProperty(exports, "ModuleExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.moduleExpression;
+ }
+ });
+ Object.defineProperty(exports, "TopicReference", {
+ enumerable: true,
+ get: function () {
+ return _index.topicReference;
+ }
+ });
+ Object.defineProperty(exports, "PipelineTopicExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.pipelineTopicExpression;
+ }
+ });
+ Object.defineProperty(exports, "PipelineBareFunction", {
+ enumerable: true,
+ get: function () {
+ return _index.pipelineBareFunction;
+ }
+ });
+ Object.defineProperty(exports, "PipelinePrimaryTopicReference", {
+ enumerable: true,
+ get: function () {
+ return _index.pipelinePrimaryTopicReference;
+ }
+ });
+ Object.defineProperty(exports, "TSParameterProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.tsParameterProperty;
+ }
+ });
+ Object.defineProperty(exports, "TSDeclareFunction", {
+ enumerable: true,
+ get: function () {
+ return _index.tsDeclareFunction;
+ }
+ });
+ Object.defineProperty(exports, "TSDeclareMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.tsDeclareMethod;
+ }
+ });
+ Object.defineProperty(exports, "TSQualifiedName", {
+ enumerable: true,
+ get: function () {
+ return _index.tsQualifiedName;
+ }
+ });
+ Object.defineProperty(exports, "TSCallSignatureDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsCallSignatureDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSConstructSignatureDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsConstructSignatureDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSPropertySignature", {
+ enumerable: true,
+ get: function () {
+ return _index.tsPropertySignature;
+ }
+ });
+ Object.defineProperty(exports, "TSMethodSignature", {
+ enumerable: true,
+ get: function () {
+ return _index.tsMethodSignature;
+ }
+ });
+ Object.defineProperty(exports, "TSIndexSignature", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIndexSignature;
+ }
+ });
+ Object.defineProperty(exports, "TSAnyKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsAnyKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSBooleanKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsBooleanKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSBigIntKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsBigIntKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSIntrinsicKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIntrinsicKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSNeverKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNeverKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSNullKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNullKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSNumberKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNumberKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSObjectKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsObjectKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSStringKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsStringKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSSymbolKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsSymbolKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSUndefinedKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsUndefinedKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSUnknownKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsUnknownKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSVoidKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsVoidKeyword;
+ }
+ });
+ Object.defineProperty(exports, "TSThisType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsThisType;
+ }
+ });
+ Object.defineProperty(exports, "TSFunctionType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsFunctionType;
+ }
+ });
+ Object.defineProperty(exports, "TSConstructorType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsConstructorType;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeReference", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeReference;
+ }
+ });
+ Object.defineProperty(exports, "TSTypePredicate", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypePredicate;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeQuery", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeQuery;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeLiteral;
+ }
+ });
+ Object.defineProperty(exports, "TSArrayType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsArrayType;
+ }
+ });
+ Object.defineProperty(exports, "TSTupleType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTupleType;
+ }
+ });
+ Object.defineProperty(exports, "TSOptionalType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsOptionalType;
+ }
+ });
+ Object.defineProperty(exports, "TSRestType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsRestType;
+ }
+ });
+ Object.defineProperty(exports, "TSNamedTupleMember", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNamedTupleMember;
+ }
+ });
+ Object.defineProperty(exports, "TSUnionType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsUnionType;
+ }
+ });
+ Object.defineProperty(exports, "TSIntersectionType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIntersectionType;
+ }
+ });
+ Object.defineProperty(exports, "TSConditionalType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsConditionalType;
+ }
+ });
+ Object.defineProperty(exports, "TSInferType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsInferType;
+ }
+ });
+ Object.defineProperty(exports, "TSParenthesizedType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsParenthesizedType;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeOperator", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeOperator;
+ }
+ });
+ Object.defineProperty(exports, "TSIndexedAccessType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIndexedAccessType;
+ }
+ });
+ Object.defineProperty(exports, "TSMappedType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsMappedType;
+ }
+ });
+ Object.defineProperty(exports, "TSLiteralType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsLiteralType;
+ }
+ });
+ Object.defineProperty(exports, "TSExpressionWithTypeArguments", {
+ enumerable: true,
+ get: function () {
+ return _index.tsExpressionWithTypeArguments;
+ }
+ });
+ Object.defineProperty(exports, "TSInterfaceDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsInterfaceDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSInterfaceBody", {
+ enumerable: true,
+ get: function () {
+ return _index.tsInterfaceBody;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeAliasDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeAliasDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSAsExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.tsAsExpression;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeAssertion", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeAssertion;
+ }
+ });
+ Object.defineProperty(exports, "TSEnumDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsEnumDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSEnumMember", {
+ enumerable: true,
+ get: function () {
+ return _index.tsEnumMember;
+ }
+ });
+ Object.defineProperty(exports, "TSModuleDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsModuleDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSModuleBlock", {
+ enumerable: true,
+ get: function () {
+ return _index.tsModuleBlock;
+ }
+ });
+ Object.defineProperty(exports, "TSImportType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsImportType;
+ }
+ });
+ Object.defineProperty(exports, "TSImportEqualsDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsImportEqualsDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSExternalModuleReference", {
+ enumerable: true,
+ get: function () {
+ return _index.tsExternalModuleReference;
+ }
+ });
+ Object.defineProperty(exports, "TSNonNullExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNonNullExpression;
+ }
+ });
+ Object.defineProperty(exports, "TSExportAssignment", {
+ enumerable: true,
+ get: function () {
+ return _index.tsExportAssignment;
+ }
+ });
+ Object.defineProperty(exports, "TSNamespaceExportDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNamespaceExportDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeAnnotation;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeParameterInstantiation", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeParameterInstantiation;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeParameterDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeParameterDeclaration;
+ }
+ });
+ Object.defineProperty(exports, "TSTypeParameter", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeParameter;
+ }
+ });
+ Object.defineProperty(exports, "NumberLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.numberLiteral;
+ }
+ });
+ Object.defineProperty(exports, "RegexLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.regexLiteral;
+ }
+ });
+ Object.defineProperty(exports, "RestProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.restProperty;
+ }
+ });
+ Object.defineProperty(exports, "SpreadProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.spreadProperty;
+ }
+ });
+
+ var _index = generated$7;
+ } (uppercase));
+
+ var cloneNode$3 = {};
+
+ Object.defineProperty(cloneNode$3, "__esModule", {
+ value: true
+ });
+ cloneNode$3.default = cloneNode$2;
+
+ var _definitions$b = requireDefinitions$1();
+
+ var _generated$E = generated$8;
+
+ const has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
+
+ function cloneIfNode$1(obj, deep, withoutLoc) {
+ if (obj && typeof obj.type === "string") {
+ return cloneNode$2(obj, deep, withoutLoc);
+ }
+
+ return obj;
+ }
+
+ function cloneIfNodeOrArray$1(obj, deep, withoutLoc) {
+ if (Array.isArray(obj)) {
+ return obj.map(node => cloneIfNode$1(node, deep, withoutLoc));
+ }
+
+ return cloneIfNode$1(obj, deep, withoutLoc);
+ }
+
+ function cloneNode$2(node, deep = true, withoutLoc = false) {
+ if (!node) return node;
+ const {
+ type
+ } = node;
+ const newNode = {
+ type: node.type
+ };
+
+ if ((0, _generated$E.isIdentifier)(node)) {
+ newNode.name = node.name;
+
+ if (has$2(node, "optional") && typeof node.optional === "boolean") {
+ newNode.optional = node.optional;
+ }
+
+ if (has$2(node, "typeAnnotation")) {
+ newNode.typeAnnotation = deep ? cloneIfNodeOrArray$1(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
+ }
+ } else if (!has$2(_definitions$b.NODE_FIELDS, type)) {
+ throw new Error(`Unknown node type: "${type}"`);
+ } else {
+ for (const field of Object.keys(_definitions$b.NODE_FIELDS[type])) {
+ if (has$2(node, field)) {
+ if (deep) {
+ newNode[field] = (0, _generated$E.isFile)(node) && field === "comments" ? maybeCloneComments$1(node.comments, deep, withoutLoc) : cloneIfNodeOrArray$1(node[field], true, withoutLoc);
+ } else {
+ newNode[field] = node[field];
+ }
+ }
+ }
+ }
+
+ if (has$2(node, "loc")) {
+ if (withoutLoc) {
+ newNode.loc = null;
+ } else {
+ newNode.loc = node.loc;
+ }
+ }
+
+ if (has$2(node, "leadingComments")) {
+ newNode.leadingComments = maybeCloneComments$1(node.leadingComments, deep, withoutLoc);
+ }
+
+ if (has$2(node, "innerComments")) {
+ newNode.innerComments = maybeCloneComments$1(node.innerComments, deep, withoutLoc);
+ }
+
+ if (has$2(node, "trailingComments")) {
+ newNode.trailingComments = maybeCloneComments$1(node.trailingComments, deep, withoutLoc);
+ }
+
+ if (has$2(node, "extra")) {
+ newNode.extra = Object.assign({}, node.extra);
+ }
+
+ return newNode;
+ }
+
+ function maybeCloneComments$1(comments, deep, withoutLoc) {
+ if (!comments || !deep) {
+ return comments;
+ }
+
+ return comments.map(({
+ type,
+ value,
+ loc
+ }) => {
+ if (withoutLoc) {
+ return {
+ type,
+ value,
+ loc: null
+ };
+ }
+
+ return {
+ type,
+ value,
+ loc
+ };
+ });
+ }
+
+ var clone$4 = {};
+
+ Object.defineProperty(clone$4, "__esModule", {
+ value: true
+ });
+ clone$4.default = clone$3;
+
+ var _cloneNode$b = cloneNode$3;
+
+ function clone$3(node) {
+ return (0, _cloneNode$b.default)(node, false);
+ }
+
+ var cloneDeep$3 = {};
+
+ Object.defineProperty(cloneDeep$3, "__esModule", {
+ value: true
+ });
+ cloneDeep$3.default = cloneDeep$2;
+
+ var _cloneNode$a = cloneNode$3;
+
+ function cloneDeep$2(node) {
+ return (0, _cloneNode$a.default)(node);
+ }
+
+ var cloneDeepWithoutLoc$3 = {};
+
+ Object.defineProperty(cloneDeepWithoutLoc$3, "__esModule", {
+ value: true
+ });
+ cloneDeepWithoutLoc$3.default = cloneDeepWithoutLoc$2;
+
+ var _cloneNode$9 = cloneNode$3;
+
+ function cloneDeepWithoutLoc$2(node) {
+ return (0, _cloneNode$9.default)(node, true, true);
+ }
+
+ var cloneWithoutLoc$3 = {};
+
+ Object.defineProperty(cloneWithoutLoc$3, "__esModule", {
+ value: true
+ });
+ cloneWithoutLoc$3.default = cloneWithoutLoc$2;
+
+ var _cloneNode$8 = cloneNode$3;
+
+ function cloneWithoutLoc$2(node) {
+ return (0, _cloneNode$8.default)(node, false, true);
+ }
+
+ var addComment$3 = {};
+
+ var addComments$3 = {};
+
+ Object.defineProperty(addComments$3, "__esModule", {
+ value: true
+ });
+ addComments$3.default = addComments$2;
+
+ function addComments$2(node, type, comments) {
+ if (!comments || !node) return node;
+ const key = `${type}Comments`;
+
+ if (node[key]) {
+ if (type === "leading") {
+ node[key] = comments.concat(node[key]);
+ } else {
+ node[key].push(...comments);
+ }
+ } else {
+ node[key] = comments;
+ }
+
+ return node;
+ }
+
+ Object.defineProperty(addComment$3, "__esModule", {
+ value: true
+ });
+ addComment$3.default = addComment$2;
+
+ var _addComments$1 = addComments$3;
+
+ function addComment$2(node, type, content, line) {
+ return (0, _addComments$1.default)(node, type, [{
+ type: line ? "CommentLine" : "CommentBlock",
+ value: content
+ }]);
+ }
+
+ var inheritInnerComments$3 = {};
+
+ var inherit$3 = {};
+
+ Object.defineProperty(inherit$3, "__esModule", {
+ value: true
+ });
+ inherit$3.default = inherit$2;
+
+ function inherit$2(key, child, parent) {
+ if (child && parent) {
+ child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
+ }
+ }
+
+ Object.defineProperty(inheritInnerComments$3, "__esModule", {
+ value: true
+ });
+ inheritInnerComments$3.default = inheritInnerComments$2;
+
+ var _inherit$5 = inherit$3;
+
+ function inheritInnerComments$2(child, parent) {
+ (0, _inherit$5.default)("innerComments", child, parent);
+ }
+
+ var inheritLeadingComments$3 = {};
+
+ Object.defineProperty(inheritLeadingComments$3, "__esModule", {
+ value: true
+ });
+ inheritLeadingComments$3.default = inheritLeadingComments$2;
+
+ var _inherit$4 = inherit$3;
+
+ function inheritLeadingComments$2(child, parent) {
+ (0, _inherit$4.default)("leadingComments", child, parent);
+ }
+
+ var inheritsComments$3 = {};
+
+ var inheritTrailingComments$3 = {};
+
+ Object.defineProperty(inheritTrailingComments$3, "__esModule", {
+ value: true
+ });
+ inheritTrailingComments$3.default = inheritTrailingComments$2;
+
+ var _inherit$3 = inherit$3;
+
+ function inheritTrailingComments$2(child, parent) {
+ (0, _inherit$3.default)("trailingComments", child, parent);
+ }
+
+ Object.defineProperty(inheritsComments$3, "__esModule", {
+ value: true
+ });
+ inheritsComments$3.default = inheritsComments$2;
+
+ var _inheritTrailingComments$1 = inheritTrailingComments$3;
+
+ var _inheritLeadingComments$1 = inheritLeadingComments$3;
+
+ var _inheritInnerComments$1 = inheritInnerComments$3;
+
+ function inheritsComments$2(child, parent) {
+ (0, _inheritTrailingComments$1.default)(child, parent);
+ (0, _inheritLeadingComments$1.default)(child, parent);
+ (0, _inheritInnerComments$1.default)(child, parent);
+ return child;
+ }
+
+ var removeComments$3 = {};
+
+ Object.defineProperty(removeComments$3, "__esModule", {
+ value: true
+ });
+ removeComments$3.default = removeComments$2;
+
+ var _constants$9 = constants$1;
+
+ function removeComments$2(node) {
+ _constants$9.COMMENT_KEYS.forEach(key => {
+ node[key] = null;
+ });
+
+ return node;
+ }
+
+ var generated$5 = {};
+
+ Object.defineProperty(generated$5, "__esModule", {
+ value: true
+ });
+ generated$5.TSBASETYPE_TYPES = generated$5.TSTYPE_TYPES = generated$5.TSTYPEELEMENT_TYPES = generated$5.JSX_TYPES = generated$5.ENUMMEMBER_TYPES = generated$5.ENUMBODY_TYPES = generated$5.FLOWPREDICATE_TYPES = generated$5.FLOWDECLARATION_TYPES = generated$5.FLOWBASEANNOTATION_TYPES = generated$5.FLOWTYPE_TYPES = generated$5.FLOW_TYPES = generated$5.PRIVATE_TYPES = generated$5.MODULESPECIFIER_TYPES = generated$5.EXPORTDECLARATION_TYPES = generated$5.MODULEDECLARATION_TYPES = generated$5.CLASS_TYPES = generated$5.PATTERN_TYPES = generated$5.UNARYLIKE_TYPES = generated$5.PROPERTY_TYPES = generated$5.OBJECTMEMBER_TYPES = generated$5.METHOD_TYPES = generated$5.USERWHITESPACABLE_TYPES = generated$5.IMMUTABLE_TYPES = generated$5.LITERAL_TYPES = generated$5.TSENTITYNAME_TYPES = generated$5.LVAL_TYPES = generated$5.PATTERNLIKE_TYPES = generated$5.DECLARATION_TYPES = generated$5.PUREISH_TYPES = generated$5.FUNCTIONPARENT_TYPES = generated$5.FUNCTION_TYPES = generated$5.FORXSTATEMENT_TYPES = generated$5.FOR_TYPES = generated$5.EXPRESSIONWRAPPER_TYPES = generated$5.WHILE_TYPES = generated$5.LOOP_TYPES = generated$5.CONDITIONAL_TYPES = generated$5.COMPLETIONSTATEMENT_TYPES = generated$5.TERMINATORLESS_TYPES = generated$5.STATEMENT_TYPES = generated$5.BLOCK_TYPES = generated$5.BLOCKPARENT_TYPES = generated$5.SCOPABLE_TYPES = generated$5.BINARY_TYPES = generated$5.EXPRESSION_TYPES = void 0;
+
+ var _definitions$a = requireDefinitions$1();
+
+ const EXPRESSION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Expression"];
+ generated$5.EXPRESSION_TYPES = EXPRESSION_TYPES$1;
+ const BINARY_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Binary"];
+ generated$5.BINARY_TYPES = BINARY_TYPES$1;
+ const SCOPABLE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Scopable"];
+ generated$5.SCOPABLE_TYPES = SCOPABLE_TYPES$1;
+ const BLOCKPARENT_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["BlockParent"];
+ generated$5.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES$1;
+ const BLOCK_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Block"];
+ generated$5.BLOCK_TYPES = BLOCK_TYPES$1;
+ const STATEMENT_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Statement"];
+ generated$5.STATEMENT_TYPES = STATEMENT_TYPES$1;
+ const TERMINATORLESS_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Terminatorless"];
+ generated$5.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES$1;
+ const COMPLETIONSTATEMENT_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["CompletionStatement"];
+ generated$5.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES$1;
+ const CONDITIONAL_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Conditional"];
+ generated$5.CONDITIONAL_TYPES = CONDITIONAL_TYPES$1;
+ const LOOP_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Loop"];
+ generated$5.LOOP_TYPES = LOOP_TYPES$1;
+ const WHILE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["While"];
+ generated$5.WHILE_TYPES = WHILE_TYPES$1;
+ const EXPRESSIONWRAPPER_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
+ generated$5.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES$1;
+ const FOR_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["For"];
+ generated$5.FOR_TYPES = FOR_TYPES$1;
+ const FORXSTATEMENT_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["ForXStatement"];
+ generated$5.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES$1;
+ const FUNCTION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Function"];
+ generated$5.FUNCTION_TYPES = FUNCTION_TYPES$1;
+ const FUNCTIONPARENT_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["FunctionParent"];
+ generated$5.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES$1;
+ const PUREISH_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Pureish"];
+ generated$5.PUREISH_TYPES = PUREISH_TYPES$1;
+ const DECLARATION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Declaration"];
+ generated$5.DECLARATION_TYPES = DECLARATION_TYPES$1;
+ const PATTERNLIKE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["PatternLike"];
+ generated$5.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES$1;
+ const LVAL_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["LVal"];
+ generated$5.LVAL_TYPES = LVAL_TYPES$1;
+ const TSENTITYNAME_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["TSEntityName"];
+ generated$5.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES$1;
+ const LITERAL_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Literal"];
+ generated$5.LITERAL_TYPES = LITERAL_TYPES$1;
+ const IMMUTABLE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Immutable"];
+ generated$5.IMMUTABLE_TYPES = IMMUTABLE_TYPES$1;
+ const USERWHITESPACABLE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
+ generated$5.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES$1;
+ const METHOD_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Method"];
+ generated$5.METHOD_TYPES = METHOD_TYPES$1;
+ const OBJECTMEMBER_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["ObjectMember"];
+ generated$5.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES$1;
+ const PROPERTY_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Property"];
+ generated$5.PROPERTY_TYPES = PROPERTY_TYPES$1;
+ const UNARYLIKE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["UnaryLike"];
+ generated$5.UNARYLIKE_TYPES = UNARYLIKE_TYPES$1;
+ const PATTERN_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Pattern"];
+ generated$5.PATTERN_TYPES = PATTERN_TYPES$1;
+ const CLASS_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Class"];
+ generated$5.CLASS_TYPES = CLASS_TYPES$1;
+ const MODULEDECLARATION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
+ generated$5.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES$1;
+ const EXPORTDECLARATION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
+ generated$5.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES$1;
+ const MODULESPECIFIER_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
+ generated$5.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES$1;
+ const PRIVATE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Private"];
+ generated$5.PRIVATE_TYPES = PRIVATE_TYPES$1;
+ const FLOW_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["Flow"];
+ generated$5.FLOW_TYPES = FLOW_TYPES$1;
+ const FLOWTYPE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["FlowType"];
+ generated$5.FLOWTYPE_TYPES = FLOWTYPE_TYPES$1;
+ const FLOWBASEANNOTATION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
+ generated$5.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES$1;
+ const FLOWDECLARATION_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
+ generated$5.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES$1;
+ const FLOWPREDICATE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["FlowPredicate"];
+ generated$5.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES$1;
+ const ENUMBODY_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["EnumBody"];
+ generated$5.ENUMBODY_TYPES = ENUMBODY_TYPES$1;
+ const ENUMMEMBER_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["EnumMember"];
+ generated$5.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES$1;
+ const JSX_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["JSX"];
+ generated$5.JSX_TYPES = JSX_TYPES$1;
+ const TSTYPEELEMENT_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["TSTypeElement"];
+ generated$5.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES$1;
+ const TSTYPE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["TSType"];
+ generated$5.TSTYPE_TYPES = TSTYPE_TYPES$1;
+ const TSBASETYPE_TYPES$1 = _definitions$a.FLIPPED_ALIAS_KEYS["TSBaseType"];
+ generated$5.TSBASETYPE_TYPES = TSBASETYPE_TYPES$1;
+
+ var ensureBlock$3 = {};
+
+ var toBlock$3 = {};
+
+ Object.defineProperty(toBlock$3, "__esModule", {
+ value: true
+ });
+ toBlock$3.default = toBlock$2;
+
+ var _generated$D = generated$8;
+
+ var _generated2$7 = generated$7;
+
+ function toBlock$2(node, parent) {
+ if ((0, _generated$D.isBlockStatement)(node)) {
+ return node;
+ }
+
+ let blockNodes = [];
+
+ if ((0, _generated$D.isEmptyStatement)(node)) {
+ blockNodes = [];
+ } else {
+ if (!(0, _generated$D.isStatement)(node)) {
+ if ((0, _generated$D.isFunction)(parent)) {
+ node = (0, _generated2$7.returnStatement)(node);
+ } else {
+ node = (0, _generated2$7.expressionStatement)(node);
+ }
+ }
+
+ blockNodes = [node];
+ }
+
+ return (0, _generated2$7.blockStatement)(blockNodes);
+ }
+
+ Object.defineProperty(ensureBlock$3, "__esModule", {
+ value: true
+ });
+ ensureBlock$3.default = ensureBlock$2;
+
+ var _toBlock$1 = toBlock$3;
+
+ function ensureBlock$2(node, key = "body") {
+ return node[key] = (0, _toBlock$1.default)(node[key], node);
+ }
+
+ var toBindingIdentifierName$3 = {};
+
+ var toIdentifier$3 = {};
+
+ Object.defineProperty(toIdentifier$3, "__esModule", {
+ value: true
+ });
+ toIdentifier$3.default = toIdentifier$2;
+
+ var _isValidIdentifier$5 = isValidIdentifier$3;
+
+ var _helperValidatorIdentifier$1 = lib$5;
+
+ function toIdentifier$2(input) {
+ input = input + "";
+ let name = "";
+
+ for (const c of input) {
+ name += (0, _helperValidatorIdentifier$1.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
+ }
+
+ name = name.replace(/^[-0-9]+/, "");
+ name = name.replace(/[-\s]+(.)?/g, function (match, c) {
+ return c ? c.toUpperCase() : "";
+ });
+
+ if (!(0, _isValidIdentifier$5.default)(name)) {
+ name = `_${name}`;
+ }
+
+ return name || "_";
+ }
+
+ Object.defineProperty(toBindingIdentifierName$3, "__esModule", {
+ value: true
+ });
+ toBindingIdentifierName$3.default = toBindingIdentifierName$2;
+
+ var _toIdentifier$1 = toIdentifier$3;
+
+ function toBindingIdentifierName$2(name) {
+ name = (0, _toIdentifier$1.default)(name);
+ if (name === "eval" || name === "arguments") name = "_" + name;
+ return name;
+ }
+
+ var toComputedKey$3 = {};
+
+ Object.defineProperty(toComputedKey$3, "__esModule", {
+ value: true
+ });
+ toComputedKey$3.default = toComputedKey$2;
+
+ var _generated$C = generated$8;
+
+ var _generated2$6 = generated$7;
+
+ function toComputedKey$2(node, key = node.key || node.property) {
+ if (!node.computed && (0, _generated$C.isIdentifier)(key)) key = (0, _generated2$6.stringLiteral)(key.name);
+ return key;
+ }
+
+ var toExpression$3 = {};
+
+ Object.defineProperty(toExpression$3, "__esModule", {
+ value: true
+ });
+ toExpression$3.default = void 0;
+
+ var _generated$B = generated$8;
+
+ var _default$7 = toExpression$2;
+ toExpression$3.default = _default$7;
+
+ function toExpression$2(node) {
+ if ((0, _generated$B.isExpressionStatement)(node)) {
+ node = node.expression;
+ }
+
+ if ((0, _generated$B.isExpression)(node)) {
+ return node;
+ }
+
+ if ((0, _generated$B.isClass)(node)) {
+ node.type = "ClassExpression";
+ } else if ((0, _generated$B.isFunction)(node)) {
+ node.type = "FunctionExpression";
+ }
+
+ if (!(0, _generated$B.isExpression)(node)) {
+ throw new Error(`cannot turn ${node.type} to an expression`);
+ }
+
+ return node;
+ }
+
+ var toKeyAlias$3 = {};
+
+ var removePropertiesDeep$3 = {};
+
+ var traverseFast$3 = {};
+
+ Object.defineProperty(traverseFast$3, "__esModule", {
+ value: true
+ });
+ traverseFast$3.default = traverseFast$2;
+
+ var _definitions$9 = requireDefinitions$1();
+
+ function traverseFast$2(node, enter, opts) {
+ if (!node) return;
+ const keys = _definitions$9.VISITOR_KEYS[node.type];
+ if (!keys) return;
+ opts = opts || {};
+ enter(node, opts);
+
+ for (const key of keys) {
+ const subNode = node[key];
+
+ if (Array.isArray(subNode)) {
+ for (const node of subNode) {
+ traverseFast$2(node, enter, opts);
+ }
+ } else {
+ traverseFast$2(subNode, enter, opts);
+ }
+ }
+ }
+
+ var removeProperties$3 = {};
+
+ Object.defineProperty(removeProperties$3, "__esModule", {
+ value: true
+ });
+ removeProperties$3.default = removeProperties$2;
+
+ var _constants$8 = constants$1;
+
+ const CLEAR_KEYS$1 = ["tokens", "start", "end", "loc", "raw", "rawValue"];
+
+ const CLEAR_KEYS_PLUS_COMMENTS$1 = _constants$8.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS$1);
+
+ function removeProperties$2(node, opts = {}) {
+ const map = opts.preserveComments ? CLEAR_KEYS$1 : CLEAR_KEYS_PLUS_COMMENTS$1;
+
+ for (const key of map) {
+ if (node[key] != null) node[key] = undefined;
+ }
+
+ for (const key of Object.keys(node)) {
+ if (key[0] === "_" && node[key] != null) node[key] = undefined;
+ }
+
+ const symbols = Object.getOwnPropertySymbols(node);
+
+ for (const sym of symbols) {
+ node[sym] = null;
+ }
+ }
+
+ Object.defineProperty(removePropertiesDeep$3, "__esModule", {
+ value: true
+ });
+ removePropertiesDeep$3.default = removePropertiesDeep$2;
+
+ var _traverseFast$1 = traverseFast$3;
+
+ var _removeProperties$1 = removeProperties$3;
+
+ function removePropertiesDeep$2(tree, opts) {
+ (0, _traverseFast$1.default)(tree, _removeProperties$1.default, opts);
+ return tree;
+ }
+
+ Object.defineProperty(toKeyAlias$3, "__esModule", {
+ value: true
+ });
+ toKeyAlias$3.default = toKeyAlias$2;
+
+ var _generated$A = generated$8;
+
+ var _cloneNode$7 = cloneNode$3;
+
+ var _removePropertiesDeep$1 = removePropertiesDeep$3;
+
+ function toKeyAlias$2(node, key = node.key) {
+ let alias;
+
+ if (node.kind === "method") {
+ return toKeyAlias$2.increment() + "";
+ } else if ((0, _generated$A.isIdentifier)(key)) {
+ alias = key.name;
+ } else if ((0, _generated$A.isStringLiteral)(key)) {
+ alias = JSON.stringify(key.value);
+ } else {
+ alias = JSON.stringify((0, _removePropertiesDeep$1.default)((0, _cloneNode$7.default)(key)));
+ }
+
+ if (node.computed) {
+ alias = `[${alias}]`;
+ }
+
+ if (node.static) {
+ alias = `static:${alias}`;
+ }
+
+ return alias;
+ }
+
+ toKeyAlias$2.uid = 0;
+
+ toKeyAlias$2.increment = function () {
+ if (toKeyAlias$2.uid >= Number.MAX_SAFE_INTEGER) {
+ return toKeyAlias$2.uid = 0;
+ } else {
+ return toKeyAlias$2.uid++;
+ }
+ };
+
+ var toSequenceExpression$3 = {};
+
+ var gatherSequenceExpressions$3 = {};
+
+ var getBindingIdentifiers$3 = {};
+
+ Object.defineProperty(getBindingIdentifiers$3, "__esModule", {
+ value: true
+ });
+ getBindingIdentifiers$3.default = getBindingIdentifiers$2;
+
+ var _generated$z = generated$8;
+
+ function getBindingIdentifiers$2(node, duplicates, outerOnly) {
+ let search = [].concat(node);
+ const ids = Object.create(null);
+
+ while (search.length) {
+ const id = search.shift();
+ if (!id) continue;
+ const keys = getBindingIdentifiers$2.keys[id.type];
+
+ if ((0, _generated$z.isIdentifier)(id)) {
+ if (duplicates) {
+ const _ids = ids[id.name] = ids[id.name] || [];
+
+ _ids.push(id);
+ } else {
+ ids[id.name] = id;
+ }
+
+ continue;
+ }
+
+ if ((0, _generated$z.isExportDeclaration)(id) && !(0, _generated$z.isExportAllDeclaration)(id)) {
+ if ((0, _generated$z.isDeclaration)(id.declaration)) {
+ search.push(id.declaration);
+ }
+
+ continue;
+ }
+
+ if (outerOnly) {
+ if ((0, _generated$z.isFunctionDeclaration)(id)) {
+ search.push(id.id);
+ continue;
+ }
+
+ if ((0, _generated$z.isFunctionExpression)(id)) {
+ continue;
+ }
+ }
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+
+ if (id[key]) {
+ search = search.concat(id[key]);
+ }
+ }
+ }
+ }
+
+ return ids;
+ }
+
+ getBindingIdentifiers$2.keys = {
+ DeclareClass: ["id"],
+ DeclareFunction: ["id"],
+ DeclareModule: ["id"],
+ DeclareVariable: ["id"],
+ DeclareInterface: ["id"],
+ DeclareTypeAlias: ["id"],
+ DeclareOpaqueType: ["id"],
+ InterfaceDeclaration: ["id"],
+ TypeAlias: ["id"],
+ OpaqueType: ["id"],
+ CatchClause: ["param"],
+ LabeledStatement: ["label"],
+ UnaryExpression: ["argument"],
+ AssignmentExpression: ["left"],
+ ImportSpecifier: ["local"],
+ ImportNamespaceSpecifier: ["local"],
+ ImportDefaultSpecifier: ["local"],
+ ImportDeclaration: ["specifiers"],
+ ExportSpecifier: ["exported"],
+ ExportNamespaceSpecifier: ["exported"],
+ ExportDefaultSpecifier: ["exported"],
+ FunctionDeclaration: ["id", "params"],
+ FunctionExpression: ["id", "params"],
+ ArrowFunctionExpression: ["params"],
+ ObjectMethod: ["params"],
+ ClassMethod: ["params"],
+ ClassPrivateMethod: ["params"],
+ ForInStatement: ["left"],
+ ForOfStatement: ["left"],
+ ClassDeclaration: ["id"],
+ ClassExpression: ["id"],
+ RestElement: ["argument"],
+ UpdateExpression: ["argument"],
+ ObjectProperty: ["value"],
+ AssignmentPattern: ["left"],
+ ArrayPattern: ["elements"],
+ ObjectPattern: ["properties"],
+ VariableDeclaration: ["declarations"],
+ VariableDeclarator: ["id"]
+ };
+
+ Object.defineProperty(gatherSequenceExpressions$3, "__esModule", {
+ value: true
+ });
+ gatherSequenceExpressions$3.default = gatherSequenceExpressions$2;
+
+ var _getBindingIdentifiers$5 = getBindingIdentifiers$3;
+
+ var _generated$y = generated$8;
+
+ var _generated2$5 = generated$7;
+
+ var _cloneNode$6 = cloneNode$3;
+
+ function gatherSequenceExpressions$2(nodes, scope, declars) {
+ const exprs = [];
+ let ensureLastUndefined = true;
+
+ for (const node of nodes) {
+ if (!(0, _generated$y.isEmptyStatement)(node)) {
+ ensureLastUndefined = false;
+ }
+
+ if ((0, _generated$y.isExpression)(node)) {
+ exprs.push(node);
+ } else if ((0, _generated$y.isExpressionStatement)(node)) {
+ exprs.push(node.expression);
+ } else if ((0, _generated$y.isVariableDeclaration)(node)) {
+ if (node.kind !== "var") return;
+
+ for (const declar of node.declarations) {
+ const bindings = (0, _getBindingIdentifiers$5.default)(declar);
+
+ for (const key of Object.keys(bindings)) {
+ declars.push({
+ kind: node.kind,
+ id: (0, _cloneNode$6.default)(bindings[key])
+ });
+ }
+
+ if (declar.init) {
+ exprs.push((0, _generated2$5.assignmentExpression)("=", declar.id, declar.init));
+ }
+ }
+
+ ensureLastUndefined = true;
+ } else if ((0, _generated$y.isIfStatement)(node)) {
+ const consequent = node.consequent ? gatherSequenceExpressions$2([node.consequent], scope, declars) : scope.buildUndefinedNode();
+ const alternate = node.alternate ? gatherSequenceExpressions$2([node.alternate], scope, declars) : scope.buildUndefinedNode();
+ if (!consequent || !alternate) return;
+ exprs.push((0, _generated2$5.conditionalExpression)(node.test, consequent, alternate));
+ } else if ((0, _generated$y.isBlockStatement)(node)) {
+ const body = gatherSequenceExpressions$2(node.body, scope, declars);
+ if (!body) return;
+ exprs.push(body);
+ } else if ((0, _generated$y.isEmptyStatement)(node)) {
+ if (nodes.indexOf(node) === 0) {
+ ensureLastUndefined = true;
+ }
+ } else {
+ return;
+ }
+ }
+
+ if (ensureLastUndefined) {
+ exprs.push(scope.buildUndefinedNode());
+ }
+
+ if (exprs.length === 1) {
+ return exprs[0];
+ } else {
+ return (0, _generated2$5.sequenceExpression)(exprs);
+ }
+ }
+
+ Object.defineProperty(toSequenceExpression$3, "__esModule", {
+ value: true
+ });
+ toSequenceExpression$3.default = toSequenceExpression$2;
+
+ var _gatherSequenceExpressions$1 = gatherSequenceExpressions$3;
+
+ function toSequenceExpression$2(nodes, scope) {
+ if (!(nodes != null && nodes.length)) return;
+ const declars = [];
+ const result = (0, _gatherSequenceExpressions$1.default)(nodes, scope, declars);
+ if (!result) return;
+
+ for (const declar of declars) {
+ scope.push(declar);
+ }
+
+ return result;
+ }
+
+ var toStatement$3 = {};
+
+ Object.defineProperty(toStatement$3, "__esModule", {
+ value: true
+ });
+ toStatement$3.default = void 0;
+
+ var _generated$x = generated$8;
+
+ var _generated2$4 = generated$7;
+
+ var _default$6 = toStatement$2;
+ toStatement$3.default = _default$6;
+
+ function toStatement$2(node, ignore) {
+ if ((0, _generated$x.isStatement)(node)) {
+ return node;
+ }
+
+ let mustHaveId = false;
+ let newType;
+
+ if ((0, _generated$x.isClass)(node)) {
+ mustHaveId = true;
+ newType = "ClassDeclaration";
+ } else if ((0, _generated$x.isFunction)(node)) {
+ mustHaveId = true;
+ newType = "FunctionDeclaration";
+ } else if ((0, _generated$x.isAssignmentExpression)(node)) {
+ return (0, _generated2$4.expressionStatement)(node);
+ }
+
+ if (mustHaveId && !node.id) {
+ newType = false;
+ }
+
+ if (!newType) {
+ if (ignore) {
+ return false;
+ } else {
+ throw new Error(`cannot turn ${node.type} to a statement`);
+ }
+ }
+
+ node.type = newType;
+ return node;
+ }
+
+ var valueToNode$3 = {};
+
+ Object.defineProperty(valueToNode$3, "__esModule", {
+ value: true
+ });
+ valueToNode$3.default = void 0;
+
+ var _isValidIdentifier$4 = isValidIdentifier$3;
+
+ var _generated$w = generated$7;
+
+ var _default$5 = valueToNode$2;
+ valueToNode$3.default = _default$5;
+ const objectToString$2 = Function.call.bind(Object.prototype.toString);
+
+ function isRegExp$1(value) {
+ return objectToString$2(value) === "[object RegExp]";
+ }
+
+ function isPlainObject$1(value) {
+ if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
+ return false;
+ }
+
+ const proto = Object.getPrototypeOf(value);
+ return proto === null || Object.getPrototypeOf(proto) === null;
+ }
+
+ function valueToNode$2(value) {
+ if (value === undefined) {
+ return (0, _generated$w.identifier)("undefined");
+ }
+
+ if (value === true || value === false) {
+ return (0, _generated$w.booleanLiteral)(value);
+ }
+
+ if (value === null) {
+ return (0, _generated$w.nullLiteral)();
+ }
+
+ if (typeof value === "string") {
+ return (0, _generated$w.stringLiteral)(value);
+ }
+
+ if (typeof value === "number") {
+ let result;
+
+ if (Number.isFinite(value)) {
+ result = (0, _generated$w.numericLiteral)(Math.abs(value));
+ } else {
+ let numerator;
+
+ if (Number.isNaN(value)) {
+ numerator = (0, _generated$w.numericLiteral)(0);
+ } else {
+ numerator = (0, _generated$w.numericLiteral)(1);
+ }
+
+ result = (0, _generated$w.binaryExpression)("/", numerator, (0, _generated$w.numericLiteral)(0));
+ }
+
+ if (value < 0 || Object.is(value, -0)) {
+ result = (0, _generated$w.unaryExpression)("-", result);
+ }
+
+ return result;
+ }
+
+ if (isRegExp$1(value)) {
+ const pattern = value.source;
+ const flags = value.toString().match(/\/([a-z]+|)$/)[1];
+ return (0, _generated$w.regExpLiteral)(pattern, flags);
+ }
+
+ if (Array.isArray(value)) {
+ return (0, _generated$w.arrayExpression)(value.map(valueToNode$2));
+ }
+
+ if (isPlainObject$1(value)) {
+ const props = [];
+
+ for (const key of Object.keys(value)) {
+ let nodeKey;
+
+ if ((0, _isValidIdentifier$4.default)(key)) {
+ nodeKey = (0, _generated$w.identifier)(key);
+ } else {
+ nodeKey = (0, _generated$w.stringLiteral)(key);
+ }
+
+ props.push((0, _generated$w.objectProperty)(nodeKey, valueToNode$2(value[key])));
+ }
+
+ return (0, _generated$w.objectExpression)(props);
+ }
+
+ throw new Error("don't know how to turn this value into a node");
+ }
+
+ var appendToMemberExpression$3 = {};
+
+ Object.defineProperty(appendToMemberExpression$3, "__esModule", {
+ value: true
+ });
+ appendToMemberExpression$3.default = appendToMemberExpression$2;
+
+ var _generated$v = generated$7;
+
+ function appendToMemberExpression$2(member, append, computed = false) {
+ member.object = (0, _generated$v.memberExpression)(member.object, member.property, member.computed);
+ member.property = append;
+ member.computed = !!computed;
+ return member;
+ }
+
+ var inherits$3 = {};
+
+ Object.defineProperty(inherits$3, "__esModule", {
+ value: true
+ });
+ inherits$3.default = inherits$2;
+
+ var _constants$7 = constants$1;
+
+ var _inheritsComments$1 = inheritsComments$3;
+
+ function inherits$2(child, parent) {
+ if (!child || !parent) return child;
+
+ for (const key of _constants$7.INHERIT_KEYS.optional) {
+ if (child[key] == null) {
+ child[key] = parent[key];
+ }
+ }
+
+ for (const key of Object.keys(parent)) {
+ if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
+ }
+
+ for (const key of _constants$7.INHERIT_KEYS.force) {
+ child[key] = parent[key];
+ }
+
+ (0, _inheritsComments$1.default)(child, parent);
+ return child;
+ }
+
+ var prependToMemberExpression$3 = {};
+
+ Object.defineProperty(prependToMemberExpression$3, "__esModule", {
+ value: true
+ });
+ prependToMemberExpression$3.default = prependToMemberExpression$2;
+
+ var _generated$u = generated$7;
+
+ function prependToMemberExpression$2(member, prepend) {
+ member.object = (0, _generated$u.memberExpression)(prepend, member.object);
+ return member;
+ }
+
+ var getOuterBindingIdentifiers$3 = {};
+
+ Object.defineProperty(getOuterBindingIdentifiers$3, "__esModule", {
+ value: true
+ });
+ getOuterBindingIdentifiers$3.default = void 0;
+
+ var _getBindingIdentifiers$4 = getBindingIdentifiers$3;
+
+ var _default$4 = getOuterBindingIdentifiers$2;
+ getOuterBindingIdentifiers$3.default = _default$4;
+
+ function getOuterBindingIdentifiers$2(node, duplicates) {
+ return (0, _getBindingIdentifiers$4.default)(node, duplicates, true);
+ }
+
+ var traverse$3 = {};
+
+ Object.defineProperty(traverse$3, "__esModule", {
+ value: true
+ });
+ traverse$3.default = traverse$2;
+
+ var _definitions$8 = requireDefinitions$1();
+
+ function traverse$2(node, handlers, state) {
+ if (typeof handlers === "function") {
+ handlers = {
+ enter: handlers
+ };
+ }
+
+ const {
+ enter,
+ exit
+ } = handlers;
+ traverseSimpleImpl$1(node, enter, exit, state, []);
+ }
+
+ function traverseSimpleImpl$1(node, enter, exit, state, ancestors) {
+ const keys = _definitions$8.VISITOR_KEYS[node.type];
+ if (!keys) return;
+ if (enter) enter(node, ancestors, state);
+
+ for (const key of keys) {
+ const subNode = node[key];
+
+ if (Array.isArray(subNode)) {
+ for (let i = 0; i < subNode.length; i++) {
+ const child = subNode[i];
+ if (!child) continue;
+ ancestors.push({
+ node,
+ key,
+ index: i
+ });
+ traverseSimpleImpl$1(child, enter, exit, state, ancestors);
+ ancestors.pop();
+ }
+ } else if (subNode) {
+ ancestors.push({
+ node,
+ key
+ });
+ traverseSimpleImpl$1(subNode, enter, exit, state, ancestors);
+ ancestors.pop();
+ }
+ }
+
+ if (exit) exit(node, ancestors, state);
+ }
+
+ var isBinding$3 = {};
+
+ Object.defineProperty(isBinding$3, "__esModule", {
+ value: true
+ });
+ isBinding$3.default = isBinding$2;
+
+ var _getBindingIdentifiers$3 = getBindingIdentifiers$3;
+
+ function isBinding$2(node, parent, grandparent) {
+ if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
+ return false;
+ }
+
+ const keys = _getBindingIdentifiers$3.default.keys[parent.type];
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+ const val = parent[key];
+
+ if (Array.isArray(val)) {
+ if (val.indexOf(node) >= 0) return true;
+ } else {
+ if (val === node) return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ var isBlockScoped$3 = {};
+
+ var isLet$3 = {};
+
+ Object.defineProperty(isLet$3, "__esModule", {
+ value: true
+ });
+ isLet$3.default = isLet$2;
+
+ var _generated$t = generated$8;
+
+ var _constants$6 = constants$1;
+
+ function isLet$2(node) {
+ return (0, _generated$t.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants$6.BLOCK_SCOPED_SYMBOL]);
+ }
+
+ Object.defineProperty(isBlockScoped$3, "__esModule", {
+ value: true
+ });
+ isBlockScoped$3.default = isBlockScoped$2;
+
+ var _generated$s = generated$8;
+
+ var _isLet$1 = isLet$3;
+
+ function isBlockScoped$2(node) {
+ return (0, _generated$s.isFunctionDeclaration)(node) || (0, _generated$s.isClassDeclaration)(node) || (0, _isLet$1.default)(node);
+ }
+
+ var isImmutable$4 = {};
+
+ Object.defineProperty(isImmutable$4, "__esModule", {
+ value: true
+ });
+ isImmutable$4.default = isImmutable$3;
+
+ var _isType$1 = requireIsType$1();
+
+ var _generated$r = generated$8;
+
+ function isImmutable$3(node) {
+ if ((0, _isType$1.default)(node.type, "Immutable")) return true;
+
+ if ((0, _generated$r.isIdentifier)(node)) {
+ if (node.name === "undefined") {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+ var isNodesEquivalent$3 = {};
+
+ Object.defineProperty(isNodesEquivalent$3, "__esModule", {
+ value: true
+ });
+ isNodesEquivalent$3.default = isNodesEquivalent$2;
+
+ var _definitions$7 = requireDefinitions$1();
+
+ function isNodesEquivalent$2(a, b) {
+ if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
+ return a === b;
+ }
+
+ if (a.type !== b.type) {
+ return false;
+ }
+
+ const fields = Object.keys(_definitions$7.NODE_FIELDS[a.type] || a.type);
+ const visitorKeys = _definitions$7.VISITOR_KEYS[a.type];
+
+ for (const field of fields) {
+ if (typeof a[field] !== typeof b[field]) {
+ return false;
+ }
+
+ if (a[field] == null && b[field] == null) {
+ continue;
+ } else if (a[field] == null || b[field] == null) {
+ return false;
+ }
+
+ if (Array.isArray(a[field])) {
+ if (!Array.isArray(b[field])) {
+ return false;
+ }
+
+ if (a[field].length !== b[field].length) {
+ return false;
+ }
+
+ for (let i = 0; i < a[field].length; i++) {
+ if (!isNodesEquivalent$2(a[field][i], b[field][i])) {
+ return false;
+ }
+ }
+
+ continue;
+ }
+
+ if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
+ for (const key of Object.keys(a[field])) {
+ if (a[field][key] !== b[field][key]) {
+ return false;
+ }
+ }
+
+ continue;
+ }
+
+ if (!isNodesEquivalent$2(a[field], b[field])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ var isReferenced$3 = {};
+
+ Object.defineProperty(isReferenced$3, "__esModule", {
+ value: true
+ });
+ isReferenced$3.default = isReferenced$2;
+
+ function isReferenced$2(node, parent, grandparent) {
+ switch (parent.type) {
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ if (parent.property === node) {
+ return !!parent.computed;
+ }
+
+ return parent.object === node;
+
+ case "JSXMemberExpression":
+ return parent.object === node;
+
+ case "VariableDeclarator":
+ return parent.init === node;
+
+ case "ArrowFunctionExpression":
+ return parent.body === node;
+
+ case "PrivateName":
+ return false;
+
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ case "ObjectMethod":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return false;
+
+ case "ObjectProperty":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return !grandparent || grandparent.type !== "ObjectPattern";
+
+ case "ClassProperty":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return true;
+
+ case "ClassPrivateProperty":
+ return parent.key !== node;
+
+ case "ClassDeclaration":
+ case "ClassExpression":
+ return parent.superClass === node;
+
+ case "AssignmentExpression":
+ return parent.right === node;
+
+ case "AssignmentPattern":
+ return parent.right === node;
+
+ case "LabeledStatement":
+ return false;
+
+ case "CatchClause":
+ return false;
+
+ case "RestElement":
+ return false;
+
+ case "BreakStatement":
+ case "ContinueStatement":
+ return false;
+
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ return false;
+
+ case "ExportNamespaceSpecifier":
+ case "ExportDefaultSpecifier":
+ return false;
+
+ case "ExportSpecifier":
+ if (grandparent != null && grandparent.source) {
+ return false;
+ }
+
+ return parent.local === node;
+
+ case "ImportDefaultSpecifier":
+ case "ImportNamespaceSpecifier":
+ case "ImportSpecifier":
+ return false;
+
+ case "ImportAttribute":
+ return false;
+
+ case "JSXAttribute":
+ return false;
+
+ case "ObjectPattern":
+ case "ArrayPattern":
+ return false;
+
+ case "MetaProperty":
+ return false;
+
+ case "ObjectTypeProperty":
+ return parent.key !== node;
+
+ case "TSEnumMember":
+ return parent.id !== node;
+
+ case "TSPropertySignature":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return true;
+ }
+
+ return true;
+ }
+
+ var isScope$3 = {};
+
+ Object.defineProperty(isScope$3, "__esModule", {
+ value: true
+ });
+ isScope$3.default = isScope$2;
+
+ var _generated$q = generated$8;
+
+ function isScope$2(node, parent) {
+ if ((0, _generated$q.isBlockStatement)(node) && ((0, _generated$q.isFunction)(parent) || (0, _generated$q.isCatchClause)(parent))) {
+ return false;
+ }
+
+ if ((0, _generated$q.isPattern)(node) && ((0, _generated$q.isFunction)(parent) || (0, _generated$q.isCatchClause)(parent))) {
+ return true;
+ }
+
+ return (0, _generated$q.isScopable)(node);
+ }
+
+ var isSpecifierDefault$3 = {};
+
+ Object.defineProperty(isSpecifierDefault$3, "__esModule", {
+ value: true
+ });
+ isSpecifierDefault$3.default = isSpecifierDefault$2;
+
+ var _generated$p = generated$8;
+
+ function isSpecifierDefault$2(specifier) {
+ return (0, _generated$p.isImportDefaultSpecifier)(specifier) || (0, _generated$p.isIdentifier)(specifier.imported || specifier.exported, {
+ name: "default"
+ });
+ }
+
+ var isValidES3Identifier$3 = {};
+
+ Object.defineProperty(isValidES3Identifier$3, "__esModule", {
+ value: true
+ });
+ isValidES3Identifier$3.default = isValidES3Identifier$2;
+
+ var _isValidIdentifier$3 = isValidIdentifier$3;
+
+ const RESERVED_WORDS_ES3_ONLY$1 = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
+
+ function isValidES3Identifier$2(name) {
+ return (0, _isValidIdentifier$3.default)(name) && !RESERVED_WORDS_ES3_ONLY$1.has(name);
+ }
+
+ var isVar$3 = {};
+
+ Object.defineProperty(isVar$3, "__esModule", {
+ value: true
+ });
+ isVar$3.default = isVar$2;
+
+ var _generated$o = generated$8;
+
+ var _constants$5 = constants$1;
+
+ function isVar$2(node) {
+ return (0, _generated$o.isVariableDeclaration)(node, {
+ kind: "var"
+ }) && !node[_constants$5.BLOCK_SCOPED_SYMBOL];
+ }
+
+ var generated$4 = {};
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ var _exportNames = {
+ react: true,
+ assertNode: true,
+ createTypeAnnotationBasedOnTypeof: true,
+ createUnionTypeAnnotation: true,
+ createFlowUnionType: true,
+ createTSUnionType: true,
+ cloneNode: true,
+ clone: true,
+ cloneDeep: true,
+ cloneDeepWithoutLoc: true,
+ cloneWithoutLoc: true,
+ addComment: true,
+ addComments: true,
+ inheritInnerComments: true,
+ inheritLeadingComments: true,
+ inheritsComments: true,
+ inheritTrailingComments: true,
+ removeComments: true,
+ ensureBlock: true,
+ toBindingIdentifierName: true,
+ toBlock: true,
+ toComputedKey: true,
+ toExpression: true,
+ toIdentifier: true,
+ toKeyAlias: true,
+ toSequenceExpression: true,
+ toStatement: true,
+ valueToNode: true,
+ appendToMemberExpression: true,
+ inherits: true,
+ prependToMemberExpression: true,
+ removeProperties: true,
+ removePropertiesDeep: true,
+ removeTypeDuplicates: true,
+ getBindingIdentifiers: true,
+ getOuterBindingIdentifiers: true,
+ traverse: true,
+ traverseFast: true,
+ shallowEqual: true,
+ is: true,
+ isBinding: true,
+ isBlockScoped: true,
+ isImmutable: true,
+ isLet: true,
+ isNode: true,
+ isNodesEquivalent: true,
+ isPlaceholderType: true,
+ isReferenced: true,
+ isScope: true,
+ isSpecifierDefault: true,
+ isType: true,
+ isValidES3Identifier: true,
+ isValidIdentifier: true,
+ isVar: true,
+ matchesPattern: true,
+ validate: true,
+ buildMatchMemberExpression: true
+ };
+ Object.defineProperty(exports, "assertNode", {
+ enumerable: true,
+ get: function () {
+ return _assertNode.default;
+ }
+ });
+ Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
+ enumerable: true,
+ get: function () {
+ return _createTypeAnnotationBasedOnTypeof.default;
+ }
+ });
+ Object.defineProperty(exports, "createUnionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+ });
+ Object.defineProperty(exports, "createFlowUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+ });
+ Object.defineProperty(exports, "createTSUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createTSUnionType.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneNode", {
+ enumerable: true,
+ get: function () {
+ return _cloneNode.default;
+ }
+ });
+ Object.defineProperty(exports, "clone", {
+ enumerable: true,
+ get: function () {
+ return _clone.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneDeep", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeep.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneDeepWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeepWithoutLoc.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneWithoutLoc.default;
+ }
+ });
+ Object.defineProperty(exports, "addComment", {
+ enumerable: true,
+ get: function () {
+ return _addComment.default;
+ }
+ });
+ Object.defineProperty(exports, "addComments", {
+ enumerable: true,
+ get: function () {
+ return _addComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritInnerComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritInnerComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritLeadingComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritLeadingComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritsComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritsComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritTrailingComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritTrailingComments.default;
+ }
+ });
+ Object.defineProperty(exports, "removeComments", {
+ enumerable: true,
+ get: function () {
+ return _removeComments.default;
+ }
+ });
+ Object.defineProperty(exports, "ensureBlock", {
+ enumerable: true,
+ get: function () {
+ return _ensureBlock.default;
+ }
+ });
+ Object.defineProperty(exports, "toBindingIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _toBindingIdentifierName.default;
+ }
+ });
+ Object.defineProperty(exports, "toBlock", {
+ enumerable: true,
+ get: function () {
+ return _toBlock.default;
+ }
+ });
+ Object.defineProperty(exports, "toComputedKey", {
+ enumerable: true,
+ get: function () {
+ return _toComputedKey.default;
+ }
+ });
+ Object.defineProperty(exports, "toExpression", {
+ enumerable: true,
+ get: function () {
+ return _toExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "toIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _toIdentifier.default;
+ }
+ });
+ Object.defineProperty(exports, "toKeyAlias", {
+ enumerable: true,
+ get: function () {
+ return _toKeyAlias.default;
+ }
+ });
+ Object.defineProperty(exports, "toSequenceExpression", {
+ enumerable: true,
+ get: function () {
+ return _toSequenceExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "toStatement", {
+ enumerable: true,
+ get: function () {
+ return _toStatement.default;
+ }
+ });
+ Object.defineProperty(exports, "valueToNode", {
+ enumerable: true,
+ get: function () {
+ return _valueToNode.default;
+ }
+ });
+ Object.defineProperty(exports, "appendToMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _appendToMemberExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "inherits", {
+ enumerable: true,
+ get: function () {
+ return _inherits.default;
+ }
+ });
+ Object.defineProperty(exports, "prependToMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _prependToMemberExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "removeProperties", {
+ enumerable: true,
+ get: function () {
+ return _removeProperties.default;
+ }
+ });
+ Object.defineProperty(exports, "removePropertiesDeep", {
+ enumerable: true,
+ get: function () {
+ return _removePropertiesDeep.default;
+ }
+ });
+ Object.defineProperty(exports, "removeTypeDuplicates", {
+ enumerable: true,
+ get: function () {
+ return _removeTypeDuplicates.default;
+ }
+ });
+ Object.defineProperty(exports, "getBindingIdentifiers", {
+ enumerable: true,
+ get: function () {
+ return _getBindingIdentifiers.default;
+ }
+ });
+ Object.defineProperty(exports, "getOuterBindingIdentifiers", {
+ enumerable: true,
+ get: function () {
+ return _getOuterBindingIdentifiers.default;
+ }
+ });
+ Object.defineProperty(exports, "traverse", {
+ enumerable: true,
+ get: function () {
+ return _traverse.default;
+ }
+ });
+ Object.defineProperty(exports, "traverseFast", {
+ enumerable: true,
+ get: function () {
+ return _traverseFast.default;
+ }
+ });
+ Object.defineProperty(exports, "shallowEqual", {
+ enumerable: true,
+ get: function () {
+ return _shallowEqual.default;
+ }
+ });
+ Object.defineProperty(exports, "is", {
+ enumerable: true,
+ get: function () {
+ return _is.default;
+ }
+ });
+ Object.defineProperty(exports, "isBinding", {
+ enumerable: true,
+ get: function () {
+ return _isBinding.default;
+ }
+ });
+ Object.defineProperty(exports, "isBlockScoped", {
+ enumerable: true,
+ get: function () {
+ return _isBlockScoped.default;
+ }
+ });
+ Object.defineProperty(exports, "isImmutable", {
+ enumerable: true,
+ get: function () {
+ return _isImmutable.default;
+ }
+ });
+ Object.defineProperty(exports, "isLet", {
+ enumerable: true,
+ get: function () {
+ return _isLet.default;
+ }
+ });
+ Object.defineProperty(exports, "isNode", {
+ enumerable: true,
+ get: function () {
+ return _isNode.default;
+ }
+ });
+ Object.defineProperty(exports, "isNodesEquivalent", {
+ enumerable: true,
+ get: function () {
+ return _isNodesEquivalent.default;
+ }
+ });
+ Object.defineProperty(exports, "isPlaceholderType", {
+ enumerable: true,
+ get: function () {
+ return _isPlaceholderType.default;
+ }
+ });
+ Object.defineProperty(exports, "isReferenced", {
+ enumerable: true,
+ get: function () {
+ return _isReferenced.default;
+ }
+ });
+ Object.defineProperty(exports, "isScope", {
+ enumerable: true,
+ get: function () {
+ return _isScope.default;
+ }
+ });
+ Object.defineProperty(exports, "isSpecifierDefault", {
+ enumerable: true,
+ get: function () {
+ return _isSpecifierDefault.default;
+ }
+ });
+ Object.defineProperty(exports, "isType", {
+ enumerable: true,
+ get: function () {
+ return _isType.default;
+ }
+ });
+ Object.defineProperty(exports, "isValidES3Identifier", {
+ enumerable: true,
+ get: function () {
+ return _isValidES3Identifier.default;
+ }
+ });
+ Object.defineProperty(exports, "isValidIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _isValidIdentifier.default;
+ }
+ });
+ Object.defineProperty(exports, "isVar", {
+ enumerable: true,
+ get: function () {
+ return _isVar.default;
+ }
+ });
+ Object.defineProperty(exports, "matchesPattern", {
+ enumerable: true,
+ get: function () {
+ return _matchesPattern.default;
+ }
+ });
+ Object.defineProperty(exports, "validate", {
+ enumerable: true,
+ get: function () {
+ return _validate.default;
+ }
+ });
+ Object.defineProperty(exports, "buildMatchMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _buildMatchMemberExpression.default;
+ }
+ });
+ exports.react = void 0;
+
+ var _isReactComponent = isReactComponent$4;
+
+ var _isCompatTag = isCompatTag$3;
+
+ var _buildChildren = buildChildren$3;
+
+ var _assertNode = assertNode$3;
+
+ var _generated = generated$6;
+
+ Object.keys(_generated).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated[key];
+ }
+ });
+ });
+
+ var _createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof$3;
+
+ var _createFlowUnionType = createFlowUnionType$3;
+
+ var _createTSUnionType = createTSUnionType$3;
+
+ var _generated2 = generated$7;
+
+ Object.keys(_generated2).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated2[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated2[key];
+ }
+ });
+ });
+
+ var _uppercase = uppercase;
+
+ Object.keys(_uppercase).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _uppercase[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _uppercase[key];
+ }
+ });
+ });
+
+ var _cloneNode = cloneNode$3;
+
+ var _clone = clone$4;
+
+ var _cloneDeep = cloneDeep$3;
+
+ var _cloneDeepWithoutLoc = cloneDeepWithoutLoc$3;
+
+ var _cloneWithoutLoc = cloneWithoutLoc$3;
+
+ var _addComment = addComment$3;
+
+ var _addComments = addComments$3;
+
+ var _inheritInnerComments = inheritInnerComments$3;
+
+ var _inheritLeadingComments = inheritLeadingComments$3;
+
+ var _inheritsComments = inheritsComments$3;
+
+ var _inheritTrailingComments = inheritTrailingComments$3;
+
+ var _removeComments = removeComments$3;
+
+ var _generated3 = generated$5;
+
+ Object.keys(_generated3).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated3[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated3[key];
+ }
+ });
+ });
+
+ var _constants = constants$1;
+
+ Object.keys(_constants).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _constants[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _constants[key];
+ }
+ });
+ });
+
+ var _ensureBlock = ensureBlock$3;
+
+ var _toBindingIdentifierName = toBindingIdentifierName$3;
+
+ var _toBlock = toBlock$3;
+
+ var _toComputedKey = toComputedKey$3;
+
+ var _toExpression = toExpression$3;
+
+ var _toIdentifier = toIdentifier$3;
+
+ var _toKeyAlias = toKeyAlias$3;
+
+ var _toSequenceExpression = toSequenceExpression$3;
+
+ var _toStatement = toStatement$3;
+
+ var _valueToNode = valueToNode$3;
+
+ var _definitions = requireDefinitions$1();
+
+ Object.keys(_definitions).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _definitions[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _definitions[key];
+ }
+ });
+ });
+
+ var _appendToMemberExpression = appendToMemberExpression$3;
+
+ var _inherits = inherits$3;
+
+ var _prependToMemberExpression = prependToMemberExpression$3;
+
+ var _removeProperties = removeProperties$3;
+
+ var _removePropertiesDeep = removePropertiesDeep$3;
+
+ var _removeTypeDuplicates = removeTypeDuplicates$7;
+
+ var _getBindingIdentifiers = getBindingIdentifiers$3;
+
+ var _getOuterBindingIdentifiers = getOuterBindingIdentifiers$3;
+
+ var _traverse = traverse$3;
+
+ Object.keys(_traverse).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _traverse[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _traverse[key];
+ }
+ });
+ });
+
+ var _traverseFast = traverseFast$3;
+
+ var _shallowEqual = shallowEqual$3;
+
+ var _is = requireIs$1();
+
+ var _isBinding = isBinding$3;
+
+ var _isBlockScoped = isBlockScoped$3;
+
+ var _isImmutable = isImmutable$4;
+
+ var _isLet = isLet$3;
+
+ var _isNode = isNode$4;
+
+ var _isNodesEquivalent = isNodesEquivalent$3;
+
+ var _isPlaceholderType = requireIsPlaceholderType$1();
+
+ var _isReferenced = isReferenced$3;
+
+ var _isScope = isScope$3;
+
+ var _isSpecifierDefault = isSpecifierDefault$3;
+
+ var _isType = requireIsType$1();
+
+ var _isValidES3Identifier = isValidES3Identifier$3;
+
+ var _isValidIdentifier = isValidIdentifier$3;
+
+ var _isVar = isVar$3;
+
+ var _matchesPattern = matchesPattern$3;
+
+ var _validate = requireValidate$1();
+
+ var _buildMatchMemberExpression = buildMatchMemberExpression$3;
+
+ var _generated4 = generated$8;
+
+ Object.keys(_generated4).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated4[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated4[key];
+ }
+ });
+ });
+
+ var _generated5 = generated$4;
+
+ Object.keys(_generated5).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated5[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated5[key];
+ }
+ });
+ });
+ const react = {
+ isReactComponent: _isReactComponent.default,
+ isCompatTag: _isCompatTag.default,
+ buildChildren: _buildChildren.default
+ };
+ exports.react = react;
+ } (lib$6));
+
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+ function createSimplePath(ancestors) {
+ if (ancestors.length === 0) {
+ return null;
+ }
+
+ // Slice the array because babel-types traverse may continue mutating
+ // the ancestors array in later traversal logic.
+ return new SimplePath(ancestors.slice());
+ }
+
+ /**
+ * Mimics @babel/traverse's NodePath API in a simpler fashion that isn't as
+ * heavy, but still allows the ease of passing paths around to process nested
+ * AST structures.
+ */
+ class SimplePath {
+ _index;
+ _ancestors;
+ _ancestor;
+
+ _parentPath;
+
+ constructor(ancestors, index = ancestors.length - 1) {
+ if (index < 0 || index >= ancestors.length) {
+ console.error(ancestors);
+ throw new Error("Created invalid path");
+ }
+
+ this._ancestors = ancestors;
+ this._ancestor = ancestors[index];
+ this._index = index;
+ }
+
+ get parentPath() {
+ let path = this._parentPath;
+ if (path === undefined) {
+ if (this._index === 0) {
+ path = null;
+ } else {
+ path = new SimplePath(this._ancestors, this._index - 1);
+ }
+ this._parentPath = path;
+ }
+
+ return path;
+ }
+
+ get parent() {
+ return this._ancestor.node;
+ }
+
+ get node() {
+ const { node, key, index } = this._ancestor;
+
+ if (typeof index === "number") {
+ return node[key][index];
+ }
+
+ return node[key];
+ }
+
+ get key() {
+ return this._ancestor.key;
+ }
+
+ set node(replacement) {
+ if (this.type !== "Identifier") {
+ throw new Error(
+ "Replacing anything other than leaf nodes is undefined behavior " +
+ "in t.traverse()"
+ );
+ }
+
+ const { node, key, index } = this._ancestor;
+ if (typeof index === "number") {
+ node[key][index] = replacement;
+ } else {
+ node[key] = replacement;
+ }
+ }
+
+ get type() {
+ return this.node.type;
+ }
+
+ get inList() {
+ return typeof this._ancestor.index === "number";
+ }
+
+ get containerIndex() {
+ const { index } = this._ancestor;
+
+ if (typeof index !== "number") {
+ throw new Error("Cannot get index of non-array node");
+ }
+
+ return index;
+ }
+
+ get depth() {
+ return this._index;
+ }
+
+ replace(node) {
+ this.node = node;
+ }
+
+ find(predicate) {
+ for (let path = this; path; path = path.parentPath) {
+ if (predicate(path)) {
+ return path;
+ }
+ }
+ return null;
+ }
+
+ findParent(predicate) {
+ if (!this.parentPath) {
+ throw new Error("Cannot use findParent on root path");
+ }
+
+ return this.parentPath.find(predicate);
+ }
+
+ getSibling(offset) {
+ const { node, key, index } = this._ancestor;
+
+ if (typeof index !== "number") {
+ throw new Error("Non-array nodes do not have siblings");
+ }
+
+ const container = node[key];
+
+ const siblingIndex = index + offset;
+ if (siblingIndex < 0 || siblingIndex >= container.length) {
+ return null;
+ }
+
+ return new SimplePath(
+ this._ancestors.slice(0, -1).concat([{ node, key, index: siblingIndex }])
+ );
+ }
+ }
+
+ var dist = {};
+
+ var lib$4 = {};
+
+ var isReactComponent$2 = {};
+
+ var buildMatchMemberExpression$1 = {};
+
+ var matchesPattern$1 = {};
+
+ var generated$3 = {};
+
+ var shallowEqual$1 = {};
+
+ Object.defineProperty(shallowEqual$1, "__esModule", {
+ value: true
+ });
+ shallowEqual$1.default = shallowEqual;
+
+ function shallowEqual(actual, expected) {
+ const keys = Object.keys(expected);
+
+ for (const key of keys) {
+ if (actual[key] !== expected[key]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ Object.defineProperty(generated$3, "__esModule", {
+ value: true
+ });
+ generated$3.isArrayExpression = isArrayExpression$1;
+ generated$3.isAssignmentExpression = isAssignmentExpression$2;
+ generated$3.isBinaryExpression = isBinaryExpression$1;
+ generated$3.isInterpreterDirective = isInterpreterDirective;
+ generated$3.isDirective = isDirective;
+ generated$3.isDirectiveLiteral = isDirectiveLiteral;
+ generated$3.isBlockStatement = isBlockStatement$1;
+ generated$3.isBreakStatement = isBreakStatement;
+ generated$3.isCallExpression = isCallExpression$4;
+ generated$3.isCatchClause = isCatchClause;
+ generated$3.isConditionalExpression = isConditionalExpression$1;
+ generated$3.isContinueStatement = isContinueStatement;
+ generated$3.isDebuggerStatement = isDebuggerStatement;
+ generated$3.isDoWhileStatement = isDoWhileStatement;
+ generated$3.isEmptyStatement = isEmptyStatement$1;
+ generated$3.isExpressionStatement = isExpressionStatement$2;
+ generated$3.isFile = isFile$1;
+ generated$3.isForInStatement = isForInStatement$1;
+ generated$3.isForStatement = isForStatement$2;
+ generated$3.isFunctionDeclaration = isFunctionDeclaration;
+ generated$3.isFunctionExpression = isFunctionExpression;
+ generated$3.isIdentifier = isIdentifier$3;
+ generated$3.isIfStatement = isIfStatement$2;
+ generated$3.isLabeledStatement = isLabeledStatement;
+ generated$3.isStringLiteral = isStringLiteral$1;
+ generated$3.isNumericLiteral = isNumericLiteral;
+ generated$3.isNullLiteral = isNullLiteral;
+ generated$3.isBooleanLiteral = isBooleanLiteral;
+ generated$3.isRegExpLiteral = isRegExpLiteral;
+ generated$3.isLogicalExpression = isLogicalExpression$1;
+ generated$3.isMemberExpression = isMemberExpression$4;
+ generated$3.isNewExpression = isNewExpression$3;
+ generated$3.isProgram = isProgram$1;
+ generated$3.isObjectExpression = isObjectExpression$1;
+ generated$3.isObjectMethod = isObjectMethod;
+ generated$3.isObjectProperty = isObjectProperty;
+ generated$3.isRestElement = isRestElement;
+ generated$3.isReturnStatement = isReturnStatement$1;
+ generated$3.isSequenceExpression = isSequenceExpression$1;
+ generated$3.isParenthesizedExpression = isParenthesizedExpression;
+ generated$3.isSwitchCase = isSwitchCase;
+ generated$3.isSwitchStatement = isSwitchStatement$1;
+ generated$3.isThisExpression = isThisExpression;
+ generated$3.isThrowStatement = isThrowStatement$1;
+ generated$3.isTryStatement = isTryStatement;
+ generated$3.isUnaryExpression = isUnaryExpression;
+ generated$3.isUpdateExpression = isUpdateExpression;
+ generated$3.isVariableDeclaration = isVariableDeclaration;
+ generated$3.isVariableDeclarator = isVariableDeclarator$1;
+ generated$3.isWhileStatement = isWhileStatement$1;
+ generated$3.isWithStatement = isWithStatement;
+ generated$3.isAssignmentPattern = isAssignmentPattern$1;
+ generated$3.isArrayPattern = isArrayPattern;
+ generated$3.isArrowFunctionExpression = isArrowFunctionExpression$1;
+ generated$3.isClassBody = isClassBody;
+ generated$3.isClassExpression = isClassExpression$1;
+ generated$3.isClassDeclaration = isClassDeclaration$2;
+ generated$3.isExportAllDeclaration = isExportAllDeclaration;
+ generated$3.isExportDefaultDeclaration = isExportDefaultDeclaration$2;
+ generated$3.isExportNamedDeclaration = isExportNamedDeclaration$1;
+ generated$3.isExportSpecifier = isExportSpecifier;
+ generated$3.isForOfStatement = isForOfStatement$1;
+ generated$3.isImportDeclaration = isImportDeclaration;
+ generated$3.isImportDefaultSpecifier = isImportDefaultSpecifier$1;
+ generated$3.isImportNamespaceSpecifier = isImportNamespaceSpecifier$1;
+ generated$3.isImportSpecifier = isImportSpecifier;
+ generated$3.isMetaProperty = isMetaProperty;
+ generated$3.isClassMethod = isClassMethod;
+ generated$3.isObjectPattern = isObjectPattern$1;
+ generated$3.isSpreadElement = isSpreadElement;
+ generated$3.isSuper = isSuper;
+ generated$3.isTaggedTemplateExpression = isTaggedTemplateExpression$1;
+ generated$3.isTemplateElement = isTemplateElement;
+ generated$3.isTemplateLiteral = isTemplateLiteral;
+ generated$3.isYieldExpression = isYieldExpression$1;
+ generated$3.isAnyTypeAnnotation = isAnyTypeAnnotation;
+ generated$3.isArrayTypeAnnotation = isArrayTypeAnnotation$1;
+ generated$3.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
+ generated$3.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
+ generated$3.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
+ generated$3.isClassImplements = isClassImplements;
+ generated$3.isDeclareClass = isDeclareClass;
+ generated$3.isDeclareFunction = isDeclareFunction;
+ generated$3.isDeclareInterface = isDeclareInterface;
+ generated$3.isDeclareModule = isDeclareModule;
+ generated$3.isDeclareModuleExports = isDeclareModuleExports;
+ generated$3.isDeclareTypeAlias = isDeclareTypeAlias;
+ generated$3.isDeclareOpaqueType = isDeclareOpaqueType;
+ generated$3.isDeclareVariable = isDeclareVariable;
+ generated$3.isDeclareExportDeclaration = isDeclareExportDeclaration;
+ generated$3.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
+ generated$3.isDeclaredPredicate = isDeclaredPredicate;
+ generated$3.isExistsTypeAnnotation = isExistsTypeAnnotation;
+ generated$3.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
+ generated$3.isFunctionTypeParam = isFunctionTypeParam;
+ generated$3.isGenericTypeAnnotation = isGenericTypeAnnotation;
+ generated$3.isInferredPredicate = isInferredPredicate;
+ generated$3.isInterfaceExtends = isInterfaceExtends;
+ generated$3.isInterfaceDeclaration = isInterfaceDeclaration;
+ generated$3.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
+ generated$3.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation$1;
+ generated$3.isMixedTypeAnnotation = isMixedTypeAnnotation;
+ generated$3.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
+ generated$3.isNullableTypeAnnotation = isNullableTypeAnnotation$1;
+ generated$3.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
+ generated$3.isNumberTypeAnnotation = isNumberTypeAnnotation;
+ generated$3.isObjectTypeAnnotation = isObjectTypeAnnotation;
+ generated$3.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
+ generated$3.isObjectTypeCallProperty = isObjectTypeCallProperty;
+ generated$3.isObjectTypeIndexer = isObjectTypeIndexer;
+ generated$3.isObjectTypeProperty = isObjectTypeProperty;
+ generated$3.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
+ generated$3.isOpaqueType = isOpaqueType;
+ generated$3.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
+ generated$3.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
+ generated$3.isStringTypeAnnotation = isStringTypeAnnotation;
+ generated$3.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
+ generated$3.isThisTypeAnnotation = isThisTypeAnnotation;
+ generated$3.isTupleTypeAnnotation = isTupleTypeAnnotation;
+ generated$3.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
+ generated$3.isTypeAlias = isTypeAlias;
+ generated$3.isTypeAnnotation = isTypeAnnotation$1;
+ generated$3.isTypeCastExpression = isTypeCastExpression;
+ generated$3.isTypeParameter = isTypeParameter;
+ generated$3.isTypeParameterDeclaration = isTypeParameterDeclaration;
+ generated$3.isTypeParameterInstantiation = isTypeParameterInstantiation;
+ generated$3.isUnionTypeAnnotation = isUnionTypeAnnotation$1;
+ generated$3.isVariance = isVariance;
+ generated$3.isVoidTypeAnnotation = isVoidTypeAnnotation;
+ generated$3.isEnumDeclaration = isEnumDeclaration;
+ generated$3.isEnumBooleanBody = isEnumBooleanBody;
+ generated$3.isEnumNumberBody = isEnumNumberBody;
+ generated$3.isEnumStringBody = isEnumStringBody;
+ generated$3.isEnumSymbolBody = isEnumSymbolBody;
+ generated$3.isEnumBooleanMember = isEnumBooleanMember;
+ generated$3.isEnumNumberMember = isEnumNumberMember;
+ generated$3.isEnumStringMember = isEnumStringMember;
+ generated$3.isEnumDefaultedMember = isEnumDefaultedMember;
+ generated$3.isJSXAttribute = isJSXAttribute;
+ generated$3.isJSXClosingElement = isJSXClosingElement;
+ generated$3.isJSXElement = isJSXElement;
+ generated$3.isJSXEmptyExpression = isJSXEmptyExpression;
+ generated$3.isJSXExpressionContainer = isJSXExpressionContainer;
+ generated$3.isJSXSpreadChild = isJSXSpreadChild;
+ generated$3.isJSXIdentifier = isJSXIdentifier;
+ generated$3.isJSXMemberExpression = isJSXMemberExpression;
+ generated$3.isJSXNamespacedName = isJSXNamespacedName;
+ generated$3.isJSXOpeningElement = isJSXOpeningElement;
+ generated$3.isJSXSpreadAttribute = isJSXSpreadAttribute;
+ generated$3.isJSXText = isJSXText;
+ generated$3.isJSXFragment = isJSXFragment;
+ generated$3.isJSXOpeningFragment = isJSXOpeningFragment;
+ generated$3.isJSXClosingFragment = isJSXClosingFragment;
+ generated$3.isNoop = isNoop;
+ generated$3.isPlaceholder = isPlaceholder;
+ generated$3.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
+ generated$3.isArgumentPlaceholder = isArgumentPlaceholder;
+ generated$3.isAwaitExpression = isAwaitExpression$1;
+ generated$3.isBindExpression = isBindExpression;
+ generated$3.isClassProperty = isClassProperty;
+ generated$3.isOptionalMemberExpression = isOptionalMemberExpression$2;
+ generated$3.isPipelineTopicExpression = isPipelineTopicExpression;
+ generated$3.isPipelineBareFunction = isPipelineBareFunction;
+ generated$3.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
+ generated$3.isOptionalCallExpression = isOptionalCallExpression$2;
+ generated$3.isClassPrivateProperty = isClassPrivateProperty;
+ generated$3.isClassPrivateMethod = isClassPrivateMethod;
+ generated$3.isImport = isImport;
+ generated$3.isImportAttribute = isImportAttribute;
+ generated$3.isDecorator = isDecorator;
+ generated$3.isDoExpression = isDoExpression;
+ generated$3.isExportDefaultSpecifier = isExportDefaultSpecifier$1;
+ generated$3.isExportNamespaceSpecifier = isExportNamespaceSpecifier$1;
+ generated$3.isPrivateName = isPrivateName;
+ generated$3.isBigIntLiteral = isBigIntLiteral;
+ generated$3.isRecordExpression = isRecordExpression;
+ generated$3.isTupleExpression = isTupleExpression;
+ generated$3.isTSParameterProperty = isTSParameterProperty;
+ generated$3.isTSDeclareFunction = isTSDeclareFunction;
+ generated$3.isTSDeclareMethod = isTSDeclareMethod;
+ generated$3.isTSQualifiedName = isTSQualifiedName;
+ generated$3.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
+ generated$3.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
+ generated$3.isTSPropertySignature = isTSPropertySignature;
+ generated$3.isTSMethodSignature = isTSMethodSignature;
+ generated$3.isTSIndexSignature = isTSIndexSignature;
+ generated$3.isTSAnyKeyword = isTSAnyKeyword;
+ generated$3.isTSBooleanKeyword = isTSBooleanKeyword;
+ generated$3.isTSBigIntKeyword = isTSBigIntKeyword;
+ generated$3.isTSNeverKeyword = isTSNeverKeyword;
+ generated$3.isTSNullKeyword = isTSNullKeyword;
+ generated$3.isTSNumberKeyword = isTSNumberKeyword;
+ generated$3.isTSObjectKeyword = isTSObjectKeyword;
+ generated$3.isTSStringKeyword = isTSStringKeyword;
+ generated$3.isTSSymbolKeyword = isTSSymbolKeyword;
+ generated$3.isTSUndefinedKeyword = isTSUndefinedKeyword;
+ generated$3.isTSUnknownKeyword = isTSUnknownKeyword;
+ generated$3.isTSVoidKeyword = isTSVoidKeyword;
+ generated$3.isTSThisType = isTSThisType;
+ generated$3.isTSFunctionType = isTSFunctionType;
+ generated$3.isTSConstructorType = isTSConstructorType;
+ generated$3.isTSTypeReference = isTSTypeReference;
+ generated$3.isTSTypePredicate = isTSTypePredicate;
+ generated$3.isTSTypeQuery = isTSTypeQuery;
+ generated$3.isTSTypeLiteral = isTSTypeLiteral;
+ generated$3.isTSArrayType = isTSArrayType$1;
+ generated$3.isTSTupleType = isTSTupleType;
+ generated$3.isTSOptionalType = isTSOptionalType$1;
+ generated$3.isTSRestType = isTSRestType$1;
+ generated$3.isTSUnionType = isTSUnionType$1;
+ generated$3.isTSIntersectionType = isTSIntersectionType$1;
+ generated$3.isTSConditionalType = isTSConditionalType;
+ generated$3.isTSInferType = isTSInferType;
+ generated$3.isTSParenthesizedType = isTSParenthesizedType;
+ generated$3.isTSTypeOperator = isTSTypeOperator;
+ generated$3.isTSIndexedAccessType = isTSIndexedAccessType;
+ generated$3.isTSMappedType = isTSMappedType;
+ generated$3.isTSLiteralType = isTSLiteralType;
+ generated$3.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
+ generated$3.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
+ generated$3.isTSInterfaceBody = isTSInterfaceBody;
+ generated$3.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
+ generated$3.isTSAsExpression = isTSAsExpression$1;
+ generated$3.isTSTypeAssertion = isTSTypeAssertion$1;
+ generated$3.isTSEnumDeclaration = isTSEnumDeclaration;
+ generated$3.isTSEnumMember = isTSEnumMember;
+ generated$3.isTSModuleDeclaration = isTSModuleDeclaration;
+ generated$3.isTSModuleBlock = isTSModuleBlock;
+ generated$3.isTSImportType = isTSImportType;
+ generated$3.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
+ generated$3.isTSExternalModuleReference = isTSExternalModuleReference;
+ generated$3.isTSNonNullExpression = isTSNonNullExpression$1;
+ generated$3.isTSExportAssignment = isTSExportAssignment;
+ generated$3.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
+ generated$3.isTSTypeAnnotation = isTSTypeAnnotation;
+ generated$3.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
+ generated$3.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
+ generated$3.isTSTypeParameter = isTSTypeParameter;
+ generated$3.isExpression = isExpression;
+ generated$3.isBinary = isBinary$2;
+ generated$3.isScopable = isScopable;
+ generated$3.isBlockParent = isBlockParent;
+ generated$3.isBlock = isBlock;
+ generated$3.isStatement = isStatement$2;
+ generated$3.isTerminatorless = isTerminatorless;
+ generated$3.isCompletionStatement = isCompletionStatement;
+ generated$3.isConditional = isConditional$1;
+ generated$3.isLoop = isLoop$2;
+ generated$3.isWhile = isWhile;
+ generated$3.isExpressionWrapper = isExpressionWrapper;
+ generated$3.isFor = isFor$2;
+ generated$3.isForXStatement = isForXStatement;
+ generated$3.isFunction = isFunction$6;
+ generated$3.isFunctionParent = isFunctionParent;
+ generated$3.isPureish = isPureish;
+ generated$3.isDeclaration = isDeclaration;
+ generated$3.isPatternLike = isPatternLike;
+ generated$3.isLVal = isLVal;
+ generated$3.isTSEntityName = isTSEntityName;
+ generated$3.isLiteral = isLiteral$2;
+ generated$3.isImmutable = isImmutable$2;
+ generated$3.isUserWhitespacable = isUserWhitespacable;
+ generated$3.isMethod = isMethod;
+ generated$3.isObjectMember = isObjectMember;
+ generated$3.isProperty = isProperty;
+ generated$3.isUnaryLike = isUnaryLike$1;
+ generated$3.isPattern = isPattern;
+ generated$3.isClass = isClass;
+ generated$3.isModuleDeclaration = isModuleDeclaration;
+ generated$3.isExportDeclaration = isExportDeclaration$1;
+ generated$3.isModuleSpecifier = isModuleSpecifier;
+ generated$3.isFlow = isFlow;
+ generated$3.isFlowType = isFlowType;
+ generated$3.isFlowBaseAnnotation = isFlowBaseAnnotation;
+ generated$3.isFlowDeclaration = isFlowDeclaration;
+ generated$3.isFlowPredicate = isFlowPredicate;
+ generated$3.isEnumBody = isEnumBody;
+ generated$3.isEnumMember = isEnumMember;
+ generated$3.isJSX = isJSX;
+ generated$3.isPrivate = isPrivate;
+ generated$3.isTSTypeElement = isTSTypeElement;
+ generated$3.isTSType = isTSType;
+ generated$3.isTSBaseType = isTSBaseType;
+ generated$3.isNumberLiteral = isNumberLiteral;
+ generated$3.isRegexLiteral = isRegexLiteral;
+ generated$3.isRestProperty = isRestProperty;
+ generated$3.isSpreadProperty = isSpreadProperty;
+
+ var _shallowEqual = _interopRequireDefault$y(shallowEqual$1);
+
+ function _interopRequireDefault$y(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function isArrayExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAssignmentExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AssignmentExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBinaryExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BinaryExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterpreterDirective(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterpreterDirective") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDirective(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Directive") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDirectiveLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DirectiveLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBlockStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BlockStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBreakStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BreakStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isCallExpression$4(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CallExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isCatchClause(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CatchClause") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isConditionalExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ConditionalExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isContinueStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ContinueStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDebuggerStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DebuggerStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDoWhileStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DoWhileStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEmptyStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EmptyStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExpressionStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExpressionStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFile$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "File") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForInStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForInStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIdentifier$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Identifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIfStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IfStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLabeledStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LabeledStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStringLiteral$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumericLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumericLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNullLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBooleanLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRegExpLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RegExpLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLogicalExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LogicalExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMemberExpression$4(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNewExpression$3(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NewExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isProgram$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Program") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRestElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RestElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isReturnStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ReturnStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSequenceExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SequenceExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isParenthesizedExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ParenthesizedExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSwitchCase(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SwitchCase") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSwitchStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SwitchStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isThisExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThisExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isThrowStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThrowStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTryStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TryStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUnaryExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnaryExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUpdateExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UpdateExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVariableDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VariableDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVariableDeclarator$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VariableDeclarator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isWhileStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "WhileStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isWithStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "WithStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAssignmentPattern$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AssignmentPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArrayPattern(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArrowFunctionExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrowFunctionExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassDeclaration$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportAllDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportAllDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportDefaultDeclaration$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDefaultDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportNamedDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportNamedDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForOfStatement$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForOfStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportDefaultSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportDefaultSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportNamespaceSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportNamespaceSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMetaProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MetaProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectPattern$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSpreadElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SpreadElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSuper(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Super") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTaggedTemplateExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TaggedTemplateExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTemplateElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TemplateElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTemplateLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TemplateLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isYieldExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "YieldExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAnyTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AnyTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArrayTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBooleanTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBooleanLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNullLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassImplements(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassImplements") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareClass(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareClass") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareInterface(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareInterface") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareModule(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareModule") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareModuleExports(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareModuleExports") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareTypeAlias(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareTypeAlias") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareOpaqueType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareOpaqueType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareVariable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareVariable") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareExportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareExportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclareExportAllDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareExportAllDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclaredPredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclaredPredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExistsTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExistsTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionTypeParam(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionTypeParam") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isGenericTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "GenericTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInferredPredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InferredPredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterfaceExtends(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceExtends") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterfaceDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isInterfaceTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isIntersectionTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IntersectionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMixedTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MixedTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEmptyTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EmptyTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNullableTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullableTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumberLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumberTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeInternalSlot(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeInternalSlot") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeCallProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeCallProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeIndexer(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeIndexer") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectTypeSpreadProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeSpreadProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOpaqueType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OpaqueType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isQualifiedTypeIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "QualifiedTypeIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStringLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStringTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSymbolTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SymbolTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isThisTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThisTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTupleTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeofTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeofTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeAlias(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeAlias") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeCastExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeCastExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeParameter(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameter") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeParameterDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameterDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTypeParameterInstantiation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameterInstantiation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUnionTypeAnnotation$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVariance(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Variance") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isVoidTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VoidTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumBooleanBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumNumberBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumStringBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumSymbolBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumSymbolBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumBooleanMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumNumberMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumStringMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumDefaultedMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDefaultedMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXClosingElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXClosingElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXEmptyExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXEmptyExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXExpressionContainer(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXExpressionContainer") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXSpreadChild(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXSpreadChild") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXMemberExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXMemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXNamespacedName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXNamespacedName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXOpeningElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXOpeningElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXSpreadAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXSpreadAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXText(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXText") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXFragment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXOpeningFragment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXOpeningFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSXClosingFragment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXClosingFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNoop(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Noop") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPlaceholder(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Placeholder") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isV8IntrinsicIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "V8IntrinsicIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isArgumentPlaceholder(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArgumentPlaceholder") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isAwaitExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AwaitExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBindExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BindExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOptionalMemberExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalMemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPipelineTopicExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelineTopicExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPipelineBareFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelineBareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPipelinePrimaryTopicReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelinePrimaryTopicReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isOptionalCallExpression$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalCallExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassPrivateProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassPrivateProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClassPrivateMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassPrivateMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImport(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Import") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImportAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDecorator(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Decorator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDoExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DoExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportDefaultSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDefaultSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportNamespaceSpecifier$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportNamespaceSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPrivateName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PrivateName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBigIntLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BigIntLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRecordExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RecordExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTupleExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSParameterProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSParameterProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSDeclareFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSDeclareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSDeclareMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSDeclareMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSQualifiedName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSQualifiedName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSCallSignatureDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSCallSignatureDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSConstructSignatureDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConstructSignatureDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSPropertySignature(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSPropertySignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSMethodSignature(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSMethodSignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIndexSignature(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIndexSignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSAnyKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSAnyKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSBooleanKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBooleanKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSBigIntKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBigIntKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNeverKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNeverKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNullKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNullKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNumberKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNumberKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSObjectKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSObjectKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSStringKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSStringKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSSymbolKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSSymbolKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSUndefinedKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUndefinedKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSUnknownKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUnknownKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSVoidKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSVoidKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSThisType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSThisType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSFunctionType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSFunctionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSConstructorType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConstructorType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypePredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypePredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeQuery(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeQuery") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSArrayType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSArrayType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTupleType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTupleType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSOptionalType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSOptionalType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSRestType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSRestType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSUnionType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUnionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIntersectionType$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIntersectionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSConditionalType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConditionalType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSInferType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInferType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSParenthesizedType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSParenthesizedType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeOperator(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeOperator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSIndexedAccessType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSMappedType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSMappedType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSLiteralType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSLiteralType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSExpressionWithTypeArguments(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExpressionWithTypeArguments") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSInterfaceDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInterfaceDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSInterfaceBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInterfaceBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeAliasDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAliasDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSAsExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSAsExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeAssertion$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAssertion") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSEnumDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSEnumMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEnumMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSModuleDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSModuleDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSModuleBlock(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSModuleBlock") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSImportType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSImportType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSImportEqualsDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSImportEqualsDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSExternalModuleReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExternalModuleReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNonNullExpression$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNonNullExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSExportAssignment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExportAssignment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSNamespaceExportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNamespaceExportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeParameterInstantiation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameterInstantiation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeParameterDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameterDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeParameter(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameter") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "AwaitExpression" === nodeType || "BindExpression" === nodeType || "OptionalMemberExpression" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "OptionalCallExpression" === nodeType || "Import" === nodeType || "DoExpression" === nodeType || "BigIntLiteral" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBinary$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Binary" || "BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isScopable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBlockParent(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isBlock(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isStatement$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTerminatorless(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Terminatorless" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isCompletionStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CompletionStatement" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isConditional$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Conditional" || "ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLoop$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Loop" || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isWhile(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "While" || "DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExpressionWrapper(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExpressionWrapper" || "ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFor$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "For" || "ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isForXStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForXStatement" || "ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunction$6(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Function" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFunctionParent(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionParent" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPureish(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPatternLike(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PatternLike" || "Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLVal(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LVal" || "Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSEntityName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEntityName" || "Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isLiteral$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isImmutable$2(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Immutable" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUserWhitespacable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UserWhitespacable" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Method" || "ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isObjectMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectMember" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Property" || "ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isUnaryLike$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnaryLike" || "UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPattern(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Pattern" || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isClass(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Class" || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isModuleDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ModuleDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isExportDeclaration$1(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isModuleSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlow(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowBaseAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FlowDeclaration" || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isFlowPredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FlowPredicate" || "DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBody" || "EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isEnumMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumMember" || "EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isJSX(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSX" || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isPrivate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Private" || "ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSTypeElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeElement" || "TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isTSBaseType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBaseType" || "TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isNumberLiteral(node, opts) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRegexLiteral(node, opts) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RegexLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isRestProperty(node, opts) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RestProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ function isSpreadProperty(node, opts) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SpreadProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+ }
+
+ Object.defineProperty(matchesPattern$1, "__esModule", {
+ value: true
+ });
+ matchesPattern$1.default = matchesPattern;
+
+ var _generated$n = generated$3;
+
+ function matchesPattern(member, match, allowPartial) {
+ if (!(0, _generated$n.isMemberExpression)(member)) return false;
+ const parts = Array.isArray(match) ? match : match.split(".");
+ const nodes = [];
+ let node;
+
+ for (node = member; (0, _generated$n.isMemberExpression)(node); node = node.object) {
+ nodes.push(node.property);
+ }
+
+ nodes.push(node);
+ if (nodes.length < parts.length) return false;
+ if (!allowPartial && nodes.length > parts.length) return false;
+
+ for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
+ const node = nodes[j];
+ let value;
+
+ if ((0, _generated$n.isIdentifier)(node)) {
+ value = node.name;
+ } else if ((0, _generated$n.isStringLiteral)(node)) {
+ value = node.value;
+ } else {
+ return false;
+ }
+
+ if (parts[i] !== value) return false;
+ }
+
+ return true;
+ }
+
+ Object.defineProperty(buildMatchMemberExpression$1, "__esModule", {
+ value: true
+ });
+ buildMatchMemberExpression$1.default = buildMatchMemberExpression;
+
+ var _matchesPattern = _interopRequireDefault$x(matchesPattern$1);
+
+ function _interopRequireDefault$x(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function buildMatchMemberExpression(match, allowPartial) {
+ const parts = match.split(".");
+ return member => (0, _matchesPattern.default)(member, parts, allowPartial);
+ }
+
+ Object.defineProperty(isReactComponent$2, "__esModule", {
+ value: true
+ });
+ isReactComponent$2.default = void 0;
+
+ var _buildMatchMemberExpression = _interopRequireDefault$w(buildMatchMemberExpression$1);
+
+ function _interopRequireDefault$w(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ const isReactComponent$1 = (0, _buildMatchMemberExpression.default)("React.Component");
+ var _default$3 = isReactComponent$1;
+ isReactComponent$2.default = _default$3;
+
+ var isCompatTag$1 = {};
+
+ Object.defineProperty(isCompatTag$1, "__esModule", {
+ value: true
+ });
+ isCompatTag$1.default = isCompatTag;
+
+ function isCompatTag(tagName) {
+ return !!tagName && /^[a-z]/.test(tagName);
+ }
+
+ var buildChildren$1 = {};
+
+ var cleanJSXElementLiteralChild$1 = {};
+
+ var generated$2 = {};
+
+ var builder$1 = {};
+
+ function listCacheClear$1() {
+ this.__data__ = [];
+ this.size = 0;
+ }
+
+ var _listCacheClear = listCacheClear$1;
+
+ function eq$2(value, other) {
+ return value === other || (value !== value && other !== other);
+ }
+
+ var eq_1 = eq$2;
+
+ var eq$1 = eq_1;
+
+ /**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+ function assocIndexOf$4(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq$1(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
+ }
+
+ var _assocIndexOf = assocIndexOf$4;
+
+ var assocIndexOf$3 = _assocIndexOf;
+
+ /** Used for built-in method references. */
+ var arrayProto = Array.prototype;
+
+ /** Built-in value references. */
+ var splice = arrayProto.splice;
+
+ /**
+ * Removes `key` and its value from the list cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf ListCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+ function listCacheDelete$1(key) {
+ var data = this.__data__,
+ index = assocIndexOf$3(data, key);
+
+ if (index < 0) {
+ return false;
+ }
+ var lastIndex = data.length - 1;
+ if (index == lastIndex) {
+ data.pop();
+ } else {
+ splice.call(data, index, 1);
+ }
+ --this.size;
+ return true;
+ }
+
+ var _listCacheDelete = listCacheDelete$1;
+
+ var assocIndexOf$2 = _assocIndexOf;
+
+ /**
+ * Gets the list cache value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf ListCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+ function listCacheGet$1(key) {
+ var data = this.__data__,
+ index = assocIndexOf$2(data, key);
+
+ return index < 0 ? undefined : data[index][1];
+ }
+
+ var _listCacheGet = listCacheGet$1;
+
+ var assocIndexOf$1 = _assocIndexOf;
+
+ /**
+ * Checks if a list cache value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf ListCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+ function listCacheHas$1(key) {
+ return assocIndexOf$1(this.__data__, key) > -1;
+ }
+
+ var _listCacheHas = listCacheHas$1;
+
+ var assocIndexOf = _assocIndexOf;
+
+ /**
+ * Sets the list cache `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf ListCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the list cache instance.
+ */
+ function listCacheSet$1(key, value) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ if (index < 0) {
+ ++this.size;
+ data.push([key, value]);
+ } else {
+ data[index][1] = value;
+ }
+ return this;
+ }
+
+ var _listCacheSet = listCacheSet$1;
+
+ var listCacheClear = _listCacheClear,
+ listCacheDelete = _listCacheDelete,
+ listCacheGet = _listCacheGet,
+ listCacheHas = _listCacheHas,
+ listCacheSet = _listCacheSet;
+
+ /**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+ function ListCache$4(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ }
+
+ // Add methods to `ListCache`.
+ ListCache$4.prototype.clear = listCacheClear;
+ ListCache$4.prototype['delete'] = listCacheDelete;
+ ListCache$4.prototype.get = listCacheGet;
+ ListCache$4.prototype.has = listCacheHas;
+ ListCache$4.prototype.set = listCacheSet;
+
+ var _ListCache = ListCache$4;
+
+ var ListCache$3 = _ListCache;
+
+ /**
+ * Removes all key-value entries from the stack.
+ *
+ * @private
+ * @name clear
+ * @memberOf Stack
+ */
+ function stackClear$1() {
+ this.__data__ = new ListCache$3;
+ this.size = 0;
+ }
+
+ var _stackClear = stackClear$1;
+
+ function stackDelete$1(key) {
+ var data = this.__data__,
+ result = data['delete'](key);
+
+ this.size = data.size;
+ return result;
+ }
+
+ var _stackDelete = stackDelete$1;
+
+ function stackGet$1(key) {
+ return this.__data__.get(key);
+ }
+
+ var _stackGet = stackGet$1;
+
+ function stackHas$1(key) {
+ return this.__data__.has(key);
+ }
+
+ var _stackHas = stackHas$1;
+
+ var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
+
+ var _freeGlobal = freeGlobal$1;
+
+ var freeGlobal = _freeGlobal;
+
+ /** Detect free variable `self`. */
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+ /** Used as a reference to the global object. */
+ var root$8 = freeGlobal || freeSelf || Function('return this')();
+
+ var _root = root$8;
+
+ var root$7 = _root;
+
+ /** Built-in value references. */
+ var Symbol$4 = root$7.Symbol;
+
+ var _Symbol = Symbol$4;
+
+ var Symbol$3 = _Symbol;
+
+ /** Used for built-in method references. */
+ var objectProto$d = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$b = objectProto$d.hasOwnProperty;
+
+ /**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+ var nativeObjectToString$1 = objectProto$d.toString;
+
+ /** Built-in value references. */
+ var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
+
+ /**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+ function getRawTag$1(value) {
+ var isOwn = hasOwnProperty$b.call(value, symToStringTag$1),
+ tag = value[symToStringTag$1];
+
+ try {
+ value[symToStringTag$1] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString$1.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag$1] = tag;
+ } else {
+ delete value[symToStringTag$1];
+ }
+ }
+ return result;
+ }
+
+ var _getRawTag = getRawTag$1;
+
+ var objectProto$c = Object.prototype;
+
+ /**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+ var nativeObjectToString = objectProto$c.toString;
+
+ /**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+ function objectToString$1(value) {
+ return nativeObjectToString.call(value);
+ }
+
+ var _objectToString = objectToString$1;
+
+ var Symbol$2 = _Symbol,
+ getRawTag = _getRawTag,
+ objectToString = _objectToString;
+
+ /** `Object#toString` result references. */
+ var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+
+ /** Built-in value references. */
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
+
+ /**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+ function baseGetTag$6(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+ }
+
+ var _baseGetTag = baseGetTag$6;
+
+ function isObject$6(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+ }
+
+ var isObject_1 = isObject$6;
+
+ var baseGetTag$5 = _baseGetTag,
+ isObject$5 = isObject_1;
+
+ /** `Object#toString` result references. */
+ var asyncTag = '[object AsyncFunction]',
+ funcTag$2 = '[object Function]',
+ genTag$1 = '[object GeneratorFunction]',
+ proxyTag = '[object Proxy]';
+
+ /**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+ function isFunction$5(value) {
+ if (!isObject$5(value)) {
+ return false;
+ }
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag$5(value);
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
+ }
+
+ var isFunction_1 = isFunction$5;
+
+ var root$6 = _root;
+
+ /** Used to detect overreaching core-js shims. */
+ var coreJsData$1 = root$6['__core-js_shared__'];
+
+ var _coreJsData = coreJsData$1;
+
+ var coreJsData = _coreJsData;
+
+ /** Used to detect methods masquerading as native. */
+ var maskSrcKey = (function() {
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
+ return uid ? ('Symbol(src)_1.' + uid) : '';
+ }());
+
+ /**
+ * Checks if `func` has its source masked.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
+ */
+ function isMasked$1(func) {
+ return !!maskSrcKey && (maskSrcKey in func);
+ }
+
+ var _isMasked = isMasked$1;
+
+ var funcProto$2 = Function.prototype;
+
+ /** Used to resolve the decompiled source of functions. */
+ var funcToString$2 = funcProto$2.toString;
+
+ /**
+ * Converts `func` to its source code.
+ *
+ * @private
+ * @param {Function} func The function to convert.
+ * @returns {string} Returns the source code.
+ */
+ function toSource$2(func) {
+ if (func != null) {
+ try {
+ return funcToString$2.call(func);
+ } catch (e) {}
+ try {
+ return (func + '');
+ } catch (e) {}
+ }
+ return '';
+ }
+
+ var _toSource = toSource$2;
+
+ var isFunction$4 = isFunction_1,
+ isMasked = _isMasked,
+ isObject$4 = isObject_1,
+ toSource$1 = _toSource;
+
+ /**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
+ */
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
+
+ /** Used to detect host constructors (Safari). */
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+ /** Used for built-in method references. */
+ var funcProto$1 = Function.prototype,
+ objectProto$b = Object.prototype;
+
+ /** Used to resolve the decompiled source of functions. */
+ var funcToString$1 = funcProto$1.toString;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$a = objectProto$b.hasOwnProperty;
+
+ /** Used to detect if a method is native. */
+ var reIsNative = RegExp('^' +
+ funcToString$1.call(hasOwnProperty$a).replace(reRegExpChar, '\\$&')
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+ );
+
+ /**
+ * The base implementation of `_.isNative` without bad shim checks.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function,
+ * else `false`.
+ */
+ function baseIsNative$1(value) {
+ if (!isObject$4(value) || isMasked(value)) {
+ return false;
+ }
+ var pattern = isFunction$4(value) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource$1(value));
+ }
+
+ var _baseIsNative = baseIsNative$1;
+
+ function getValue$1(object, key) {
+ return object == null ? undefined : object[key];
+ }
+
+ var _getValue = getValue$1;
+
+ var baseIsNative = _baseIsNative,
+ getValue = _getValue;
+
+ /**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+ function getNative$7(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : undefined;
+ }
+
+ var _getNative = getNative$7;
+
+ var getNative$6 = _getNative,
+ root$5 = _root;
+
+ /* Built-in method references that are verified to be native. */
+ var Map$4 = getNative$6(root$5, 'Map');
+
+ var _Map = Map$4;
+
+ var getNative$5 = _getNative;
+
+ /* Built-in method references that are verified to be native. */
+ var nativeCreate$4 = getNative$5(Object, 'create');
+
+ var _nativeCreate = nativeCreate$4;
+
+ var nativeCreate$3 = _nativeCreate;
+
+ /**
+ * Removes all key-value entries from the hash.
+ *
+ * @private
+ * @name clear
+ * @memberOf Hash
+ */
+ function hashClear$1() {
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
+ this.size = 0;
+ }
+
+ var _hashClear = hashClear$1;
+
+ function hashDelete$1(key) {
+ var result = this.has(key) && delete this.__data__[key];
+ this.size -= result ? 1 : 0;
+ return result;
+ }
+
+ var _hashDelete = hashDelete$1;
+
+ var nativeCreate$2 = _nativeCreate;
+
+ /** Used to stand-in for `undefined` hash values. */
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
+
+ /** Used for built-in method references. */
+ var objectProto$a = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
+
+ /**
+ * Gets the hash value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Hash
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+ function hashGet$1(key) {
+ var data = this.__data__;
+ if (nativeCreate$2) {
+ var result = data[key];
+ return result === HASH_UNDEFINED$2 ? undefined : result;
+ }
+ return hasOwnProperty$9.call(data, key) ? data[key] : undefined;
+ }
+
+ var _hashGet = hashGet$1;
+
+ var nativeCreate$1 = _nativeCreate;
+
+ /** Used for built-in method references. */
+ var objectProto$9 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
+
+ /**
+ * Checks if a hash value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Hash
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+ function hashHas$1(key) {
+ var data = this.__data__;
+ return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$8.call(data, key);
+ }
+
+ var _hashHas = hashHas$1;
+
+ var nativeCreate = _nativeCreate;
+
+ /** Used to stand-in for `undefined` hash values. */
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
+
+ /**
+ * Sets the hash `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Hash
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the hash instance.
+ */
+ function hashSet$1(key, value) {
+ var data = this.__data__;
+ this.size += this.has(key) ? 0 : 1;
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
+ return this;
+ }
+
+ var _hashSet = hashSet$1;
+
+ var hashClear = _hashClear,
+ hashDelete = _hashDelete,
+ hashGet = _hashGet,
+ hashHas = _hashHas,
+ hashSet = _hashSet;
+
+ /**
+ * Creates a hash object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+ function Hash$1(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ }
+
+ // Add methods to `Hash`.
+ Hash$1.prototype.clear = hashClear;
+ Hash$1.prototype['delete'] = hashDelete;
+ Hash$1.prototype.get = hashGet;
+ Hash$1.prototype.has = hashHas;
+ Hash$1.prototype.set = hashSet;
+
+ var _Hash = Hash$1;
+
+ var Hash = _Hash,
+ ListCache$2 = _ListCache,
+ Map$3 = _Map;
+
+ /**
+ * Removes all key-value entries from the map.
+ *
+ * @private
+ * @name clear
+ * @memberOf MapCache
+ */
+ function mapCacheClear$1() {
+ this.size = 0;
+ this.__data__ = {
+ 'hash': new Hash,
+ 'map': new (Map$3 || ListCache$2),
+ 'string': new Hash
+ };
+ }
+
+ var _mapCacheClear = mapCacheClear$1;
+
+ function isKeyable$1(value) {
+ var type = typeof value;
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
+ ? (value !== '__proto__')
+ : (value === null);
+ }
+
+ var _isKeyable = isKeyable$1;
+
+ var isKeyable = _isKeyable;
+
+ /**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */
+ function getMapData$4(map, key) {
+ var data = map.__data__;
+ return isKeyable(key)
+ ? data[typeof key == 'string' ? 'string' : 'hash']
+ : data.map;
+ }
+
+ var _getMapData = getMapData$4;
+
+ var getMapData$3 = _getMapData;
+
+ /**
+ * Removes `key` and its value from the map.
+ *
+ * @private
+ * @name delete
+ * @memberOf MapCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+ function mapCacheDelete$1(key) {
+ var result = getMapData$3(this, key)['delete'](key);
+ this.size -= result ? 1 : 0;
+ return result;
+ }
+
+ var _mapCacheDelete = mapCacheDelete$1;
+
+ var getMapData$2 = _getMapData;
+
+ /**
+ * Gets the map value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf MapCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+ function mapCacheGet$1(key) {
+ return getMapData$2(this, key).get(key);
+ }
+
+ var _mapCacheGet = mapCacheGet$1;
+
+ var getMapData$1 = _getMapData;
+
+ /**
+ * Checks if a map value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf MapCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+ function mapCacheHas$1(key) {
+ return getMapData$1(this, key).has(key);
+ }
+
+ var _mapCacheHas = mapCacheHas$1;
+
+ var getMapData = _getMapData;
+
+ /**
+ * Sets the map `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf MapCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the map cache instance.
+ */
+ function mapCacheSet$1(key, value) {
+ var data = getMapData(this, key),
+ size = data.size;
+
+ data.set(key, value);
+ this.size += data.size == size ? 0 : 1;
+ return this;
+ }
+
+ var _mapCacheSet = mapCacheSet$1;
+
+ var mapCacheClear = _mapCacheClear,
+ mapCacheDelete = _mapCacheDelete,
+ mapCacheGet = _mapCacheGet,
+ mapCacheHas = _mapCacheHas,
+ mapCacheSet = _mapCacheSet;
+
+ /**
+ * Creates a map cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+ function MapCache$2(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ }
+
+ // Add methods to `MapCache`.
+ MapCache$2.prototype.clear = mapCacheClear;
+ MapCache$2.prototype['delete'] = mapCacheDelete;
+ MapCache$2.prototype.get = mapCacheGet;
+ MapCache$2.prototype.has = mapCacheHas;
+ MapCache$2.prototype.set = mapCacheSet;
+
+ var _MapCache = MapCache$2;
+
+ var ListCache$1 = _ListCache,
+ Map$2 = _Map,
+ MapCache$1 = _MapCache;
+
+ /** Used as the size to enable large array optimizations. */
+ var LARGE_ARRAY_SIZE$1 = 200;
+
+ /**
+ * Sets the stack `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Stack
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the stack cache instance.
+ */
+ function stackSet$1(key, value) {
+ var data = this.__data__;
+ if (data instanceof ListCache$1) {
+ var pairs = data.__data__;
+ if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE$1 - 1)) {
+ pairs.push([key, value]);
+ this.size = ++data.size;
+ return this;
+ }
+ data = this.__data__ = new MapCache$1(pairs);
+ }
+ data.set(key, value);
+ this.size = data.size;
+ return this;
+ }
+
+ var _stackSet = stackSet$1;
+
+ var ListCache = _ListCache,
+ stackClear = _stackClear,
+ stackDelete = _stackDelete,
+ stackGet = _stackGet,
+ stackHas = _stackHas,
+ stackSet = _stackSet;
+
+ /**
+ * Creates a stack cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+ function Stack$1(entries) {
+ var data = this.__data__ = new ListCache(entries);
+ this.size = data.size;
+ }
+
+ // Add methods to `Stack`.
+ Stack$1.prototype.clear = stackClear;
+ Stack$1.prototype['delete'] = stackDelete;
+ Stack$1.prototype.get = stackGet;
+ Stack$1.prototype.has = stackHas;
+ Stack$1.prototype.set = stackSet;
+
+ var _Stack = Stack$1;
+
+ function arrayEach$1(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+
+ var _arrayEach = arrayEach$1;
+
+ var getNative$4 = _getNative;
+
+ var defineProperty$1 = (function() {
+ try {
+ var func = getNative$4(Object, 'defineProperty');
+ func({}, '', {});
+ return func;
+ } catch (e) {}
+ }());
+
+ var _defineProperty = defineProperty$1;
+
+ var defineProperty = _defineProperty;
+
+ /**
+ * The base implementation of `assignValue` and `assignMergeValue` without
+ * value checks.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */
+ function baseAssignValue$2(object, key, value) {
+ if (key == '__proto__' && defineProperty) {
+ defineProperty(object, key, {
+ 'configurable': true,
+ 'enumerable': true,
+ 'value': value,
+ 'writable': true
+ });
+ } else {
+ object[key] = value;
+ }
+ }
+
+ var _baseAssignValue = baseAssignValue$2;
+
+ var baseAssignValue$1 = _baseAssignValue,
+ eq = eq_1;
+
+ /** Used for built-in method references. */
+ var objectProto$8 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
+
+ /**
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */
+ function assignValue$2(object, key, value) {
+ var objValue = object[key];
+ if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) ||
+ (value === undefined && !(key in object))) {
+ baseAssignValue$1(object, key, value);
+ }
+ }
+
+ var _assignValue = assignValue$2;
+
+ var assignValue$1 = _assignValue,
+ baseAssignValue = _baseAssignValue;
+
+ /**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property identifiers to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @param {Function} [customizer] The function to customize copied values.
+ * @returns {Object} Returns `object`.
+ */
+ function copyObject$4(source, props, object, customizer) {
+ var isNew = !object;
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+
+ var newValue = customizer
+ ? customizer(object[key], source[key], key, object, source)
+ : undefined;
+
+ if (newValue === undefined) {
+ newValue = source[key];
+ }
+ if (isNew) {
+ baseAssignValue(object, key, newValue);
+ } else {
+ assignValue$1(object, key, newValue);
+ }
+ }
+ return object;
+ }
+
+ var _copyObject = copyObject$4;
+
+ function baseTimes$1(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+ }
+
+ var _baseTimes = baseTimes$1;
+
+ function isObjectLike$7(value) {
+ return value != null && typeof value == 'object';
+ }
+
+ var isObjectLike_1 = isObjectLike$7;
+
+ var baseGetTag$4 = _baseGetTag,
+ isObjectLike$6 = isObjectLike_1;
+
+ /** `Object#toString` result references. */
+ var argsTag$2 = '[object Arguments]';
+
+ /**
+ * The base implementation of `_.isArguments`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ */
+ function baseIsArguments$1(value) {
+ return isObjectLike$6(value) && baseGetTag$4(value) == argsTag$2;
+ }
+
+ var _baseIsArguments = baseIsArguments$1;
+
+ var baseIsArguments = _baseIsArguments,
+ isObjectLike$5 = isObjectLike_1;
+
+ /** Used for built-in method references. */
+ var objectProto$7 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
+
+ /** Built-in value references. */
+ var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
+
+ /**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+ var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
+ return isObjectLike$5(value) && hasOwnProperty$6.call(value, 'callee') &&
+ !propertyIsEnumerable$1.call(value, 'callee');
+ };
+
+ var isArguments_1 = isArguments$1;
+
+ var isArray$5 = Array.isArray;
+
+ var isArray_1 = isArray$5;
+
+ var isBufferExports = {};
+ var isBuffer$4 = {
+ get exports(){ return isBufferExports; },
+ set exports(v){ isBufferExports = v; },
+ };
+
+ function stubFalse() {
+ return false;
+ }
+
+ var stubFalse_1 = stubFalse;
+
+ (function (module, exports) {
+ var root = _root,
+ stubFalse = stubFalse_1;
+
+ /** Detect free variable `exports`. */
+ var freeExports = exports && !exports.nodeType && exports;
+
+ /** Detect free variable `module`. */
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
+
+ /** Detect the popular CommonJS extension `module.exports`. */
+ var moduleExports = freeModule && freeModule.exports === freeExports;
+
+ /** Built-in value references. */
+ var Buffer = moduleExports ? root.Buffer : undefined;
+
+ /* Built-in method references for those with the same name as other `lodash` methods. */
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
+
+ /**
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
+ *
+ * _.isBuffer(new Buffer(2));
+ * // => true
+ *
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
+ */
+ var isBuffer = nativeIsBuffer || stubFalse;
+
+ module.exports = isBuffer;
+ } (isBuffer$4, isBufferExports));
+
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
+
+ /** Used to detect unsigned integer values. */
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
+
+ /**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+ function isIndex$1(value, length) {
+ var type = typeof value;
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
+
+ return !!length &&
+ (type == 'number' ||
+ (type != 'symbol' && reIsUint.test(value))) &&
+ (value > -1 && value % 1 == 0 && value < length);
+ }
+
+ var _isIndex = isIndex$1;
+
+ var MAX_SAFE_INTEGER = 9007199254740991;
+
+ /**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+ function isLength$2(value) {
+ return typeof value == 'number' &&
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+ }
+
+ var isLength_1 = isLength$2;
+
+ var baseGetTag$3 = _baseGetTag,
+ isLength$1 = isLength_1,
+ isObjectLike$4 = isObjectLike_1;
+
+ /** `Object#toString` result references. */
+ var argsTag$1 = '[object Arguments]',
+ arrayTag$1 = '[object Array]',
+ boolTag$2 = '[object Boolean]',
+ dateTag$2 = '[object Date]',
+ errorTag$1 = '[object Error]',
+ funcTag$1 = '[object Function]',
+ mapTag$4 = '[object Map]',
+ numberTag$2 = '[object Number]',
+ objectTag$3 = '[object Object]',
+ regexpTag$3 = '[object RegExp]',
+ setTag$4 = '[object Set]',
+ stringTag$2 = '[object String]',
+ weakMapTag$2 = '[object WeakMap]';
+
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
+ dataViewTag$3 = '[object DataView]',
+ float32Tag$2 = '[object Float32Array]',
+ float64Tag$2 = '[object Float64Array]',
+ int8Tag$2 = '[object Int8Array]',
+ int16Tag$2 = '[object Int16Array]',
+ int32Tag$2 = '[object Int32Array]',
+ uint8Tag$2 = '[object Uint8Array]',
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
+ uint16Tag$2 = '[object Uint16Array]',
+ uint32Tag$2 = '[object Uint32Array]';
+
+ /** Used to identify `toStringTag` values of typed arrays. */
+ var typedArrayTags = {};
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
+ typedArrayTags[uint32Tag$2] = true;
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
+ typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$3] =
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
+ typedArrayTags[weakMapTag$2] = false;
+
+ /**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */
+ function baseIsTypedArray$1(value) {
+ return isObjectLike$4(value) &&
+ isLength$1(value.length) && !!typedArrayTags[baseGetTag$3(value)];
+ }
+
+ var _baseIsTypedArray = baseIsTypedArray$1;
+
+ function baseUnary$4(func) {
+ return function(value) {
+ return func(value);
+ };
+ }
+
+ var _baseUnary = baseUnary$4;
+
+ var _nodeUtilExports = {};
+ var _nodeUtil = {
+ get exports(){ return _nodeUtilExports; },
+ set exports(v){ _nodeUtilExports = v; },
+ };
+
+ (function (module, exports) {
+ var freeGlobal = _freeGlobal;
+
+ /** Detect free variable `exports`. */
+ var freeExports = exports && !exports.nodeType && exports;
+
+ /** Detect free variable `module`. */
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
+
+ /** Detect the popular CommonJS extension `module.exports`. */
+ var moduleExports = freeModule && freeModule.exports === freeExports;
+
+ /** Detect free variable `process` from Node.js. */
+ var freeProcess = moduleExports && freeGlobal.process;
+
+ /** Used to access faster Node.js helpers. */
+ var nodeUtil = (function() {
+ try {
+ // Use `util.types` for Node.js 10+.
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
+
+ if (types) {
+ return types;
+ }
+
+ // Legacy `process.binding('util')` for Node.js < 10.
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
+ } catch (e) {}
+ }());
+
+ module.exports = nodeUtil;
+ } (_nodeUtil, _nodeUtilExports));
+
+ var baseIsTypedArray = _baseIsTypedArray,
+ baseUnary$3 = _baseUnary,
+ nodeUtil$3 = _nodeUtilExports;
+
+ /* Node.js helper references. */
+ var nodeIsTypedArray = nodeUtil$3 && nodeUtil$3.isTypedArray;
+
+ /**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+ var isTypedArray$1 = nodeIsTypedArray ? baseUnary$3(nodeIsTypedArray) : baseIsTypedArray;
+
+ var isTypedArray_1 = isTypedArray$1;
+
+ var baseTimes = _baseTimes,
+ isArguments = isArguments_1,
+ isArray$4 = isArray_1,
+ isBuffer$3 = isBufferExports,
+ isIndex = _isIndex,
+ isTypedArray = isTypedArray_1;
+
+ /** Used for built-in method references. */
+ var objectProto$6 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
+
+ /**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */
+ function arrayLikeKeys$2(value, inherited) {
+ var isArr = isArray$4(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer$3(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
+
+ for (var key in value) {
+ if ((inherited || hasOwnProperty$5.call(value, key)) &&
+ !(skipIndexes && (
+ // Safari 9 has enumerable `arguments.length` in strict mode.
+ key == 'length' ||
+ // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == 'offset' || key == 'parent')) ||
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
+ // Skip index properties.
+ isIndex(key, length)
+ ))) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ var _arrayLikeKeys = arrayLikeKeys$2;
+
+ var objectProto$5 = Object.prototype;
+
+ /**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */
+ function isPrototype$3(value) {
+ var Ctor = value && value.constructor,
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
+
+ return value === proto;
+ }
+
+ var _isPrototype = isPrototype$3;
+
+ function overArg$2(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+ }
+
+ var _overArg = overArg$2;
+
+ var overArg$1 = _overArg;
+
+ /* Built-in method references for those with the same name as other `lodash` methods. */
+ var nativeKeys$1 = overArg$1(Object.keys, Object);
+
+ var _nativeKeys = nativeKeys$1;
+
+ var isPrototype$2 = _isPrototype,
+ nativeKeys = _nativeKeys;
+
+ /** Used for built-in method references. */
+ var objectProto$4 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
+
+ /**
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+ function baseKeys$1(object) {
+ if (!isPrototype$2(object)) {
+ return nativeKeys(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ var _baseKeys = baseKeys$1;
+
+ var isFunction$3 = isFunction_1,
+ isLength = isLength_1;
+
+ /**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+ function isArrayLike$2(value) {
+ return value != null && isLength(value.length) && !isFunction$3(value);
+ }
+
+ var isArrayLike_1 = isArrayLike$2;
+
+ var arrayLikeKeys$1 = _arrayLikeKeys,
+ baseKeys = _baseKeys,
+ isArrayLike$1 = isArrayLike_1;
+
+ /**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+ function keys$3(object) {
+ return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
+ }
+
+ var keys_1 = keys$3;
+
+ var copyObject$3 = _copyObject,
+ keys$2 = keys_1;
+
+ /**
+ * The base implementation of `_.assign` without support for multiple sources
+ * or `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+ function baseAssign$1(object, source) {
+ return object && copyObject$3(source, keys$2(source), object);
+ }
+
+ var _baseAssign = baseAssign$1;
+
+ function nativeKeysIn$1(object) {
+ var result = [];
+ if (object != null) {
+ for (var key in Object(object)) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ var _nativeKeysIn = nativeKeysIn$1;
+
+ var isObject$3 = isObject_1,
+ isPrototype$1 = _isPrototype,
+ nativeKeysIn = _nativeKeysIn;
+
+ /** Used for built-in method references. */
+ var objectProto$3 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
+
+ /**
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+ function baseKeysIn$1(object) {
+ if (!isObject$3(object)) {
+ return nativeKeysIn(object);
+ }
+ var isProto = isPrototype$1(object),
+ result = [];
+
+ for (var key in object) {
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty$3.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ var _baseKeysIn = baseKeysIn$1;
+
+ var arrayLikeKeys = _arrayLikeKeys,
+ baseKeysIn = _baseKeysIn,
+ isArrayLike = isArrayLike_1;
+
+ /**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+ function keysIn$3(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
+ }
+
+ var keysIn_1 = keysIn$3;
+
+ var copyObject$2 = _copyObject,
+ keysIn$2 = keysIn_1;
+
+ /**
+ * The base implementation of `_.assignIn` without support for multiple sources
+ * or `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+ function baseAssignIn$1(object, source) {
+ return object && copyObject$2(source, keysIn$2(source), object);
+ }
+
+ var _baseAssignIn = baseAssignIn$1;
+
+ var _cloneBufferExports = {};
+ var _cloneBuffer = {
+ get exports(){ return _cloneBufferExports; },
+ set exports(v){ _cloneBufferExports = v; },
+ };
+
+ (function (module, exports) {
+ var root = _root;
+
+ /** Detect free variable `exports`. */
+ var freeExports = exports && !exports.nodeType && exports;
+
+ /** Detect free variable `module`. */
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
+
+ /** Detect the popular CommonJS extension `module.exports`. */
+ var moduleExports = freeModule && freeModule.exports === freeExports;
+
+ /** Built-in value references. */
+ var Buffer = moduleExports ? root.Buffer : undefined,
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
+
+ /**
+ * Creates a clone of `buffer`.
+ *
+ * @private
+ * @param {Buffer} buffer The buffer to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Buffer} Returns the cloned buffer.
+ */
+ function cloneBuffer(buffer, isDeep) {
+ if (isDeep) {
+ return buffer.slice();
+ }
+ var length = buffer.length,
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
+
+ buffer.copy(result);
+ return result;
+ }
+
+ module.exports = cloneBuffer;
+ } (_cloneBuffer, _cloneBufferExports));
+
+ function copyArray$1(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+ }
+
+ var _copyArray = copyArray$1;
+
+ function arrayFilter$1(array, predicate) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ resIndex = 0,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[resIndex++] = value;
+ }
+ }
+ return result;
+ }
+
+ var _arrayFilter = arrayFilter$1;
+
+ function stubArray$2() {
+ return [];
+ }
+
+ var stubArray_1 = stubArray$2;
+
+ var arrayFilter = _arrayFilter,
+ stubArray$1 = stubArray_1;
+
+ /** Used for built-in method references. */
+ var objectProto$2 = Object.prototype;
+
+ /** Built-in value references. */
+ var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
+
+ /* Built-in method references for those with the same name as other `lodash` methods. */
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
+
+ /**
+ * Creates an array of the own enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+ var getSymbols$4 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
+ if (object == null) {
+ return [];
+ }
+ object = Object(object);
+ return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
+ return propertyIsEnumerable.call(object, symbol);
+ });
+ };
+
+ var _getSymbols = getSymbols$4;
+
+ var copyObject$1 = _copyObject,
+ getSymbols$3 = _getSymbols;
+
+ /**
+ * Copies own symbols of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy symbols from.
+ * @param {Object} [object={}] The object to copy symbols to.
+ * @returns {Object} Returns `object`.
+ */
+ function copySymbols$1(source, object) {
+ return copyObject$1(source, getSymbols$3(source), object);
+ }
+
+ var _copySymbols = copySymbols$1;
+
+ function arrayPush$2(array, values) {
+ var index = -1,
+ length = values.length,
+ offset = array.length;
+
+ while (++index < length) {
+ array[offset + index] = values[index];
+ }
+ return array;
+ }
+
+ var _arrayPush = arrayPush$2;
+
+ var overArg = _overArg;
+
+ /** Built-in value references. */
+ var getPrototype$3 = overArg(Object.getPrototypeOf, Object);
+
+ var _getPrototype = getPrototype$3;
+
+ var arrayPush$1 = _arrayPush,
+ getPrototype$2 = _getPrototype,
+ getSymbols$2 = _getSymbols,
+ stubArray = stubArray_1;
+
+ /* Built-in method references for those with the same name as other `lodash` methods. */
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
+
+ /**
+ * Creates an array of the own and inherited enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+ var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
+ var result = [];
+ while (object) {
+ arrayPush$1(result, getSymbols$2(object));
+ object = getPrototype$2(object);
+ }
+ return result;
+ };
+
+ var _getSymbolsIn = getSymbolsIn$2;
+
+ var copyObject = _copyObject,
+ getSymbolsIn$1 = _getSymbolsIn;
+
+ /**
+ * Copies own and inherited symbols of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy symbols from.
+ * @param {Object} [object={}] The object to copy symbols to.
+ * @returns {Object} Returns `object`.
+ */
+ function copySymbolsIn$1(source, object) {
+ return copyObject(source, getSymbolsIn$1(source), object);
+ }
+
+ var _copySymbolsIn = copySymbolsIn$1;
+
+ var arrayPush = _arrayPush,
+ isArray$3 = isArray_1;
+
+ /**
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+ function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
+ var result = keysFunc(object);
+ return isArray$3(object) ? result : arrayPush(result, symbolsFunc(object));
+ }
+
+ var _baseGetAllKeys = baseGetAllKeys$2;
+
+ var baseGetAllKeys$1 = _baseGetAllKeys,
+ getSymbols$1 = _getSymbols,
+ keys$1 = keys_1;
+
+ /**
+ * Creates an array of own enumerable property names and symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+ function getAllKeys$1(object) {
+ return baseGetAllKeys$1(object, keys$1, getSymbols$1);
+ }
+
+ var _getAllKeys = getAllKeys$1;
+
+ var baseGetAllKeys = _baseGetAllKeys,
+ getSymbolsIn = _getSymbolsIn,
+ keysIn$1 = keysIn_1;
+
+ /**
+ * Creates an array of own and inherited enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+ function getAllKeysIn$1(object) {
+ return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
+ }
+
+ var _getAllKeysIn = getAllKeysIn$1;
+
+ var getNative$3 = _getNative,
+ root$4 = _root;
+
+ /* Built-in method references that are verified to be native. */
+ var DataView$1 = getNative$3(root$4, 'DataView');
+
+ var _DataView = DataView$1;
+
+ var getNative$2 = _getNative,
+ root$3 = _root;
+
+ /* Built-in method references that are verified to be native. */
+ var Promise$2 = getNative$2(root$3, 'Promise');
+
+ var _Promise = Promise$2;
+
+ var getNative$1 = _getNative,
+ root$2 = _root;
+
+ /* Built-in method references that are verified to be native. */
+ var Set$3 = getNative$1(root$2, 'Set');
+
+ var _Set = Set$3;
+
+ var getNative = _getNative,
+ root$1 = _root;
+
+ /* Built-in method references that are verified to be native. */
+ var WeakMap$2 = getNative(root$1, 'WeakMap');
+
+ var _WeakMap = WeakMap$2;
+
+ var DataView = _DataView,
+ Map$1 = _Map,
+ Promise$1 = _Promise,
+ Set$2 = _Set,
+ WeakMap$1 = _WeakMap,
+ baseGetTag$2 = _baseGetTag,
+ toSource = _toSource;
+
+ /** `Object#toString` result references. */
+ var mapTag$3 = '[object Map]',
+ objectTag$2 = '[object Object]',
+ promiseTag = '[object Promise]',
+ setTag$3 = '[object Set]',
+ weakMapTag$1 = '[object WeakMap]';
+
+ var dataViewTag$2 = '[object DataView]';
+
+ /** Used to detect maps, sets, and weakmaps. */
+ var dataViewCtorString = toSource(DataView),
+ mapCtorString = toSource(Map$1),
+ promiseCtorString = toSource(Promise$1),
+ setCtorString = toSource(Set$2),
+ weakMapCtorString = toSource(WeakMap$1);
+
+ /**
+ * Gets the `toStringTag` of `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+ var getTag$3 = baseGetTag$2;
+
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
+ if ((DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
+ (Map$1 && getTag$3(new Map$1) != mapTag$3) ||
+ (Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag) ||
+ (Set$2 && getTag$3(new Set$2) != setTag$3) ||
+ (WeakMap$1 && getTag$3(new WeakMap$1) != weakMapTag$1)) {
+ getTag$3 = function(value) {
+ var result = baseGetTag$2(value),
+ Ctor = result == objectTag$2 ? value.constructor : undefined,
+ ctorString = Ctor ? toSource(Ctor) : '';
+
+ if (ctorString) {
+ switch (ctorString) {
+ case dataViewCtorString: return dataViewTag$2;
+ case mapCtorString: return mapTag$3;
+ case promiseCtorString: return promiseTag;
+ case setCtorString: return setTag$3;
+ case weakMapCtorString: return weakMapTag$1;
+ }
+ }
+ return result;
+ };
+ }
+
+ var _getTag = getTag$3;
+
+ var objectProto$1 = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
+
+ /**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+ function initCloneArray$1(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty$2.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+ }
+
+ var _initCloneArray = initCloneArray$1;
+
+ var root = _root;
+
+ /** Built-in value references. */
+ var Uint8Array$2 = root.Uint8Array;
+
+ var _Uint8Array = Uint8Array$2;
+
+ var Uint8Array$1 = _Uint8Array;
+
+ /**
+ * Creates a clone of `arrayBuffer`.
+ *
+ * @private
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+ function cloneArrayBuffer$3(arrayBuffer) {
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
+ new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
+ return result;
+ }
+
+ var _cloneArrayBuffer = cloneArrayBuffer$3;
+
+ var cloneArrayBuffer$2 = _cloneArrayBuffer;
+
+ /**
+ * Creates a clone of `dataView`.
+ *
+ * @private
+ * @param {Object} dataView The data view to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned data view.
+ */
+ function cloneDataView$1(dataView, isDeep) {
+ var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
+ }
+
+ var _cloneDataView = cloneDataView$1;
+
+ var reFlags = /\w*$/;
+
+ /**
+ * Creates a clone of `regexp`.
+ *
+ * @private
+ * @param {Object} regexp The regexp to clone.
+ * @returns {Object} Returns the cloned regexp.
+ */
+ function cloneRegExp$1(regexp) {
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
+ result.lastIndex = regexp.lastIndex;
+ return result;
+ }
+
+ var _cloneRegExp = cloneRegExp$1;
+
+ var Symbol$1 = _Symbol;
+
+ /** Used to convert symbols to primitives and strings. */
+ var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
+
+ /**
+ * Creates a clone of the `symbol` object.
+ *
+ * @private
+ * @param {Object} symbol The symbol object to clone.
+ * @returns {Object} Returns the cloned symbol object.
+ */
+ function cloneSymbol$1(symbol) {
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
+ }
+
+ var _cloneSymbol = cloneSymbol$1;
+
+ var cloneArrayBuffer$1 = _cloneArrayBuffer;
+
+ /**
+ * Creates a clone of `typedArray`.
+ *
+ * @private
+ * @param {Object} typedArray The typed array to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned typed array.
+ */
+ function cloneTypedArray$1(typedArray, isDeep) {
+ var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
+ }
+
+ var _cloneTypedArray = cloneTypedArray$1;
+
+ var cloneArrayBuffer = _cloneArrayBuffer,
+ cloneDataView = _cloneDataView,
+ cloneRegExp = _cloneRegExp,
+ cloneSymbol = _cloneSymbol,
+ cloneTypedArray = _cloneTypedArray;
+
+ /** `Object#toString` result references. */
+ var boolTag$1 = '[object Boolean]',
+ dateTag$1 = '[object Date]',
+ mapTag$2 = '[object Map]',
+ numberTag$1 = '[object Number]',
+ regexpTag$2 = '[object RegExp]',
+ setTag$2 = '[object Set]',
+ stringTag$1 = '[object String]',
+ symbolTag$1 = '[object Symbol]';
+
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
+ dataViewTag$1 = '[object DataView]',
+ float32Tag$1 = '[object Float32Array]',
+ float64Tag$1 = '[object Float64Array]',
+ int8Tag$1 = '[object Int8Array]',
+ int16Tag$1 = '[object Int16Array]',
+ int32Tag$1 = '[object Int32Array]',
+ uint8Tag$1 = '[object Uint8Array]',
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
+ uint16Tag$1 = '[object Uint16Array]',
+ uint32Tag$1 = '[object Uint32Array]';
+
+ /**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+ function initCloneByTag$1(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag$1:
+ return cloneArrayBuffer(object);
+
+ case boolTag$1:
+ case dateTag$1:
+ return new Ctor(+object);
+
+ case dataViewTag$1:
+ return cloneDataView(object, isDeep);
+
+ case float32Tag$1: case float64Tag$1:
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
+ return cloneTypedArray(object, isDeep);
+
+ case mapTag$2:
+ return new Ctor;
+
+ case numberTag$1:
+ case stringTag$1:
+ return new Ctor(object);
+
+ case regexpTag$2:
+ return cloneRegExp(object);
+
+ case setTag$2:
+ return new Ctor;
+
+ case symbolTag$1:
+ return cloneSymbol(object);
+ }
+ }
+
+ var _initCloneByTag = initCloneByTag$1;
+
+ var isObject$2 = isObject_1;
+
+ /** Built-in value references. */
+ var objectCreate = Object.create;
+
+ /**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} proto The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+ var baseCreate$1 = (function() {
+ function object() {}
+ return function(proto) {
+ if (!isObject$2(proto)) {
+ return {};
+ }
+ if (objectCreate) {
+ return objectCreate(proto);
+ }
+ object.prototype = proto;
+ var result = new object;
+ object.prototype = undefined;
+ return result;
+ };
+ }());
+
+ var _baseCreate = baseCreate$1;
+
+ var baseCreate = _baseCreate,
+ getPrototype$1 = _getPrototype,
+ isPrototype = _isPrototype;
+
+ /**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+ function initCloneObject$1(object) {
+ return (typeof object.constructor == 'function' && !isPrototype(object))
+ ? baseCreate(getPrototype$1(object))
+ : {};
+ }
+
+ var _initCloneObject = initCloneObject$1;
+
+ var getTag$2 = _getTag,
+ isObjectLike$3 = isObjectLike_1;
+
+ /** `Object#toString` result references. */
+ var mapTag$1 = '[object Map]';
+
+ /**
+ * The base implementation of `_.isMap` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
+ */
+ function baseIsMap$1(value) {
+ return isObjectLike$3(value) && getTag$2(value) == mapTag$1;
+ }
+
+ var _baseIsMap = baseIsMap$1;
+
+ var baseIsMap = _baseIsMap,
+ baseUnary$2 = _baseUnary,
+ nodeUtil$2 = _nodeUtilExports;
+
+ /* Node.js helper references. */
+ var nodeIsMap = nodeUtil$2 && nodeUtil$2.isMap;
+
+ /**
+ * Checks if `value` is classified as a `Map` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
+ * @example
+ *
+ * _.isMap(new Map);
+ * // => true
+ *
+ * _.isMap(new WeakMap);
+ * // => false
+ */
+ var isMap$2 = nodeIsMap ? baseUnary$2(nodeIsMap) : baseIsMap;
+
+ var isMap_1 = isMap$2;
+
+ var getTag$1 = _getTag,
+ isObjectLike$2 = isObjectLike_1;
+
+ /** `Object#toString` result references. */
+ var setTag$1 = '[object Set]';
+
+ /**
+ * The base implementation of `_.isSet` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
+ */
+ function baseIsSet$1(value) {
+ return isObjectLike$2(value) && getTag$1(value) == setTag$1;
+ }
+
+ var _baseIsSet = baseIsSet$1;
+
+ var baseIsSet = _baseIsSet,
+ baseUnary$1 = _baseUnary,
+ nodeUtil$1 = _nodeUtilExports;
+
+ /* Node.js helper references. */
+ var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
+
+ /**
+ * Checks if `value` is classified as a `Set` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
+ * @example
+ *
+ * _.isSet(new Set);
+ * // => true
+ *
+ * _.isSet(new WeakSet);
+ * // => false
+ */
+ var isSet$2 = nodeIsSet ? baseUnary$1(nodeIsSet) : baseIsSet;
+
+ var isSet_1 = isSet$2;
+
+ var Stack = _Stack,
+ arrayEach = _arrayEach,
+ assignValue = _assignValue,
+ baseAssign = _baseAssign,
+ baseAssignIn = _baseAssignIn,
+ cloneBuffer = _cloneBufferExports,
+ copyArray = _copyArray,
+ copySymbols = _copySymbols,
+ copySymbolsIn = _copySymbolsIn,
+ getAllKeys = _getAllKeys,
+ getAllKeysIn = _getAllKeysIn,
+ getTag = _getTag,
+ initCloneArray = _initCloneArray,
+ initCloneByTag = _initCloneByTag,
+ initCloneObject = _initCloneObject,
+ isArray$2 = isArray_1,
+ isBuffer$2 = isBufferExports,
+ isMap$1 = isMap_1,
+ isObject$1 = isObject_1,
+ isSet$1 = isSet_1,
+ keys = keys_1;
+
+ /** Used to compose bitmasks for cloning. */
+ var CLONE_DEEP_FLAG = 1,
+ CLONE_FLAT_FLAG = 2,
+ CLONE_SYMBOLS_FLAG$1 = 4;
+
+ /** `Object#toString` result references. */
+ var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag$1 = '[object Object]',
+ regexpTag$1 = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ symbolTag = '[object Symbol]',
+ weakMapTag = '[object WeakMap]';
+
+ var arrayBufferTag = '[object ArrayBuffer]',
+ dataViewTag = '[object DataView]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
+ var cloneableTags = {};
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
+ cloneableTags[numberTag] = cloneableTags[objectTag$1] =
+ cloneableTags[regexpTag$1] = cloneableTags[setTag] =
+ cloneableTags[stringTag] = cloneableTags[symbolTag] =
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
+ cloneableTags[weakMapTag] = false;
+
+ /**
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
+ * traversed objects.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} bitmask The bitmask flags.
+ * 1 - Deep clone
+ * 2 - Flatten inherited properties
+ * 4 - Clone symbols
+ * @param {Function} [customizer] The function to customize cloning.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The parent object of `value`.
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+ function baseClone$1(value, bitmask, customizer, key, object, stack) {
+ var result,
+ isDeep = bitmask & CLONE_DEEP_FLAG,
+ isFlat = bitmask & CLONE_FLAT_FLAG,
+ isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
+
+ if (customizer) {
+ result = object ? customizer(value, key, object, stack) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject$1(value)) {
+ return value;
+ }
+ var isArr = isArray$2(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return copyArray(value, result);
+ }
+ } else {
+ var tag = getTag(value),
+ isFunc = tag == funcTag || tag == genTag;
+
+ if (isBuffer$2(value)) {
+ return cloneBuffer(value, isDeep);
+ }
+ if (tag == objectTag$1 || tag == argsTag || (isFunc && !object)) {
+ result = (isFlat || isFunc) ? {} : initCloneObject(value);
+ if (!isDeep) {
+ return isFlat
+ ? copySymbolsIn(value, baseAssignIn(result, value))
+ : copySymbols(value, baseAssign(result, value));
+ }
+ } else {
+ if (!cloneableTags[tag]) {
+ return object ? value : {};
+ }
+ result = initCloneByTag(value, tag, isDeep);
+ }
+ }
+ // Check for circular references and return its corresponding clone.
+ stack || (stack = new Stack);
+ var stacked = stack.get(value);
+ if (stacked) {
+ return stacked;
+ }
+ stack.set(value, result);
+
+ if (isSet$1(value)) {
+ value.forEach(function(subValue) {
+ result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
+ });
+ } else if (isMap$1(value)) {
+ value.forEach(function(subValue, key) {
+ result.set(key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
+ });
+ }
+
+ var keysFunc = isFull
+ ? (isFlat ? getAllKeysIn : getAllKeys)
+ : (isFlat ? keysIn : keys);
+
+ var props = isArr ? undefined : keysFunc(value);
+ arrayEach(props || value, function(subValue, key) {
+ if (props) {
+ key = subValue;
+ subValue = value[key];
+ }
+ // Recursively populate clone (susceptible to call stack limits).
+ assignValue(result, key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
+ });
+ return result;
+ }
+
+ var _baseClone = baseClone$1;
+
+ var baseClone = _baseClone;
+
+ /** Used to compose bitmasks for cloning. */
+ var CLONE_SYMBOLS_FLAG = 4;
+
+ /**
+ * Creates a shallow clone of `value`.
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
+ * and supports cloning arrays, array buffers, booleans, date objects, maps,
+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
+ * arrays. The own enumerable properties of `arguments` objects are cloned
+ * as plain objects. An empty object is returned for uncloneable values such
+ * as error objects, functions, DOM nodes, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @returns {*} Returns the cloned value.
+ * @see _.cloneDeep
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var shallow = _.clone(objects);
+ * console.log(shallow[0] === objects[0]);
+ * // => true
+ */
+ function clone$2(value) {
+ return baseClone(value, CLONE_SYMBOLS_FLAG);
+ }
+
+ var clone_1 = clone$2;
+
+ var definitions = {};
+
+ var core = {};
+
+ var is = {};
+
+ var isType$1 = {};
+
+ var hasRequiredIsType;
+
+ function requireIsType () {
+ if (hasRequiredIsType) return isType$1;
+ hasRequiredIsType = 1;
+
+ Object.defineProperty(isType$1, "__esModule", {
+ value: true
+ });
+ isType$1.default = isType;
+
+ var _definitions = requireDefinitions();
+
+ function isType(nodeType, targetType) {
+ if (nodeType === targetType) return true;
+ if (_definitions.ALIAS_KEYS[targetType]) return false;
+ const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
+
+ if (aliases) {
+ if (aliases[0] === nodeType) return true;
+
+ for (const alias of aliases) {
+ if (nodeType === alias) return true;
+ }
+ }
+
+ return false;
+ }
+ return isType$1;
+ }
+
+ var isPlaceholderType = {};
+
+ var hasRequiredIsPlaceholderType;
+
+ function requireIsPlaceholderType () {
+ if (hasRequiredIsPlaceholderType) return isPlaceholderType;
+ hasRequiredIsPlaceholderType = 1;
+
+ Object.defineProperty(isPlaceholderType, "__esModule", {
+ value: true
+ });
+ isPlaceholderType.default = isPlaceholderType$1;
+
+ var _definitions = requireDefinitions();
+
+ function isPlaceholderType$1(placeholderType, targetType) {
+ if (placeholderType === targetType) return true;
+ const aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType];
+
+ if (aliases) {
+ for (const alias of aliases) {
+ if (targetType === alias) return true;
+ }
+ }
+
+ return false;
+ }
+ return isPlaceholderType;
+ }
+
+ var hasRequiredIs;
+
+ function requireIs () {
+ if (hasRequiredIs) return is;
+ hasRequiredIs = 1;
+
+ Object.defineProperty(is, "__esModule", {
+ value: true
+ });
+ is.default = is$1;
+
+ var _shallowEqual = _interopRequireDefault(shallowEqual$1);
+
+ var _isType = _interopRequireDefault(requireIsType());
+
+ var _isPlaceholderType = _interopRequireDefault(requireIsPlaceholderType());
+
+ var _definitions = requireDefinitions();
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function is$1(type, node, opts) {
+ if (!node) return false;
+ const matches = (0, _isType.default)(node.type, type);
+
+ if (!matches) {
+ if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
+ return (0, _isPlaceholderType.default)(node.expectedNode, type);
+ }
+
+ return false;
+ }
+
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+ return is;
+ }
+
+ var isValidIdentifier$1 = {};
+
+ var lib$3 = {};
+
+ var identifier = {};
+
+ Object.defineProperty(identifier, "__esModule", {
+ value: true
+ });
+ identifier.isIdentifierStart = isIdentifierStart$2;
+ identifier.isIdentifierChar = isIdentifierChar$2;
+ identifier.isIdentifierName = isIdentifierName;
+ let nonASCIIidentifierStartChars$2 = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+ let nonASCIIidentifierChars$2 = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+ const nonASCIIidentifierStart$2 = new RegExp("[" + nonASCIIidentifierStartChars$2 + "]");
+ const nonASCIIidentifier$2 = new RegExp("[" + nonASCIIidentifierStartChars$2 + nonASCIIidentifierChars$2 + "]");
+ nonASCIIidentifierStartChars$2 = nonASCIIidentifierChars$2 = null;
+ const astralIdentifierStartCodes$2 = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+ const astralIdentifierCodes$2 = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+ function isInAstralSet$2(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+ }
+
+ function isIdentifierStart$2(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart$2.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet$2(code, astralIdentifierStartCodes$2);
+ }
+
+ function isIdentifierChar$2(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier$2.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet$2(code, astralIdentifierStartCodes$2) || isInAstralSet$2(code, astralIdentifierCodes$2);
+ }
+
+ function isIdentifierName(name) {
+ let isFirst = true;
+
+ for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {
+ const char = _Array$from[_i];
+ const cp = char.codePointAt(0);
+
+ if (isFirst) {
+ if (!isIdentifierStart$2(cp)) {
+ return false;
+ }
+
+ isFirst = false;
+ } else if (!isIdentifierChar$2(cp)) {
+ return false;
+ }
+ }
+
+ return !isFirst;
+ }
+
+ var keyword = {};
+
+ Object.defineProperty(keyword, "__esModule", {
+ value: true
+ });
+ keyword.isReservedWord = isReservedWord$2;
+ keyword.isStrictReservedWord = isStrictReservedWord$2;
+ keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord$2;
+ keyword.isStrictBindReservedWord = isStrictBindReservedWord$2;
+ keyword.isKeyword = isKeyword$2;
+ const reservedWords$2 = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+ };
+ const keywords$3 = new Set(reservedWords$2.keyword);
+ const reservedWordsStrictSet$2 = new Set(reservedWords$2.strict);
+ const reservedWordsStrictBindSet$2 = new Set(reservedWords$2.strictBind);
+
+ function isReservedWord$2(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+ }
+
+ function isStrictReservedWord$2(word, inModule) {
+ return isReservedWord$2(word, inModule) || reservedWordsStrictSet$2.has(word);
+ }
+
+ function isStrictBindOnlyReservedWord$2(word) {
+ return reservedWordsStrictBindSet$2.has(word);
+ }
+
+ function isStrictBindReservedWord$2(word, inModule) {
+ return isStrictReservedWord$2(word, inModule) || isStrictBindOnlyReservedWord$2(word);
+ }
+
+ function isKeyword$2(word) {
+ return keywords$3.has(word);
+ }
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.defineProperty(exports, "isIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierName;
+ }
+ });
+ Object.defineProperty(exports, "isIdentifierChar", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierChar;
+ }
+ });
+ Object.defineProperty(exports, "isIdentifierStart", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierStart;
+ }
+ });
+ Object.defineProperty(exports, "isReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindOnlyReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isStrictBindReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isStrictReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictReservedWord;
+ }
+ });
+ Object.defineProperty(exports, "isKeyword", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isKeyword;
+ }
+ });
+
+ var _identifier = identifier;
+
+ var _keyword = keyword;
+ } (lib$3));
+
+ Object.defineProperty(isValidIdentifier$1, "__esModule", {
+ value: true
+ });
+ isValidIdentifier$1.default = isValidIdentifier;
+
+ var _helperValidatorIdentifier = lib$3;
+
+ function isValidIdentifier(name, reserved = true) {
+ if (typeof name !== "string") return false;
+
+ if (reserved) {
+ if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name)) {
+ return false;
+ } else if (name === "await") {
+ return false;
+ }
+ }
+
+ return (0, _helperValidatorIdentifier.isIdentifierName)(name);
+ }
+
+ var constants = {};
+
+ Object.defineProperty(constants, "__esModule", {
+ value: true
+ });
+ constants.NOT_LOCAL_BINDING = constants.BLOCK_SCOPED_SYMBOL = constants.INHERIT_KEYS = constants.UNARY_OPERATORS = constants.STRING_UNARY_OPERATORS = constants.NUMBER_UNARY_OPERATORS = constants.BOOLEAN_UNARY_OPERATORS = constants.ASSIGNMENT_OPERATORS = constants.BINARY_OPERATORS = constants.NUMBER_BINARY_OPERATORS = constants.BOOLEAN_BINARY_OPERATORS = constants.COMPARISON_BINARY_OPERATORS = constants.EQUALITY_BINARY_OPERATORS = constants.BOOLEAN_NUMBER_BINARY_OPERATORS = constants.UPDATE_OPERATORS = constants.LOGICAL_OPERATORS = constants.COMMENT_KEYS = constants.FOR_INIT_KEYS = constants.FLATTENABLE_KEYS = constants.STATEMENT_OR_BLOCK_KEYS = void 0;
+ const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
+ constants.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
+ const FLATTENABLE_KEYS = ["body", "expressions"];
+ constants.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
+ const FOR_INIT_KEYS = ["left", "init"];
+ constants.FOR_INIT_KEYS = FOR_INIT_KEYS;
+ const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
+ constants.COMMENT_KEYS = COMMENT_KEYS;
+ const LOGICAL_OPERATORS = ["||", "&&", "??"];
+ constants.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
+ const UPDATE_OPERATORS = ["++", "--"];
+ constants.UPDATE_OPERATORS = UPDATE_OPERATORS;
+ const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
+ constants.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
+ const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
+ constants.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
+ const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
+ constants.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
+ const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
+ constants.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
+ const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
+ constants.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
+ const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];
+ constants.BINARY_OPERATORS = BINARY_OPERATORS;
+ const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")];
+ constants.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;
+ const BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
+ constants.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
+ const NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
+ constants.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
+ const STRING_UNARY_OPERATORS = ["typeof"];
+ constants.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
+ const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
+ constants.UNARY_OPERATORS = UNARY_OPERATORS;
+ const INHERIT_KEYS = {
+ optional: ["typeAnnotation", "typeParameters", "returnType"],
+ force: ["start", "loc", "end"]
+ };
+ constants.INHERIT_KEYS = INHERIT_KEYS;
+ const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
+ constants.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
+ const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
+ constants.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
+
+ var utils = {};
+
+ var validate = {};
+
+ var hasRequiredValidate;
+
+ function requireValidate () {
+ if (hasRequiredValidate) return validate;
+ hasRequiredValidate = 1;
+
+ Object.defineProperty(validate, "__esModule", {
+ value: true
+ });
+ validate.default = validate$1;
+ validate.validateField = validateField;
+ validate.validateChild = validateChild;
+
+ var _definitions = requireDefinitions();
+
+ function validate$1(node, key, val) {
+ if (!node) return;
+ const fields = _definitions.NODE_FIELDS[node.type];
+ if (!fields) return;
+ const field = fields[key];
+ validateField(node, key, val, field);
+ validateChild(node, key, val);
+ }
+
+ function validateField(node, key, val, field) {
+ if (!(field == null ? void 0 : field.validate)) return;
+ if (field.optional && val == null) return;
+ field.validate(node, key, val);
+ }
+
+ function validateChild(node, key, val) {
+ if (val == null) return;
+ const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];
+ if (!validate) return;
+ validate(node, key, val);
+ }
+ return validate;
+ }
+
+ var hasRequiredUtils;
+
+ function requireUtils () {
+ if (hasRequiredUtils) return utils;
+ hasRequiredUtils = 1;
+
+ Object.defineProperty(utils, "__esModule", {
+ value: true
+ });
+ utils.validate = validate;
+ utils.typeIs = typeIs;
+ utils.validateType = validateType;
+ utils.validateOptional = validateOptional;
+ utils.validateOptionalType = validateOptionalType;
+ utils.arrayOf = arrayOf;
+ utils.arrayOfType = arrayOfType;
+ utils.validateArrayOfType = validateArrayOfType;
+ utils.assertEach = assertEach;
+ utils.assertOneOf = assertOneOf;
+ utils.assertNodeType = assertNodeType;
+ utils.assertNodeOrValueType = assertNodeOrValueType;
+ utils.assertValueType = assertValueType;
+ utils.assertShape = assertShape;
+ utils.assertOptionalChainStart = assertOptionalChainStart;
+ utils.chain = chain;
+ utils.default = defineType;
+ utils.NODE_PARENT_VALIDATIONS = utils.DEPRECATED_KEYS = utils.BUILDER_KEYS = utils.NODE_FIELDS = utils.FLIPPED_ALIAS_KEYS = utils.ALIAS_KEYS = utils.VISITOR_KEYS = void 0;
+
+ var _is = _interopRequireDefault(requireIs());
+
+ var _validate = requireValidate();
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ const VISITOR_KEYS = {};
+ utils.VISITOR_KEYS = VISITOR_KEYS;
+ const ALIAS_KEYS = {};
+ utils.ALIAS_KEYS = ALIAS_KEYS;
+ const FLIPPED_ALIAS_KEYS = {};
+ utils.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
+ const NODE_FIELDS = {};
+ utils.NODE_FIELDS = NODE_FIELDS;
+ const BUILDER_KEYS = {};
+ utils.BUILDER_KEYS = BUILDER_KEYS;
+ const DEPRECATED_KEYS = {};
+ utils.DEPRECATED_KEYS = DEPRECATED_KEYS;
+ const NODE_PARENT_VALIDATIONS = {};
+ utils.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
+
+ function getType(val) {
+ if (Array.isArray(val)) {
+ return "array";
+ } else if (val === null) {
+ return "null";
+ } else {
+ return typeof val;
+ }
+ }
+
+ function validate(validate) {
+ return {
+ validate
+ };
+ }
+
+ function typeIs(typeName) {
+ return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
+ }
+
+ function validateType(typeName) {
+ return validate(typeIs(typeName));
+ }
+
+ function validateOptional(validate) {
+ return {
+ validate,
+ optional: true
+ };
+ }
+
+ function validateOptionalType(typeName) {
+ return {
+ validate: typeIs(typeName),
+ optional: true
+ };
+ }
+
+ function arrayOf(elementType) {
+ return chain(assertValueType("array"), assertEach(elementType));
+ }
+
+ function arrayOfType(typeName) {
+ return arrayOf(typeIs(typeName));
+ }
+
+ function validateArrayOfType(typeName) {
+ return validate(arrayOfType(typeName));
+ }
+
+ function assertEach(callback) {
+ function validator(node, key, val) {
+ if (!Array.isArray(val)) return;
+
+ for (let i = 0; i < val.length; i++) {
+ const subkey = `${key}[${i}]`;
+ const v = val[i];
+ callback(node, subkey, v);
+ if (process$1.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v);
+ }
+ }
+
+ validator.each = callback;
+ return validator;
+ }
+
+ function assertOneOf(...values) {
+ function validate(node, key, val) {
+ if (values.indexOf(val) < 0) {
+ throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
+ }
+ }
+
+ validate.oneOf = values;
+ return validate;
+ }
+
+ function assertNodeType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if ((0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeTypes = types;
+ return validate;
+ }
+
+ function assertNodeOrValueType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if (getType(val) === type || (0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeOrValueTypes = types;
+ return validate;
+ }
+
+ function assertValueType(type) {
+ function validate(node, key, val) {
+ const valid = getType(val) === type;
+
+ if (!valid) {
+ throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
+ }
+ }
+
+ validate.type = type;
+ return validate;
+ }
+
+ function assertShape(shape) {
+ function validate(node, key, val) {
+ const errors = [];
+
+ for (const property of Object.keys(shape)) {
+ try {
+ (0, _validate.validateField)(node, property, val[property], shape[property]);
+ } catch (error) {
+ if (error instanceof TypeError) {
+ errors.push(error.message);
+ continue;
+ }
+
+ throw error;
+ }
+ }
+
+ if (errors.length) {
+ throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
+ }
+ }
+
+ validate.shapeOf = shape;
+ return validate;
+ }
+
+ function assertOptionalChainStart() {
+ function validate(node) {
+ var _current;
+
+ let current = node;
+
+ while (node) {
+ const {
+ type
+ } = current;
+
+ if (type === "OptionalCallExpression") {
+ if (current.optional) return;
+ current = current.callee;
+ continue;
+ }
+
+ if (type === "OptionalMemberExpression") {
+ if (current.optional) return;
+ current = current.object;
+ continue;
+ }
+
+ break;
+ }
+
+ throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
+ }
+
+ return validate;
+ }
+
+ function chain(...fns) {
+ function validate(...args) {
+ for (const fn of fns) {
+ fn(...args);
+ }
+ }
+
+ validate.chainOf = fns;
+ return validate;
+ }
+
+ const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
+ const validFieldKeys = ["default", "optional", "validate"];
+
+ function defineType(type, opts = {}) {
+ const inherits = opts.inherits && store[opts.inherits] || {};
+ let fields = opts.fields;
+
+ if (!fields) {
+ fields = {};
+
+ if (inherits.fields) {
+ const keys = Object.getOwnPropertyNames(inherits.fields);
+
+ for (const key of keys) {
+ const field = inherits.fields[key];
+ fields[key] = {
+ default: field.default,
+ optional: field.optional,
+ validate: field.validate
+ };
+ }
+ }
+ }
+
+ const visitor = opts.visitor || inherits.visitor || [];
+ const aliases = opts.aliases || inherits.aliases || [];
+ const builder = opts.builder || inherits.builder || opts.visitor || [];
+
+ for (const k of Object.keys(opts)) {
+ if (validTypeOpts.indexOf(k) === -1) {
+ throw new Error(`Unknown type option "${k}" on ${type}`);
+ }
+ }
+
+ if (opts.deprecatedAlias) {
+ DEPRECATED_KEYS[opts.deprecatedAlias] = type;
+ }
+
+ for (const key of visitor.concat(builder)) {
+ fields[key] = fields[key] || {};
+ }
+
+ for (const key of Object.keys(fields)) {
+ const field = fields[key];
+
+ if (field.default !== undefined && builder.indexOf(key) === -1) {
+ field.optional = true;
+ }
+
+ if (field.default === undefined) {
+ field.default = null;
+ } else if (!field.validate && field.default != null) {
+ field.validate = assertValueType(getType(field.default));
+ }
+
+ for (const k of Object.keys(field)) {
+ if (validFieldKeys.indexOf(k) === -1) {
+ throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
+ }
+ }
+ }
+
+ VISITOR_KEYS[type] = opts.visitor = visitor;
+ BUILDER_KEYS[type] = opts.builder = builder;
+ NODE_FIELDS[type] = opts.fields = fields;
+ ALIAS_KEYS[type] = opts.aliases = aliases;
+ aliases.forEach(alias => {
+ FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
+ FLIPPED_ALIAS_KEYS[alias].push(type);
+ });
+
+ if (opts.validate) {
+ NODE_PARENT_VALIDATIONS[type] = opts.validate;
+ }
+
+ store[type] = opts;
+ }
+
+ const store = {};
+ return utils;
+ }
+
+ var hasRequiredCore;
+
+ function requireCore () {
+ if (hasRequiredCore) return core;
+ hasRequiredCore = 1;
+
+ Object.defineProperty(core, "__esModule", {
+ value: true
+ });
+ core.patternLikeCommon = core.functionDeclarationCommon = core.functionTypeAnnotationCommon = core.functionCommon = void 0;
+
+ var _is = _interopRequireDefault(requireIs());
+
+ var _isValidIdentifier = _interopRequireDefault(isValidIdentifier$1);
+
+ var _helperValidatorIdentifier = lib$3;
+
+ var _constants = constants;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ (0, _utils.default)("ArrayExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
+ default: !process$1.env.BABEL_TYPES_8_BREAKING ? [] : undefined
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("AssignmentExpression", {
+ fields: {
+ operator: {
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertValueType)("string");
+ }
+
+ const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS);
+ const pattern = (0, _utils.assertOneOf)("=");
+ return function (node, key, val) {
+ const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier;
+ validator(node, key, val);
+ };
+ }()
+ },
+ left: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ builder: ["operator", "left", "right"],
+ visitor: ["left", "right"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("BinaryExpression", {
+ builder: ["operator", "left", "right"],
+ fields: {
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS)
+ },
+ left: {
+ validate: function () {
+ const expression = (0, _utils.assertNodeType)("Expression");
+ const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName");
+
+ const validator = function (node, key, val) {
+ const validator = node.operator === "in" ? inOp : expression;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "PrivateName"];
+ return validator;
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ visitor: ["left", "right"],
+ aliases: ["Binary", "Expression"]
+ });
+ (0, _utils.default)("InterpreterDirective", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("Directive", {
+ visitor: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertNodeType)("DirectiveLiteral")
+ }
+ }
+ });
+ (0, _utils.default)("DirectiveLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("BlockStatement", {
+ builder: ["body", "directives"],
+ visitor: ["directives", "body"],
+ fields: {
+ directives: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
+ default: []
+ },
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent", "Block", "Statement"]
+ });
+ (0, _utils.default)("BreakStatement", {
+ visitor: ["label"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ },
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"]
+ });
+ (0, _utils.default)("CallExpression", {
+ visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
+ builder: ["callee", "arguments"],
+ aliases: ["Expression"],
+ fields: Object.assign({
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
+ }
+ }, !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ optional: {
+ validate: (0, _utils.assertOneOf)(true, false),
+ optional: true
+ }
+ } : {}, {
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("CatchClause", {
+ visitor: ["param", "body"],
+ fields: {
+ param: {
+ validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ },
+ aliases: ["Scopable", "BlockParent"]
+ });
+ (0, _utils.default)("ConditionalExpression", {
+ visitor: ["test", "consequent", "alternate"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ consequent: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ alternate: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression", "Conditional"]
+ });
+ (0, _utils.default)("ContinueStatement", {
+ visitor: ["label"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ },
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"]
+ });
+ (0, _utils.default)("DebuggerStatement", {
+ aliases: ["Statement"]
+ });
+ (0, _utils.default)("DoWhileStatement", {
+ visitor: ["test", "body"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ },
+ aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
+ });
+ (0, _utils.default)("EmptyStatement", {
+ aliases: ["Statement"]
+ });
+ (0, _utils.default)("ExpressionStatement", {
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Statement", "ExpressionWrapper"]
+ });
+ (0, _utils.default)("File", {
+ builder: ["program", "comments", "tokens"],
+ visitor: ["program"],
+ fields: {
+ program: {
+ validate: (0, _utils.assertNodeType)("Program")
+ },
+ comments: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
+ each: {
+ oneOfNodeTypes: ["CommentBlock", "CommentLine"]
+ }
+ }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")),
+ optional: true
+ },
+ tokens: {
+ validate: (0, _utils.assertEach)(Object.assign(() => {}, {
+ type: "any"
+ })),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ForInStatement", {
+ visitor: ["left", "right", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("ForStatement", {
+ visitor: ["init", "test", "update", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
+ fields: {
+ init: {
+ validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"),
+ optional: true
+ },
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ update: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ const functionCommon = {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
+ },
+ generator: {
+ default: false
+ },
+ async: {
+ default: false
+ }
+ };
+ core.functionCommon = functionCommon;
+ const functionTypeAnnotationCommon = {
+ returnType: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ }
+ };
+ core.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
+ const functionDeclarationCommon = Object.assign({}, functionCommon, {
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ });
+ core.functionDeclarationCommon = functionDeclarationCommon;
+ (0, _utils.default)("FunctionDeclaration", {
+ builder: ["id", "params", "body", "generator", "async"],
+ visitor: ["id", "params", "body", "returnType", "typeParameters"],
+ fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }),
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return () => {};
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+ });
+ (0, _utils.default)("FunctionExpression", {
+ inherits: "FunctionDeclaration",
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+ });
+ const patternLikeCommon = {
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
+ }
+ };
+ core.patternLikeCommon = patternLikeCommon;
+ (0, _utils.default)("Identifier", {
+ builder: ["name"],
+ visitor: ["typeAnnotation", "decorators"],
+ aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
+ fields: Object.assign({}, patternLikeCommon, {
+ name: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _isValidIdentifier.default)(val, false)) {
+ throw new TypeError(`"${val}" is not a valid identifier name`);
+ }
+ }, {
+ type: "string"
+ }))
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }),
+
+ validate(parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const match = /\.(\w+)$/.exec(key);
+ if (!match) return;
+ const [, parentKey] = match;
+ const nonComp = {
+ computed: false
+ };
+
+ if (parentKey === "property") {
+ if ((0, _is.default)("MemberExpression", parent, nonComp)) return;
+ if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return;
+ } else if (parentKey === "key") {
+ if ((0, _is.default)("Property", parent, nonComp)) return;
+ if ((0, _is.default)("Method", parent, nonComp)) return;
+ } else if (parentKey === "exported") {
+ if ((0, _is.default)("ExportSpecifier", parent)) return;
+ } else if (parentKey === "imported") {
+ if ((0, _is.default)("ImportSpecifier", parent, {
+ imported: node
+ })) return;
+ } else if (parentKey === "meta") {
+ if ((0, _is.default)("MetaProperty", parent, {
+ meta: node
+ })) return;
+ }
+
+ if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name)) && node.name !== "this") {
+ throw new TypeError(`"${node.name}" is not a valid identifier`);
+ }
+ }
+
+ });
+ (0, _utils.default)("IfStatement", {
+ visitor: ["test", "consequent", "alternate"],
+ aliases: ["Statement", "Conditional"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ consequent: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ alternate: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("LabeledStatement", {
+ visitor: ["label", "body"],
+ aliases: ["Statement"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("StringLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("NumericLiteral", {
+ builder: ["value"],
+ deprecatedAlias: "NumberLiteral",
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("number")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("NullLiteral", {
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("BooleanLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("boolean")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("RegExpLiteral", {
+ builder: ["pattern", "flags"],
+ deprecatedAlias: "RegexLiteral",
+ aliases: ["Expression", "Pureish", "Literal"],
+ fields: {
+ pattern: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ flags: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const invalid = /[^gimsuy]/.exec(val);
+
+ if (invalid) {
+ throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
+ }
+ }, {
+ type: "string"
+ })),
+ default: ""
+ }
+ }
+ });
+ (0, _utils.default)("LogicalExpression", {
+ builder: ["operator", "left", "right"],
+ visitor: ["left", "right"],
+ aliases: ["Binary", "Expression"],
+ fields: {
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS)
+ },
+ left: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("MemberExpression", {
+ builder: ["object", "property", "computed", "optional"],
+ visitor: ["object", "property"],
+ aliases: ["Expression", "LVal"],
+ fields: Object.assign({
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ }
+ }, !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ optional: {
+ validate: (0, _utils.assertOneOf)(true, false),
+ optional: true
+ }
+ } : {})
+ });
+ (0, _utils.default)("NewExpression", {
+ inherits: "CallExpression"
+ });
+ (0, _utils.default)("Program", {
+ visitor: ["directives", "body"],
+ builder: ["body", "directives", "sourceType", "interpreter"],
+ fields: {
+ sourceFile: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ sourceType: {
+ validate: (0, _utils.assertOneOf)("script", "module"),
+ default: "script"
+ },
+ interpreter: {
+ validate: (0, _utils.assertNodeType)("InterpreterDirective"),
+ default: null,
+ optional: true
+ },
+ directives: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
+ default: []
+ },
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent", "Block"]
+ });
+ (0, _utils.default)("ObjectExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
+ }
+ }
+ });
+ (0, _utils.default)("ObjectMethod", {
+ builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ kind: Object.assign({
+ validate: (0, _utils.assertOneOf)("method", "get", "set")
+ }, !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ default: "method"
+ } : {}),
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }),
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
+ });
+ (0, _utils.default)("ObjectProperty", {
+ builder: ["key", "value", "computed", "shorthand", ...(!process$1.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
+ fields: {
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
+ },
+ shorthand: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.computed) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
+ }
+ }, {
+ type: "boolean"
+ }), function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !(0, _is.default)("Identifier", node.key)) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
+ }
+ }),
+ default: false
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ },
+ visitor: ["key", "value", "decorators"],
+ aliases: ["UserWhitespacable", "Property", "ObjectMember"],
+ validate: function () {
+ const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern");
+ const expression = (0, _utils.assertNodeType)("Expression");
+ return function (parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression;
+ validator(node, "value", node.value);
+ };
+ }()
+ });
+ (0, _utils.default)("RestElement", {
+ visitor: ["argument", "typeAnnotation"],
+ builder: ["argument"],
+ aliases: ["LVal", "PatternLike"],
+ deprecatedAlias: "RestProperty",
+ fields: Object.assign({}, patternLikeCommon, {
+ argument: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "Pattern", "MemberExpression")
+ }
+ }),
+
+ validate(parent, key) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ const match = /(\w+)\[(\d+)\]/.exec(key);
+ if (!match) throw new Error("Internal Babel error: malformed key.");
+ const [, listKey, index] = match;
+
+ if (parent[listKey].length > index + 1) {
+ throw new TypeError(`RestElement must be last element of ${listKey}`);
+ }
+ }
+
+ });
+ (0, _utils.default)("ReturnStatement", {
+ visitor: ["argument"],
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("SequenceExpression", {
+ visitor: ["expressions"],
+ fields: {
+ expressions: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
+ }
+ },
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("ParenthesizedExpression", {
+ visitor: ["expression"],
+ aliases: ["Expression", "ExpressionWrapper"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("SwitchCase", {
+ visitor: ["test", "consequent"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ consequent: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ }
+ });
+ (0, _utils.default)("SwitchStatement", {
+ visitor: ["discriminant", "cases"],
+ aliases: ["Statement", "BlockParent", "Scopable"],
+ fields: {
+ discriminant: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ cases: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase")))
+ }
+ }
+ });
+ (0, _utils.default)("ThisExpression", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("ThrowStatement", {
+ visitor: ["argument"],
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("TryStatement", {
+ visitor: ["block", "handler", "finalizer"],
+ aliases: ["Statement"],
+ fields: {
+ block: {
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!node.handler && !node.finalizer) {
+ throw new TypeError("TryStatement expects either a handler or finalizer, or both");
+ }
+ }, {
+ oneOfNodeTypes: ["BlockStatement"]
+ }))
+ },
+ handler: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("CatchClause")
+ },
+ finalizer: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }
+ });
+ (0, _utils.default)("UnaryExpression", {
+ builder: ["operator", "argument", "prefix"],
+ fields: {
+ prefix: {
+ default: true
+ },
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS)
+ }
+ },
+ visitor: ["argument"],
+ aliases: ["UnaryLike", "Expression"]
+ });
+ (0, _utils.default)("UpdateExpression", {
+ builder: ["operator", "argument", "prefix"],
+ fields: {
+ prefix: {
+ default: false
+ },
+ argument: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression")
+ },
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS)
+ }
+ },
+ visitor: ["argument"],
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("VariableDeclaration", {
+ builder: ["kind", "declarations"],
+ visitor: ["declarations"],
+ aliases: ["Statement", "Declaration"],
+ fields: {
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ kind: {
+ validate: (0, _utils.assertOneOf)("var", "let", "const")
+ },
+ declarations: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
+ }
+ },
+
+ validate(parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ if (!(0, _is.default)("ForXStatement", parent, {
+ left: node
+ })) return;
+
+ if (node.declarations.length !== 1) {
+ throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
+ }
+ }
+
+ });
+ (0, _utils.default)("VariableDeclarator", {
+ visitor: ["id", "init"],
+ fields: {
+ id: {
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("LVal");
+ }
+
+ const normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
+ const without = (0, _utils.assertNodeType)("Identifier");
+ return function (node, key, val) {
+ const validator = node.init ? normal : without;
+ validator(node, key, val);
+ };
+ }()
+ },
+ definite: {
+ optional: true,
+ validate: (0, _utils.assertValueType)("boolean")
+ },
+ init: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("WhileStatement", {
+ visitor: ["test", "body"],
+ aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ (0, _utils.default)("WithStatement", {
+ visitor: ["object", "body"],
+ aliases: ["Statement"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+ });
+ return core;
+ }
+
+ var es2015 = {};
+
+ var hasRequiredEs2015;
+
+ function requireEs2015 () {
+ if (hasRequiredEs2015) return es2015;
+ hasRequiredEs2015 = 1;
+
+ Object.defineProperty(es2015, "__esModule", {
+ value: true
+ });
+ es2015.classMethodOrDeclareMethodCommon = es2015.classMethodOrPropertyCommon = void 0;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ var _core = requireCore();
+
+ var _is = _interopRequireDefault(requireIs());
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ (0, _utils.default)("AssignmentPattern", {
+ visitor: ["left", "right", "decorators"],
+ builder: ["left", "right"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, _core.patternLikeCommon, {
+ left: {
+ validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("ArrayPattern", {
+ visitor: ["elements", "typeAnnotation"],
+ builder: ["elements"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, _core.patternLikeCommon, {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike")))
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("ArrowFunctionExpression", {
+ builder: ["params", "body", "async"],
+ visitor: ["params", "body", "returnType", "typeParameters"],
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
+ fields: Object.assign({}, _core.functionCommon, _core.functionTypeAnnotationCommon, {
+ expression: {
+ validate: (0, _utils.assertValueType)("boolean")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
+ }
+ })
+ });
+ (0, _utils.default)("ClassBody", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
+ }
+ }
+ });
+ (0, _utils.default)("ClassExpression", {
+ builder: ["id", "superClass", "body", "decorators"],
+ visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
+ aliases: ["Scopable", "Class", "Expression"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("ClassBody")
+ },
+ superClass: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ superTypeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ },
+ implements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ClassDeclaration", {
+ inherits: "ClassExpression",
+ aliases: ["Scopable", "Class", "Statement", "Declaration"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("ClassBody")
+ },
+ superClass: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ superTypeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ },
+ implements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ },
+ validate: function () {
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+ });
+ (0, _utils.default)("ExportAllDeclaration", {
+ visitor: ["source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ }
+ }
+ });
+ (0, _utils.default)("ExportDefaultDeclaration", {
+ visitor: ["declaration"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ declaration: {
+ validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
+ }
+ }
+ });
+ (0, _utils.default)("ExportNamedDeclaration", {
+ visitor: ["declaration", "specifiers", "source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ declaration: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.specifiers.length) {
+ throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
+ }
+ }, {
+ oneOfNodeTypes: ["Declaration"]
+ }), function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.source) {
+ throw new TypeError("Cannot export a declaration from a source");
+ }
+ })
+ },
+ specifiers: {
+ default: [],
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function () {
+ const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
+ const sourceless = (0, _utils.assertNodeType)("ExportSpecifier");
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return sourced;
+ return function (node, key, val) {
+ const validator = node.source ? sourced : sourceless;
+ validator(node, key, val);
+ };
+ }()))
+ },
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral"),
+ optional: true
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
+ }
+ });
+ (0, _utils.default)("ExportSpecifier", {
+ visitor: ["local", "exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("ForOfStatement", {
+ visitor: ["left", "right", "body"],
+ builder: ["left", "right", "body", "await"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: function () {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("VariableDeclaration", "LVal");
+ }
+
+ const declaration = (0, _utils.assertNodeType)("VariableDeclaration");
+ const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
+ return function (node, key, val) {
+ if ((0, _is.default)("VariableDeclaration", val)) {
+ declaration(node, key, val);
+ } else {
+ lval(node, key, val);
+ }
+ };
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ await: {
+ default: false
+ }
+ }
+ });
+ (0, _utils.default)("ImportDeclaration", {
+ visitor: ["specifiers", "source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration"],
+ fields: {
+ specifiers: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
+ },
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ },
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ImportDefaultSpecifier", {
+ visitor: ["local"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("ImportNamespaceSpecifier", {
+ visitor: ["local"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("ImportSpecifier", {
+ visitor: ["local", "imported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ imported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "typeof"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("MetaProperty", {
+ visitor: ["meta", "property"],
+ aliases: ["Expression"],
+ fields: {
+ meta: {
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+ let property;
+
+ switch (val.name) {
+ case "function":
+ property = "sent";
+ break;
+
+ case "new":
+ property = "target";
+ break;
+
+ case "import":
+ property = "meta";
+ break;
+ }
+
+ if (!(0, _is.default)("Identifier", node.property, {
+ name: property
+ })) {
+ throw new TypeError("Unrecognised MetaProperty");
+ }
+ }, {
+ oneOfNodeTypes: ["Identifier"]
+ }))
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ const classMethodOrPropertyCommon = {
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ static: {
+ default: false
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ key: {
+ validate: (0, _utils.chain)(function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+ return function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+ }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
+ }
+ };
+ es2015.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
+ const classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, {
+ kind: {
+ validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"),
+ default: "method"
+ },
+ access: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ });
+ es2015.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
+ (0, _utils.default)("ClassMethod", {
+ aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
+ builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ fields: Object.assign({}, classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+ });
+ (0, _utils.default)("ObjectPattern", {
+ visitor: ["properties", "typeAnnotation", "decorators"],
+ builder: ["properties"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, _core.patternLikeCommon, {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty")))
+ }
+ })
+ });
+ (0, _utils.default)("SpreadElement", {
+ visitor: ["argument"],
+ aliases: ["UnaryLike"],
+ deprecatedAlias: "SpreadProperty",
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("Super", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("TaggedTemplateExpression", {
+ visitor: ["tag", "quasi"],
+ aliases: ["Expression"],
+ fields: {
+ tag: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ quasi: {
+ validate: (0, _utils.assertNodeType)("TemplateLiteral")
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("TemplateElement", {
+ builder: ["value", "tail"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertShape)({
+ raw: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ cooked: {
+ validate: (0, _utils.assertValueType)("string"),
+ optional: true
+ }
+ })
+ },
+ tail: {
+ default: false
+ }
+ }
+ });
+ (0, _utils.default)("TemplateLiteral", {
+ visitor: ["quasis", "expressions"],
+ aliases: ["Expression", "Literal"],
+ fields: {
+ quasis: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement")))
+ },
+ expressions: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")), function (node, key, val) {
+ if (node.quasis.length !== val.length + 1) {
+ throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
+ }
+ })
+ }
+ }
+ });
+ (0, _utils.default)("YieldExpression", {
+ builder: ["argument", "delegate"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ delegate: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!process$1.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !node.argument) {
+ throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
+ }
+ }, {
+ type: "boolean"
+ })),
+ default: false
+ },
+ argument: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ return es2015;
+ }
+
+ var flow$3 = {};
+
+ var hasRequiredFlow;
+
+ function requireFlow () {
+ if (hasRequiredFlow) return flow$3;
+ hasRequiredFlow = 1;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
+ (0, _utils.default)(name, {
+ builder: ["id", "typeParameters", "extends", "body"],
+ visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)(typeParameterType),
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")),
+ body: (0, _utils.validateType)("ObjectTypeAnnotation")
+ }
+ });
+ };
+
+ (0, _utils.default)("AnyTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ArrayTypeAnnotation", {
+ visitor: ["elementType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ elementType: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("BooleanTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("BooleanLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("NullLiteralTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ClassImplements", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+ });
+ defineInterfaceishType("DeclareClass");
+ (0, _utils.default)("DeclareFunction", {
+ visitor: ["id"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ predicate: (0, _utils.validateOptionalType)("DeclaredPredicate")
+ }
+ });
+ defineInterfaceishType("DeclareInterface");
+ (0, _utils.default)("DeclareModule", {
+ builder: ["id", "body", "kind"],
+ visitor: ["id", "body"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ body: (0, _utils.validateType)("BlockStatement"),
+ kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES"))
+ }
+ });
+ (0, _utils.default)("DeclareModuleExports", {
+ visitor: ["typeAnnotation"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
+ }
+ });
+ (0, _utils.default)("DeclareTypeAlias", {
+ visitor: ["id", "typeParameters", "right"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ right: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("DeclareOpaqueType", {
+ visitor: ["id", "typeParameters", "supertype"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ supertype: (0, _utils.validateOptionalType)("FlowType")
+ }
+ });
+ (0, _utils.default)("DeclareVariable", {
+ visitor: ["id"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+ });
+ (0, _utils.default)("DeclareExportDeclaration", {
+ visitor: ["declaration", "specifiers", "source"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ declaration: (0, _utils.validateOptionalType)("Flow"),
+ specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
+ source: (0, _utils.validateOptionalType)("StringLiteral"),
+ default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("DeclareExportAllDeclaration", {
+ visitor: ["source"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ source: (0, _utils.validateType)("StringLiteral"),
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
+ }
+ });
+ (0, _utils.default)("DeclaredPredicate", {
+ visitor: ["value"],
+ aliases: ["Flow", "FlowPredicate"],
+ fields: {
+ value: (0, _utils.validateType)("Flow")
+ }
+ });
+ (0, _utils.default)("ExistsTypeAnnotation", {
+ aliases: ["Flow", "FlowType"]
+ });
+ (0, _utils.default)("FunctionTypeAnnotation", {
+ visitor: ["typeParameters", "params", "rest", "returnType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")),
+ rest: (0, _utils.validateOptionalType)("FunctionTypeParam"),
+ returnType: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("FunctionTypeParam", {
+ visitor: ["name", "typeAnnotation"],
+ aliases: ["Flow"],
+ fields: {
+ name: (0, _utils.validateOptionalType)("Identifier"),
+ typeAnnotation: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("GenericTypeAnnotation", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("InferredPredicate", {
+ aliases: ["Flow", "FlowPredicate"]
+ });
+ (0, _utils.default)("InterfaceExtends", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+ });
+ defineInterfaceishType("InterfaceDeclaration");
+ (0, _utils.default)("InterfaceTypeAnnotation", {
+ visitor: ["extends", "body"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ body: (0, _utils.validateType)("ObjectTypeAnnotation")
+ }
+ });
+ (0, _utils.default)("IntersectionTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("MixedTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("EmptyTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("NullableTypeAnnotation", {
+ visitor: ["typeAnnotation"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("NumberLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("number"))
+ }
+ });
+ (0, _utils.default)("NumberTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ObjectTypeAnnotation", {
+ visitor: ["properties", "indexers", "callProperties", "internalSlots"],
+ aliases: ["Flow", "FlowType"],
+ builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
+ fields: {
+ properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
+ indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")),
+ callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")),
+ internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")),
+ exact: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ default: false
+ },
+ inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeInternalSlot", {
+ visitor: ["id", "value", "optional", "static", "method"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ value: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeCallProperty", {
+ visitor: ["value"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ value: (0, _utils.validateType)("FlowType"),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+ });
+ (0, _utils.default)("ObjectTypeIndexer", {
+ visitor: ["id", "key", "value", "variance"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ id: (0, _utils.validateOptionalType)("Identifier"),
+ key: (0, _utils.validateType)("FlowType"),
+ value: (0, _utils.validateType)("FlowType"),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+ });
+ (0, _utils.default)("ObjectTypeProperty", {
+ visitor: ["key", "value", "variance"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ key: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ value: (0, _utils.validateType)("FlowType"),
+ kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+ });
+ (0, _utils.default)("ObjectTypeSpreadProperty", {
+ visitor: ["argument"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ argument: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("OpaqueType", {
+ visitor: ["id", "typeParameters", "supertype", "impltype"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ supertype: (0, _utils.validateOptionalType)("FlowType"),
+ impltype: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("QualifiedTypeIdentifier", {
+ visitor: ["id", "qualification"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"])
+ }
+ });
+ (0, _utils.default)("StringLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("string"))
+ }
+ });
+ (0, _utils.default)("StringTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("SymbolTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("ThisTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("TupleTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("TypeofTypeAnnotation", {
+ visitor: ["argument"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ argument: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("TypeAlias", {
+ visitor: ["id", "typeParameters", "right"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ right: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("TypeAnnotation", {
+ aliases: ["Flow"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("FlowType")
+ }
+ });
+ (0, _utils.default)("TypeCastExpression", {
+ visitor: ["expression", "typeAnnotation"],
+ aliases: ["Flow", "ExpressionWrapper", "Expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression"),
+ typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
+ }
+ });
+ (0, _utils.default)("TypeParameter", {
+ aliases: ["Flow"],
+ visitor: ["bound", "default", "variance"],
+ fields: {
+ name: (0, _utils.validate)((0, _utils.assertValueType)("string")),
+ bound: (0, _utils.validateOptionalType)("TypeAnnotation"),
+ default: (0, _utils.validateOptionalType)("FlowType"),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+ });
+ (0, _utils.default)("TypeParameterDeclaration", {
+ aliases: ["Flow"],
+ visitor: ["params"],
+ fields: {
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter"))
+ }
+ });
+ (0, _utils.default)("TypeParameterInstantiation", {
+ aliases: ["Flow"],
+ visitor: ["params"],
+ fields: {
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("UnionTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+ });
+ (0, _utils.default)("Variance", {
+ aliases: ["Flow"],
+ builder: ["kind"],
+ fields: {
+ kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus"))
+ }
+ });
+ (0, _utils.default)("VoidTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+ });
+ (0, _utils.default)("EnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
+ }
+ });
+ (0, _utils.default)("EnumBooleanBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumBooleanMember")
+ }
+ });
+ (0, _utils.default)("EnumNumberBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumNumberMember")
+ }
+ });
+ (0, _utils.default)("EnumStringBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"])
+ }
+ });
+ (0, _utils.default)("EnumSymbolBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("EnumDefaultedMember")
+ }
+ });
+ (0, _utils.default)("EnumBooleanMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("BooleanLiteral")
+ }
+ });
+ (0, _utils.default)("EnumNumberMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("NumericLiteral")
+ }
+ });
+ (0, _utils.default)("EnumStringMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("StringLiteral")
+ }
+ });
+ (0, _utils.default)("EnumDefaultedMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+ });
+ return flow$3;
+ }
+
+ var jsx$3 = {};
+
+ var hasRequiredJsx;
+
+ function requireJsx () {
+ if (hasRequiredJsx) return jsx$3;
+ hasRequiredJsx = 1;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ (0, _utils.default)("JSXAttribute", {
+ visitor: ["name", "value"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
+ },
+ value: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
+ }
+ }
+ });
+ (0, _utils.default)("JSXClosingElement", {
+ visitor: ["name"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
+ }
+ }
+ });
+ (0, _utils.default)("JSXElement", {
+ builder: ["openingElement", "closingElement", "children", "selfClosing"],
+ visitor: ["openingElement", "children", "closingElement"],
+ aliases: ["JSX", "Immutable", "Expression"],
+ fields: {
+ openingElement: {
+ validate: (0, _utils.assertNodeType)("JSXOpeningElement")
+ },
+ closingElement: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("JSXClosingElement")
+ },
+ children: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
+ },
+ selfClosing: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("JSXEmptyExpression", {
+ aliases: ["JSX"]
+ });
+ (0, _utils.default)("JSXExpressionContainer", {
+ visitor: ["expression"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression")
+ }
+ }
+ });
+ (0, _utils.default)("JSXSpreadChild", {
+ visitor: ["expression"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("JSXIdentifier", {
+ builder: ["name"],
+ aliases: ["JSX"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("JSXMemberExpression", {
+ visitor: ["object", "property"],
+ aliases: ["JSX"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ }
+ }
+ });
+ (0, _utils.default)("JSXNamespacedName", {
+ visitor: ["namespace", "name"],
+ aliases: ["JSX"],
+ fields: {
+ namespace: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ },
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ }
+ }
+ });
+ (0, _utils.default)("JSXOpeningElement", {
+ builder: ["name", "attributes", "selfClosing"],
+ visitor: ["name", "attributes"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
+ },
+ selfClosing: {
+ default: false
+ },
+ attributes: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("JSXSpreadAttribute", {
+ visitor: ["argument"],
+ aliases: ["JSX"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("JSXText", {
+ aliases: ["JSX", "Immutable"],
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ (0, _utils.default)("JSXFragment", {
+ builder: ["openingFragment", "closingFragment", "children"],
+ visitor: ["openingFragment", "children", "closingFragment"],
+ aliases: ["JSX", "Immutable", "Expression"],
+ fields: {
+ openingFragment: {
+ validate: (0, _utils.assertNodeType)("JSXOpeningFragment")
+ },
+ closingFragment: {
+ validate: (0, _utils.assertNodeType)("JSXClosingFragment")
+ },
+ children: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
+ }
+ }
+ });
+ (0, _utils.default)("JSXOpeningFragment", {
+ aliases: ["JSX", "Immutable"]
+ });
+ (0, _utils.default)("JSXClosingFragment", {
+ aliases: ["JSX", "Immutable"]
+ });
+ return jsx$3;
+ }
+
+ var misc = {};
+
+ var placeholders$2 = {};
+
+ var hasRequiredPlaceholders;
+
+ function requirePlaceholders () {
+ if (hasRequiredPlaceholders) return placeholders$2;
+ hasRequiredPlaceholders = 1;
+
+ Object.defineProperty(placeholders$2, "__esModule", {
+ value: true
+ });
+ placeholders$2.PLACEHOLDERS_FLIPPED_ALIAS = placeholders$2.PLACEHOLDERS_ALIAS = placeholders$2.PLACEHOLDERS = void 0;
+
+ var _utils = requireUtils();
+
+ const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
+ placeholders$2.PLACEHOLDERS = PLACEHOLDERS;
+ const PLACEHOLDERS_ALIAS = {
+ Declaration: ["Statement"],
+ Pattern: ["PatternLike", "LVal"]
+ };
+ placeholders$2.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
+
+ for (const type of PLACEHOLDERS) {
+ const alias = _utils.ALIAS_KEYS[type];
+ if (alias == null ? void 0 : alias.length) PLACEHOLDERS_ALIAS[type] = alias;
+ }
+
+ const PLACEHOLDERS_FLIPPED_ALIAS = {};
+ placeholders$2.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
+ Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
+ PLACEHOLDERS_ALIAS[type].forEach(alias => {
+ if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
+ PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
+ }
+
+ PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
+ });
+ });
+ return placeholders$2;
+ }
+
+ var hasRequiredMisc;
+
+ function requireMisc () {
+ if (hasRequiredMisc) return misc;
+ hasRequiredMisc = 1;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ var _placeholders = requirePlaceholders();
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ (0, _utils.default)("Noop", {
+ visitor: []
+ });
+ (0, _utils.default)("Placeholder", {
+ visitor: [],
+ builder: ["expectedNode", "name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ expectedNode: {
+ validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
+ }
+ }
+ });
+ (0, _utils.default)("V8IntrinsicIdentifier", {
+ builder: ["name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+ });
+ return misc;
+ }
+
+ var experimental = {};
+
+ var hasRequiredExperimental;
+
+ function requireExperimental () {
+ if (hasRequiredExperimental) return experimental;
+ hasRequiredExperimental = 1;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ var _es = requireEs2015();
+
+ var _core = requireCore();
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ (0, _utils.default)("ArgumentPlaceholder", {});
+ (0, _utils.default)("AwaitExpression", {
+ builder: ["argument"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("BindExpression", {
+ visitor: ["object", "callee"],
+ aliases: ["Expression"],
+ fields: !process$1.env.BABEL_TYPES_8_BREAKING ? {
+ object: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ },
+ callee: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ }
+ } : {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("ClassProperty", {
+ visitor: ["key", "value", "typeAnnotation", "decorators"],
+ builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
+ aliases: ["Property"],
+ fields: Object.assign({}, _es.classMethodOrPropertyCommon, {
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ definite: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ })
+ });
+ (0, _utils.default)("OptionalMemberExpression", {
+ builder: ["object", "property", "computed", "optional"],
+ visitor: ["object", "property"],
+ aliases: ["Expression"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ }
+ }
+ });
+ (0, _utils.default)("PipelineTopicExpression", {
+ builder: ["expression"],
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("PipelineBareFunction", {
+ builder: ["callee"],
+ visitor: ["callee"],
+ fields: {
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("PipelinePrimaryTopicReference", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("OptionalCallExpression", {
+ visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
+ builder: ["callee", "arguments", "optional"],
+ aliases: ["Expression"],
+ fields: {
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName")))
+ },
+ optional: {
+ validate: !process$1.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ },
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ClassPrivateProperty", {
+ visitor: ["key", "value", "decorators"],
+ builder: ["key", "value", "decorators"],
+ aliases: ["Property", "Private"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ }
+ });
+ (0, _utils.default)("ClassPrivateMethod", {
+ builder: ["kind", "key", "params", "body", "static"],
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
+ fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+ });
+ (0, _utils.default)("Import", {
+ aliases: ["Expression"]
+ });
+ (0, _utils.default)("ImportAttribute", {
+ visitor: ["key", "value"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ }
+ }
+ });
+ (0, _utils.default)("Decorator", {
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+ });
+ (0, _utils.default)("DoExpression", {
+ visitor: ["body"],
+ aliases: ["Expression"],
+ fields: {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }
+ });
+ (0, _utils.default)("ExportDefaultSpecifier", {
+ visitor: ["exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("ExportNamespaceSpecifier", {
+ visitor: ["exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("PrivateName", {
+ visitor: ["id"],
+ aliases: ["Private"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+ });
+ (0, _utils.default)("BigIntLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+ });
+ (0, _utils.default)("RecordExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement")))
+ }
+ }
+ });
+ (0, _utils.default)("TupleExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))),
+ default: []
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+ });
+ return experimental;
+ }
+
+ var typescript$3 = {};
+
+ var hasRequiredTypescript;
+
+ function requireTypescript () {
+ if (hasRequiredTypescript) return typescript$3;
+ hasRequiredTypescript = 1;
+
+ var _utils = _interopRequireWildcard(requireUtils());
+
+ var _core = requireCore();
+
+ var _es = requireEs2015();
+
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+ const bool = (0, _utils.assertValueType)("boolean");
+ const tSFunctionTypeAnnotationCommon = {
+ returnType: {
+ validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ }
+ };
+ (0, _utils.default)("TSParameterProperty", {
+ aliases: ["LVal"],
+ visitor: ["parameter"],
+ fields: {
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ parameter: {
+ validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
+ }
+ }
+ });
+ (0, _utils.default)("TSDeclareFunction", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "params", "returnType"],
+ fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
+ });
+ (0, _utils.default)("TSDeclareMethod", {
+ visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
+ fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
+ });
+ (0, _utils.default)("TSQualifiedName", {
+ aliases: ["TSEntityName"],
+ visitor: ["left", "right"],
+ fields: {
+ left: (0, _utils.validateType)("TSEntityName"),
+ right: (0, _utils.validateType)("Identifier")
+ }
+ });
+ const signatureDeclarationCommon = {
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
+ };
+ const callConstructSignatureDeclaration = {
+ aliases: ["TSTypeElement"],
+ visitor: ["typeParameters", "parameters", "typeAnnotation"],
+ fields: signatureDeclarationCommon
+ };
+ (0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
+ (0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
+ const namedTypeElementCommon = {
+ key: (0, _utils.validateType)("Expression"),
+ computed: (0, _utils.validate)(bool),
+ optional: (0, _utils.validateOptional)(bool)
+ };
+ (0, _utils.default)("TSPropertySignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["key", "typeAnnotation", "initializer"],
+ fields: Object.assign({}, namedTypeElementCommon, {
+ readonly: (0, _utils.validateOptional)(bool),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ })
+ });
+ (0, _utils.default)("TSMethodSignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
+ fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon)
+ });
+ (0, _utils.default)("TSIndexSignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["parameters", "typeAnnotation"],
+ fields: {
+ readonly: (0, _utils.validateOptional)(bool),
+ parameters: (0, _utils.validateArrayOfType)("Identifier"),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
+ }
+ });
+ const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
+
+ for (const type of tsKeywordTypes) {
+ (0, _utils.default)(type, {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+ });
+ }
+
+ (0, _utils.default)("TSThisType", {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+ });
+ const fnOrCtr = {
+ aliases: ["TSType"],
+ visitor: ["typeParameters", "parameters", "typeAnnotation"],
+ fields: signatureDeclarationCommon
+ };
+ (0, _utils.default)("TSFunctionType", fnOrCtr);
+ (0, _utils.default)("TSConstructorType", fnOrCtr);
+ (0, _utils.default)("TSTypeReference", {
+ aliases: ["TSType"],
+ visitor: ["typeName", "typeParameters"],
+ fields: {
+ typeName: (0, _utils.validateType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("TSTypePredicate", {
+ aliases: ["TSType"],
+ visitor: ["parameterName", "typeAnnotation"],
+ builder: ["parameterName", "typeAnnotation", "asserts"],
+ fields: {
+ parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ asserts: (0, _utils.validateOptional)(bool)
+ }
+ });
+ (0, _utils.default)("TSTypeQuery", {
+ aliases: ["TSType"],
+ visitor: ["exprName"],
+ fields: {
+ exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
+ }
+ });
+ (0, _utils.default)("TSTypeLiteral", {
+ aliases: ["TSType"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("TSTypeElement")
+ }
+ });
+ (0, _utils.default)("TSArrayType", {
+ aliases: ["TSType"],
+ visitor: ["elementType"],
+ fields: {
+ elementType: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSTupleType", {
+ aliases: ["TSType"],
+ visitor: ["elementTypes"],
+ fields: {
+ elementTypes: (0, _utils.validateArrayOfType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSOptionalType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSRestType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ const unionOrIntersection = {
+ aliases: ["TSType"],
+ visitor: ["types"],
+ fields: {
+ types: (0, _utils.validateArrayOfType)("TSType")
+ }
+ };
+ (0, _utils.default)("TSUnionType", unionOrIntersection);
+ (0, _utils.default)("TSIntersectionType", unionOrIntersection);
+ (0, _utils.default)("TSConditionalType", {
+ aliases: ["TSType"],
+ visitor: ["checkType", "extendsType", "trueType", "falseType"],
+ fields: {
+ checkType: (0, _utils.validateType)("TSType"),
+ extendsType: (0, _utils.validateType)("TSType"),
+ trueType: (0, _utils.validateType)("TSType"),
+ falseType: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSInferType", {
+ aliases: ["TSType"],
+ visitor: ["typeParameter"],
+ fields: {
+ typeParameter: (0, _utils.validateType)("TSTypeParameter")
+ }
+ });
+ (0, _utils.default)("TSParenthesizedType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSTypeOperator", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSIndexedAccessType", {
+ aliases: ["TSType"],
+ visitor: ["objectType", "indexType"],
+ fields: {
+ objectType: (0, _utils.validateType)("TSType"),
+ indexType: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSMappedType", {
+ aliases: ["TSType"],
+ visitor: ["typeParameter", "typeAnnotation"],
+ fields: {
+ readonly: (0, _utils.validateOptional)(bool),
+ typeParameter: (0, _utils.validateType)("TSTypeParameter"),
+ optional: (0, _utils.validateOptional)(bool),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSLiteralType", {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: ["literal"],
+ fields: {
+ literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral"])
+ }
+ });
+ (0, _utils.default)("TSExpressionWithTypeArguments", {
+ aliases: ["TSType"],
+ visitor: ["expression", "typeParameters"],
+ fields: {
+ expression: (0, _utils.validateType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("TSInterfaceDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "extends", "body"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
+ body: (0, _utils.validateType)("TSInterfaceBody")
+ }
+ });
+ (0, _utils.default)("TSInterfaceBody", {
+ visitor: ["body"],
+ fields: {
+ body: (0, _utils.validateArrayOfType)("TSTypeElement")
+ }
+ });
+ (0, _utils.default)("TSTypeAliasDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "typeAnnotation"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSAsExpression", {
+ aliases: ["Expression"],
+ visitor: ["expression", "typeAnnotation"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression"),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+ });
+ (0, _utils.default)("TSTypeAssertion", {
+ aliases: ["Expression"],
+ visitor: ["typeAnnotation", "expression"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType"),
+ expression: (0, _utils.validateType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSEnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "members"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ const: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ members: (0, _utils.validateArrayOfType)("TSEnumMember"),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSEnumMember", {
+ visitor: ["id", "initializer"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSModuleDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ global: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
+ }
+ });
+ (0, _utils.default)("TSModuleBlock", {
+ aliases: ["Scopable", "Block", "BlockParent"],
+ visitor: ["body"],
+ fields: {
+ body: (0, _utils.validateArrayOfType)("Statement")
+ }
+ });
+ (0, _utils.default)("TSImportType", {
+ aliases: ["TSType"],
+ visitor: ["argument", "qualifier", "typeParameters"],
+ fields: {
+ argument: (0, _utils.validateType)("StringLiteral"),
+ qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+ });
+ (0, _utils.default)("TSImportEqualsDeclaration", {
+ aliases: ["Statement"],
+ visitor: ["id", "moduleReference"],
+ fields: {
+ isExport: (0, _utils.validate)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"])
+ }
+ });
+ (0, _utils.default)("TSExternalModuleReference", {
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("StringLiteral")
+ }
+ });
+ (0, _utils.default)("TSNonNullExpression", {
+ aliases: ["Expression"],
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSExportAssignment", {
+ aliases: ["Statement"],
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression")
+ }
+ });
+ (0, _utils.default)("TSNamespaceExportDeclaration", {
+ aliases: ["Statement"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+ });
+ (0, _utils.default)("TSTypeAnnotation", {
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TSType")
+ }
+ }
+ });
+ (0, _utils.default)("TSTypeParameterInstantiation", {
+ visitor: ["params"],
+ fields: {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
+ }
+ }
+ });
+ (0, _utils.default)("TSTypeParameterDeclaration", {
+ visitor: ["params"],
+ fields: {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
+ }
+ }
+ });
+ (0, _utils.default)("TSTypeParameter", {
+ builder: ["constraint", "default", "name"],
+ visitor: ["constraint", "default"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ constraint: {
+ validate: (0, _utils.assertNodeType)("TSType"),
+ optional: true
+ },
+ default: {
+ validate: (0, _utils.assertNodeType)("TSType"),
+ optional: true
+ }
+ }
+ });
+ return typescript$3;
+ }
+
+ var hasRequiredDefinitions;
+
+ function requireDefinitions () {
+ if (hasRequiredDefinitions) return definitions;
+ hasRequiredDefinitions = 1;
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.defineProperty(exports, "VISITOR_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.VISITOR_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "ALIAS_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.ALIAS_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.FLIPPED_ALIAS_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "NODE_FIELDS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_FIELDS;
+ }
+ });
+ Object.defineProperty(exports, "BUILDER_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.BUILDER_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "DEPRECATED_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.DEPRECATED_KEYS;
+ }
+ });
+ Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_PARENT_VALIDATIONS;
+ }
+ });
+ Object.defineProperty(exports, "PLACEHOLDERS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS;
+ }
+ });
+ Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS_ALIAS;
+ }
+ });
+ Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
+ }
+ });
+ exports.TYPES = void 0;
+
+ var _toFastProperties = _interopRequireDefault(toFastProperties);
+
+ requireCore();
+
+ requireEs2015();
+
+ requireFlow();
+
+ requireJsx();
+
+ requireMisc();
+
+ requireExperimental();
+
+ requireTypescript();
+
+ var _utils = requireUtils();
+
+ var _placeholders = requirePlaceholders();
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ (0, _toFastProperties.default)(_utils.VISITOR_KEYS);
+ (0, _toFastProperties.default)(_utils.ALIAS_KEYS);
+ (0, _toFastProperties.default)(_utils.FLIPPED_ALIAS_KEYS);
+ (0, _toFastProperties.default)(_utils.NODE_FIELDS);
+ (0, _toFastProperties.default)(_utils.BUILDER_KEYS);
+ (0, _toFastProperties.default)(_utils.DEPRECATED_KEYS);
+ (0, _toFastProperties.default)(_placeholders.PLACEHOLDERS_ALIAS);
+ (0, _toFastProperties.default)(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS);
+ const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
+ exports.TYPES = TYPES;
+ } (definitions));
+ return definitions;
+ }
+
+ Object.defineProperty(builder$1, "__esModule", {
+ value: true
+ });
+ builder$1.default = builder;
+
+ var _clone = _interopRequireDefault$v(clone_1);
+
+ var _definitions$6 = requireDefinitions();
+
+ var _validate = _interopRequireDefault$v(requireValidate());
+
+ function _interopRequireDefault$v(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function builder(type, ...args) {
+ const keys = _definitions$6.BUILDER_KEYS[type];
+ const countArgs = args.length;
+
+ if (countArgs > keys.length) {
+ throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
+ }
+
+ const node = {
+ type
+ };
+ let i = 0;
+ keys.forEach(key => {
+ const field = _definitions$6.NODE_FIELDS[type][key];
+ let arg;
+ if (i < countArgs) arg = args[i];
+ if (arg === undefined) arg = (0, _clone.default)(field.default);
+ node[key] = arg;
+ i++;
+ });
+
+ for (const key of Object.keys(node)) {
+ (0, _validate.default)(node, key, node[key]);
+ }
+
+ return node;
+ }
+
+ Object.defineProperty(generated$2, "__esModule", {
+ value: true
+ });
+ generated$2.arrayExpression = generated$2.ArrayExpression = ArrayExpression$1;
+ generated$2.assignmentExpression = generated$2.AssignmentExpression = AssignmentExpression$2;
+ generated$2.binaryExpression = generated$2.BinaryExpression = BinaryExpression$1;
+ generated$2.interpreterDirective = generated$2.InterpreterDirective = InterpreterDirective$1;
+ generated$2.directive = generated$2.Directive = Directive$1;
+ generated$2.directiveLiteral = generated$2.DirectiveLiteral = DirectiveLiteral$1;
+ generated$2.blockStatement = generated$2.BlockStatement = BlockStatement$1;
+ generated$2.breakStatement = generated$2.BreakStatement = BreakStatement$1;
+ generated$2.callExpression = generated$2.CallExpression = CallExpression$1;
+ generated$2.catchClause = generated$2.CatchClause = CatchClause$1;
+ generated$2.conditionalExpression = generated$2.ConditionalExpression = ConditionalExpression$2;
+ generated$2.continueStatement = generated$2.ContinueStatement = ContinueStatement$1;
+ generated$2.debuggerStatement = generated$2.DebuggerStatement = DebuggerStatement$1;
+ generated$2.doWhileStatement = generated$2.DoWhileStatement = DoWhileStatement$1;
+ generated$2.emptyStatement = generated$2.EmptyStatement = EmptyStatement$1;
+ generated$2.expressionStatement = generated$2.ExpressionStatement = ExpressionStatement$1;
+ generated$2.file = generated$2.File = File$1;
+ generated$2.forInStatement = generated$2.ForInStatement = ForInStatement$1;
+ generated$2.forStatement = generated$2.ForStatement = ForStatement$1;
+ generated$2.functionDeclaration = generated$2.FunctionDeclaration = FunctionDeclaration;
+ generated$2.functionExpression = generated$2.FunctionExpression = FunctionExpression$2;
+ generated$2.identifier = generated$2.Identifier = Identifier$2;
+ generated$2.ifStatement = generated$2.IfStatement = IfStatement$1;
+ generated$2.labeledStatement = generated$2.LabeledStatement = LabeledStatement$1;
+ generated$2.stringLiteral = generated$2.StringLiteral = StringLiteral$1;
+ generated$2.numericLiteral = generated$2.NumericLiteral = NumericLiteral$1;
+ generated$2.nullLiteral = generated$2.NullLiteral = NullLiteral$1;
+ generated$2.booleanLiteral = generated$2.BooleanLiteral = BooleanLiteral$1;
+ generated$2.regExpLiteral = generated$2.RegExpLiteral = RegExpLiteral$1;
+ generated$2.logicalExpression = generated$2.LogicalExpression = LogicalExpression$1;
+ generated$2.memberExpression = generated$2.MemberExpression = MemberExpression$1;
+ generated$2.newExpression = generated$2.NewExpression = NewExpression$1;
+ generated$2.program = generated$2.Program = Program$1;
+ generated$2.objectExpression = generated$2.ObjectExpression = ObjectExpression$2;
+ generated$2.objectMethod = generated$2.ObjectMethod = ObjectMethod$1;
+ generated$2.objectProperty = generated$2.ObjectProperty = ObjectProperty$1;
+ generated$2.restElement = generated$2.RestElement = RestElement$1;
+ generated$2.returnStatement = generated$2.ReturnStatement = ReturnStatement$1;
+ generated$2.sequenceExpression = generated$2.SequenceExpression = SequenceExpression$2;
+ generated$2.parenthesizedExpression = generated$2.ParenthesizedExpression = ParenthesizedExpression$1;
+ generated$2.switchCase = generated$2.SwitchCase = SwitchCase$1;
+ generated$2.switchStatement = generated$2.SwitchStatement = SwitchStatement$1;
+ generated$2.thisExpression = generated$2.ThisExpression = ThisExpression$1;
+ generated$2.throwStatement = generated$2.ThrowStatement = ThrowStatement$1;
+ generated$2.tryStatement = generated$2.TryStatement = TryStatement$1;
+ generated$2.unaryExpression = generated$2.UnaryExpression = UnaryExpression$1;
+ generated$2.updateExpression = generated$2.UpdateExpression = UpdateExpression$2;
+ generated$2.variableDeclaration = generated$2.VariableDeclaration = VariableDeclaration$1;
+ generated$2.variableDeclarator = generated$2.VariableDeclarator = VariableDeclarator$1;
+ generated$2.whileStatement = generated$2.WhileStatement = WhileStatement$1;
+ generated$2.withStatement = generated$2.WithStatement = WithStatement$1;
+ generated$2.assignmentPattern = generated$2.AssignmentPattern = AssignmentPattern$1;
+ generated$2.arrayPattern = generated$2.ArrayPattern = ArrayPattern;
+ generated$2.arrowFunctionExpression = generated$2.ArrowFunctionExpression = ArrowFunctionExpression$2;
+ generated$2.classBody = generated$2.ClassBody = ClassBody$1;
+ generated$2.classExpression = generated$2.ClassExpression = ClassExpression$1;
+ generated$2.classDeclaration = generated$2.ClassDeclaration = ClassDeclaration$1;
+ generated$2.exportAllDeclaration = generated$2.ExportAllDeclaration = ExportAllDeclaration$1;
+ generated$2.exportDefaultDeclaration = generated$2.ExportDefaultDeclaration = ExportDefaultDeclaration$1;
+ generated$2.exportNamedDeclaration = generated$2.ExportNamedDeclaration = ExportNamedDeclaration$1;
+ generated$2.exportSpecifier = generated$2.ExportSpecifier = ExportSpecifier$1;
+ generated$2.forOfStatement = generated$2.ForOfStatement = ForOfStatement$1;
+ generated$2.importDeclaration = generated$2.ImportDeclaration = ImportDeclaration$1;
+ generated$2.importDefaultSpecifier = generated$2.ImportDefaultSpecifier = ImportDefaultSpecifier$1;
+ generated$2.importNamespaceSpecifier = generated$2.ImportNamespaceSpecifier = ImportNamespaceSpecifier$1;
+ generated$2.importSpecifier = generated$2.ImportSpecifier = ImportSpecifier$1;
+ generated$2.metaProperty = generated$2.MetaProperty = MetaProperty$1;
+ generated$2.classMethod = generated$2.ClassMethod = ClassMethod$1;
+ generated$2.objectPattern = generated$2.ObjectPattern = ObjectPattern;
+ generated$2.spreadElement = generated$2.SpreadElement = SpreadElement;
+ generated$2.super = generated$2.Super = Super$1;
+ generated$2.taggedTemplateExpression = generated$2.TaggedTemplateExpression = TaggedTemplateExpression$1;
+ generated$2.templateElement = generated$2.TemplateElement = TemplateElement$1;
+ generated$2.templateLiteral = generated$2.TemplateLiteral = TemplateLiteral$1;
+ generated$2.yieldExpression = generated$2.YieldExpression = YieldExpression$2;
+ generated$2.anyTypeAnnotation = generated$2.AnyTypeAnnotation = AnyTypeAnnotation;
+ generated$2.arrayTypeAnnotation = generated$2.ArrayTypeAnnotation = ArrayTypeAnnotation;
+ generated$2.booleanTypeAnnotation = generated$2.BooleanTypeAnnotation = BooleanTypeAnnotation;
+ generated$2.booleanLiteralTypeAnnotation = generated$2.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
+ generated$2.nullLiteralTypeAnnotation = generated$2.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
+ generated$2.classImplements = generated$2.ClassImplements = ClassImplements;
+ generated$2.declareClass = generated$2.DeclareClass = DeclareClass;
+ generated$2.declareFunction = generated$2.DeclareFunction = DeclareFunction;
+ generated$2.declareInterface = generated$2.DeclareInterface = DeclareInterface;
+ generated$2.declareModule = generated$2.DeclareModule = DeclareModule;
+ generated$2.declareModuleExports = generated$2.DeclareModuleExports = DeclareModuleExports;
+ generated$2.declareTypeAlias = generated$2.DeclareTypeAlias = DeclareTypeAlias;
+ generated$2.declareOpaqueType = generated$2.DeclareOpaqueType = DeclareOpaqueType;
+ generated$2.declareVariable = generated$2.DeclareVariable = DeclareVariable;
+ generated$2.declareExportDeclaration = generated$2.DeclareExportDeclaration = DeclareExportDeclaration;
+ generated$2.declareExportAllDeclaration = generated$2.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
+ generated$2.declaredPredicate = generated$2.DeclaredPredicate = DeclaredPredicate;
+ generated$2.existsTypeAnnotation = generated$2.ExistsTypeAnnotation = ExistsTypeAnnotation;
+ generated$2.functionTypeAnnotation = generated$2.FunctionTypeAnnotation = FunctionTypeAnnotation$1;
+ generated$2.functionTypeParam = generated$2.FunctionTypeParam = FunctionTypeParam;
+ generated$2.genericTypeAnnotation = generated$2.GenericTypeAnnotation = GenericTypeAnnotation;
+ generated$2.inferredPredicate = generated$2.InferredPredicate = InferredPredicate;
+ generated$2.interfaceExtends = generated$2.InterfaceExtends = InterfaceExtends;
+ generated$2.interfaceDeclaration = generated$2.InterfaceDeclaration = InterfaceDeclaration;
+ generated$2.interfaceTypeAnnotation = generated$2.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
+ generated$2.intersectionTypeAnnotation = generated$2.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
+ generated$2.mixedTypeAnnotation = generated$2.MixedTypeAnnotation = MixedTypeAnnotation;
+ generated$2.emptyTypeAnnotation = generated$2.EmptyTypeAnnotation = EmptyTypeAnnotation;
+ generated$2.nullableTypeAnnotation = generated$2.NullableTypeAnnotation = NullableTypeAnnotation$1;
+ generated$2.numberLiteralTypeAnnotation = generated$2.NumberLiteralTypeAnnotation = NumberLiteralTypeAnnotation;
+ generated$2.numberTypeAnnotation = generated$2.NumberTypeAnnotation = NumberTypeAnnotation;
+ generated$2.objectTypeAnnotation = generated$2.ObjectTypeAnnotation = ObjectTypeAnnotation;
+ generated$2.objectTypeInternalSlot = generated$2.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
+ generated$2.objectTypeCallProperty = generated$2.ObjectTypeCallProperty = ObjectTypeCallProperty;
+ generated$2.objectTypeIndexer = generated$2.ObjectTypeIndexer = ObjectTypeIndexer;
+ generated$2.objectTypeProperty = generated$2.ObjectTypeProperty = ObjectTypeProperty;
+ generated$2.objectTypeSpreadProperty = generated$2.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
+ generated$2.opaqueType = generated$2.OpaqueType = OpaqueType;
+ generated$2.qualifiedTypeIdentifier = generated$2.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
+ generated$2.stringLiteralTypeAnnotation = generated$2.StringLiteralTypeAnnotation = StringLiteralTypeAnnotation;
+ generated$2.stringTypeAnnotation = generated$2.StringTypeAnnotation = StringTypeAnnotation;
+ generated$2.symbolTypeAnnotation = generated$2.SymbolTypeAnnotation = SymbolTypeAnnotation;
+ generated$2.thisTypeAnnotation = generated$2.ThisTypeAnnotation = ThisTypeAnnotation;
+ generated$2.tupleTypeAnnotation = generated$2.TupleTypeAnnotation = TupleTypeAnnotation;
+ generated$2.typeofTypeAnnotation = generated$2.TypeofTypeAnnotation = TypeofTypeAnnotation;
+ generated$2.typeAlias = generated$2.TypeAlias = TypeAlias;
+ generated$2.typeAnnotation = generated$2.TypeAnnotation = TypeAnnotation;
+ generated$2.typeCastExpression = generated$2.TypeCastExpression = TypeCastExpression;
+ generated$2.typeParameter = generated$2.TypeParameter = TypeParameter;
+ generated$2.typeParameterDeclaration = generated$2.TypeParameterDeclaration = TypeParameterDeclaration;
+ generated$2.typeParameterInstantiation = generated$2.TypeParameterInstantiation = TypeParameterInstantiation;
+ generated$2.unionTypeAnnotation = generated$2.UnionTypeAnnotation = UnionTypeAnnotation$1;
+ generated$2.variance = generated$2.Variance = Variance;
+ generated$2.voidTypeAnnotation = generated$2.VoidTypeAnnotation = VoidTypeAnnotation;
+ generated$2.enumDeclaration = generated$2.EnumDeclaration = EnumDeclaration;
+ generated$2.enumBooleanBody = generated$2.EnumBooleanBody = EnumBooleanBody;
+ generated$2.enumNumberBody = generated$2.EnumNumberBody = EnumNumberBody;
+ generated$2.enumStringBody = generated$2.EnumStringBody = EnumStringBody;
+ generated$2.enumSymbolBody = generated$2.EnumSymbolBody = EnumSymbolBody;
+ generated$2.enumBooleanMember = generated$2.EnumBooleanMember = EnumBooleanMember;
+ generated$2.enumNumberMember = generated$2.EnumNumberMember = EnumNumberMember;
+ generated$2.enumStringMember = generated$2.EnumStringMember = EnumStringMember;
+ generated$2.enumDefaultedMember = generated$2.EnumDefaultedMember = EnumDefaultedMember;
+ generated$2.jSXAttribute = generated$2.jsxAttribute = generated$2.JSXAttribute = JSXAttribute$1;
+ generated$2.jSXClosingElement = generated$2.jsxClosingElement = generated$2.JSXClosingElement = JSXClosingElement$1;
+ generated$2.jSXElement = generated$2.jsxElement = generated$2.JSXElement = JSXElement$1;
+ generated$2.jSXEmptyExpression = generated$2.jsxEmptyExpression = generated$2.JSXEmptyExpression = JSXEmptyExpression$1;
+ generated$2.jSXExpressionContainer = generated$2.jsxExpressionContainer = generated$2.JSXExpressionContainer = JSXExpressionContainer$1;
+ generated$2.jSXSpreadChild = generated$2.jsxSpreadChild = generated$2.JSXSpreadChild = JSXSpreadChild$1;
+ generated$2.jSXIdentifier = generated$2.jsxIdentifier = generated$2.JSXIdentifier = JSXIdentifier$1;
+ generated$2.jSXMemberExpression = generated$2.jsxMemberExpression = generated$2.JSXMemberExpression = JSXMemberExpression$1;
+ generated$2.jSXNamespacedName = generated$2.jsxNamespacedName = generated$2.JSXNamespacedName = JSXNamespacedName$1;
+ generated$2.jSXOpeningElement = generated$2.jsxOpeningElement = generated$2.JSXOpeningElement = JSXOpeningElement$1;
+ generated$2.jSXSpreadAttribute = generated$2.jsxSpreadAttribute = generated$2.JSXSpreadAttribute = JSXSpreadAttribute$1;
+ generated$2.jSXText = generated$2.jsxText = generated$2.JSXText = JSXText$1;
+ generated$2.jSXFragment = generated$2.jsxFragment = generated$2.JSXFragment = JSXFragment$1;
+ generated$2.jSXOpeningFragment = generated$2.jsxOpeningFragment = generated$2.JSXOpeningFragment = JSXOpeningFragment$1;
+ generated$2.jSXClosingFragment = generated$2.jsxClosingFragment = generated$2.JSXClosingFragment = JSXClosingFragment$1;
+ generated$2.noop = generated$2.Noop = Noop;
+ generated$2.placeholder = generated$2.Placeholder = Placeholder$1;
+ generated$2.v8IntrinsicIdentifier = generated$2.V8IntrinsicIdentifier = V8IntrinsicIdentifier$1;
+ generated$2.argumentPlaceholder = generated$2.ArgumentPlaceholder = ArgumentPlaceholder$1;
+ generated$2.awaitExpression = generated$2.AwaitExpression = AwaitExpression$1;
+ generated$2.bindExpression = generated$2.BindExpression = BindExpression$1;
+ generated$2.classProperty = generated$2.ClassProperty = ClassProperty$1;
+ generated$2.optionalMemberExpression = generated$2.OptionalMemberExpression = OptionalMemberExpression$2;
+ generated$2.pipelineTopicExpression = generated$2.PipelineTopicExpression = PipelineTopicExpression$1;
+ generated$2.pipelineBareFunction = generated$2.PipelineBareFunction = PipelineBareFunction$1;
+ generated$2.pipelinePrimaryTopicReference = generated$2.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference$1;
+ generated$2.optionalCallExpression = generated$2.OptionalCallExpression = OptionalCallExpression$1;
+ generated$2.classPrivateProperty = generated$2.ClassPrivateProperty = ClassPrivateProperty$1;
+ generated$2.classPrivateMethod = generated$2.ClassPrivateMethod = ClassPrivateMethod$1;
+ generated$2.import = generated$2.Import = Import$1;
+ generated$2.importAttribute = generated$2.ImportAttribute = ImportAttribute$1;
+ generated$2.decorator = generated$2.Decorator = Decorator$1;
+ generated$2.doExpression = generated$2.DoExpression = DoExpression$2;
+ generated$2.exportDefaultSpecifier = generated$2.ExportDefaultSpecifier = ExportDefaultSpecifier$1;
+ generated$2.exportNamespaceSpecifier = generated$2.ExportNamespaceSpecifier = ExportNamespaceSpecifier$1;
+ generated$2.privateName = generated$2.PrivateName = PrivateName$1;
+ generated$2.bigIntLiteral = generated$2.BigIntLiteral = BigIntLiteral$1;
+ generated$2.recordExpression = generated$2.RecordExpression = RecordExpression$1;
+ generated$2.tupleExpression = generated$2.TupleExpression = TupleExpression$1;
+ generated$2.tSParameterProperty = generated$2.tsParameterProperty = generated$2.TSParameterProperty = TSParameterProperty$1;
+ generated$2.tSDeclareFunction = generated$2.tsDeclareFunction = generated$2.TSDeclareFunction = TSDeclareFunction$1;
+ generated$2.tSDeclareMethod = generated$2.tsDeclareMethod = generated$2.TSDeclareMethod = TSDeclareMethod$1;
+ generated$2.tSQualifiedName = generated$2.tsQualifiedName = generated$2.TSQualifiedName = TSQualifiedName$1;
+ generated$2.tSCallSignatureDeclaration = generated$2.tsCallSignatureDeclaration = generated$2.TSCallSignatureDeclaration = TSCallSignatureDeclaration$1;
+ generated$2.tSConstructSignatureDeclaration = generated$2.tsConstructSignatureDeclaration = generated$2.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration$1;
+ generated$2.tSPropertySignature = generated$2.tsPropertySignature = generated$2.TSPropertySignature = TSPropertySignature$1;
+ generated$2.tSMethodSignature = generated$2.tsMethodSignature = generated$2.TSMethodSignature = TSMethodSignature$1;
+ generated$2.tSIndexSignature = generated$2.tsIndexSignature = generated$2.TSIndexSignature = TSIndexSignature$1;
+ generated$2.tSAnyKeyword = generated$2.tsAnyKeyword = generated$2.TSAnyKeyword = TSAnyKeyword$1;
+ generated$2.tSBooleanKeyword = generated$2.tsBooleanKeyword = generated$2.TSBooleanKeyword = TSBooleanKeyword$1;
+ generated$2.tSBigIntKeyword = generated$2.tsBigIntKeyword = generated$2.TSBigIntKeyword = TSBigIntKeyword$1;
+ generated$2.tSNeverKeyword = generated$2.tsNeverKeyword = generated$2.TSNeverKeyword = TSNeverKeyword$1;
+ generated$2.tSNullKeyword = generated$2.tsNullKeyword = generated$2.TSNullKeyword = TSNullKeyword$1;
+ generated$2.tSNumberKeyword = generated$2.tsNumberKeyword = generated$2.TSNumberKeyword = TSNumberKeyword$1;
+ generated$2.tSObjectKeyword = generated$2.tsObjectKeyword = generated$2.TSObjectKeyword = TSObjectKeyword$1;
+ generated$2.tSStringKeyword = generated$2.tsStringKeyword = generated$2.TSStringKeyword = TSStringKeyword$1;
+ generated$2.tSSymbolKeyword = generated$2.tsSymbolKeyword = generated$2.TSSymbolKeyword = TSSymbolKeyword$1;
+ generated$2.tSUndefinedKeyword = generated$2.tsUndefinedKeyword = generated$2.TSUndefinedKeyword = TSUndefinedKeyword$1;
+ generated$2.tSUnknownKeyword = generated$2.tsUnknownKeyword = generated$2.TSUnknownKeyword = TSUnknownKeyword$1;
+ generated$2.tSVoidKeyword = generated$2.tsVoidKeyword = generated$2.TSVoidKeyword = TSVoidKeyword$1;
+ generated$2.tSThisType = generated$2.tsThisType = generated$2.TSThisType = TSThisType$1;
+ generated$2.tSFunctionType = generated$2.tsFunctionType = generated$2.TSFunctionType = TSFunctionType$1;
+ generated$2.tSConstructorType = generated$2.tsConstructorType = generated$2.TSConstructorType = TSConstructorType$1;
+ generated$2.tSTypeReference = generated$2.tsTypeReference = generated$2.TSTypeReference = TSTypeReference$1;
+ generated$2.tSTypePredicate = generated$2.tsTypePredicate = generated$2.TSTypePredicate = TSTypePredicate$1;
+ generated$2.tSTypeQuery = generated$2.tsTypeQuery = generated$2.TSTypeQuery = TSTypeQuery$1;
+ generated$2.tSTypeLiteral = generated$2.tsTypeLiteral = generated$2.TSTypeLiteral = TSTypeLiteral$1;
+ generated$2.tSArrayType = generated$2.tsArrayType = generated$2.TSArrayType = TSArrayType$1;
+ generated$2.tSTupleType = generated$2.tsTupleType = generated$2.TSTupleType = TSTupleType$1;
+ generated$2.tSOptionalType = generated$2.tsOptionalType = generated$2.TSOptionalType = TSOptionalType$1;
+ generated$2.tSRestType = generated$2.tsRestType = generated$2.TSRestType = TSRestType$1;
+ generated$2.tSUnionType = generated$2.tsUnionType = generated$2.TSUnionType = TSUnionType$2;
+ generated$2.tSIntersectionType = generated$2.tsIntersectionType = generated$2.TSIntersectionType = TSIntersectionType$1;
+ generated$2.tSConditionalType = generated$2.tsConditionalType = generated$2.TSConditionalType = TSConditionalType$1;
+ generated$2.tSInferType = generated$2.tsInferType = generated$2.TSInferType = TSInferType$2;
+ generated$2.tSParenthesizedType = generated$2.tsParenthesizedType = generated$2.TSParenthesizedType = TSParenthesizedType$1;
+ generated$2.tSTypeOperator = generated$2.tsTypeOperator = generated$2.TSTypeOperator = TSTypeOperator$1;
+ generated$2.tSIndexedAccessType = generated$2.tsIndexedAccessType = generated$2.TSIndexedAccessType = TSIndexedAccessType$1;
+ generated$2.tSMappedType = generated$2.tsMappedType = generated$2.TSMappedType = TSMappedType$1;
+ generated$2.tSLiteralType = generated$2.tsLiteralType = generated$2.TSLiteralType = TSLiteralType$1;
+ generated$2.tSExpressionWithTypeArguments = generated$2.tsExpressionWithTypeArguments = generated$2.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments$1;
+ generated$2.tSInterfaceDeclaration = generated$2.tsInterfaceDeclaration = generated$2.TSInterfaceDeclaration = TSInterfaceDeclaration$1;
+ generated$2.tSInterfaceBody = generated$2.tsInterfaceBody = generated$2.TSInterfaceBody = TSInterfaceBody$1;
+ generated$2.tSTypeAliasDeclaration = generated$2.tsTypeAliasDeclaration = generated$2.TSTypeAliasDeclaration = TSTypeAliasDeclaration$1;
+ generated$2.tSAsExpression = generated$2.tsAsExpression = generated$2.TSAsExpression = TSAsExpression$2;
+ generated$2.tSTypeAssertion = generated$2.tsTypeAssertion = generated$2.TSTypeAssertion = TSTypeAssertion$2;
+ generated$2.tSEnumDeclaration = generated$2.tsEnumDeclaration = generated$2.TSEnumDeclaration = TSEnumDeclaration$1;
+ generated$2.tSEnumMember = generated$2.tsEnumMember = generated$2.TSEnumMember = TSEnumMember$1;
+ generated$2.tSModuleDeclaration = generated$2.tsModuleDeclaration = generated$2.TSModuleDeclaration = TSModuleDeclaration$1;
+ generated$2.tSModuleBlock = generated$2.tsModuleBlock = generated$2.TSModuleBlock = TSModuleBlock$1;
+ generated$2.tSImportType = generated$2.tsImportType = generated$2.TSImportType = TSImportType$1;
+ generated$2.tSImportEqualsDeclaration = generated$2.tsImportEqualsDeclaration = generated$2.TSImportEqualsDeclaration = TSImportEqualsDeclaration$1;
+ generated$2.tSExternalModuleReference = generated$2.tsExternalModuleReference = generated$2.TSExternalModuleReference = TSExternalModuleReference$1;
+ generated$2.tSNonNullExpression = generated$2.tsNonNullExpression = generated$2.TSNonNullExpression = TSNonNullExpression$1;
+ generated$2.tSExportAssignment = generated$2.tsExportAssignment = generated$2.TSExportAssignment = TSExportAssignment$1;
+ generated$2.tSNamespaceExportDeclaration = generated$2.tsNamespaceExportDeclaration = generated$2.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration$1;
+ generated$2.tSTypeAnnotation = generated$2.tsTypeAnnotation = generated$2.TSTypeAnnotation = TSTypeAnnotation$1;
+ generated$2.tSTypeParameterInstantiation = generated$2.tsTypeParameterInstantiation = generated$2.TSTypeParameterInstantiation = TSTypeParameterInstantiation$1;
+ generated$2.tSTypeParameterDeclaration = generated$2.tsTypeParameterDeclaration = generated$2.TSTypeParameterDeclaration = TSTypeParameterDeclaration;
+ generated$2.tSTypeParameter = generated$2.tsTypeParameter = generated$2.TSTypeParameter = TSTypeParameter$1;
+ generated$2.numberLiteral = generated$2.NumberLiteral = NumberLiteral;
+ generated$2.regexLiteral = generated$2.RegexLiteral = RegexLiteral;
+ generated$2.restProperty = generated$2.RestProperty = RestProperty;
+ generated$2.spreadProperty = generated$2.SpreadProperty = SpreadProperty;
+
+ var _builder = _interopRequireDefault$u(builder$1);
+
+ function _interopRequireDefault$u(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function ArrayExpression$1(...args) {
+ return (0, _builder.default)("ArrayExpression", ...args);
+ }
+
+ function AssignmentExpression$2(...args) {
+ return (0, _builder.default)("AssignmentExpression", ...args);
+ }
+
+ function BinaryExpression$1(...args) {
+ return (0, _builder.default)("BinaryExpression", ...args);
+ }
+
+ function InterpreterDirective$1(...args) {
+ return (0, _builder.default)("InterpreterDirective", ...args);
+ }
+
+ function Directive$1(...args) {
+ return (0, _builder.default)("Directive", ...args);
+ }
+
+ function DirectiveLiteral$1(...args) {
+ return (0, _builder.default)("DirectiveLiteral", ...args);
+ }
+
+ function BlockStatement$1(...args) {
+ return (0, _builder.default)("BlockStatement", ...args);
+ }
+
+ function BreakStatement$1(...args) {
+ return (0, _builder.default)("BreakStatement", ...args);
+ }
+
+ function CallExpression$1(...args) {
+ return (0, _builder.default)("CallExpression", ...args);
+ }
+
+ function CatchClause$1(...args) {
+ return (0, _builder.default)("CatchClause", ...args);
+ }
+
+ function ConditionalExpression$2(...args) {
+ return (0, _builder.default)("ConditionalExpression", ...args);
+ }
+
+ function ContinueStatement$1(...args) {
+ return (0, _builder.default)("ContinueStatement", ...args);
+ }
+
+ function DebuggerStatement$1(...args) {
+ return (0, _builder.default)("DebuggerStatement", ...args);
+ }
+
+ function DoWhileStatement$1(...args) {
+ return (0, _builder.default)("DoWhileStatement", ...args);
+ }
+
+ function EmptyStatement$1(...args) {
+ return (0, _builder.default)("EmptyStatement", ...args);
+ }
+
+ function ExpressionStatement$1(...args) {
+ return (0, _builder.default)("ExpressionStatement", ...args);
+ }
+
+ function File$1(...args) {
+ return (0, _builder.default)("File", ...args);
+ }
+
+ function ForInStatement$1(...args) {
+ return (0, _builder.default)("ForInStatement", ...args);
+ }
+
+ function ForStatement$1(...args) {
+ return (0, _builder.default)("ForStatement", ...args);
+ }
+
+ function FunctionDeclaration(...args) {
+ return (0, _builder.default)("FunctionDeclaration", ...args);
+ }
+
+ function FunctionExpression$2(...args) {
+ return (0, _builder.default)("FunctionExpression", ...args);
+ }
+
+ function Identifier$2(...args) {
+ return (0, _builder.default)("Identifier", ...args);
+ }
+
+ function IfStatement$1(...args) {
+ return (0, _builder.default)("IfStatement", ...args);
+ }
+
+ function LabeledStatement$1(...args) {
+ return (0, _builder.default)("LabeledStatement", ...args);
+ }
+
+ function StringLiteral$1(...args) {
+ return (0, _builder.default)("StringLiteral", ...args);
+ }
+
+ function NumericLiteral$1(...args) {
+ return (0, _builder.default)("NumericLiteral", ...args);
+ }
+
+ function NullLiteral$1(...args) {
+ return (0, _builder.default)("NullLiteral", ...args);
+ }
+
+ function BooleanLiteral$1(...args) {
+ return (0, _builder.default)("BooleanLiteral", ...args);
+ }
+
+ function RegExpLiteral$1(...args) {
+ return (0, _builder.default)("RegExpLiteral", ...args);
+ }
+
+ function LogicalExpression$1(...args) {
+ return (0, _builder.default)("LogicalExpression", ...args);
+ }
+
+ function MemberExpression$1(...args) {
+ return (0, _builder.default)("MemberExpression", ...args);
+ }
+
+ function NewExpression$1(...args) {
+ return (0, _builder.default)("NewExpression", ...args);
+ }
+
+ function Program$1(...args) {
+ return (0, _builder.default)("Program", ...args);
+ }
+
+ function ObjectExpression$2(...args) {
+ return (0, _builder.default)("ObjectExpression", ...args);
+ }
+
+ function ObjectMethod$1(...args) {
+ return (0, _builder.default)("ObjectMethod", ...args);
+ }
+
+ function ObjectProperty$1(...args) {
+ return (0, _builder.default)("ObjectProperty", ...args);
+ }
+
+ function RestElement$1(...args) {
+ return (0, _builder.default)("RestElement", ...args);
+ }
+
+ function ReturnStatement$1(...args) {
+ return (0, _builder.default)("ReturnStatement", ...args);
+ }
+
+ function SequenceExpression$2(...args) {
+ return (0, _builder.default)("SequenceExpression", ...args);
+ }
+
+ function ParenthesizedExpression$1(...args) {
+ return (0, _builder.default)("ParenthesizedExpression", ...args);
+ }
+
+ function SwitchCase$1(...args) {
+ return (0, _builder.default)("SwitchCase", ...args);
+ }
+
+ function SwitchStatement$1(...args) {
+ return (0, _builder.default)("SwitchStatement", ...args);
+ }
+
+ function ThisExpression$1(...args) {
+ return (0, _builder.default)("ThisExpression", ...args);
+ }
+
+ function ThrowStatement$1(...args) {
+ return (0, _builder.default)("ThrowStatement", ...args);
+ }
+
+ function TryStatement$1(...args) {
+ return (0, _builder.default)("TryStatement", ...args);
+ }
+
+ function UnaryExpression$1(...args) {
+ return (0, _builder.default)("UnaryExpression", ...args);
+ }
+
+ function UpdateExpression$2(...args) {
+ return (0, _builder.default)("UpdateExpression", ...args);
+ }
+
+ function VariableDeclaration$1(...args) {
+ return (0, _builder.default)("VariableDeclaration", ...args);
+ }
+
+ function VariableDeclarator$1(...args) {
+ return (0, _builder.default)("VariableDeclarator", ...args);
+ }
+
+ function WhileStatement$1(...args) {
+ return (0, _builder.default)("WhileStatement", ...args);
+ }
+
+ function WithStatement$1(...args) {
+ return (0, _builder.default)("WithStatement", ...args);
+ }
+
+ function AssignmentPattern$1(...args) {
+ return (0, _builder.default)("AssignmentPattern", ...args);
+ }
+
+ function ArrayPattern(...args) {
+ return (0, _builder.default)("ArrayPattern", ...args);
+ }
+
+ function ArrowFunctionExpression$2(...args) {
+ return (0, _builder.default)("ArrowFunctionExpression", ...args);
+ }
+
+ function ClassBody$1(...args) {
+ return (0, _builder.default)("ClassBody", ...args);
+ }
+
+ function ClassExpression$1(...args) {
+ return (0, _builder.default)("ClassExpression", ...args);
+ }
+
+ function ClassDeclaration$1(...args) {
+ return (0, _builder.default)("ClassDeclaration", ...args);
+ }
+
+ function ExportAllDeclaration$1(...args) {
+ return (0, _builder.default)("ExportAllDeclaration", ...args);
+ }
+
+ function ExportDefaultDeclaration$1(...args) {
+ return (0, _builder.default)("ExportDefaultDeclaration", ...args);
+ }
+
+ function ExportNamedDeclaration$1(...args) {
+ return (0, _builder.default)("ExportNamedDeclaration", ...args);
+ }
+
+ function ExportSpecifier$1(...args) {
+ return (0, _builder.default)("ExportSpecifier", ...args);
+ }
+
+ function ForOfStatement$1(...args) {
+ return (0, _builder.default)("ForOfStatement", ...args);
+ }
+
+ function ImportDeclaration$1(...args) {
+ return (0, _builder.default)("ImportDeclaration", ...args);
+ }
+
+ function ImportDefaultSpecifier$1(...args) {
+ return (0, _builder.default)("ImportDefaultSpecifier", ...args);
+ }
+
+ function ImportNamespaceSpecifier$1(...args) {
+ return (0, _builder.default)("ImportNamespaceSpecifier", ...args);
+ }
+
+ function ImportSpecifier$1(...args) {
+ return (0, _builder.default)("ImportSpecifier", ...args);
+ }
+
+ function MetaProperty$1(...args) {
+ return (0, _builder.default)("MetaProperty", ...args);
+ }
+
+ function ClassMethod$1(...args) {
+ return (0, _builder.default)("ClassMethod", ...args);
+ }
+
+ function ObjectPattern(...args) {
+ return (0, _builder.default)("ObjectPattern", ...args);
+ }
+
+ function SpreadElement(...args) {
+ return (0, _builder.default)("SpreadElement", ...args);
+ }
+
+ function Super$1(...args) {
+ return (0, _builder.default)("Super", ...args);
+ }
+
+ function TaggedTemplateExpression$1(...args) {
+ return (0, _builder.default)("TaggedTemplateExpression", ...args);
+ }
+
+ function TemplateElement$1(...args) {
+ return (0, _builder.default)("TemplateElement", ...args);
+ }
+
+ function TemplateLiteral$1(...args) {
+ return (0, _builder.default)("TemplateLiteral", ...args);
+ }
+
+ function YieldExpression$2(...args) {
+ return (0, _builder.default)("YieldExpression", ...args);
+ }
+
+ function AnyTypeAnnotation(...args) {
+ return (0, _builder.default)("AnyTypeAnnotation", ...args);
+ }
+
+ function ArrayTypeAnnotation(...args) {
+ return (0, _builder.default)("ArrayTypeAnnotation", ...args);
+ }
+
+ function BooleanTypeAnnotation(...args) {
+ return (0, _builder.default)("BooleanTypeAnnotation", ...args);
+ }
+
+ function BooleanLiteralTypeAnnotation(...args) {
+ return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...args);
+ }
+
+ function NullLiteralTypeAnnotation(...args) {
+ return (0, _builder.default)("NullLiteralTypeAnnotation", ...args);
+ }
+
+ function ClassImplements(...args) {
+ return (0, _builder.default)("ClassImplements", ...args);
+ }
+
+ function DeclareClass(...args) {
+ return (0, _builder.default)("DeclareClass", ...args);
+ }
+
+ function DeclareFunction(...args) {
+ return (0, _builder.default)("DeclareFunction", ...args);
+ }
+
+ function DeclareInterface(...args) {
+ return (0, _builder.default)("DeclareInterface", ...args);
+ }
+
+ function DeclareModule(...args) {
+ return (0, _builder.default)("DeclareModule", ...args);
+ }
+
+ function DeclareModuleExports(...args) {
+ return (0, _builder.default)("DeclareModuleExports", ...args);
+ }
+
+ function DeclareTypeAlias(...args) {
+ return (0, _builder.default)("DeclareTypeAlias", ...args);
+ }
+
+ function DeclareOpaqueType(...args) {
+ return (0, _builder.default)("DeclareOpaqueType", ...args);
+ }
+
+ function DeclareVariable(...args) {
+ return (0, _builder.default)("DeclareVariable", ...args);
+ }
+
+ function DeclareExportDeclaration(...args) {
+ return (0, _builder.default)("DeclareExportDeclaration", ...args);
+ }
+
+ function DeclareExportAllDeclaration(...args) {
+ return (0, _builder.default)("DeclareExportAllDeclaration", ...args);
+ }
+
+ function DeclaredPredicate(...args) {
+ return (0, _builder.default)("DeclaredPredicate", ...args);
+ }
+
+ function ExistsTypeAnnotation(...args) {
+ return (0, _builder.default)("ExistsTypeAnnotation", ...args);
+ }
+
+ function FunctionTypeAnnotation$1(...args) {
+ return (0, _builder.default)("FunctionTypeAnnotation", ...args);
+ }
+
+ function FunctionTypeParam(...args) {
+ return (0, _builder.default)("FunctionTypeParam", ...args);
+ }
+
+ function GenericTypeAnnotation(...args) {
+ return (0, _builder.default)("GenericTypeAnnotation", ...args);
+ }
+
+ function InferredPredicate(...args) {
+ return (0, _builder.default)("InferredPredicate", ...args);
+ }
+
+ function InterfaceExtends(...args) {
+ return (0, _builder.default)("InterfaceExtends", ...args);
+ }
+
+ function InterfaceDeclaration(...args) {
+ return (0, _builder.default)("InterfaceDeclaration", ...args);
+ }
+
+ function InterfaceTypeAnnotation(...args) {
+ return (0, _builder.default)("InterfaceTypeAnnotation", ...args);
+ }
+
+ function IntersectionTypeAnnotation(...args) {
+ return (0, _builder.default)("IntersectionTypeAnnotation", ...args);
+ }
+
+ function MixedTypeAnnotation(...args) {
+ return (0, _builder.default)("MixedTypeAnnotation", ...args);
+ }
+
+ function EmptyTypeAnnotation(...args) {
+ return (0, _builder.default)("EmptyTypeAnnotation", ...args);
+ }
+
+ function NullableTypeAnnotation$1(...args) {
+ return (0, _builder.default)("NullableTypeAnnotation", ...args);
+ }
+
+ function NumberLiteralTypeAnnotation(...args) {
+ return (0, _builder.default)("NumberLiteralTypeAnnotation", ...args);
+ }
+
+ function NumberTypeAnnotation(...args) {
+ return (0, _builder.default)("NumberTypeAnnotation", ...args);
+ }
+
+ function ObjectTypeAnnotation(...args) {
+ return (0, _builder.default)("ObjectTypeAnnotation", ...args);
+ }
+
+ function ObjectTypeInternalSlot(...args) {
+ return (0, _builder.default)("ObjectTypeInternalSlot", ...args);
+ }
+
+ function ObjectTypeCallProperty(...args) {
+ return (0, _builder.default)("ObjectTypeCallProperty", ...args);
+ }
+
+ function ObjectTypeIndexer(...args) {
+ return (0, _builder.default)("ObjectTypeIndexer", ...args);
+ }
+
+ function ObjectTypeProperty(...args) {
+ return (0, _builder.default)("ObjectTypeProperty", ...args);
+ }
+
+ function ObjectTypeSpreadProperty(...args) {
+ return (0, _builder.default)("ObjectTypeSpreadProperty", ...args);
+ }
+
+ function OpaqueType(...args) {
+ return (0, _builder.default)("OpaqueType", ...args);
+ }
+
+ function QualifiedTypeIdentifier(...args) {
+ return (0, _builder.default)("QualifiedTypeIdentifier", ...args);
+ }
+
+ function StringLiteralTypeAnnotation(...args) {
+ return (0, _builder.default)("StringLiteralTypeAnnotation", ...args);
+ }
+
+ function StringTypeAnnotation(...args) {
+ return (0, _builder.default)("StringTypeAnnotation", ...args);
+ }
+
+ function SymbolTypeAnnotation(...args) {
+ return (0, _builder.default)("SymbolTypeAnnotation", ...args);
+ }
+
+ function ThisTypeAnnotation(...args) {
+ return (0, _builder.default)("ThisTypeAnnotation", ...args);
+ }
+
+ function TupleTypeAnnotation(...args) {
+ return (0, _builder.default)("TupleTypeAnnotation", ...args);
+ }
+
+ function TypeofTypeAnnotation(...args) {
+ return (0, _builder.default)("TypeofTypeAnnotation", ...args);
+ }
+
+ function TypeAlias(...args) {
+ return (0, _builder.default)("TypeAlias", ...args);
+ }
+
+ function TypeAnnotation(...args) {
+ return (0, _builder.default)("TypeAnnotation", ...args);
+ }
+
+ function TypeCastExpression(...args) {
+ return (0, _builder.default)("TypeCastExpression", ...args);
+ }
+
+ function TypeParameter(...args) {
+ return (0, _builder.default)("TypeParameter", ...args);
+ }
+
+ function TypeParameterDeclaration(...args) {
+ return (0, _builder.default)("TypeParameterDeclaration", ...args);
+ }
+
+ function TypeParameterInstantiation(...args) {
+ return (0, _builder.default)("TypeParameterInstantiation", ...args);
+ }
+
+ function UnionTypeAnnotation$1(...args) {
+ return (0, _builder.default)("UnionTypeAnnotation", ...args);
+ }
+
+ function Variance(...args) {
+ return (0, _builder.default)("Variance", ...args);
+ }
+
+ function VoidTypeAnnotation(...args) {
+ return (0, _builder.default)("VoidTypeAnnotation", ...args);
+ }
+
+ function EnumDeclaration(...args) {
+ return (0, _builder.default)("EnumDeclaration", ...args);
+ }
+
+ function EnumBooleanBody(...args) {
+ return (0, _builder.default)("EnumBooleanBody", ...args);
+ }
+
+ function EnumNumberBody(...args) {
+ return (0, _builder.default)("EnumNumberBody", ...args);
+ }
+
+ function EnumStringBody(...args) {
+ return (0, _builder.default)("EnumStringBody", ...args);
+ }
+
+ function EnumSymbolBody(...args) {
+ return (0, _builder.default)("EnumSymbolBody", ...args);
+ }
+
+ function EnumBooleanMember(...args) {
+ return (0, _builder.default)("EnumBooleanMember", ...args);
+ }
+
+ function EnumNumberMember(...args) {
+ return (0, _builder.default)("EnumNumberMember", ...args);
+ }
+
+ function EnumStringMember(...args) {
+ return (0, _builder.default)("EnumStringMember", ...args);
+ }
+
+ function EnumDefaultedMember(...args) {
+ return (0, _builder.default)("EnumDefaultedMember", ...args);
+ }
+
+ function JSXAttribute$1(...args) {
+ return (0, _builder.default)("JSXAttribute", ...args);
+ }
+
+ function JSXClosingElement$1(...args) {
+ return (0, _builder.default)("JSXClosingElement", ...args);
+ }
+
+ function JSXElement$1(...args) {
+ return (0, _builder.default)("JSXElement", ...args);
+ }
+
+ function JSXEmptyExpression$1(...args) {
+ return (0, _builder.default)("JSXEmptyExpression", ...args);
+ }
+
+ function JSXExpressionContainer$1(...args) {
+ return (0, _builder.default)("JSXExpressionContainer", ...args);
+ }
+
+ function JSXSpreadChild$1(...args) {
+ return (0, _builder.default)("JSXSpreadChild", ...args);
+ }
+
+ function JSXIdentifier$1(...args) {
+ return (0, _builder.default)("JSXIdentifier", ...args);
+ }
+
+ function JSXMemberExpression$1(...args) {
+ return (0, _builder.default)("JSXMemberExpression", ...args);
+ }
+
+ function JSXNamespacedName$1(...args) {
+ return (0, _builder.default)("JSXNamespacedName", ...args);
+ }
+
+ function JSXOpeningElement$1(...args) {
+ return (0, _builder.default)("JSXOpeningElement", ...args);
+ }
+
+ function JSXSpreadAttribute$1(...args) {
+ return (0, _builder.default)("JSXSpreadAttribute", ...args);
+ }
+
+ function JSXText$1(...args) {
+ return (0, _builder.default)("JSXText", ...args);
+ }
+
+ function JSXFragment$1(...args) {
+ return (0, _builder.default)("JSXFragment", ...args);
+ }
+
+ function JSXOpeningFragment$1(...args) {
+ return (0, _builder.default)("JSXOpeningFragment", ...args);
+ }
+
+ function JSXClosingFragment$1(...args) {
+ return (0, _builder.default)("JSXClosingFragment", ...args);
+ }
+
+ function Noop(...args) {
+ return (0, _builder.default)("Noop", ...args);
+ }
+
+ function Placeholder$1(...args) {
+ return (0, _builder.default)("Placeholder", ...args);
+ }
+
+ function V8IntrinsicIdentifier$1(...args) {
+ return (0, _builder.default)("V8IntrinsicIdentifier", ...args);
+ }
+
+ function ArgumentPlaceholder$1(...args) {
+ return (0, _builder.default)("ArgumentPlaceholder", ...args);
+ }
+
+ function AwaitExpression$1(...args) {
+ return (0, _builder.default)("AwaitExpression", ...args);
+ }
+
+ function BindExpression$1(...args) {
+ return (0, _builder.default)("BindExpression", ...args);
+ }
+
+ function ClassProperty$1(...args) {
+ return (0, _builder.default)("ClassProperty", ...args);
+ }
+
+ function OptionalMemberExpression$2(...args) {
+ return (0, _builder.default)("OptionalMemberExpression", ...args);
+ }
+
+ function PipelineTopicExpression$1(...args) {
+ return (0, _builder.default)("PipelineTopicExpression", ...args);
+ }
+
+ function PipelineBareFunction$1(...args) {
+ return (0, _builder.default)("PipelineBareFunction", ...args);
+ }
+
+ function PipelinePrimaryTopicReference$1(...args) {
+ return (0, _builder.default)("PipelinePrimaryTopicReference", ...args);
+ }
+
+ function OptionalCallExpression$1(...args) {
+ return (0, _builder.default)("OptionalCallExpression", ...args);
+ }
+
+ function ClassPrivateProperty$1(...args) {
+ return (0, _builder.default)("ClassPrivateProperty", ...args);
+ }
+
+ function ClassPrivateMethod$1(...args) {
+ return (0, _builder.default)("ClassPrivateMethod", ...args);
+ }
+
+ function Import$1(...args) {
+ return (0, _builder.default)("Import", ...args);
+ }
+
+ function ImportAttribute$1(...args) {
+ return (0, _builder.default)("ImportAttribute", ...args);
+ }
+
+ function Decorator$1(...args) {
+ return (0, _builder.default)("Decorator", ...args);
+ }
+
+ function DoExpression$2(...args) {
+ return (0, _builder.default)("DoExpression", ...args);
+ }
+
+ function ExportDefaultSpecifier$1(...args) {
+ return (0, _builder.default)("ExportDefaultSpecifier", ...args);
+ }
+
+ function ExportNamespaceSpecifier$1(...args) {
+ return (0, _builder.default)("ExportNamespaceSpecifier", ...args);
+ }
+
+ function PrivateName$1(...args) {
+ return (0, _builder.default)("PrivateName", ...args);
+ }
+
+ function BigIntLiteral$1(...args) {
+ return (0, _builder.default)("BigIntLiteral", ...args);
+ }
+
+ function RecordExpression$1(...args) {
+ return (0, _builder.default)("RecordExpression", ...args);
+ }
+
+ function TupleExpression$1(...args) {
+ return (0, _builder.default)("TupleExpression", ...args);
+ }
+
+ function TSParameterProperty$1(...args) {
+ return (0, _builder.default)("TSParameterProperty", ...args);
+ }
+
+ function TSDeclareFunction$1(...args) {
+ return (0, _builder.default)("TSDeclareFunction", ...args);
+ }
+
+ function TSDeclareMethod$1(...args) {
+ return (0, _builder.default)("TSDeclareMethod", ...args);
+ }
+
+ function TSQualifiedName$1(...args) {
+ return (0, _builder.default)("TSQualifiedName", ...args);
+ }
+
+ function TSCallSignatureDeclaration$1(...args) {
+ return (0, _builder.default)("TSCallSignatureDeclaration", ...args);
+ }
+
+ function TSConstructSignatureDeclaration$1(...args) {
+ return (0, _builder.default)("TSConstructSignatureDeclaration", ...args);
+ }
+
+ function TSPropertySignature$1(...args) {
+ return (0, _builder.default)("TSPropertySignature", ...args);
+ }
+
+ function TSMethodSignature$1(...args) {
+ return (0, _builder.default)("TSMethodSignature", ...args);
+ }
+
+ function TSIndexSignature$1(...args) {
+ return (0, _builder.default)("TSIndexSignature", ...args);
+ }
+
+ function TSAnyKeyword$1(...args) {
+ return (0, _builder.default)("TSAnyKeyword", ...args);
+ }
+
+ function TSBooleanKeyword$1(...args) {
+ return (0, _builder.default)("TSBooleanKeyword", ...args);
+ }
+
+ function TSBigIntKeyword$1(...args) {
+ return (0, _builder.default)("TSBigIntKeyword", ...args);
+ }
+
+ function TSNeverKeyword$1(...args) {
+ return (0, _builder.default)("TSNeverKeyword", ...args);
+ }
+
+ function TSNullKeyword$1(...args) {
+ return (0, _builder.default)("TSNullKeyword", ...args);
+ }
+
+ function TSNumberKeyword$1(...args) {
+ return (0, _builder.default)("TSNumberKeyword", ...args);
+ }
+
+ function TSObjectKeyword$1(...args) {
+ return (0, _builder.default)("TSObjectKeyword", ...args);
+ }
+
+ function TSStringKeyword$1(...args) {
+ return (0, _builder.default)("TSStringKeyword", ...args);
+ }
+
+ function TSSymbolKeyword$1(...args) {
+ return (0, _builder.default)("TSSymbolKeyword", ...args);
+ }
+
+ function TSUndefinedKeyword$1(...args) {
+ return (0, _builder.default)("TSUndefinedKeyword", ...args);
+ }
+
+ function TSUnknownKeyword$1(...args) {
+ return (0, _builder.default)("TSUnknownKeyword", ...args);
+ }
+
+ function TSVoidKeyword$1(...args) {
+ return (0, _builder.default)("TSVoidKeyword", ...args);
+ }
+
+ function TSThisType$1(...args) {
+ return (0, _builder.default)("TSThisType", ...args);
+ }
+
+ function TSFunctionType$1(...args) {
+ return (0, _builder.default)("TSFunctionType", ...args);
+ }
+
+ function TSConstructorType$1(...args) {
+ return (0, _builder.default)("TSConstructorType", ...args);
+ }
+
+ function TSTypeReference$1(...args) {
+ return (0, _builder.default)("TSTypeReference", ...args);
+ }
+
+ function TSTypePredicate$1(...args) {
+ return (0, _builder.default)("TSTypePredicate", ...args);
+ }
+
+ function TSTypeQuery$1(...args) {
+ return (0, _builder.default)("TSTypeQuery", ...args);
+ }
+
+ function TSTypeLiteral$1(...args) {
+ return (0, _builder.default)("TSTypeLiteral", ...args);
+ }
+
+ function TSArrayType$1(...args) {
+ return (0, _builder.default)("TSArrayType", ...args);
+ }
+
+ function TSTupleType$1(...args) {
+ return (0, _builder.default)("TSTupleType", ...args);
+ }
+
+ function TSOptionalType$1(...args) {
+ return (0, _builder.default)("TSOptionalType", ...args);
+ }
+
+ function TSRestType$1(...args) {
+ return (0, _builder.default)("TSRestType", ...args);
+ }
+
+ function TSUnionType$2(...args) {
+ return (0, _builder.default)("TSUnionType", ...args);
+ }
+
+ function TSIntersectionType$1(...args) {
+ return (0, _builder.default)("TSIntersectionType", ...args);
+ }
+
+ function TSConditionalType$1(...args) {
+ return (0, _builder.default)("TSConditionalType", ...args);
+ }
+
+ function TSInferType$2(...args) {
+ return (0, _builder.default)("TSInferType", ...args);
+ }
+
+ function TSParenthesizedType$1(...args) {
+ return (0, _builder.default)("TSParenthesizedType", ...args);
+ }
+
+ function TSTypeOperator$1(...args) {
+ return (0, _builder.default)("TSTypeOperator", ...args);
+ }
+
+ function TSIndexedAccessType$1(...args) {
+ return (0, _builder.default)("TSIndexedAccessType", ...args);
+ }
+
+ function TSMappedType$1(...args) {
+ return (0, _builder.default)("TSMappedType", ...args);
+ }
+
+ function TSLiteralType$1(...args) {
+ return (0, _builder.default)("TSLiteralType", ...args);
+ }
+
+ function TSExpressionWithTypeArguments$1(...args) {
+ return (0, _builder.default)("TSExpressionWithTypeArguments", ...args);
+ }
+
+ function TSInterfaceDeclaration$1(...args) {
+ return (0, _builder.default)("TSInterfaceDeclaration", ...args);
+ }
+
+ function TSInterfaceBody$1(...args) {
+ return (0, _builder.default)("TSInterfaceBody", ...args);
+ }
+
+ function TSTypeAliasDeclaration$1(...args) {
+ return (0, _builder.default)("TSTypeAliasDeclaration", ...args);
+ }
+
+ function TSAsExpression$2(...args) {
+ return (0, _builder.default)("TSAsExpression", ...args);
+ }
+
+ function TSTypeAssertion$2(...args) {
+ return (0, _builder.default)("TSTypeAssertion", ...args);
+ }
+
+ function TSEnumDeclaration$1(...args) {
+ return (0, _builder.default)("TSEnumDeclaration", ...args);
+ }
+
+ function TSEnumMember$1(...args) {
+ return (0, _builder.default)("TSEnumMember", ...args);
+ }
+
+ function TSModuleDeclaration$1(...args) {
+ return (0, _builder.default)("TSModuleDeclaration", ...args);
+ }
+
+ function TSModuleBlock$1(...args) {
+ return (0, _builder.default)("TSModuleBlock", ...args);
+ }
+
+ function TSImportType$1(...args) {
+ return (0, _builder.default)("TSImportType", ...args);
+ }
+
+ function TSImportEqualsDeclaration$1(...args) {
+ return (0, _builder.default)("TSImportEqualsDeclaration", ...args);
+ }
+
+ function TSExternalModuleReference$1(...args) {
+ return (0, _builder.default)("TSExternalModuleReference", ...args);
+ }
+
+ function TSNonNullExpression$1(...args) {
+ return (0, _builder.default)("TSNonNullExpression", ...args);
+ }
+
+ function TSExportAssignment$1(...args) {
+ return (0, _builder.default)("TSExportAssignment", ...args);
+ }
+
+ function TSNamespaceExportDeclaration$1(...args) {
+ return (0, _builder.default)("TSNamespaceExportDeclaration", ...args);
+ }
+
+ function TSTypeAnnotation$1(...args) {
+ return (0, _builder.default)("TSTypeAnnotation", ...args);
+ }
+
+ function TSTypeParameterInstantiation$1(...args) {
+ return (0, _builder.default)("TSTypeParameterInstantiation", ...args);
+ }
+
+ function TSTypeParameterDeclaration(...args) {
+ return (0, _builder.default)("TSTypeParameterDeclaration", ...args);
+ }
+
+ function TSTypeParameter$1(...args) {
+ return (0, _builder.default)("TSTypeParameter", ...args);
+ }
+
+ function NumberLiteral(...args) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ return NumberLiteral("NumberLiteral", ...args);
+ }
+
+ function RegexLiteral(...args) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ return RegexLiteral("RegexLiteral", ...args);
+ }
+
+ function RestProperty(...args) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ return RestProperty("RestProperty", ...args);
+ }
+
+ function SpreadProperty(...args) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ return SpreadProperty("SpreadProperty", ...args);
+ }
+
+ Object.defineProperty(cleanJSXElementLiteralChild$1, "__esModule", {
+ value: true
+ });
+ cleanJSXElementLiteralChild$1.default = cleanJSXElementLiteralChild;
+
+ var _generated$m = generated$2;
+
+ function cleanJSXElementLiteralChild(child, args) {
+ const lines = child.value.split(/\r\n|\n|\r/);
+ let lastNonEmptyLine = 0;
+
+ for (let i = 0; i < lines.length; i++) {
+ if (lines[i].match(/[^ \t]/)) {
+ lastNonEmptyLine = i;
+ }
+ }
+
+ let str = "";
+
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ const isFirstLine = i === 0;
+ const isLastLine = i === lines.length - 1;
+ const isLastNonEmptyLine = i === lastNonEmptyLine;
+ let trimmedLine = line.replace(/\t/g, " ");
+
+ if (!isFirstLine) {
+ trimmedLine = trimmedLine.replace(/^[ ]+/, "");
+ }
+
+ if (!isLastLine) {
+ trimmedLine = trimmedLine.replace(/[ ]+$/, "");
+ }
+
+ if (trimmedLine) {
+ if (!isLastNonEmptyLine) {
+ trimmedLine += " ";
+ }
+
+ str += trimmedLine;
+ }
+ }
+
+ if (str) args.push((0, _generated$m.stringLiteral)(str));
+ }
+
+ Object.defineProperty(buildChildren$1, "__esModule", {
+ value: true
+ });
+ buildChildren$1.default = buildChildren;
+
+ var _generated$l = generated$3;
+
+ var _cleanJSXElementLiteralChild = _interopRequireDefault$t(cleanJSXElementLiteralChild$1);
+
+ function _interopRequireDefault$t(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function buildChildren(node) {
+ const elements = [];
+
+ for (let i = 0; i < node.children.length; i++) {
+ let child = node.children[i];
+
+ if ((0, _generated$l.isJSXText)(child)) {
+ (0, _cleanJSXElementLiteralChild.default)(child, elements);
+ continue;
+ }
+
+ if ((0, _generated$l.isJSXExpressionContainer)(child)) child = child.expression;
+ if ((0, _generated$l.isJSXEmptyExpression)(child)) continue;
+ elements.push(child);
+ }
+
+ return elements;
+ }
+
+ var assertNode$1 = {};
+
+ var isNode$2 = {};
+
+ Object.defineProperty(isNode$2, "__esModule", {
+ value: true
+ });
+ isNode$2.default = isNode$1;
+
+ var _definitions$5 = requireDefinitions();
+
+ function isNode$1(node) {
+ return !!(node && _definitions$5.VISITOR_KEYS[node.type]);
+ }
+
+ Object.defineProperty(assertNode$1, "__esModule", {
+ value: true
+ });
+ assertNode$1.default = assertNode;
+
+ var _isNode = _interopRequireDefault$s(isNode$2);
+
+ function _interopRequireDefault$s(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function assertNode(node) {
+ if (!(0, _isNode.default)(node)) {
+ var _node$type;
+
+ const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
+ throw new TypeError(`Not a valid node of type "${type}"`);
+ }
+ }
+
+ var generated$1 = {};
+
+ Object.defineProperty(generated$1, "__esModule", {
+ value: true
+ });
+ generated$1.assertArrayExpression = assertArrayExpression;
+ generated$1.assertAssignmentExpression = assertAssignmentExpression;
+ generated$1.assertBinaryExpression = assertBinaryExpression;
+ generated$1.assertInterpreterDirective = assertInterpreterDirective;
+ generated$1.assertDirective = assertDirective;
+ generated$1.assertDirectiveLiteral = assertDirectiveLiteral;
+ generated$1.assertBlockStatement = assertBlockStatement;
+ generated$1.assertBreakStatement = assertBreakStatement;
+ generated$1.assertCallExpression = assertCallExpression;
+ generated$1.assertCatchClause = assertCatchClause;
+ generated$1.assertConditionalExpression = assertConditionalExpression;
+ generated$1.assertContinueStatement = assertContinueStatement;
+ generated$1.assertDebuggerStatement = assertDebuggerStatement;
+ generated$1.assertDoWhileStatement = assertDoWhileStatement;
+ generated$1.assertEmptyStatement = assertEmptyStatement;
+ generated$1.assertExpressionStatement = assertExpressionStatement;
+ generated$1.assertFile = assertFile;
+ generated$1.assertForInStatement = assertForInStatement;
+ generated$1.assertForStatement = assertForStatement;
+ generated$1.assertFunctionDeclaration = assertFunctionDeclaration;
+ generated$1.assertFunctionExpression = assertFunctionExpression;
+ generated$1.assertIdentifier = assertIdentifier;
+ generated$1.assertIfStatement = assertIfStatement;
+ generated$1.assertLabeledStatement = assertLabeledStatement;
+ generated$1.assertStringLiteral = assertStringLiteral;
+ generated$1.assertNumericLiteral = assertNumericLiteral;
+ generated$1.assertNullLiteral = assertNullLiteral;
+ generated$1.assertBooleanLiteral = assertBooleanLiteral;
+ generated$1.assertRegExpLiteral = assertRegExpLiteral;
+ generated$1.assertLogicalExpression = assertLogicalExpression;
+ generated$1.assertMemberExpression = assertMemberExpression;
+ generated$1.assertNewExpression = assertNewExpression;
+ generated$1.assertProgram = assertProgram;
+ generated$1.assertObjectExpression = assertObjectExpression;
+ generated$1.assertObjectMethod = assertObjectMethod;
+ generated$1.assertObjectProperty = assertObjectProperty;
+ generated$1.assertRestElement = assertRestElement;
+ generated$1.assertReturnStatement = assertReturnStatement;
+ generated$1.assertSequenceExpression = assertSequenceExpression;
+ generated$1.assertParenthesizedExpression = assertParenthesizedExpression;
+ generated$1.assertSwitchCase = assertSwitchCase;
+ generated$1.assertSwitchStatement = assertSwitchStatement;
+ generated$1.assertThisExpression = assertThisExpression;
+ generated$1.assertThrowStatement = assertThrowStatement;
+ generated$1.assertTryStatement = assertTryStatement;
+ generated$1.assertUnaryExpression = assertUnaryExpression;
+ generated$1.assertUpdateExpression = assertUpdateExpression;
+ generated$1.assertVariableDeclaration = assertVariableDeclaration;
+ generated$1.assertVariableDeclarator = assertVariableDeclarator;
+ generated$1.assertWhileStatement = assertWhileStatement;
+ generated$1.assertWithStatement = assertWithStatement;
+ generated$1.assertAssignmentPattern = assertAssignmentPattern;
+ generated$1.assertArrayPattern = assertArrayPattern;
+ generated$1.assertArrowFunctionExpression = assertArrowFunctionExpression;
+ generated$1.assertClassBody = assertClassBody;
+ generated$1.assertClassExpression = assertClassExpression;
+ generated$1.assertClassDeclaration = assertClassDeclaration;
+ generated$1.assertExportAllDeclaration = assertExportAllDeclaration;
+ generated$1.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
+ generated$1.assertExportNamedDeclaration = assertExportNamedDeclaration;
+ generated$1.assertExportSpecifier = assertExportSpecifier;
+ generated$1.assertForOfStatement = assertForOfStatement;
+ generated$1.assertImportDeclaration = assertImportDeclaration;
+ generated$1.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
+ generated$1.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
+ generated$1.assertImportSpecifier = assertImportSpecifier;
+ generated$1.assertMetaProperty = assertMetaProperty;
+ generated$1.assertClassMethod = assertClassMethod;
+ generated$1.assertObjectPattern = assertObjectPattern;
+ generated$1.assertSpreadElement = assertSpreadElement;
+ generated$1.assertSuper = assertSuper;
+ generated$1.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
+ generated$1.assertTemplateElement = assertTemplateElement;
+ generated$1.assertTemplateLiteral = assertTemplateLiteral;
+ generated$1.assertYieldExpression = assertYieldExpression;
+ generated$1.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
+ generated$1.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
+ generated$1.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
+ generated$1.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
+ generated$1.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
+ generated$1.assertClassImplements = assertClassImplements;
+ generated$1.assertDeclareClass = assertDeclareClass;
+ generated$1.assertDeclareFunction = assertDeclareFunction;
+ generated$1.assertDeclareInterface = assertDeclareInterface;
+ generated$1.assertDeclareModule = assertDeclareModule;
+ generated$1.assertDeclareModuleExports = assertDeclareModuleExports;
+ generated$1.assertDeclareTypeAlias = assertDeclareTypeAlias;
+ generated$1.assertDeclareOpaqueType = assertDeclareOpaqueType;
+ generated$1.assertDeclareVariable = assertDeclareVariable;
+ generated$1.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
+ generated$1.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
+ generated$1.assertDeclaredPredicate = assertDeclaredPredicate;
+ generated$1.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
+ generated$1.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
+ generated$1.assertFunctionTypeParam = assertFunctionTypeParam;
+ generated$1.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
+ generated$1.assertInferredPredicate = assertInferredPredicate;
+ generated$1.assertInterfaceExtends = assertInterfaceExtends;
+ generated$1.assertInterfaceDeclaration = assertInterfaceDeclaration;
+ generated$1.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
+ generated$1.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
+ generated$1.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
+ generated$1.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
+ generated$1.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
+ generated$1.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
+ generated$1.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
+ generated$1.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
+ generated$1.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
+ generated$1.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
+ generated$1.assertObjectTypeIndexer = assertObjectTypeIndexer;
+ generated$1.assertObjectTypeProperty = assertObjectTypeProperty;
+ generated$1.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
+ generated$1.assertOpaqueType = assertOpaqueType;
+ generated$1.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
+ generated$1.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
+ generated$1.assertStringTypeAnnotation = assertStringTypeAnnotation;
+ generated$1.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
+ generated$1.assertThisTypeAnnotation = assertThisTypeAnnotation;
+ generated$1.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
+ generated$1.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
+ generated$1.assertTypeAlias = assertTypeAlias;
+ generated$1.assertTypeAnnotation = assertTypeAnnotation;
+ generated$1.assertTypeCastExpression = assertTypeCastExpression;
+ generated$1.assertTypeParameter = assertTypeParameter;
+ generated$1.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
+ generated$1.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
+ generated$1.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
+ generated$1.assertVariance = assertVariance;
+ generated$1.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
+ generated$1.assertEnumDeclaration = assertEnumDeclaration;
+ generated$1.assertEnumBooleanBody = assertEnumBooleanBody;
+ generated$1.assertEnumNumberBody = assertEnumNumberBody;
+ generated$1.assertEnumStringBody = assertEnumStringBody;
+ generated$1.assertEnumSymbolBody = assertEnumSymbolBody;
+ generated$1.assertEnumBooleanMember = assertEnumBooleanMember;
+ generated$1.assertEnumNumberMember = assertEnumNumberMember;
+ generated$1.assertEnumStringMember = assertEnumStringMember;
+ generated$1.assertEnumDefaultedMember = assertEnumDefaultedMember;
+ generated$1.assertJSXAttribute = assertJSXAttribute;
+ generated$1.assertJSXClosingElement = assertJSXClosingElement;
+ generated$1.assertJSXElement = assertJSXElement;
+ generated$1.assertJSXEmptyExpression = assertJSXEmptyExpression;
+ generated$1.assertJSXExpressionContainer = assertJSXExpressionContainer;
+ generated$1.assertJSXSpreadChild = assertJSXSpreadChild;
+ generated$1.assertJSXIdentifier = assertJSXIdentifier;
+ generated$1.assertJSXMemberExpression = assertJSXMemberExpression;
+ generated$1.assertJSXNamespacedName = assertJSXNamespacedName;
+ generated$1.assertJSXOpeningElement = assertJSXOpeningElement;
+ generated$1.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
+ generated$1.assertJSXText = assertJSXText;
+ generated$1.assertJSXFragment = assertJSXFragment;
+ generated$1.assertJSXOpeningFragment = assertJSXOpeningFragment;
+ generated$1.assertJSXClosingFragment = assertJSXClosingFragment;
+ generated$1.assertNoop = assertNoop;
+ generated$1.assertPlaceholder = assertPlaceholder;
+ generated$1.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
+ generated$1.assertArgumentPlaceholder = assertArgumentPlaceholder;
+ generated$1.assertAwaitExpression = assertAwaitExpression;
+ generated$1.assertBindExpression = assertBindExpression;
+ generated$1.assertClassProperty = assertClassProperty;
+ generated$1.assertOptionalMemberExpression = assertOptionalMemberExpression;
+ generated$1.assertPipelineTopicExpression = assertPipelineTopicExpression;
+ generated$1.assertPipelineBareFunction = assertPipelineBareFunction;
+ generated$1.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
+ generated$1.assertOptionalCallExpression = assertOptionalCallExpression;
+ generated$1.assertClassPrivateProperty = assertClassPrivateProperty;
+ generated$1.assertClassPrivateMethod = assertClassPrivateMethod;
+ generated$1.assertImport = assertImport;
+ generated$1.assertImportAttribute = assertImportAttribute;
+ generated$1.assertDecorator = assertDecorator;
+ generated$1.assertDoExpression = assertDoExpression;
+ generated$1.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
+ generated$1.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
+ generated$1.assertPrivateName = assertPrivateName;
+ generated$1.assertBigIntLiteral = assertBigIntLiteral;
+ generated$1.assertRecordExpression = assertRecordExpression;
+ generated$1.assertTupleExpression = assertTupleExpression;
+ generated$1.assertTSParameterProperty = assertTSParameterProperty;
+ generated$1.assertTSDeclareFunction = assertTSDeclareFunction;
+ generated$1.assertTSDeclareMethod = assertTSDeclareMethod;
+ generated$1.assertTSQualifiedName = assertTSQualifiedName;
+ generated$1.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
+ generated$1.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
+ generated$1.assertTSPropertySignature = assertTSPropertySignature;
+ generated$1.assertTSMethodSignature = assertTSMethodSignature;
+ generated$1.assertTSIndexSignature = assertTSIndexSignature;
+ generated$1.assertTSAnyKeyword = assertTSAnyKeyword;
+ generated$1.assertTSBooleanKeyword = assertTSBooleanKeyword;
+ generated$1.assertTSBigIntKeyword = assertTSBigIntKeyword;
+ generated$1.assertTSNeverKeyword = assertTSNeverKeyword;
+ generated$1.assertTSNullKeyword = assertTSNullKeyword;
+ generated$1.assertTSNumberKeyword = assertTSNumberKeyword;
+ generated$1.assertTSObjectKeyword = assertTSObjectKeyword;
+ generated$1.assertTSStringKeyword = assertTSStringKeyword;
+ generated$1.assertTSSymbolKeyword = assertTSSymbolKeyword;
+ generated$1.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
+ generated$1.assertTSUnknownKeyword = assertTSUnknownKeyword;
+ generated$1.assertTSVoidKeyword = assertTSVoidKeyword;
+ generated$1.assertTSThisType = assertTSThisType;
+ generated$1.assertTSFunctionType = assertTSFunctionType;
+ generated$1.assertTSConstructorType = assertTSConstructorType;
+ generated$1.assertTSTypeReference = assertTSTypeReference;
+ generated$1.assertTSTypePredicate = assertTSTypePredicate;
+ generated$1.assertTSTypeQuery = assertTSTypeQuery;
+ generated$1.assertTSTypeLiteral = assertTSTypeLiteral;
+ generated$1.assertTSArrayType = assertTSArrayType;
+ generated$1.assertTSTupleType = assertTSTupleType;
+ generated$1.assertTSOptionalType = assertTSOptionalType;
+ generated$1.assertTSRestType = assertTSRestType;
+ generated$1.assertTSUnionType = assertTSUnionType;
+ generated$1.assertTSIntersectionType = assertTSIntersectionType;
+ generated$1.assertTSConditionalType = assertTSConditionalType;
+ generated$1.assertTSInferType = assertTSInferType;
+ generated$1.assertTSParenthesizedType = assertTSParenthesizedType;
+ generated$1.assertTSTypeOperator = assertTSTypeOperator;
+ generated$1.assertTSIndexedAccessType = assertTSIndexedAccessType;
+ generated$1.assertTSMappedType = assertTSMappedType;
+ generated$1.assertTSLiteralType = assertTSLiteralType;
+ generated$1.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
+ generated$1.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
+ generated$1.assertTSInterfaceBody = assertTSInterfaceBody;
+ generated$1.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
+ generated$1.assertTSAsExpression = assertTSAsExpression;
+ generated$1.assertTSTypeAssertion = assertTSTypeAssertion;
+ generated$1.assertTSEnumDeclaration = assertTSEnumDeclaration;
+ generated$1.assertTSEnumMember = assertTSEnumMember;
+ generated$1.assertTSModuleDeclaration = assertTSModuleDeclaration;
+ generated$1.assertTSModuleBlock = assertTSModuleBlock;
+ generated$1.assertTSImportType = assertTSImportType;
+ generated$1.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
+ generated$1.assertTSExternalModuleReference = assertTSExternalModuleReference;
+ generated$1.assertTSNonNullExpression = assertTSNonNullExpression;
+ generated$1.assertTSExportAssignment = assertTSExportAssignment;
+ generated$1.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
+ generated$1.assertTSTypeAnnotation = assertTSTypeAnnotation;
+ generated$1.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
+ generated$1.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
+ generated$1.assertTSTypeParameter = assertTSTypeParameter;
+ generated$1.assertExpression = assertExpression;
+ generated$1.assertBinary = assertBinary;
+ generated$1.assertScopable = assertScopable;
+ generated$1.assertBlockParent = assertBlockParent;
+ generated$1.assertBlock = assertBlock;
+ generated$1.assertStatement = assertStatement;
+ generated$1.assertTerminatorless = assertTerminatorless;
+ generated$1.assertCompletionStatement = assertCompletionStatement;
+ generated$1.assertConditional = assertConditional;
+ generated$1.assertLoop = assertLoop;
+ generated$1.assertWhile = assertWhile;
+ generated$1.assertExpressionWrapper = assertExpressionWrapper;
+ generated$1.assertFor = assertFor;
+ generated$1.assertForXStatement = assertForXStatement;
+ generated$1.assertFunction = assertFunction;
+ generated$1.assertFunctionParent = assertFunctionParent;
+ generated$1.assertPureish = assertPureish;
+ generated$1.assertDeclaration = assertDeclaration;
+ generated$1.assertPatternLike = assertPatternLike;
+ generated$1.assertLVal = assertLVal;
+ generated$1.assertTSEntityName = assertTSEntityName;
+ generated$1.assertLiteral = assertLiteral;
+ generated$1.assertImmutable = assertImmutable;
+ generated$1.assertUserWhitespacable = assertUserWhitespacable;
+ generated$1.assertMethod = assertMethod;
+ generated$1.assertObjectMember = assertObjectMember;
+ generated$1.assertProperty = assertProperty;
+ generated$1.assertUnaryLike = assertUnaryLike;
+ generated$1.assertPattern = assertPattern;
+ generated$1.assertClass = assertClass;
+ generated$1.assertModuleDeclaration = assertModuleDeclaration;
+ generated$1.assertExportDeclaration = assertExportDeclaration;
+ generated$1.assertModuleSpecifier = assertModuleSpecifier;
+ generated$1.assertFlow = assertFlow;
+ generated$1.assertFlowType = assertFlowType;
+ generated$1.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
+ generated$1.assertFlowDeclaration = assertFlowDeclaration;
+ generated$1.assertFlowPredicate = assertFlowPredicate;
+ generated$1.assertEnumBody = assertEnumBody;
+ generated$1.assertEnumMember = assertEnumMember;
+ generated$1.assertJSX = assertJSX;
+ generated$1.assertPrivate = assertPrivate;
+ generated$1.assertTSTypeElement = assertTSTypeElement;
+ generated$1.assertTSType = assertTSType;
+ generated$1.assertTSBaseType = assertTSBaseType;
+ generated$1.assertNumberLiteral = assertNumberLiteral;
+ generated$1.assertRegexLiteral = assertRegexLiteral;
+ generated$1.assertRestProperty = assertRestProperty;
+ generated$1.assertSpreadProperty = assertSpreadProperty;
+
+ var _is = _interopRequireDefault$r(requireIs());
+
+ function _interopRequireDefault$r(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function assert$2(type, node, opts) {
+ if (!(0, _is.default)(type, node, opts)) {
+ throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`);
+ }
+ }
+
+ function assertArrayExpression(node, opts = {}) {
+ assert$2("ArrayExpression", node, opts);
+ }
+
+ function assertAssignmentExpression(node, opts = {}) {
+ assert$2("AssignmentExpression", node, opts);
+ }
+
+ function assertBinaryExpression(node, opts = {}) {
+ assert$2("BinaryExpression", node, opts);
+ }
+
+ function assertInterpreterDirective(node, opts = {}) {
+ assert$2("InterpreterDirective", node, opts);
+ }
+
+ function assertDirective(node, opts = {}) {
+ assert$2("Directive", node, opts);
+ }
+
+ function assertDirectiveLiteral(node, opts = {}) {
+ assert$2("DirectiveLiteral", node, opts);
+ }
+
+ function assertBlockStatement(node, opts = {}) {
+ assert$2("BlockStatement", node, opts);
+ }
+
+ function assertBreakStatement(node, opts = {}) {
+ assert$2("BreakStatement", node, opts);
+ }
+
+ function assertCallExpression(node, opts = {}) {
+ assert$2("CallExpression", node, opts);
+ }
+
+ function assertCatchClause(node, opts = {}) {
+ assert$2("CatchClause", node, opts);
+ }
+
+ function assertConditionalExpression(node, opts = {}) {
+ assert$2("ConditionalExpression", node, opts);
+ }
+
+ function assertContinueStatement(node, opts = {}) {
+ assert$2("ContinueStatement", node, opts);
+ }
+
+ function assertDebuggerStatement(node, opts = {}) {
+ assert$2("DebuggerStatement", node, opts);
+ }
+
+ function assertDoWhileStatement(node, opts = {}) {
+ assert$2("DoWhileStatement", node, opts);
+ }
+
+ function assertEmptyStatement(node, opts = {}) {
+ assert$2("EmptyStatement", node, opts);
+ }
+
+ function assertExpressionStatement(node, opts = {}) {
+ assert$2("ExpressionStatement", node, opts);
+ }
+
+ function assertFile(node, opts = {}) {
+ assert$2("File", node, opts);
+ }
+
+ function assertForInStatement(node, opts = {}) {
+ assert$2("ForInStatement", node, opts);
+ }
+
+ function assertForStatement(node, opts = {}) {
+ assert$2("ForStatement", node, opts);
+ }
+
+ function assertFunctionDeclaration(node, opts = {}) {
+ assert$2("FunctionDeclaration", node, opts);
+ }
+
+ function assertFunctionExpression(node, opts = {}) {
+ assert$2("FunctionExpression", node, opts);
+ }
+
+ function assertIdentifier(node, opts = {}) {
+ assert$2("Identifier", node, opts);
+ }
+
+ function assertIfStatement(node, opts = {}) {
+ assert$2("IfStatement", node, opts);
+ }
+
+ function assertLabeledStatement(node, opts = {}) {
+ assert$2("LabeledStatement", node, opts);
+ }
+
+ function assertStringLiteral(node, opts = {}) {
+ assert$2("StringLiteral", node, opts);
+ }
+
+ function assertNumericLiteral(node, opts = {}) {
+ assert$2("NumericLiteral", node, opts);
+ }
+
+ function assertNullLiteral(node, opts = {}) {
+ assert$2("NullLiteral", node, opts);
+ }
+
+ function assertBooleanLiteral(node, opts = {}) {
+ assert$2("BooleanLiteral", node, opts);
+ }
+
+ function assertRegExpLiteral(node, opts = {}) {
+ assert$2("RegExpLiteral", node, opts);
+ }
+
+ function assertLogicalExpression(node, opts = {}) {
+ assert$2("LogicalExpression", node, opts);
+ }
+
+ function assertMemberExpression(node, opts = {}) {
+ assert$2("MemberExpression", node, opts);
+ }
+
+ function assertNewExpression(node, opts = {}) {
+ assert$2("NewExpression", node, opts);
+ }
+
+ function assertProgram(node, opts = {}) {
+ assert$2("Program", node, opts);
+ }
+
+ function assertObjectExpression(node, opts = {}) {
+ assert$2("ObjectExpression", node, opts);
+ }
+
+ function assertObjectMethod(node, opts = {}) {
+ assert$2("ObjectMethod", node, opts);
+ }
+
+ function assertObjectProperty(node, opts = {}) {
+ assert$2("ObjectProperty", node, opts);
+ }
+
+ function assertRestElement(node, opts = {}) {
+ assert$2("RestElement", node, opts);
+ }
+
+ function assertReturnStatement(node, opts = {}) {
+ assert$2("ReturnStatement", node, opts);
+ }
+
+ function assertSequenceExpression(node, opts = {}) {
+ assert$2("SequenceExpression", node, opts);
+ }
+
+ function assertParenthesizedExpression(node, opts = {}) {
+ assert$2("ParenthesizedExpression", node, opts);
+ }
+
+ function assertSwitchCase(node, opts = {}) {
+ assert$2("SwitchCase", node, opts);
+ }
+
+ function assertSwitchStatement(node, opts = {}) {
+ assert$2("SwitchStatement", node, opts);
+ }
+
+ function assertThisExpression(node, opts = {}) {
+ assert$2("ThisExpression", node, opts);
+ }
+
+ function assertThrowStatement(node, opts = {}) {
+ assert$2("ThrowStatement", node, opts);
+ }
+
+ function assertTryStatement(node, opts = {}) {
+ assert$2("TryStatement", node, opts);
+ }
+
+ function assertUnaryExpression(node, opts = {}) {
+ assert$2("UnaryExpression", node, opts);
+ }
+
+ function assertUpdateExpression(node, opts = {}) {
+ assert$2("UpdateExpression", node, opts);
+ }
+
+ function assertVariableDeclaration(node, opts = {}) {
+ assert$2("VariableDeclaration", node, opts);
+ }
+
+ function assertVariableDeclarator(node, opts = {}) {
+ assert$2("VariableDeclarator", node, opts);
+ }
+
+ function assertWhileStatement(node, opts = {}) {
+ assert$2("WhileStatement", node, opts);
+ }
+
+ function assertWithStatement(node, opts = {}) {
+ assert$2("WithStatement", node, opts);
+ }
+
+ function assertAssignmentPattern(node, opts = {}) {
+ assert$2("AssignmentPattern", node, opts);
+ }
+
+ function assertArrayPattern(node, opts = {}) {
+ assert$2("ArrayPattern", node, opts);
+ }
+
+ function assertArrowFunctionExpression(node, opts = {}) {
+ assert$2("ArrowFunctionExpression", node, opts);
+ }
+
+ function assertClassBody(node, opts = {}) {
+ assert$2("ClassBody", node, opts);
+ }
+
+ function assertClassExpression(node, opts = {}) {
+ assert$2("ClassExpression", node, opts);
+ }
+
+ function assertClassDeclaration(node, opts = {}) {
+ assert$2("ClassDeclaration", node, opts);
+ }
+
+ function assertExportAllDeclaration(node, opts = {}) {
+ assert$2("ExportAllDeclaration", node, opts);
+ }
+
+ function assertExportDefaultDeclaration(node, opts = {}) {
+ assert$2("ExportDefaultDeclaration", node, opts);
+ }
+
+ function assertExportNamedDeclaration(node, opts = {}) {
+ assert$2("ExportNamedDeclaration", node, opts);
+ }
+
+ function assertExportSpecifier(node, opts = {}) {
+ assert$2("ExportSpecifier", node, opts);
+ }
+
+ function assertForOfStatement(node, opts = {}) {
+ assert$2("ForOfStatement", node, opts);
+ }
+
+ function assertImportDeclaration(node, opts = {}) {
+ assert$2("ImportDeclaration", node, opts);
+ }
+
+ function assertImportDefaultSpecifier(node, opts = {}) {
+ assert$2("ImportDefaultSpecifier", node, opts);
+ }
+
+ function assertImportNamespaceSpecifier(node, opts = {}) {
+ assert$2("ImportNamespaceSpecifier", node, opts);
+ }
+
+ function assertImportSpecifier(node, opts = {}) {
+ assert$2("ImportSpecifier", node, opts);
+ }
+
+ function assertMetaProperty(node, opts = {}) {
+ assert$2("MetaProperty", node, opts);
+ }
+
+ function assertClassMethod(node, opts = {}) {
+ assert$2("ClassMethod", node, opts);
+ }
+
+ function assertObjectPattern(node, opts = {}) {
+ assert$2("ObjectPattern", node, opts);
+ }
+
+ function assertSpreadElement(node, opts = {}) {
+ assert$2("SpreadElement", node, opts);
+ }
+
+ function assertSuper(node, opts = {}) {
+ assert$2("Super", node, opts);
+ }
+
+ function assertTaggedTemplateExpression(node, opts = {}) {
+ assert$2("TaggedTemplateExpression", node, opts);
+ }
+
+ function assertTemplateElement(node, opts = {}) {
+ assert$2("TemplateElement", node, opts);
+ }
+
+ function assertTemplateLiteral(node, opts = {}) {
+ assert$2("TemplateLiteral", node, opts);
+ }
+
+ function assertYieldExpression(node, opts = {}) {
+ assert$2("YieldExpression", node, opts);
+ }
+
+ function assertAnyTypeAnnotation(node, opts = {}) {
+ assert$2("AnyTypeAnnotation", node, opts);
+ }
+
+ function assertArrayTypeAnnotation(node, opts = {}) {
+ assert$2("ArrayTypeAnnotation", node, opts);
+ }
+
+ function assertBooleanTypeAnnotation(node, opts = {}) {
+ assert$2("BooleanTypeAnnotation", node, opts);
+ }
+
+ function assertBooleanLiteralTypeAnnotation(node, opts = {}) {
+ assert$2("BooleanLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertNullLiteralTypeAnnotation(node, opts = {}) {
+ assert$2("NullLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertClassImplements(node, opts = {}) {
+ assert$2("ClassImplements", node, opts);
+ }
+
+ function assertDeclareClass(node, opts = {}) {
+ assert$2("DeclareClass", node, opts);
+ }
+
+ function assertDeclareFunction(node, opts = {}) {
+ assert$2("DeclareFunction", node, opts);
+ }
+
+ function assertDeclareInterface(node, opts = {}) {
+ assert$2("DeclareInterface", node, opts);
+ }
+
+ function assertDeclareModule(node, opts = {}) {
+ assert$2("DeclareModule", node, opts);
+ }
+
+ function assertDeclareModuleExports(node, opts = {}) {
+ assert$2("DeclareModuleExports", node, opts);
+ }
+
+ function assertDeclareTypeAlias(node, opts = {}) {
+ assert$2("DeclareTypeAlias", node, opts);
+ }
+
+ function assertDeclareOpaqueType(node, opts = {}) {
+ assert$2("DeclareOpaqueType", node, opts);
+ }
+
+ function assertDeclareVariable(node, opts = {}) {
+ assert$2("DeclareVariable", node, opts);
+ }
+
+ function assertDeclareExportDeclaration(node, opts = {}) {
+ assert$2("DeclareExportDeclaration", node, opts);
+ }
+
+ function assertDeclareExportAllDeclaration(node, opts = {}) {
+ assert$2("DeclareExportAllDeclaration", node, opts);
+ }
+
+ function assertDeclaredPredicate(node, opts = {}) {
+ assert$2("DeclaredPredicate", node, opts);
+ }
+
+ function assertExistsTypeAnnotation(node, opts = {}) {
+ assert$2("ExistsTypeAnnotation", node, opts);
+ }
+
+ function assertFunctionTypeAnnotation(node, opts = {}) {
+ assert$2("FunctionTypeAnnotation", node, opts);
+ }
+
+ function assertFunctionTypeParam(node, opts = {}) {
+ assert$2("FunctionTypeParam", node, opts);
+ }
+
+ function assertGenericTypeAnnotation(node, opts = {}) {
+ assert$2("GenericTypeAnnotation", node, opts);
+ }
+
+ function assertInferredPredicate(node, opts = {}) {
+ assert$2("InferredPredicate", node, opts);
+ }
+
+ function assertInterfaceExtends(node, opts = {}) {
+ assert$2("InterfaceExtends", node, opts);
+ }
+
+ function assertInterfaceDeclaration(node, opts = {}) {
+ assert$2("InterfaceDeclaration", node, opts);
+ }
+
+ function assertInterfaceTypeAnnotation(node, opts = {}) {
+ assert$2("InterfaceTypeAnnotation", node, opts);
+ }
+
+ function assertIntersectionTypeAnnotation(node, opts = {}) {
+ assert$2("IntersectionTypeAnnotation", node, opts);
+ }
+
+ function assertMixedTypeAnnotation(node, opts = {}) {
+ assert$2("MixedTypeAnnotation", node, opts);
+ }
+
+ function assertEmptyTypeAnnotation(node, opts = {}) {
+ assert$2("EmptyTypeAnnotation", node, opts);
+ }
+
+ function assertNullableTypeAnnotation(node, opts = {}) {
+ assert$2("NullableTypeAnnotation", node, opts);
+ }
+
+ function assertNumberLiteralTypeAnnotation(node, opts = {}) {
+ assert$2("NumberLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertNumberTypeAnnotation(node, opts = {}) {
+ assert$2("NumberTypeAnnotation", node, opts);
+ }
+
+ function assertObjectTypeAnnotation(node, opts = {}) {
+ assert$2("ObjectTypeAnnotation", node, opts);
+ }
+
+ function assertObjectTypeInternalSlot(node, opts = {}) {
+ assert$2("ObjectTypeInternalSlot", node, opts);
+ }
+
+ function assertObjectTypeCallProperty(node, opts = {}) {
+ assert$2("ObjectTypeCallProperty", node, opts);
+ }
+
+ function assertObjectTypeIndexer(node, opts = {}) {
+ assert$2("ObjectTypeIndexer", node, opts);
+ }
+
+ function assertObjectTypeProperty(node, opts = {}) {
+ assert$2("ObjectTypeProperty", node, opts);
+ }
+
+ function assertObjectTypeSpreadProperty(node, opts = {}) {
+ assert$2("ObjectTypeSpreadProperty", node, opts);
+ }
+
+ function assertOpaqueType(node, opts = {}) {
+ assert$2("OpaqueType", node, opts);
+ }
+
+ function assertQualifiedTypeIdentifier(node, opts = {}) {
+ assert$2("QualifiedTypeIdentifier", node, opts);
+ }
+
+ function assertStringLiteralTypeAnnotation(node, opts = {}) {
+ assert$2("StringLiteralTypeAnnotation", node, opts);
+ }
+
+ function assertStringTypeAnnotation(node, opts = {}) {
+ assert$2("StringTypeAnnotation", node, opts);
+ }
+
+ function assertSymbolTypeAnnotation(node, opts = {}) {
+ assert$2("SymbolTypeAnnotation", node, opts);
+ }
+
+ function assertThisTypeAnnotation(node, opts = {}) {
+ assert$2("ThisTypeAnnotation", node, opts);
+ }
+
+ function assertTupleTypeAnnotation(node, opts = {}) {
+ assert$2("TupleTypeAnnotation", node, opts);
+ }
+
+ function assertTypeofTypeAnnotation(node, opts = {}) {
+ assert$2("TypeofTypeAnnotation", node, opts);
+ }
+
+ function assertTypeAlias(node, opts = {}) {
+ assert$2("TypeAlias", node, opts);
+ }
+
+ function assertTypeAnnotation(node, opts = {}) {
+ assert$2("TypeAnnotation", node, opts);
+ }
+
+ function assertTypeCastExpression(node, opts = {}) {
+ assert$2("TypeCastExpression", node, opts);
+ }
+
+ function assertTypeParameter(node, opts = {}) {
+ assert$2("TypeParameter", node, opts);
+ }
+
+ function assertTypeParameterDeclaration(node, opts = {}) {
+ assert$2("TypeParameterDeclaration", node, opts);
+ }
+
+ function assertTypeParameterInstantiation(node, opts = {}) {
+ assert$2("TypeParameterInstantiation", node, opts);
+ }
+
+ function assertUnionTypeAnnotation(node, opts = {}) {
+ assert$2("UnionTypeAnnotation", node, opts);
+ }
+
+ function assertVariance(node, opts = {}) {
+ assert$2("Variance", node, opts);
+ }
+
+ function assertVoidTypeAnnotation(node, opts = {}) {
+ assert$2("VoidTypeAnnotation", node, opts);
+ }
+
+ function assertEnumDeclaration(node, opts = {}) {
+ assert$2("EnumDeclaration", node, opts);
+ }
+
+ function assertEnumBooleanBody(node, opts = {}) {
+ assert$2("EnumBooleanBody", node, opts);
+ }
+
+ function assertEnumNumberBody(node, opts = {}) {
+ assert$2("EnumNumberBody", node, opts);
+ }
+
+ function assertEnumStringBody(node, opts = {}) {
+ assert$2("EnumStringBody", node, opts);
+ }
+
+ function assertEnumSymbolBody(node, opts = {}) {
+ assert$2("EnumSymbolBody", node, opts);
+ }
+
+ function assertEnumBooleanMember(node, opts = {}) {
+ assert$2("EnumBooleanMember", node, opts);
+ }
+
+ function assertEnumNumberMember(node, opts = {}) {
+ assert$2("EnumNumberMember", node, opts);
+ }
+
+ function assertEnumStringMember(node, opts = {}) {
+ assert$2("EnumStringMember", node, opts);
+ }
+
+ function assertEnumDefaultedMember(node, opts = {}) {
+ assert$2("EnumDefaultedMember", node, opts);
+ }
+
+ function assertJSXAttribute(node, opts = {}) {
+ assert$2("JSXAttribute", node, opts);
+ }
+
+ function assertJSXClosingElement(node, opts = {}) {
+ assert$2("JSXClosingElement", node, opts);
+ }
+
+ function assertJSXElement(node, opts = {}) {
+ assert$2("JSXElement", node, opts);
+ }
+
+ function assertJSXEmptyExpression(node, opts = {}) {
+ assert$2("JSXEmptyExpression", node, opts);
+ }
+
+ function assertJSXExpressionContainer(node, opts = {}) {
+ assert$2("JSXExpressionContainer", node, opts);
+ }
+
+ function assertJSXSpreadChild(node, opts = {}) {
+ assert$2("JSXSpreadChild", node, opts);
+ }
+
+ function assertJSXIdentifier(node, opts = {}) {
+ assert$2("JSXIdentifier", node, opts);
+ }
+
+ function assertJSXMemberExpression(node, opts = {}) {
+ assert$2("JSXMemberExpression", node, opts);
+ }
+
+ function assertJSXNamespacedName(node, opts = {}) {
+ assert$2("JSXNamespacedName", node, opts);
+ }
+
+ function assertJSXOpeningElement(node, opts = {}) {
+ assert$2("JSXOpeningElement", node, opts);
+ }
+
+ function assertJSXSpreadAttribute(node, opts = {}) {
+ assert$2("JSXSpreadAttribute", node, opts);
+ }
+
+ function assertJSXText(node, opts = {}) {
+ assert$2("JSXText", node, opts);
+ }
+
+ function assertJSXFragment(node, opts = {}) {
+ assert$2("JSXFragment", node, opts);
+ }
+
+ function assertJSXOpeningFragment(node, opts = {}) {
+ assert$2("JSXOpeningFragment", node, opts);
+ }
+
+ function assertJSXClosingFragment(node, opts = {}) {
+ assert$2("JSXClosingFragment", node, opts);
+ }
+
+ function assertNoop(node, opts = {}) {
+ assert$2("Noop", node, opts);
+ }
+
+ function assertPlaceholder(node, opts = {}) {
+ assert$2("Placeholder", node, opts);
+ }
+
+ function assertV8IntrinsicIdentifier(node, opts = {}) {
+ assert$2("V8IntrinsicIdentifier", node, opts);
+ }
+
+ function assertArgumentPlaceholder(node, opts = {}) {
+ assert$2("ArgumentPlaceholder", node, opts);
+ }
+
+ function assertAwaitExpression(node, opts = {}) {
+ assert$2("AwaitExpression", node, opts);
+ }
+
+ function assertBindExpression(node, opts = {}) {
+ assert$2("BindExpression", node, opts);
+ }
+
+ function assertClassProperty(node, opts = {}) {
+ assert$2("ClassProperty", node, opts);
+ }
+
+ function assertOptionalMemberExpression(node, opts = {}) {
+ assert$2("OptionalMemberExpression", node, opts);
+ }
+
+ function assertPipelineTopicExpression(node, opts = {}) {
+ assert$2("PipelineTopicExpression", node, opts);
+ }
+
+ function assertPipelineBareFunction(node, opts = {}) {
+ assert$2("PipelineBareFunction", node, opts);
+ }
+
+ function assertPipelinePrimaryTopicReference(node, opts = {}) {
+ assert$2("PipelinePrimaryTopicReference", node, opts);
+ }
+
+ function assertOptionalCallExpression(node, opts = {}) {
+ assert$2("OptionalCallExpression", node, opts);
+ }
+
+ function assertClassPrivateProperty(node, opts = {}) {
+ assert$2("ClassPrivateProperty", node, opts);
+ }
+
+ function assertClassPrivateMethod(node, opts = {}) {
+ assert$2("ClassPrivateMethod", node, opts);
+ }
+
+ function assertImport(node, opts = {}) {
+ assert$2("Import", node, opts);
+ }
+
+ function assertImportAttribute(node, opts = {}) {
+ assert$2("ImportAttribute", node, opts);
+ }
+
+ function assertDecorator(node, opts = {}) {
+ assert$2("Decorator", node, opts);
+ }
+
+ function assertDoExpression(node, opts = {}) {
+ assert$2("DoExpression", node, opts);
+ }
+
+ function assertExportDefaultSpecifier(node, opts = {}) {
+ assert$2("ExportDefaultSpecifier", node, opts);
+ }
+
+ function assertExportNamespaceSpecifier(node, opts = {}) {
+ assert$2("ExportNamespaceSpecifier", node, opts);
+ }
+
+ function assertPrivateName(node, opts = {}) {
+ assert$2("PrivateName", node, opts);
+ }
+
+ function assertBigIntLiteral(node, opts = {}) {
+ assert$2("BigIntLiteral", node, opts);
+ }
+
+ function assertRecordExpression(node, opts = {}) {
+ assert$2("RecordExpression", node, opts);
+ }
+
+ function assertTupleExpression(node, opts = {}) {
+ assert$2("TupleExpression", node, opts);
+ }
+
+ function assertTSParameterProperty(node, opts = {}) {
+ assert$2("TSParameterProperty", node, opts);
+ }
+
+ function assertTSDeclareFunction(node, opts = {}) {
+ assert$2("TSDeclareFunction", node, opts);
+ }
+
+ function assertTSDeclareMethod(node, opts = {}) {
+ assert$2("TSDeclareMethod", node, opts);
+ }
+
+ function assertTSQualifiedName(node, opts = {}) {
+ assert$2("TSQualifiedName", node, opts);
+ }
+
+ function assertTSCallSignatureDeclaration(node, opts = {}) {
+ assert$2("TSCallSignatureDeclaration", node, opts);
+ }
+
+ function assertTSConstructSignatureDeclaration(node, opts = {}) {
+ assert$2("TSConstructSignatureDeclaration", node, opts);
+ }
+
+ function assertTSPropertySignature(node, opts = {}) {
+ assert$2("TSPropertySignature", node, opts);
+ }
+
+ function assertTSMethodSignature(node, opts = {}) {
+ assert$2("TSMethodSignature", node, opts);
+ }
+
+ function assertTSIndexSignature(node, opts = {}) {
+ assert$2("TSIndexSignature", node, opts);
+ }
+
+ function assertTSAnyKeyword(node, opts = {}) {
+ assert$2("TSAnyKeyword", node, opts);
+ }
+
+ function assertTSBooleanKeyword(node, opts = {}) {
+ assert$2("TSBooleanKeyword", node, opts);
+ }
+
+ function assertTSBigIntKeyword(node, opts = {}) {
+ assert$2("TSBigIntKeyword", node, opts);
+ }
+
+ function assertTSNeverKeyword(node, opts = {}) {
+ assert$2("TSNeverKeyword", node, opts);
+ }
+
+ function assertTSNullKeyword(node, opts = {}) {
+ assert$2("TSNullKeyword", node, opts);
+ }
+
+ function assertTSNumberKeyword(node, opts = {}) {
+ assert$2("TSNumberKeyword", node, opts);
+ }
+
+ function assertTSObjectKeyword(node, opts = {}) {
+ assert$2("TSObjectKeyword", node, opts);
+ }
+
+ function assertTSStringKeyword(node, opts = {}) {
+ assert$2("TSStringKeyword", node, opts);
+ }
+
+ function assertTSSymbolKeyword(node, opts = {}) {
+ assert$2("TSSymbolKeyword", node, opts);
+ }
+
+ function assertTSUndefinedKeyword(node, opts = {}) {
+ assert$2("TSUndefinedKeyword", node, opts);
+ }
+
+ function assertTSUnknownKeyword(node, opts = {}) {
+ assert$2("TSUnknownKeyword", node, opts);
+ }
+
+ function assertTSVoidKeyword(node, opts = {}) {
+ assert$2("TSVoidKeyword", node, opts);
+ }
+
+ function assertTSThisType(node, opts = {}) {
+ assert$2("TSThisType", node, opts);
+ }
+
+ function assertTSFunctionType(node, opts = {}) {
+ assert$2("TSFunctionType", node, opts);
+ }
+
+ function assertTSConstructorType(node, opts = {}) {
+ assert$2("TSConstructorType", node, opts);
+ }
+
+ function assertTSTypeReference(node, opts = {}) {
+ assert$2("TSTypeReference", node, opts);
+ }
+
+ function assertTSTypePredicate(node, opts = {}) {
+ assert$2("TSTypePredicate", node, opts);
+ }
+
+ function assertTSTypeQuery(node, opts = {}) {
+ assert$2("TSTypeQuery", node, opts);
+ }
+
+ function assertTSTypeLiteral(node, opts = {}) {
+ assert$2("TSTypeLiteral", node, opts);
+ }
+
+ function assertTSArrayType(node, opts = {}) {
+ assert$2("TSArrayType", node, opts);
+ }
+
+ function assertTSTupleType(node, opts = {}) {
+ assert$2("TSTupleType", node, opts);
+ }
+
+ function assertTSOptionalType(node, opts = {}) {
+ assert$2("TSOptionalType", node, opts);
+ }
+
+ function assertTSRestType(node, opts = {}) {
+ assert$2("TSRestType", node, opts);
+ }
+
+ function assertTSUnionType(node, opts = {}) {
+ assert$2("TSUnionType", node, opts);
+ }
+
+ function assertTSIntersectionType(node, opts = {}) {
+ assert$2("TSIntersectionType", node, opts);
+ }
+
+ function assertTSConditionalType(node, opts = {}) {
+ assert$2("TSConditionalType", node, opts);
+ }
+
+ function assertTSInferType(node, opts = {}) {
+ assert$2("TSInferType", node, opts);
+ }
+
+ function assertTSParenthesizedType(node, opts = {}) {
+ assert$2("TSParenthesizedType", node, opts);
+ }
+
+ function assertTSTypeOperator(node, opts = {}) {
+ assert$2("TSTypeOperator", node, opts);
+ }
+
+ function assertTSIndexedAccessType(node, opts = {}) {
+ assert$2("TSIndexedAccessType", node, opts);
+ }
+
+ function assertTSMappedType(node, opts = {}) {
+ assert$2("TSMappedType", node, opts);
+ }
+
+ function assertTSLiteralType(node, opts = {}) {
+ assert$2("TSLiteralType", node, opts);
+ }
+
+ function assertTSExpressionWithTypeArguments(node, opts = {}) {
+ assert$2("TSExpressionWithTypeArguments", node, opts);
+ }
+
+ function assertTSInterfaceDeclaration(node, opts = {}) {
+ assert$2("TSInterfaceDeclaration", node, opts);
+ }
+
+ function assertTSInterfaceBody(node, opts = {}) {
+ assert$2("TSInterfaceBody", node, opts);
+ }
+
+ function assertTSTypeAliasDeclaration(node, opts = {}) {
+ assert$2("TSTypeAliasDeclaration", node, opts);
+ }
+
+ function assertTSAsExpression(node, opts = {}) {
+ assert$2("TSAsExpression", node, opts);
+ }
+
+ function assertTSTypeAssertion(node, opts = {}) {
+ assert$2("TSTypeAssertion", node, opts);
+ }
+
+ function assertTSEnumDeclaration(node, opts = {}) {
+ assert$2("TSEnumDeclaration", node, opts);
+ }
+
+ function assertTSEnumMember(node, opts = {}) {
+ assert$2("TSEnumMember", node, opts);
+ }
+
+ function assertTSModuleDeclaration(node, opts = {}) {
+ assert$2("TSModuleDeclaration", node, opts);
+ }
+
+ function assertTSModuleBlock(node, opts = {}) {
+ assert$2("TSModuleBlock", node, opts);
+ }
+
+ function assertTSImportType(node, opts = {}) {
+ assert$2("TSImportType", node, opts);
+ }
+
+ function assertTSImportEqualsDeclaration(node, opts = {}) {
+ assert$2("TSImportEqualsDeclaration", node, opts);
+ }
+
+ function assertTSExternalModuleReference(node, opts = {}) {
+ assert$2("TSExternalModuleReference", node, opts);
+ }
+
+ function assertTSNonNullExpression(node, opts = {}) {
+ assert$2("TSNonNullExpression", node, opts);
+ }
+
+ function assertTSExportAssignment(node, opts = {}) {
+ assert$2("TSExportAssignment", node, opts);
+ }
+
+ function assertTSNamespaceExportDeclaration(node, opts = {}) {
+ assert$2("TSNamespaceExportDeclaration", node, opts);
+ }
+
+ function assertTSTypeAnnotation(node, opts = {}) {
+ assert$2("TSTypeAnnotation", node, opts);
+ }
+
+ function assertTSTypeParameterInstantiation(node, opts = {}) {
+ assert$2("TSTypeParameterInstantiation", node, opts);
+ }
+
+ function assertTSTypeParameterDeclaration(node, opts = {}) {
+ assert$2("TSTypeParameterDeclaration", node, opts);
+ }
+
+ function assertTSTypeParameter(node, opts = {}) {
+ assert$2("TSTypeParameter", node, opts);
+ }
+
+ function assertExpression(node, opts = {}) {
+ assert$2("Expression", node, opts);
+ }
+
+ function assertBinary(node, opts = {}) {
+ assert$2("Binary", node, opts);
+ }
+
+ function assertScopable(node, opts = {}) {
+ assert$2("Scopable", node, opts);
+ }
+
+ function assertBlockParent(node, opts = {}) {
+ assert$2("BlockParent", node, opts);
+ }
+
+ function assertBlock(node, opts = {}) {
+ assert$2("Block", node, opts);
+ }
+
+ function assertStatement(node, opts = {}) {
+ assert$2("Statement", node, opts);
+ }
+
+ function assertTerminatorless(node, opts = {}) {
+ assert$2("Terminatorless", node, opts);
+ }
+
+ function assertCompletionStatement(node, opts = {}) {
+ assert$2("CompletionStatement", node, opts);
+ }
+
+ function assertConditional(node, opts = {}) {
+ assert$2("Conditional", node, opts);
+ }
+
+ function assertLoop(node, opts = {}) {
+ assert$2("Loop", node, opts);
+ }
+
+ function assertWhile(node, opts = {}) {
+ assert$2("While", node, opts);
+ }
+
+ function assertExpressionWrapper(node, opts = {}) {
+ assert$2("ExpressionWrapper", node, opts);
+ }
+
+ function assertFor(node, opts = {}) {
+ assert$2("For", node, opts);
+ }
+
+ function assertForXStatement(node, opts = {}) {
+ assert$2("ForXStatement", node, opts);
+ }
+
+ function assertFunction(node, opts = {}) {
+ assert$2("Function", node, opts);
+ }
+
+ function assertFunctionParent(node, opts = {}) {
+ assert$2("FunctionParent", node, opts);
+ }
+
+ function assertPureish(node, opts = {}) {
+ assert$2("Pureish", node, opts);
+ }
+
+ function assertDeclaration(node, opts = {}) {
+ assert$2("Declaration", node, opts);
+ }
+
+ function assertPatternLike(node, opts = {}) {
+ assert$2("PatternLike", node, opts);
+ }
+
+ function assertLVal(node, opts = {}) {
+ assert$2("LVal", node, opts);
+ }
+
+ function assertTSEntityName(node, opts = {}) {
+ assert$2("TSEntityName", node, opts);
+ }
+
+ function assertLiteral(node, opts = {}) {
+ assert$2("Literal", node, opts);
+ }
+
+ function assertImmutable(node, opts = {}) {
+ assert$2("Immutable", node, opts);
+ }
+
+ function assertUserWhitespacable(node, opts = {}) {
+ assert$2("UserWhitespacable", node, opts);
+ }
+
+ function assertMethod(node, opts = {}) {
+ assert$2("Method", node, opts);
+ }
+
+ function assertObjectMember(node, opts = {}) {
+ assert$2("ObjectMember", node, opts);
+ }
+
+ function assertProperty(node, opts = {}) {
+ assert$2("Property", node, opts);
+ }
+
+ function assertUnaryLike(node, opts = {}) {
+ assert$2("UnaryLike", node, opts);
+ }
+
+ function assertPattern(node, opts = {}) {
+ assert$2("Pattern", node, opts);
+ }
+
+ function assertClass(node, opts = {}) {
+ assert$2("Class", node, opts);
+ }
+
+ function assertModuleDeclaration(node, opts = {}) {
+ assert$2("ModuleDeclaration", node, opts);
+ }
+
+ function assertExportDeclaration(node, opts = {}) {
+ assert$2("ExportDeclaration", node, opts);
+ }
+
+ function assertModuleSpecifier(node, opts = {}) {
+ assert$2("ModuleSpecifier", node, opts);
+ }
+
+ function assertFlow(node, opts = {}) {
+ assert$2("Flow", node, opts);
+ }
+
+ function assertFlowType(node, opts = {}) {
+ assert$2("FlowType", node, opts);
+ }
+
+ function assertFlowBaseAnnotation(node, opts = {}) {
+ assert$2("FlowBaseAnnotation", node, opts);
+ }
+
+ function assertFlowDeclaration(node, opts = {}) {
+ assert$2("FlowDeclaration", node, opts);
+ }
+
+ function assertFlowPredicate(node, opts = {}) {
+ assert$2("FlowPredicate", node, opts);
+ }
+
+ function assertEnumBody(node, opts = {}) {
+ assert$2("EnumBody", node, opts);
+ }
+
+ function assertEnumMember(node, opts = {}) {
+ assert$2("EnumMember", node, opts);
+ }
+
+ function assertJSX(node, opts = {}) {
+ assert$2("JSX", node, opts);
+ }
+
+ function assertPrivate(node, opts = {}) {
+ assert$2("Private", node, opts);
+ }
+
+ function assertTSTypeElement(node, opts = {}) {
+ assert$2("TSTypeElement", node, opts);
+ }
+
+ function assertTSType(node, opts = {}) {
+ assert$2("TSType", node, opts);
+ }
+
+ function assertTSBaseType(node, opts = {}) {
+ assert$2("TSBaseType", node, opts);
+ }
+
+ function assertNumberLiteral(node, opts) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ assert$2("NumberLiteral", node, opts);
+ }
+
+ function assertRegexLiteral(node, opts) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ assert$2("RegexLiteral", node, opts);
+ }
+
+ function assertRestProperty(node, opts) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ assert$2("RestProperty", node, opts);
+ }
+
+ function assertSpreadProperty(node, opts) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ assert$2("SpreadProperty", node, opts);
+ }
+
+ var createTypeAnnotationBasedOnTypeof$1 = {};
+
+ Object.defineProperty(createTypeAnnotationBasedOnTypeof$1, "__esModule", {
+ value: true
+ });
+ createTypeAnnotationBasedOnTypeof$1.default = createTypeAnnotationBasedOnTypeof;
+
+ var _generated$k = generated$2;
+
+ function createTypeAnnotationBasedOnTypeof(type) {
+ if (type === "string") {
+ return (0, _generated$k.stringTypeAnnotation)();
+ } else if (type === "number") {
+ return (0, _generated$k.numberTypeAnnotation)();
+ } else if (type === "undefined") {
+ return (0, _generated$k.voidTypeAnnotation)();
+ } else if (type === "boolean") {
+ return (0, _generated$k.booleanTypeAnnotation)();
+ } else if (type === "function") {
+ return (0, _generated$k.genericTypeAnnotation)((0, _generated$k.identifier)("Function"));
+ } else if (type === "object") {
+ return (0, _generated$k.genericTypeAnnotation)((0, _generated$k.identifier)("Object"));
+ } else if (type === "symbol") {
+ return (0, _generated$k.genericTypeAnnotation)((0, _generated$k.identifier)("Symbol"));
+ } else {
+ throw new Error("Invalid typeof value");
+ }
+ }
+
+ var createFlowUnionType$1 = {};
+
+ var removeTypeDuplicates$3 = {};
+
+ Object.defineProperty(removeTypeDuplicates$3, "__esModule", {
+ value: true
+ });
+ removeTypeDuplicates$3.default = removeTypeDuplicates$2;
+
+ var _generated$j = generated$3;
+
+ function removeTypeDuplicates$2(nodes) {
+ const generics = {};
+ const bases = {};
+ const typeGroups = [];
+ const types = [];
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+
+ if (types.indexOf(node) >= 0) {
+ continue;
+ }
+
+ if ((0, _generated$j.isAnyTypeAnnotation)(node)) {
+ return [node];
+ }
+
+ if ((0, _generated$j.isFlowBaseAnnotation)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated$j.isUnionTypeAnnotation)(node)) {
+ if (typeGroups.indexOf(node.types) < 0) {
+ nodes = nodes.concat(node.types);
+ typeGroups.push(node.types);
+ }
+
+ continue;
+ }
+
+ if ((0, _generated$j.isGenericTypeAnnotation)(node)) {
+ const name = node.id.name;
+
+ if (generics[name]) {
+ let existing = generics[name];
+
+ if (existing.typeParameters) {
+ if (node.typeParameters) {
+ existing.typeParameters.params = removeTypeDuplicates$2(existing.typeParameters.params.concat(node.typeParameters.params));
+ }
+ } else {
+ existing = node.typeParameters;
+ }
+ } else {
+ generics[name] = node;
+ }
+
+ continue;
+ }
+
+ types.push(node);
+ }
+
+ for (const type of Object.keys(bases)) {
+ types.push(bases[type]);
+ }
+
+ for (const name of Object.keys(generics)) {
+ types.push(generics[name]);
+ }
+
+ return types;
+ }
+
+ Object.defineProperty(createFlowUnionType$1, "__esModule", {
+ value: true
+ });
+ createFlowUnionType$1.default = createFlowUnionType;
+
+ var _generated$i = generated$2;
+
+ var _removeTypeDuplicates$1 = _interopRequireDefault$q(removeTypeDuplicates$3);
+
+ function _interopRequireDefault$q(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function createFlowUnionType(types) {
+ const flattened = (0, _removeTypeDuplicates$1.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated$i.unionTypeAnnotation)(flattened);
+ }
+ }
+
+ var createTSUnionType$1 = {};
+
+ var removeTypeDuplicates$1 = {};
+
+ Object.defineProperty(removeTypeDuplicates$1, "__esModule", {
+ value: true
+ });
+ removeTypeDuplicates$1.default = removeTypeDuplicates;
+
+ var _generated$h = generated$3;
+
+ function removeTypeDuplicates(nodes) {
+ const generics = {};
+ const bases = {};
+ const typeGroups = [];
+ const types = [];
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+
+ if (types.indexOf(node) >= 0) {
+ continue;
+ }
+
+ if ((0, _generated$h.isTSAnyKeyword)(node.type)) {
+ return [node];
+ }
+
+ if ((0, _generated$h.isTSBaseType)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated$h.isTSUnionType)(node)) {
+ if (typeGroups.indexOf(node.types) < 0) {
+ nodes = nodes.concat(node.types);
+ typeGroups.push(node.types);
+ }
+
+ continue;
+ }
+
+ types.push(node);
+ }
+
+ for (const type of Object.keys(bases)) {
+ types.push(bases[type]);
+ }
+
+ for (const name of Object.keys(generics)) {
+ types.push(generics[name]);
+ }
+
+ return types;
+ }
+
+ Object.defineProperty(createTSUnionType$1, "__esModule", {
+ value: true
+ });
+ createTSUnionType$1.default = createTSUnionType;
+
+ var _generated$g = generated$2;
+
+ var _removeTypeDuplicates = _interopRequireDefault$p(removeTypeDuplicates$1);
+
+ function _interopRequireDefault$p(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function createTSUnionType(typeAnnotations) {
+ const types = typeAnnotations.map(type => type.typeAnnotations);
+ const flattened = (0, _removeTypeDuplicates.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated$g.TSUnionType)(flattened);
+ }
+ }
+
+ var cloneNode$1 = {};
+
+ Object.defineProperty(cloneNode$1, "__esModule", {
+ value: true
+ });
+ cloneNode$1.default = cloneNode;
+
+ var _definitions$4 = requireDefinitions();
+
+ const has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
+
+ function cloneIfNode(obj, deep, withoutLoc) {
+ if (obj && typeof obj.type === "string") {
+ return cloneNode(obj, deep, withoutLoc);
+ }
+
+ return obj;
+ }
+
+ function cloneIfNodeOrArray(obj, deep, withoutLoc) {
+ if (Array.isArray(obj)) {
+ return obj.map(node => cloneIfNode(node, deep, withoutLoc));
+ }
+
+ return cloneIfNode(obj, deep, withoutLoc);
+ }
+
+ function cloneNode(node, deep = true, withoutLoc = false) {
+ if (!node) return node;
+ const {
+ type
+ } = node;
+ const newNode = {
+ type
+ };
+
+ if (type === "Identifier") {
+ newNode.name = node.name;
+
+ if (has$1(node, "optional") && typeof node.optional === "boolean") {
+ newNode.optional = node.optional;
+ }
+
+ if (has$1(node, "typeAnnotation")) {
+ newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
+ }
+ } else if (!has$1(_definitions$4.NODE_FIELDS, type)) {
+ throw new Error(`Unknown node type: "${type}"`);
+ } else {
+ for (const field of Object.keys(_definitions$4.NODE_FIELDS[type])) {
+ if (has$1(node, field)) {
+ if (deep) {
+ newNode[field] = type === "File" && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
+ } else {
+ newNode[field] = node[field];
+ }
+ }
+ }
+ }
+
+ if (has$1(node, "loc")) {
+ if (withoutLoc) {
+ newNode.loc = null;
+ } else {
+ newNode.loc = node.loc;
+ }
+ }
+
+ if (has$1(node, "leadingComments")) {
+ newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
+ }
+
+ if (has$1(node, "innerComments")) {
+ newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
+ }
+
+ if (has$1(node, "trailingComments")) {
+ newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
+ }
+
+ if (has$1(node, "extra")) {
+ newNode.extra = Object.assign({}, node.extra);
+ }
+
+ return newNode;
+ }
+
+ function cloneCommentsWithoutLoc(comments) {
+ return comments.map(({
+ type,
+ value
+ }) => ({
+ type,
+ value,
+ loc: null
+ }));
+ }
+
+ function maybeCloneComments(comments, deep, withoutLoc) {
+ return deep && withoutLoc ? cloneCommentsWithoutLoc(comments) : comments;
+ }
+
+ var clone$1 = {};
+
+ Object.defineProperty(clone$1, "__esModule", {
+ value: true
+ });
+ clone$1.default = clone;
+
+ var _cloneNode$5 = _interopRequireDefault$o(cloneNode$1);
+
+ function _interopRequireDefault$o(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function clone(node) {
+ return (0, _cloneNode$5.default)(node, false);
+ }
+
+ var cloneDeep$1 = {};
+
+ Object.defineProperty(cloneDeep$1, "__esModule", {
+ value: true
+ });
+ cloneDeep$1.default = cloneDeep;
+
+ var _cloneNode$4 = _interopRequireDefault$n(cloneNode$1);
+
+ function _interopRequireDefault$n(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function cloneDeep(node) {
+ return (0, _cloneNode$4.default)(node);
+ }
+
+ var cloneDeepWithoutLoc$1 = {};
+
+ Object.defineProperty(cloneDeepWithoutLoc$1, "__esModule", {
+ value: true
+ });
+ cloneDeepWithoutLoc$1.default = cloneDeepWithoutLoc;
+
+ var _cloneNode$3 = _interopRequireDefault$m(cloneNode$1);
+
+ function _interopRequireDefault$m(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function cloneDeepWithoutLoc(node) {
+ return (0, _cloneNode$3.default)(node, true, true);
+ }
+
+ var cloneWithoutLoc$1 = {};
+
+ Object.defineProperty(cloneWithoutLoc$1, "__esModule", {
+ value: true
+ });
+ cloneWithoutLoc$1.default = cloneWithoutLoc;
+
+ var _cloneNode$2 = _interopRequireDefault$l(cloneNode$1);
+
+ function _interopRequireDefault$l(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function cloneWithoutLoc(node) {
+ return (0, _cloneNode$2.default)(node, false, true);
+ }
+
+ var addComment$1 = {};
+
+ var addComments$1 = {};
+
+ Object.defineProperty(addComments$1, "__esModule", {
+ value: true
+ });
+ addComments$1.default = addComments;
+
+ function addComments(node, type, comments) {
+ if (!comments || !node) return node;
+ const key = `${type}Comments`;
+
+ if (node[key]) {
+ if (type === "leading") {
+ node[key] = comments.concat(node[key]);
+ } else {
+ node[key] = node[key].concat(comments);
+ }
+ } else {
+ node[key] = comments;
+ }
+
+ return node;
+ }
+
+ Object.defineProperty(addComment$1, "__esModule", {
+ value: true
+ });
+ addComment$1.default = addComment;
+
+ var _addComments = _interopRequireDefault$k(addComments$1);
+
+ function _interopRequireDefault$k(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function addComment(node, type, content, line) {
+ return (0, _addComments.default)(node, type, [{
+ type: line ? "CommentLine" : "CommentBlock",
+ value: content
+ }]);
+ }
+
+ var inheritInnerComments$1 = {};
+
+ var inherit$1 = {};
+
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+ /**
+ * Adds `value` to the array cache.
+ *
+ * @private
+ * @name add
+ * @memberOf SetCache
+ * @alias push
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache instance.
+ */
+ function setCacheAdd$1(value) {
+ this.__data__.set(value, HASH_UNDEFINED);
+ return this;
+ }
+
+ var _setCacheAdd = setCacheAdd$1;
+
+ function setCacheHas$1(value) {
+ return this.__data__.has(value);
+ }
+
+ var _setCacheHas = setCacheHas$1;
+
+ var MapCache = _MapCache,
+ setCacheAdd = _setCacheAdd,
+ setCacheHas = _setCacheHas;
+
+ /**
+ *
+ * Creates an array cache object to store unique values.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [values] The values to cache.
+ */
+ function SetCache$1(values) {
+ var index = -1,
+ length = values == null ? 0 : values.length;
+
+ this.__data__ = new MapCache;
+ while (++index < length) {
+ this.add(values[index]);
+ }
+ }
+
+ // Add methods to `SetCache`.
+ SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
+ SetCache$1.prototype.has = setCacheHas;
+
+ var _SetCache = SetCache$1;
+
+ function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 1 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ var _baseFindIndex = baseFindIndex$1;
+
+ function baseIsNaN$1(value) {
+ return value !== value;
+ }
+
+ var _baseIsNaN = baseIsNaN$1;
+
+ function strictIndexOf$1(array, value, fromIndex) {
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ var _strictIndexOf = strictIndexOf$1;
+
+ var baseFindIndex = _baseFindIndex,
+ baseIsNaN = _baseIsNaN,
+ strictIndexOf = _strictIndexOf;
+
+ /**
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+ function baseIndexOf$1(array, value, fromIndex) {
+ return value === value
+ ? strictIndexOf(array, value, fromIndex)
+ : baseFindIndex(array, baseIsNaN, fromIndex);
+ }
+
+ var _baseIndexOf = baseIndexOf$1;
+
+ var baseIndexOf = _baseIndexOf;
+
+ /**
+ * A specialized version of `_.includes` for arrays without support for
+ * specifying an index to search from.
+ *
+ * @private
+ * @param {Array} [array] The array to inspect.
+ * @param {*} target The value to search for.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */
+ function arrayIncludes$1(array, value) {
+ var length = array == null ? 0 : array.length;
+ return !!length && baseIndexOf(array, value, 0) > -1;
+ }
+
+ var _arrayIncludes = arrayIncludes$1;
+
+ function arrayIncludesWith$1(array, value, comparator) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (comparator(value, array[index])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ var _arrayIncludesWith = arrayIncludesWith$1;
+
+ function cacheHas$1(cache, key) {
+ return cache.has(key);
+ }
+
+ var _cacheHas = cacheHas$1;
+
+ function noop$1() {
+ // No operation performed.
+ }
+
+ var noop_1 = noop$1;
+
+ function setToArray$2(set) {
+ var index = -1,
+ result = Array(set.size);
+
+ set.forEach(function(value) {
+ result[++index] = value;
+ });
+ return result;
+ }
+
+ var _setToArray = setToArray$2;
+
+ var Set$1 = _Set,
+ noop = noop_1,
+ setToArray$1 = _setToArray;
+
+ /** Used as references for various `Number` constants. */
+ var INFINITY = 1 / 0;
+
+ /**
+ * Creates a set object of `values`.
+ *
+ * @private
+ * @param {Array} values The values to add to the set.
+ * @returns {Object} Returns the new set.
+ */
+ var createSet$1 = !(Set$1 && (1 / setToArray$1(new Set$1([,-0]))[1]) == INFINITY) ? noop : function(values) {
+ return new Set$1(values);
+ };
+
+ var _createSet = createSet$1;
+
+ var SetCache = _SetCache,
+ arrayIncludes = _arrayIncludes,
+ arrayIncludesWith = _arrayIncludesWith,
+ cacheHas = _cacheHas,
+ createSet = _createSet,
+ setToArray = _setToArray;
+
+ /** Used as the size to enable large array optimizations. */
+ var LARGE_ARRAY_SIZE = 200;
+
+ /**
+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ */
+ function baseUniq$1(array, iteratee, comparator) {
+ var index = -1,
+ includes = arrayIncludes,
+ length = array.length,
+ isCommon = true,
+ result = [],
+ seen = result;
+
+ if (comparator) {
+ isCommon = false;
+ includes = arrayIncludesWith;
+ }
+ else if (length >= LARGE_ARRAY_SIZE) {
+ var set = iteratee ? null : createSet(array);
+ if (set) {
+ return setToArray(set);
+ }
+ isCommon = false;
+ includes = cacheHas;
+ seen = new SetCache;
+ }
+ else {
+ seen = iteratee ? [] : result;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value) : value;
+
+ value = (comparator || value !== 0) ? value : 0;
+ if (isCommon && computed === computed) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ else if (!includes(seen, computed, comparator)) {
+ if (seen !== result) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ var _baseUniq = baseUniq$1;
+
+ var baseUniq = _baseUniq;
+
+ /**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurrence of each element
+ * is kept. The order of result values is determined by the order they occur
+ * in the array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ */
+ function uniq(array) {
+ return (array && array.length) ? baseUniq(array) : [];
+ }
+
+ var uniq_1 = uniq;
+
+ Object.defineProperty(inherit$1, "__esModule", {
+ value: true
+ });
+ inherit$1.default = inherit;
+
+ var _uniq = _interopRequireDefault$j(uniq_1);
+
+ function _interopRequireDefault$j(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function inherit(key, child, parent) {
+ if (child && parent) {
+ child[key] = (0, _uniq.default)([].concat(child[key], parent[key]).filter(Boolean));
+ }
+ }
+
+ Object.defineProperty(inheritInnerComments$1, "__esModule", {
+ value: true
+ });
+ inheritInnerComments$1.default = inheritInnerComments;
+
+ var _inherit$2 = _interopRequireDefault$i(inherit$1);
+
+ function _interopRequireDefault$i(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function inheritInnerComments(child, parent) {
+ (0, _inherit$2.default)("innerComments", child, parent);
+ }
+
+ var inheritLeadingComments$1 = {};
+
+ Object.defineProperty(inheritLeadingComments$1, "__esModule", {
+ value: true
+ });
+ inheritLeadingComments$1.default = inheritLeadingComments;
+
+ var _inherit$1 = _interopRequireDefault$h(inherit$1);
+
+ function _interopRequireDefault$h(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function inheritLeadingComments(child, parent) {
+ (0, _inherit$1.default)("leadingComments", child, parent);
+ }
+
+ var inheritsComments$1 = {};
+
+ var inheritTrailingComments$1 = {};
+
+ Object.defineProperty(inheritTrailingComments$1, "__esModule", {
+ value: true
+ });
+ inheritTrailingComments$1.default = inheritTrailingComments;
+
+ var _inherit = _interopRequireDefault$g(inherit$1);
+
+ function _interopRequireDefault$g(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function inheritTrailingComments(child, parent) {
+ (0, _inherit.default)("trailingComments", child, parent);
+ }
+
+ Object.defineProperty(inheritsComments$1, "__esModule", {
+ value: true
+ });
+ inheritsComments$1.default = inheritsComments;
+
+ var _inheritTrailingComments = _interopRequireDefault$f(inheritTrailingComments$1);
+
+ var _inheritLeadingComments = _interopRequireDefault$f(inheritLeadingComments$1);
+
+ var _inheritInnerComments = _interopRequireDefault$f(inheritInnerComments$1);
+
+ function _interopRequireDefault$f(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function inheritsComments(child, parent) {
+ (0, _inheritTrailingComments.default)(child, parent);
+ (0, _inheritLeadingComments.default)(child, parent);
+ (0, _inheritInnerComments.default)(child, parent);
+ return child;
+ }
+
+ var removeComments$1 = {};
+
+ Object.defineProperty(removeComments$1, "__esModule", {
+ value: true
+ });
+ removeComments$1.default = removeComments;
+
+ var _constants$4 = constants;
+
+ function removeComments(node) {
+ _constants$4.COMMENT_KEYS.forEach(key => {
+ node[key] = null;
+ });
+
+ return node;
+ }
+
+ var generated = {};
+
+ Object.defineProperty(generated, "__esModule", {
+ value: true
+ });
+ generated.TSBASETYPE_TYPES = generated.TSTYPE_TYPES = generated.TSTYPEELEMENT_TYPES = generated.PRIVATE_TYPES = generated.JSX_TYPES = generated.ENUMMEMBER_TYPES = generated.ENUMBODY_TYPES = generated.FLOWPREDICATE_TYPES = generated.FLOWDECLARATION_TYPES = generated.FLOWBASEANNOTATION_TYPES = generated.FLOWTYPE_TYPES = generated.FLOW_TYPES = generated.MODULESPECIFIER_TYPES = generated.EXPORTDECLARATION_TYPES = generated.MODULEDECLARATION_TYPES = generated.CLASS_TYPES = generated.PATTERN_TYPES = generated.UNARYLIKE_TYPES = generated.PROPERTY_TYPES = generated.OBJECTMEMBER_TYPES = generated.METHOD_TYPES = generated.USERWHITESPACABLE_TYPES = generated.IMMUTABLE_TYPES = generated.LITERAL_TYPES = generated.TSENTITYNAME_TYPES = generated.LVAL_TYPES = generated.PATTERNLIKE_TYPES = generated.DECLARATION_TYPES = generated.PUREISH_TYPES = generated.FUNCTIONPARENT_TYPES = generated.FUNCTION_TYPES = generated.FORXSTATEMENT_TYPES = generated.FOR_TYPES = generated.EXPRESSIONWRAPPER_TYPES = generated.WHILE_TYPES = generated.LOOP_TYPES = generated.CONDITIONAL_TYPES = generated.COMPLETIONSTATEMENT_TYPES = generated.TERMINATORLESS_TYPES = generated.STATEMENT_TYPES = generated.BLOCK_TYPES = generated.BLOCKPARENT_TYPES = generated.SCOPABLE_TYPES = generated.BINARY_TYPES = generated.EXPRESSION_TYPES = void 0;
+
+ var _definitions$3 = requireDefinitions();
+
+ const EXPRESSION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Expression"];
+ generated.EXPRESSION_TYPES = EXPRESSION_TYPES;
+ const BINARY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Binary"];
+ generated.BINARY_TYPES = BINARY_TYPES;
+ const SCOPABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Scopable"];
+ generated.SCOPABLE_TYPES = SCOPABLE_TYPES;
+ const BLOCKPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["BlockParent"];
+ generated.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
+ const BLOCK_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Block"];
+ generated.BLOCK_TYPES = BLOCK_TYPES;
+ const STATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Statement"];
+ generated.STATEMENT_TYPES = STATEMENT_TYPES;
+ const TERMINATORLESS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Terminatorless"];
+ generated.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
+ const COMPLETIONSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["CompletionStatement"];
+ generated.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
+ const CONDITIONAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Conditional"];
+ generated.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
+ const LOOP_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Loop"];
+ generated.LOOP_TYPES = LOOP_TYPES;
+ const WHILE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["While"];
+ generated.WHILE_TYPES = WHILE_TYPES;
+ const EXPRESSIONWRAPPER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
+ generated.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
+ const FOR_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["For"];
+ generated.FOR_TYPES = FOR_TYPES;
+ const FORXSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ForXStatement"];
+ generated.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
+ const FUNCTION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Function"];
+ generated.FUNCTION_TYPES = FUNCTION_TYPES;
+ const FUNCTIONPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FunctionParent"];
+ generated.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
+ const PUREISH_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pureish"];
+ generated.PUREISH_TYPES = PUREISH_TYPES;
+ const DECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Declaration"];
+ generated.DECLARATION_TYPES = DECLARATION_TYPES;
+ const PATTERNLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["PatternLike"];
+ generated.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
+ const LVAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["LVal"];
+ generated.LVAL_TYPES = LVAL_TYPES;
+ const TSENTITYNAME_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSEntityName"];
+ generated.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
+ const LITERAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Literal"];
+ generated.LITERAL_TYPES = LITERAL_TYPES;
+ const IMMUTABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Immutable"];
+ generated.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
+ const USERWHITESPACABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
+ generated.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
+ const METHOD_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Method"];
+ generated.METHOD_TYPES = METHOD_TYPES;
+ const OBJECTMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ObjectMember"];
+ generated.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
+ const PROPERTY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Property"];
+ generated.PROPERTY_TYPES = PROPERTY_TYPES;
+ const UNARYLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UnaryLike"];
+ generated.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
+ const PATTERN_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pattern"];
+ generated.PATTERN_TYPES = PATTERN_TYPES;
+ const CLASS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Class"];
+ generated.CLASS_TYPES = CLASS_TYPES;
+ const MODULEDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
+ generated.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
+ const EXPORTDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
+ generated.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
+ const MODULESPECIFIER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
+ generated.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
+ const FLOW_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Flow"];
+ generated.FLOW_TYPES = FLOW_TYPES;
+ const FLOWTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowType"];
+ generated.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
+ const FLOWBASEANNOTATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
+ generated.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
+ const FLOWDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
+ generated.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
+ const FLOWPREDICATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowPredicate"];
+ generated.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
+ const ENUMBODY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumBody"];
+ generated.ENUMBODY_TYPES = ENUMBODY_TYPES;
+ const ENUMMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumMember"];
+ generated.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;
+ const JSX_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["JSX"];
+ generated.JSX_TYPES = JSX_TYPES;
+ const PRIVATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Private"];
+ generated.PRIVATE_TYPES = PRIVATE_TYPES;
+ const TSTYPEELEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSTypeElement"];
+ generated.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
+ const TSTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSType"];
+ generated.TSTYPE_TYPES = TSTYPE_TYPES;
+ const TSBASETYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSBaseType"];
+ generated.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
+
+ var ensureBlock$1 = {};
+
+ var toBlock$1 = {};
+
+ Object.defineProperty(toBlock$1, "__esModule", {
+ value: true
+ });
+ toBlock$1.default = toBlock;
+
+ var _generated$f = generated$3;
+
+ var _generated2$3 = generated$2;
+
+ function toBlock(node, parent) {
+ if ((0, _generated$f.isBlockStatement)(node)) {
+ return node;
+ }
+
+ let blockNodes = [];
+
+ if ((0, _generated$f.isEmptyStatement)(node)) {
+ blockNodes = [];
+ } else {
+ if (!(0, _generated$f.isStatement)(node)) {
+ if ((0, _generated$f.isFunction)(parent)) {
+ node = (0, _generated2$3.returnStatement)(node);
+ } else {
+ node = (0, _generated2$3.expressionStatement)(node);
+ }
+ }
+
+ blockNodes = [node];
+ }
+
+ return (0, _generated2$3.blockStatement)(blockNodes);
+ }
+
+ Object.defineProperty(ensureBlock$1, "__esModule", {
+ value: true
+ });
+ ensureBlock$1.default = ensureBlock;
+
+ var _toBlock = _interopRequireDefault$e(toBlock$1);
+
+ function _interopRequireDefault$e(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function ensureBlock(node, key = "body") {
+ return node[key] = (0, _toBlock.default)(node[key], node);
+ }
+
+ var toBindingIdentifierName$1 = {};
+
+ var toIdentifier$1 = {};
+
+ Object.defineProperty(toIdentifier$1, "__esModule", {
+ value: true
+ });
+ toIdentifier$1.default = toIdentifier;
+
+ var _isValidIdentifier$2 = _interopRequireDefault$d(isValidIdentifier$1);
+
+ function _interopRequireDefault$d(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function toIdentifier(name) {
+ name = name + "";
+ name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
+ name = name.replace(/^[-0-9]+/, "");
+ name = name.replace(/[-\s]+(.)?/g, function (match, c) {
+ return c ? c.toUpperCase() : "";
+ });
+
+ if (!(0, _isValidIdentifier$2.default)(name)) {
+ name = `_${name}`;
+ }
+
+ return name || "_";
+ }
+
+ Object.defineProperty(toBindingIdentifierName$1, "__esModule", {
+ value: true
+ });
+ toBindingIdentifierName$1.default = toBindingIdentifierName;
+
+ var _toIdentifier = _interopRequireDefault$c(toIdentifier$1);
+
+ function _interopRequireDefault$c(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function toBindingIdentifierName(name) {
+ name = (0, _toIdentifier.default)(name);
+ if (name === "eval" || name === "arguments") name = "_" + name;
+ return name;
+ }
+
+ var toComputedKey$1 = {};
+
+ Object.defineProperty(toComputedKey$1, "__esModule", {
+ value: true
+ });
+ toComputedKey$1.default = toComputedKey;
+
+ var _generated$e = generated$3;
+
+ var _generated2$2 = generated$2;
+
+ function toComputedKey(node, key = node.key || node.property) {
+ if (!node.computed && (0, _generated$e.isIdentifier)(key)) key = (0, _generated2$2.stringLiteral)(key.name);
+ return key;
+ }
+
+ var toExpression$1 = {};
+
+ Object.defineProperty(toExpression$1, "__esModule", {
+ value: true
+ });
+ toExpression$1.default = toExpression;
+
+ var _generated$d = generated$3;
+
+ function toExpression(node) {
+ if ((0, _generated$d.isExpressionStatement)(node)) {
+ node = node.expression;
+ }
+
+ if ((0, _generated$d.isExpression)(node)) {
+ return node;
+ }
+
+ if ((0, _generated$d.isClass)(node)) {
+ node.type = "ClassExpression";
+ } else if ((0, _generated$d.isFunction)(node)) {
+ node.type = "FunctionExpression";
+ }
+
+ if (!(0, _generated$d.isExpression)(node)) {
+ throw new Error(`cannot turn ${node.type} to an expression`);
+ }
+
+ return node;
+ }
+
+ var toKeyAlias$1 = {};
+
+ var removePropertiesDeep$1 = {};
+
+ var traverseFast$1 = {};
+
+ Object.defineProperty(traverseFast$1, "__esModule", {
+ value: true
+ });
+ traverseFast$1.default = traverseFast;
+
+ var _definitions$2 = requireDefinitions();
+
+ function traverseFast(node, enter, opts) {
+ if (!node) return;
+ const keys = _definitions$2.VISITOR_KEYS[node.type];
+ if (!keys) return;
+ opts = opts || {};
+ enter(node, opts);
+
+ for (const key of keys) {
+ const subNode = node[key];
+
+ if (Array.isArray(subNode)) {
+ for (const node of subNode) {
+ traverseFast(node, enter, opts);
+ }
+ } else {
+ traverseFast(subNode, enter, opts);
+ }
+ }
+ }
+
+ var removeProperties$1 = {};
+
+ Object.defineProperty(removeProperties$1, "__esModule", {
+ value: true
+ });
+ removeProperties$1.default = removeProperties;
+
+ var _constants$3 = constants;
+
+ const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
+
+ const CLEAR_KEYS_PLUS_COMMENTS = _constants$3.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
+
+ function removeProperties(node, opts = {}) {
+ const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
+
+ for (const key of map) {
+ if (node[key] != null) node[key] = undefined;
+ }
+
+ for (const key of Object.keys(node)) {
+ if (key[0] === "_" && node[key] != null) node[key] = undefined;
+ }
+
+ const symbols = Object.getOwnPropertySymbols(node);
+
+ for (const sym of symbols) {
+ node[sym] = null;
+ }
+ }
+
+ Object.defineProperty(removePropertiesDeep$1, "__esModule", {
+ value: true
+ });
+ removePropertiesDeep$1.default = removePropertiesDeep;
+
+ var _traverseFast = _interopRequireDefault$b(traverseFast$1);
+
+ var _removeProperties = _interopRequireDefault$b(removeProperties$1);
+
+ function _interopRequireDefault$b(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function removePropertiesDeep(tree, opts) {
+ (0, _traverseFast.default)(tree, _removeProperties.default, opts);
+ return tree;
+ }
+
+ Object.defineProperty(toKeyAlias$1, "__esModule", {
+ value: true
+ });
+ toKeyAlias$1.default = toKeyAlias;
+
+ var _generated$c = generated$3;
+
+ var _cloneNode$1 = _interopRequireDefault$a(cloneNode$1);
+
+ var _removePropertiesDeep = _interopRequireDefault$a(removePropertiesDeep$1);
+
+ function _interopRequireDefault$a(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function toKeyAlias(node, key = node.key) {
+ let alias;
+
+ if (node.kind === "method") {
+ return toKeyAlias.increment() + "";
+ } else if ((0, _generated$c.isIdentifier)(key)) {
+ alias = key.name;
+ } else if ((0, _generated$c.isStringLiteral)(key)) {
+ alias = JSON.stringify(key.value);
+ } else {
+ alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode$1.default)(key)));
+ }
+
+ if (node.computed) {
+ alias = `[${alias}]`;
+ }
+
+ if (node.static) {
+ alias = `static:${alias}`;
+ }
+
+ return alias;
+ }
+
+ toKeyAlias.uid = 0;
+
+ toKeyAlias.increment = function () {
+ if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
+ return toKeyAlias.uid = 0;
+ } else {
+ return toKeyAlias.uid++;
+ }
+ };
+
+ var toSequenceExpression$1 = {};
+
+ var gatherSequenceExpressions$1 = {};
+
+ var getBindingIdentifiers$1 = {};
+
+ Object.defineProperty(getBindingIdentifiers$1, "__esModule", {
+ value: true
+ });
+ getBindingIdentifiers$1.default = getBindingIdentifiers;
+
+ var _generated$b = generated$3;
+
+ function getBindingIdentifiers(node, duplicates, outerOnly) {
+ let search = [].concat(node);
+ const ids = Object.create(null);
+
+ while (search.length) {
+ const id = search.shift();
+ if (!id) continue;
+ const keys = getBindingIdentifiers.keys[id.type];
+
+ if ((0, _generated$b.isIdentifier)(id)) {
+ if (duplicates) {
+ const _ids = ids[id.name] = ids[id.name] || [];
+
+ _ids.push(id);
+ } else {
+ ids[id.name] = id;
+ }
+
+ continue;
+ }
+
+ if ((0, _generated$b.isExportDeclaration)(id)) {
+ if ((0, _generated$b.isDeclaration)(id.declaration)) {
+ search.push(id.declaration);
+ }
+
+ continue;
+ }
+
+ if (outerOnly) {
+ if ((0, _generated$b.isFunctionDeclaration)(id)) {
+ search.push(id.id);
+ continue;
+ }
+
+ if ((0, _generated$b.isFunctionExpression)(id)) {
+ continue;
+ }
+ }
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+
+ if (id[key]) {
+ search = search.concat(id[key]);
+ }
+ }
+ }
+ }
+
+ return ids;
+ }
+
+ getBindingIdentifiers.keys = {
+ DeclareClass: ["id"],
+ DeclareFunction: ["id"],
+ DeclareModule: ["id"],
+ DeclareVariable: ["id"],
+ DeclareInterface: ["id"],
+ DeclareTypeAlias: ["id"],
+ DeclareOpaqueType: ["id"],
+ InterfaceDeclaration: ["id"],
+ TypeAlias: ["id"],
+ OpaqueType: ["id"],
+ CatchClause: ["param"],
+ LabeledStatement: ["label"],
+ UnaryExpression: ["argument"],
+ AssignmentExpression: ["left"],
+ ImportSpecifier: ["local"],
+ ImportNamespaceSpecifier: ["local"],
+ ImportDefaultSpecifier: ["local"],
+ ImportDeclaration: ["specifiers"],
+ ExportSpecifier: ["exported"],
+ ExportNamespaceSpecifier: ["exported"],
+ ExportDefaultSpecifier: ["exported"],
+ FunctionDeclaration: ["id", "params"],
+ FunctionExpression: ["id", "params"],
+ ArrowFunctionExpression: ["params"],
+ ObjectMethod: ["params"],
+ ClassMethod: ["params"],
+ ForInStatement: ["left"],
+ ForOfStatement: ["left"],
+ ClassDeclaration: ["id"],
+ ClassExpression: ["id"],
+ RestElement: ["argument"],
+ UpdateExpression: ["argument"],
+ ObjectProperty: ["value"],
+ AssignmentPattern: ["left"],
+ ArrayPattern: ["elements"],
+ ObjectPattern: ["properties"],
+ VariableDeclaration: ["declarations"],
+ VariableDeclarator: ["id"]
+ };
+
+ Object.defineProperty(gatherSequenceExpressions$1, "__esModule", {
+ value: true
+ });
+ gatherSequenceExpressions$1.default = gatherSequenceExpressions;
+
+ var _getBindingIdentifiers$2 = _interopRequireDefault$9(getBindingIdentifiers$1);
+
+ var _generated$a = generated$3;
+
+ var _generated2$1 = generated$2;
+
+ var _cloneNode = _interopRequireDefault$9(cloneNode$1);
+
+ function _interopRequireDefault$9(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function gatherSequenceExpressions(nodes, scope, declars) {
+ const exprs = [];
+ let ensureLastUndefined = true;
+
+ for (const node of nodes) {
+ if (!(0, _generated$a.isEmptyStatement)(node)) {
+ ensureLastUndefined = false;
+ }
+
+ if ((0, _generated$a.isExpression)(node)) {
+ exprs.push(node);
+ } else if ((0, _generated$a.isExpressionStatement)(node)) {
+ exprs.push(node.expression);
+ } else if ((0, _generated$a.isVariableDeclaration)(node)) {
+ if (node.kind !== "var") return;
+
+ for (const declar of node.declarations) {
+ const bindings = (0, _getBindingIdentifiers$2.default)(declar);
+
+ for (const key of Object.keys(bindings)) {
+ declars.push({
+ kind: node.kind,
+ id: (0, _cloneNode.default)(bindings[key])
+ });
+ }
+
+ if (declar.init) {
+ exprs.push((0, _generated2$1.assignmentExpression)("=", declar.id, declar.init));
+ }
+ }
+
+ ensureLastUndefined = true;
+ } else if ((0, _generated$a.isIfStatement)(node)) {
+ const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
+ const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
+ if (!consequent || !alternate) return;
+ exprs.push((0, _generated2$1.conditionalExpression)(node.test, consequent, alternate));
+ } else if ((0, _generated$a.isBlockStatement)(node)) {
+ const body = gatherSequenceExpressions(node.body, scope, declars);
+ if (!body) return;
+ exprs.push(body);
+ } else if ((0, _generated$a.isEmptyStatement)(node)) {
+ if (nodes.indexOf(node) === 0) {
+ ensureLastUndefined = true;
+ }
+ } else {
+ return;
+ }
+ }
+
+ if (ensureLastUndefined) {
+ exprs.push(scope.buildUndefinedNode());
+ }
+
+ if (exprs.length === 1) {
+ return exprs[0];
+ } else {
+ return (0, _generated2$1.sequenceExpression)(exprs);
+ }
+ }
+
+ Object.defineProperty(toSequenceExpression$1, "__esModule", {
+ value: true
+ });
+ toSequenceExpression$1.default = toSequenceExpression;
+
+ var _gatherSequenceExpressions = _interopRequireDefault$8(gatherSequenceExpressions$1);
+
+ function _interopRequireDefault$8(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function toSequenceExpression(nodes, scope) {
+ if (!(nodes == null ? void 0 : nodes.length)) return;
+ const declars = [];
+ const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
+ if (!result) return;
+
+ for (const declar of declars) {
+ scope.push(declar);
+ }
+
+ return result;
+ }
+
+ var toStatement$1 = {};
+
+ Object.defineProperty(toStatement$1, "__esModule", {
+ value: true
+ });
+ toStatement$1.default = toStatement;
+
+ var _generated$9 = generated$3;
+
+ var _generated2 = generated$2;
+
+ function toStatement(node, ignore) {
+ if ((0, _generated$9.isStatement)(node)) {
+ return node;
+ }
+
+ let mustHaveId = false;
+ let newType;
+
+ if ((0, _generated$9.isClass)(node)) {
+ mustHaveId = true;
+ newType = "ClassDeclaration";
+ } else if ((0, _generated$9.isFunction)(node)) {
+ mustHaveId = true;
+ newType = "FunctionDeclaration";
+ } else if ((0, _generated$9.isAssignmentExpression)(node)) {
+ return (0, _generated2.expressionStatement)(node);
+ }
+
+ if (mustHaveId && !node.id) {
+ newType = false;
+ }
+
+ if (!newType) {
+ if (ignore) {
+ return false;
+ } else {
+ throw new Error(`cannot turn ${node.type} to a statement`);
+ }
+ }
+
+ node.type = newType;
+ return node;
+ }
+
+ var valueToNode$1 = {};
+
+ var baseGetTag$1 = _baseGetTag,
+ getPrototype = _getPrototype,
+ isObjectLike$1 = isObjectLike_1;
+
+ /** `Object#toString` result references. */
+ var objectTag = '[object Object]';
+
+ /** Used for built-in method references. */
+ var funcProto = Function.prototype,
+ objectProto = Object.prototype;
+
+ /** Used to resolve the decompiled source of functions. */
+ var funcToString = funcProto.toString;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty$1 = objectProto.hasOwnProperty;
+
+ /** Used to infer the `Object` constructor. */
+ var objectCtorString = funcToString.call(Object);
+
+ /**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.8.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+ function isPlainObject(value) {
+ if (!isObjectLike$1(value) || baseGetTag$1(value) != objectTag) {
+ return false;
+ }
+ var proto = getPrototype(value);
+ if (proto === null) {
+ return true;
+ }
+ var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor;
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
+ funcToString.call(Ctor) == objectCtorString;
+ }
+
+ var isPlainObject_1 = isPlainObject;
+
+ var baseGetTag = _baseGetTag,
+ isObjectLike = isObjectLike_1;
+
+ /** `Object#toString` result references. */
+ var regexpTag = '[object RegExp]';
+
+ /**
+ * The base implementation of `_.isRegExp` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
+ */
+ function baseIsRegExp$1(value) {
+ return isObjectLike(value) && baseGetTag(value) == regexpTag;
+ }
+
+ var _baseIsRegExp = baseIsRegExp$1;
+
+ var baseIsRegExp = _baseIsRegExp,
+ baseUnary = _baseUnary,
+ nodeUtil = _nodeUtilExports;
+
+ /* Node.js helper references. */
+ var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
+
+ /**
+ * Checks if `value` is classified as a `RegExp` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
+ * @example
+ *
+ * _.isRegExp(/abc/);
+ * // => true
+ *
+ * _.isRegExp('/abc/');
+ * // => false
+ */
+ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
+
+ var isRegExp_1 = isRegExp;
+
+ Object.defineProperty(valueToNode$1, "__esModule", {
+ value: true
+ });
+ valueToNode$1.default = valueToNode;
+
+ var _isPlainObject = _interopRequireDefault$7(isPlainObject_1);
+
+ var _isRegExp = _interopRequireDefault$7(isRegExp_1);
+
+ var _isValidIdentifier$1 = _interopRequireDefault$7(isValidIdentifier$1);
+
+ var _generated$8 = generated$2;
+
+ function _interopRequireDefault$7(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function valueToNode(value) {
+ if (value === undefined) {
+ return (0, _generated$8.identifier)("undefined");
+ }
+
+ if (value === true || value === false) {
+ return (0, _generated$8.booleanLiteral)(value);
+ }
+
+ if (value === null) {
+ return (0, _generated$8.nullLiteral)();
+ }
+
+ if (typeof value === "string") {
+ return (0, _generated$8.stringLiteral)(value);
+ }
+
+ if (typeof value === "number") {
+ let result;
+
+ if (Number.isFinite(value)) {
+ result = (0, _generated$8.numericLiteral)(Math.abs(value));
+ } else {
+ let numerator;
+
+ if (Number.isNaN(value)) {
+ numerator = (0, _generated$8.numericLiteral)(0);
+ } else {
+ numerator = (0, _generated$8.numericLiteral)(1);
+ }
+
+ result = (0, _generated$8.binaryExpression)("/", numerator, (0, _generated$8.numericLiteral)(0));
+ }
+
+ if (value < 0 || Object.is(value, -0)) {
+ result = (0, _generated$8.unaryExpression)("-", result);
+ }
+
+ return result;
+ }
+
+ if ((0, _isRegExp.default)(value)) {
+ const pattern = value.source;
+ const flags = value.toString().match(/\/([a-z]+|)$/)[1];
+ return (0, _generated$8.regExpLiteral)(pattern, flags);
+ }
+
+ if (Array.isArray(value)) {
+ return (0, _generated$8.arrayExpression)(value.map(valueToNode));
+ }
+
+ if ((0, _isPlainObject.default)(value)) {
+ const props = [];
+
+ for (const key of Object.keys(value)) {
+ let nodeKey;
+
+ if ((0, _isValidIdentifier$1.default)(key)) {
+ nodeKey = (0, _generated$8.identifier)(key);
+ } else {
+ nodeKey = (0, _generated$8.stringLiteral)(key);
+ }
+
+ props.push((0, _generated$8.objectProperty)(nodeKey, valueToNode(value[key])));
+ }
+
+ return (0, _generated$8.objectExpression)(props);
+ }
+
+ throw new Error("don't know how to turn this value into a node");
+ }
+
+ var appendToMemberExpression$1 = {};
+
+ Object.defineProperty(appendToMemberExpression$1, "__esModule", {
+ value: true
+ });
+ appendToMemberExpression$1.default = appendToMemberExpression;
+
+ var _generated$7 = generated$2;
+
+ function appendToMemberExpression(member, append, computed = false) {
+ member.object = (0, _generated$7.memberExpression)(member.object, member.property, member.computed);
+ member.property = append;
+ member.computed = !!computed;
+ return member;
+ }
+
+ var inherits$1 = {};
+
+ Object.defineProperty(inherits$1, "__esModule", {
+ value: true
+ });
+ inherits$1.default = inherits;
+
+ var _constants$2 = constants;
+
+ var _inheritsComments = _interopRequireDefault$6(inheritsComments$1);
+
+ function _interopRequireDefault$6(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function inherits(child, parent) {
+ if (!child || !parent) return child;
+
+ for (const key of _constants$2.INHERIT_KEYS.optional) {
+ if (child[key] == null) {
+ child[key] = parent[key];
+ }
+ }
+
+ for (const key of Object.keys(parent)) {
+ if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
+ }
+
+ for (const key of _constants$2.INHERIT_KEYS.force) {
+ child[key] = parent[key];
+ }
+
+ (0, _inheritsComments.default)(child, parent);
+ return child;
+ }
+
+ var prependToMemberExpression$1 = {};
+
+ Object.defineProperty(prependToMemberExpression$1, "__esModule", {
+ value: true
+ });
+ prependToMemberExpression$1.default = prependToMemberExpression;
+
+ var _generated$6 = generated$2;
+
+ function prependToMemberExpression(member, prepend) {
+ member.object = (0, _generated$6.memberExpression)(prepend, member.object);
+ return member;
+ }
+
+ var getOuterBindingIdentifiers$1 = {};
+
+ Object.defineProperty(getOuterBindingIdentifiers$1, "__esModule", {
+ value: true
+ });
+ getOuterBindingIdentifiers$1.default = getOuterBindingIdentifiers;
+
+ var _getBindingIdentifiers$1 = _interopRequireDefault$5(getBindingIdentifiers$1);
+
+ function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function getOuterBindingIdentifiers(node, duplicates) {
+ return (0, _getBindingIdentifiers$1.default)(node, duplicates, true);
+ }
+
+ var traverse$1 = {};
+
+ Object.defineProperty(traverse$1, "__esModule", {
+ value: true
+ });
+ traverse$1.default = traverse;
+
+ var _definitions$1 = requireDefinitions();
+
+ function traverse(node, handlers, state) {
+ if (typeof handlers === "function") {
+ handlers = {
+ enter: handlers
+ };
+ }
+
+ const {
+ enter,
+ exit
+ } = handlers;
+ traverseSimpleImpl(node, enter, exit, state, []);
+ }
+
+ function traverseSimpleImpl(node, enter, exit, state, ancestors) {
+ const keys = _definitions$1.VISITOR_KEYS[node.type];
+ if (!keys) return;
+ if (enter) enter(node, ancestors, state);
+
+ for (const key of keys) {
+ const subNode = node[key];
+
+ if (Array.isArray(subNode)) {
+ for (let i = 0; i < subNode.length; i++) {
+ const child = subNode[i];
+ if (!child) continue;
+ ancestors.push({
+ node,
+ key,
+ index: i
+ });
+ traverseSimpleImpl(child, enter, exit, state, ancestors);
+ ancestors.pop();
+ }
+ } else if (subNode) {
+ ancestors.push({
+ node,
+ key
+ });
+ traverseSimpleImpl(subNode, enter, exit, state, ancestors);
+ ancestors.pop();
+ }
+ }
+
+ if (exit) exit(node, ancestors, state);
+ }
+
+ var isBinding$1 = {};
+
+ Object.defineProperty(isBinding$1, "__esModule", {
+ value: true
+ });
+ isBinding$1.default = isBinding;
+
+ var _getBindingIdentifiers = _interopRequireDefault$4(getBindingIdentifiers$1);
+
+ function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function isBinding(node, parent, grandparent) {
+ if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
+ return false;
+ }
+
+ const keys = _getBindingIdentifiers.default.keys[parent.type];
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+ const val = parent[key];
+
+ if (Array.isArray(val)) {
+ if (val.indexOf(node) >= 0) return true;
+ } else {
+ if (val === node) return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ var isBlockScoped$1 = {};
+
+ var isLet$1 = {};
+
+ Object.defineProperty(isLet$1, "__esModule", {
+ value: true
+ });
+ isLet$1.default = isLet;
+
+ var _generated$5 = generated$3;
+
+ var _constants$1 = constants;
+
+ function isLet(node) {
+ return (0, _generated$5.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants$1.BLOCK_SCOPED_SYMBOL]);
+ }
+
+ Object.defineProperty(isBlockScoped$1, "__esModule", {
+ value: true
+ });
+ isBlockScoped$1.default = isBlockScoped;
+
+ var _generated$4 = generated$3;
+
+ var _isLet = _interopRequireDefault$3(isLet$1);
+
+ function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function isBlockScoped(node) {
+ return (0, _generated$4.isFunctionDeclaration)(node) || (0, _generated$4.isClassDeclaration)(node) || (0, _isLet.default)(node);
+ }
+
+ var isImmutable$1 = {};
+
+ Object.defineProperty(isImmutable$1, "__esModule", {
+ value: true
+ });
+ isImmutable$1.default = isImmutable;
+
+ var _isType = _interopRequireDefault$2(requireIsType());
+
+ var _generated$3 = generated$3;
+
+ function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function isImmutable(node) {
+ if ((0, _isType.default)(node.type, "Immutable")) return true;
+
+ if ((0, _generated$3.isIdentifier)(node)) {
+ if (node.name === "undefined") {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+ var isNodesEquivalent$1 = {};
+
+ Object.defineProperty(isNodesEquivalent$1, "__esModule", {
+ value: true
+ });
+ isNodesEquivalent$1.default = isNodesEquivalent;
+
+ var _definitions = requireDefinitions();
+
+ function isNodesEquivalent(a, b) {
+ if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
+ return a === b;
+ }
+
+ if (a.type !== b.type) {
+ return false;
+ }
+
+ const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
+ const visitorKeys = _definitions.VISITOR_KEYS[a.type];
+
+ for (const field of fields) {
+ if (typeof a[field] !== typeof b[field]) {
+ return false;
+ }
+
+ if (a[field] == null && b[field] == null) {
+ continue;
+ } else if (a[field] == null || b[field] == null) {
+ return false;
+ }
+
+ if (Array.isArray(a[field])) {
+ if (!Array.isArray(b[field])) {
+ return false;
+ }
+
+ if (a[field].length !== b[field].length) {
+ return false;
+ }
+
+ for (let i = 0; i < a[field].length; i++) {
+ if (!isNodesEquivalent(a[field][i], b[field][i])) {
+ return false;
+ }
+ }
+
+ continue;
+ }
+
+ if (typeof a[field] === "object" && !(visitorKeys == null ? void 0 : visitorKeys.includes(field))) {
+ for (const key of Object.keys(a[field])) {
+ if (a[field][key] !== b[field][key]) {
+ return false;
+ }
+ }
+
+ continue;
+ }
+
+ if (!isNodesEquivalent(a[field], b[field])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ var isReferenced$1 = {};
+
+ Object.defineProperty(isReferenced$1, "__esModule", {
+ value: true
+ });
+ isReferenced$1.default = isReferenced;
+
+ function isReferenced(node, parent, grandparent) {
+ switch (parent.type) {
+ case "MemberExpression":
+ case "JSXMemberExpression":
+ case "OptionalMemberExpression":
+ if (parent.property === node) {
+ return !!parent.computed;
+ }
+
+ return parent.object === node;
+
+ case "VariableDeclarator":
+ return parent.init === node;
+
+ case "ArrowFunctionExpression":
+ return parent.body === node;
+
+ case "ExportSpecifier":
+ if (parent.source) {
+ return false;
+ }
+
+ return parent.local === node;
+
+ case "PrivateName":
+ return false;
+
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ case "ObjectMethod":
+ if (parent.params.includes(node)) {
+ return false;
+ }
+
+ case "ObjectProperty":
+ case "ClassProperty":
+ case "ClassPrivateProperty":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ if (parent.value === node) {
+ return !grandparent || grandparent.type !== "ObjectPattern";
+ }
+
+ return true;
+
+ case "ClassDeclaration":
+ case "ClassExpression":
+ return parent.superClass === node;
+
+ case "AssignmentExpression":
+ return parent.right === node;
+
+ case "AssignmentPattern":
+ return parent.right === node;
+
+ case "LabeledStatement":
+ return false;
+
+ case "CatchClause":
+ return false;
+
+ case "RestElement":
+ return false;
+
+ case "BreakStatement":
+ case "ContinueStatement":
+ return false;
+
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ return false;
+
+ case "ExportNamespaceSpecifier":
+ case "ExportDefaultSpecifier":
+ return false;
+
+ case "ImportDefaultSpecifier":
+ case "ImportNamespaceSpecifier":
+ case "ImportSpecifier":
+ return false;
+
+ case "JSXAttribute":
+ return false;
+
+ case "ObjectPattern":
+ case "ArrayPattern":
+ return false;
+
+ case "MetaProperty":
+ return false;
+
+ case "ObjectTypeProperty":
+ return parent.key !== node;
+
+ case "TSEnumMember":
+ return parent.id !== node;
+
+ case "TSPropertySignature":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return true;
+ }
+
+ return true;
+ }
+
+ var isScope$1 = {};
+
+ Object.defineProperty(isScope$1, "__esModule", {
+ value: true
+ });
+ isScope$1.default = isScope;
+
+ var _generated$2 = generated$3;
+
+ function isScope(node, parent) {
+ if ((0, _generated$2.isBlockStatement)(node) && (0, _generated$2.isFunction)(parent, {
+ body: node
+ })) {
+ return false;
+ }
+
+ if ((0, _generated$2.isBlockStatement)(node) && (0, _generated$2.isCatchClause)(parent, {
+ body: node
+ })) {
+ return false;
+ }
+
+ if ((0, _generated$2.isPattern)(node) && (0, _generated$2.isFunction)(parent)) {
+ return true;
+ }
+
+ return (0, _generated$2.isScopable)(node);
+ }
+
+ var isSpecifierDefault$1 = {};
+
+ Object.defineProperty(isSpecifierDefault$1, "__esModule", {
+ value: true
+ });
+ isSpecifierDefault$1.default = isSpecifierDefault;
+
+ var _generated$1 = generated$3;
+
+ function isSpecifierDefault(specifier) {
+ return (0, _generated$1.isImportDefaultSpecifier)(specifier) || (0, _generated$1.isIdentifier)(specifier.imported || specifier.exported, {
+ name: "default"
+ });
+ }
+
+ var isValidES3Identifier$1 = {};
+
+ Object.defineProperty(isValidES3Identifier$1, "__esModule", {
+ value: true
+ });
+ isValidES3Identifier$1.default = isValidES3Identifier;
+
+ var _isValidIdentifier = _interopRequireDefault$1(isValidIdentifier$1);
+
+ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
+
+ function isValidES3Identifier(name) {
+ return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
+ }
+
+ var isVar$1 = {};
+
+ Object.defineProperty(isVar$1, "__esModule", {
+ value: true
+ });
+ isVar$1.default = isVar;
+
+ var _generated = generated$3;
+
+ var _constants = constants;
+
+ function isVar(node) {
+ return (0, _generated.isVariableDeclaration)(node, {
+ kind: "var"
+ }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
+ }
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ var _exportNames = {
+ react: true,
+ assertNode: true,
+ createTypeAnnotationBasedOnTypeof: true,
+ createUnionTypeAnnotation: true,
+ createFlowUnionType: true,
+ createTSUnionType: true,
+ cloneNode: true,
+ clone: true,
+ cloneDeep: true,
+ cloneDeepWithoutLoc: true,
+ cloneWithoutLoc: true,
+ addComment: true,
+ addComments: true,
+ inheritInnerComments: true,
+ inheritLeadingComments: true,
+ inheritsComments: true,
+ inheritTrailingComments: true,
+ removeComments: true,
+ ensureBlock: true,
+ toBindingIdentifierName: true,
+ toBlock: true,
+ toComputedKey: true,
+ toExpression: true,
+ toIdentifier: true,
+ toKeyAlias: true,
+ toSequenceExpression: true,
+ toStatement: true,
+ valueToNode: true,
+ appendToMemberExpression: true,
+ inherits: true,
+ prependToMemberExpression: true,
+ removeProperties: true,
+ removePropertiesDeep: true,
+ removeTypeDuplicates: true,
+ getBindingIdentifiers: true,
+ getOuterBindingIdentifiers: true,
+ traverse: true,
+ traverseFast: true,
+ shallowEqual: true,
+ is: true,
+ isBinding: true,
+ isBlockScoped: true,
+ isImmutable: true,
+ isLet: true,
+ isNode: true,
+ isNodesEquivalent: true,
+ isPlaceholderType: true,
+ isReferenced: true,
+ isScope: true,
+ isSpecifierDefault: true,
+ isType: true,
+ isValidES3Identifier: true,
+ isValidIdentifier: true,
+ isVar: true,
+ matchesPattern: true,
+ validate: true,
+ buildMatchMemberExpression: true
+ };
+ Object.defineProperty(exports, "assertNode", {
+ enumerable: true,
+ get: function () {
+ return _assertNode.default;
+ }
+ });
+ Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
+ enumerable: true,
+ get: function () {
+ return _createTypeAnnotationBasedOnTypeof.default;
+ }
+ });
+ Object.defineProperty(exports, "createUnionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+ });
+ Object.defineProperty(exports, "createFlowUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+ });
+ Object.defineProperty(exports, "createTSUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createTSUnionType.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneNode", {
+ enumerable: true,
+ get: function () {
+ return _cloneNode.default;
+ }
+ });
+ Object.defineProperty(exports, "clone", {
+ enumerable: true,
+ get: function () {
+ return _clone.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneDeep", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeep.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneDeepWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeepWithoutLoc.default;
+ }
+ });
+ Object.defineProperty(exports, "cloneWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneWithoutLoc.default;
+ }
+ });
+ Object.defineProperty(exports, "addComment", {
+ enumerable: true,
+ get: function () {
+ return _addComment.default;
+ }
+ });
+ Object.defineProperty(exports, "addComments", {
+ enumerable: true,
+ get: function () {
+ return _addComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritInnerComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritInnerComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritLeadingComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritLeadingComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritsComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritsComments.default;
+ }
+ });
+ Object.defineProperty(exports, "inheritTrailingComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritTrailingComments.default;
+ }
+ });
+ Object.defineProperty(exports, "removeComments", {
+ enumerable: true,
+ get: function () {
+ return _removeComments.default;
+ }
+ });
+ Object.defineProperty(exports, "ensureBlock", {
+ enumerable: true,
+ get: function () {
+ return _ensureBlock.default;
+ }
+ });
+ Object.defineProperty(exports, "toBindingIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _toBindingIdentifierName.default;
+ }
+ });
+ Object.defineProperty(exports, "toBlock", {
+ enumerable: true,
+ get: function () {
+ return _toBlock.default;
+ }
+ });
+ Object.defineProperty(exports, "toComputedKey", {
+ enumerable: true,
+ get: function () {
+ return _toComputedKey.default;
+ }
+ });
+ Object.defineProperty(exports, "toExpression", {
+ enumerable: true,
+ get: function () {
+ return _toExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "toIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _toIdentifier.default;
+ }
+ });
+ Object.defineProperty(exports, "toKeyAlias", {
+ enumerable: true,
+ get: function () {
+ return _toKeyAlias.default;
+ }
+ });
+ Object.defineProperty(exports, "toSequenceExpression", {
+ enumerable: true,
+ get: function () {
+ return _toSequenceExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "toStatement", {
+ enumerable: true,
+ get: function () {
+ return _toStatement.default;
+ }
+ });
+ Object.defineProperty(exports, "valueToNode", {
+ enumerable: true,
+ get: function () {
+ return _valueToNode.default;
+ }
+ });
+ Object.defineProperty(exports, "appendToMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _appendToMemberExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "inherits", {
+ enumerable: true,
+ get: function () {
+ return _inherits.default;
+ }
+ });
+ Object.defineProperty(exports, "prependToMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _prependToMemberExpression.default;
+ }
+ });
+ Object.defineProperty(exports, "removeProperties", {
+ enumerable: true,
+ get: function () {
+ return _removeProperties.default;
+ }
+ });
+ Object.defineProperty(exports, "removePropertiesDeep", {
+ enumerable: true,
+ get: function () {
+ return _removePropertiesDeep.default;
+ }
+ });
+ Object.defineProperty(exports, "removeTypeDuplicates", {
+ enumerable: true,
+ get: function () {
+ return _removeTypeDuplicates.default;
+ }
+ });
+ Object.defineProperty(exports, "getBindingIdentifiers", {
+ enumerable: true,
+ get: function () {
+ return _getBindingIdentifiers.default;
+ }
+ });
+ Object.defineProperty(exports, "getOuterBindingIdentifiers", {
+ enumerable: true,
+ get: function () {
+ return _getOuterBindingIdentifiers.default;
+ }
+ });
+ Object.defineProperty(exports, "traverse", {
+ enumerable: true,
+ get: function () {
+ return _traverse.default;
+ }
+ });
+ Object.defineProperty(exports, "traverseFast", {
+ enumerable: true,
+ get: function () {
+ return _traverseFast.default;
+ }
+ });
+ Object.defineProperty(exports, "shallowEqual", {
+ enumerable: true,
+ get: function () {
+ return _shallowEqual.default;
+ }
+ });
+ Object.defineProperty(exports, "is", {
+ enumerable: true,
+ get: function () {
+ return _is.default;
+ }
+ });
+ Object.defineProperty(exports, "isBinding", {
+ enumerable: true,
+ get: function () {
+ return _isBinding.default;
+ }
+ });
+ Object.defineProperty(exports, "isBlockScoped", {
+ enumerable: true,
+ get: function () {
+ return _isBlockScoped.default;
+ }
+ });
+ Object.defineProperty(exports, "isImmutable", {
+ enumerable: true,
+ get: function () {
+ return _isImmutable.default;
+ }
+ });
+ Object.defineProperty(exports, "isLet", {
+ enumerable: true,
+ get: function () {
+ return _isLet.default;
+ }
+ });
+ Object.defineProperty(exports, "isNode", {
+ enumerable: true,
+ get: function () {
+ return _isNode.default;
+ }
+ });
+ Object.defineProperty(exports, "isNodesEquivalent", {
+ enumerable: true,
+ get: function () {
+ return _isNodesEquivalent.default;
+ }
+ });
+ Object.defineProperty(exports, "isPlaceholderType", {
+ enumerable: true,
+ get: function () {
+ return _isPlaceholderType.default;
+ }
+ });
+ Object.defineProperty(exports, "isReferenced", {
+ enumerable: true,
+ get: function () {
+ return _isReferenced.default;
+ }
+ });
+ Object.defineProperty(exports, "isScope", {
+ enumerable: true,
+ get: function () {
+ return _isScope.default;
+ }
+ });
+ Object.defineProperty(exports, "isSpecifierDefault", {
+ enumerable: true,
+ get: function () {
+ return _isSpecifierDefault.default;
+ }
+ });
+ Object.defineProperty(exports, "isType", {
+ enumerable: true,
+ get: function () {
+ return _isType.default;
+ }
+ });
+ Object.defineProperty(exports, "isValidES3Identifier", {
+ enumerable: true,
+ get: function () {
+ return _isValidES3Identifier.default;
+ }
+ });
+ Object.defineProperty(exports, "isValidIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _isValidIdentifier.default;
+ }
+ });
+ Object.defineProperty(exports, "isVar", {
+ enumerable: true,
+ get: function () {
+ return _isVar.default;
+ }
+ });
+ Object.defineProperty(exports, "matchesPattern", {
+ enumerable: true,
+ get: function () {
+ return _matchesPattern.default;
+ }
+ });
+ Object.defineProperty(exports, "validate", {
+ enumerable: true,
+ get: function () {
+ return _validate.default;
+ }
+ });
+ Object.defineProperty(exports, "buildMatchMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _buildMatchMemberExpression.default;
+ }
+ });
+ exports.react = void 0;
+
+ var _isReactComponent = _interopRequireDefault(isReactComponent$2);
+
+ var _isCompatTag = _interopRequireDefault(isCompatTag$1);
+
+ var _buildChildren = _interopRequireDefault(buildChildren$1);
+
+ var _assertNode = _interopRequireDefault(assertNode$1);
+
+ var _generated = generated$1;
+
+ Object.keys(_generated).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated[key];
+ }
+ });
+ });
+
+ var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(createTypeAnnotationBasedOnTypeof$1);
+
+ var _createFlowUnionType = _interopRequireDefault(createFlowUnionType$1);
+
+ var _createTSUnionType = _interopRequireDefault(createTSUnionType$1);
+
+ var _generated2 = generated$2;
+
+ Object.keys(_generated2).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated2[key];
+ }
+ });
+ });
+
+ var _cloneNode = _interopRequireDefault(cloneNode$1);
+
+ var _clone = _interopRequireDefault(clone$1);
+
+ var _cloneDeep = _interopRequireDefault(cloneDeep$1);
+
+ var _cloneDeepWithoutLoc = _interopRequireDefault(cloneDeepWithoutLoc$1);
+
+ var _cloneWithoutLoc = _interopRequireDefault(cloneWithoutLoc$1);
+
+ var _addComment = _interopRequireDefault(addComment$1);
+
+ var _addComments = _interopRequireDefault(addComments$1);
+
+ var _inheritInnerComments = _interopRequireDefault(inheritInnerComments$1);
+
+ var _inheritLeadingComments = _interopRequireDefault(inheritLeadingComments$1);
+
+ var _inheritsComments = _interopRequireDefault(inheritsComments$1);
+
+ var _inheritTrailingComments = _interopRequireDefault(inheritTrailingComments$1);
+
+ var _removeComments = _interopRequireDefault(removeComments$1);
+
+ var _generated3 = generated;
+
+ Object.keys(_generated3).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated3[key];
+ }
+ });
+ });
+
+ var _constants = constants;
+
+ Object.keys(_constants).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _constants[key];
+ }
+ });
+ });
+
+ var _ensureBlock = _interopRequireDefault(ensureBlock$1);
+
+ var _toBindingIdentifierName = _interopRequireDefault(toBindingIdentifierName$1);
+
+ var _toBlock = _interopRequireDefault(toBlock$1);
+
+ var _toComputedKey = _interopRequireDefault(toComputedKey$1);
+
+ var _toExpression = _interopRequireDefault(toExpression$1);
+
+ var _toIdentifier = _interopRequireDefault(toIdentifier$1);
+
+ var _toKeyAlias = _interopRequireDefault(toKeyAlias$1);
+
+ var _toSequenceExpression = _interopRequireDefault(toSequenceExpression$1);
+
+ var _toStatement = _interopRequireDefault(toStatement$1);
+
+ var _valueToNode = _interopRequireDefault(valueToNode$1);
+
+ var _definitions = requireDefinitions();
+
+ Object.keys(_definitions).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _definitions[key];
+ }
+ });
+ });
+
+ var _appendToMemberExpression = _interopRequireDefault(appendToMemberExpression$1);
+
+ var _inherits = _interopRequireDefault(inherits$1);
+
+ var _prependToMemberExpression = _interopRequireDefault(prependToMemberExpression$1);
+
+ var _removeProperties = _interopRequireDefault(removeProperties$1);
+
+ var _removePropertiesDeep = _interopRequireDefault(removePropertiesDeep$1);
+
+ var _removeTypeDuplicates = _interopRequireDefault(removeTypeDuplicates$3);
+
+ var _getBindingIdentifiers = _interopRequireDefault(getBindingIdentifiers$1);
+
+ var _getOuterBindingIdentifiers = _interopRequireDefault(getOuterBindingIdentifiers$1);
+
+ var _traverse = _interopRequireDefault(traverse$1);
+
+ var _traverseFast = _interopRequireDefault(traverseFast$1);
+
+ var _shallowEqual = _interopRequireDefault(shallowEqual$1);
+
+ var _is = _interopRequireDefault(requireIs());
+
+ var _isBinding = _interopRequireDefault(isBinding$1);
+
+ var _isBlockScoped = _interopRequireDefault(isBlockScoped$1);
+
+ var _isImmutable = _interopRequireDefault(isImmutable$1);
+
+ var _isLet = _interopRequireDefault(isLet$1);
+
+ var _isNode = _interopRequireDefault(isNode$2);
+
+ var _isNodesEquivalent = _interopRequireDefault(isNodesEquivalent$1);
+
+ var _isPlaceholderType = _interopRequireDefault(requireIsPlaceholderType());
+
+ var _isReferenced = _interopRequireDefault(isReferenced$1);
+
+ var _isScope = _interopRequireDefault(isScope$1);
+
+ var _isSpecifierDefault = _interopRequireDefault(isSpecifierDefault$1);
+
+ var _isType = _interopRequireDefault(requireIsType());
+
+ var _isValidES3Identifier = _interopRequireDefault(isValidES3Identifier$1);
+
+ var _isValidIdentifier = _interopRequireDefault(isValidIdentifier$1);
+
+ var _isVar = _interopRequireDefault(isVar$1);
+
+ var _matchesPattern = _interopRequireDefault(matchesPattern$1);
+
+ var _validate = _interopRequireDefault(requireValidate());
+
+ var _buildMatchMemberExpression = _interopRequireDefault(buildMatchMemberExpression$1);
+
+ var _generated4 = generated$3;
+
+ Object.keys(_generated4).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated4[key];
+ }
+ });
+ });
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ const react = {
+ isReactComponent: _isReactComponent.default,
+ isCompatTag: _isCompatTag.default,
+ buildChildren: _buildChildren.default
+ };
+ exports.react = react;
+ } (lib$4));
+
+ var lib$2 = {};
+
+ Object.defineProperty(lib$2, '__esModule', { value: true });
+
+ const beforeExpr$1 = true;
+ const startsExpr$1 = true;
+ const isLoop$1 = true;
+ const isAssign$1 = true;
+ const prefix$1 = true;
+ const postfix$1 = true;
+ class TokenType {
+ constructor(label, conf = {}) {
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.rightAssociative = !!conf.rightAssociative;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop != null ? conf.binop : null;
+ this.updateContext = null;
+ }
+
+ }
+ const keywords$2 = new Map();
+
+ function createKeyword$1(name, options = {}) {
+ options.keyword = name;
+ const token = new TokenType(name, options);
+ keywords$2.set(name, token);
+ return token;
+ }
+
+ function createBinop$1(name, binop) {
+ return new TokenType(name, {
+ beforeExpr: beforeExpr$1,
+ binop
+ });
+ }
+
+ const types$4 = {
+ num: new TokenType("num", {
+ startsExpr: startsExpr$1
+ }),
+ bigint: new TokenType("bigint", {
+ startsExpr: startsExpr$1
+ }),
+ regexp: new TokenType("regexp", {
+ startsExpr: startsExpr$1
+ }),
+ string: new TokenType("string", {
+ startsExpr: startsExpr$1
+ }),
+ name: new TokenType("name", {
+ startsExpr: startsExpr$1
+ }),
+ eof: new TokenType("eof"),
+ bracketL: new TokenType("[", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ bracketHashL: new TokenType("#[", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ bracketBarL: new TokenType("[|", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ bracketR: new TokenType("]"),
+ bracketBarR: new TokenType("|]"),
+ braceL: new TokenType("{", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ braceBarL: new TokenType("{|", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ braceHashL: new TokenType("#{", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ braceR: new TokenType("}"),
+ braceBarR: new TokenType("|}"),
+ parenL: new TokenType("(", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ parenR: new TokenType(")"),
+ comma: new TokenType(",", {
+ beforeExpr: beforeExpr$1
+ }),
+ semi: new TokenType(";", {
+ beforeExpr: beforeExpr$1
+ }),
+ colon: new TokenType(":", {
+ beforeExpr: beforeExpr$1
+ }),
+ doubleColon: new TokenType("::", {
+ beforeExpr: beforeExpr$1
+ }),
+ dot: new TokenType("."),
+ question: new TokenType("?", {
+ beforeExpr: beforeExpr$1
+ }),
+ questionDot: new TokenType("?."),
+ arrow: new TokenType("=>", {
+ beforeExpr: beforeExpr$1
+ }),
+ template: new TokenType("template"),
+ ellipsis: new TokenType("...", {
+ beforeExpr: beforeExpr$1
+ }),
+ backQuote: new TokenType("`", {
+ startsExpr: startsExpr$1
+ }),
+ dollarBraceL: new TokenType("${", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ at: new TokenType("@"),
+ hash: new TokenType("#", {
+ startsExpr: startsExpr$1
+ }),
+ interpreterDirective: new TokenType("#!..."),
+ eq: new TokenType("=", {
+ beforeExpr: beforeExpr$1,
+ isAssign: isAssign$1
+ }),
+ assign: new TokenType("_=", {
+ beforeExpr: beforeExpr$1,
+ isAssign: isAssign$1
+ }),
+ incDec: new TokenType("++/--", {
+ prefix: prefix$1,
+ postfix: postfix$1,
+ startsExpr: startsExpr$1
+ }),
+ bang: new TokenType("!", {
+ beforeExpr: beforeExpr$1,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ }),
+ tilde: new TokenType("~", {
+ beforeExpr: beforeExpr$1,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ }),
+ pipeline: createBinop$1("|>", 0),
+ nullishCoalescing: createBinop$1("??", 1),
+ logicalOR: createBinop$1("||", 1),
+ logicalAND: createBinop$1("&&", 2),
+ bitwiseOR: createBinop$1("|", 3),
+ bitwiseXOR: createBinop$1("^", 4),
+ bitwiseAND: createBinop$1("&", 5),
+ equality: createBinop$1("==/!=/===/!==", 6),
+ relational: createBinop$1("</>/<=/>=", 7),
+ bitShift: createBinop$1("<</>>/>>>", 8),
+ plusMin: new TokenType("+/-", {
+ beforeExpr: beforeExpr$1,
+ binop: 9,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ }),
+ modulo: new TokenType("%", {
+ beforeExpr: beforeExpr$1,
+ binop: 10,
+ startsExpr: startsExpr$1
+ }),
+ star: createBinop$1("*", 10),
+ slash: createBinop$1("/", 10),
+ exponent: new TokenType("**", {
+ beforeExpr: beforeExpr$1,
+ binop: 11,
+ rightAssociative: true
+ }),
+ _break: createKeyword$1("break"),
+ _case: createKeyword$1("case", {
+ beforeExpr: beforeExpr$1
+ }),
+ _catch: createKeyword$1("catch"),
+ _continue: createKeyword$1("continue"),
+ _debugger: createKeyword$1("debugger"),
+ _default: createKeyword$1("default", {
+ beforeExpr: beforeExpr$1
+ }),
+ _do: createKeyword$1("do", {
+ isLoop: isLoop$1,
+ beforeExpr: beforeExpr$1
+ }),
+ _else: createKeyword$1("else", {
+ beforeExpr: beforeExpr$1
+ }),
+ _finally: createKeyword$1("finally"),
+ _for: createKeyword$1("for", {
+ isLoop: isLoop$1
+ }),
+ _function: createKeyword$1("function", {
+ startsExpr: startsExpr$1
+ }),
+ _if: createKeyword$1("if"),
+ _return: createKeyword$1("return", {
+ beforeExpr: beforeExpr$1
+ }),
+ _switch: createKeyword$1("switch"),
+ _throw: createKeyword$1("throw", {
+ beforeExpr: beforeExpr$1,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ }),
+ _try: createKeyword$1("try"),
+ _var: createKeyword$1("var"),
+ _const: createKeyword$1("const"),
+ _while: createKeyword$1("while", {
+ isLoop: isLoop$1
+ }),
+ _with: createKeyword$1("with"),
+ _new: createKeyword$1("new", {
+ beforeExpr: beforeExpr$1,
+ startsExpr: startsExpr$1
+ }),
+ _this: createKeyword$1("this", {
+ startsExpr: startsExpr$1
+ }),
+ _super: createKeyword$1("super", {
+ startsExpr: startsExpr$1
+ }),
+ _class: createKeyword$1("class", {
+ startsExpr: startsExpr$1
+ }),
+ _extends: createKeyword$1("extends", {
+ beforeExpr: beforeExpr$1
+ }),
+ _export: createKeyword$1("export"),
+ _import: createKeyword$1("import", {
+ startsExpr: startsExpr$1
+ }),
+ _null: createKeyword$1("null", {
+ startsExpr: startsExpr$1
+ }),
+ _true: createKeyword$1("true", {
+ startsExpr: startsExpr$1
+ }),
+ _false: createKeyword$1("false", {
+ startsExpr: startsExpr$1
+ }),
+ _in: createKeyword$1("in", {
+ beforeExpr: beforeExpr$1,
+ binop: 7
+ }),
+ _instanceof: createKeyword$1("instanceof", {
+ beforeExpr: beforeExpr$1,
+ binop: 7
+ }),
+ _typeof: createKeyword$1("typeof", {
+ beforeExpr: beforeExpr$1,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ }),
+ _void: createKeyword$1("void", {
+ beforeExpr: beforeExpr$1,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ }),
+ _delete: createKeyword$1("delete", {
+ beforeExpr: beforeExpr$1,
+ prefix: prefix$1,
+ startsExpr: startsExpr$1
+ })
+ };
+
+ const SCOPE_OTHER$1 = 0b00000000,
+ SCOPE_PROGRAM$1 = 0b00000001,
+ SCOPE_FUNCTION$1 = 0b00000010,
+ SCOPE_ARROW$1 = 0b00000100,
+ SCOPE_SIMPLE_CATCH$1 = 0b00001000,
+ SCOPE_SUPER$1 = 0b00010000,
+ SCOPE_DIRECT_SUPER$1 = 0b00100000,
+ SCOPE_CLASS$1 = 0b01000000,
+ SCOPE_TS_MODULE$1 = 0b10000000,
+ SCOPE_VAR$1 = SCOPE_PROGRAM$1 | SCOPE_FUNCTION$1 | SCOPE_TS_MODULE$1;
+ const BIND_KIND_VALUE$1 = 0b00000000001,
+ BIND_KIND_TYPE$1 = 0b00000000010,
+ BIND_SCOPE_VAR$1 = 0b00000000100,
+ BIND_SCOPE_LEXICAL$1 = 0b00000001000,
+ BIND_SCOPE_FUNCTION$1 = 0b00000010000,
+ BIND_FLAGS_NONE$1 = 0b00001000000,
+ BIND_FLAGS_CLASS$1 = 0b00010000000,
+ BIND_FLAGS_TS_ENUM$1 = 0b00100000000,
+ BIND_FLAGS_TS_CONST_ENUM$1 = 0b01000000000,
+ BIND_FLAGS_TS_EXPORT_ONLY$1 = 0b10000000000;
+ const BIND_CLASS$1 = BIND_KIND_VALUE$1 | BIND_KIND_TYPE$1 | BIND_SCOPE_LEXICAL$1 | BIND_FLAGS_CLASS$1,
+ BIND_LEXICAL$1 = BIND_KIND_VALUE$1 | 0 | BIND_SCOPE_LEXICAL$1 | 0,
+ BIND_VAR$1 = BIND_KIND_VALUE$1 | 0 | BIND_SCOPE_VAR$1 | 0,
+ BIND_FUNCTION$1 = BIND_KIND_VALUE$1 | 0 | BIND_SCOPE_FUNCTION$1 | 0,
+ BIND_TS_INTERFACE$1 = 0 | BIND_KIND_TYPE$1 | 0 | BIND_FLAGS_CLASS$1,
+ BIND_TS_TYPE$1 = 0 | BIND_KIND_TYPE$1 | 0 | 0,
+ BIND_TS_ENUM$1 = BIND_KIND_VALUE$1 | BIND_KIND_TYPE$1 | BIND_SCOPE_LEXICAL$1 | BIND_FLAGS_TS_ENUM$1,
+ BIND_TS_AMBIENT$1 = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY$1,
+ BIND_NONE$1 = 0 | 0 | 0 | BIND_FLAGS_NONE$1,
+ BIND_OUTSIDE$1 = BIND_KIND_VALUE$1 | 0 | 0 | BIND_FLAGS_NONE$1,
+ BIND_TS_CONST_ENUM$1 = BIND_TS_ENUM$1 | BIND_FLAGS_TS_CONST_ENUM$1,
+ BIND_TS_NAMESPACE$1 = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY$1;
+ const CLASS_ELEMENT_FLAG_STATIC$1 = 0b100,
+ CLASS_ELEMENT_KIND_GETTER$1 = 0b010,
+ CLASS_ELEMENT_KIND_SETTER$1 = 0b001,
+ CLASS_ELEMENT_KIND_ACCESSOR$1 = CLASS_ELEMENT_KIND_GETTER$1 | CLASS_ELEMENT_KIND_SETTER$1;
+ const CLASS_ELEMENT_STATIC_GETTER$1 = CLASS_ELEMENT_KIND_GETTER$1 | CLASS_ELEMENT_FLAG_STATIC$1,
+ CLASS_ELEMENT_STATIC_SETTER$1 = CLASS_ELEMENT_KIND_SETTER$1 | CLASS_ELEMENT_FLAG_STATIC$1,
+ CLASS_ELEMENT_INSTANCE_GETTER$1 = CLASS_ELEMENT_KIND_GETTER$1,
+ CLASS_ELEMENT_INSTANCE_SETTER$1 = CLASS_ELEMENT_KIND_SETTER$1,
+ CLASS_ELEMENT_OTHER$1 = 0;
+
+ const lineBreak$1 = /\r\n?|[\n\u2028\u2029]/;
+ const lineBreakG$1 = new RegExp(lineBreak$1.source, "g");
+ function isNewLine$1(code) {
+ switch (code) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+ const skipWhiteSpace$1 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+ function isWhitespace$1(code) {
+ switch (code) {
+ case 0x0009:
+ case 0x000b:
+ case 0x000c:
+ case 32:
+ case 160:
+ case 5760:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200a:
+ case 0x202f:
+ case 0x205f:
+ case 0x3000:
+ case 0xfeff:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ let Position$1 = class Position {
+ constructor(line, col) {
+ this.line = line;
+ this.column = col;
+ }
+
+ };
+ let SourceLocation$1 = class SourceLocation {
+ constructor(start, end) {
+ this.start = start;
+ this.end = end;
+ }
+
+ };
+ function getLineInfo$1(input, offset) {
+ let line = 1;
+ let lineStart = 0;
+ let match;
+ lineBreakG$1.lastIndex = 0;
+
+ while ((match = lineBreakG$1.exec(input)) && match.index < offset) {
+ line++;
+ lineStart = lineBreakG$1.lastIndex;
+ }
+
+ return new Position$1(line, offset - lineStart);
+ }
+
+ let BaseParser$1 = class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+
+ hasPlugin(name) {
+ return this.plugins.has(name);
+ }
+
+ getPluginOption(plugin, name) {
+ if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];
+ }
+
+ };
+
+ function last(stack) {
+ return stack[stack.length - 1];
+ }
+
+ let CommentsParser$1 = class CommentsParser extends BaseParser$1 {
+ addComment(comment) {
+ if (this.filename) comment.loc.filename = this.filename;
+ this.state.trailingComments.push(comment);
+ this.state.leadingComments.push(comment);
+ }
+
+ adjustCommentsAfterTrailingComma(node, elements, takeAllComments) {
+ if (this.state.leadingComments.length === 0) {
+ return;
+ }
+
+ let lastElement = null;
+ let i = elements.length;
+
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+
+ if (lastElement === null) {
+ return;
+ }
+
+ for (let j = 0; j < this.state.leadingComments.length; j++) {
+ if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
+ this.state.leadingComments.splice(j, 1);
+ j--;
+ }
+ }
+
+ const newTrailingComments = [];
+
+ for (let i = 0; i < this.state.leadingComments.length; i++) {
+ const leadingComment = this.state.leadingComments[i];
+
+ if (leadingComment.end < node.end) {
+ newTrailingComments.push(leadingComment);
+
+ if (!takeAllComments) {
+ this.state.leadingComments.splice(i, 1);
+ i--;
+ }
+ } else {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = [];
+ }
+
+ node.trailingComments.push(leadingComment);
+ }
+ }
+
+ if (takeAllComments) this.state.leadingComments = [];
+
+ if (newTrailingComments.length > 0) {
+ lastElement.trailingComments = newTrailingComments;
+ } else if (lastElement.trailingComments !== undefined) {
+ lastElement.trailingComments = [];
+ }
+ }
+
+ processComment(node) {
+ if (node.type === "Program" && node.body.length > 0) return;
+ const stack = this.state.commentStack;
+ let firstChild, lastChild, trailingComments, i, j;
+
+ if (this.state.trailingComments.length > 0) {
+ if (this.state.trailingComments[0].start >= node.end) {
+ trailingComments = this.state.trailingComments;
+ this.state.trailingComments = [];
+ } else {
+ this.state.trailingComments.length = 0;
+ }
+ } else if (stack.length > 0) {
+ const lastInStack = last(stack);
+
+ if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
+ trailingComments = lastInStack.trailingComments;
+ delete lastInStack.trailingComments;
+ }
+ }
+
+ if (stack.length > 0 && last(stack).start >= node.start) {
+ firstChild = stack.pop();
+ }
+
+ while (stack.length > 0 && last(stack).start >= node.start) {
+ lastChild = stack.pop();
+ }
+
+ if (!lastChild && firstChild) lastChild = firstChild;
+
+ if (firstChild) {
+ switch (node.type) {
+ case "ObjectExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.properties);
+ break;
+
+ case "ObjectPattern":
+ this.adjustCommentsAfterTrailingComma(node, node.properties, true);
+ break;
+
+ case "CallExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.arguments);
+ break;
+
+ case "ArrayExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.elements);
+ break;
+
+ case "ArrayPattern":
+ this.adjustCommentsAfterTrailingComma(node, node.elements, true);
+ break;
+ }
+ } else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === "ImportSpecifier" && node.type !== "ImportSpecifier" || this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) {
+ this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]);
+ }
+
+ if (lastChild) {
+ if (lastChild.leadingComments) {
+ if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) {
+ node.leadingComments = lastChild.leadingComments;
+ delete lastChild.leadingComments;
+ } else {
+ for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
+ if (lastChild.leadingComments[i].end <= node.start) {
+ node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
+ break;
+ }
+ }
+ }
+ }
+ } else if (this.state.leadingComments.length > 0) {
+ if (last(this.state.leadingComments).end <= node.start) {
+ if (this.state.commentPreviousNode) {
+ for (j = 0; j < this.state.leadingComments.length; j++) {
+ if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
+ this.state.leadingComments.splice(j, 1);
+ j--;
+ }
+ }
+ }
+
+ if (this.state.leadingComments.length > 0) {
+ node.leadingComments = this.state.leadingComments;
+ this.state.leadingComments = [];
+ }
+ } else {
+ for (i = 0; i < this.state.leadingComments.length; i++) {
+ if (this.state.leadingComments[i].end > node.start) {
+ break;
+ }
+ }
+
+ const leadingComments = this.state.leadingComments.slice(0, i);
+
+ if (leadingComments.length) {
+ node.leadingComments = leadingComments;
+ }
+
+ trailingComments = this.state.leadingComments.slice(i);
+
+ if (trailingComments.length === 0) {
+ trailingComments = null;
+ }
+ }
+ }
+
+ this.state.commentPreviousNode = node;
+
+ if (trailingComments) {
+ if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
+ node.innerComments = trailingComments;
+ } else {
+ const firstTrailingCommentIndex = trailingComments.findIndex(comment => comment.end >= node.end);
+
+ if (firstTrailingCommentIndex > 0) {
+ node.innerComments = trailingComments.slice(0, firstTrailingCommentIndex);
+ node.trailingComments = trailingComments.slice(firstTrailingCommentIndex);
+ } else {
+ node.trailingComments = trailingComments;
+ }
+ }
+ }
+
+ stack.push(node);
+ }
+
+ };
+
+ const ErrorMessages$1 = Object.freeze({
+ ArgumentsDisallowedInInitializer: "'arguments' is not allowed in class field initializer",
+ AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block",
+ AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function",
+ AwaitExpressionFormalParameter: "await is not allowed in async function parameters",
+ AwaitNotInAsyncFunction: "Can not use keyword 'await' outside an async function",
+ BadGetterArity: "getter must not have any formal parameters",
+ BadSetterArity: "setter must have exactly one formal parameter",
+ BadSetterRestParameter: "setter function argument must not be a rest parameter",
+ ConstructorClassField: "Classes may not have a field named 'constructor'",
+ ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'",
+ ConstructorIsAccessor: "Class constructor may not be an accessor",
+ ConstructorIsAsync: "Constructor can't be an async function",
+ ConstructorIsGenerator: "Constructor can't be a generator",
+ DeclarationMissingInitializer: "%0 require an initialization value",
+ DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax",
+ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
+ DecoratorSemicolon: "Decorators must not be followed by a semicolon",
+ DeletePrivateField: "Deleting a private field is not allowed",
+ DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
+ DuplicateConstructor: "Duplicate constructor in the same class",
+ DuplicateDefaultExport: "Only one default export allowed per module.",
+ DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.",
+ DuplicateProto: "Redefinition of __proto__ property",
+ DuplicateRegExpFlags: "Duplicate regular expression flag",
+ ElementAfterRest: "Rest element must be last element",
+ EscapedCharNotAnIdentifier: "Invalid Unicode escape",
+ ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'",
+ ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer",
+ GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block",
+ IllegalBreakContinue: "Unsyntactic %0",
+ IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list",
+ IllegalReturn: "'return' outside of function",
+ ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments",
+ ImportCallArity: "import() requires exactly %0",
+ ImportCallNotNewExpression: "Cannot use new with import(...)",
+ ImportCallSpreadArgument: "... is not allowed in import()",
+ ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
+ ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`,
+ InvalidBigIntLiteral: "Invalid BigIntLiteral",
+ InvalidCodePoint: "Code point out of bounds",
+ InvalidDigit: "Expected number in radix %0",
+ InvalidEscapeSequence: "Bad character escape sequence",
+ InvalidEscapeSequenceTemplate: "Invalid escape sequence in template",
+ InvalidEscapedReservedWord: "Escape sequence in keyword %0",
+ InvalidIdentifier: "Invalid identifier %0",
+ InvalidLhs: "Invalid left-hand side in %0",
+ InvalidLhsBinding: "Binding invalid left-hand side in %0",
+ InvalidNumber: "Invalid number",
+ InvalidOrUnexpectedToken: "Unexpected character '%0'",
+ InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern",
+ InvalidPrivateFieldResolution: "Private name #%0 is not defined",
+ InvalidPropertyBindingPattern: "Binding member expression",
+ InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions",
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument",
+ LabelRedeclaration: "Label '%0' is already declared",
+ LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
+ MalformedRegExpFlags: "Invalid regular expression flag",
+ MissingClassName: "A class name is required",
+ MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
+ MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX",
+ MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators",
+ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`",
+ ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values",
+ ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes',
+ ModuleExportUndefined: "Export '%0' is not defined",
+ MultipleDefaultsInSwitch: "Multiple default clauses",
+ NewlineAfterThrow: "Illegal newline after throw",
+ NoCatchOrFinally: "Missing catch or finally clause",
+ NumberIdentifier: "Identifier directly after number",
+ NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences",
+ ObsoleteAwaitStar: "await* has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew: "constructors in/after an Optional Chain are not allowed",
+ OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain",
+ ParamDupe: "Argument name clash",
+ PatternHasAccessor: "Object pattern can't contain getter or setter",
+ PatternHasMethod: "Object pattern can't contain methods",
+ PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized',
+ PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression",
+ PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression",
+ PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference",
+ PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding",
+ PrimaryTopicRequiresSmartPipeline: "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.",
+ PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)",
+ PrivateNameRedeclaration: "Duplicate private name #%0",
+ RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions",
+ RestTrailingComma: "Unexpected trailing comma after rest element",
+ SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",
+ StaticPrototype: "Classes may not have static property named prototype",
+ StrictDelete: "Deleting local variable in strict mode",
+ StrictEvalArguments: "Assigning to '%0' in strict mode",
+ StrictEvalArgumentsBinding: "Binding '%0' in strict mode",
+ StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block",
+ StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode",
+ StrictWith: "'with' in strict mode",
+ SuperNotAllowed: "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
+ SuperPrivateField: "Private fields can't be accessed on super",
+ TrailingDecorator: "Decorators must be attached to a class element",
+ TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
+ UnexpectedArgumentPlaceholder: "Unexpected argument placeholder",
+ UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal',
+ UnexpectedDigitAfterHash: "Unexpected digit after hash token",
+ UnexpectedImportExport: "'import' and 'export' may only appear at the top level",
+ UnexpectedKeyword: "Unexpected keyword '%0'",
+ UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration",
+ UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context",
+ UnexpectedNewTarget: "new.target can only be used in functions",
+ UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits",
+ UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).",
+ UnexpectedReservedWord: "Unexpected reserved word '%0'",
+ UnexpectedSuper: "super is only allowed in object methods and classes",
+ UnexpectedToken: "Unexpected token '%0'",
+ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
+ UnsupportedBind: "Binding should be performed on object property.",
+ UnsupportedDecoratorExport: "A decorated export must export a class declaration",
+ UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
+ UnsupportedImport: "import can only be used in import() or import.meta",
+ UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1",
+ UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters",
+ UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties",
+ UnsupportedSuper: "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])",
+ UnterminatedComment: "Unterminated comment",
+ UnterminatedRegExp: "Unterminated regular expression",
+ UnterminatedString: "Unterminated string constant",
+ UnterminatedTemplate: "Unterminated template",
+ VarRedeclaration: "Identifier '%0' has already been declared",
+ YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator",
+ YieldInParameter: "yield is not allowed in generator parameters",
+ ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0"
+ });
+
+ let ParserError$1 = class ParserError extends CommentsParser$1 {
+ getLocationForPosition(pos) {
+ let loc;
+ if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo$1(this.input, pos);
+ return loc;
+ }
+
+ raise(pos, errorTemplate, ...params) {
+ return this.raiseWithData(pos, undefined, errorTemplate, ...params);
+ }
+
+ raiseWithData(pos, data, errorTemplate, ...params) {
+ const loc = this.getLocationForPosition(pos);
+ const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
+ return this._raise(Object.assign({
+ loc,
+ pos
+ }, data), message);
+ }
+
+ _raise(errorContext, message) {
+ const err = new SyntaxError(message);
+ Object.assign(err, errorContext);
+
+ if (this.options.errorRecovery) {
+ if (!this.isLookahead) this.state.errors.push(err);
+ return err;
+ } else {
+ throw err;
+ }
+ }
+
+ };
+
+ function isSimpleProperty(node) {
+ return node != null && node.type === "Property" && node.kind === "init" && node.method === false;
+ }
+
+ var estree$1 = (superClass => class extends superClass {
+ estreeParseRegExpLiteral({
+ pattern,
+ flags
+ }) {
+ let regex = null;
+
+ try {
+ regex = new RegExp(pattern, flags);
+ } catch (e) {}
+
+ const node = this.estreeParseLiteral(regex);
+ node.regex = {
+ pattern,
+ flags
+ };
+ return node;
+ }
+
+ estreeParseBigIntLiteral(value) {
+ const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null;
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ return node;
+ }
+
+ estreeParseLiteral(value) {
+ return this.parseLiteral(value, "Literal");
+ }
+
+ directiveToStmt(directive) {
+ const directiveLiteral = directive.value;
+ const stmt = this.startNodeAt(directive.start, directive.loc.start);
+ const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
+ expression.value = directiveLiteral.value;
+ expression.raw = directiveLiteral.extra.raw;
+ stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
+ stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
+ return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
+ }
+
+ initFunction(node, isAsync) {
+ super.initFunction(node, isAsync);
+ node.expression = false;
+ }
+
+ checkDeclaration(node) {
+ if (isSimpleProperty(node)) {
+ this.checkDeclaration(node.value);
+ } else {
+ super.checkDeclaration(node);
+ }
+ }
+
+ checkGetterSetterParams(method) {
+ const prop = method;
+ const paramCount = prop.kind === "get" ? 0 : 1;
+ const start = prop.start;
+
+ if (prop.value.params.length !== paramCount) {
+ if (method.kind === "get") {
+ this.raise(start, ErrorMessages$1.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages$1.BadSetterArity);
+ }
+ } else if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
+ this.raise(start, ErrorMessages$1.BadSetterRestParameter);
+ }
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE$1, checkClashes, contextDescription, disallowLetBinding) {
+ switch (expr.type) {
+ case "ObjectPattern":
+ expr.properties.forEach(prop => {
+ this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
+ });
+ break;
+
+ default:
+ super.checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding);
+ }
+ }
+
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.method) {
+ return;
+ }
+
+ super.checkProto(prop, isRecord, protoRef, refExpressionErrors);
+ }
+
+ isValidDirective(stmt) {
+ var _stmt$expression$extr;
+
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) == null ? void 0 : _stmt$expression$extr.parenthesized);
+ }
+
+ stmtToDirective(stmt) {
+ const directive = super.stmtToDirective(stmt);
+ const value = stmt.expression.value;
+ directive.value.value = value;
+ return directive;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end) {
+ super.parseBlockBody(node, allowDirectives, topLevel, end);
+ const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
+ node.body = directiveStatements.concat(node.body);
+ delete node.directives;
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
+
+ if (method.typeParameters) {
+ method.value.typeParameters = method.typeParameters;
+ delete method.typeParameters;
+ }
+
+ classBody.body.push(method);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ switch (this.state.type) {
+ case types$4.num:
+ case types$4.string:
+ return this.estreeParseLiteral(this.state.value);
+
+ case types$4.regexp:
+ return this.estreeParseRegExpLiteral(this.state.value);
+
+ case types$4.bigint:
+ return this.estreeParseBigIntLiteral(this.state.value);
+
+ case types$4._null:
+ return this.estreeParseLiteral(null);
+
+ case types$4._true:
+ return this.estreeParseLiteral(true);
+
+ case types$4._false:
+ return this.estreeParseLiteral(false);
+
+ default:
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ parseLiteral(value, type, startPos, startLoc) {
+ const node = super.parseLiteral(value, type, startPos, startLoc);
+ node.raw = node.extra.raw;
+ delete node.extra;
+ return node;
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ super.parseFunctionBody(node, allowExpression, isMethod);
+ node.expression = node.body.type !== "BlockStatement";
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ let funcNode = this.startNode();
+ funcNode.kind = node.kind;
+ funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ funcNode.type = "FunctionExpression";
+ delete funcNode.kind;
+ node.value = funcNode;
+ type = type === "ClassMethod" ? "MethodDefinition" : type;
+ return this.finishNode(node, type);
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
+ const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc);
+
+ if (node) {
+ node.type = "Property";
+ if (node.kind === "method") node.kind = "init";
+ node.shorthand = false;
+ }
+
+ return node;
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+
+ return node;
+ }
+
+ toAssignable(node) {
+ if (isSimpleProperty(node)) {
+ this.toAssignable(node.value);
+ return node;
+ }
+
+ return super.toAssignable(node);
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast) {
+ if (prop.kind === "get" || prop.kind === "set") {
+ throw this.raise(prop.key.start, ErrorMessages$1.PatternHasAccessor);
+ } else if (prop.method) {
+ throw this.raise(prop.key.start, ErrorMessages$1.PatternHasMethod);
+ } else {
+ super.toAssignableObjectExpressionProp(prop, isLast);
+ }
+ }
+
+ finishCallExpression(node, optional) {
+ super.finishCallExpression(node, optional);
+
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+ delete node.arguments;
+ delete node.callee;
+ } else if (node.type === "CallExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ if (!exprList) {
+ return;
+ }
+
+ super.toReferencedListDeep(exprList, isParenthesizedExpr);
+ }
+
+ parseExport(node) {
+ super.parseExport(node);
+
+ switch (node.type) {
+ case "ExportAllDeclaration":
+ node.exported = null;
+ break;
+
+ case "ExportNamedDeclaration":
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
+ node.type = "ExportAllDeclaration";
+ node.exported = node.specifiers[0].exported;
+ delete node.specifiers;
+ }
+
+ break;
+ }
+
+ return node;
+ }
+
+ parseSubscript(...args) {
+ const node = super.parseSubscript(...args);
+
+ if (node.type === "MemberExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+ });
+
+ let TokContext$1 = class TokContext {
+ constructor(token, isExpr, preserveSpace, override) {
+ this.token = token;
+ this.isExpr = !!isExpr;
+ this.preserveSpace = !!preserveSpace;
+ this.override = override;
+ }
+
+ };
+ const types$1$1 = {
+ braceStatement: new TokContext$1("{", false),
+ braceExpression: new TokContext$1("{", true),
+ templateQuasi: new TokContext$1("${", false),
+ parenStatement: new TokContext$1("(", false),
+ parenExpression: new TokContext$1("(", true),
+ template: new TokContext$1("`", true, true, p => p.readTmplToken()),
+ functionExpression: new TokContext$1("function", true),
+ functionStatement: new TokContext$1("function", false)
+ };
+
+ types$4.parenR.updateContext = types$4.braceR.updateContext = function () {
+ if (this.state.context.length === 1) {
+ this.state.exprAllowed = true;
+ return;
+ }
+
+ let out = this.state.context.pop();
+
+ if (out === types$1$1.braceStatement && this.curContext().token === "function") {
+ out = this.state.context.pop();
+ }
+
+ this.state.exprAllowed = !out.isExpr;
+ };
+
+ types$4.name.updateContext = function (prevType) {
+ let allowed = false;
+
+ if (prevType !== types$4.dot) {
+ if (this.state.value === "of" && !this.state.exprAllowed && prevType !== types$4._function && prevType !== types$4._class || this.state.value === "yield" && this.prodParam.hasYield) {
+ allowed = true;
+ }
+ }
+
+ this.state.exprAllowed = allowed;
+
+ if (this.state.isIterator) {
+ this.state.isIterator = false;
+ }
+ };
+
+ types$4.braceL.updateContext = function (prevType) {
+ this.state.context.push(this.braceIsBlock(prevType) ? types$1$1.braceStatement : types$1$1.braceExpression);
+ this.state.exprAllowed = true;
+ };
+
+ types$4.dollarBraceL.updateContext = function () {
+ this.state.context.push(types$1$1.templateQuasi);
+ this.state.exprAllowed = true;
+ };
+
+ types$4.parenL.updateContext = function (prevType) {
+ const statementParens = prevType === types$4._if || prevType === types$4._for || prevType === types$4._with || prevType === types$4._while;
+ this.state.context.push(statementParens ? types$1$1.parenStatement : types$1$1.parenExpression);
+ this.state.exprAllowed = true;
+ };
+
+ types$4.incDec.updateContext = function () {};
+
+ types$4._function.updateContext = types$4._class.updateContext = function (prevType) {
+ if (prevType === types$4.dot || prevType === types$4.questionDot) ; else if (prevType.beforeExpr && prevType !== types$4.semi && prevType !== types$4._else && !(prevType === types$4._return && lineBreak$1.test(this.input.slice(this.state.lastTokEnd, this.state.start))) && !((prevType === types$4.colon || prevType === types$4.braceL) && this.curContext() === types$1$1.b_stat)) {
+ this.state.context.push(types$1$1.functionExpression);
+ } else {
+ this.state.context.push(types$1$1.functionStatement);
+ }
+
+ this.state.exprAllowed = false;
+ };
+
+ types$4.backQuote.updateContext = function () {
+ if (this.curContext() === types$1$1.template) {
+ this.state.context.pop();
+ } else {
+ this.state.context.push(types$1$1.template);
+ }
+
+ this.state.exprAllowed = false;
+ };
+
+ types$4.star.updateContext = function () {
+ this.state.exprAllowed = false;
+ };
+
+ let nonASCIIidentifierStartChars$1 = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+ let nonASCIIidentifierChars$1 = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+ const nonASCIIidentifierStart$1 = new RegExp("[" + nonASCIIidentifierStartChars$1 + "]");
+ const nonASCIIidentifier$1 = new RegExp("[" + nonASCIIidentifierStartChars$1 + nonASCIIidentifierChars$1 + "]");
+ nonASCIIidentifierStartChars$1 = nonASCIIidentifierChars$1 = null;
+ const astralIdentifierStartCodes$1 = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+ const astralIdentifierCodes$1 = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+ function isInAstralSet$1(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+ }
+
+ function isIdentifierStart$1(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart$1.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet$1(code, astralIdentifierStartCodes$1);
+ }
+ function isIdentifierChar$1(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier$1.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet$1(code, astralIdentifierStartCodes$1) || isInAstralSet$1(code, astralIdentifierCodes$1);
+ }
+
+ const reservedWords$1 = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+ };
+ const keywords$1$1 = new Set(reservedWords$1.keyword);
+ const reservedWordsStrictSet$1 = new Set(reservedWords$1.strict);
+ const reservedWordsStrictBindSet$1 = new Set(reservedWords$1.strictBind);
+ function isReservedWord$1(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+ }
+ function isStrictReservedWord$1(word, inModule) {
+ return isReservedWord$1(word, inModule) || reservedWordsStrictSet$1.has(word);
+ }
+ function isStrictBindOnlyReservedWord$1(word) {
+ return reservedWordsStrictBindSet$1.has(word);
+ }
+ function isStrictBindReservedWord$1(word, inModule) {
+ return isStrictReservedWord$1(word, inModule) || isStrictBindOnlyReservedWord$1(word);
+ }
+ function isKeyword$1(word) {
+ return keywords$1$1.has(word);
+ }
+
+ const keywordRelationalOperator$1 = /^in(stanceof)?$/;
+ function isIteratorStart$1(current, next) {
+ return current === 64 && next === 64;
+ }
+
+ const reservedTypes$1 = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+ const FlowErrors$1 = Object.freeze({
+ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
+ AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module",
+ AssignReservedType: "Cannot overwrite reserved type %0",
+ DeclareClassElement: "The `declare` modifier can only appear on class fields.",
+ DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
+ DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement",
+ EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.",
+ EnumDuplicateMemberName: "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.",
+ EnumInconsistentMemberValues: "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.",
+ EnumInvalidExplicitType: "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidExplicitTypeUnknownSupplied: "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidMemberInitializerPrimaryType: "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.",
+ EnumInvalidMemberInitializerSymbolType: "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.",
+ EnumInvalidMemberInitializerUnknownType: "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.",
+ EnumInvalidMemberName: "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.",
+ EnumNumberMemberNotInitialized: "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.",
+ EnumStringMemberInconsistentlyInitailized: "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.",
+ ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements",
+ InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type",
+ InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions",
+ InexactVariance: "Explicit inexact syntax cannot have variance",
+ InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`",
+ MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
+ NestedDeclareModule: "`declare module` cannot be used inside another `declare module`",
+ NestedFlowComment: "Cannot have a flow comment inside another flow comment",
+ OptionalBindingPattern: "A binding pattern parameter cannot be optional in an implementation signature.",
+ SpreadVariance: "Spread properties cannot have variance",
+ TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`",
+ TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis",
+ UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object",
+ UnexpectedReservedType: "Unexpected reserved type %0",
+ UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new",
+ UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
+ UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions",
+ UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint"',
+ UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration",
+ UnsupportedDeclareExportKind: "`declare export %0` is not supported. Use `%1` instead",
+ UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module",
+ UnterminatedFlowComment: "Unterminated flow-comment"
+ });
+
+ function isEsModuleType$1(bodyElement) {
+ return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
+ }
+
+ function hasTypeImportKind$1(node) {
+ return node.importKind === "type" || node.importKind === "typeof";
+ }
+
+ function isMaybeDefaultImport$1(state) {
+ return (state.type === types$4.name || !!state.type.keyword) && state.value !== "from";
+ }
+
+ const exportSuggestions$1 = {
+ const: "declare export var",
+ let: "declare export var",
+ type: "export type",
+ interface: "export interface"
+ };
+
+ function partition$1(list, test) {
+ const list1 = [];
+ const list2 = [];
+
+ for (let i = 0; i < list.length; i++) {
+ (test(list[i], i, list) ? list1 : list2).push(list[i]);
+ }
+
+ return [list1, list2];
+ }
+
+ const FLOW_PRAGMA_REGEX$1 = /\*?\s*@((?:no)?flow)\b/;
+ var flow$2 = (superClass => class extends superClass {
+ constructor(options, input) {
+ super(options, input);
+ this.flowPragma = undefined;
+ }
+
+ shouldParseTypes() {
+ return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
+ }
+
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
+ finishToken(type, val) {
+ if (type !== types$4.string && type !== types$4.semi && type !== types$4.interpreterDirective) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+
+ return super.finishToken(type, val);
+ }
+
+ addComment(comment) {
+ if (this.flowPragma === undefined) {
+ const matches = FLOW_PRAGMA_REGEX$1.exec(comment.value);
+
+ if (!matches) ; else if (matches[1] === "flow") {
+ this.flowPragma = "flow";
+ } else if (matches[1] === "noflow") {
+ this.flowPragma = "noflow";
+ } else {
+ throw new Error("Unexpected flow pragma");
+ }
+ }
+
+ return super.addComment(comment);
+ }
+
+ flowParseTypeInitialiser(tok) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(tok || types$4.colon);
+ const type = this.flowParseType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParsePredicate() {
+ const node = this.startNode();
+ const moduloLoc = this.state.startLoc;
+ const moduloPos = this.state.start;
+ this.expect(types$4.modulo);
+ const checksLoc = this.state.startLoc;
+ this.expectContextual("checks");
+
+ if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {
+ this.raise(moduloPos, FlowErrors$1.UnexpectedSpaceBetweenModuloChecks);
+ }
+
+ if (this.eat(types$4.parenL)) {
+ node.value = this.parseExpression();
+ this.expect(types$4.parenR);
+ return this.finishNode(node, "DeclaredPredicate");
+ } else {
+ return this.finishNode(node, "InferredPredicate");
+ }
+ }
+
+ flowParseTypeAndPredicateInitialiser() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(types$4.colon);
+ let type = null;
+ let predicate = null;
+
+ if (this.match(types$4.modulo)) {
+ this.state.inType = oldInType;
+ predicate = this.flowParsePredicate();
+ } else {
+ type = this.flowParseType();
+ this.state.inType = oldInType;
+
+ if (this.match(types$4.modulo)) {
+ predicate = this.flowParsePredicate();
+ }
+ }
+
+ return [type, predicate];
+ }
+
+ flowParseDeclareClass(node) {
+ this.next();
+ this.flowParseInterfaceish(node, true);
+ return this.finishNode(node, "DeclareClass");
+ }
+
+ flowParseDeclareFunction(node) {
+ this.next();
+ const id = node.id = this.parseIdentifier();
+ const typeNode = this.startNode();
+ const typeContainer = this.startNode();
+
+ if (this.isRelational("<")) {
+ typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ typeNode.typeParameters = null;
+ }
+
+ this.expect(types$4.parenL);
+ const tmp = this.flowParseFunctionTypeParams();
+ typeNode.params = tmp.params;
+ typeNode.rest = tmp.rest;
+ this.expect(types$4.parenR);
+ [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
+ id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
+ this.resetEndLocation(id);
+ this.semicolon();
+ return this.finishNode(node, "DeclareFunction");
+ }
+
+ flowParseDeclare(node, insideModule) {
+ if (this.match(types$4._class)) {
+ return this.flowParseDeclareClass(node);
+ } else if (this.match(types$4._function)) {
+ return this.flowParseDeclareFunction(node);
+ } else if (this.match(types$4._var)) {
+ return this.flowParseDeclareVariable(node);
+ } else if (this.eatContextual("module")) {
+ if (this.match(types$4.dot)) {
+ return this.flowParseDeclareModuleExports(node);
+ } else {
+ if (insideModule) {
+ this.raise(this.state.lastTokStart, FlowErrors$1.NestedDeclareModule);
+ }
+
+ return this.flowParseDeclareModule(node);
+ }
+ } else if (this.isContextual("type")) {
+ return this.flowParseDeclareTypeAlias(node);
+ } else if (this.isContextual("opaque")) {
+ return this.flowParseDeclareOpaqueType(node);
+ } else if (this.isContextual("interface")) {
+ return this.flowParseDeclareInterface(node);
+ } else if (this.match(types$4._export)) {
+ return this.flowParseDeclareExportDeclaration(node, insideModule);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ flowParseDeclareVariable(node) {
+ this.next();
+ node.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(node.id.name, BIND_VAR$1, node.id.start);
+ this.semicolon();
+ return this.finishNode(node, "DeclareVariable");
+ }
+
+ flowParseDeclareModule(node) {
+ this.scope.enter(SCOPE_OTHER$1);
+
+ if (this.match(types$4.string)) {
+ node.id = this.parseExprAtom();
+ } else {
+ node.id = this.parseIdentifier();
+ }
+
+ const bodyNode = node.body = this.startNode();
+ const body = bodyNode.body = [];
+ this.expect(types$4.braceL);
+
+ while (!this.match(types$4.braceR)) {
+ let bodyNode = this.startNode();
+
+ if (this.match(types$4._import)) {
+ this.next();
+
+ if (!this.isContextual("type") && !this.match(types$4._typeof)) {
+ this.raise(this.state.lastTokStart, FlowErrors$1.InvalidNonTypeImportInDeclareModule);
+ }
+
+ this.parseImport(bodyNode);
+ } else {
+ this.expectContextual("declare", FlowErrors$1.UnsupportedStatementInDeclareModule);
+ bodyNode = this.flowParseDeclare(bodyNode, true);
+ }
+
+ body.push(bodyNode);
+ }
+
+ this.scope.exit();
+ this.expect(types$4.braceR);
+ this.finishNode(bodyNode, "BlockStatement");
+ let kind = null;
+ let hasModuleExport = false;
+ body.forEach(bodyElement => {
+ if (isEsModuleType$1(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(bodyElement.start, FlowErrors$1.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(bodyElement.start, FlowErrors$1.DuplicateDeclareModuleExports);
+ }
+
+ if (kind === "ES") {
+ this.raise(bodyElement.start, FlowErrors$1.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "CommonJS";
+ hasModuleExport = true;
+ }
+ });
+ node.kind = kind || "CommonJS";
+ return this.finishNode(node, "DeclareModule");
+ }
+
+ flowParseDeclareExportDeclaration(node, insideModule) {
+ this.expect(types$4._export);
+
+ if (this.eat(types$4._default)) {
+ if (this.match(types$4._function) || this.match(types$4._class)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ node.declaration = this.flowParseType();
+ this.semicolon();
+ }
+
+ node.default = true;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else {
+ if (this.match(types$4._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) {
+ const label = this.state.value;
+ const suggestion = exportSuggestions$1[label];
+ throw this.raise(this.state.start, FlowErrors$1.UnsupportedDeclareExportKind, label, suggestion);
+ }
+
+ if (this.match(types$4._var) || this.match(types$4._function) || this.match(types$4._class) || this.isContextual("opaque")) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ node.default = false;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else if (this.match(types$4.star) || this.match(types$4.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) {
+ node = this.parseExport(node);
+
+ if (node.type === "ExportNamedDeclaration") {
+ node.type = "ExportDeclaration";
+ node.default = false;
+ delete node.exportKind;
+ }
+
+ node.type = "Declare" + node.type;
+ return node;
+ }
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParseDeclareModuleExports(node) {
+ this.next();
+ this.expectContextual("exports");
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(node, "DeclareModuleExports");
+ }
+
+ flowParseDeclareTypeAlias(node) {
+ this.next();
+ this.flowParseTypeAlias(node);
+ node.type = "DeclareTypeAlias";
+ return node;
+ }
+
+ flowParseDeclareOpaqueType(node) {
+ this.next();
+ this.flowParseOpaqueType(node, true);
+ node.type = "DeclareOpaqueType";
+ return node;
+ }
+
+ flowParseDeclareInterface(node) {
+ this.next();
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "DeclareInterface");
+ }
+
+ flowParseInterfaceish(node, isClass = false) {
+ node.id = this.flowParseRestrictedIdentifier(!isClass, true);
+ this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION$1 : BIND_LEXICAL$1, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.extends = [];
+ node.implements = [];
+ node.mixins = [];
+
+ if (this.eat(types$4._extends)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (!isClass && this.eat(types$4.comma));
+ }
+
+ if (this.isContextual("mixins")) {
+ this.next();
+
+ do {
+ node.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(types$4.comma));
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+
+ do {
+ node.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(types$4.comma));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: isClass,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: isClass,
+ allowInexact: false
+ });
+ }
+
+ flowParseInterfaceExtends() {
+ const node = this.startNode();
+ node.id = this.flowParseQualifiedTypeIdentifier();
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ return this.finishNode(node, "InterfaceExtends");
+ }
+
+ flowParseInterface(node) {
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "InterfaceDeclaration");
+ }
+
+ checkNotUnderscore(word) {
+ if (word === "_") {
+ this.raise(this.state.start, FlowErrors$1.UnexpectedReservedUnderscore);
+ }
+ }
+
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes$1.has(word)) return;
+ this.raise(startLoc, declaration ? FlowErrors$1.AssignReservedType : FlowErrors$1.UnexpectedReservedType, word);
+ }
+
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.start, declaration);
+ return this.parseIdentifier(liberal);
+ }
+
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL$1, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.right = this.flowParseTypeInitialiser(types$4.eq);
+ this.semicolon();
+ return this.finishNode(node, "TypeAlias");
+ }
+
+ flowParseOpaqueType(node, declare) {
+ this.expectContextual("type");
+ node.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL$1, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.supertype = null;
+
+ if (this.match(types$4.colon)) {
+ node.supertype = this.flowParseTypeInitialiser(types$4.colon);
+ }
+
+ node.impltype = null;
+
+ if (!declare) {
+ node.impltype = this.flowParseTypeInitialiser(types$4.eq);
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "OpaqueType");
+ }
+
+ flowParseTypeParameter(requireDefault = false) {
+ const nodeStart = this.state.start;
+ const node = this.startNode();
+ const variance = this.flowParseVariance();
+ const ident = this.flowParseTypeAnnotatableIdentifier();
+ node.name = ident.name;
+ node.variance = variance;
+ node.bound = ident.typeAnnotation;
+
+ if (this.match(types$4.eq)) {
+ this.eat(types$4.eq);
+ node.default = this.flowParseType();
+ } else {
+ if (requireDefault) {
+ this.raise(nodeStart, FlowErrors$1.MissingTypeParamDefault);
+ }
+ }
+
+ return this.finishNode(node, "TypeParameter");
+ }
+
+ flowParseTypeParameterDeclaration() {
+ const oldInType = this.state.inType;
+ const node = this.startNode();
+ node.params = [];
+ this.state.inType = true;
+
+ if (this.isRelational("<") || this.match(types$4.jsxTagStart)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ let defaultRequired = false;
+
+ do {
+ const typeParameter = this.flowParseTypeParameter(defaultRequired);
+ node.params.push(typeParameter);
+
+ if (typeParameter.default) {
+ defaultRequired = true;
+ }
+
+ if (!this.isRelational(">")) {
+ this.expect(types$4.comma);
+ }
+ } while (!this.isRelational(">"));
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterDeclaration");
+ }
+
+ flowParseTypeParameterInstantiation() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseType());
+
+ if (!this.isRelational(">")) {
+ this.expect(types$4.comma);
+ }
+ }
+
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseTypeOrImplicitInstantiation());
+
+ if (!this.isRelational(">")) {
+ this.expect(types$4.comma);
+ }
+ }
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseInterfaceType() {
+ const node = this.startNode();
+ this.expectContextual("interface");
+ node.extends = [];
+
+ if (this.eat(types$4._extends)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(types$4.comma));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false
+ });
+ return this.finishNode(node, "InterfaceTypeAnnotation");
+ }
+
+ flowParseObjectPropertyKey() {
+ return this.match(types$4.num) || this.match(types$4.string) ? this.parseExprAtom() : this.parseIdentifier(true);
+ }
+
+ flowParseObjectTypeIndexer(node, isStatic, variance) {
+ node.static = isStatic;
+
+ if (this.lookahead().type === types$4.colon) {
+ node.id = this.flowParseObjectPropertyKey();
+ node.key = this.flowParseTypeInitialiser();
+ } else {
+ node.id = null;
+ node.key = this.flowParseType();
+ }
+
+ this.expect(types$4.bracketR);
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ return this.finishNode(node, "ObjectTypeIndexer");
+ }
+
+ flowParseObjectTypeInternalSlot(node, isStatic) {
+ node.static = isStatic;
+ node.id = this.flowParseObjectPropertyKey();
+ this.expect(types$4.bracketR);
+ this.expect(types$4.bracketR);
+
+ if (this.isRelational("<") || this.match(types$4.parenL)) {
+ node.method = true;
+ node.optional = false;
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+ } else {
+ node.method = false;
+
+ if (this.eat(types$4.question)) {
+ node.optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ }
+
+ return this.finishNode(node, "ObjectTypeInternalSlot");
+ }
+
+ flowParseObjectTypeMethodish(node) {
+ node.params = [];
+ node.rest = null;
+ node.typeParameters = null;
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ this.expect(types$4.parenL);
+
+ while (!this.match(types$4.parenR) && !this.match(types$4.ellipsis)) {
+ node.params.push(this.flowParseFunctionTypeParam());
+
+ if (!this.match(types$4.parenR)) {
+ this.expect(types$4.comma);
+ }
+ }
+
+ if (this.eat(types$4.ellipsis)) {
+ node.rest = this.flowParseFunctionTypeParam();
+ }
+
+ this.expect(types$4.parenR);
+ node.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ flowParseObjectTypeCallProperty(node, isStatic) {
+ const valueNode = this.startNode();
+ node.static = isStatic;
+ node.value = this.flowParseObjectTypeMethodish(valueNode);
+ return this.finishNode(node, "ObjectTypeCallProperty");
+ }
+
+ flowParseObjectType({
+ allowStatic,
+ allowExact,
+ allowSpread,
+ allowProto,
+ allowInexact
+ }) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const nodeStart = this.startNode();
+ nodeStart.callProperties = [];
+ nodeStart.properties = [];
+ nodeStart.indexers = [];
+ nodeStart.internalSlots = [];
+ let endDelim;
+ let exact;
+ let inexact = false;
+
+ if (allowExact && this.match(types$4.braceBarL)) {
+ this.expect(types$4.braceBarL);
+ endDelim = types$4.braceBarR;
+ exact = true;
+ } else {
+ this.expect(types$4.braceL);
+ endDelim = types$4.braceR;
+ exact = false;
+ }
+
+ nodeStart.exact = exact;
+
+ while (!this.match(endDelim)) {
+ let isStatic = false;
+ let protoStart = null;
+ let inexactStart = null;
+ const node = this.startNode();
+
+ if (allowProto && this.isContextual("proto")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== types$4.colon && lookahead.type !== types$4.question) {
+ this.next();
+ protoStart = this.state.start;
+ allowStatic = false;
+ }
+ }
+
+ if (allowStatic && this.isContextual("static")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== types$4.colon && lookahead.type !== types$4.question) {
+ this.next();
+ isStatic = true;
+ }
+ }
+
+ const variance = this.flowParseVariance();
+
+ if (this.eat(types$4.bracketL)) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (this.eat(types$4.bracketL)) {
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
+ } else {
+ nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
+ }
+ } else if (this.match(types$4.parenL) || this.isRelational("<")) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
+ } else {
+ let kind = "init";
+
+ if (this.isContextual("get") || this.isContextual("set")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type === types$4.name || lookahead.type === types$4.string || lookahead.type === types$4.num) {
+ kind = this.state.value;
+ this.next();
+ }
+ }
+
+ const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
+
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStart = this.state.lastTokStart;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+
+ this.flowObjectTypeSemicolon();
+
+ if (inexactStart && !this.match(types$4.braceR) && !this.match(types$4.braceBarR)) {
+ this.raise(inexactStart, FlowErrors$1.UnexpectedExplicitInexactInObject);
+ }
+ }
+
+ this.expect(endDelim);
+
+ if (allowSpread) {
+ nodeStart.inexact = inexact;
+ }
+
+ const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
+ this.state.inType = oldInType;
+ return out;
+ }
+
+ flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) {
+ if (this.eat(types$4.ellipsis)) {
+ const isInexactToken = this.match(types$4.comma) || this.match(types$4.semi) || this.match(types$4.braceR) || this.match(types$4.braceBarR);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors$1.InexactInsideNonObject);
+ } else if (!allowInexact) {
+ this.raise(this.state.lastTokStart, FlowErrors$1.InexactInsideExact);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors$1.InexactVariance);
+ }
+
+ return null;
+ }
+
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors$1.UnexpectedSpreadType);
+ }
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors$1.SpreadVariance);
+ }
+
+ node.argument = this.flowParseType();
+ return this.finishNode(node, "ObjectTypeSpreadProperty");
+ } else {
+ node.key = this.flowParseObjectPropertyKey();
+ node.static = isStatic;
+ node.proto = protoStart != null;
+ node.kind = kind;
+ let optional = false;
+
+ if (this.isRelational("<") || this.match(types$4.parenL)) {
+ node.method = true;
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+
+ if (kind === "get" || kind === "set") {
+ this.flowCheckGetterSetterParams(node);
+ }
+ } else {
+ if (kind !== "init") this.unexpected();
+ node.method = false;
+
+ if (this.eat(types$4.question)) {
+ optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ }
+
+ node.optional = optional;
+ return this.finishNode(node, "ObjectTypeProperty");
+ }
+ }
+
+ flowCheckGetterSetterParams(property) {
+ const paramCount = property.kind === "get" ? 0 : 1;
+ const start = property.start;
+ const length = property.value.params.length + (property.value.rest ? 1 : 0);
+
+ if (length !== paramCount) {
+ if (property.kind === "get") {
+ this.raise(start, ErrorMessages$1.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages$1.BadSetterArity);
+ }
+ }
+
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(start, ErrorMessages$1.BadSetterRestParameter);
+ }
+ }
+
+ flowObjectTypeSemicolon() {
+ if (!this.eat(types$4.semi) && !this.eat(types$4.comma) && !this.match(types$4.braceR) && !this.match(types$4.braceBarR)) {
+ this.unexpected();
+ }
+ }
+
+ flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ let node = id || this.flowParseRestrictedIdentifier(true);
+
+ while (this.eat(types$4.dot)) {
+ const node2 = this.startNodeAt(startPos, startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ node = this.finishNode(node2, "QualifiedTypeIdentifier");
+ }
+
+ return node;
+ }
+
+ flowParseGenericType(startPos, startLoc, id) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = null;
+ node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ return this.finishNode(node, "GenericTypeAnnotation");
+ }
+
+ flowParseTypeofType() {
+ const node = this.startNode();
+ this.expect(types$4._typeof);
+ node.argument = this.flowParsePrimaryType();
+ return this.finishNode(node, "TypeofTypeAnnotation");
+ }
+
+ flowParseTupleType() {
+ const node = this.startNode();
+ node.types = [];
+ this.expect(types$4.bracketL);
+
+ while (this.state.pos < this.length && !this.match(types$4.bracketR)) {
+ node.types.push(this.flowParseType());
+ if (this.match(types$4.bracketR)) break;
+ this.expect(types$4.comma);
+ }
+
+ this.expect(types$4.bracketR);
+ return this.finishNode(node, "TupleTypeAnnotation");
+ }
+
+ flowParseFunctionTypeParam() {
+ let name = null;
+ let optional = false;
+ let typeAnnotation = null;
+ const node = this.startNode();
+ const lh = this.lookahead();
+
+ if (lh.type === types$4.colon || lh.type === types$4.question) {
+ name = this.parseIdentifier();
+
+ if (this.eat(types$4.question)) {
+ optional = true;
+ }
+
+ typeAnnotation = this.flowParseTypeInitialiser();
+ } else {
+ typeAnnotation = this.flowParseType();
+ }
+
+ node.name = name;
+ node.optional = optional;
+ node.typeAnnotation = typeAnnotation;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ reinterpretTypeAsFunctionTypeParam(type) {
+ const node = this.startNodeAt(type.start, type.loc.start);
+ node.name = null;
+ node.optional = false;
+ node.typeAnnotation = type;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ flowParseFunctionTypeParams(params = []) {
+ let rest = null;
+
+ while (!this.match(types$4.parenR) && !this.match(types$4.ellipsis)) {
+ params.push(this.flowParseFunctionTypeParam());
+
+ if (!this.match(types$4.parenR)) {
+ this.expect(types$4.comma);
+ }
+ }
+
+ if (this.eat(types$4.ellipsis)) {
+ rest = this.flowParseFunctionTypeParam();
+ }
+
+ return {
+ params,
+ rest
+ };
+ }
+
+ flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
+ switch (id.name) {
+ case "any":
+ return this.finishNode(node, "AnyTypeAnnotation");
+
+ case "bool":
+ case "boolean":
+ return this.finishNode(node, "BooleanTypeAnnotation");
+
+ case "mixed":
+ return this.finishNode(node, "MixedTypeAnnotation");
+
+ case "empty":
+ return this.finishNode(node, "EmptyTypeAnnotation");
+
+ case "number":
+ return this.finishNode(node, "NumberTypeAnnotation");
+
+ case "string":
+ return this.finishNode(node, "StringTypeAnnotation");
+
+ case "symbol":
+ return this.finishNode(node, "SymbolTypeAnnotation");
+
+ default:
+ this.checkNotUnderscore(id.name);
+ return this.flowParseGenericType(startPos, startLoc, id);
+ }
+ }
+
+ flowParsePrimaryType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.startNode();
+ let tmp;
+ let type;
+ let isGroupedType = false;
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+
+ switch (this.state.type) {
+ case types$4.name:
+ if (this.isContextual("interface")) {
+ return this.flowParseInterfaceType();
+ }
+
+ return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
+
+ case types$4.braceL:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true
+ });
+
+ case types$4.braceBarL:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false
+ });
+
+ case types$4.bracketL:
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseTupleType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ return type;
+
+ case types$4.relational:
+ if (this.state.value === "<") {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(types$4.parenL);
+ tmp = this.flowParseFunctionTypeParams();
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ this.expect(types$4.parenR);
+ this.expect(types$4.arrow);
+ node.returnType = this.flowParseType();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ break;
+
+ case types$4.parenL:
+ this.next();
+
+ if (!this.match(types$4.parenR) && !this.match(types$4.ellipsis)) {
+ if (this.match(types$4.name)) {
+ const token = this.lookahead().type;
+ isGroupedType = token !== types$4.question && token !== types$4.colon;
+ } else {
+ isGroupedType = true;
+ }
+ }
+
+ if (isGroupedType) {
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+
+ if (this.state.noAnonFunctionType || !(this.match(types$4.comma) || this.match(types$4.parenR) && this.lookahead().type === types$4.arrow)) {
+ this.expect(types$4.parenR);
+ return type;
+ } else {
+ this.eat(types$4.comma);
+ }
+ }
+
+ if (type) {
+ tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
+ } else {
+ tmp = this.flowParseFunctionTypeParams();
+ }
+
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ this.expect(types$4.parenR);
+ this.expect(types$4.arrow);
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+
+ case types$4.string:
+ return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
+
+ case types$4._true:
+ case types$4._false:
+ node.value = this.match(types$4._true);
+ this.next();
+ return this.finishNode(node, "BooleanLiteralTypeAnnotation");
+
+ case types$4.plusMin:
+ if (this.state.value === "-") {
+ this.next();
+
+ if (this.match(types$4.num)) {
+ return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start);
+ }
+
+ if (this.match(types$4.bigint)) {
+ return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start);
+ }
+
+ throw this.raise(this.state.start, FlowErrors$1.UnexpectedSubtractionOperand);
+ }
+
+ throw this.unexpected();
+
+ case types$4.num:
+ return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
+
+ case types$4.bigint:
+ return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
+
+ case types$4._void:
+ this.next();
+ return this.finishNode(node, "VoidTypeAnnotation");
+
+ case types$4._null:
+ this.next();
+ return this.finishNode(node, "NullLiteralTypeAnnotation");
+
+ case types$4._this:
+ this.next();
+ return this.finishNode(node, "ThisTypeAnnotation");
+
+ case types$4.star:
+ this.next();
+ return this.finishNode(node, "ExistsTypeAnnotation");
+
+ default:
+ if (this.state.type.keyword === "typeof") {
+ return this.flowParseTypeofType();
+ } else if (this.state.type.keyword) {
+ const label = this.state.type.label;
+ this.next();
+ return super.createIdentifier(node, label);
+ }
+
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParsePostfixType() {
+ const startPos = this.state.start,
+ startLoc = this.state.startLoc;
+ let type = this.flowParsePrimaryType();
+
+ while (this.match(types$4.bracketL) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.elementType = type;
+ this.expect(types$4.bracketL);
+ this.expect(types$4.bracketR);
+ type = this.finishNode(node, "ArrayTypeAnnotation");
+ }
+
+ return type;
+ }
+
+ flowParsePrefixType() {
+ const node = this.startNode();
+
+ if (this.eat(types$4.question)) {
+ node.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(node, "NullableTypeAnnotation");
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+
+ flowParseAnonFunctionWithoutParens() {
+ const param = this.flowParsePrefixType();
+
+ if (!this.state.noAnonFunctionType && this.eat(types$4.arrow)) {
+ const node = this.startNodeAt(param.start, param.loc.start);
+ node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
+ node.rest = null;
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ return param;
+ }
+
+ flowParseIntersectionType() {
+ const node = this.startNode();
+ this.eat(types$4.bitwiseAND);
+ const type = this.flowParseAnonFunctionWithoutParens();
+ node.types = [type];
+
+ while (this.eat(types$4.bitwiseAND)) {
+ node.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
+ }
+
+ flowParseUnionType() {
+ const node = this.startNode();
+ this.eat(types$4.bitwiseOR);
+ const type = this.flowParseIntersectionType();
+ node.types = [type];
+
+ while (this.eat(types$4.bitwiseOR)) {
+ node.types.push(this.flowParseIntersectionType());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
+ }
+
+ flowParseType() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const type = this.flowParseUnionType();
+ this.state.inType = oldInType;
+ this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType;
+ return type;
+ }
+
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === types$4.name && this.state.value === "_") {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.parseIdentifier();
+ return this.flowParseGenericType(startPos, startLoc, node);
+ } else {
+ return this.flowParseType();
+ }
+ }
+
+ flowParseTypeAnnotation() {
+ const node = this.startNode();
+ node.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "TypeAnnotation");
+ }
+
+ flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
+ const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
+
+ if (this.match(types$4.colon)) {
+ ident.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(ident);
+ }
+
+ return ident;
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ flowParseVariance() {
+ let variance = null;
+
+ if (this.match(types$4.plusMin)) {
+ variance = this.startNode();
+
+ if (this.state.value === "+") {
+ variance.kind = "plus";
+ } else {
+ variance.kind = "minus";
+ }
+
+ this.next();
+ this.finishNode(variance, "Variance");
+ }
+
+ return variance;
+ }
+
+ parseFunctionBody(node, allowExpressionBody, isMethod = false) {
+ if (allowExpressionBody) {
+ return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
+ }
+
+ return super.parseFunctionBody(node, false, isMethod);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(types$4.colon)) {
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.state.strict && this.match(types$4.name) && this.state.value === "interface") {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseInterface(node);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ } else {
+ const stmt = super.parseStatement(context, topLevel);
+
+ if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
+ this.flowPragma = null;
+ }
+
+ return stmt;
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type === "Identifier") {
+ if (expr.name === "declare") {
+ if (this.match(types$4._class) || this.match(types$4.name) || this.match(types$4._function) || this.match(types$4._var) || this.match(types$4._export)) {
+ return this.flowParseDeclare(node);
+ }
+ } else if (this.match(types$4.name)) {
+ if (expr.name === "interface") {
+ return this.flowParseInterface(node);
+ } else if (expr.name === "type") {
+ return this.flowParseTypeAlias(node);
+ } else if (expr.name === "opaque") {
+ return this.flowParseOpaqueType(node, false);
+ }
+ }
+ }
+
+ return super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration();
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types$4.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) {
+ return false;
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (!this.match(types$4.question)) return expr;
+
+ if (refNeedsArrowPos) {
+ const result = this.tryParse(() => super.parseConditional(expr, noIn, startPos, startLoc));
+
+ if (!result.node) {
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ this.expect(types$4.question);
+ const state = this.state.clone();
+ const originalNoArrowAt = this.state.noArrowAt;
+ const node = this.startNodeAt(startPos, startLoc);
+ let {
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent();
+ let [valid, invalid] = this.getArrowLikeExpressions(consequent);
+
+ if (failed || invalid.length > 0) {
+ const noArrowAt = [...originalNoArrowAt];
+
+ if (invalid.length > 0) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt;
+
+ for (let i = 0; i < invalid.length; i++) {
+ noArrowAt.push(invalid[i].start);
+ }
+
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ }
+
+ if (failed && valid.length > 1) {
+ this.raise(state.start, FlowErrors$1.AmbiguousConditionalArrow);
+ }
+
+ if (failed && valid.length === 1) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt.concat(valid[0].start);
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ }
+ }
+
+ this.getArrowLikeExpressions(consequent, true);
+ this.state.noArrowAt = originalNoArrowAt;
+ this.expect(types$4.colon);
+ node.test = expr;
+ node.consequent = consequent;
+ node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(noIn, undefined, undefined, undefined));
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const consequent = this.parseMaybeAssign();
+ const failed = !this.match(types$4.colon);
+ this.state.noArrowParamsConversionAt.pop();
+ return {
+ consequent,
+ failed
+ };
+ }
+
+ getArrowLikeExpressions(node, disallowInvalid) {
+ const stack = [node];
+ const arrows = [];
+
+ while (stack.length !== 0) {
+ const node = stack.pop();
+
+ if (node.type === "ArrowFunctionExpression") {
+ if (node.typeParameters || !node.returnType) {
+ this.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+
+ return partition$1(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+
+ finishArrowValidation(node) {
+ var _node$extra;
+
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma);
+ this.scope.enter(SCOPE_FUNCTION$1 | SCOPE_ARROW$1);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+
+ forwardNoArrowParamsConversionAt(node, parse) {
+ let result;
+
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ result = parse();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ result = parse();
+ }
+
+ return result;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(types$4.question)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(types$4.colon)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TypeCastExpression");
+ }
+
+ return node;
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
+ return;
+ }
+
+ super.assertModuleNodeAllowed(node);
+ }
+
+ parseExport(node) {
+ const decl = super.parseExport(node);
+
+ if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") {
+ decl.exportKind = decl.exportKind || "value";
+ }
+
+ return decl;
+ }
+
+ parseExportDeclaration(node) {
+ if (this.isContextual("type")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+
+ if (this.match(types$4.braceL)) {
+ node.specifiers = this.parseExportSpecifiers();
+ this.parseExportFrom(node);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(declarationNode);
+ }
+ } else if (this.isContextual("opaque")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(declarationNode, false);
+ } else if (this.isContextual("interface")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
+ } else {
+ return super.parseExportDeclaration(node);
+ }
+ }
+
+ eatExportStar(node) {
+ if (super.eatExportStar(...arguments)) return true;
+
+ if (this.isContextual("type") && this.lookahead().type === types$4.star) {
+ node.exportKind = "type";
+ this.next();
+ this.next();
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ const pos = this.state.start;
+ const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
+
+ if (hasNamespace && node.exportKind === "type") {
+ this.unexpected(pos);
+ }
+
+ return hasNamespace;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ super.parseClassId(node, isStatement, optionalId);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ const pos = this.state.start;
+
+ if (this.isContextual("declare")) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ member.declare = true;
+ }
+
+ super.parseClassMember(classBody, member, state, constructorAllowsSuper);
+
+ if (member.declare) {
+ if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty") {
+ this.raise(pos, FlowErrors$1.DeclareClassElement);
+ } else if (member.value) {
+ this.raise(member.value.start, FlowErrors$1.DeclareClassFieldInitializer);
+ }
+ }
+ }
+
+ getTokenFromCode(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 123 && next === 124) {
+ return this.finishOp(types$4.braceBarL, 2);
+ } else if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(types$4.relational, 1);
+ } else if (isIteratorStart$1(code, next)) {
+ this.state.isIterator = true;
+ return super.readWord();
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ return true;
+
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ case "TypeCastExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
+ toAssignable(node) {
+ if (node.type === "TypeCastExpression") {
+ return super.toAssignable(this.typeCastToParameter(node));
+ } else {
+ return super.toAssignable(node);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ return super.toAssignableList(exprList, trailingCommaPos);
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ var _expr$extra;
+
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) == null ? void 0 : _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(expr.typeAnnotation.start, FlowErrors$1.TypeCastInPattern);
+ }
+ }
+
+ return exprList;
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE$1, checkClashes, contextDescription) {
+ if (expr.type !== "TypeCastExpression") {
+ return super.checkLVal(expr, bindingType, checkClashes, contextDescription);
+ }
+ }
+
+ parseClassProperty(node) {
+ if (this.match(types$4.colon)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (this.match(types$4.colon)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassPrivateProperty(node);
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(types$4.colon) || super.isClassProperty();
+ }
+
+ isNonstaticConstructor(method) {
+ return !this.match(types$4.colon) && super.isNonstaticConstructor(method);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+ const implemented = node.implements = [];
+
+ do {
+ const node = this.startNode();
+ node.id = this.flowParseRestrictedIdentifier(true);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ implemented.push(this.finishNode(node, "ClassImplements"));
+ } while (this.eat(types$4.comma));
+ }
+ }
+
+ parsePropertyName(node, isPrivateNameAllowed) {
+ const variance = this.flowParseVariance();
+ const key = super.parsePropertyName(node, isPrivateNameAllowed);
+ node.variance = variance;
+ return key;
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc) {
+ if (prop.variance) {
+ this.unexpected(prop.variance.start);
+ }
+
+ delete prop.variance;
+ let typeParameters;
+
+ if (this.isRelational("<")) {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ if (!this.match(types$4.parenL)) this.unexpected();
+ }
+
+ super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc);
+
+ if (typeParameters) {
+ (prop.value || prop).typeParameters = typeParameters;
+ }
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(types$4.question)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, FlowErrors$1.OptionalBindingPattern);
+ }
+
+ param.optional = true;
+ }
+
+ if (this.match(types$4.colon)) {
+ param.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ const node = super.parseMaybeDefault(startPos, startLoc, left);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, FlowErrors$1.TypeBeforeInitializer);
+ }
+
+ return node;
+ }
+
+ shouldParseDefaultImport(node) {
+ if (!hasTypeImportKind$1(node)) {
+ return super.shouldParseDefaultImport(node);
+ }
+
+ return isMaybeDefaultImport$1(this.state);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = hasTypeImportKind$1(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
+ this.checkLVal(specifier.local, BIND_LEXICAL$1, undefined, contextDescription);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ node.importKind = "value";
+ let kind = null;
+
+ if (this.match(types$4._typeof)) {
+ kind = "typeof";
+ } else if (this.isContextual("type")) {
+ kind = "type";
+ }
+
+ if (kind) {
+ const lh = this.lookahead();
+
+ if (kind === "type" && lh.type === types$4.star) {
+ this.unexpected(lh.start);
+ }
+
+ if (isMaybeDefaultImport$1(lh) || lh.type === types$4.braceL || lh.type === types$4.star) {
+ this.next();
+ node.importKind = kind;
+ }
+ }
+
+ return super.maybeParseDefaultImportSpecifier(node);
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ const firstIdentLoc = this.state.start;
+ const firstIdent = this.parseIdentifier(true);
+ let specifierTypeKind = null;
+
+ if (firstIdent.name === "type") {
+ specifierTypeKind = "type";
+ } else if (firstIdent.name === "typeof") {
+ specifierTypeKind = "typeof";
+ }
+
+ let isBinding = false;
+
+ if (this.isContextual("as") && !this.isLookaheadContextual("as")) {
+ const as_ident = this.parseIdentifier(true);
+
+ if (specifierTypeKind !== null && !this.match(types$4.name) && !this.state.type.keyword) {
+ specifier.imported = as_ident;
+ specifier.importKind = specifierTypeKind;
+ specifier.local = as_ident.__clone();
+ } else {
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = this.parseIdentifier();
+ }
+ } else if (specifierTypeKind !== null && (this.match(types$4.name) || this.state.type.keyword)) {
+ specifier.imported = this.parseIdentifier(true);
+ specifier.importKind = specifierTypeKind;
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ isBinding = true;
+ specifier.local = specifier.imported.__clone();
+ }
+ } else {
+ isBinding = true;
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = specifier.imported.__clone();
+ }
+
+ const nodeIsTypeImport = hasTypeImportKind$1(node);
+ const specifierIsTypeImport = hasTypeImportKind$1(specifier);
+
+ if (nodeIsTypeImport && specifierIsTypeImport) {
+ this.raise(firstIdentLoc, FlowErrors$1.ImportTypeShorthandOnlyInPureImport);
+ }
+
+ if (nodeIsTypeImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.start, true);
+ }
+
+ if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {
+ this.checkReservedWord(specifier.local.name, specifier.start, true, true);
+ }
+
+ this.checkLVal(specifier.local, BIND_LEXICAL$1, undefined, "import specifier");
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const kind = node.kind;
+
+ if (kind !== "get" && kind !== "set" && this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (this.match(types$4.colon)) {
+ decl.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(types$4.colon)) {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ node.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(types$4.colon) || super.shouldParseAsyncArrow();
+ }
+
+ parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos) {
+ var _jsx;
+
+ let state = null;
+ let jsx;
+
+ if (this.hasPlugin("jsx") && (this.match(types$4.jsxTagStart) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational("<")) {
+ var _arrow$node, _jsx2, _jsx3;
+
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(() => {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos));
+ arrowExpression.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(arrowExpression, typeParameters);
+ return arrowExpression;
+ }, state);
+ const arrowExpression = ((_arrow$node = arrow.node) == null ? void 0 : _arrow$node.type) === "ArrowFunctionExpression" ? arrow.node : null;
+ if (!arrow.error && arrowExpression) return arrowExpression;
+
+ if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+
+ if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(typeParameters.start, FlowErrors$1.UnexpectedTokenAfterTypeParameter);
+ }
+
+ return super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos);
+ }
+
+ parseArrow(node) {
+ if (this.match(types$4.colon)) {
+ const result = this.tryParse(() => {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(types$4.arrow)) this.unexpected();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+
+ return super.parseArrow(node);
+ }
+
+ shouldParseArrow() {
+ return this.match(types$4.colon) || super.shouldParseArrow();
+ }
+
+ setArrowFunctionParameters(node, params) {
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ node.params = params;
+ } else {
+ super.setArrowFunctionParameters(node, params);
+ }
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction) {
+ if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ return;
+ }
+
+ return super.checkParams(...arguments);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, false);
+ base = this.finishNode(node, "CallExpression");
+ } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) {
+ const state = this.state.clone();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+
+ throw arrow.error || result.error;
+ }
+
+ return super.parseSubscripts(base, startPos, startLoc, noCalls);
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
+ if (this.match(types$4.questionDot) && this.isLookaheadRelational("<")) {
+ subscriptState.optionalChainMember = true;
+
+ if (noCalls) {
+ subscriptState.stop = true;
+ return base;
+ }
+
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(types$4.parenL);
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, false);
+ node.optional = true;
+ return this.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(types$4.parenL);
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, false);
+ if (subscriptState.optionalChainMember) node.optional = false;
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);
+ }
+
+ parseNewArguments(node) {
+ let targs = null;
+
+ if (this.shouldParseTypes() && this.isRelational("<")) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+
+ node.typeArguments = targs;
+ super.parseNewArguments(node);
+ }
+
+ parseAsyncArrowWithTypeParameters(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.parseFunctionParams(node);
+ if (!this.parseArrow(node)) return;
+ return this.parseArrowExpression(node, undefined, true);
+ }
+
+ readToken_mult_modulo(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+
+ super.readToken_mult_modulo(code);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 124 && next === 125) {
+ this.finishOp(types$4.braceBarR, 2);
+ return;
+ }
+
+ super.readToken_pipe_amp(code);
+ }
+
+ parseTopLevel(file, program) {
+ const fileNode = super.parseTopLevel(file, program);
+
+ if (this.state.hasFlowComment) {
+ this.raise(this.state.pos, FlowErrors$1.UnterminatedFlowComment);
+ }
+
+ return fileNode;
+ }
+
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ this.unexpected(null, FlowErrors$1.NestedFlowComment);
+ }
+
+ this.hasFlowCommentCompletion();
+ this.state.pos += this.skipFlowComment();
+ this.state.hasFlowComment = true;
+ return;
+ }
+
+ if (this.state.hasFlowComment) {
+ const end = this.input.indexOf("*-/", this.state.pos += 2);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos - 2, ErrorMessages$1.UnterminatedComment);
+ }
+
+ this.state.pos = end + 3;
+ return;
+ }
+
+ super.skipBlockComment();
+ }
+
+ skipFlowComment() {
+ const {
+ pos
+ } = this.state;
+ let shiftToFirstNonWhiteSpace = 2;
+
+ while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
+ shiftToFirstNonWhiteSpace++;
+ }
+
+ const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
+ const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
+
+ if (ch2 === 58 && ch3 === 58) {
+ return shiftToFirstNonWhiteSpace + 2;
+ }
+
+ if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
+ return shiftToFirstNonWhiteSpace + 12;
+ }
+
+ if (ch2 === 58 && ch3 !== 58) {
+ return shiftToFirstNonWhiteSpace;
+ }
+
+ return false;
+ }
+
+ hasFlowCommentCompletion() {
+ const end = this.input.indexOf("*/", this.state.pos);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos, ErrorMessages$1.UnterminatedComment);
+ }
+ }
+
+ flowEnumErrorBooleanMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors$1.EnumBooleanMemberNotInitialized, memberName, enumName);
+ }
+
+ flowEnumErrorInvalidMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ const suggestion = memberName[0].toUpperCase() + memberName.slice(1);
+ this.raise(pos, FlowErrors$1.EnumInvalidMemberName, memberName, suggestion, enumName);
+ }
+
+ flowEnumErrorDuplicateMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors$1.EnumDuplicateMemberName, memberName, enumName);
+ }
+
+ flowEnumErrorInconsistentMemberValues(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors$1.EnumInconsistentMemberValues, enumName);
+ }
+
+ flowEnumErrorInvalidExplicitType(pos, {
+ enumName,
+ suppliedType
+ }) {
+ return this.raise(pos, suppliedType === null ? FlowErrors$1.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors$1.EnumInvalidExplicitType, enumName, suppliedType);
+ }
+
+ flowEnumErrorInvalidMemberInitializer(pos, {
+ enumName,
+ explicitType,
+ memberName
+ }) {
+ let message = null;
+
+ switch (explicitType) {
+ case "boolean":
+ case "number":
+ case "string":
+ message = FlowErrors$1.EnumInvalidMemberInitializerPrimaryType;
+ break;
+
+ case "symbol":
+ message = FlowErrors$1.EnumInvalidMemberInitializerSymbolType;
+ break;
+
+ default:
+ message = FlowErrors$1.EnumInvalidMemberInitializerUnknownType;
+ }
+
+ return this.raise(pos, message, enumName, memberName, explicitType);
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors$1.EnumNumberMemberNotInitialized, enumName, memberName);
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors$1.EnumStringMemberInconsistentlyInitailized, enumName);
+ }
+
+ flowEnumMemberInit() {
+ const startPos = this.state.start;
+
+ const endOfInit = () => this.match(types$4.comma) || this.match(types$4.braceR);
+
+ switch (this.state.type) {
+ case types$4.num:
+ {
+ const literal = this.parseLiteral(this.state.value, "NumericLiteral");
+
+ if (endOfInit()) {
+ return {
+ type: "number",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case types$4.string:
+ {
+ const literal = this.parseLiteral(this.state.value, "StringLiteral");
+
+ if (endOfInit()) {
+ return {
+ type: "string",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case types$4._true:
+ case types$4._false:
+ {
+ const literal = this.parseBooleanLiteral();
+
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ default:
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+ }
+
+ flowEnumMemberRaw() {
+ const pos = this.state.start;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(types$4.eq) ? this.flowEnumMemberInit() : {
+ type: "none",
+ pos
+ };
+ return {
+ id,
+ init
+ };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+
+ if (explicitType === null) {
+ return;
+ }
+
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(pos, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+
+ while (!this.match(types$4.braceR)) {
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+
+ if (memberName === "") {
+ continue;
+ }
+
+ if (/^[a-z]/.test(memberName)) {
+ this.flowEnumErrorInvalidMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ if (seenNames.has(memberName)) {
+ this.flowEnumErrorDuplicateMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
+ }
+
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);
+ break;
+
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
+ break;
+
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+
+ if (!this.match(types$4.braceR)) {
+ this.expect(types$4.comma);
+ }
+ }
+
+ return members;
+ }
+
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (let _i = 0; _i < initializedMembers.length; _i++) {
+ const member = initializedMembers[_i];
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return defaultedMembers;
+ } else {
+ for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) {
+ const member = defaultedMembers[_i2];
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return initializedMembers;
+ }
+ }
+
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (this.eatContextual("of")) {
+ if (!this.match(types$4.name)) {
+ throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: null
+ });
+ }
+
+ const {
+ value
+ } = this.state;
+ this.next();
+
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: value
+ });
+ }
+
+ return value;
+ }
+
+ return null;
+ }
+
+ flowEnumBody(node, {
+ enumName,
+ nameLoc
+ }) {
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(types$4.braceL);
+ const members = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumBooleanBody");
+
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumNumberBody");
+
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumStringBody");
+
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumSymbolBody");
+
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumStringBody");
+ };
+
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) {
+ const member = _members$defaultedMem[_i3];
+ this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.booleanMembers;
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) {
+ const member = _members$defaultedMem2[_i4];
+ this.flowEnumErrorNumberMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.numberMembers;
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.flowEnumErrorInconsistentMemberValues(nameLoc, {
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), {
+ enumName: id.name,
+ nameLoc: id.start
+ });
+ return this.finishNode(node, "EnumDeclaration");
+ }
+
+ updateContext(prevType) {
+ if (this.match(types$4.name) && this.state.value === "of" && prevType === types$4.name && this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) === "interface") {
+ this.state.exprAllowed = false;
+ } else {
+ super.updateContext(prevType);
+ }
+ }
+
+ });
+
+ const entities$1 = {
+ quot: "\u0022",
+ amp: "&",
+ apos: "\u0027",
+ lt: "<",
+ gt: ">",
+ nbsp: "\u00A0",
+ iexcl: "\u00A1",
+ cent: "\u00A2",
+ pound: "\u00A3",
+ curren: "\u00A4",
+ yen: "\u00A5",
+ brvbar: "\u00A6",
+ sect: "\u00A7",
+ uml: "\u00A8",
+ copy: "\u00A9",
+ ordf: "\u00AA",
+ laquo: "\u00AB",
+ not: "\u00AC",
+ shy: "\u00AD",
+ reg: "\u00AE",
+ macr: "\u00AF",
+ deg: "\u00B0",
+ plusmn: "\u00B1",
+ sup2: "\u00B2",
+ sup3: "\u00B3",
+ acute: "\u00B4",
+ micro: "\u00B5",
+ para: "\u00B6",
+ middot: "\u00B7",
+ cedil: "\u00B8",
+ sup1: "\u00B9",
+ ordm: "\u00BA",
+ raquo: "\u00BB",
+ frac14: "\u00BC",
+ frac12: "\u00BD",
+ frac34: "\u00BE",
+ iquest: "\u00BF",
+ Agrave: "\u00C0",
+ Aacute: "\u00C1",
+ Acirc: "\u00C2",
+ Atilde: "\u00C3",
+ Auml: "\u00C4",
+ Aring: "\u00C5",
+ AElig: "\u00C6",
+ Ccedil: "\u00C7",
+ Egrave: "\u00C8",
+ Eacute: "\u00C9",
+ Ecirc: "\u00CA",
+ Euml: "\u00CB",
+ Igrave: "\u00CC",
+ Iacute: "\u00CD",
+ Icirc: "\u00CE",
+ Iuml: "\u00CF",
+ ETH: "\u00D0",
+ Ntilde: "\u00D1",
+ Ograve: "\u00D2",
+ Oacute: "\u00D3",
+ Ocirc: "\u00D4",
+ Otilde: "\u00D5",
+ Ouml: "\u00D6",
+ times: "\u00D7",
+ Oslash: "\u00D8",
+ Ugrave: "\u00D9",
+ Uacute: "\u00DA",
+ Ucirc: "\u00DB",
+ Uuml: "\u00DC",
+ Yacute: "\u00DD",
+ THORN: "\u00DE",
+ szlig: "\u00DF",
+ agrave: "\u00E0",
+ aacute: "\u00E1",
+ acirc: "\u00E2",
+ atilde: "\u00E3",
+ auml: "\u00E4",
+ aring: "\u00E5",
+ aelig: "\u00E6",
+ ccedil: "\u00E7",
+ egrave: "\u00E8",
+ eacute: "\u00E9",
+ ecirc: "\u00EA",
+ euml: "\u00EB",
+ igrave: "\u00EC",
+ iacute: "\u00ED",
+ icirc: "\u00EE",
+ iuml: "\u00EF",
+ eth: "\u00F0",
+ ntilde: "\u00F1",
+ ograve: "\u00F2",
+ oacute: "\u00F3",
+ ocirc: "\u00F4",
+ otilde: "\u00F5",
+ ouml: "\u00F6",
+ divide: "\u00F7",
+ oslash: "\u00F8",
+ ugrave: "\u00F9",
+ uacute: "\u00FA",
+ ucirc: "\u00FB",
+ uuml: "\u00FC",
+ yacute: "\u00FD",
+ thorn: "\u00FE",
+ yuml: "\u00FF",
+ OElig: "\u0152",
+ oelig: "\u0153",
+ Scaron: "\u0160",
+ scaron: "\u0161",
+ Yuml: "\u0178",
+ fnof: "\u0192",
+ circ: "\u02C6",
+ tilde: "\u02DC",
+ Alpha: "\u0391",
+ Beta: "\u0392",
+ Gamma: "\u0393",
+ Delta: "\u0394",
+ Epsilon: "\u0395",
+ Zeta: "\u0396",
+ Eta: "\u0397",
+ Theta: "\u0398",
+ Iota: "\u0399",
+ Kappa: "\u039A",
+ Lambda: "\u039B",
+ Mu: "\u039C",
+ Nu: "\u039D",
+ Xi: "\u039E",
+ Omicron: "\u039F",
+ Pi: "\u03A0",
+ Rho: "\u03A1",
+ Sigma: "\u03A3",
+ Tau: "\u03A4",
+ Upsilon: "\u03A5",
+ Phi: "\u03A6",
+ Chi: "\u03A7",
+ Psi: "\u03A8",
+ Omega: "\u03A9",
+ alpha: "\u03B1",
+ beta: "\u03B2",
+ gamma: "\u03B3",
+ delta: "\u03B4",
+ epsilon: "\u03B5",
+ zeta: "\u03B6",
+ eta: "\u03B7",
+ theta: "\u03B8",
+ iota: "\u03B9",
+ kappa: "\u03BA",
+ lambda: "\u03BB",
+ mu: "\u03BC",
+ nu: "\u03BD",
+ xi: "\u03BE",
+ omicron: "\u03BF",
+ pi: "\u03C0",
+ rho: "\u03C1",
+ sigmaf: "\u03C2",
+ sigma: "\u03C3",
+ tau: "\u03C4",
+ upsilon: "\u03C5",
+ phi: "\u03C6",
+ chi: "\u03C7",
+ psi: "\u03C8",
+ omega: "\u03C9",
+ thetasym: "\u03D1",
+ upsih: "\u03D2",
+ piv: "\u03D6",
+ ensp: "\u2002",
+ emsp: "\u2003",
+ thinsp: "\u2009",
+ zwnj: "\u200C",
+ zwj: "\u200D",
+ lrm: "\u200E",
+ rlm: "\u200F",
+ ndash: "\u2013",
+ mdash: "\u2014",
+ lsquo: "\u2018",
+ rsquo: "\u2019",
+ sbquo: "\u201A",
+ ldquo: "\u201C",
+ rdquo: "\u201D",
+ bdquo: "\u201E",
+ dagger: "\u2020",
+ Dagger: "\u2021",
+ bull: "\u2022",
+ hellip: "\u2026",
+ permil: "\u2030",
+ prime: "\u2032",
+ Prime: "\u2033",
+ lsaquo: "\u2039",
+ rsaquo: "\u203A",
+ oline: "\u203E",
+ frasl: "\u2044",
+ euro: "\u20AC",
+ image: "\u2111",
+ weierp: "\u2118",
+ real: "\u211C",
+ trade: "\u2122",
+ alefsym: "\u2135",
+ larr: "\u2190",
+ uarr: "\u2191",
+ rarr: "\u2192",
+ darr: "\u2193",
+ harr: "\u2194",
+ crarr: "\u21B5",
+ lArr: "\u21D0",
+ uArr: "\u21D1",
+ rArr: "\u21D2",
+ dArr: "\u21D3",
+ hArr: "\u21D4",
+ forall: "\u2200",
+ part: "\u2202",
+ exist: "\u2203",
+ empty: "\u2205",
+ nabla: "\u2207",
+ isin: "\u2208",
+ notin: "\u2209",
+ ni: "\u220B",
+ prod: "\u220F",
+ sum: "\u2211",
+ minus: "\u2212",
+ lowast: "\u2217",
+ radic: "\u221A",
+ prop: "\u221D",
+ infin: "\u221E",
+ ang: "\u2220",
+ and: "\u2227",
+ or: "\u2228",
+ cap: "\u2229",
+ cup: "\u222A",
+ int: "\u222B",
+ there4: "\u2234",
+ sim: "\u223C",
+ cong: "\u2245",
+ asymp: "\u2248",
+ ne: "\u2260",
+ equiv: "\u2261",
+ le: "\u2264",
+ ge: "\u2265",
+ sub: "\u2282",
+ sup: "\u2283",
+ nsub: "\u2284",
+ sube: "\u2286",
+ supe: "\u2287",
+ oplus: "\u2295",
+ otimes: "\u2297",
+ perp: "\u22A5",
+ sdot: "\u22C5",
+ lceil: "\u2308",
+ rceil: "\u2309",
+ lfloor: "\u230A",
+ rfloor: "\u230B",
+ lang: "\u2329",
+ rang: "\u232A",
+ loz: "\u25CA",
+ spades: "\u2660",
+ clubs: "\u2663",
+ hearts: "\u2665",
+ diams: "\u2666"
+ };
+
+ const HEX_NUMBER$1 = /^[\da-fA-F]+$/;
+ const DECIMAL_NUMBER$1 = /^\d+$/;
+ const JsxErrors$1 = Object.freeze({
+ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression",
+ MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>",
+ MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>",
+ UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text",
+ UnterminatedJsxContent: "Unterminated JSX contents",
+ UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
+ });
+ types$1$1.j_oTag = new TokContext$1("<tag", false);
+ types$1$1.j_cTag = new TokContext$1("</tag", false);
+ types$1$1.j_expr = new TokContext$1("<tag>...</tag>", true, true);
+ types$4.jsxName = new TokenType("jsxName");
+ types$4.jsxText = new TokenType("jsxText", {
+ beforeExpr: true
+ });
+ types$4.jsxTagStart = new TokenType("jsxTagStart", {
+ startsExpr: true
+ });
+ types$4.jsxTagEnd = new TokenType("jsxTagEnd");
+
+ types$4.jsxTagStart.updateContext = function () {
+ this.state.context.push(types$1$1.j_expr);
+ this.state.context.push(types$1$1.j_oTag);
+ this.state.exprAllowed = false;
+ };
+
+ types$4.jsxTagEnd.updateContext = function (prevType) {
+ const out = this.state.context.pop();
+
+ if (out === types$1$1.j_oTag && prevType === types$4.slash || out === types$1$1.j_cTag) {
+ this.state.context.pop();
+ this.state.exprAllowed = this.curContext() === types$1$1.j_expr;
+ } else {
+ this.state.exprAllowed = true;
+ }
+ };
+
+ function isFragment$1(object) {
+ return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
+ }
+
+ function getQualifiedJSXName$1(object) {
+ if (object.type === "JSXIdentifier") {
+ return object.name;
+ }
+
+ if (object.type === "JSXNamespacedName") {
+ return object.namespace.name + ":" + object.name.name;
+ }
+
+ if (object.type === "JSXMemberExpression") {
+ return getQualifiedJSXName$1(object.object) + "." + getQualifiedJSXName$1(object.property);
+ }
+
+ throw new Error("Node had unexpected type: " + object.type);
+ }
+
+ var jsx$2 = (superClass => class extends superClass {
+ jsxReadToken() {
+ let out = "";
+ let chunkStart = this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, JsxErrors$1.UnterminatedJsxContent);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (ch === 60 && this.state.exprAllowed) {
+ ++this.state.pos;
+ return this.finishToken(types$4.jsxTagStart);
+ }
+
+ return super.getTokenFromCode(ch);
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ return this.finishToken(types$4.jsxText, out);
+
+ case 38:
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ break;
+
+ default:
+ if (isNewLine$1(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(true);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+
+ }
+ }
+ }
+
+ jsxReadNewLine(normalizeCRLF) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let out;
+ ++this.state.pos;
+
+ if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ out = normalizeCRLF ? "\n" : "\r\n";
+ } else {
+ out = String.fromCharCode(ch);
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return out;
+ }
+
+ jsxReadString(quote) {
+ let out = "";
+ let chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnterminatedString);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 38) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ } else if (isNewLine$1(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(false);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ return this.finishToken(types$4.string, out);
+ }
+
+ jsxReadEntity() {
+ let str = "";
+ let count = 0;
+ let entity;
+ let ch = this.input[this.state.pos];
+ const startPos = ++this.state.pos;
+
+ while (this.state.pos < this.length && count++ < 10) {
+ ch = this.input[this.state.pos++];
+
+ if (ch === ";") {
+ if (str[0] === "#") {
+ if (str[1] === "x") {
+ str = str.substr(2);
+
+ if (HEX_NUMBER$1.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 16));
+ }
+ } else {
+ str = str.substr(1);
+
+ if (DECIMAL_NUMBER$1.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 10));
+ }
+ }
+ } else {
+ entity = entities$1[str];
+ }
+
+ break;
+ }
+
+ str += ch;
+ }
+
+ if (!entity) {
+ this.state.pos = startPos;
+ return "&";
+ }
+
+ return entity;
+ }
+
+ jsxReadWord() {
+ let ch;
+ const start = this.state.pos;
+
+ do {
+ ch = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar$1(ch) || ch === 45);
+
+ return this.finishToken(types$4.jsxName, this.input.slice(start, this.state.pos));
+ }
+
+ jsxParseIdentifier() {
+ const node = this.startNode();
+
+ if (this.match(types$4.jsxName)) {
+ node.name = this.state.value;
+ } else if (this.state.type.keyword) {
+ node.name = this.state.type.keyword;
+ } else {
+ this.unexpected();
+ }
+
+ this.next();
+ return this.finishNode(node, "JSXIdentifier");
+ }
+
+ jsxParseNamespacedName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const name = this.jsxParseIdentifier();
+ if (!this.eat(types$4.colon)) return name;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.namespace = name;
+ node.name = this.jsxParseIdentifier();
+ return this.finishNode(node, "JSXNamespacedName");
+ }
+
+ jsxParseElementName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let node = this.jsxParseNamespacedName();
+
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+
+ while (this.eat(types$4.dot)) {
+ const newNode = this.startNodeAt(startPos, startLoc);
+ newNode.object = node;
+ newNode.property = this.jsxParseIdentifier();
+ node = this.finishNode(newNode, "JSXMemberExpression");
+ }
+
+ return node;
+ }
+
+ jsxParseAttributeValue() {
+ let node;
+
+ switch (this.state.type) {
+ case types$4.braceL:
+ node = this.startNode();
+ this.next();
+ node = this.jsxParseExpressionContainer(node);
+
+ if (node.expression.type === "JSXEmptyExpression") {
+ this.raise(node.start, JsxErrors$1.AttributeIsEmpty);
+ }
+
+ return node;
+
+ case types$4.jsxTagStart:
+ case types$4.string:
+ return this.parseExprAtom();
+
+ default:
+ throw this.raise(this.state.start, JsxErrors$1.UnsupportedJsxValue);
+ }
+ }
+
+ jsxParseEmptyExpression() {
+ const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
+ return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
+ }
+
+ jsxParseSpreadChild(node) {
+ this.next();
+ node.expression = this.parseExpression();
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "JSXSpreadChild");
+ }
+
+ jsxParseExpressionContainer(node) {
+ if (this.match(types$4.braceR)) {
+ node.expression = this.jsxParseEmptyExpression();
+ } else {
+ node.expression = this.parseExpression();
+ }
+
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "JSXExpressionContainer");
+ }
+
+ jsxParseAttribute() {
+ const node = this.startNode();
+
+ if (this.eat(types$4.braceL)) {
+ this.expect(types$4.ellipsis);
+ node.argument = this.parseMaybeAssign();
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "JSXSpreadAttribute");
+ }
+
+ node.name = this.jsxParseNamespacedName();
+ node.value = this.eat(types$4.eq) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(node, "JSXAttribute");
+ }
+
+ jsxParseOpeningElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(types$4.jsxTagEnd)) {
+ this.expect(types$4.jsxTagEnd);
+ return this.finishNode(node, "JSXOpeningFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(node);
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ const attributes = [];
+
+ while (!this.match(types$4.slash) && !this.match(types$4.jsxTagEnd)) {
+ attributes.push(this.jsxParseAttribute());
+ }
+
+ node.attributes = attributes;
+ node.selfClosing = this.eat(types$4.slash);
+ this.expect(types$4.jsxTagEnd);
+ return this.finishNode(node, "JSXOpeningElement");
+ }
+
+ jsxParseClosingElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(types$4.jsxTagEnd)) {
+ this.expect(types$4.jsxTagEnd);
+ return this.finishNode(node, "JSXClosingFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ this.expect(types$4.jsxTagEnd);
+ return this.finishNode(node, "JSXClosingElement");
+ }
+
+ jsxParseElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const children = [];
+ const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
+ let closingElement = null;
+
+ if (!openingElement.selfClosing) {
+ contents: for (;;) {
+ switch (this.state.type) {
+ case types$4.jsxTagStart:
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ this.next();
+
+ if (this.eat(types$4.slash)) {
+ closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
+ break contents;
+ }
+
+ children.push(this.jsxParseElementAt(startPos, startLoc));
+ break;
+
+ case types$4.jsxText:
+ children.push(this.parseExprAtom());
+ break;
+
+ case types$4.braceL:
+ {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(types$4.ellipsis)) {
+ children.push(this.jsxParseSpreadChild(node));
+ } else {
+ children.push(this.jsxParseExpressionContainer(node));
+ }
+
+ break;
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ if (isFragment$1(openingElement) && !isFragment$1(closingElement)) {
+ this.raise(closingElement.start, JsxErrors$1.MissingClosingTagFragment);
+ } else if (!isFragment$1(openingElement) && isFragment$1(closingElement)) {
+ this.raise(closingElement.start, JsxErrors$1.MissingClosingTagElement, getQualifiedJSXName$1(openingElement.name));
+ } else if (!isFragment$1(openingElement) && !isFragment$1(closingElement)) {
+ if (getQualifiedJSXName$1(closingElement.name) !== getQualifiedJSXName$1(openingElement.name)) {
+ this.raise(closingElement.start, JsxErrors$1.MissingClosingTagElement, getQualifiedJSXName$1(openingElement.name));
+ }
+ }
+ }
+
+ if (isFragment$1(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+
+ node.children = children;
+
+ if (this.isRelational("<")) {
+ throw this.raise(this.state.start, JsxErrors$1.UnwrappedAdjacentJSXElements);
+ }
+
+ return isFragment$1(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
+ }
+
+ jsxParseElement() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(startPos, startLoc);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.match(types$4.jsxText)) {
+ return this.parseLiteral(this.state.value, "JSXText");
+ } else if (this.match(types$4.jsxTagStart)) {
+ return this.jsxParseElement();
+ } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) {
+ this.finishToken(types$4.jsxTagStart);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inPropertyName) return super.getTokenFromCode(code);
+ const context = this.curContext();
+
+ if (context === types$1$1.j_expr) {
+ return this.jsxReadToken();
+ }
+
+ if (context === types$1$1.j_oTag || context === types$1$1.j_cTag) {
+ if (isIdentifierStart$1(code)) {
+ return this.jsxReadWord();
+ }
+
+ if (code === 62) {
+ ++this.state.pos;
+ return this.finishToken(types$4.jsxTagEnd);
+ }
+
+ if ((code === 34 || code === 39) && context === types$1$1.j_oTag) {
+ return this.jsxReadString(code);
+ }
+ }
+
+ if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {
+ ++this.state.pos;
+ return this.finishToken(types$4.jsxTagStart);
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ updateContext(prevType) {
+ if (this.match(types$4.braceL)) {
+ const curContext = this.curContext();
+
+ if (curContext === types$1$1.j_oTag) {
+ this.state.context.push(types$1$1.braceExpression);
+ } else if (curContext === types$1$1.j_expr) {
+ this.state.context.push(types$1$1.templateQuasi);
+ } else {
+ super.updateContext(prevType);
+ }
+
+ this.state.exprAllowed = true;
+ } else if (this.match(types$4.slash) && prevType === types$4.jsxTagStart) {
+ this.state.context.length -= 2;
+ this.state.context.push(types$1$1.j_cTag);
+ this.state.exprAllowed = false;
+ } else {
+ return super.updateContext(prevType);
+ }
+ }
+
+ });
+
+ let Scope$1 = class Scope {
+ constructor(flags) {
+ this.var = [];
+ this.lexical = [];
+ this.functions = [];
+ this.flags = flags;
+ }
+
+ };
+ let ScopeHandler$1 = class ScopeHandler {
+ constructor(raise, inModule) {
+ this.scopeStack = [];
+ this.undefinedExports = new Map();
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ this.inModule = inModule;
+ }
+
+ get inFunction() {
+ return (this.currentVarScope().flags & SCOPE_FUNCTION$1) > 0;
+ }
+
+ get allowSuper() {
+ return (this.currentThisScope().flags & SCOPE_SUPER$1) > 0;
+ }
+
+ get allowDirectSuper() {
+ return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER$1) > 0;
+ }
+
+ get inClass() {
+ return (this.currentThisScope().flags & SCOPE_CLASS$1) > 0;
+ }
+
+ get inNonArrowFunction() {
+ return (this.currentThisScope().flags & SCOPE_FUNCTION$1) > 0;
+ }
+
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+
+ createScope(flags) {
+ return new Scope$1(flags);
+ }
+
+ enter(flags) {
+ this.scopeStack.push(this.createScope(flags));
+ }
+
+ exit() {
+ this.scopeStack.pop();
+ }
+
+ treatFunctionsAsVarInScope(scope) {
+ return !!(scope.flags & SCOPE_FUNCTION$1 || !this.inModule && scope.flags & SCOPE_PROGRAM$1);
+ }
+
+ declareName(name, bindingType, pos) {
+ let scope = this.currentScope();
+
+ if (bindingType & BIND_SCOPE_LEXICAL$1 || bindingType & BIND_SCOPE_FUNCTION$1) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+
+ if (bindingType & BIND_SCOPE_FUNCTION$1) {
+ scope.functions.push(name);
+ } else {
+ scope.lexical.push(name);
+ }
+
+ if (bindingType & BIND_SCOPE_LEXICAL$1) {
+ this.maybeExportDefined(scope, name);
+ }
+ } else if (bindingType & BIND_SCOPE_VAR$1) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ scope = this.scopeStack[i];
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ scope.var.push(name);
+ this.maybeExportDefined(scope, name);
+ if (scope.flags & SCOPE_VAR$1) break;
+ }
+ }
+
+ if (this.inModule && scope.flags & SCOPE_PROGRAM$1) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ maybeExportDefined(scope, name) {
+ if (this.inModule && scope.flags & SCOPE_PROGRAM$1) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ checkRedeclarationInScope(scope, name, bindingType, pos) {
+ if (this.isRedeclaredInScope(scope, name, bindingType)) {
+ this.raise(pos, ErrorMessages$1.VarRedeclaration, name);
+ }
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (!(bindingType & BIND_KIND_VALUE$1)) return false;
+
+ if (bindingType & BIND_SCOPE_LEXICAL$1) {
+ return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
+ }
+
+ if (bindingType & BIND_SCOPE_FUNCTION$1) {
+ return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope.var.indexOf(name) > -1;
+ }
+
+ return scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH$1 && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1;
+ }
+
+ checkLocalExport(id) {
+ if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) {
+ this.undefinedExports.set(id.name, id.start);
+ }
+ }
+
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+
+ currentVarScope() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const scope = this.scopeStack[i];
+
+ if (scope.flags & SCOPE_VAR$1) {
+ return scope;
+ }
+ }
+ }
+
+ currentThisScope() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const scope = this.scopeStack[i];
+
+ if ((scope.flags & SCOPE_VAR$1 || scope.flags & SCOPE_CLASS$1) && !(scope.flags & SCOPE_ARROW$1)) {
+ return scope;
+ }
+ }
+ }
+
+ };
+
+ let TypeScriptScope$1 = class TypeScriptScope extends Scope$1 {
+ constructor(...args) {
+ super(...args);
+ this.types = [];
+ this.enums = [];
+ this.constEnums = [];
+ this.classes = [];
+ this.exportOnlyBindings = [];
+ }
+
+ };
+
+ let TypeScriptScopeHandler$1 = class TypeScriptScopeHandler extends ScopeHandler$1 {
+ createScope(flags) {
+ return new TypeScriptScope$1(flags);
+ }
+
+ declareName(name, bindingType, pos) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY$1) {
+ this.maybeExportDefined(scope, name);
+ scope.exportOnlyBindings.push(name);
+ return;
+ }
+
+ super.declareName(...arguments);
+
+ if (bindingType & BIND_KIND_TYPE$1) {
+ if (!(bindingType & BIND_KIND_VALUE$1)) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ this.maybeExportDefined(scope, name);
+ }
+
+ scope.types.push(name);
+ }
+
+ if (bindingType & BIND_FLAGS_TS_ENUM$1) scope.enums.push(name);
+ if (bindingType & BIND_FLAGS_TS_CONST_ENUM$1) scope.constEnums.push(name);
+ if (bindingType & BIND_FLAGS_CLASS$1) scope.classes.push(name);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (scope.enums.indexOf(name) > -1) {
+ if (bindingType & BIND_FLAGS_TS_ENUM$1) {
+ const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM$1);
+ const wasConst = scope.constEnums.indexOf(name) > -1;
+ return isConst !== wasConst;
+ }
+
+ return true;
+ }
+
+ if (bindingType & BIND_FLAGS_CLASS$1 && scope.classes.indexOf(name) > -1) {
+ if (scope.lexical.indexOf(name) > -1) {
+ return !!(bindingType & BIND_KIND_VALUE$1);
+ } else {
+ return false;
+ }
+ }
+
+ if (bindingType & BIND_KIND_TYPE$1 && scope.types.indexOf(name) > -1) {
+ return true;
+ }
+
+ return super.isRedeclaredInScope(...arguments);
+ }
+
+ checkLocalExport(id) {
+ if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) {
+ super.checkLocalExport(id);
+ }
+ }
+
+ };
+
+ const PARAM$1 = 0b000,
+ PARAM_YIELD$1 = 0b001,
+ PARAM_AWAIT$1 = 0b010,
+ PARAM_RETURN$1 = 0b100;
+ let ProductionParameterHandler$1 = class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+
+ exit() {
+ this.stacks.pop();
+ }
+
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+
+ get hasAwait() {
+ return (this.currentFlags() & PARAM_AWAIT$1) > 0;
+ }
+
+ get hasYield() {
+ return (this.currentFlags() & PARAM_YIELD$1) > 0;
+ }
+
+ get hasReturn() {
+ return (this.currentFlags() & PARAM_RETURN$1) > 0;
+ }
+
+ };
+ function functionFlags$1(isAsync, isGenerator) {
+ return (isAsync ? PARAM_AWAIT$1 : 0) | (isGenerator ? PARAM_YIELD$1 : 0);
+ }
+
+ function nonNull$1(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+
+ return x;
+ }
+
+ function assert$1(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+ }
+
+ const TSErrors$1 = Object.freeze({
+ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier",
+ ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier",
+ DeclareClassFieldHasInitializer: "'declare' class fields cannot have an initializer",
+ DuplicateModifier: "Duplicate modifier: '%0'",
+ EmptyHeritageClauseType: "'%0' list cannot be empty.",
+ IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier",
+ IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0')",
+ IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier",
+ OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0')",
+ TemplateTypeHasSubstitution: "Template literal types cannot have any substitution",
+ TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`",
+ UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
+ UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
+ UnsupportedImportTypeArgument: "Argument in a type import must be a string literal",
+ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
+ UnsupportedSignatureParameterKind: "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0"
+ });
+
+ function keywordTypeFromName$1(value) {
+ switch (value) {
+ case "any":
+ return "TSAnyKeyword";
+
+ case "boolean":
+ return "TSBooleanKeyword";
+
+ case "bigint":
+ return "TSBigIntKeyword";
+
+ case "never":
+ return "TSNeverKeyword";
+
+ case "number":
+ return "TSNumberKeyword";
+
+ case "object":
+ return "TSObjectKeyword";
+
+ case "string":
+ return "TSStringKeyword";
+
+ case "symbol":
+ return "TSSymbolKeyword";
+
+ case "undefined":
+ return "TSUndefinedKeyword";
+
+ case "unknown":
+ return "TSUnknownKeyword";
+
+ default:
+ return undefined;
+ }
+ }
+
+ var typescript$2 = (superClass => class extends superClass {
+ getScopeHandler() {
+ return TypeScriptScopeHandler$1;
+ }
+
+ tsIsIdentifier() {
+ return this.match(types$4.name);
+ }
+
+ tsNextTokenCanFollowModifier() {
+ this.next();
+ return !this.hasPrecedingLineBreak() && !this.match(types$4.parenL) && !this.match(types$4.parenR) && !this.match(types$4.colon) && !this.match(types$4.eq) && !this.match(types$4.question) && !this.match(types$4.bang);
+ }
+
+ tsParseModifier(allowedModifiers) {
+ if (!this.match(types$4.name)) {
+ return undefined;
+ }
+
+ const modifier = this.state.value;
+
+ if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
+ return modifier;
+ }
+
+ return undefined;
+ }
+
+ tsParseModifiers(modified, allowedModifiers) {
+ for (;;) {
+ const startPos = this.state.start;
+ const modifier = this.tsParseModifier(allowedModifiers);
+ if (!modifier) break;
+
+ if (Object.hasOwnProperty.call(modified, modifier)) {
+ this.raise(startPos, TSErrors$1.DuplicateModifier, modifier);
+ }
+
+ modified[modifier] = true;
+ }
+ }
+
+ tsIsListTerminator(kind) {
+ switch (kind) {
+ case "EnumMembers":
+ case "TypeMembers":
+ return this.match(types$4.braceR);
+
+ case "HeritageClauseElement":
+ return this.match(types$4.braceL);
+
+ case "TupleElementTypes":
+ return this.match(types$4.bracketR);
+
+ case "TypeParametersOrArguments":
+ return this.isRelational(">");
+ }
+
+ throw new Error("Unreachable");
+ }
+
+ tsParseList(kind, parseElement) {
+ const result = [];
+
+ while (!this.tsIsListTerminator(kind)) {
+ result.push(parseElement());
+ }
+
+ return result;
+ }
+
+ tsParseDelimitedList(kind, parseElement) {
+ return nonNull$1(this.tsParseDelimitedListWorker(kind, parseElement, true));
+ }
+
+ tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {
+ const result = [];
+
+ for (;;) {
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ const element = parseElement();
+
+ if (element == null) {
+ return undefined;
+ }
+
+ result.push(element);
+
+ if (this.eat(types$4.comma)) {
+ continue;
+ }
+
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ if (expectSuccess) {
+ this.expect(types$4.comma);
+ }
+
+ return undefined;
+ }
+
+ return result;
+ }
+
+ tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {
+ if (!skipFirstToken) {
+ if (bracket) {
+ this.expect(types$4.bracketL);
+ } else {
+ this.expectRelational("<");
+ }
+ }
+
+ const result = this.tsParseDelimitedList(kind, parseElement);
+
+ if (bracket) {
+ this.expect(types$4.bracketR);
+ } else {
+ this.expectRelational(">");
+ }
+
+ return result;
+ }
+
+ tsParseImportType() {
+ const node = this.startNode();
+ this.expect(types$4._import);
+ this.expect(types$4.parenL);
+
+ if (!this.match(types$4.string)) {
+ this.raise(this.state.start, TSErrors$1.UnsupportedImportTypeArgument);
+ }
+
+ node.argument = this.parseExprAtom();
+ this.expect(types$4.parenR);
+
+ if (this.eat(types$4.dot)) {
+ node.qualifier = this.tsParseEntityName(true);
+ }
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSImportType");
+ }
+
+ tsParseEntityName(allowReservedWords) {
+ let entity = this.parseIdentifier();
+
+ while (this.eat(types$4.dot)) {
+ const node = this.startNodeAtNode(entity);
+ node.left = entity;
+ node.right = this.parseIdentifier(allowReservedWords);
+ entity = this.finishNode(node, "TSQualifiedName");
+ }
+
+ return entity;
+ }
+
+ tsParseTypeReference() {
+ const node = this.startNode();
+ node.typeName = this.tsParseEntityName(false);
+
+ if (!this.hasPrecedingLineBreak() && this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSTypeReference");
+ }
+
+ tsParseThisTypePredicate(lhs) {
+ this.next();
+ const node = this.startNodeAtNode(lhs);
+ node.parameterName = lhs;
+ node.typeAnnotation = this.tsParseTypeAnnotation(false);
+ return this.finishNode(node, "TSTypePredicate");
+ }
+
+ tsParseThisTypeNode() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSThisType");
+ }
+
+ tsParseTypeQuery() {
+ const node = this.startNode();
+ this.expect(types$4._typeof);
+
+ if (this.match(types$4._import)) {
+ node.exprName = this.tsParseImportType();
+ } else {
+ node.exprName = this.tsParseEntityName(true);
+ }
+
+ return this.finishNode(node, "TSTypeQuery");
+ }
+
+ tsParseTypeParameter() {
+ const node = this.startNode();
+ node.name = this.parseIdentifierName(node.start);
+ node.constraint = this.tsEatThenParseType(types$4._extends);
+ node.default = this.tsEatThenParseType(types$4.eq);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsTryParseTypeParameters() {
+ if (this.isRelational("<")) {
+ return this.tsParseTypeParameters();
+ }
+ }
+
+ tsParseTypeParameters() {
+ const node = this.startNode();
+
+ if (this.isRelational("<") || this.match(types$4.jsxTagStart)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true);
+ return this.finishNode(node, "TSTypeParameterDeclaration");
+ }
+
+ tsTryNextParseConstantContext() {
+ if (this.lookahead().type === types$4._const) {
+ this.next();
+ return this.tsParseTypeReference();
+ }
+
+ return null;
+ }
+
+ tsFillSignature(returnToken, signature) {
+ const returnTokenRequired = returnToken === types$4.arrow;
+ signature.typeParameters = this.tsTryParseTypeParameters();
+ this.expect(types$4.parenL);
+ signature.parameters = this.tsParseBindingListForSignature();
+
+ if (returnTokenRequired) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ } else if (this.match(returnToken)) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ }
+ }
+
+ tsParseBindingListForSignature() {
+ return this.parseBindingList(types$4.parenR, 41).map(pattern => {
+ if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
+ this.raise(pattern.start, TSErrors$1.UnsupportedSignatureParameterKind, pattern.type);
+ }
+
+ return pattern;
+ });
+ }
+
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(types$4.comma)) {
+ this.semicolon();
+ }
+ }
+
+ tsParseSignatureMember(kind, node) {
+ this.tsFillSignature(types$4.colon, node);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, kind);
+ }
+
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+ return this.eat(types$4.name) && this.match(types$4.colon);
+ }
+
+ tsTryParseIndexSignature(node) {
+ if (!(this.match(types$4.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
+ return undefined;
+ }
+
+ this.expect(types$4.bracketL);
+ const id = this.parseIdentifier();
+ id.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(id);
+ this.expect(types$4.bracketR);
+ node.parameters = [id];
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, "TSIndexSignature");
+ }
+
+ tsParsePropertyOrMethodSignature(node, readonly) {
+ if (this.eat(types$4.question)) node.optional = true;
+ const nodeAny = node;
+
+ if (!readonly && (this.match(types$4.parenL) || this.isRelational("<"))) {
+ const method = nodeAny;
+ this.tsFillSignature(types$4.colon, method);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(method, "TSMethodSignature");
+ } else {
+ const property = nodeAny;
+ if (readonly) property.readonly = true;
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) property.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(property, "TSPropertySignature");
+ }
+ }
+
+ tsParseTypeMember() {
+ const node = this.startNode();
+
+ if (this.match(types$4.parenL) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
+ }
+
+ if (this.match(types$4._new)) {
+ const id = this.startNode();
+ this.next();
+
+ if (this.match(types$4.parenL) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
+ } else {
+ node.key = this.createIdentifier(id, "new");
+ return this.tsParsePropertyOrMethodSignature(node, false);
+ }
+ }
+
+ const readonly = !!this.tsParseModifier(["readonly"]);
+ const idx = this.tsTryParseIndexSignature(node);
+
+ if (idx) {
+ if (readonly) node.readonly = true;
+ return idx;
+ }
+
+ this.parsePropertyName(node, false);
+ return this.tsParsePropertyOrMethodSignature(node, readonly);
+ }
+
+ tsParseTypeLiteral() {
+ const node = this.startNode();
+ node.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(node, "TSTypeLiteral");
+ }
+
+ tsParseObjectTypeMembers() {
+ this.expect(types$4.braceL);
+ const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
+ this.expect(types$4.braceR);
+ return members;
+ }
+
+ tsIsStartOfMappedType() {
+ this.next();
+
+ if (this.eat(types$4.plusMin)) {
+ return this.isContextual("readonly");
+ }
+
+ if (this.isContextual("readonly")) {
+ this.next();
+ }
+
+ if (!this.match(types$4.bracketL)) {
+ return false;
+ }
+
+ this.next();
+
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+
+ this.next();
+ return this.match(types$4._in);
+ }
+
+ tsParseMappedTypeParameter() {
+ const node = this.startNode();
+ node.name = this.parseIdentifierName(node.start);
+ node.constraint = this.tsExpectThenParseType(types$4._in);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsParseMappedType() {
+ const node = this.startNode();
+ this.expect(types$4.braceL);
+
+ if (this.match(types$4.plusMin)) {
+ node.readonly = this.state.value;
+ this.next();
+ this.expectContextual("readonly");
+ } else if (this.eatContextual("readonly")) {
+ node.readonly = true;
+ }
+
+ this.expect(types$4.bracketL);
+ node.typeParameter = this.tsParseMappedTypeParameter();
+ this.expect(types$4.bracketR);
+
+ if (this.match(types$4.plusMin)) {
+ node.optional = this.state.value;
+ this.next();
+ this.expect(types$4.question);
+ } else if (this.eat(types$4.question)) {
+ node.optional = true;
+ }
+
+ node.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "TSMappedType");
+ }
+
+ tsParseTupleType() {
+ const node = this.startNode();
+ node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
+ let seenOptionalElement = false;
+ node.elementTypes.forEach(elementNode => {
+ if (elementNode.type === "TSOptionalType") {
+ seenOptionalElement = true;
+ } else if (seenOptionalElement && elementNode.type !== "TSRestType") {
+ this.raise(elementNode.start, TSErrors$1.OptionalTypeBeforeRequired);
+ }
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+
+ tsParseTupleElementType() {
+ if (this.match(types$4.ellipsis)) {
+ const restNode = this.startNode();
+ this.next();
+ restNode.typeAnnotation = this.tsParseType();
+
+ if (this.match(types$4.comma) && this.lookaheadCharCode() !== 93) {
+ this.raiseRestNotLast(this.state.start);
+ }
+
+ return this.finishNode(restNode, "TSRestType");
+ }
+
+ const type = this.tsParseType();
+
+ if (this.eat(types$4.question)) {
+ const optionalTypeNode = this.startNodeAtNode(type);
+ optionalTypeNode.typeAnnotation = type;
+ return this.finishNode(optionalTypeNode, "TSOptionalType");
+ }
+
+ return type;
+ }
+
+ tsParseParenthesizedType() {
+ const node = this.startNode();
+ this.expect(types$4.parenL);
+ node.typeAnnotation = this.tsParseType();
+ this.expect(types$4.parenR);
+ return this.finishNode(node, "TSParenthesizedType");
+ }
+
+ tsParseFunctionOrConstructorType(type) {
+ const node = this.startNode();
+
+ if (type === "TSConstructorType") {
+ this.expect(types$4._new);
+ }
+
+ this.tsFillSignature(types$4.arrow, node);
+ return this.finishNode(node, type);
+ }
+
+ tsParseLiteralTypeNode() {
+ const node = this.startNode();
+
+ node.literal = (() => {
+ switch (this.state.type) {
+ case types$4.num:
+ case types$4.bigint:
+ case types$4.string:
+ case types$4._true:
+ case types$4._false:
+ return this.parseExprAtom();
+
+ default:
+ throw this.unexpected();
+ }
+ })();
+
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseTemplateLiteralType() {
+ const node = this.startNode();
+ const templateNode = this.parseTemplate(false);
+
+ if (templateNode.expressions.length > 0) {
+ this.raise(templateNode.expressions[0].start, TSErrors$1.TemplateTypeHasSubstitution);
+ }
+
+ node.literal = templateNode;
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case types$4.name:
+ case types$4._void:
+ case types$4._null:
+ {
+ const type = this.match(types$4._void) ? "TSVoidKeyword" : this.match(types$4._null) ? "TSNullKeyword" : keywordTypeFromName$1(this.state.value);
+
+ if (type !== undefined && this.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ return this.tsParseTypeReference();
+ }
+
+ case types$4.string:
+ case types$4.num:
+ case types$4.bigint:
+ case types$4._true:
+ case types$4._false:
+ return this.tsParseLiteralTypeNode();
+
+ case types$4.plusMin:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+ const nextToken = this.lookahead();
+
+ if (nextToken.type !== types$4.num && nextToken.type !== types$4.bigint) {
+ throw this.unexpected();
+ }
+
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ break;
+
+ case types$4._this:
+ return this.tsParseThisTypeOrThisTypePredicate();
+
+ case types$4._typeof:
+ return this.tsParseTypeQuery();
+
+ case types$4._import:
+ return this.tsParseImportType();
+
+ case types$4.braceL:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
+
+ case types$4.bracketL:
+ return this.tsParseTupleType();
+
+ case types$4.parenL:
+ return this.tsParseParenthesizedType();
+
+ case types$4.backQuote:
+ return this.tsParseTemplateLiteralType();
+ }
+
+ throw this.unexpected();
+ }
+
+ tsParseArrayTypeOrHigher() {
+ let type = this.tsParseNonArrayType();
+
+ while (!this.hasPrecedingLineBreak() && this.eat(types$4.bracketL)) {
+ if (this.match(types$4.bracketR)) {
+ const node = this.startNodeAtNode(type);
+ node.elementType = type;
+ this.expect(types$4.bracketR);
+ type = this.finishNode(node, "TSArrayType");
+ } else {
+ const node = this.startNodeAtNode(type);
+ node.objectType = type;
+ node.indexType = this.tsParseType();
+ this.expect(types$4.bracketR);
+ type = this.finishNode(node, "TSIndexedAccessType");
+ }
+ }
+
+ return type;
+ }
+
+ tsParseTypeOperator(operator) {
+ const node = this.startNode();
+ this.expectContextual(operator);
+ node.operator = operator;
+ node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+
+ if (operator === "readonly") {
+ this.tsCheckTypeAnnotationForReadOnly(node);
+ }
+
+ return this.finishNode(node, "TSTypeOperator");
+ }
+
+ tsCheckTypeAnnotationForReadOnly(node) {
+ switch (node.typeAnnotation.type) {
+ case "TSTupleType":
+ case "TSArrayType":
+ return;
+
+ default:
+ this.raise(node.start, TSErrors$1.UnexpectedReadonly);
+ }
+ }
+
+ tsParseInferType() {
+ const node = this.startNode();
+ this.expectContextual("infer");
+ const typeParameter = this.startNode();
+ typeParameter.name = this.parseIdentifierName(typeParameter.start);
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ return this.finishNode(node, "TSInferType");
+ }
+
+ tsParseTypeOperatorOrHigher() {
+ const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw));
+ return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
+ }
+
+ tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
+ this.eat(operator);
+ let type = parseConstituentType();
+
+ if (this.match(operator)) {
+ const types = [type];
+
+ while (this.eat(operator)) {
+ types.push(parseConstituentType());
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.types = types;
+ type = this.finishNode(node, kind);
+ }
+
+ return type;
+ }
+
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), types$4.bitwiseAND);
+ }
+
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), types$4.bitwiseOR);
+ }
+
+ tsIsStartOfFunctionType() {
+ if (this.isRelational("<")) {
+ return true;
+ }
+
+ return this.match(types$4.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
+ }
+
+ tsSkipParameterStart() {
+ if (this.match(types$4.name) || this.match(types$4._this)) {
+ this.next();
+ return true;
+ }
+
+ if (this.match(types$4.braceL)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(types$4.braceL)) {
+ ++braceStackCounter;
+ } else if (this.match(types$4.braceR)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ if (this.match(types$4.bracketL)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(types$4.bracketL)) {
+ ++braceStackCounter;
+ } else if (this.match(types$4.bracketR)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+
+ if (this.match(types$4.parenR) || this.match(types$4.ellipsis)) {
+ return true;
+ }
+
+ if (this.tsSkipParameterStart()) {
+ if (this.match(types$4.colon) || this.match(types$4.comma) || this.match(types$4.question) || this.match(types$4.eq)) {
+ return true;
+ }
+
+ if (this.match(types$4.parenR)) {
+ this.next();
+
+ if (this.match(types$4.arrow)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ tsParseTypeOrTypePredicateAnnotation(returnToken) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(returnToken);
+ const asserts = this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+
+ if (asserts && this.match(types$4._this)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+
+ if (thisTypePredicate.type === "TSThisType") {
+ const node = this.startNodeAtNode(t);
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ thisTypePredicate.asserts = true;
+ }
+
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+
+ const node = this.startNodeAtNode(t);
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const type = this.tsParseTypeAnnotation(false);
+ const node = this.startNodeAtNode(t);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ });
+ }
+
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ return this.match(types$4.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types$4.colon) : undefined;
+ }
+
+ tsTryParseTypeAnnotation() {
+ return this.match(types$4.colon) ? this.tsParseTypeAnnotation() : undefined;
+ }
+
+ tsTryParseType() {
+ return this.tsEatThenParseType(types$4.colon);
+ }
+
+ tsParseTypePredicatePrefix() {
+ const id = this.parseIdentifier();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return id;
+ }
+ }
+
+ tsParseTypePredicateAsserts() {
+ if (!this.match(types$4.name) || this.state.value !== "asserts" || this.hasPrecedingLineBreak()) {
+ return false;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.next();
+
+ if (!this.match(types$4.name) && !this.match(types$4._this)) {
+ return false;
+ }
+
+ if (containsEsc) {
+ this.raise(this.state.lastTokStart, ErrorMessages$1.InvalidEscapedReservedWord, "asserts");
+ }
+
+ return true;
+ }
+
+ tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (eatColon) this.expect(types$4.colon);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ tsParseType() {
+ assert$1(this.state.inType);
+ const type = this.tsParseNonConditionalType();
+
+ if (this.hasPrecedingLineBreak() || !this.eat(types$4._extends)) {
+ return type;
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.checkType = type;
+ node.extendsType = this.tsParseNonConditionalType();
+ this.expect(types$4.question);
+ node.trueType = this.tsParseType();
+ this.expect(types$4.colon);
+ node.falseType = this.tsParseType();
+ return this.finishNode(node, "TSConditionalType");
+ }
+
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType("TSFunctionType");
+ }
+
+ if (this.match(types$4._new)) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType");
+ }
+
+ return this.tsParseUnionTypeOrHigher();
+ }
+
+ tsParseTypeAssertion() {
+ const node = this.startNode();
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ node.typeAnnotation = _const || this.tsNextThenParseType();
+ this.expectRelational(">");
+ node.expression = this.parseMaybeUnary();
+ return this.finishNode(node, "TSTypeAssertion");
+ }
+
+ tsParseHeritageClause(descriptor) {
+ const originalStart = this.state.start;
+ const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this));
+
+ if (!delimitedList.length) {
+ this.raise(originalStart, TSErrors$1.EmptyHeritageClauseType, descriptor);
+ }
+
+ return delimitedList;
+ }
+
+ tsParseExpressionWithTypeArguments() {
+ const node = this.startNode();
+ node.expression = this.tsParseEntityName(false);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSExpressionWithTypeArguments");
+ }
+
+ tsParseInterfaceDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_TS_INTERFACE$1, undefined, "typescript interface declaration");
+ node.typeParameters = this.tsTryParseTypeParameters();
+
+ if (this.eat(types$4._extends)) {
+ node.extends = this.tsParseHeritageClause("extends");
+ }
+
+ const body = this.startNode();
+ body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ node.body = this.finishNode(body, "TSInterfaceBody");
+ return this.finishNode(node, "TSInterfaceDeclaration");
+ }
+
+ tsParseTypeAliasDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_TS_TYPE$1, undefined, "typescript type alias");
+ node.typeParameters = this.tsTryParseTypeParameters();
+ node.typeAnnotation = this.tsExpectThenParseType(types$4.eq);
+ this.semicolon();
+ return this.finishNode(node, "TSTypeAliasDeclaration");
+ }
+
+ tsInNoContext(cb) {
+ const oldContext = this.state.context;
+ this.state.context = [oldContext[0]];
+
+ try {
+ return cb();
+ } finally {
+ this.state.context = oldContext;
+ }
+ }
+
+ tsInType(cb) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inType = oldInType;
+ }
+ }
+
+ tsEatThenParseType(token) {
+ return !this.match(token) ? undefined : this.tsNextThenParseType();
+ }
+
+ tsExpectThenParseType(token) {
+ return this.tsDoThenParseType(() => this.expect(token));
+ }
+
+ tsNextThenParseType() {
+ return this.tsDoThenParseType(() => this.next());
+ }
+
+ tsDoThenParseType(cb) {
+ return this.tsInType(() => {
+ cb();
+ return this.tsParseType();
+ });
+ }
+
+ tsParseEnumMember() {
+ const node = this.startNode();
+ node.id = this.match(types$4.string) ? this.parseExprAtom() : this.parseIdentifier(true);
+
+ if (this.eat(types$4.eq)) {
+ node.initializer = this.parseMaybeAssign();
+ }
+
+ return this.finishNode(node, "TSEnumMember");
+ }
+
+ tsParseEnumDeclaration(node, isConst) {
+ if (isConst) node.const = true;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM$1 : BIND_TS_ENUM$1, undefined, "typescript enum declaration");
+ this.expect(types$4.braceL);
+ node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
+ this.expect(types$4.braceR);
+ return this.finishNode(node, "TSEnumDeclaration");
+ }
+
+ tsParseModuleBlock() {
+ const node = this.startNode();
+ this.scope.enter(SCOPE_OTHER$1);
+ this.expect(types$4.braceL);
+ this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types$4.braceR);
+ this.scope.exit();
+ return this.finishNode(node, "TSModuleBlock");
+ }
+
+ tsParseModuleOrNamespaceDeclaration(node, nested = false) {
+ node.id = this.parseIdentifier();
+
+ if (!nested) {
+ this.checkLVal(node.id, BIND_TS_NAMESPACE$1, null, "module or namespace declaration");
+ }
+
+ if (this.eat(types$4.dot)) {
+ const inner = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(inner, true);
+ node.body = inner;
+ } else {
+ this.scope.enter(SCOPE_TS_MODULE$1);
+ this.prodParam.enter(PARAM$1);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseAmbientExternalModuleDeclaration(node) {
+ if (this.isContextual("global")) {
+ node.global = true;
+ node.id = this.parseIdentifier();
+ } else if (this.match(types$4.string)) {
+ node.id = this.parseExprAtom();
+ } else {
+ this.unexpected();
+ }
+
+ if (this.match(types$4.braceL)) {
+ this.scope.enter(SCOPE_TS_MODULE$1);
+ this.prodParam.enter(PARAM$1);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseImportEqualsDeclaration(node, isExport) {
+ node.isExport = isExport || false;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_LEXICAL$1, undefined, "import equals declaration");
+ this.expect(types$4.eq);
+ node.moduleReference = this.tsParseModuleReference();
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+
+ tsIsExternalModuleReference() {
+ return this.isContextual("require") && this.lookaheadCharCode() === 40;
+ }
+
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
+ }
+
+ tsParseExternalModuleReference() {
+ const node = this.startNode();
+ this.expectContextual("require");
+ this.expect(types$4.parenL);
+
+ if (!this.match(types$4.string)) {
+ throw this.unexpected();
+ }
+
+ node.expression = this.parseExprAtom();
+ this.expect(types$4.parenR);
+ return this.finishNode(node, "TSExternalModuleReference");
+ }
+
+ tsLookAhead(f) {
+ const state = this.state.clone();
+ const res = f();
+ this.state = state;
+ return res;
+ }
+
+ tsTryParseAndCatch(f) {
+ const result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ tsTryParse(f) {
+ const state = this.state.clone();
+ const result = f();
+
+ if (result !== undefined && result !== false) {
+ return result;
+ } else {
+ this.state = state;
+ return undefined;
+ }
+ }
+
+ tsTryParseDeclare(nany) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+
+ let starttype = this.state.type;
+ let kind;
+
+ if (this.isContextual("let")) {
+ starttype = types$4._var;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case types$4._function:
+ return this.parseFunctionStatement(nany, false, true);
+
+ case types$4._class:
+ nany.declare = true;
+ return this.parseClass(nany, true, false);
+
+ case types$4._const:
+ if (this.match(types$4._const) && this.isLookaheadContextual("enum")) {
+ this.expect(types$4._const);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(nany, true);
+ }
+
+ case types$4._var:
+ kind = kind || this.state.value;
+ return this.parseVarStatement(nany, kind);
+
+ case types$4.name:
+ {
+ const value = this.state.value;
+
+ if (value === "global") {
+ return this.tsParseAmbientExternalModuleDeclaration(nany);
+ } else {
+ return this.tsParseDeclaration(nany, value, true);
+ }
+ }
+ }
+ }
+
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ }
+
+ tsParseExpressionStatement(node, expr) {
+ switch (expr.name) {
+ case "declare":
+ {
+ const declaration = this.tsTryParseDeclare(node);
+
+ if (declaration) {
+ declaration.declare = true;
+ return declaration;
+ }
+
+ break;
+ }
+
+ case "global":
+ if (this.match(types$4.braceL)) {
+ this.scope.enter(SCOPE_TS_MODULE$1);
+ this.prodParam.enter(PARAM$1);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(mod, "TSModuleDeclaration");
+ }
+
+ break;
+
+ default:
+ return this.tsParseDeclaration(node, expr.name, false);
+ }
+ }
+
+ tsParseDeclaration(node, value, next) {
+ switch (value) {
+ case "abstract":
+ if (this.tsCheckLineTerminatorAndMatch(types$4._class, next)) {
+ const cls = node;
+ cls.abstract = true;
+
+ if (next) {
+ this.next();
+
+ if (!this.match(types$4._class)) {
+ this.unexpected(null, types$4._class);
+ }
+ }
+
+ return this.parseClass(cls, true, false);
+ }
+
+ break;
+
+ case "enum":
+ if (next || this.match(types$4.name)) {
+ if (next) this.next();
+ return this.tsParseEnumDeclaration(node, false);
+ }
+
+ break;
+
+ case "interface":
+ if (this.tsCheckLineTerminatorAndMatch(types$4.name, next)) {
+ if (next) this.next();
+ return this.tsParseInterfaceDeclaration(node);
+ }
+
+ break;
+
+ case "module":
+ if (next) this.next();
+
+ if (this.match(types$4.string)) {
+ return this.tsParseAmbientExternalModuleDeclaration(node);
+ } else if (this.tsCheckLineTerminatorAndMatch(types$4.name, next)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "namespace":
+ if (this.tsCheckLineTerminatorAndMatch(types$4.name, next)) {
+ if (next) this.next();
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "type":
+ if (this.tsCheckLineTerminatorAndMatch(types$4.name, next)) {
+ if (next) this.next();
+ return this.tsParseTypeAliasDeclaration(node);
+ }
+
+ break;
+ }
+ }
+
+ tsCheckLineTerminatorAndMatch(tokenType, next) {
+ return (next || this.match(tokenType)) && !this.isLineTerminator();
+ }
+
+ tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
+ if (!this.isRelational("<")) {
+ return undefined;
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ const res = this.tsTryParseAndCatch(() => {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = this.tsParseTypeParameters();
+ super.parseFunctionParams(node);
+ node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(types$4.arrow);
+ return node;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+
+ if (!res) {
+ return undefined;
+ }
+
+ return this.parseArrowExpression(res, null, true);
+ }
+
+ tsParseTypeArguments() {
+ const node = this.startNode();
+ node.params = this.tsInType(() => this.tsInNoContext(() => {
+ this.expectRelational("<");
+ return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
+ }));
+ this.state.exprAllowed = false;
+ this.expectRelational(">");
+ return this.finishNode(node, "TSTypeParameterInstantiation");
+ }
+
+ tsIsDeclarationStart() {
+ if (this.match(types$4.name)) {
+ switch (this.state.value) {
+ case "abstract":
+ case "declare":
+ case "enum":
+ case "interface":
+ case "module":
+ case "namespace":
+ case "type":
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let accessibility;
+ let readonly = false;
+
+ if (allowModifiers) {
+ accessibility = this.parseAccessModifier();
+ readonly = !!this.tsParseModifier(["readonly"]);
+ }
+
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (accessibility || readonly) {
+ const pp = this.startNodeAt(startPos, startLoc);
+
+ if (decorators.length) {
+ pp.decorators = decorators;
+ }
+
+ if (accessibility) pp.accessibility = accessibility;
+ if (readonly) pp.readonly = readonly;
+
+ if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
+ this.raise(pp.start, TSErrors$1.UnsupportedParameterPropertyKind);
+ }
+
+ pp.parameter = elt;
+ return this.finishNode(pp, "TSParameterProperty");
+ }
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(types$4.colon)) {
+ node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types$4.colon);
+ }
+
+ const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined;
+
+ if (bodilessType && !this.match(types$4.braceL) && this.isLineTerminator()) {
+ this.finishNode(node, bodilessType);
+ return;
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkLVal(node.id, BIND_TS_AMBIENT$1, null, "function name");
+ } else {
+ super.registerFunctionStatementId(...arguments);
+ }
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!this.hasPrecedingLineBreak() && this.match(types$4.bang)) {
+ this.state.exprAllowed = false;
+ this.next();
+ const nonNullExpression = this.startNodeAt(startPos, startLoc);
+ nonNullExpression.expression = base;
+ return this.finishNode(nonNullExpression, "TSNonNullExpression");
+ }
+
+ if (this.isRelational("<")) {
+ const result = this.tsTryParseAndCatch(() => {
+ if (!noCalls && this.atPossibleAsyncArrow(base)) {
+ const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
+
+ if (asyncArrowFn) {
+ return asyncArrowFn;
+ }
+ }
+
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (typeArguments) {
+ if (!noCalls && this.eat(types$4.parenL)) {
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, false);
+ node.typeParameters = typeArguments;
+ return this.finishCallExpression(node, state.optionalChainMember);
+ } else if (this.match(types$4.backQuote)) {
+ return this.parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments);
+ }
+ }
+
+ this.unexpected();
+ });
+ if (result) return result;
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, state);
+ }
+
+ parseNewArguments(node) {
+ if (this.isRelational("<")) {
+ const typeParameters = this.tsTryParseAndCatch(() => {
+ const args = this.tsParseTypeArguments();
+ if (!this.match(types$4.parenL)) this.unexpected();
+ return args;
+ });
+
+ if (typeParameters) {
+ node.typeParameters = typeParameters;
+ }
+ }
+
+ super.parseNewArguments(node);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
+ if (nonNull$1(types$4._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) {
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.expression = left;
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ if (_const) {
+ node.typeAnnotation = _const;
+ } else {
+ node.typeAnnotation = this.tsNextThenParseType();
+ }
+
+ this.finishNode(node, "TSAsExpression");
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
+ }
+
+ return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn);
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {}
+
+ checkDuplicateExports() {}
+
+ parseImport(node) {
+ if (this.match(types$4.name) || this.match(types$4.star) || this.match(types$4.braceL)) {
+ const ahead = this.lookahead();
+
+ if (this.match(types$4.name) && ahead.type === types$4.eq) {
+ return this.tsParseImportEqualsDeclaration(node);
+ }
+
+ if (this.isContextual("type") && ahead.type !== types$4.comma && !(ahead.type === types$4.name && ahead.value === "from")) {
+ node.importKind = "type";
+ this.next();
+ } else {
+ node.importKind = "value";
+ }
+ }
+
+ const importNode = super.parseImport(node);
+
+ if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
+ this.raise(importNode.start, "A type-only import can specify a default import or named bindings, but not both.");
+ }
+
+ return importNode;
+ }
+
+ parseExport(node) {
+ if (this.match(types$4._import)) {
+ this.expect(types$4._import);
+ return this.tsParseImportEqualsDeclaration(node, true);
+ } else if (this.eat(types$4.eq)) {
+ const assign = node;
+ assign.expression = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(assign, "TSExportAssignment");
+ } else if (this.eatContextual("as")) {
+ const decl = node;
+ this.expectContextual("namespace");
+ decl.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(decl, "TSNamespaceExportDeclaration");
+ } else {
+ if (this.isContextual("type") && this.lookahead().type === types$4.braceL) {
+ this.next();
+ node.exportKind = "type";
+ } else {
+ node.exportKind = "value";
+ }
+
+ return super.parseExport(node);
+ }
+ }
+
+ isAbstractClass() {
+ return this.isContextual("abstract") && this.lookahead().type === types$4._class;
+ }
+
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const cls = this.startNode();
+ this.next();
+ this.parseClass(cls, true, true);
+ cls.abstract = true;
+ return cls;
+ }
+
+ if (this.state.value === "interface") {
+ const result = this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ if (result) return result;
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseStatementContent(context, topLevel) {
+ if (this.state.type === types$4._const) {
+ const ahead = this.lookahead();
+
+ if (ahead.type === types$4.name && ahead.value === "enum") {
+ const node = this.startNode();
+ this.expect(types$4._const);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(node, true);
+ }
+ }
+
+ return super.parseStatementContent(context, topLevel);
+ }
+
+ parseAccessModifier() {
+ return this.tsParseModifier(["public", "protected", "private"]);
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ this.tsParseModifiers(member, ["declare"]);
+ const accessibility = this.parseAccessModifier();
+ if (accessibility) member.accessibility = accessibility;
+ this.tsParseModifiers(member, ["declare"]);
+ super.parseClassMember(classBody, member, state, constructorAllowsSuper);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
+ this.tsParseModifiers(member, ["abstract", "readonly", "declare"]);
+ const idx = this.tsTryParseIndexSignature(member);
+
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (member.abstract) {
+ this.raise(member.start, TSErrors$1.IndexSignatureHasAbstract);
+ }
+
+ if (isStatic) {
+ this.raise(member.start, TSErrors$1.IndexSignatureHasStatic);
+ }
+
+ if (member.accessibility) {
+ this.raise(member.start, TSErrors$1.IndexSignatureHasAccessibility, member.accessibility);
+ }
+
+ return;
+ }
+
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(types$4.question);
+ if (optional) methodOrProp.optional = true;
+
+ if (methodOrProp.readonly && this.match(types$4.parenL)) {
+ this.raise(methodOrProp.start, TSErrors$1.ClassMethodHasReadonly);
+ }
+
+ if (methodOrProp.declare && this.match(types$4.parenL)) {
+ this.raise(methodOrProp.start, TSErrors$1.ClassMethodHasDeclare);
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
+ return decl || super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (!refNeedsArrowPos || !this.match(types$4.question)) {
+ return super.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
+ }
+
+ const result = this.tryParse(() => super.parseConditional(expr, noIn, startPos, startLoc));
+
+ if (!result.node) {
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(types$4.question)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(types$4.colon)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TSTypeCastExpression");
+ }
+
+ return node;
+ }
+
+ parseExportDeclaration(node) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isDeclare = this.eatContextual("declare");
+ let declaration;
+
+ if (this.match(types$4.name)) {
+ declaration = this.tsTryParseExportDeclaration();
+ }
+
+ if (!declaration) {
+ declaration = super.parseExportDeclaration(node);
+ }
+
+ if (declaration && (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare)) {
+ node.exportKind = "type";
+ }
+
+ if (declaration && isDeclare) {
+ this.resetStartLocation(declaration, startPos, startLoc);
+ declaration.declare = true;
+ }
+
+ return declaration;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ if ((!isStatement || optionalId) && this.isContextual("implements")) {
+ return;
+ }
+
+ super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT$1 : BIND_CLASS$1);
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional && this.eat(types$4.bang)) {
+ node.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+
+ if (node.declare && this.match(types$4.equal)) {
+ this.raise(this.state.start, TSErrors$1.DeclareClassFieldHasInitializer);
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(node.start, TSErrors$1.PrivateElementHasAbstract);
+ }
+
+ if (node.accessibility) {
+ this.raise(node.start, TSErrors$1.PrivateElementHasAccessibility, node.accessibility);
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.tsParseTypeArguments();
+ }
+
+ if (this.eatContextual("implements")) {
+ node.implements = this.tsParseHeritageClause("implements");
+ }
+ }
+
+ parseObjPropValue(prop, ...args) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) prop.typeParameters = typeParameters;
+ super.parseObjPropValue(prop, ...args);
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (decl.id.type === "Identifier" && this.eat(types$4.bang)) {
+ decl.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ decl.id.typeAnnotation = type;
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(types$4.colon)) {
+ node.returnType = this.tsParseTypeAnnotation();
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ parseMaybeAssign(...args) {
+ var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;
+
+ let state;
+ let jsx;
+ let typeCast;
+
+ if (this.match(types$4.jsxTagStart)) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (!((_jsx = jsx) == null ? void 0 : _jsx.error) && !this.isRelational("<")) {
+ return super.parseMaybeAssign(...args);
+ }
+
+ let typeParameters;
+ state = state || this.state.clone();
+ const arrow = this.tryParse(abort => {
+ var _typeParameters;
+
+ typeParameters = this.tsParseTypeParameters();
+ const expr = super.parseMaybeAssign(...args);
+
+ if (expr.type !== "ArrowFunctionExpression" || expr.extra && expr.extra.parenthesized) {
+ abort();
+ }
+
+ if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+
+ if (!jsx) {
+ assert$1(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if ((_typeCast = typeCast) == null ? void 0 : _typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+
+ if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.thrown) throw typeCast.error;
+ throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (!this.hasPlugin("jsx") && this.isRelational("<")) {
+ return this.tsParseTypeAssertion();
+ } else {
+ return super.parseMaybeUnary(refExpressionErrors);
+ }
+ }
+
+ parseArrow(node) {
+ if (this.match(types$4.colon)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(types$4.colon);
+ if (this.canInsertSemicolon() || !this.match(types$4.arrow)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+
+ return super.parseArrow(node);
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(types$4.question)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, TSErrors$1.PatternIsOptional);
+ }
+
+ param.optional = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ toAssignable(node) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return super.toAssignable(this.typeCastToParameter(node));
+
+ case "TSParameterProperty":
+ return super.toAssignable(node);
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ node.expression = this.toAssignable(node.expression);
+ return node;
+
+ default:
+ return super.toAssignable(node);
+ }
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE$1, checkClashes, contextDescription) {
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ return;
+
+ case "TSParameterProperty":
+ this.checkLVal(expr.parameter, bindingType, checkClashes, "parameter property");
+ return;
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription);
+ return;
+
+ default:
+ super.checkLVal(expr, bindingType, checkClashes, contextDescription);
+ return;
+ }
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case types$4._this:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (this.match(types$4.parenL)) {
+ const call = super.parseMaybeDecoratorArguments(expr);
+ call.typeParameters = typeArguments;
+ return call;
+ }
+
+ this.unexpected(this.state.start, types$4.parenL);
+ }
+
+ return super.parseMaybeDecoratorArguments(expr);
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(types$4.bang) || this.match(types$4.colon) || super.isClassProperty();
+ }
+
+ parseMaybeDefault(...args) {
+ const node = super.parseMaybeDefault(...args);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, TSErrors$1.TypeAnnotationAfterAssign);
+ }
+
+ return node;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(types$4.relational, 1);
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ toAssignableList(exprList) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+ if (!expr) continue;
+
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ exprList[i] = this.typeCastToParameter(expr);
+ break;
+
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ if (!this.state.maybeInArrowParameters) {
+ exprList[i] = this.typeCastToParameter(expr);
+ } else {
+ this.raise(expr.start, TSErrors$1.UnexpectedTypeCastInParameter);
+ }
+
+ break;
+ }
+ }
+
+ return super.toAssignableList(...arguments);
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ toReferencedList(exprList, isInParens) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") {
+ this.raise(expr.start, TSErrors$1.UnexpectedTypeAnnotation);
+ }
+ }
+
+ return exprList;
+ }
+
+ shouldParseArrow() {
+ return this.match(types$4.colon) || super.shouldParseArrow();
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(types$4.colon) || super.shouldParseAsyncArrow();
+ }
+
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments());
+ if (typeArguments) node.typeParameters = typeArguments;
+ }
+
+ return super.jsxParseOpeningElementAfterName(node);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ const baseCount = super.getGetterSetterExpectedParamCount(method);
+ const firstParam = method.params[0];
+ const hasContextParam = firstParam && firstParam.type === "Identifier" && firstParam.name === "this";
+ return hasContextParam ? baseCount + 1 : baseCount;
+ }
+
+ });
+
+ types$4.placeholder = new TokenType("%%", {
+ startsExpr: true
+ });
+ var placeholders$1 = (superClass => class extends superClass {
+ parsePlaceholder(expectedNode) {
+ if (this.match(types$4.placeholder)) {
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace("Unexpected space in placeholder.");
+ node.name = super.parseIdentifier(true);
+ this.assertNoSpace("Unexpected space in placeholder.");
+ this.expect(types$4.placeholder);
+ return this.finishPlaceholder(node, expectedNode);
+ }
+ }
+
+ finishPlaceholder(node, expectedNode) {
+ const isFinished = !!(node.expectedNode && node.type === "Placeholder");
+ node.expectedNode = expectedNode;
+ return isFinished ? node : this.finishNode(node, "Placeholder");
+ }
+
+ getTokenFromCode(code) {
+ if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ return this.finishOp(types$4.placeholder, 2);
+ }
+
+ return super.getTokenFromCode(...arguments);
+ }
+
+ parseExprAtom() {
+ return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments);
+ }
+
+ parseIdentifier() {
+ return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments);
+ }
+
+ checkReservedWord(word) {
+ if (word !== undefined) super.checkReservedWord(...arguments);
+ }
+
+ parseBindingAtom() {
+ return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments);
+ }
+
+ checkLVal(expr) {
+ if (expr.type !== "Placeholder") super.checkLVal(...arguments);
+ }
+
+ toAssignable(node) {
+ if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
+ node.expectedNode = "Pattern";
+ return node;
+ }
+
+ return super.toAssignable(...arguments);
+ }
+
+ verifyBreakContinue(node) {
+ if (node.label && node.label.type === "Placeholder") return;
+ super.verifyBreakContinue(...arguments);
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
+ return super.parseExpressionStatement(...arguments);
+ }
+
+ if (this.match(types$4.colon)) {
+ const stmt = node;
+ stmt.label = this.finishPlaceholder(expr, "Identifier");
+ this.next();
+ stmt.body = this.parseStatement("label");
+ return this.finishNode(stmt, "LabeledStatement");
+ }
+
+ this.semicolon();
+ node.name = expr.name;
+ return this.finishPlaceholder(node, "Statement");
+ }
+
+ parseBlock() {
+ return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments);
+ }
+
+ parseFunctionId() {
+ return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ const type = isStatement ? "ClassDeclaration" : "ClassExpression";
+ this.next();
+ this.takeDecorators(node);
+ const placeholder = this.parsePlaceholder("Identifier");
+
+ if (placeholder) {
+ if (this.match(types$4._extends) || this.match(types$4.placeholder) || this.match(types$4.braceL)) {
+ node.id = placeholder;
+ } else if (optionalId || !isStatement) {
+ node.id = null;
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
+ return this.finishNode(node, type);
+ } else {
+ this.unexpected(null, "A class name is required");
+ }
+ } else {
+ this.parseClassId(node, isStatement, optionalId);
+ }
+
+ this.parseClassSuper(node);
+ node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass);
+ return this.finishNode(node, type);
+ }
+
+ parseExport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseExport(...arguments);
+
+ if (!this.isContextual("from") && !this.match(types$4.comma)) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.finishPlaceholder(placeholder, "Declaration");
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = placeholder;
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return super.parseExport(node);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types$4._default)) {
+ const next = this.nextTokenStart();
+
+ if (this.isUnparsedContextual(next, "from")) {
+ if (this.input.startsWith(types$4.placeholder.label, this.nextTokenStartSince(next + 4))) {
+ return true;
+ }
+ }
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (node.specifiers && node.specifiers.length > 0) {
+ return true;
+ }
+
+ return super.maybeParseExportDefaultSpecifier(...arguments);
+ }
+
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+
+ if (specifiers == null ? void 0 : specifiers.length) {
+ node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
+ }
+
+ super.checkExport(node);
+ node.specifiers = specifiers;
+ }
+
+ parseImport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseImport(...arguments);
+ node.specifiers = [];
+
+ if (!this.isContextual("from") && !this.match(types$4.comma)) {
+ node.source = this.finishPlaceholder(placeholder, "StringLiteral");
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ const specifier = this.startNodeAtNode(placeholder);
+ specifier.local = placeholder;
+ this.finishNode(specifier, "ImportDefaultSpecifier");
+ node.specifiers.push(specifier);
+
+ if (this.eat(types$4.comma)) {
+ const hasStarImport = this.maybeParseStarImportSpecifier(node);
+ if (!hasStarImport) this.parseNamedImportSpecifiers(node);
+ }
+
+ this.expectContextual("from");
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments);
+ }
+
+ });
+
+ var v8intrinsic$1 = (superClass => class extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(types$4.modulo)) {
+ const v8IntrinsicStart = this.state.start;
+ const node = this.startNode();
+ this.eat(types$4.modulo);
+
+ if (this.match(types$4.name)) {
+ const name = this.parseIdentifierName(this.state.start);
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+
+ if (this.match(types$4.parenL)) {
+ return identifier;
+ }
+ }
+
+ this.unexpected(v8IntrinsicStart);
+ }
+ }
+
+ parseExprAtom() {
+ return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);
+ }
+
+ });
+
+ function hasPlugin$1(plugins, name) {
+ return plugins.some(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+ }
+ function getPluginOption$1(plugins, name, option) {
+ const plugin = plugins.find(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+
+ if (plugin && Array.isArray(plugin)) {
+ return plugin[1][option];
+ }
+
+ return null;
+ }
+ const PIPELINE_PROPOSALS$1 = ["minimal", "smart", "fsharp"];
+ const RECORD_AND_TUPLE_SYNTAX_TYPES$1 = ["hash", "bar"];
+ function validatePlugins$1(plugins) {
+ if (hasPlugin$1(plugins, "decorators")) {
+ if (hasPlugin$1(plugins, "decorators-legacy")) {
+ throw new Error("Cannot use the decorators and decorators-legacy plugin together");
+ }
+
+ const decoratorsBeforeExport = getPluginOption$1(plugins, "decorators", "decoratorsBeforeExport");
+
+ if (decoratorsBeforeExport == null) {
+ throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
+ } else if (typeof decoratorsBeforeExport !== "boolean") {
+ throw new Error("'decoratorsBeforeExport' must be a boolean.");
+ }
+ }
+
+ if (hasPlugin$1(plugins, "flow") && hasPlugin$1(plugins, "typescript")) {
+ throw new Error("Cannot combine flow and typescript plugins.");
+ }
+
+ if (hasPlugin$1(plugins, "placeholders") && hasPlugin$1(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
+ }
+
+ if (hasPlugin$1(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS$1.includes(getPluginOption$1(plugins, "pipelineOperator", "proposal"))) {
+ throw new Error("'pipelineOperator' requires 'proposal' option whose value should be one of: " + PIPELINE_PROPOSALS$1.map(p => `'${p}'`).join(", "));
+ }
+
+ if (hasPlugin$1(plugins, "moduleAttributes")) {
+ const moduleAttributesVerionPluginOption = getPluginOption$1(plugins, "moduleAttributes", "version");
+
+ if (moduleAttributesVerionPluginOption !== "may-2020") {
+ throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
+ }
+ }
+
+ if (hasPlugin$1(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES$1.includes(getPluginOption$1(plugins, "recordAndTuple", "syntaxType"))) {
+ throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES$1.map(p => `'${p}'`).join(", "));
+ }
+ }
+ const mixinPlugins$1 = {
+ estree: estree$1,
+ jsx: jsx$2,
+ flow: flow$2,
+ typescript: typescript$2,
+ v8intrinsic: v8intrinsic$1,
+ placeholders: placeholders$1
+ };
+ const mixinPluginNames$1 = Object.keys(mixinPlugins$1);
+
+ const defaultOptions$1 = {
+ sourceType: "script",
+ sourceFilename: undefined,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false
+ };
+ function getOptions$1(opts) {
+ const options = {};
+
+ for (let _i = 0, _Object$keys = Object.keys(defaultOptions$1); _i < _Object$keys.length; _i++) {
+ const key = _Object$keys[_i];
+ options[key] = opts && opts[key] != null ? opts[key] : defaultOptions$1[key];
+ }
+
+ return options;
+ }
+
+ let State$1 = class State {
+ constructor() {
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.inParameters = false;
+ this.maybeInArrowParameters = false;
+ this.maybeInAsyncArrowHead = false;
+ this.inPipeline = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.inPropertyName = false;
+ this.hasFlowComment = false;
+ this.isIterator = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.decoratorStack = [[]];
+ this.yieldPos = -1;
+ this.awaitPos = -1;
+ this.comments = [];
+ this.trailingComments = [];
+ this.leadingComments = [];
+ this.commentStack = [];
+ this.commentPreviousNode = null;
+ this.pos = 0;
+ this.lineStart = 0;
+ this.type = types$4.eof;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.lastTokStart = 0;
+ this.lastTokEnd = 0;
+ this.context = [types$1$1.braceStatement];
+ this.exprAllowed = true;
+ this.containsEsc = false;
+ this.octalPositions = [];
+ this.exportedIdentifiers = [];
+ this.tokensLength = 0;
+ }
+
+ init(options) {
+ this.strict = options.strictMode === false ? false : options.sourceType === "module";
+ this.curLine = options.startLine;
+ this.startLoc = this.endLoc = this.curPosition();
+ }
+
+ curPosition() {
+ return new Position$1(this.curLine, this.pos - this.lineStart);
+ }
+
+ clone(skipArrays) {
+ const state = new State();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+ let val = this[key];
+
+ if (!skipArrays && Array.isArray(val)) {
+ val = val.slice();
+ }
+
+ state[key] = val;
+ }
+
+ return state;
+ }
+
+ };
+
+ var _isDigit$1 = function isDigit(code) {
+ return code >= 48 && code <= 57;
+ };
+ const VALID_REGEX_FLAGS$1 = new Set(["g", "m", "s", "i", "y", "u"]);
+ const forbiddenNumericSeparatorSiblings$1 = {
+ decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
+ hex: [46, 88, 95, 120]
+ };
+ const allowedNumericSeparatorSiblings$1 = {};
+ allowedNumericSeparatorSiblings$1.bin = [48, 49];
+ allowedNumericSeparatorSiblings$1.oct = [...allowedNumericSeparatorSiblings$1.bin, 50, 51, 52, 53, 54, 55];
+ allowedNumericSeparatorSiblings$1.dec = [...allowedNumericSeparatorSiblings$1.oct, 56, 57];
+ allowedNumericSeparatorSiblings$1.hex = [...allowedNumericSeparatorSiblings$1.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102];
+ let Token$1 = class Token {
+ constructor(state) {
+ this.type = state.type;
+ this.value = state.value;
+ this.start = state.start;
+ this.end = state.end;
+ this.loc = new SourceLocation$1(state.startLoc, state.endLoc);
+ }
+
+ };
+ let Tokenizer$1 = class Tokenizer extends ParserError$1 {
+ constructor(options, input) {
+ super();
+ this.tokens = [];
+ this.state = new State$1();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.isLookahead = false;
+ }
+
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+
+ next() {
+ if (!this.isLookahead) {
+ this.checkKeywordEscapes();
+
+ if (this.options.tokens) {
+ this.pushToken(new Token$1(this.state));
+ }
+ }
+
+ this.state.lastTokEnd = this.state.end;
+ this.state.lastTokStart = this.state.start;
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+
+ eat(type) {
+ if (this.match(type)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ match(type) {
+ return this.state.type === type;
+ }
+
+ lookahead() {
+ const old = this.state;
+ this.state = old.clone(true);
+ this.isLookahead = true;
+ this.next();
+ this.isLookahead = false;
+ const curr = this.state;
+ this.state = old;
+ return curr;
+ }
+
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+
+ nextTokenStartSince(pos) {
+ skipWhiteSpace$1.lastIndex = pos;
+ const skip = skipWhiteSpace$1.exec(this.input);
+ return pos + skip[0].length;
+ }
+
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+
+ setStrict(strict) {
+ this.state.strict = strict;
+ if (!this.match(types$4.num) && !this.match(types$4.string)) return;
+ this.state.pos = this.state.start;
+
+ while (this.state.pos < this.state.lineStart) {
+ this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
+ --this.state.curLine;
+ }
+
+ this.nextToken();
+ }
+
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+
+ nextToken() {
+ const curContext = this.curContext();
+ if (!(curContext == null ? void 0 : curContext.preserveSpace)) this.skipSpace();
+ this.state.octalPositions = [];
+ this.state.start = this.state.pos;
+ this.state.startLoc = this.state.curPosition();
+
+ if (this.state.pos >= this.length) {
+ this.finishToken(types$4.eof);
+ return;
+ }
+
+ const override = curContext == null ? void 0 : curContext.override;
+
+ if (override) {
+ override(this);
+ } else {
+ this.getTokenFromCode(this.input.codePointAt(this.state.pos));
+ }
+ }
+
+ pushComment(block, text, start, end, startLoc, endLoc) {
+ const comment = {
+ type: block ? "CommentBlock" : "CommentLine",
+ value: text,
+ start: start,
+ end: end,
+ loc: new SourceLocation$1(startLoc, endLoc)
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ this.state.comments.push(comment);
+ this.addComment(comment);
+ }
+
+ skipBlockComment() {
+ const startLoc = this.state.curPosition();
+ const start = this.state.pos;
+ const end = this.input.indexOf("*/", this.state.pos + 2);
+ if (end === -1) throw this.raise(start, ErrorMessages$1.UnterminatedComment);
+ this.state.pos = end + 2;
+ lineBreakG$1.lastIndex = start;
+ let match;
+
+ while ((match = lineBreakG$1.exec(this.input)) && match.index < this.state.pos) {
+ ++this.state.curLine;
+ this.state.lineStart = match.index + match[0].length;
+ }
+
+ if (this.isLookahead) return;
+ this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
+ }
+
+ skipLineComment(startSkip) {
+ const start = this.state.pos;
+ const startLoc = this.state.curPosition();
+ let ch = this.input.charCodeAt(this.state.pos += startSkip);
+
+ if (this.state.pos < this.length) {
+ while (!isNewLine$1(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ }
+
+ if (this.isLookahead) return;
+ this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
+ }
+
+ skipSpace() {
+ loop: while (this.state.pos < this.length) {
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42:
+ this.skipBlockComment();
+ break;
+
+ case 47:
+ this.skipLineComment(2);
+ break;
+
+ default:
+ break loop;
+ }
+
+ break;
+
+ default:
+ if (isWhitespace$1(ch)) {
+ ++this.state.pos;
+ } else {
+ break loop;
+ }
+
+ }
+ }
+ }
+
+ finishToken(type, val) {
+ this.state.end = this.state.pos;
+ this.state.endLoc = this.state.curPosition();
+ const prevType = this.state.type;
+ this.state.type = type;
+ this.state.value = val;
+ if (!this.isLookahead) this.updateContext(prevType);
+ }
+
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+
+ const nextPos = this.state.pos + 1;
+ const next = this.input.charCodeAt(nextPos);
+
+ if (next >= 48 && next <= 57) {
+ throw this.raise(this.state.pos, ErrorMessages$1.UnexpectedDigitAfterHash);
+ }
+
+ if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
+ this.expectPlugin("recordAndTuple");
+
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") {
+ throw this.raise(this.state.pos, next === 123 ? ErrorMessages$1.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages$1.TupleExpressionHashIncorrectStartSyntaxType);
+ }
+
+ if (next === 123) {
+ this.finishToken(types$4.braceHashL);
+ } else {
+ this.finishToken(types$4.bracketHashL);
+ }
+
+ this.state.pos += 2;
+ } else {
+ this.finishOp(types$4.hash, 1);
+ }
+ }
+
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(types$4.ellipsis);
+ } else {
+ ++this.state.pos;
+ this.finishToken(types$4.dot);
+ }
+ }
+
+ readToken_slash() {
+ if (this.state.exprAllowed && !this.state.inType) {
+ ++this.state.pos;
+ this.readRegexp();
+ return;
+ }
+
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(types$4.assign, 2);
+ } else {
+ this.finishOp(types$4.slash, 1);
+ }
+ }
+
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ let ch = this.input.charCodeAt(this.state.pos + 1);
+ if (ch !== 33) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+
+ while (!isNewLine$1(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+
+ const value = this.input.slice(start + 2, this.state.pos);
+ this.finishToken(types$4.interpreterDirective, value);
+ return true;
+ }
+
+ readToken_mult_modulo(code) {
+ let type = code === 42 ? types$4.star : types$4.modulo;
+ let width = 1;
+ let next = this.input.charCodeAt(this.state.pos + 1);
+ const exprAllowed = this.state.exprAllowed;
+
+ if (code === 42 && next === 42) {
+ width++;
+ next = this.input.charCodeAt(this.state.pos + 2);
+ type = types$4.exponent;
+ }
+
+ if (next === 61 && !exprAllowed) {
+ width++;
+ type = types$4.assign;
+ }
+
+ this.finishOp(type, width);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(types$4.assign, 3);
+ } else {
+ this.finishOp(code === 124 ? types$4.logicalOR : types$4.logicalAND, 2);
+ }
+
+ return;
+ }
+
+ if (code === 124) {
+ if (next === 62) {
+ this.finishOp(types$4.pipeline, 2);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 125) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages$1.RecordExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.finishOp(types$4.braceBarR, 2);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 93) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages$1.TupleExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.finishOp(types$4.bracketBarR, 2);
+ return;
+ }
+ }
+
+ if (next === 61) {
+ this.finishOp(types$4.assign, 2);
+ return;
+ }
+
+ this.finishOp(code === 124 ? types$4.bitwiseOR : types$4.bitwiseAND, 1);
+ }
+
+ readToken_caret() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(types$4.assign, 2);
+ } else {
+ this.finishOp(types$4.bitwiseXOR, 1);
+ }
+ }
+
+ readToken_plus_min(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && (this.state.lastTokEnd === 0 || lineBreak$1.test(this.input.slice(this.state.lastTokEnd, this.state.pos)))) {
+ this.skipLineComment(3);
+ this.skipSpace();
+ this.nextToken();
+ return;
+ }
+
+ this.finishOp(types$4.incDec, 2);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(types$4.assign, 2);
+ } else {
+ this.finishOp(types$4.plusMin, 1);
+ }
+ }
+
+ readToken_lt_gt(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ let size = 1;
+
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
+
+ if (this.input.charCodeAt(this.state.pos + size) === 61) {
+ this.finishOp(types$4.assign, size + 1);
+ return;
+ }
+
+ this.finishOp(types$4.bitShift, size);
+ return;
+ }
+
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
+ this.skipLineComment(4);
+ this.skipSpace();
+ this.nextToken();
+ return;
+ }
+
+ if (next === 61) {
+ size = 2;
+ }
+
+ this.finishOp(types$4.relational, size);
+ }
+
+ readToken_eq_excl(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(types$4.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+ return;
+ }
+
+ if (code === 61 && next === 62) {
+ this.state.pos += 2;
+ this.finishToken(types$4.arrow);
+ return;
+ }
+
+ this.finishOp(code === 61 ? types$4.eq : types$4.bang, 1);
+ }
+
+ readToken_question() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ const next2 = this.input.charCodeAt(this.state.pos + 2);
+
+ if (next === 63 && !this.state.inType) {
+ if (next2 === 61) {
+ this.finishOp(types$4.assign, 3);
+ } else {
+ this.finishOp(types$4.nullishCoalescing, 2);
+ }
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(types$4.questionDot);
+ } else {
+ ++this.state.pos;
+ this.finishToken(types$4.question);
+ }
+ }
+
+ getTokenFromCode(code) {
+ switch (code) {
+ case 46:
+ this.readToken_dot();
+ return;
+
+ case 40:
+ ++this.state.pos;
+ this.finishToken(types$4.parenL);
+ return;
+
+ case 41:
+ ++this.state.pos;
+ this.finishToken(types$4.parenR);
+ return;
+
+ case 59:
+ ++this.state.pos;
+ this.finishToken(types$4.semi);
+ return;
+
+ case 44:
+ ++this.state.pos;
+ this.finishToken(types$4.comma);
+ return;
+
+ case 91:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages$1.TupleExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.finishToken(types$4.bracketBarL);
+ this.state.pos += 2;
+ } else {
+ ++this.state.pos;
+ this.finishToken(types$4.bracketL);
+ }
+
+ return;
+
+ case 93:
+ ++this.state.pos;
+ this.finishToken(types$4.bracketR);
+ return;
+
+ case 123:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages$1.RecordExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.finishToken(types$4.braceBarL);
+ this.state.pos += 2;
+ } else {
+ ++this.state.pos;
+ this.finishToken(types$4.braceL);
+ }
+
+ return;
+
+ case 125:
+ ++this.state.pos;
+ this.finishToken(types$4.braceR);
+ return;
+
+ case 58:
+ if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+ this.finishOp(types$4.doubleColon, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(types$4.colon);
+ }
+
+ return;
+
+ case 63:
+ this.readToken_question();
+ return;
+
+ case 96:
+ ++this.state.pos;
+ this.finishToken(types$4.backQuote);
+ return;
+
+ case 48:
+ {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 120 || next === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+
+ if (next === 111 || next === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+
+ if (next === 98 || next === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+
+ case 34:
+ case 39:
+ this.readString(code);
+ return;
+
+ case 47:
+ this.readToken_slash();
+ return;
+
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(code);
+ return;
+
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(code);
+ return;
+
+ case 94:
+ this.readToken_caret();
+ return;
+
+ case 43:
+ case 45:
+ this.readToken_plus_min(code);
+ return;
+
+ case 60:
+ case 62:
+ this.readToken_lt_gt(code);
+ return;
+
+ case 61:
+ case 33:
+ this.readToken_eq_excl(code);
+ return;
+
+ case 126:
+ this.finishOp(types$4.tilde, 1);
+ return;
+
+ case 64:
+ ++this.state.pos;
+ this.finishToken(types$4.at);
+ return;
+
+ case 35:
+ this.readToken_numberSign();
+ return;
+
+ case 92:
+ this.readWord();
+ return;
+
+ default:
+ if (isIdentifierStart$1(code)) {
+ this.readWord();
+ return;
+ }
+
+ }
+
+ throw this.raise(this.state.pos, ErrorMessages$1.InvalidOrUnexpectedToken, String.fromCodePoint(code));
+ }
+
+ finishOp(type, size) {
+ const str = this.input.slice(this.state.pos, this.state.pos + size);
+ this.state.pos += size;
+ this.finishToken(type, str);
+ }
+
+ readRegexp() {
+ const start = this.state.pos;
+ let escaped, inClass;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(start, ErrorMessages$1.UnterminatedRegExp);
+ }
+
+ const ch = this.input.charAt(this.state.pos);
+
+ if (lineBreak$1.test(ch)) {
+ throw this.raise(start, ErrorMessages$1.UnterminatedRegExp);
+ }
+
+ if (escaped) {
+ escaped = false;
+ } else {
+ if (ch === "[") {
+ inClass = true;
+ } else if (ch === "]" && inClass) {
+ inClass = false;
+ } else if (ch === "/" && !inClass) {
+ break;
+ }
+
+ escaped = ch === "\\";
+ }
+
+ ++this.state.pos;
+ }
+
+ const content = this.input.slice(start, this.state.pos);
+ ++this.state.pos;
+ let mods = "";
+
+ while (this.state.pos < this.length) {
+ const char = this.input[this.state.pos];
+ const charCode = this.input.codePointAt(this.state.pos);
+
+ if (VALID_REGEX_FLAGS$1.has(char)) {
+ if (mods.indexOf(char) > -1) {
+ this.raise(this.state.pos + 1, ErrorMessages$1.DuplicateRegExpFlags);
+ }
+ } else if (isIdentifierChar$1(charCode) || charCode === 92) {
+ this.raise(this.state.pos + 1, ErrorMessages$1.MalformedRegExpFlags);
+ } else {
+ break;
+ }
+
+ ++this.state.pos;
+ mods += char;
+ }
+
+ this.finishToken(types$4.regexp, {
+ pattern: content,
+ flags: mods
+ });
+ }
+
+ readInt(radix, len, forceLen, allowNumSeparator = true) {
+ const start = this.state.pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings$1.hex : forbiddenNumericSeparatorSiblings$1.decBinOct;
+ const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings$1.hex : radix === 10 ? allowedNumericSeparatorSiblings$1.dec : radix === 8 ? allowedNumericSeparatorSiblings$1.oct : allowedNumericSeparatorSiblings$1.bin;
+ let invalid = false;
+ let total = 0;
+
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = this.input.charCodeAt(this.state.pos);
+ let val;
+
+ if (this.hasPlugin("numericSeparator")) {
+ if (code === 95) {
+ const prev = this.input.charCodeAt(this.state.pos - 1);
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (allowedSiblings.indexOf(next) === -1) {
+ this.raise(this.state.pos, ErrorMessages$1.UnexpectedNumericSeparator);
+ } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
+ this.raise(this.state.pos, ErrorMessages$1.UnexpectedNumericSeparator);
+ }
+
+ if (!allowNumSeparator) {
+ this.raise(this.state.pos, ErrorMessages$1.NumericSeparatorInEscapeSequence);
+ }
+
+ ++this.state.pos;
+ continue;
+ }
+ }
+
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit$1(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+
+ if (val >= radix) {
+ if (this.options.errorRecovery && val <= 9) {
+ val = 0;
+ this.raise(this.state.start + i + 2, ErrorMessages$1.InvalidDigit, radix);
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+
+ ++this.state.pos;
+ total = total * radix + val;
+ }
+
+ if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {
+ return null;
+ }
+
+ return total;
+ }
+
+ readRadixNumber(radix) {
+ const start = this.state.pos;
+ let isBigInt = false;
+ this.state.pos += 2;
+ const val = this.readInt(radix);
+
+ if (val == null) {
+ this.raise(this.state.start + 2, ErrorMessages$1.InvalidDigit, radix);
+ }
+
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 95) {
+ this.expectPlugin("numericSeparator", this.state.pos);
+ }
+
+ if (next === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (isIdentifierStart$1(this.input.codePointAt(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages$1.NumberIdentifier);
+ }
+
+ if (isBigInt) {
+ const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
+ this.finishToken(types$4.bigint, str);
+ return;
+ }
+
+ this.finishToken(types$4.num, val);
+ }
+
+ readNumber(startsWithDot) {
+ const start = this.state.pos;
+ let isFloat = false;
+ let isBigInt = false;
+ let isNonOctalDecimalInt = false;
+
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(start, ErrorMessages$1.InvalidNumber);
+ }
+
+ let octal = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+
+ if (octal) {
+ if (this.state.strict) {
+ this.raise(start, ErrorMessages$1.StrictOctalLiteral);
+ }
+
+ if (/[89]/.test(this.input.slice(start, this.state.pos))) {
+ octal = false;
+ isNonOctalDecimalInt = true;
+ }
+ }
+
+ let next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 46 && !octal) {
+ ++this.state.pos;
+ this.readInt(10);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if ((next === 69 || next === 101) && !octal) {
+ next = this.input.charCodeAt(++this.state.pos);
+
+ if (next === 43 || next === 45) {
+ ++this.state.pos;
+ }
+
+ if (this.readInt(10) === null) this.raise(start, ErrorMessages$1.InvalidNumber);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if (this.hasPlugin("numericSeparator") && (octal || isNonOctalDecimalInt)) {
+ const underscorePos = this.input.slice(start, this.state.pos).indexOf("_");
+
+ if (underscorePos > 0) {
+ this.raise(underscorePos + start, ErrorMessages$1.ZeroDigitNumericSeparator);
+ }
+ }
+
+ if (next === 95) {
+ this.expectPlugin("numericSeparator", this.state.pos);
+ }
+
+ if (next === 110) {
+ if (isFloat || octal || isNonOctalDecimalInt) {
+ this.raise(start, ErrorMessages$1.InvalidBigIntLiteral);
+ }
+
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (isIdentifierStart$1(this.input.codePointAt(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages$1.NumberIdentifier);
+ }
+
+ const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
+
+ if (isBigInt) {
+ this.finishToken(types$4.bigint, str);
+ return;
+ }
+
+ const val = octal ? parseInt(str, 8) : parseFloat(str);
+ this.finishToken(types$4.num, val);
+ }
+
+ readCodePoint(throwOnInvalid) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let code;
+
+ if (ch === 123) {
+ const codePos = ++this.state.pos;
+ code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid);
+ ++this.state.pos;
+
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages$1.InvalidCodePoint);
+ } else {
+ return null;
+ }
+ }
+ } else {
+ code = this.readHexChar(4, false, throwOnInvalid);
+ }
+
+ return code;
+ }
+
+ readString(quote) {
+ let out = "",
+ chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnterminatedString);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.readEscapedChar(false);
+ chunkStart = this.state.pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ } else if (isNewLine$1(ch)) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnterminatedString);
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ this.finishToken(types$4.string, out);
+ }
+
+ readTmplToken() {
+ let out = "",
+ chunkStart = this.state.pos,
+ containsInvalid = false;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnterminatedTemplate);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
+ if (this.state.pos === this.state.start && this.match(types$4.template)) {
+ if (ch === 36) {
+ this.state.pos += 2;
+ this.finishToken(types$4.dollarBraceL);
+ return;
+ } else {
+ ++this.state.pos;
+ this.finishToken(types$4.backQuote);
+ return;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ this.finishToken(types$4.template, containsInvalid ? null : out);
+ return;
+ }
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ const escaped = this.readEscapedChar(true);
+
+ if (escaped === null) {
+ containsInvalid = true;
+ } else {
+ out += escaped;
+ }
+
+ chunkStart = this.state.pos;
+ } else if (isNewLine$1(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ out += "\n";
+ break;
+
+ default:
+ out += String.fromCharCode(ch);
+ break;
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ }
+
+ readEscapedChar(inTemplate) {
+ const throwOnInvalid = !inTemplate;
+ const ch = this.input.charCodeAt(++this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 110:
+ return "\n";
+
+ case 114:
+ return "\r";
+
+ case 120:
+ {
+ const code = this.readHexChar(2, false, throwOnInvalid);
+ return code === null ? null : String.fromCharCode(code);
+ }
+
+ case 117:
+ {
+ const code = this.readCodePoint(throwOnInvalid);
+ return code === null ? null : String.fromCodePoint(code);
+ }
+
+ case 116:
+ return "\t";
+
+ case 98:
+ return "\b";
+
+ case 118:
+ return "\u000b";
+
+ case 102:
+ return "\f";
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ this.state.lineStart = this.state.pos;
+ ++this.state.curLine;
+
+ case 8232:
+ case 8233:
+ return "";
+
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return null;
+ }
+
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const codePos = this.state.pos - 1;
+ const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/);
+ let octalStr = match[0];
+ let octal = parseInt(octalStr, 8);
+
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+
+ this.state.pos += octalStr.length - 1;
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return null;
+ } else if (this.state.strict) {
+ this.raise(codePos, ErrorMessages$1.StrictOctalLiteral);
+ } else {
+ this.state.octalPositions.push(codePos);
+ }
+ }
+
+ return String.fromCharCode(octal);
+ }
+
+ return String.fromCharCode(ch);
+ }
+ }
+
+ readHexChar(len, forceLen, throwOnInvalid) {
+ const codePos = this.state.pos;
+ const n = this.readInt(16, len, forceLen, false);
+
+ if (n === null) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages$1.InvalidEscapeSequence);
+ } else {
+ this.state.pos = codePos - 1;
+ }
+ }
+
+ return n;
+ }
+
+ readWord1() {
+ let word = "";
+ this.state.containsEsc = false;
+ const start = this.state.pos;
+ let chunkStart = this.state.pos;
+
+ while (this.state.pos < this.length) {
+ const ch = this.input.codePointAt(this.state.pos);
+
+ if (isIdentifierChar$1(ch)) {
+ this.state.pos += ch <= 0xffff ? 1 : 2;
+ } else if (this.state.isIterator && ch === 64) {
+ ++this.state.pos;
+ } else if (ch === 92) {
+ this.state.containsEsc = true;
+ word += this.input.slice(chunkStart, this.state.pos);
+ const escStart = this.state.pos;
+ const identifierCheck = this.state.pos === start ? isIdentifierStart$1 : isIdentifierChar$1;
+
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(this.state.pos, ErrorMessages$1.MissingUnicodeEscape);
+ continue;
+ }
+
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(escStart, ErrorMessages$1.EscapedCharNotAnIdentifier);
+ }
+
+ word += String.fromCodePoint(esc);
+ }
+
+ chunkStart = this.state.pos;
+ } else {
+ break;
+ }
+ }
+
+ return word + this.input.slice(chunkStart, this.state.pos);
+ }
+
+ isIterator(word) {
+ return word === "@@iterator" || word === "@@asyncIterator";
+ }
+
+ readWord() {
+ const word = this.readWord1();
+ const type = keywords$2.get(word) || types$4.name;
+
+ if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) {
+ this.raise(this.state.pos, ErrorMessages$1.InvalidIdentifier, word);
+ }
+
+ this.finishToken(type, word);
+ }
+
+ checkKeywordEscapes() {
+ const kw = this.state.type.keyword;
+
+ if (kw && this.state.containsEsc) {
+ this.raise(this.state.start, ErrorMessages$1.InvalidEscapedReservedWord, kw);
+ }
+ }
+
+ braceIsBlock(prevType) {
+ const parent = this.curContext();
+
+ if (parent === types$1$1.functionExpression || parent === types$1$1.functionStatement) {
+ return true;
+ }
+
+ if (prevType === types$4.colon && (parent === types$1$1.braceStatement || parent === types$1$1.braceExpression)) {
+ return !parent.isExpr;
+ }
+
+ if (prevType === types$4._return || prevType === types$4.name && this.state.exprAllowed) {
+ return lineBreak$1.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+ }
+
+ if (prevType === types$4._else || prevType === types$4.semi || prevType === types$4.eof || prevType === types$4.parenR || prevType === types$4.arrow) {
+ return true;
+ }
+
+ if (prevType === types$4.braceL) {
+ return parent === types$1$1.braceStatement;
+ }
+
+ if (prevType === types$4._var || prevType === types$4._const || prevType === types$4.name) {
+ return false;
+ }
+
+ if (prevType === types$4.relational) {
+ return true;
+ }
+
+ return !this.state.exprAllowed;
+ }
+
+ updateContext(prevType) {
+ const type = this.state.type;
+ let update;
+
+ if (type.keyword && (prevType === types$4.dot || prevType === types$4.questionDot)) {
+ this.state.exprAllowed = false;
+ } else if (update = type.updateContext) {
+ update.call(this, prevType);
+ } else {
+ this.state.exprAllowed = type.beforeExpr;
+ }
+ }
+
+ };
+
+ let UtilParser$1 = class UtilParser extends Tokenizer$1 {
+ addExtra(node, key, val) {
+ if (!node) return;
+ const extra = node.extra = node.extra || {};
+ extra[key] = val;
+ }
+
+ isRelational(op) {
+ return this.match(types$4.relational) && this.state.value === op;
+ }
+
+ isLookaheadRelational(op) {
+ const next = this.nextTokenStart();
+
+ if (this.input.charAt(next) === op) {
+ if (next + 1 === this.input.length) {
+ return true;
+ }
+
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== op.charCodeAt(0) && afterNext !== 61;
+ }
+
+ return false;
+ }
+
+ expectRelational(op) {
+ if (this.isRelational(op)) {
+ this.next();
+ } else {
+ this.unexpected(null, types$4.relational);
+ }
+ }
+
+ isContextual(name) {
+ return this.match(types$4.name) && this.state.value === name && !this.state.containsEsc;
+ }
+
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+ return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !isIdentifierChar$1(this.input.charCodeAt(nameEnd)));
+ }
+
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, name);
+ }
+
+ eatContextual(name) {
+ return this.isContextual(name) && this.eat(types$4.name);
+ }
+
+ expectContextual(name, message) {
+ if (!this.eatContextual(name)) this.unexpected(null, message);
+ }
+
+ canInsertSemicolon() {
+ return this.match(types$4.eof) || this.match(types$4.braceR) || this.hasPrecedingLineBreak();
+ }
+
+ hasPrecedingLineBreak() {
+ return lineBreak$1.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+ }
+
+ isLineTerminator() {
+ return this.eat(types$4.semi) || this.canInsertSemicolon();
+ }
+
+ semicolon() {
+ if (!this.isLineTerminator()) this.unexpected(null, types$4.semi);
+ }
+
+ expect(type, pos) {
+ this.eat(type) || this.unexpected(pos, type);
+ }
+
+ assertNoSpace(message = "Unexpected space.") {
+ if (this.state.start > this.state.lastTokEnd) {
+ this.raise(this.state.lastTokEnd, message);
+ }
+ }
+
+ unexpected(pos, messageOrType = "Unexpected token") {
+ if (typeof messageOrType !== "string") {
+ messageOrType = `Unexpected token, expected "${messageOrType.label}"`;
+ }
+
+ throw this.raise(pos != null ? pos : this.state.start, messageOrType);
+ }
+
+ expectPlugin(name, pos) {
+ if (!this.hasPlugin(name)) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: [name]
+ }, `This experimental syntax requires enabling the parser plugin: '${name}'`);
+ }
+
+ return true;
+ }
+
+ expectOnePlugin(names, pos) {
+ if (!names.some(n => this.hasPlugin(n))) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: names
+ }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`);
+ }
+ }
+
+ checkYieldAwaitInDefaultParams() {
+ if (this.state.yieldPos !== -1 && (this.state.awaitPos === -1 || this.state.yieldPos < this.state.awaitPos)) {
+ this.raise(this.state.yieldPos, ErrorMessages$1.YieldBindingIdentifier);
+ }
+
+ if (this.state.awaitPos !== -1) {
+ this.raise(this.state.awaitPos, ErrorMessages$1.AwaitBindingIdentifier);
+ }
+ }
+
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+
+ throw error;
+ }
+ }
+
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssign,
+ doubleProto
+ } = refExpressionErrors;
+ if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0;
+
+ if (shorthandAssign >= 0) {
+ this.unexpected(shorthandAssign);
+ }
+
+ if (doubleProto >= 0) {
+ this.raise(doubleProto, ErrorMessages$1.DuplicateProto);
+ }
+ }
+
+ isLiteralPropertyName() {
+ return this.match(types$4.name) || !!this.state.type.keyword || this.match(types$4.string) || this.match(types$4.num) || this.match(types$4.bigint);
+ }
+
+ };
+ let ExpressionErrors$1 = class ExpressionErrors {
+ constructor() {
+ this.shorthandAssign = -1;
+ this.doubleProto = -1;
+ }
+
+ };
+
+ let Node$1 = class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation$1(loc);
+ if (parser == null ? void 0 : parser.options.ranges) this.range = [pos, 0];
+ if (parser == null ? void 0 : parser.filename) this.loc.filename = parser.filename;
+ }
+
+ __clone() {
+ const newNode = new Node();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+
+ if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
+ newNode[key] = this[key];
+ }
+ }
+
+ return newNode;
+ }
+
+ };
+
+ let NodeUtils$1 = class NodeUtils extends UtilParser$1 {
+ startNode() {
+ return new Node$1(this, this.state.start, this.state.startLoc);
+ }
+
+ startNodeAt(pos, loc) {
+ return new Node$1(this, pos, loc);
+ }
+
+ startNodeAtNode(type) {
+ return this.startNodeAt(type.start, type.loc.start);
+ }
+
+ finishNode(node, type) {
+ return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
+ }
+
+ finishNodeAt(node, type, pos, loc) {
+
+ node.type = type;
+ node.end = pos;
+ node.loc.end = loc;
+ if (this.options.ranges) node.range[1] = pos;
+ this.processComment(node);
+ return node;
+ }
+
+ resetStartLocation(node, start, startLoc) {
+ node.start = start;
+ node.loc.start = startLoc;
+ if (this.options.ranges) node.range[0] = start;
+ }
+
+ resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) {
+ node.end = end;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = end;
+ }
+
+ resetStartLocationFromNode(node, locationNode) {
+ this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
+ }
+
+ };
+
+ const unwrapParenthesizedExpression$1 = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression$1(node.expression) : node;
+ };
+
+ let LValParser$1 = class LValParser extends NodeUtils$1 {
+ toAssignable(node) {
+ var _node$extra, _node$extra3;
+
+ let parenthesized = undefined;
+
+ if (node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) {
+ parenthesized = unwrapParenthesizedExpression$1(node);
+
+ if (parenthesized.type !== "Identifier" && parenthesized.type !== "MemberExpression") {
+ this.raise(node.start, ErrorMessages$1.InvalidParenthesizedAssignment);
+ }
+ }
+
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ break;
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+
+ for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
+ var _node$extra2;
+
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast);
+
+ if (isLast && prop.type === "RestElement" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) {
+ this.raiseRestNotLast(node.extra.trailingComma);
+ }
+ }
+
+ break;
+
+ case "ObjectProperty":
+ this.toAssignable(node.value);
+ break;
+
+ case "SpreadElement":
+ {
+ this.checkToRestConversion(node);
+ node.type = "RestElement";
+ const arg = node.argument;
+ this.toAssignable(arg);
+ break;
+ }
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma);
+ break;
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(node.left.end, ErrorMessages$1.MissingEqInAssignment);
+ }
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left);
+ break;
+
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized);
+ break;
+ }
+
+ return node;
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast) {
+ if (prop.type === "ObjectMethod") {
+ const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages$1.PatternHasAccessor : ErrorMessages$1.PatternHasMethod;
+ this.raise(prop.key.start, error);
+ } else if (prop.type === "SpreadElement" && !isLast) {
+ this.raiseRestNotLast(prop.start);
+ } else {
+ this.toAssignable(prop);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos) {
+ let end = exprList.length;
+
+ if (end) {
+ const last = exprList[end - 1];
+
+ if ((last == null ? void 0 : last.type) === "RestElement") {
+ --end;
+ } else if ((last == null ? void 0 : last.type) === "SpreadElement") {
+ last.type = "RestElement";
+ const arg = last.argument;
+ this.toAssignable(arg);
+
+ if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
+ this.unexpected(arg.start);
+ }
+
+ if (trailingCommaPos) {
+ this.raiseTrailingCommaAfterRest(trailingCommaPos);
+ }
+
+ --end;
+ }
+ }
+
+ for (let i = 0; i < end; i++) {
+ const elt = exprList[i];
+
+ if (elt) {
+ this.toAssignable(elt);
+
+ if (elt.type === "RestElement") {
+ this.raiseRestNotLast(elt.start);
+ }
+ }
+ }
+
+ return exprList;
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ return exprList;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ this.toReferencedList(exprList, isParenthesizedExpr);
+
+ for (let _i = 0; _i < exprList.length; _i++) {
+ const expr = exprList[_i];
+
+ if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+
+ parseSpread(refExpressionErrors, refNeedsArrowPos) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssign(false, refExpressionErrors, undefined, refNeedsArrowPos);
+ return this.finishNode(node, "SpreadElement");
+ }
+
+ parseRestBinding() {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseBindingAtom();
+ return this.finishNode(node, "RestElement");
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case types$4.bracketL:
+ {
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(types$4.bracketR, 93, true);
+ return this.finishNode(node, "ArrayPattern");
+ }
+
+ case types$4.braceL:
+ return this.parseObj(types$4.braceR, true);
+ }
+
+ return this.parseIdentifier();
+ }
+
+ parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types$4.comma);
+ }
+
+ if (allowEmpty && this.match(types$4.comma)) {
+ elts.push(null);
+ } else if (this.eat(close)) {
+ break;
+ } else if (this.match(types$4.ellipsis)) {
+ elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
+ this.checkCommaAfterRest(closeCharCode);
+ this.expect(close);
+ break;
+ } else {
+ const decorators = [];
+
+ if (this.match(types$4.at) && this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages$1.UnsupportedParameterDecorator);
+ }
+
+ while (this.match(types$4.at)) {
+ decorators.push(this.parseDecorator());
+ }
+
+ elts.push(this.parseAssignableListItem(allowModifiers, decorators));
+ }
+ }
+
+ return elts;
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseAssignableListItemTypes(param) {
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ startLoc = startLoc || this.state.startLoc;
+ startPos = startPos || this.state.start;
+ left = left || this.parseBindingAtom();
+ if (!this.eat(types$4.eq)) return left;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssign();
+ return this.finishNode(node, "AssignmentPattern");
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE$1, checkClashes, contextDescription, disallowLetBinding, strictModeChanged = false) {
+ switch (expr.type) {
+ case "Identifier":
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord$1(expr.name, this.inModule) : isStrictBindOnlyReservedWord$1(expr.name))) {
+ this.raise(expr.start, bindingType === BIND_NONE$1 ? ErrorMessages$1.StrictEvalArguments : ErrorMessages$1.StrictEvalArgumentsBinding, expr.name);
+ }
+
+ if (checkClashes) {
+ const key = `_${expr.name}`;
+
+ if (checkClashes[key]) {
+ this.raise(expr.start, ErrorMessages$1.ParamDupe);
+ } else {
+ checkClashes[key] = true;
+ }
+ }
+
+ if (disallowLetBinding && expr.name === "let") {
+ this.raise(expr.start, ErrorMessages$1.LetInLexicalBinding);
+ }
+
+ if (!(bindingType & BIND_NONE$1)) {
+ this.scope.declareName(expr.name, bindingType, expr.start);
+ }
+
+ break;
+
+ case "MemberExpression":
+ if (bindingType !== BIND_NONE$1) {
+ this.raise(expr.start, ErrorMessages$1.InvalidPropertyBindingPattern);
+ }
+
+ break;
+
+ case "ObjectPattern":
+ for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) {
+ let prop = _expr$properties[_i2];
+ if (prop.type === "ObjectProperty") prop = prop.value;else if (prop.type === "ObjectMethod") continue;
+ this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
+ }
+
+ break;
+
+ case "ArrayPattern":
+ for (let _i3 = 0, _expr$elements = expr.elements; _i3 < _expr$elements.length; _i3++) {
+ const elem = _expr$elements[_i3];
+
+ if (elem) {
+ this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern", disallowLetBinding);
+ }
+ }
+
+ break;
+
+ case "AssignmentPattern":
+ this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern");
+ break;
+
+ case "RestElement":
+ this.checkLVal(expr.argument, bindingType, checkClashes, "rest element");
+ break;
+
+ case "ParenthesizedExpression":
+ this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression");
+ break;
+
+ default:
+ {
+ this.raise(expr.start, bindingType === BIND_NONE$1 ? ErrorMessages$1.InvalidLhs : ErrorMessages$1.InvalidLhsBinding, contextDescription);
+ }
+ }
+ }
+
+ checkToRestConversion(node) {
+ if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
+ this.raise(node.argument.start, ErrorMessages$1.InvalidRestAssignmentPattern);
+ }
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.match(types$4.comma)) {
+ if (this.lookaheadCharCode() === close) {
+ this.raiseTrailingCommaAfterRest(this.state.start);
+ } else {
+ this.raiseRestNotLast(this.state.start);
+ }
+ }
+ }
+
+ raiseRestNotLast(pos) {
+ throw this.raise(pos, ErrorMessages$1.ElementAfterRest);
+ }
+
+ raiseTrailingCommaAfterRest(pos) {
+ this.raise(pos, ErrorMessages$1.RestTrailingComma);
+ }
+
+ };
+
+ let ExpressionParser$1 = class ExpressionParser extends LValParser$1 {
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || prop.type === "ObjectMethod" || prop.computed || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : key.value;
+
+ if (name === "__proto__") {
+ if (isRecord) {
+ this.raise(key.start, ErrorMessages$1.RecordNoProto);
+ return;
+ }
+
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProto === -1) {
+ refExpressionErrors.doubleProto = key.start;
+ }
+ } else {
+ this.raise(key.start, ErrorMessages$1.DuplicateProto);
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ getExpression() {
+ let paramFlags = PARAM$1;
+
+ if (this.hasPlugin("topLevelAwait") && this.inModule) {
+ paramFlags |= PARAM_AWAIT$1;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM$1);
+ this.prodParam.enter(paramFlags);
+ this.nextToken();
+ const expr = this.parseExpression();
+
+ if (!this.match(types$4.eof)) {
+ this.unexpected();
+ }
+
+ expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
+ return expr;
+ }
+
+ parseExpression(noIn, refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(noIn, refExpressionErrors);
+
+ if (this.match(types$4.comma)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+
+ while (this.eat(types$4.comma)) {
+ node.expressions.push(this.parseMaybeAssign(noIn, refExpressionErrors));
+ }
+
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ if (this.isContextual("yield")) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield(noIn);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ return left;
+ } else {
+ this.state.exprAllowed = false;
+ }
+ }
+
+ let ownExpressionErrors;
+
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors$1();
+ ownExpressionErrors = true;
+ }
+
+ if (this.match(types$4.parenL) || this.match(types$4.name)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+
+ let left = this.parseMaybeConditional(noIn, refExpressionErrors, refNeedsArrowPos);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ if (this.state.type.isAssign) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const operator = this.state.value;
+ node.operator = operator;
+
+ if (operator === "??=") {
+ this.expectPlugin("logicalAssignment");
+ }
+
+ if (operator === "||=" || operator === "&&=") {
+ this.expectPlugin("logicalAssignment");
+ }
+
+ if (this.match(types$4.eq)) {
+ node.left = this.toAssignable(left);
+ refExpressionErrors.doubleProto = -1;
+ } else {
+ node.left = left;
+ }
+
+ if (refExpressionErrors.shorthandAssign >= node.left.start) {
+ refExpressionErrors.shorthandAssign = -1;
+ }
+
+ this.checkLVal(left, undefined, undefined, "assignment expression");
+ this.next();
+ node.right = this.parseMaybeAssign(noIn);
+ return this.finishNode(node, "AssignmentExpression");
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ return left;
+ }
+
+ parseMaybeConditional(noIn, refExpressionErrors, refNeedsArrowPos) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(noIn, refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+ return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (this.eat(types$4.question)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssign();
+ this.expect(types$4.colon);
+ node.alternate = this.parseMaybeAssign(noIn);
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ return expr;
+ }
+
+ parseExprOps(noIn, refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnary(refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ if (this.checkExpressionErrors(refExpressionErrors, false)) {
+ return expr;
+ }
+
+ return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
+ let prec = this.state.type.binop;
+
+ if (prec != null && (!noIn || !this.match(types$4._in))) {
+ if (prec > minPrec) {
+ const operator = this.state.value;
+
+ if (operator === "|>" && this.state.inFSharpPipelineDirectBody) {
+ return left;
+ }
+
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.left = left;
+ node.operator = operator;
+
+ if (operator === "**" && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) {
+ this.raise(left.argument.start, ErrorMessages$1.UnexpectedTokenUnaryExponentiation);
+ }
+
+ const op = this.state.type;
+ const logical = op === types$4.logicalOR || op === types$4.logicalAND;
+ const coalesce = op === types$4.nullishCoalescing;
+
+ if (op === types$4.pipeline) {
+ this.expectPlugin("pipelineOperator");
+ this.state.inPipeline = true;
+ this.checkPipelineAtInfixOperator(left, leftStartPos);
+ } else if (coalesce) {
+ prec = types$4.logicalAND.binop;
+ }
+
+ this.next();
+
+ if (op === types$4.pipeline && this.getPluginOption("pipelineOperator", "proposal") === "minimal") {
+ if (this.match(types$4.name) && this.state.value === "await" && this.prodParam.hasAwait) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnexpectedAwaitAfterPipelineBody);
+ }
+ }
+
+ node.right = this.parseExprOpRightExpr(op, prec, noIn);
+ this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+
+ if (coalesce && (nextOp === types$4.logicalOR || nextOp === types$4.logicalAND) || logical && nextOp === types$4.nullishCoalescing) {
+ throw this.raise(this.state.start, ErrorMessages$1.MixingCoalesceWithLogical);
+ }
+
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
+ }
+ }
+
+ return left;
+ }
+
+ parseExprOpRightExpr(op, prec, noIn) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ switch (op) {
+ case types$4.pipeline:
+ switch (this.getPluginOption("pipelineOperator", "proposal")) {
+ case "smart":
+ return this.withTopicPermittingContext(() => {
+ return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc);
+ });
+
+ case "fsharp":
+ return this.withSoloAwaitPermittingContext(() => {
+ return this.parseFSharpPipelineBody(prec, noIn);
+ });
+ }
+
+ default:
+ return this.parseExprOpBaseRightExpr(op, prec, noIn);
+ }
+ }
+
+ parseExprOpBaseRightExpr(op, prec, noIn) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (this.isContextual("await") && this.isAwaitAllowed()) {
+ return this.parseAwait();
+ } else if (this.state.type.prefix) {
+ const node = this.startNode();
+ const update = this.match(types$4.incDec);
+ node.operator = this.state.value;
+ node.prefix = true;
+
+ if (node.operator === "throw") {
+ this.expectPlugin("throwExpressions");
+ }
+
+ this.next();
+ node.argument = this.parseMaybeUnary();
+ this.checkExpressionErrors(refExpressionErrors, true);
+
+ if (update) {
+ this.checkLVal(node.argument, undefined, undefined, "prefix operation");
+ } else if (this.state.strict && node.operator === "delete") {
+ const arg = node.argument;
+
+ if (arg.type === "Identifier") {
+ this.raise(node.start, ErrorMessages$1.StrictDelete);
+ } else if ((arg.type === "MemberExpression" || arg.type === "OptionalMemberExpression") && arg.property.type === "PrivateName") {
+ this.raise(node.start, ErrorMessages$1.DeletePrivateField);
+ }
+ }
+
+ return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+
+ while (this.state.type.postfix && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.state.value;
+ node.prefix = false;
+ node.argument = expr;
+ this.checkLVal(expr, undefined, undefined, "postfix operation");
+ this.next();
+ expr = this.finishNode(node, "UpdateExpression");
+ }
+
+ return expr;
+ }
+
+ parseExprSubscripts(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ return this.parseSubscripts(expr, startPos, startLoc);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(base),
+ stop: false
+ };
+
+ do {
+ const oldMaybeInAsyncArrowHead = this.state.maybeInAsyncArrowHead;
+
+ if (state.maybeAsyncArrow) {
+ this.state.maybeInAsyncArrowHead = true;
+ }
+
+ base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ this.state.maybeInAsyncArrowHead = oldMaybeInAsyncArrowHead;
+ } while (!state.stop);
+
+ return base;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!noCalls && this.eat(types$4.doubleColon)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.callee = this.parseNoCallExpr();
+ state.stop = true;
+ return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
+ }
+
+ let optional = false;
+
+ if (this.match(types$4.questionDot)) {
+ state.optionalChainMember = optional = true;
+
+ if (noCalls && this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+
+ this.next();
+ }
+
+ const computed = this.eat(types$4.bracketL);
+
+ if (optional && !this.match(types$4.parenL) && !this.match(types$4.backQuote) || computed || this.eat(types$4.dot)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.property = computed ? this.parseExpression() : this.parseMaybePrivateName(true);
+ node.computed = computed;
+
+ if (node.property.type === "PrivateName") {
+ if (node.object.type === "Super") {
+ this.raise(startPos, ErrorMessages$1.SuperPrivateField);
+ }
+
+ this.classScope.usePrivateName(node.property.id.name, node.property.start);
+ }
+
+ if (computed) {
+ this.expect(types$4.bracketR);
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ return this.finishNode(node, "MemberExpression");
+ }
+ } else if (!noCalls && this.match(types$4.parenL)) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.next();
+ let node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+
+ if (optional) {
+ node.optional = true;
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, false);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", node);
+ }
+
+ this.finishCallExpression(node, state.optionalChainMember);
+
+ if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
+ this.checkYieldAwaitInDefaultParams();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ } else {
+ this.toReferencedListDeep(node.arguments);
+ if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
+
+ if (!this.isAwaitAllowed() && !oldMaybeInArrowParameters || oldAwaitPos !== -1) {
+ this.state.awaitPos = oldAwaitPos;
+ }
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ } else if (this.match(types$4.backQuote)) {
+ return this.parseTaggedTemplateExpression(startPos, startLoc, base, state);
+ } else {
+ state.stop = true;
+ return base;
+ }
+ }
+
+ parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.tag = base;
+ node.quasi = this.parseTemplate(true);
+ if (typeArguments) node.typeParameters = typeArguments;
+
+ if (state.optionalChainMember) {
+ this.raise(startPos, ErrorMessages$1.OptionalChainingNoTemplate);
+ }
+
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+
+ atPossibleAsyncArrow(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
+ }
+
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length === 2) {
+ this.expectPlugin("moduleAttributes");
+ }
+
+ if (node.arguments.length === 0 || node.arguments.length > 2) {
+ this.raise(node.start, ErrorMessages$1.ImportCallArity, this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument");
+ } else {
+ for (let _i = 0, _node$arguments = node.arguments; _i < _node$arguments.length; _i++) {
+ const arg = _node$arguments[_i];
+
+ if (arg.type === "SpreadElement") {
+ this.raise(arg.start, ErrorMessages$1.ImportCallSpreadArgument);
+ }
+ }
+ }
+ }
+
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+
+ parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) {
+ const elts = [];
+ let innerParenStart;
+ let first = true;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types$4.comma);
+
+ if (this.match(close)) {
+ if (dynamicImport && !this.hasPlugin("moduleAttributes")) {
+ this.raise(this.state.lastTokStart, ErrorMessages$1.ImportCallArgumentTrailingComma);
+ }
+
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ if (this.match(types$4.parenL) && !innerParenStart) {
+ innerParenStart = this.state.start;
+ }
+
+ elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors$1() : undefined, possibleAsyncArrow ? {
+ start: 0
+ } : undefined, allowPlaceholder));
+ }
+
+ if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
+ this.unexpected();
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return elts;
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(types$4.arrow) && !this.canInsertSemicolon();
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ var _call$extra;
+
+ this.expect(types$4.arrow);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);
+ return node;
+ }
+
+ parseNoCallExpr() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.state.type === types$4.slash) this.readRegexp();
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ let node;
+
+ switch (this.state.type) {
+ case types$4._super:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(types$4.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages$1.SuperNotAllowed);
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages$1.UnexpectedSuper);
+ }
+
+ if (!this.match(types$4.parenL) && !this.match(types$4.bracketL) && !this.match(types$4.dot)) {
+ this.raise(node.start, ErrorMessages$1.UnsupportedSuper);
+ }
+
+ return this.finishNode(node, "Super");
+
+ case types$4._import:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(types$4.dot)) {
+ return this.parseImportMetaProperty(node);
+ }
+
+ if (!this.match(types$4.parenL)) {
+ this.raise(this.state.lastTokStart, ErrorMessages$1.UnsupportedImport);
+ }
+
+ return this.finishNode(node, "Import");
+
+ case types$4._this:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression");
+
+ case types$4.name:
+ {
+ node = this.startNode();
+ const containsEsc = this.state.containsEsc;
+ const id = this.parseIdentifier();
+
+ if (!containsEsc && id.name === "async" && this.match(types$4._function) && !this.canInsertSemicolon()) {
+ const last = this.state.context.length - 1;
+
+ if (this.state.context[last] !== types$1$1.functionStatement) {
+ throw new Error("Internal error");
+ }
+
+ this.state.context[last] = types$1$1.functionExpression;
+ this.next();
+ return this.parseFunction(node, undefined, true);
+ } else if (canBeArrow && !containsEsc && id.name === "async" && this.match(types$4.name) && !this.canInsertSemicolon()) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldMaybeInAsyncArrowHead = this.state.maybeInAsyncArrowHead;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.maybeInAsyncArrowHead = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ const params = [this.parseIdentifier()];
+ this.expect(types$4.arrow);
+ this.checkYieldAwaitInDefaultParams();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.maybeInAsyncArrowHead = oldMaybeInAsyncArrowHead;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ this.parseArrowExpression(node, params, true);
+ return node;
+ }
+
+ if (canBeArrow && this.match(types$4.arrow) && !this.canInsertSemicolon()) {
+ this.next();
+ this.parseArrowExpression(node, [id], false);
+ return node;
+ }
+
+ return id;
+ }
+
+ case types$4._do:
+ {
+ this.expectPlugin("doExpressions");
+ const node = this.startNode();
+ this.next();
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ node.body = this.parseBlock();
+ this.state.labels = oldLabels;
+ return this.finishNode(node, "DoExpression");
+ }
+
+ case types$4.regexp:
+ {
+ const value = this.state.value;
+ node = this.parseLiteral(value.value, "RegExpLiteral");
+ node.pattern = value.pattern;
+ node.flags = value.flags;
+ return node;
+ }
+
+ case types$4.num:
+ return this.parseLiteral(this.state.value, "NumericLiteral");
+
+ case types$4.bigint:
+ return this.parseLiteral(this.state.value, "BigIntLiteral");
+
+ case types$4.string:
+ return this.parseLiteral(this.state.value, "StringLiteral");
+
+ case types$4._null:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "NullLiteral");
+
+ case types$4._true:
+ case types$4._false:
+ return this.parseBooleanLiteral();
+
+ case types$4.parenL:
+ return this.parseParenAndDistinguishExpression(canBeArrow);
+
+ case types$4.bracketBarL:
+ case types$4.bracketHashL:
+ {
+ this.expectPlugin("recordAndTuple");
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ const close = this.state.type === types$4.bracketBarL ? types$4.bracketBarR : types$4.bracketR;
+ this.state.inFSharpPipelineDirectBody = false;
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(close, false, refExpressionErrors, node);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, "TupleExpression");
+ }
+
+ case types$4.bracketL:
+ {
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(types$4.bracketR, true, refExpressionErrors, node);
+
+ if (!this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, "ArrayExpression");
+ }
+
+ case types$4.braceBarL:
+ case types$4.braceHashL:
+ {
+ this.expectPlugin("recordAndTuple");
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ const close = this.state.type === types$4.braceBarL ? types$4.braceBarR : types$4.braceR;
+ this.state.inFSharpPipelineDirectBody = false;
+ const ret = this.parseObj(close, false, true, refExpressionErrors);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ case types$4.braceL:
+ {
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const ret = this.parseObj(types$4.braceR, false, false, refExpressionErrors);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ case types$4._function:
+ return this.parseFunctionExpression();
+
+ case types$4.at:
+ this.parseDecorators();
+
+ case types$4._class:
+ node = this.startNode();
+ this.takeDecorators(node);
+ return this.parseClass(node, false);
+
+ case types$4._new:
+ return this.parseNew();
+
+ case types$4.backQuote:
+ return this.parseTemplate(false);
+
+ case types$4.doubleColon:
+ {
+ node = this.startNode();
+ this.next();
+ node.object = null;
+ const callee = node.callee = this.parseNoCallExpr();
+
+ if (callee.type === "MemberExpression") {
+ return this.finishNode(node, "BindExpression");
+ } else {
+ throw this.raise(callee.start, ErrorMessages$1.UnsupportedBind);
+ }
+ }
+
+ case types$4.hash:
+ {
+ if (this.state.inPipeline) {
+ node = this.startNode();
+
+ if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") {
+ this.raise(node.start, ErrorMessages$1.PrimaryTopicRequiresSmartPipeline);
+ }
+
+ this.next();
+
+ if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {
+ this.raise(node.start, ErrorMessages$1.PrimaryTopicNotAllowed);
+ }
+
+ this.registerTopicReference();
+ return this.finishNode(node, "PipelinePrimaryTopicReference");
+ }
+
+ const nextCh = this.input.codePointAt(this.state.end);
+
+ if (isIdentifierStart$1(nextCh) || nextCh === 92) {
+ const start = this.state.start;
+ node = this.parseMaybePrivateName(true);
+
+ if (this.match(types$4._in)) {
+ this.expectPlugin("privateIn");
+ this.classScope.usePrivateName(node.id.name, node.start);
+ } else if (this.hasPlugin("privateIn")) {
+ this.raise(this.state.start, ErrorMessages$1.PrivateInExpectedIn, node.id.name);
+ } else {
+ throw this.unexpected(start);
+ }
+
+ return node;
+ }
+ }
+
+ case types$4.relational:
+ {
+ if (this.state.value === "<") {
+ throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
+ }
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ parseBooleanLiteral() {
+ const node = this.startNode();
+ node.value = this.match(types$4._true);
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+
+ parseMaybePrivateName(isPrivateNameAllowed) {
+ const isPrivate = this.match(types$4.hash);
+
+ if (isPrivate) {
+ this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]);
+
+ if (!isPrivateNameAllowed) {
+ this.raise(this.state.pos, ErrorMessages$1.UnexpectedPrivateField);
+ }
+
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace("Unexpected space between # and identifier");
+ node.id = this.parseIdentifier(true);
+ return this.finishNode(node, "PrivateName");
+ } else {
+ return this.parseIdentifier(true);
+ }
+ }
+
+ parseFunctionExpression() {
+ const node = this.startNode();
+ let meta = this.startNode();
+ this.next();
+ meta = this.createIdentifier(meta, "function");
+
+ if (this.prodParam.hasYield && this.eat(types$4.dot)) {
+ return this.parseMetaProperty(node, meta, "sent");
+ }
+
+ return this.parseFunction(node);
+ }
+
+ parseMetaProperty(node, meta, propertyName) {
+ node.meta = meta;
+
+ if (meta.name === "function" && propertyName === "sent") {
+ if (this.isContextual(propertyName)) {
+ this.expectPlugin("functionSent");
+ } else if (!this.hasPlugin("functionSent")) {
+ this.unexpected();
+ }
+ }
+
+ const containsEsc = this.state.containsEsc;
+ node.property = this.parseIdentifier(true);
+
+ if (node.property.name !== propertyName || containsEsc) {
+ this.raise(node.property.start, ErrorMessages$1.UnsupportedMetaProperty, meta.name, propertyName);
+ }
+
+ return this.finishNode(node, "MetaProperty");
+ }
+
+ parseImportMetaProperty(node) {
+ const id = this.createIdentifier(this.startNodeAtNode(node), "import");
+ this.expect(types$4.dot);
+
+ if (this.isContextual("meta")) {
+ if (!this.inModule) {
+ this.raiseWithData(id.start, {
+ code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ }, ErrorMessages$1.ImportMetaOutsideModule);
+ }
+
+ this.sawUnambiguousESM = true;
+ }
+
+ return this.parseMetaProperty(node, id, "meta");
+ }
+
+ parseLiteral(value, type, startPos, startLoc) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ const node = this.startNodeAt(startPos, startLoc);
+ this.addExtra(node, "rawValue", value);
+ this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
+ node.value = value;
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let val;
+ this.expect(types$4.parenL);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartPos = this.state.start;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors$1();
+ const refNeedsArrowPos = {
+ start: 0
+ };
+ let first = true;
+ let spreadStart;
+ let optionalCommaStart;
+
+ while (!this.match(types$4.parenR)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types$4.comma, refNeedsArrowPos.start || null);
+
+ if (this.match(types$4.parenR)) {
+ optionalCommaStart = this.state.start;
+ break;
+ }
+ }
+
+ if (this.match(types$4.ellipsis)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ spreadStart = this.state.start;
+ exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));
+ this.checkCommaAfterRest(41);
+ break;
+ } else {
+ exprList.push(this.parseMaybeAssign(false, refExpressionErrors, this.parseParenItem, refNeedsArrowPos));
+ }
+ }
+
+ const innerEndPos = this.state.start;
+ const innerEndLoc = this.state.startLoc;
+ this.expect(types$4.parenR);
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let arrowNode = this.startNodeAt(startPos, startLoc);
+
+ if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
+ if (!this.isAwaitAllowed() && !this.state.maybeInAsyncArrowHead) {
+ this.state.awaitPos = oldAwaitPos;
+ }
+
+ this.checkYieldAwaitInDefaultParams();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+
+ for (let _i2 = 0; _i2 < exprList.length; _i2++) {
+ const param = exprList[_i2];
+
+ if (param.extra && param.extra.parenthesized) {
+ this.unexpected(param.extra.parenStart);
+ }
+ }
+
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+
+ if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
+ if (oldAwaitPos !== -1) this.state.awaitPos = oldAwaitPos;
+
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStart);
+ }
+
+ if (optionalCommaStart) this.unexpected(optionalCommaStart);
+ if (spreadStart) this.unexpected(spreadStart);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);
+ this.toReferencedListDeep(exprList, true);
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(val, "parenthesized", true);
+ this.addExtra(val, "parenStart", startPos);
+ return val;
+ }
+
+ const parenExpression = this.startNodeAt(startPos, startLoc);
+ parenExpression.expression = val;
+ this.finishNode(parenExpression, "ParenthesizedExpression");
+ return parenExpression;
+ }
+
+ shouldParseArrow() {
+ return !this.canInsertSemicolon();
+ }
+
+ parseArrow(node) {
+ if (this.eat(types$4.arrow)) {
+ return node;
+ }
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ return node;
+ }
+
+ parseNew() {
+ const node = this.startNode();
+ let meta = this.startNode();
+ this.next();
+ meta = this.createIdentifier(meta, "new");
+
+ if (this.eat(types$4.dot)) {
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
+ let error = ErrorMessages$1.UnexpectedNewTarget;
+
+ if (this.hasPlugin("classProperties")) {
+ error += " or class properties";
+ }
+
+ this.raise(metaProp.start, error);
+ }
+
+ return metaProp;
+ }
+
+ node.callee = this.parseNoCallExpr();
+
+ if (node.callee.type === "Import") {
+ this.raise(node.callee.start, ErrorMessages$1.ImportCallNotNewExpression);
+ } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") {
+ this.raise(this.state.lastTokEnd, ErrorMessages$1.OptionalChainingNoNew);
+ } else if (this.eat(types$4.questionDot)) {
+ this.raise(this.state.start, ErrorMessages$1.OptionalChainingNoNew);
+ }
+
+ this.parseNewArguments(node);
+ return this.finishNode(node, "NewExpression");
+ }
+
+ parseNewArguments(node) {
+ if (this.eat(types$4.parenL)) {
+ const args = this.parseExprList(types$4.parenR);
+ this.toReferencedList(args);
+ node.arguments = args;
+ } else {
+ node.arguments = [];
+ }
+ }
+
+ parseTemplateElement(isTagged) {
+ const elem = this.startNode();
+
+ if (this.state.value === null) {
+ if (!isTagged) {
+ this.raise(this.state.start + 1, ErrorMessages$1.InvalidEscapeSequenceTemplate);
+ }
+ }
+
+ elem.value = {
+ raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
+ cooked: this.state.value
+ };
+ this.next();
+ elem.tail = this.match(types$4.backQuote);
+ return this.finishNode(elem, "TemplateElement");
+ }
+
+ parseTemplate(isTagged) {
+ const node = this.startNode();
+ this.next();
+ node.expressions = [];
+ let curElt = this.parseTemplateElement(isTagged);
+ node.quasis = [curElt];
+
+ while (!curElt.tail) {
+ this.expect(types$4.dollarBraceL);
+ node.expressions.push(this.parseExpression());
+ this.expect(types$4.braceR);
+ node.quasis.push(curElt = this.parseTemplateElement(isTagged));
+ }
+
+ this.next();
+ return this.finishNode(node, "TemplateLiteral");
+ }
+
+ parseObj(close, isPattern, isRecord, refExpressionErrors) {
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types$4.comma);
+
+ if (this.match(close)) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStart);
+ this.next();
+ break;
+ }
+ }
+
+ const prop = this.parseObjectMember(isPattern, refExpressionErrors);
+
+ if (!isPattern) {
+ this.checkProto(prop, isRecord, propHash, refExpressionErrors);
+ }
+
+ if (isRecord && prop.type !== "ObjectProperty" && prop.type !== "SpreadElement") {
+ this.raise(prop.start, ErrorMessages$1.InvalidRecordProperty);
+ }
+
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+
+ node.properties.push(prop);
+ }
+
+ let type = "ObjectExpression";
+
+ if (isPattern) {
+ type = "ObjectPattern";
+ } else if (isRecord) {
+ type = "RecordExpression";
+ }
+
+ return this.finishNode(node, type);
+ }
+
+ isAsyncProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.isLiteralPropertyName() || this.match(types$4.bracketL) || this.match(types$4.star)) && !this.hasPrecedingLineBreak();
+ }
+
+ parseObjectMember(isPattern, refExpressionErrors) {
+ let decorators = [];
+
+ if (this.match(types$4.at)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages$1.UnsupportedPropertyDecorator);
+ }
+
+ while (this.match(types$4.at)) {
+ decorators.push(this.parseDecorator());
+ }
+ }
+
+ const prop = this.startNode();
+ let isGenerator = false;
+ let isAsync = false;
+ let startPos;
+ let startLoc;
+
+ if (this.match(types$4.ellipsis)) {
+ if (decorators.length) this.unexpected();
+
+ if (isPattern) {
+ this.next();
+ prop.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(prop, "RestElement");
+ }
+
+ return this.parseSpread();
+ }
+
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+
+ prop.method = false;
+
+ if (isPattern || refExpressionErrors) {
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ }
+
+ if (!isPattern) {
+ isGenerator = this.eat(types$4.star);
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.parsePropertyName(prop, false);
+
+ if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) {
+ isAsync = true;
+ isGenerator = this.eat(types$4.star);
+ this.parsePropertyName(prop, false);
+ } else {
+ isAsync = false;
+ }
+
+ this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc);
+ return prop;
+ }
+
+ isGetterOrSetterMethod(prop, isPattern) {
+ return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.isLiteralPropertyName() || this.match(types$4.bracketL));
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ return method.kind === "get" ? 0 : 1;
+ }
+
+ checkGetterSetterParams(method) {
+ const paramCount = this.getGetterSetterExpectedParamCount(method);
+ const start = method.start;
+
+ if (method.params.length !== paramCount) {
+ if (method.kind === "get") {
+ this.raise(start, ErrorMessages$1.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages$1.BadSetterArity);
+ }
+ }
+
+ if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") {
+ this.raise(start, ErrorMessages$1.BadSetterRestParameter);
+ }
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
+ if (isAsync || isGenerator || this.match(types$4.parenL)) {
+ if (isPattern) this.unexpected();
+ prop.kind = "method";
+ prop.method = true;
+ return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
+ }
+
+ if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) {
+ if (isGenerator || isAsync) this.unexpected();
+ prop.kind = prop.key.name;
+ this.parsePropertyName(prop, false);
+ this.parseMethod(prop, false, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(prop);
+ return prop;
+ }
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+
+ if (this.eat(types$4.colon)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refExpressionErrors);
+ return this.finishNode(prop, "ObjectProperty");
+ }
+
+ if (!prop.computed && prop.key.type === "Identifier") {
+ this.checkReservedWord(prop.key.name, prop.key.start, true, true);
+
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
+ } else if (this.match(types$4.eq) && refExpressionErrors) {
+ if (refExpressionErrors.shorthandAssign === -1) {
+ refExpressionErrors.shorthandAssign = this.state.start;
+ }
+
+ prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
+ } else {
+ prop.value = prop.key.__clone();
+ }
+
+ prop.shorthand = true;
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+
+ parsePropertyName(prop, isPrivateNameAllowed) {
+ if (this.eat(types$4.bracketL)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssign();
+ this.expect(types$4.bracketR);
+ } else {
+ const oldInPropertyName = this.state.inPropertyName;
+ this.state.inPropertyName = true;
+ prop.key = this.match(types$4.num) || this.match(types$4.string) || this.match(types$4.bigint) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);
+
+ if (prop.key.type !== "PrivateName") {
+ prop.computed = false;
+ }
+
+ this.state.inPropertyName = oldInPropertyName;
+ }
+
+ return prop.key;
+ }
+
+ initFunction(node, isAsync) {
+ node.id = null;
+ node.generator = false;
+ node.async = !!isAsync;
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.initFunction(node, isAsync);
+ node.generator = !!isGenerator;
+ const allowModifiers = isConstructor;
+ this.scope.enter(SCOPE_FUNCTION$1 | SCOPE_SUPER$1 | (inClassScope ? SCOPE_CLASS$1 : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER$1 : 0));
+ this.prodParam.enter(functionFlags$1(isAsync, node.generator));
+ this.parseFunctionParams(node, allowModifiers);
+ this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return node;
+ }
+
+ parseArrowExpression(node, params, isAsync, trailingCommaPos) {
+ this.scope.enter(SCOPE_FUNCTION$1 | SCOPE_ARROW$1);
+ this.prodParam.enter(functionFlags$1(isAsync, false));
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaPos);
+ }
+
+ this.state.maybeInArrowParameters = false;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+
+ setArrowFunctionParameters(node, params, trailingCommaPos) {
+ node.params = this.toAssignableList(params, trailingCommaPos);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ this.parseFunctionBody(node, false, isMethod);
+ this.finishNode(node, type);
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ const isExpression = allowExpression && !this.match(types$4.braceL);
+ const oldInParameters = this.state.inParameters;
+ this.state.inParameters = false;
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const oldStrict = this.state.strict;
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN$1);
+ node.body = this.parseBlock(true, false, hasStrictModeDirective => {
+ const nonSimple = !this.isSimpleParamList(node.params);
+
+ if (hasStrictModeDirective && nonSimple) {
+ const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start;
+ this.raise(errorPos, ErrorMessages$1.IllegalLanguageModeDirective);
+ }
+
+ const strictModeChanged = !oldStrict && this.state.strict;
+ this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
+
+ if (this.state.strict && node.id) {
+ this.checkLVal(node.id, BIND_OUTSIDE$1, undefined, "function name", undefined, strictModeChanged);
+ }
+ });
+ this.prodParam.exit();
+ this.state.labels = oldLabels;
+ }
+
+ this.state.inParameters = oldInParameters;
+ }
+
+ isSimpleParamList(params) {
+ for (let i = 0, len = params.length; i < len; i++) {
+ if (params[i].type !== "Identifier") return false;
+ }
+
+ return true;
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ const nameHash = Object.create(null);
+
+ for (let i = 0; i < node.params.length; i++) {
+ this.checkLVal(node.params[i], BIND_VAR$1, allowDuplicates ? null : nameHash, "function parameter list", undefined, strictModeChanged);
+ }
+ }
+
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types$4.comma);
+
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+
+ return elts;
+ }
+
+ parseExprListItem(allowEmpty, refExpressionErrors, refNeedsArrowPos, allowPlaceholder) {
+ let elt;
+
+ if (this.match(types$4.comma)) {
+ if (!allowEmpty) {
+ this.raise(this.state.pos, ErrorMessages$1.UnexpectedToken, ",");
+ }
+
+ elt = null;
+ } else if (this.match(types$4.ellipsis)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc);
+ } else if (this.match(types$4.question)) {
+ this.expectPlugin("partialApplication");
+
+ if (!allowPlaceholder) {
+ this.raise(this.state.start, ErrorMessages$1.UnexpectedArgumentPlaceholder);
+ }
+
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssign(false, refExpressionErrors, this.parseParenItem, refNeedsArrowPos);
+ }
+
+ return elt;
+ }
+
+ parseIdentifier(liberal) {
+ const node = this.startNode();
+ const name = this.parseIdentifierName(node.start, liberal);
+ return this.createIdentifier(node, name);
+ }
+
+ createIdentifier(node, name) {
+ node.name = name;
+ node.loc.identifierName = name;
+ return this.finishNode(node, "Identifier");
+ }
+
+ parseIdentifierName(pos, liberal) {
+ let name;
+
+ if (this.match(types$4.name)) {
+ name = this.state.value;
+ } else if (this.state.type.keyword) {
+ name = this.state.type.keyword;
+ const context = this.state.context;
+
+ if ((name === "class" || name === "function") && context[context.length - 1].token === "function") {
+ context.pop();
+ }
+ } else {
+ throw this.unexpected();
+ }
+
+ if (liberal) {
+ this.state.type = types$4.name;
+ } else {
+ this.checkReservedWord(name, this.state.start, !!this.state.type.keyword, false);
+ }
+
+ this.next();
+ return name;
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (this.prodParam.hasYield && word === "yield") {
+ this.raise(startLoc, ErrorMessages$1.YieldBindingIdentifier);
+ return;
+ }
+
+ if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(startLoc, ErrorMessages$1.AwaitBindingIdentifier);
+ return;
+ }
+
+ if (this.state.awaitPos === -1 && (this.state.maybeInAsyncArrowHead || this.isAwaitAllowed())) {
+ this.state.awaitPos = this.state.start;
+ }
+ }
+
+ if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") {
+ this.raise(startLoc, ErrorMessages$1.ArgumentsDisallowedInInitializer);
+ return;
+ }
+
+ if (checkKeywords && isKeyword$1(word)) {
+ this.raise(startLoc, ErrorMessages$1.UnexpectedKeyword, word);
+ return;
+ }
+
+ const reservedTest = !this.state.strict ? isReservedWord$1 : isBinding ? isStrictBindReservedWord$1 : isStrictReservedWord$1;
+
+ if (reservedTest(word, this.inModule)) {
+ if (!this.prodParam.hasAwait && word === "await") {
+ this.raise(startLoc, ErrorMessages$1.AwaitNotInAsyncFunction);
+ } else {
+ this.raise(startLoc, ErrorMessages$1.UnexpectedReservedWord, word);
+ }
+ }
+ }
+
+ isAwaitAllowed() {
+ if (this.scope.inFunction) return this.prodParam.hasAwait;
+ if (this.options.allowAwaitOutsideFunction) return true;
+
+ if (this.hasPlugin("topLevelAwait")) {
+ return this.inModule && this.prodParam.hasAwait;
+ }
+
+ return false;
+ }
+
+ parseAwait() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.state.inParameters) {
+ this.raise(node.start, ErrorMessages$1.AwaitExpressionFormalParameter);
+ } else if (this.state.awaitPos === -1) {
+ this.state.awaitPos = node.start;
+ }
+
+ if (this.eat(types$4.star)) {
+ this.raise(node.start, ErrorMessages$1.ObsoleteAwaitStar);
+ }
+
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.hasPrecedingLineBreak() || this.match(types$4.plusMin) || this.match(types$4.parenL) || this.match(types$4.bracketL) || this.match(types$4.backQuote) || this.match(types$4.regexp) || this.match(types$4.slash) || this.hasPlugin("v8intrinsic") && this.match(types$4.modulo)) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary();
+ }
+
+ return this.finishNode(node, "AwaitExpression");
+ }
+
+ parseYield(noIn) {
+ const node = this.startNode();
+
+ if (this.state.inParameters) {
+ this.raise(node.start, ErrorMessages$1.YieldInParameter);
+ } else if (this.state.yieldPos === -1) {
+ this.state.yieldPos = node.start;
+ }
+
+ this.next();
+
+ if (this.match(types$4.semi) || !this.match(types$4.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) {
+ node.delegate = false;
+ node.argument = null;
+ } else {
+ node.delegate = this.eat(types$4.star);
+ node.argument = this.parseMaybeAssign(noIn);
+ }
+
+ return this.finishNode(node, "YieldExpression");
+ }
+
+ checkPipelineAtInfixOperator(left, leftStartPos) {
+ if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
+ if (left.type === "SequenceExpression") {
+ this.raise(leftStartPos, ErrorMessages$1.PipelineHeadSequenceExpression);
+ }
+ }
+ }
+
+ parseSmartPipelineBody(childExpression, startPos, startLoc) {
+ const pipelineStyle = this.checkSmartPipelineBodyStyle(childExpression);
+ this.checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos);
+ return this.parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc);
+ }
+
+ checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos) {
+ if (this.match(types$4.arrow)) {
+ throw this.raise(this.state.start, ErrorMessages$1.PipelineBodyNoArrow);
+ } else if (pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression") {
+ this.raise(startPos, ErrorMessages$1.PipelineBodySequenceExpression);
+ }
+ }
+
+ parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc) {
+ const bodyNode = this.startNodeAt(startPos, startLoc);
+
+ switch (pipelineStyle) {
+ case "PipelineBareFunction":
+ bodyNode.callee = childExpression;
+ break;
+
+ case "PipelineBareConstructor":
+ bodyNode.callee = childExpression.callee;
+ break;
+
+ case "PipelineBareAwaitedFunction":
+ bodyNode.callee = childExpression.argument;
+ break;
+
+ case "PipelineTopicExpression":
+ if (!this.topicReferenceWasUsedInCurrentTopicContext()) {
+ this.raise(startPos, ErrorMessages$1.PipelineTopicUnused);
+ }
+
+ bodyNode.expression = childExpression;
+ break;
+
+ default:
+ throw new Error(`Internal @babel/parser error: Unknown pipeline style (${pipelineStyle})`);
+ }
+
+ return this.finishNode(bodyNode, pipelineStyle);
+ }
+
+ checkSmartPipelineBodyStyle(expression) {
+ switch (expression.type) {
+ default:
+ return this.isSimpleReference(expression) ? "PipelineBareFunction" : "PipelineTopicExpression";
+ }
+ }
+
+ isSimpleReference(expression) {
+ switch (expression.type) {
+ case "MemberExpression":
+ return !expression.computed && this.isSimpleReference(expression.object);
+
+ case "Identifier":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ withTopicPermittingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withTopicForbiddingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withSoloAwaitPermittingContext(callback) {
+ const outerContextSoloAwaitState = this.state.soloAwait;
+ this.state.soloAwait = true;
+
+ try {
+ return callback();
+ } finally {
+ this.state.soloAwait = outerContextSoloAwaitState;
+ }
+ }
+
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+
+ primaryTopicReferenceIsAllowedInCurrentTopicContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+
+ topicReferenceWasUsedInCurrentTopicContext() {
+ return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
+ }
+
+ parseFSharpPipelineBody(prec, noIn) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ };
+
+ const loopLabel$1 = {
+ kind: "loop"
+ },
+ switchLabel$1 = {
+ kind: "switch"
+ };
+ const FUNC_NO_FLAGS$1 = 0b000,
+ FUNC_STATEMENT$1 = 0b001,
+ FUNC_HANGING_STATEMENT$1 = 0b010,
+ FUNC_NULLABLE_ID$1 = 0b100;
+ let StatementParser$1 = class StatementParser extends ExpressionParser$1 {
+ parseTopLevel(file, program) {
+ program.sourceType = this.options.sourceType;
+ program.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(program, true, true, types$4.eof);
+
+ if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
+ for (let _i = 0, _Array$from = Array.from(this.scope.undefinedExports); _i < _Array$from.length; _i++) {
+ const [name] = _Array$from[_i];
+ const pos = this.scope.undefinedExports.get(name);
+ this.raise(pos, ErrorMessages$1.ModuleExportUndefined, name);
+ }
+ }
+
+ file.program = this.finishNode(program, "Program");
+ file.comments = this.state.comments;
+ if (this.options.tokens) file.tokens = this.tokens;
+ return this.finishNode(file, "File");
+ }
+
+ stmtToDirective(stmt) {
+ const expr = stmt.expression;
+ const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
+ const directive = this.startNodeAt(stmt.start, stmt.loc.start);
+ const raw = this.input.slice(expr.start, expr.end);
+ const val = directiveLiteral.value = raw.slice(1, -1);
+ this.addExtra(directiveLiteral, "raw", raw);
+ this.addExtra(directiveLiteral, "rawValue", val);
+ directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
+ return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
+ }
+
+ parseInterpreterDirective() {
+ if (!this.match(types$4.interpreterDirective)) {
+ return null;
+ }
+
+ const node = this.startNode();
+ node.value = this.state.value;
+ this.next();
+ return this.finishNode(node, "InterpreterDirective");
+ }
+
+ isLet(context) {
+ if (!this.isContextual("let")) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const nextCh = this.input.charCodeAt(next);
+ if (nextCh === 91) return true;
+ if (context) return false;
+ if (nextCh === 123) return true;
+
+ if (isIdentifierStart$1(nextCh)) {
+ let pos = next + 1;
+
+ while (isIdentifierChar$1(this.input.charCodeAt(pos))) {
+ ++pos;
+ }
+
+ const ident = this.input.slice(next, pos);
+ if (!keywordRelationalOperator$1.test(ident)) return true;
+ }
+
+ return false;
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.match(types$4.at)) {
+ this.parseDecorators(true);
+ }
+
+ return this.parseStatementContent(context, topLevel);
+ }
+
+ parseStatementContent(context, topLevel) {
+ let starttype = this.state.type;
+ const node = this.startNode();
+ let kind;
+
+ if (this.isLet(context)) {
+ starttype = types$4._var;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case types$4._break:
+ case types$4._continue:
+ return this.parseBreakContinueStatement(node, starttype.keyword);
+
+ case types$4._debugger:
+ return this.parseDebuggerStatement(node);
+
+ case types$4._do:
+ return this.parseDoStatement(node);
+
+ case types$4._for:
+ return this.parseForStatement(node);
+
+ case types$4._function:
+ if (this.lookaheadCharCode() === 46) break;
+
+ if (context) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages$1.StrictFunction);
+ } else if (context !== "if" && context !== "label") {
+ this.raise(this.state.start, ErrorMessages$1.SloppyFunction);
+ }
+ }
+
+ return this.parseFunctionStatement(node, false, !context);
+
+ case types$4._class:
+ if (context) this.unexpected();
+ return this.parseClass(node, true);
+
+ case types$4._if:
+ return this.parseIfStatement(node);
+
+ case types$4._return:
+ return this.parseReturnStatement(node);
+
+ case types$4._switch:
+ return this.parseSwitchStatement(node);
+
+ case types$4._throw:
+ return this.parseThrowStatement(node);
+
+ case types$4._try:
+ return this.parseTryStatement(node);
+
+ case types$4._const:
+ case types$4._var:
+ kind = kind || this.state.value;
+
+ if (context && kind !== "var") {
+ this.raise(this.state.start, ErrorMessages$1.UnexpectedLexicalDeclaration);
+ }
+
+ return this.parseVarStatement(node, kind);
+
+ case types$4._while:
+ return this.parseWhileStatement(node);
+
+ case types$4._with:
+ return this.parseWithStatement(node);
+
+ case types$4.braceL:
+ return this.parseBlock();
+
+ case types$4.semi:
+ return this.parseEmptyStatement(node);
+
+ case types$4._export:
+ case types$4._import:
+ {
+ const nextTokenCharCode = this.lookaheadCharCode();
+
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(this.state.start, ErrorMessages$1.UnexpectedImportExport);
+ }
+
+ this.next();
+ let result;
+
+ if (starttype === types$4._import) {
+ result = this.parseImport(node);
+
+ if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ result = this.parseExport(node);
+
+ if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ this.assertModuleNodeAllowed(node);
+ return result;
+ }
+
+ default:
+ {
+ if (this.isAsyncFunction()) {
+ if (context) {
+ this.raise(this.state.start, ErrorMessages$1.AsyncFunctionInSingleStatementContext);
+ }
+
+ this.next();
+ return this.parseFunctionStatement(node, true, !context);
+ }
+ }
+ }
+
+ const maybeName = this.state.value;
+ const expr = this.parseExpression();
+
+ if (starttype === types$4.name && expr.type === "Identifier" && this.eat(types$4.colon)) {
+ return this.parseLabeledStatement(node, maybeName, expr, context);
+ } else {
+ return this.parseExpressionStatement(node, expr);
+ }
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raiseWithData(node.start, {
+ code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ }, ErrorMessages$1.ImportOutsideModule);
+ }
+ }
+
+ takeDecorators(node) {
+ const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (decorators.length) {
+ node.decorators = decorators;
+ this.resetStartLocationFromNode(node, decorators[0]);
+ this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
+ }
+ }
+
+ canHaveLeadingDecorator() {
+ return this.match(types$4._class);
+ }
+
+ parseDecorators(allowExport) {
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ while (this.match(types$4.at)) {
+ const decorator = this.parseDecorator();
+ currentContextDecorators.push(decorator);
+ }
+
+ if (this.match(types$4._export)) {
+ if (!allowExport) {
+ this.unexpected();
+ }
+
+ if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, ErrorMessages$1.DecoratorExportClass);
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnexpectedLeadingDecorator);
+ }
+ }
+
+ parseDecorator() {
+ this.expectOnePlugin(["decorators-legacy", "decorators"]);
+ const node = this.startNode();
+ this.next();
+
+ if (this.hasPlugin("decorators")) {
+ this.state.decoratorStack.push([]);
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr;
+
+ if (this.eat(types$4.parenL)) {
+ expr = this.parseExpression();
+ this.expect(types$4.parenR);
+ } else {
+ expr = this.parseIdentifier(false);
+
+ while (this.eat(types$4.dot)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = expr;
+ node.property = this.parseIdentifier(true);
+ node.computed = false;
+ expr = this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ this.state.decoratorStack.pop();
+ } else {
+ node.expression = this.parseExprSubscripts();
+ }
+
+ return this.finishNode(node, "Decorator");
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.eat(types$4.parenL)) {
+ const node = this.startNodeAtNode(expr);
+ node.callee = expr;
+ node.arguments = this.parseCallExpressionArguments(types$4.parenR, false);
+ this.toReferencedList(node.arguments);
+ return this.finishNode(node, "CallExpression");
+ }
+
+ return expr;
+ }
+
+ parseBreakContinueStatement(node, keyword) {
+ const isBreak = keyword === "break";
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.label = null;
+ } else {
+ node.label = this.parseIdentifier();
+ this.semicolon();
+ }
+
+ this.verifyBreakContinue(node, keyword);
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+ }
+
+ verifyBreakContinue(node, keyword) {
+ const isBreak = keyword === "break";
+ let i;
+
+ for (i = 0; i < this.state.labels.length; ++i) {
+ const lab = this.state.labels[i];
+
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
+ if (node.label && isBreak) break;
+ }
+ }
+
+ if (i === this.state.labels.length) {
+ this.raise(node.start, ErrorMessages$1.IllegalBreakContinue, keyword);
+ }
+ }
+
+ parseDebuggerStatement(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement");
+ }
+
+ parseHeaderExpression() {
+ this.expect(types$4.parenL);
+ const val = this.parseExpression();
+ this.expect(types$4.parenR);
+ return val;
+ }
+
+ parseDoStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel$1);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("do"));
+ this.state.labels.pop();
+ this.expect(types$4._while);
+ node.test = this.parseHeaderExpression();
+ this.eat(types$4.semi);
+ return this.finishNode(node, "DoWhileStatement");
+ }
+
+ parseForStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel$1);
+ let awaitAt = -1;
+
+ if (this.isAwaitAllowed() && this.eatContextual("await")) {
+ awaitAt = this.state.lastTokStart;
+ }
+
+ this.scope.enter(SCOPE_OTHER$1);
+ this.expect(types$4.parenL);
+
+ if (this.match(types$4.semi)) {
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, null);
+ }
+
+ const isLet = this.isLet();
+
+ if (this.match(types$4._var) || this.match(types$4._const) || isLet) {
+ const init = this.startNode();
+ const kind = isLet ? "let" : this.state.value;
+ this.next();
+ this.parseVar(init, true, kind);
+ this.finishNode(init, "VariableDeclaration");
+
+ if ((this.match(types$4._in) || this.isContextual("of")) && init.declarations.length === 1) {
+ return this.parseForIn(node, init, awaitAt);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ const refExpressionErrors = new ExpressionErrors$1();
+ const init = this.parseExpression(true, refExpressionErrors);
+
+ if (this.match(types$4._in) || this.isContextual("of")) {
+ this.toAssignable(init);
+ const description = this.isContextual("of") ? "for-of statement" : "for-in statement";
+ this.checkLVal(init, undefined, undefined, description);
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ parseFunctionStatement(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT$1 | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT$1), isAsync);
+ }
+
+ parseIfStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(types$4._else) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement");
+ }
+
+ parseReturnStatement(node) {
+ if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(this.state.start, ErrorMessages$1.IllegalReturn);
+ }
+
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.argument = null;
+ } else {
+ node.argument = this.parseExpression();
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "ReturnStatement");
+ }
+
+ parseSwitchStatement(node) {
+ this.next();
+ node.discriminant = this.parseHeaderExpression();
+ const cases = node.cases = [];
+ this.expect(types$4.braceL);
+ this.state.labels.push(switchLabel$1);
+ this.scope.enter(SCOPE_OTHER$1);
+ let cur;
+
+ for (let sawDefault; !this.match(types$4.braceR);) {
+ if (this.match(types$4._case) || this.match(types$4._default)) {
+ const isCase = this.match(types$4._case);
+ if (cur) this.finishNode(cur, "SwitchCase");
+ cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) {
+ this.raise(this.state.lastTokStart, ErrorMessages$1.MultipleDefaultsInSwitch);
+ }
+
+ sawDefault = true;
+ cur.test = null;
+ }
+
+ this.expect(types$4.colon);
+ } else {
+ if (cur) {
+ cur.consequent.push(this.parseStatement(null));
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+
+ this.scope.exit();
+ if (cur) this.finishNode(cur, "SwitchCase");
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(node, "SwitchStatement");
+ }
+
+ parseThrowStatement(node) {
+ this.next();
+
+ if (lineBreak$1.test(this.input.slice(this.state.lastTokEnd, this.state.start))) {
+ this.raise(this.state.lastTokEnd, ErrorMessages$1.NewlineAfterThrow);
+ }
+
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement");
+ }
+
+ parseTryStatement(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+
+ if (this.match(types$4._catch)) {
+ const clause = this.startNode();
+ this.next();
+
+ if (this.match(types$4.parenL)) {
+ this.expect(types$4.parenL);
+ clause.param = this.parseBindingAtom();
+ const simple = clause.param.type === "Identifier";
+ this.scope.enter(simple ? SCOPE_SIMPLE_CATCH$1 : 0);
+ this.checkLVal(clause.param, BIND_LEXICAL$1, null, "catch clause");
+ this.expect(types$4.parenR);
+ } else {
+ clause.param = null;
+ this.scope.enter(SCOPE_OTHER$1);
+ }
+
+ clause.body = this.withTopicForbiddingContext(() => this.parseBlock(false, false));
+ this.scope.exit();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+
+ node.finalizer = this.eat(types$4._finally) ? this.parseBlock() : null;
+
+ if (!node.handler && !node.finalizer) {
+ this.raise(node.start, ErrorMessages$1.NoCatchOrFinally);
+ }
+
+ return this.finishNode(node, "TryStatement");
+ }
+
+ parseVarStatement(node, kind) {
+ this.next();
+ this.parseVar(node, false, kind);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration");
+ }
+
+ parseWhileStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ this.state.labels.push(loopLabel$1);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("while"));
+ this.state.labels.pop();
+ return this.finishNode(node, "WhileStatement");
+ }
+
+ parseWithStatement(node) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages$1.StrictWith);
+ }
+
+ this.next();
+ node.object = this.parseHeaderExpression();
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("with"));
+ return this.finishNode(node, "WithStatement");
+ }
+
+ parseEmptyStatement(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement");
+ }
+
+ parseLabeledStatement(node, maybeName, expr, context) {
+ for (let _i2 = 0, _this$state$labels = this.state.labels; _i2 < _this$state$labels.length; _i2++) {
+ const label = _this$state$labels[_i2];
+
+ if (label.name === maybeName) {
+ this.raise(expr.start, ErrorMessages$1.LabelRedeclaration, maybeName);
+ }
+ }
+
+ const kind = this.state.type.isLoop ? "loop" : this.match(types$4._switch) ? "switch" : null;
+
+ for (let i = this.state.labels.length - 1; i >= 0; i--) {
+ const label = this.state.labels[i];
+
+ if (label.statementStart === node.start) {
+ label.statementStart = this.state.start;
+ label.kind = kind;
+ } else {
+ break;
+ }
+ }
+
+ this.state.labels.push({
+ name: maybeName,
+ kind: kind,
+ statementStart: this.state.start
+ });
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.state.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement");
+ }
+
+ parseExpressionStatement(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement");
+ }
+
+ parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
+ const node = this.startNode();
+ this.expect(types$4.braceL);
+
+ if (createNewLexicalScope) {
+ this.scope.enter(SCOPE_OTHER$1);
+ }
+
+ this.parseBlockBody(node, allowDirectives, false, types$4.braceR, afterBlockParse);
+
+ if (createNewLexicalScope) {
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "BlockStatement");
+ }
+
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
+ }
+
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
+ const octalPositions = [];
+ const oldStrict = this.state.strict;
+ let hasStrictModeDirective = false;
+ let parsedNonDirective = false;
+
+ while (!this.match(end)) {
+ if (!parsedNonDirective && this.state.octalPositions.length) {
+ octalPositions.push(...this.state.octalPositions);
+ }
+
+ const stmt = this.parseStatement(null, topLevel);
+
+ if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+
+ if (!hasStrictModeDirective && directive.value.value === "use strict") {
+ hasStrictModeDirective = true;
+ this.setStrict(true);
+ }
+
+ continue;
+ }
+
+ parsedNonDirective = true;
+ body.push(stmt);
+ }
+
+ if (this.state.strict && octalPositions.length) {
+ for (let _i3 = 0; _i3 < octalPositions.length; _i3++) {
+ const pos = octalPositions[_i3];
+ this.raise(pos, ErrorMessages$1.StrictOctalLiteral);
+ }
+ }
+
+ if (afterBlockParse) {
+ afterBlockParse.call(this, hasStrictModeDirective);
+ }
+
+ if (!oldStrict) {
+ this.setStrict(false);
+ }
+
+ this.next();
+ }
+
+ parseFor(node, init) {
+ node.init = init;
+ this.expect(types$4.semi);
+ node.test = this.match(types$4.semi) ? null : this.parseExpression();
+ this.expect(types$4.semi);
+ node.update = this.match(types$4.parenR) ? null : this.parseExpression();
+ this.expect(types$4.parenR);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, "ForStatement");
+ }
+
+ parseForIn(node, init, awaitAt) {
+ const isForIn = this.match(types$4._in);
+ this.next();
+
+ if (isForIn) {
+ if (awaitAt > -1) this.unexpected(awaitAt);
+ } else {
+ node.await = awaitAt > -1;
+ }
+
+ if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
+ this.raise(init.start, ErrorMessages$1.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of");
+ } else if (init.type === "AssignmentPattern") {
+ this.raise(init.start, ErrorMessages$1.InvalidLhs, "for-loop");
+ }
+
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
+ this.expect(types$4.parenR);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
+ }
+
+ parseVar(node, isFor, kind) {
+ const declarations = node.declarations = [];
+ const isTypescript = this.hasPlugin("typescript");
+ node.kind = kind;
+
+ for (;;) {
+ const decl = this.startNode();
+ this.parseVarId(decl, kind);
+
+ if (this.eat(types$4.eq)) {
+ decl.init = this.parseMaybeAssign(isFor);
+ } else {
+ if (kind === "const" && !(this.match(types$4._in) || this.isContextual("of"))) {
+ if (!isTypescript) {
+ this.unexpected();
+ }
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types$4._in) || this.isContextual("of")))) {
+ this.raise(this.state.lastTokEnd, ErrorMessages$1.DeclarationMissingInitializer, "Complex binding patterns");
+ }
+
+ decl.init = null;
+ }
+
+ declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(types$4.comma)) break;
+ }
+
+ return node;
+ }
+
+ parseVarId(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLVal(decl.id, kind === "var" ? BIND_VAR$1 : BIND_LEXICAL$1, undefined, "variable declaration", kind !== "var");
+ }
+
+ parseFunction(node, statement = FUNC_NO_FLAGS$1, isAsync = false) {
+ const isStatement = statement & FUNC_STATEMENT$1;
+ const isHangingStatement = statement & FUNC_HANGING_STATEMENT$1;
+ const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID$1);
+ this.initFunction(node, isAsync);
+
+ if (this.match(types$4.star) && isHangingStatement) {
+ this.raise(this.state.start, ErrorMessages$1.GeneratorInSingleStatementContext);
+ }
+
+ node.generator = this.eat(types$4.star);
+
+ if (isStatement) {
+ node.id = this.parseFunctionId(requireId);
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = false;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.scope.enter(SCOPE_FUNCTION$1);
+ this.prodParam.enter(functionFlags$1(isAsync, node.generator));
+
+ if (!isStatement) {
+ node.id = this.parseFunctionId();
+ }
+
+ this.parseFunctionParams(node);
+ this.withTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+
+ if (isStatement && !isHangingStatement) {
+ this.registerFunctionStatementId(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return node;
+ }
+
+ parseFunctionId(requireId) {
+ return requireId || this.match(types$4.name) ? this.parseIdentifier() : null;
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const oldInParameters = this.state.inParameters;
+ this.state.inParameters = true;
+ this.expect(types$4.parenL);
+ node.params = this.parseBindingList(types$4.parenR, 41, false, allowModifiers);
+ this.state.inParameters = oldInParameters;
+ this.checkYieldAwaitInDefaultParams();
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR$1 : BIND_LEXICAL$1 : BIND_FUNCTION$1, node.id.start);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(node, isStatement, optionalId);
+ this.parseClassSuper(node);
+ node.body = this.parseClassBody(!!node.superClass, oldStrict);
+ this.state.strict = oldStrict;
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+ }
+
+ isClassProperty() {
+ return this.match(types$4.eq) || this.match(types$4.semi) || this.match(types$4.braceR);
+ }
+
+ isClassMethod() {
+ return this.match(types$4.parenL);
+ }
+
+ isNonstaticConstructor(method) {
+ return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
+ }
+
+ parseClassBody(constructorAllowsSuper, oldStrict) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(types$4.braceL);
+ this.withTopicForbiddingContext(() => {
+ while (!this.match(types$4.braceR)) {
+ if (this.eat(types$4.semi)) {
+ if (decorators.length > 0) {
+ throw this.raise(this.state.lastTokEnd, ErrorMessages$1.DecoratorSemicolon);
+ }
+
+ continue;
+ }
+
+ if (this.match(types$4.at)) {
+ decorators.push(this.parseDecorator());
+ continue;
+ }
+
+ const member = this.startNode();
+
+ if (decorators.length) {
+ member.decorators = decorators;
+ this.resetStartLocationFromNode(member, decorators[0]);
+ decorators = [];
+ }
+
+ this.parseClassMember(classBody, member, state, constructorAllowsSuper);
+
+ if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
+ this.raise(member.start, ErrorMessages$1.DecoratorConstructor);
+ }
+ }
+ });
+
+ if (!oldStrict) {
+ this.state.strict = false;
+ }
+
+ this.next();
+
+ if (decorators.length) {
+ throw this.raise(this.state.start, ErrorMessages$1.TrailingDecorator);
+ }
+
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+
+ parseClassMemberFromModifier(classBody, member) {
+ const containsEsc = this.state.containsEsc;
+ const key = this.parseIdentifier(true);
+
+ if (this.isClassMethod()) {
+ const method = member;
+ method.kind = "method";
+ method.computed = false;
+ method.key = key;
+ method.static = false;
+ this.pushClassMethod(classBody, method, false, false, false, false);
+ return true;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return true;
+ } else if (containsEsc) {
+ throw this.unexpected();
+ }
+
+ return false;
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ const isStatic = this.isContextual("static");
+
+ if (isStatic && this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ this.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
+ const publicMethod = member;
+ const privateMethod = member;
+ const publicProp = member;
+ const privateProp = member;
+ const method = publicMethod;
+ const publicMember = publicMethod;
+ member.static = isStatic;
+
+ if (this.eat(types$4.star)) {
+ method.kind = "method";
+ this.parseClassPropertyName(method);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, true, false);
+ return;
+ }
+
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages$1.ConstructorIsGenerator);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, true, false, false, false);
+ return;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ const key = this.parseClassPropertyName(member);
+ const isPrivate = key.type === "PrivateName";
+ const isSimple = key.type === "Identifier";
+ const maybeQuestionTokenStart = this.state.start;
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (this.isClassMethod()) {
+ method.kind = "method";
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ return;
+ }
+
+ const isConstructor = this.isNonstaticConstructor(publicMethod);
+ let allowsDirectSuper = false;
+
+ if (isConstructor) {
+ publicMethod.kind = "constructor";
+
+ if (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(key.start, ErrorMessages$1.DuplicateConstructor);
+ }
+
+ state.hadConstructor = true;
+ allowsDirectSuper = constructorAllowsSuper;
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
+ } else if (this.isClassProperty()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else if (isSimple && key.name === "async" && !containsEsc && !this.isLineTerminator()) {
+ const isGenerator = this.eat(types$4.star);
+
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStart);
+ }
+
+ method.kind = "method";
+ this.parseClassPropertyName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages$1.ConstructorIsAsync);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
+ }
+ } else if (isSimple && (key.name === "get" || key.name === "set") && !containsEsc && !(this.match(types$4.star) && this.isLineTerminator())) {
+ method.kind = key.name;
+ this.parseClassPropertyName(publicMethod);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages$1.ConstructorIsAccessor);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, false, false);
+ }
+
+ this.checkGetterSetterParams(publicMethod);
+ } else if (this.isLineTerminator()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+
+ parseClassPropertyName(member) {
+ const key = this.parsePropertyName(member, true);
+
+ if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) {
+ this.raise(key.start, ErrorMessages$1.StaticPrototype);
+ }
+
+ if (key.type === "PrivateName" && key.id.name === "constructor") {
+ this.raise(key.start, ErrorMessages$1.ConstructorClassPrivateField);
+ }
+
+ return key;
+ }
+
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
+ this.raise(prop.key.start, ErrorMessages$1.ConstructorClassField);
+ }
+
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+
+ pushClassPrivateProperty(classBody, prop) {
+ this.expectPlugin("classPrivateProperties", prop.key.start);
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER$1, node.key.start);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ this.expectPlugin("classPrivateMethods", method.key.start);
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER$1 : CLASS_ELEMENT_INSTANCE_GETTER$1 : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER$1 : CLASS_ELEMENT_INSTANCE_SETTER$1 : CLASS_ELEMENT_OTHER$1;
+ this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {}
+
+ parseAccessModifier() {
+ return undefined;
+ }
+
+ parseClassPrivateProperty(node) {
+ this.scope.enter(SCOPE_CLASS$1 | SCOPE_SUPER$1);
+ this.prodParam.enter(PARAM$1);
+ node.value = this.eat(types$4.eq) ? this.parseMaybeAssign() : null;
+ this.semicolon();
+ this.prodParam.exit();
+ this.scope.exit();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+
+ parseClassProperty(node) {
+ if (!node.typeAnnotation) {
+ this.expectPlugin("classProperties");
+ }
+
+ this.scope.enter(SCOPE_CLASS$1 | SCOPE_SUPER$1);
+ this.prodParam.enter(PARAM$1);
+
+ if (this.match(types$4.eq)) {
+ this.expectPlugin("classProperties");
+ this.next();
+ node.value = this.parseMaybeAssign();
+ } else {
+ node.value = null;
+ }
+
+ this.semicolon();
+ this.prodParam.exit();
+ this.scope.exit();
+ return this.finishNode(node, "ClassProperty");
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS$1) {
+ if (this.match(types$4.name)) {
+ node.id = this.parseIdentifier();
+
+ if (isStatement) {
+ this.checkLVal(node.id, bindingType, undefined, "class name");
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ this.unexpected(null, ErrorMessages$1.MissingClassName);
+ }
+ }
+ }
+
+ parseClassSuper(node) {
+ node.superClass = this.eat(types$4._extends) ? this.parseExprSubscripts() : null;
+ }
+
+ parseExport(node) {
+ const hasDefault = this.maybeParseExportDefaultSpecifier(node);
+ const parseAfterDefault = !hasDefault || this.eat(types$4.comma);
+ const hasStar = parseAfterDefault && this.eatExportStar(node);
+ const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
+ const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(types$4.comma));
+ const isFromRequired = hasDefault || hasStar;
+
+ if (hasStar && !hasNamespace) {
+ if (hasDefault) this.unexpected();
+ this.parseExportFrom(node, true);
+ return this.finishNode(node, "ExportAllDeclaration");
+ }
+
+ const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
+
+ if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
+ throw this.unexpected(null, types$4.braceL);
+ }
+
+ let hasDeclaration;
+
+ if (isFromRequired || hasSpecifiers) {
+ hasDeclaration = false;
+ this.parseExportFrom(node, isFromRequired);
+ } else {
+ hasDeclaration = this.maybeParseExportDeclaration(node);
+ }
+
+ if (isFromRequired || hasSpecifiers || hasDeclaration) {
+ this.checkExport(node, true, false, !!node.source);
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ if (this.eat(types$4._default)) {
+ node.declaration = this.parseExportDefaultExpression();
+ this.checkExport(node, true, true);
+ return this.finishNode(node, "ExportDefaultDeclaration");
+ }
+
+ throw this.unexpected(null, types$4.braceL);
+ }
+
+ eatExportStar(node) {
+ return this.eat(types$4.star);
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (this.isExportDefaultSpecifier()) {
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ if (this.isContextual("as")) {
+ if (!node.specifiers) node.specifiers = [];
+ const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
+ this.next();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamedSpecifiers(node) {
+ if (this.match(types$4.braceL)) {
+ if (!node.specifiers) node.specifiers = [];
+ node.specifiers.push(...this.parseExportSpecifiers());
+ node.source = null;
+ node.declaration = null;
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportDeclaration(node) {
+ if (this.shouldParseExportDeclaration()) {
+ if (this.isContextual("async")) {
+ const next = this.nextTokenStart();
+
+ if (!this.isUnparsedContextual(next, "function")) {
+ this.unexpected(next, types$4._function);
+ }
+ }
+
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+
+ return false;
+ }
+
+ isAsyncFunction() {
+ if (!this.isContextual("async")) return false;
+ const next = this.nextTokenStart();
+ return !lineBreak$1.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
+ }
+
+ parseExportDefaultExpression() {
+ const expr = this.startNode();
+ const isAsync = this.isAsyncFunction();
+
+ if (this.match(types$4._function) || isAsync) {
+ this.next();
+
+ if (isAsync) {
+ this.next();
+ }
+
+ return this.parseFunction(expr, FUNC_STATEMENT$1 | FUNC_NULLABLE_ID$1, isAsync);
+ } else if (this.match(types$4._class)) {
+ return this.parseClass(expr, true, true);
+ } else if (this.match(types$4.at)) {
+ if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, ErrorMessages$1.DecoratorBeforeExport);
+ }
+
+ this.parseDecorators(false);
+ return this.parseClass(expr, true, true);
+ } else if (this.match(types$4._const) || this.match(types$4._var) || this.isLet()) {
+ throw this.raise(this.state.start, ErrorMessages$1.UnsupportedDefaultExport);
+ } else {
+ const res = this.parseMaybeAssign();
+ this.semicolon();
+ return res;
+ }
+ }
+
+ parseExportDeclaration(node) {
+ return this.parseStatement(null);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types$4.name)) {
+ const value = this.state.value;
+
+ if (value === "async" || value === "let") {
+ return false;
+ }
+
+ if ((value === "type" || value === "interface") && !this.state.containsEsc) {
+ const l = this.lookahead();
+
+ if (l.type === types$4.name && l.value !== "from" || l.type === types$4.braceL) {
+ this.expectOnePlugin(["flow", "typescript"]);
+ return false;
+ }
+ }
+ } else if (!this.match(types$4._default)) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const hasFrom = this.isUnparsedContextual(next, "from");
+
+ if (this.input.charCodeAt(next) === 44 || this.match(types$4.name) && hasFrom) {
+ return true;
+ }
+
+ if (this.match(types$4._default) && hasFrom) {
+ const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
+ return nextAfterFrom === 34 || nextAfterFrom === 39;
+ }
+
+ return false;
+ }
+
+ parseExportFrom(node, expect) {
+ if (this.eatContextual("from")) {
+ node.source = this.parseImportSource();
+ this.checkExport(node);
+ } else {
+ if (expect) {
+ this.unexpected();
+ } else {
+ node.source = null;
+ }
+ }
+
+ this.semicolon();
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.match(types$4.at)) {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+
+ if (this.hasPlugin("decorators")) {
+ if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.unexpected(this.state.start, ErrorMessages$1.DecoratorBeforeExport);
+ } else {
+ return true;
+ }
+ }
+ }
+
+ return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isLet() || this.isAsyncFunction();
+ }
+
+ checkExport(node, checkNames, isDefault, isFrom) {
+ if (checkNames) {
+ if (isDefault) {
+ this.checkDuplicateExports(node, "default");
+
+ if (this.hasPlugin("exportDefaultFrom")) {
+ var _declaration$extra;
+
+ const declaration = node.declaration;
+
+ if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) == null ? void 0 : _declaration$extra.parenthesized)) {
+ this.raise(declaration.start, ErrorMessages$1.ExportDefaultFromAsIdentifier);
+ }
+ }
+ } else if (node.specifiers && node.specifiers.length) {
+ for (let _i4 = 0, _node$specifiers = node.specifiers; _i4 < _node$specifiers.length; _i4++) {
+ const specifier = _node$specifiers[_i4];
+ this.checkDuplicateExports(specifier, specifier.exported.name);
+
+ if (!isFrom && specifier.local) {
+ this.checkReservedWord(specifier.local.name, specifier.local.start, true, false);
+ this.scope.checkLocalExport(specifier.local);
+ }
+ }
+ } else if (node.declaration) {
+ if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
+ const id = node.declaration.id;
+ if (!id) throw new Error("Assertion failure");
+ this.checkDuplicateExports(node, id.name);
+ } else if (node.declaration.type === "VariableDeclaration") {
+ for (let _i5 = 0, _node$declaration$dec = node.declaration.declarations; _i5 < _node$declaration$dec.length; _i5++) {
+ const declaration = _node$declaration$dec[_i5];
+ this.checkDeclaration(declaration.id);
+ }
+ }
+ }
+ }
+
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (currentContextDecorators.length) {
+ const isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
+
+ if (!node.declaration || !isClass) {
+ throw this.raise(node.start, ErrorMessages$1.UnsupportedDecoratorExport);
+ }
+
+ this.takeDecorators(node.declaration);
+ }
+ }
+
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (let _i6 = 0, _node$properties = node.properties; _i6 < _node$properties.length; _i6++) {
+ const prop = _node$properties[_i6];
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (let _i7 = 0, _node$elements = node.elements; _i7 < _node$elements.length; _i7++) {
+ const elem = _node$elements[_i7];
+
+ if (elem) {
+ this.checkDeclaration(elem);
+ }
+ }
+ } else if (node.type === "ObjectProperty") {
+ this.checkDeclaration(node.value);
+ } else if (node.type === "RestElement") {
+ this.checkDeclaration(node.argument);
+ } else if (node.type === "AssignmentPattern") {
+ this.checkDeclaration(node.left);
+ }
+ }
+
+ checkDuplicateExports(node, name) {
+ if (this.state.exportedIdentifiers.indexOf(name) > -1) {
+ this.raise(node.start, name === "default" ? ErrorMessages$1.DuplicateDefaultExport : ErrorMessages$1.DuplicateExport, name);
+ }
+
+ this.state.exportedIdentifiers.push(name);
+ }
+
+ parseExportSpecifiers() {
+ const nodes = [];
+ let first = true;
+ this.expect(types$4.braceL);
+
+ while (!this.eat(types$4.braceR)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types$4.comma);
+ if (this.eat(types$4.braceR)) break;
+ }
+
+ const node = this.startNode();
+ node.local = this.parseIdentifier(true);
+ node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
+ }
+
+ return nodes;
+ }
+
+ parseImport(node) {
+ node.specifiers = [];
+
+ if (!this.match(types$4.string)) {
+ const hasDefault = this.maybeParseDefaultImportSpecifier(node);
+ const parseNext = !hasDefault || this.eat(types$4.comma);
+ const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
+ if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
+ this.expectContextual("from");
+ }
+
+ node.source = this.parseImportSource();
+ const attributes = this.maybeParseModuleAttributes();
+
+ if (attributes) {
+ node.attributes = attributes;
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ if (!this.match(types$4.string)) this.unexpected();
+ return this.parseExprAtom();
+ }
+
+ shouldParseDefaultImport(node) {
+ return this.match(types$4.name);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = this.parseIdentifier();
+ this.checkLVal(specifier.local, BIND_LEXICAL$1, undefined, contextDescription);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ maybeParseModuleAttributes() {
+ if (this.match(types$4._with) && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("moduleAttributes");
+ this.next();
+ } else {
+ if (this.hasPlugin("moduleAttributes")) return [];
+ return null;
+ }
+
+ const attrs = [];
+ const attributes = new Set();
+
+ do {
+ const node = this.startNode();
+ node.key = this.parseIdentifier(true);
+
+ if (node.key.name !== "type") {
+ this.raise(node.key.start, ErrorMessages$1.ModuleAttributeDifferentFromType, node.key.name);
+ }
+
+ if (attributes.has(node.key.name)) {
+ this.raise(node.key.start, ErrorMessages$1.ModuleAttributesWithDuplicateKeys, node.key.name);
+ }
+
+ attributes.add(node.key.name);
+ this.expect(types$4.colon);
+
+ if (!this.match(types$4.string)) {
+ throw this.unexpected(this.state.start, ErrorMessages$1.ModuleAttributeInvalidValue);
+ }
+
+ node.value = this.parseLiteral(this.state.value, "StringLiteral");
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(types$4.comma));
+
+ return attrs;
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ if (this.shouldParseDefaultImport(node)) {
+ this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseStarImportSpecifier(node) {
+ if (this.match(types$4.star)) {
+ const specifier = this.startNode();
+ this.next();
+ this.expectContextual("as");
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ parseNamedImportSpecifiers(node) {
+ let first = true;
+ this.expect(types$4.braceL);
+
+ while (!this.eat(types$4.braceR)) {
+ if (first) {
+ first = false;
+ } else {
+ if (this.eat(types$4.colon)) {
+ throw this.raise(this.state.start, ErrorMessages$1.DestructureNamedImport);
+ }
+
+ this.expect(types$4.comma);
+ if (this.eat(types$4.braceR)) break;
+ }
+
+ this.parseImportSpecifier(node);
+ }
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ specifier.imported = this.parseIdentifier(true);
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
+ specifier.local = specifier.imported.__clone();
+ }
+
+ this.checkLVal(specifier.local, BIND_LEXICAL$1, undefined, "import specifier");
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ };
+
+ let ClassScope$1 = class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+
+ };
+ let ClassScopeHandler$1 = class ClassScopeHandler {
+ constructor(raise) {
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ }
+
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+
+ enter() {
+ this.stack.push(new ClassScope$1());
+ }
+
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+
+ for (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) {
+ const [name, pos] = _Array$from[_i];
+
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, pos);
+ }
+ } else {
+ this.raise(pos, ErrorMessages$1.InvalidPrivateFieldResolution, name);
+ }
+ }
+ }
+
+ declarePrivateName(name, elementType, pos) {
+ const classScope = this.current();
+ let redefined = classScope.privateNames.has(name);
+
+ if (elementType & CLASS_ELEMENT_KIND_ACCESSOR$1) {
+ const accessor = redefined && classScope.loneAccessors.get(name);
+
+ if (accessor) {
+ const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC$1;
+ const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC$1;
+ const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR$1;
+ const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR$1;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) classScope.loneAccessors.delete(name);
+ } else if (!redefined) {
+ classScope.loneAccessors.set(name, elementType);
+ }
+ }
+
+ if (redefined) {
+ this.raise(pos, ErrorMessages$1.PrivateNameRedeclaration, name);
+ }
+
+ classScope.privateNames.add(name);
+ classScope.undefinedPrivateNames.delete(name);
+ }
+
+ usePrivateName(name, pos) {
+ let classScope;
+
+ for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) {
+ classScope = _this$stack[_i2];
+ if (classScope.privateNames.has(name)) return;
+ }
+
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, pos);
+ } else {
+ this.raise(pos, ErrorMessages$1.InvalidPrivateFieldResolution, name);
+ }
+ }
+
+ };
+
+ let Parser$1 = class Parser extends StatementParser$1 {
+ constructor(options, input) {
+ options = getOptions$1(options);
+ super(options, input);
+ const ScopeHandler = this.getScopeHandler();
+ this.options = options;
+ this.inModule = this.options.sourceType === "module";
+ this.scope = new ScopeHandler(this.raise.bind(this), this.inModule);
+ this.prodParam = new ProductionParameterHandler$1();
+ this.classScope = new ClassScopeHandler$1(this.raise.bind(this));
+ this.plugins = pluginsMap$1(this.options.plugins);
+ this.filename = options.sourceFilename;
+ }
+
+ getScopeHandler() {
+ return ScopeHandler$1;
+ }
+
+ parse() {
+ let paramFlags = PARAM$1;
+
+ if (this.hasPlugin("topLevelAwait") && this.inModule) {
+ paramFlags |= PARAM_AWAIT$1;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM$1);
+ this.prodParam.enter(paramFlags);
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
+ }
+
+ };
+
+ function pluginsMap$1(plugins) {
+ const pluginMap = new Map();
+
+ for (let _i = 0; _i < plugins.length; _i++) {
+ const plugin = plugins[_i];
+ const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
+ if (!pluginMap.has(name)) pluginMap.set(name, options || {});
+ }
+
+ return pluginMap;
+ }
+
+ function parse$2(input, options) {
+ var _options;
+
+ if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
+ options = Object.assign({}, options);
+
+ try {
+ options.sourceType = "module";
+ const parser = getParser$1(options, input);
+ const ast = parser.parse();
+
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser$1(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser$1(options, input).parse();
+ } catch (_unused2) {}
+
+ throw moduleError;
+ }
+ } else {
+ return getParser$1(options, input).parse();
+ }
+ }
+ function parseExpression$1(input, options) {
+ const parser = getParser$1(options, input);
+
+ if (parser.options.strictMode) {
+ parser.state.strict = true;
+ }
+
+ return parser.getExpression();
+ }
+
+ function getParser$1(options, input) {
+ let cls = Parser$1;
+
+ if (options == null ? void 0 : options.plugins) {
+ validatePlugins$1(options.plugins);
+ cls = getParserClass$1(options.plugins);
+ }
+
+ return new cls(options, input);
+ }
+
+ const parserClassCache$1 = {};
+
+ function getParserClass$1(pluginsFromOptions) {
+ const pluginList = mixinPluginNames$1.filter(name => hasPlugin$1(pluginsFromOptions, name));
+ const key = pluginList.join("/");
+ let cls = parserClassCache$1[key];
+
+ if (!cls) {
+ cls = Parser$1;
+
+ for (let _i = 0; _i < pluginList.length; _i++) {
+ const plugin = pluginList[_i];
+ cls = mixinPlugins$1[plugin](cls);
+ }
+
+ parserClassCache$1[key] = cls;
+ }
+
+ return cls;
+ }
+
+ lib$2.parse = parse$2;
+ lib$2.parseExpression = parseExpression$1;
+ lib$2.tokTypes = types$4;
+
+ var customParse = {};
+
+ var parseScriptFragment = {};
+
+ Object.defineProperty(parseScriptFragment, "__esModule", {
+ value: true
+ });
+
+ var alphanum = /[a-z0-9\-]/i;
+
+ function parseToken(str, start) {
+ var i = start;
+ while (i < str.length && alphanum.test(str.charAt(i++))) {
+ continue;
+ }
+
+ if (i !== start) {
+ return {
+ token: str.substring(start, i - 1),
+ index: i
+ };
+ }
+
+ return null;
+ }
+
+ function parseAttributes(str, start) {
+ var i = start;
+ var attributes = {};
+ var attribute = null;
+
+ while (i < str.length) {
+ var c = str.charAt(i);
+
+ if (attribute === null && c == ">") {
+ break;
+ } else if (attribute === null && alphanum.test(c)) {
+ attribute = {
+ name: null,
+ value: true,
+ bool: true,
+ terminator: null
+ };
+
+ var attributeNameNode = parseToken(str, i);
+ if (attributeNameNode) {
+ attribute.name = attributeNameNode.token;
+ i = attributeNameNode.index - 2;
+ }
+ } else if (attribute !== null) {
+ if (c === "=") {
+ // once we've started an attribute, look for = to indicate
+ // it's a non-boolean attribute
+ attribute.bool = false;
+ if (attribute.value === true) {
+ attribute.value = "";
+ }
+ } else if (!attribute.bool && attribute.terminator === null && (c === '"' || c === "'")) {
+ // once we've determined it's non-boolean, look for a
+ // value terminator (", ')
+ attribute.terminator = c;
+ } else if (attribute.terminator) {
+ if (c === attribute.terminator) {
+ // if we had a terminator and found another, we've
+ // reach the end of the attribute
+ attributes[attribute.name] = attribute.value;
+ attribute = null;
+ } else {
+ // otherwise, append the character to the attribute value
+ attribute.value += c;
+
+ // check for an escaped terminator and push it as well
+ // to avoid terminating prematurely
+ if (c === "\\") {
+ var next = str.charAt(i + 1);
+ if (next === attribute.terminator) {
+ attribute.value += next;
+ i += 1;
+ }
+ }
+ }
+ } else if (!/\s/.test(c)) {
+ // if we've hit a non-space character and aren't processing a value,
+ // we're starting a new attribute so push the attribute and clear the
+ // local variable
+ attributes[attribute.name] = attribute.value;
+ attribute = null;
+
+ // move the cursor back to re-find the start of the attribute
+ i -= 1;
+ }
+ }
+
+ i++;
+ }
+
+ if (i !== start) {
+ return {
+ attributes: attributes,
+ index: i
+ };
+ }
+
+ return null;
+ }
+
+ function parseFragment(str) {
+ var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
+
+ var tag = null;
+ var open = false;
+ var attributes = {};
+
+ var i = start;
+ while (i < str.length) {
+ var c = str.charAt(i++);
+
+ if (!open && !tag && c === "<") {
+ // Open Start Tag
+ open = true;
+
+ var tagNode = parseToken(str, i);
+ if (!tagNode) {
+ return null;
+ }
+
+ i = tagNode.index - 1;
+ tag = tagNode.token;
+ } else if (open && c === ">") {
+ // Close Start Tag
+ break;
+ } else if (open) {
+ // Attributes
+ var attributeNode = parseAttributes(str, i - 1);
+
+ if (attributeNode) {
+ i = attributeNode.index;
+ attributes = attributeNode.attributes || attributes;
+ }
+ }
+ }
+
+ if (tag) {
+ return {
+ tag: tag,
+ attributes: attributes
+ };
+ }
+
+ return null;
+ }
+
+ parseScriptFragment.default = parseFragment;
+ parseScriptFragment.parseFragment = parseFragment;
+
+ Object.defineProperty(customParse, "__esModule", {
+ value: true
+ });
+ customParse.parseScriptTags = customParse.parseScripts = customParse.getCandidateScriptLocations = customParse.generateWhitespace = undefined;
+
+ var _types$1 = lib$4;
+
+ var types$3 = _interopRequireWildcard$1(_types$1);
+
+ var _parseScriptFragment = parseScriptFragment;
+
+ var _parseScriptFragment2 = _interopRequireDefault(_parseScriptFragment);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _interopRequireWildcard$1(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+
+ var startScript = /<script[^>]*>/im;
+ var endScript = /<\/script\s*>/im;
+ // https://stackoverflow.com/questions/5034781/js-regex-to-split-by-line#comment5633979_5035005
+ var newLines = /\r\n|[\n\v\f\r\x85\u2028\u2029]/;
+
+ function getType(tag) {
+ var fragment = (0, _parseScriptFragment2.default)(tag);
+
+ if (fragment) {
+ var type = fragment.attributes.type;
+
+ return type ? type.toLowerCase() : null;
+ }
+
+ return null;
+ }
+
+ function getCandidateScriptLocations(source, index) {
+ var i = index || 0;
+ var str = source.substring(i);
+
+ var startMatch = startScript.exec(str);
+ if (startMatch) {
+ var startsAt = startMatch.index + startMatch[0].length;
+ var afterStart = str.substring(startsAt);
+ var endMatch = endScript.exec(afterStart);
+ if (endMatch) {
+ var locLength = endMatch.index;
+ var locIndex = i + startsAt;
+ var endIndex = locIndex + locLength + endMatch[0].length;
+
+ // extract the complete tag (incl start and end tags and content). if the
+ // type is invalid (= not JS), skip this tag and continue
+ var tag = source.substring(i + startMatch.index, endIndex);
+ var type = getType(tag);
+ if (type && type !== "javascript" && type !== "text/javascript") {
+ return getCandidateScriptLocations(source, endIndex);
+ }
+
+ return [adjustForLineAndColumn(source, {
+ index: locIndex,
+ length: locLength,
+ source: source.substring(locIndex, locIndex + locLength)
+ })].concat(_toConsumableArray(getCandidateScriptLocations(source, endIndex)));
+ }
+ }
+
+ return [];
+ }
+
+ function parseScripts$1(locations, parser) {
+ return locations.map(parser);
+ }
+
+ function generateWhitespace(length) {
+ return Array.from(new Array(length + 1)).join(" ");
+ }
+
+ function calcLineAndColumn(source, index) {
+ var lines = source.substring(0, index).split(newLines);
+ var line = lines.length;
+ var column = lines.pop().length + 1;
+
+ return {
+ column: column,
+ line: line
+ };
+ }
+
+ function adjustForLineAndColumn(fullSource, location) {
+ var _calcLineAndColumn = calcLineAndColumn(fullSource, location.index),
+ column = _calcLineAndColumn.column,
+ line = _calcLineAndColumn.line;
+
+ return Object.assign({}, location, {
+ line: line,
+ column: column,
+ // prepend whitespace for scripts that do not start on the first column
+ source: generateWhitespace(column) + location.source
+ });
+ }
+
+ function parseScriptTags$1(source, parser) {
+ var scripts = parseScripts$1(getCandidateScriptLocations(source), parser).filter(types$3.isFile).reduce(function (main, script) {
+ return {
+ statements: main.statements.concat(script.program.body),
+ comments: main.comments.concat(script.comments),
+ tokens: main.tokens.concat(script.tokens)
+ };
+ }, {
+ statements: [],
+ comments: [],
+ tokens: []
+ });
+
+ var program = types$3.program(scripts.statements);
+ var file = types$3.file(program, scripts.comments, scripts.tokens);
+
+ var end = calcLineAndColumn(source, source.length);
+ file.start = program.start = 0;
+ file.end = program.end = source.length;
+ file.loc = program.loc = {
+ start: {
+ line: 1,
+ column: 0
+ },
+ end: end
+ };
+
+ return file;
+ }
+
+ customParse.default = parseScriptTags$1;
+ customParse.generateWhitespace = generateWhitespace;
+ customParse.getCandidateScriptLocations = getCandidateScriptLocations;
+ customParse.parseScripts = parseScripts$1;
+ customParse.parseScriptTags = parseScriptTags$1;
+
+ Object.defineProperty(dist, "__esModule", {
+ value: true
+ });
+ dist.parseScriptTags = dist.parseScripts = dist.parseScript = dist.getCandidateScriptLocations = dist.generateWhitespace = dist.extractScriptTags = undefined;
+
+ var _types = lib$4;
+
+ var types$2 = _interopRequireWildcard(_types);
+
+ var _parser = lib$2;
+
+ var parser = _interopRequireWildcard(_parser);
+
+ var _customParse = customParse;
+
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+ function parseScript$1(_ref) {
+ var source = _ref.source,
+ line = _ref.line;
+
+ // remove empty or only whitespace scripts
+ if (source.length === 0 || /^\s+$/.test(source)) {
+ return null;
+ }
+
+ try {
+ return parser.parse(source, {
+ sourceType: "script",
+ startLine: line
+ });
+ } catch (e) {
+ return null;
+ }
+ }
+
+ function parseScripts(locations) {
+ var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parseScript$1;
+
+ return (0, _customParse.parseScripts)(locations, parser);
+ }
+
+ function extractScriptTags(source) {
+ return parseScripts((0, _customParse.getCandidateScriptLocations)(source), function (loc) {
+ var ast = parseScript$1(loc);
+
+ if (ast) {
+ return loc;
+ }
+
+ return null;
+ }).filter(types$2.isFile);
+ }
+
+ function parseScriptTags(source) {
+ var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parseScript$1;
+
+ return (0, _customParse.parseScriptTags)(source, parser);
+ }
+
+ var _default$2 = dist.default = parseScriptTags;
+ dist.extractScriptTags = extractScriptTags;
+ dist.generateWhitespace = _customParse.generateWhitespace;
+ dist.getCandidateScriptLocations = _customParse.getCandidateScriptLocations;
+ dist.parseScript = parseScript$1;
+ dist.parseScripts = parseScripts;
+ dist.parseScriptTags = parseScriptTags;
+
+ var lib$1 = {};
+
+ Object.defineProperty(lib$1, '__esModule', { value: true });
+
+ const lineBreak = /\r\n?|[\n\u2028\u2029]/;
+ const lineBreakG = new RegExp(lineBreak.source, "g");
+ function isNewLine(code) {
+ switch (code) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+ const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+ const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y;
+ const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
+ function isWhitespace(code) {
+ switch (code) {
+ case 0x0009:
+ case 0x000b:
+ case 0x000c:
+ case 32:
+ case 160:
+ case 5760:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200a:
+ case 0x202f:
+ case 0x205f:
+ case 0x3000:
+ case 0xfeff:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ class Position {
+ constructor(line, col) {
+ this.line = void 0;
+ this.column = void 0;
+ this.line = line;
+ this.column = col;
+ }
+
+ }
+ class SourceLocation {
+ constructor(start, end) {
+ this.start = void 0;
+ this.end = void 0;
+ this.filename = void 0;
+ this.identifierName = void 0;
+ this.start = start;
+ this.end = end;
+ }
+
+ }
+ function getLineInfo(input, offset) {
+ let line = 1;
+ let lineStart = 0;
+ let match;
+ lineBreakG.lastIndex = 0;
+
+ while ((match = lineBreakG.exec(input)) && match.index < offset) {
+ line++;
+ lineStart = lineBreakG.lastIndex;
+ }
+
+ return new Position(line, offset - lineStart);
+ }
+
+ class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+
+ hasPlugin(name) {
+ return this.plugins.has(name);
+ }
+
+ getPluginOption(plugin, name) {
+ if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];
+ }
+
+ }
+
+ function setTrailingComments(node, comments) {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = comments;
+ } else {
+ node.trailingComments.unshift(...comments);
+ }
+ }
+
+ function setInnerComments(node, comments) {
+ if (node.innerComments === undefined) {
+ node.innerComments = comments;
+ } else if (comments !== undefined) {
+ node.innerComments.unshift(...comments);
+ }
+ }
+
+ function adjustInnerComments(node, elements, commentWS) {
+ let lastElement = null;
+ let i = elements.length;
+
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+
+ if (lastElement === null || lastElement.start > commentWS.start) {
+ setInnerComments(node, commentWS.comments);
+ } else {
+ setTrailingComments(lastElement, commentWS.comments);
+ }
+ }
+
+ class CommentsParser extends BaseParser {
+ addComment(comment) {
+ if (this.filename) comment.loc.filename = this.filename;
+ this.state.comments.push(comment);
+ }
+
+ processComment(node) {
+ const {
+ commentStack
+ } = this.state;
+ const commentStackLength = commentStack.length;
+ if (commentStackLength === 0) return;
+ let i = commentStackLength - 1;
+ const lastCommentWS = commentStack[i];
+
+ if (lastCommentWS.start === node.end) {
+ lastCommentWS.leadingNode = node;
+ i--;
+ }
+
+ const {
+ start: nodeStart
+ } = node;
+
+ for (; i >= 0; i--) {
+ const commentWS = commentStack[i];
+ const commentEnd = commentWS.end;
+
+ if (commentEnd > nodeStart) {
+ commentWS.containingNode = node;
+ this.finalizeComment(commentWS);
+ commentStack.splice(i, 1);
+ } else {
+ if (commentEnd === nodeStart) {
+ commentWS.trailingNode = node;
+ }
+
+ break;
+ }
+ }
+ }
+
+ finalizeComment(commentWS) {
+ const {
+ comments
+ } = commentWS;
+
+ if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
+ if (commentWS.leadingNode !== null) {
+ setTrailingComments(commentWS.leadingNode, comments);
+ }
+
+ if (commentWS.trailingNode !== null) {
+ commentWS.trailingNode.leadingComments = comments;
+ }
+ } else {
+ const {
+ containingNode: node,
+ start: commentStart
+ } = commentWS;
+
+ if (this.input.charCodeAt(commentStart - 1) === 44) {
+ switch (node.type) {
+ case "ObjectExpression":
+ case "ObjectPattern":
+ case "RecordExpression":
+ adjustInnerComments(node, node.properties, commentWS);
+ break;
+
+ case "CallExpression":
+ case "OptionalCallExpression":
+ adjustInnerComments(node, node.arguments, commentWS);
+ break;
+
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ case "ArrowFunctionExpression":
+ case "ObjectMethod":
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ adjustInnerComments(node, node.params, commentWS);
+ break;
+
+ case "ArrayExpression":
+ case "ArrayPattern":
+ case "TupleExpression":
+ adjustInnerComments(node, node.elements, commentWS);
+ break;
+
+ case "ExportNamedDeclaration":
+ case "ImportDeclaration":
+ adjustInnerComments(node, node.specifiers, commentWS);
+ break;
+
+ default:
+ {
+ setInnerComments(node, comments);
+ }
+ }
+ } else {
+ setInnerComments(node, comments);
+ }
+ }
+ }
+
+ finalizeRemainingComments() {
+ const {
+ commentStack
+ } = this.state;
+
+ for (let i = commentStack.length - 1; i >= 0; i--) {
+ this.finalizeComment(commentStack[i]);
+ }
+
+ this.state.commentStack = [];
+ }
+
+ resetPreviousNodeTrailingComments(node) {
+ const {
+ commentStack
+ } = this.state;
+ const {
+ length
+ } = commentStack;
+ if (length === 0) return;
+ const commentWS = commentStack[length - 1];
+
+ if (commentWS.leadingNode === node) {
+ commentWS.leadingNode = null;
+ }
+ }
+
+ }
+
+ const ErrorCodes = Object.freeze({
+ SyntaxError: "BABEL_PARSER_SYNTAX_ERROR",
+ SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ });
+
+ const ErrorMessages = makeErrorTemplates({
+ AccessorIsGenerator: "A %0ter cannot be a generator.",
+ ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
+ AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
+ AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
+ AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
+ AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
+ AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
+ BadGetterArity: "A 'get' accesor must not have any formal parameters.",
+ BadSetterArity: "A 'set' accesor must have exactly one formal parameter.",
+ BadSetterRestParameter: "A 'set' accesor function argument must not be a rest parameter.",
+ ConstructorClassField: "Classes may not have a field named 'constructor'.",
+ ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
+ ConstructorIsAccessor: "Class constructor may not be an accessor.",
+ ConstructorIsAsync: "Constructor can't be an async function.",
+ ConstructorIsGenerator: "Constructor can't be a generator.",
+ DeclarationMissingInitializer: "'%0' require an initialization value.",
+ DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.",
+ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
+ DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
+ DecoratorStaticBlock: "Decorators can't be used with a static block.",
+ DeletePrivateField: "Deleting a private field is not allowed.",
+ DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
+ DuplicateConstructor: "Duplicate constructor in the same class.",
+ DuplicateDefaultExport: "Only one default export allowed per module.",
+ DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.",
+ DuplicateProto: "Redefinition of __proto__ property.",
+ DuplicateRegExpFlags: "Duplicate regular expression flag.",
+ ElementAfterRest: "Rest element must be last element.",
+ EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
+ ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?",
+ ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
+ ForInOfLoopInitializer: "'%0' loop variable declaration may not have an initializer.",
+ ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
+ ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
+ GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
+ IllegalBreakContinue: "Unsyntactic %0.",
+ IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
+ IllegalReturn: "'return' outside of function.",
+ ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?',
+ ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
+ ImportCallArity: "`import()` requires exactly %0.",
+ ImportCallNotNewExpression: "Cannot use new with import(...).",
+ ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
+ InvalidBigIntLiteral: "Invalid BigIntLiteral.",
+ InvalidCodePoint: "Code point out of bounds.",
+ InvalidDecimal: "Invalid decimal.",
+ InvalidDigit: "Expected number in radix %0.",
+ InvalidEscapeSequence: "Bad character escape sequence.",
+ InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
+ InvalidEscapedReservedWord: "Escape sequence in keyword %0.",
+ InvalidIdentifier: "Invalid identifier %0.",
+ InvalidLhs: "Invalid left-hand side in %0.",
+ InvalidLhsBinding: "Binding invalid left-hand side in %0.",
+ InvalidNumber: "Invalid number.",
+ InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
+ InvalidOrUnexpectedToken: "Unexpected character '%0'.",
+ InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
+ InvalidPrivateFieldResolution: "Private name #%0 is not defined.",
+ InvalidPropertyBindingPattern: "Binding member expression.",
+ InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
+ LabelRedeclaration: "Label '%0' is already declared.",
+ LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
+ LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
+ MalformedRegExpFlags: "Invalid regular expression flag.",
+ MissingClassName: "A class name is required.",
+ MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
+ MissingSemicolon: "Missing semicolon.",
+ MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
+ MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
+ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
+ ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
+ ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes.',
+ ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'.",
+ ModuleExportUndefined: "Export '%0' is not defined.",
+ MultipleDefaultsInSwitch: "Multiple default clauses.",
+ NewlineAfterThrow: "Illegal newline after throw.",
+ NoCatchOrFinally: "Missing catch or finally clause.",
+ NumberIdentifier: "Identifier directly after number.",
+ NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
+ ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
+ OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
+ OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
+ ParamDupe: "Argument name clash.",
+ PatternHasAccessor: "Object pattern can't contain getter or setter.",
+ PatternHasMethod: "Object pattern can't contain methods.",
+ PipeBodyIsTighter: "Unexpected %0 after pipeline body; any %0 expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
+ PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
+ PipeTopicUnconfiguredToken: 'Invalid topic token %0. In order to use %0 as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "%0" }.',
+ PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
+ PipeUnparenthesizedBody: "Hack-style pipe body cannot be an unparenthesized %0 expression; please wrap it in parentheses.",
+ PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
+ PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
+ PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
+ PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
+ PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
+ PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`).",
+ PrivateNameRedeclaration: "Duplicate private name #%0.",
+ RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions.",
+ RestTrailingComma: "Unexpected trailing comma after rest element.",
+ SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
+ StaticPrototype: "Classes may not have static property named prototype.",
+ StrictDelete: "Deleting local variable in strict mode.",
+ StrictEvalArguments: "Assigning to '%0' in strict mode.",
+ StrictEvalArgumentsBinding: "Binding '%0' in strict mode.",
+ StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
+ StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
+ StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
+ StrictWith: "'with' in strict mode.",
+ SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
+ SuperPrivateField: "Private fields can't be accessed on super.",
+ TrailingDecorator: "Decorators must be attached to a class element.",
+ TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
+ UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
+ UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
+ UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
+ UnexpectedKeyword: "Unexpected keyword '%0'.",
+ UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
+ UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
+ UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
+ UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
+ UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).",
+ UnexpectedReservedWord: "Unexpected reserved word '%0'.",
+ UnexpectedSuper: "'super' is only allowed in object methods and classes.",
+ UnexpectedToken: "Unexpected token '%0'.",
+ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
+ UnsupportedBind: "Binding should be performed on object property.",
+ UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
+ UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
+ UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
+ UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1.",
+ UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
+ UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
+ UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
+ UnterminatedComment: "Unterminated comment.",
+ UnterminatedRegExp: "Unterminated regular expression.",
+ UnterminatedString: "Unterminated string constant.",
+ UnterminatedTemplate: "Unterminated template.",
+ VarRedeclaration: "Identifier '%0' has already been declared.",
+ YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
+ YieldInParameter: "Yield expression is not allowed in formal parameters.",
+ ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
+ }, ErrorCodes.SyntaxError);
+ const SourceTypeModuleErrorMessages = makeErrorTemplates({
+ ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
+ ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`
+ }, ErrorCodes.SourceTypeModuleError);
+
+ function keepReasonCodeCompat(reasonCode, syntaxPlugin) {
+ {
+ if (syntaxPlugin === "flow" && reasonCode === "PatternIsOptional") {
+ return "OptionalBindingPattern";
+ }
+ }
+ return reasonCode;
+ }
+
+ function makeErrorTemplates(messages, code, syntaxPlugin) {
+ const templates = {};
+ Object.keys(messages).forEach(reasonCode => {
+ templates[reasonCode] = Object.freeze({
+ code,
+ reasonCode: keepReasonCodeCompat(reasonCode, syntaxPlugin),
+ template: messages[reasonCode]
+ });
+ });
+ return Object.freeze(templates);
+ }
+ class ParserError extends CommentsParser {
+ getLocationForPosition(pos) {
+ let loc;
+ if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos);
+ return loc;
+ }
+
+ raise(pos, {
+ code,
+ reasonCode,
+ template
+ }, ...params) {
+ return this.raiseWithData(pos, {
+ code,
+ reasonCode
+ }, template, ...params);
+ }
+
+ raiseOverwrite(pos, {
+ code,
+ template
+ }, ...params) {
+ const loc = this.getLocationForPosition(pos);
+ const message = template.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
+
+ if (this.options.errorRecovery) {
+ const errors = this.state.errors;
+
+ for (let i = errors.length - 1; i >= 0; i--) {
+ const error = errors[i];
+
+ if (error.pos === pos) {
+ return Object.assign(error, {
+ message
+ });
+ } else if (error.pos < pos) {
+ break;
+ }
+ }
+ }
+
+ return this._raise({
+ code,
+ loc,
+ pos
+ }, message);
+ }
+
+ raiseWithData(pos, data, errorTemplate, ...params) {
+ const loc = this.getLocationForPosition(pos);
+ const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
+ return this._raise(Object.assign({
+ loc,
+ pos
+ }, data), message);
+ }
+
+ _raise(errorContext, message) {
+ const err = new SyntaxError(message);
+ Object.assign(err, errorContext);
+
+ if (this.options.errorRecovery) {
+ if (!this.isLookahead) this.state.errors.push(err);
+ return err;
+ } else {
+ throw err;
+ }
+ }
+
+ }
+
+ var estree = (superClass => class extends superClass {
+ parseRegExpLiteral({
+ pattern,
+ flags
+ }) {
+ let regex = null;
+
+ try {
+ regex = new RegExp(pattern, flags);
+ } catch (e) {}
+
+ const node = this.estreeParseLiteral(regex);
+ node.regex = {
+ pattern,
+ flags
+ };
+ return node;
+ }
+
+ parseBigIntLiteral(value) {
+ let bigInt;
+
+ try {
+ bigInt = BigInt(value);
+ } catch (_unused) {
+ bigInt = null;
+ }
+
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ return node;
+ }
+
+ parseDecimalLiteral(value) {
+ const decimal = null;
+ const node = this.estreeParseLiteral(decimal);
+ node.decimal = String(node.value || value);
+ return node;
+ }
+
+ estreeParseLiteral(value) {
+ return this.parseLiteral(value, "Literal");
+ }
+
+ parseStringLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ parseNumericLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ parseNullLiteral() {
+ return this.estreeParseLiteral(null);
+ }
+
+ parseBooleanLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ directiveToStmt(directive) {
+ const directiveLiteral = directive.value;
+ const stmt = this.startNodeAt(directive.start, directive.loc.start);
+ const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
+ expression.value = directiveLiteral.extra.expressionValue;
+ expression.raw = directiveLiteral.extra.raw;
+ stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
+ stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
+ return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
+ }
+
+ initFunction(node, isAsync) {
+ super.initFunction(node, isAsync);
+ node.expression = false;
+ }
+
+ checkDeclaration(node) {
+ if (node != null && this.isObjectProperty(node)) {
+ this.checkDeclaration(node.value);
+ } else {
+ super.checkDeclaration(node);
+ }
+ }
+
+ getObjectOrClassMethodParams(method) {
+ return method.value.params;
+ }
+
+ isValidDirective(stmt) {
+ var _stmt$expression$extr;
+
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
+ }
+
+ stmtToDirective(stmt) {
+ const value = stmt.expression.value;
+ const directive = super.stmtToDirective(stmt);
+ this.addExtra(directive.value, "expressionValue", value);
+ return directive;
+ }
+
+ parseBlockBody(node, ...args) {
+ super.parseBlockBody(node, ...args);
+ const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
+ node.body = directiveStatements.concat(node.body);
+ delete node.directives;
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
+
+ if (method.typeParameters) {
+ method.value.typeParameters = method.typeParameters;
+ delete method.typeParameters;
+ }
+
+ classBody.body.push(method);
+ }
+
+ parsePrivateName() {
+ const node = super.parsePrivateName();
+
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return node;
+ }
+
+ return this.convertPrivateNameToPrivateIdentifier(node);
+ }
+
+ convertPrivateNameToPrivateIdentifier(node) {
+ const name = super.getPrivateNameSV(node);
+ node = node;
+ delete node.id;
+ node.name = name;
+ node.type = "PrivateIdentifier";
+ return node;
+ }
+
+ isPrivateName(node) {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.isPrivateName(node);
+ }
+
+ return node.type === "PrivateIdentifier";
+ }
+
+ getPrivateNameSV(node) {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.getPrivateNameSV(node);
+ }
+
+ return node.name;
+ }
+
+ parseLiteral(value, type) {
+ const node = super.parseLiteral(value, type);
+ node.raw = node.extra.raw;
+ delete node.extra;
+ return node;
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ super.parseFunctionBody(node, allowExpression, isMethod);
+ node.expression = node.body.type !== "BlockStatement";
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ let funcNode = this.startNode();
+ funcNode.kind = node.kind;
+ funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ funcNode.type = "FunctionExpression";
+ delete funcNode.kind;
+ node.value = funcNode;
+
+ if (type === "ClassPrivateMethod") {
+ node.computed = false;
+ }
+
+ type = "MethodDefinition";
+ return this.finishNode(node, type);
+ }
+
+ parseClassProperty(...args) {
+ const propertyNode = super.parseClassProperty(...args);
+
+ if (this.getPluginOption("estree", "classFeatures")) {
+ propertyNode.type = "PropertyDefinition";
+ }
+
+ return propertyNode;
+ }
+
+ parseClassPrivateProperty(...args) {
+ const propertyNode = super.parseClassPrivateProperty(...args);
+
+ if (this.getPluginOption("estree", "classFeatures")) {
+ propertyNode.type = "PropertyDefinition";
+ propertyNode.computed = false;
+ }
+
+ return propertyNode;
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
+
+ if (node) {
+ node.type = "Property";
+ if (node.kind === "method") node.kind = "init";
+ node.shorthand = false;
+ }
+
+ return node;
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+
+ return node;
+ }
+
+ isAssignable(node, isBinding) {
+ if (node != null && this.isObjectProperty(node)) {
+ return this.isAssignable(node.value, isBinding);
+ }
+
+ return super.isAssignable(node, isBinding);
+ }
+
+ toAssignable(node, isLHS = false) {
+ if (node != null && this.isObjectProperty(node)) {
+ this.toAssignable(node.value, isLHS);
+ return node;
+ }
+
+ return super.toAssignable(node, isLHS);
+ }
+
+ toAssignableObjectExpressionProp(prop, ...args) {
+ if (prop.kind === "get" || prop.kind === "set") {
+ this.raise(prop.key.start, ErrorMessages.PatternHasAccessor);
+ } else if (prop.method) {
+ this.raise(prop.key.start, ErrorMessages.PatternHasMethod);
+ } else {
+ super.toAssignableObjectExpressionProp(prop, ...args);
+ }
+ }
+
+ finishCallExpression(node, optional) {
+ super.finishCallExpression(node, optional);
+
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+
+ if (this.hasPlugin("importAssertions")) {
+ var _node$arguments$;
+
+ node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;
+ }
+
+ delete node.arguments;
+ delete node.callee;
+ }
+
+ return node;
+ }
+
+ toReferencedArguments(node) {
+ if (node.type === "ImportExpression") {
+ return;
+ }
+
+ super.toReferencedArguments(node);
+ }
+
+ parseExport(node) {
+ super.parseExport(node);
+
+ switch (node.type) {
+ case "ExportAllDeclaration":
+ node.exported = null;
+ break;
+
+ case "ExportNamedDeclaration":
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
+ node.type = "ExportAllDeclaration";
+ node.exported = node.specifiers[0].exported;
+ delete node.specifiers;
+ }
+
+ break;
+ }
+
+ return node;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ const node = super.parseSubscript(base, startPos, startLoc, noCalls, state);
+
+ if (state.optionalChainMember) {
+ if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
+ node.type = node.type.substring(8);
+ }
+
+ if (state.stop) {
+ const chain = this.startNodeAtNode(node);
+ chain.expression = node;
+ return this.finishNode(chain, "ChainExpression");
+ }
+ } else if (node.type === "MemberExpression" || node.type === "CallExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+ hasPropertyAsPrivateName(node) {
+ if (node.type === "ChainExpression") {
+ node = node.expression;
+ }
+
+ return super.hasPropertyAsPrivateName(node);
+ }
+
+ isOptionalChain(node) {
+ return node.type === "ChainExpression";
+ }
+
+ isObjectProperty(node) {
+ return node.type === "Property" && node.kind === "init" && !node.method;
+ }
+
+ isObjectMethod(node) {
+ return node.method || node.kind === "get" || node.kind === "set";
+ }
+
+ });
+
+ class TokContext {
+ constructor(token, preserveSpace) {
+ this.token = void 0;
+ this.preserveSpace = void 0;
+ this.token = token;
+ this.preserveSpace = !!preserveSpace;
+ }
+
+ }
+ const types$1 = {
+ brace: new TokContext("{"),
+ template: new TokContext("`", true)
+ };
+
+ const beforeExpr = true;
+ const startsExpr = true;
+ const isLoop = true;
+ const isAssign = true;
+ const prefix = true;
+ const postfix = true;
+ class ExportedTokenType {
+ constructor(label, conf = {}) {
+ this.label = void 0;
+ this.keyword = void 0;
+ this.beforeExpr = void 0;
+ this.startsExpr = void 0;
+ this.rightAssociative = void 0;
+ this.isLoop = void 0;
+ this.isAssign = void 0;
+ this.prefix = void 0;
+ this.postfix = void 0;
+ this.binop = void 0;
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.rightAssociative = !!conf.rightAssociative;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop != null ? conf.binop : null;
+ {
+ this.updateContext = null;
+ }
+ }
+
+ }
+ const keywords$1 = new Map();
+
+ function createKeyword(name, options = {}) {
+ options.keyword = name;
+ const token = createToken(name, options);
+ keywords$1.set(name, token);
+ return token;
+ }
+
+ function createBinop(name, binop) {
+ return createToken(name, {
+ beforeExpr,
+ binop
+ });
+ }
+
+ let tokenTypeCounter = -1;
+ const tokenTypes = [];
+ const tokenLabels = [];
+ const tokenBinops = [];
+ const tokenBeforeExprs = [];
+ const tokenStartsExprs = [];
+ const tokenPrefixes = [];
+
+ function createToken(name, options = {}) {
+ var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
+
+ ++tokenTypeCounter;
+ tokenLabels.push(name);
+ tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
+ tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
+ tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
+ tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
+ tokenTypes.push(new ExportedTokenType(name, options));
+ return tokenTypeCounter;
+ }
+
+ const tt = {
+ num: createToken("num", {
+ startsExpr
+ }),
+ bigint: createToken("bigint", {
+ startsExpr
+ }),
+ decimal: createToken("decimal", {
+ startsExpr
+ }),
+ regexp: createToken("regexp", {
+ startsExpr
+ }),
+ string: createToken("string", {
+ startsExpr
+ }),
+ name: createToken("name", {
+ startsExpr
+ }),
+ privateName: createToken("#name", {
+ startsExpr
+ }),
+ eof: createToken("eof"),
+ bracketL: createToken("[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketHashL: createToken("#[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketBarL: createToken("[|", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketR: createToken("]"),
+ bracketBarR: createToken("|]"),
+ braceL: createToken("{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceBarL: createToken("{|", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceHashL: createToken("#{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceR: createToken("}", {
+ beforeExpr
+ }),
+ braceBarR: createToken("|}"),
+ parenL: createToken("(", {
+ beforeExpr,
+ startsExpr
+ }),
+ parenR: createToken(")"),
+ comma: createToken(",", {
+ beforeExpr
+ }),
+ semi: createToken(";", {
+ beforeExpr
+ }),
+ colon: createToken(":", {
+ beforeExpr
+ }),
+ doubleColon: createToken("::", {
+ beforeExpr
+ }),
+ dot: createToken("."),
+ question: createToken("?", {
+ beforeExpr
+ }),
+ questionDot: createToken("?."),
+ arrow: createToken("=>", {
+ beforeExpr
+ }),
+ template: createToken("template"),
+ ellipsis: createToken("...", {
+ beforeExpr
+ }),
+ backQuote: createToken("`", {
+ startsExpr
+ }),
+ dollarBraceL: createToken("${", {
+ beforeExpr,
+ startsExpr
+ }),
+ at: createToken("@"),
+ hash: createToken("#", {
+ startsExpr
+ }),
+ interpreterDirective: createToken("#!..."),
+ eq: createToken("=", {
+ beforeExpr,
+ isAssign
+ }),
+ assign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ slashAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ moduloAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ incDec: createToken("++/--", {
+ prefix,
+ postfix,
+ startsExpr
+ }),
+ bang: createToken("!", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ tilde: createToken("~", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ pipeline: createBinop("|>", 0),
+ nullishCoalescing: createBinop("??", 1),
+ logicalOR: createBinop("||", 1),
+ logicalAND: createBinop("&&", 2),
+ bitwiseOR: createBinop("|", 3),
+ bitwiseXOR: createBinop("^", 4),
+ bitwiseAND: createBinop("&", 5),
+ equality: createBinop("==/!=/===/!==", 6),
+ relational: createBinop("</>/<=/>=", 7),
+ bitShift: createBinop("<</>>/>>>", 8),
+ plusMin: createToken("+/-", {
+ beforeExpr,
+ binop: 9,
+ prefix,
+ startsExpr
+ }),
+ modulo: createToken("%", {
+ binop: 10,
+ startsExpr
+ }),
+ star: createToken("*", {
+ binop: 10
+ }),
+ slash: createBinop("/", 10),
+ exponent: createToken("**", {
+ beforeExpr,
+ binop: 11,
+ rightAssociative: true
+ }),
+ _in: createKeyword("in", {
+ beforeExpr,
+ binop: 7
+ }),
+ _instanceof: createKeyword("instanceof", {
+ beforeExpr,
+ binop: 7
+ }),
+ _break: createKeyword("break"),
+ _case: createKeyword("case", {
+ beforeExpr
+ }),
+ _catch: createKeyword("catch"),
+ _continue: createKeyword("continue"),
+ _debugger: createKeyword("debugger"),
+ _default: createKeyword("default", {
+ beforeExpr
+ }),
+ _else: createKeyword("else", {
+ beforeExpr
+ }),
+ _finally: createKeyword("finally"),
+ _function: createKeyword("function", {
+ startsExpr
+ }),
+ _if: createKeyword("if"),
+ _return: createKeyword("return", {
+ beforeExpr
+ }),
+ _switch: createKeyword("switch"),
+ _throw: createKeyword("throw", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _try: createKeyword("try"),
+ _var: createKeyword("var"),
+ _const: createKeyword("const"),
+ _with: createKeyword("with"),
+ _new: createKeyword("new", {
+ beforeExpr,
+ startsExpr
+ }),
+ _this: createKeyword("this", {
+ startsExpr
+ }),
+ _super: createKeyword("super", {
+ startsExpr
+ }),
+ _class: createKeyword("class", {
+ startsExpr
+ }),
+ _extends: createKeyword("extends", {
+ beforeExpr
+ }),
+ _export: createKeyword("export"),
+ _import: createKeyword("import", {
+ startsExpr
+ }),
+ _null: createKeyword("null", {
+ startsExpr
+ }),
+ _true: createKeyword("true", {
+ startsExpr
+ }),
+ _false: createKeyword("false", {
+ startsExpr
+ }),
+ _typeof: createKeyword("typeof", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _void: createKeyword("void", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _delete: createKeyword("delete", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _do: createKeyword("do", {
+ isLoop,
+ beforeExpr
+ }),
+ _for: createKeyword("for", {
+ isLoop
+ }),
+ _while: createKeyword("while", {
+ isLoop
+ }),
+ jsxName: createToken("jsxName"),
+ jsxText: createToken("jsxText", {
+ beforeExpr: true
+ }),
+ jsxTagStart: createToken("jsxTagStart", {
+ startsExpr: true
+ }),
+ jsxTagEnd: createToken("jsxTagEnd"),
+ placeholder: createToken("%%", {
+ startsExpr: true
+ })
+ };
+ function tokenComesBeforeExpression(token) {
+ return tokenBeforeExprs[token];
+ }
+ function tokenCanStartExpression(token) {
+ return tokenStartsExprs[token];
+ }
+ function tokenIsAssignment(token) {
+ return token >= 35 && token <= 38;
+ }
+ function tokenIsLoop(token) {
+ return token >= 89 && token <= 91;
+ }
+ function tokenIsKeyword(token) {
+ return token >= 57 && token <= 91;
+ }
+ function tokenIsOperator(token) {
+ return token >= 42 && token <= 58;
+ }
+ function tokenIsPostfix(token) {
+ return token === 39;
+ }
+ function tokenIsPrefix(token) {
+ return tokenPrefixes[token];
+ }
+ function tokenLabelName(token) {
+ return tokenLabels[token];
+ }
+ function tokenOperatorPrecedence(token) {
+ return tokenBinops[token];
+ }
+ function tokenIsRightAssociative(token) {
+ return token === 56;
+ }
+ function getExportedToken(token) {
+ return tokenTypes[token];
+ }
+ function isTokenType(obj) {
+ return typeof obj === "number";
+ }
+ {
+ tokenTypes[16].updateContext = context => {
+ context.pop();
+ };
+
+ tokenTypes[13].updateContext = tokenTypes[15].updateContext = tokenTypes[31].updateContext = context => {
+ context.push(types$1.brace);
+ };
+
+ tokenTypes[30].updateContext = context => {
+ if (context[context.length - 1] === types$1.template) {
+ context.pop();
+ } else {
+ context.push(types$1.template);
+ }
+ };
+
+ tokenTypes[94].updateContext = context => {
+ context.push(types$1.j_expr, types$1.j_oTag);
+ };
+ }
+
+ let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+ let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+ const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+ const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+ const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+ const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+ function isInAstralSet(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+ }
+
+ function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes);
+ }
+ function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+ }
+
+ const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+ };
+ const keywords = new Set(reservedWords.keyword);
+ const reservedWordsStrictSet = new Set(reservedWords.strict);
+ const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+ function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+ }
+ function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+ }
+ function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+ }
+ function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+ }
+ function isKeyword(word) {
+ return keywords.has(word);
+ }
+
+ function isIteratorStart(current, next) {
+ return current === 64 && next === 64;
+ }
+ const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
+ function canBeReservedWord(word) {
+ return reservedWordLikeSet.has(word);
+ }
+
+ const SCOPE_OTHER = 0b000000000,
+ SCOPE_PROGRAM = 0b000000001,
+ SCOPE_FUNCTION = 0b000000010,
+ SCOPE_ARROW = 0b000000100,
+ SCOPE_SIMPLE_CATCH = 0b000001000,
+ SCOPE_SUPER = 0b000010000,
+ SCOPE_DIRECT_SUPER = 0b000100000,
+ SCOPE_CLASS = 0b001000000,
+ SCOPE_STATIC_BLOCK = 0b010000000,
+ SCOPE_TS_MODULE = 0b100000000,
+ SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
+ const BIND_KIND_VALUE = 0b000000000001,
+ BIND_KIND_TYPE = 0b000000000010,
+ BIND_SCOPE_VAR = 0b000000000100,
+ BIND_SCOPE_LEXICAL = 0b000000001000,
+ BIND_SCOPE_FUNCTION = 0b000000010000,
+ BIND_FLAGS_NONE = 0b000001000000,
+ BIND_FLAGS_CLASS = 0b000010000000,
+ BIND_FLAGS_TS_ENUM = 0b000100000000,
+ BIND_FLAGS_TS_CONST_ENUM = 0b001000000000,
+ BIND_FLAGS_TS_EXPORT_ONLY = 0b010000000000,
+ BIND_FLAGS_FLOW_DECLARE_FN = 0b100000000000;
+ const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,
+ BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,
+ BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,
+ BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,
+ BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,
+ BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,
+ BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,
+ BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,
+ BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;
+ const CLASS_ELEMENT_FLAG_STATIC = 0b100,
+ CLASS_ELEMENT_KIND_GETTER = 0b010,
+ CLASS_ELEMENT_KIND_SETTER = 0b001,
+ CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
+ const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
+ CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,
+ CLASS_ELEMENT_OTHER = 0;
+
+ class Scope {
+ constructor(flags) {
+ this.var = new Set();
+ this.lexical = new Set();
+ this.functions = new Set();
+ this.flags = flags;
+ }
+
+ }
+ class ScopeHandler {
+ constructor(raise, inModule) {
+ this.scopeStack = [];
+ this.undefinedExports = new Map();
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ this.inModule = inModule;
+ }
+
+ get inFunction() {
+ return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;
+ }
+
+ get allowSuper() {
+ return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;
+ }
+
+ get allowDirectSuper() {
+ return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;
+ }
+
+ get inClass() {
+ return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;
+ }
+
+ get inClassAndNotInNonArrowFunction() {
+ const flags = this.currentThisScopeFlags();
+ return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;
+ }
+
+ get inStaticBlock() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & SCOPE_STATIC_BLOCK) {
+ return true;
+ }
+
+ if (flags & (SCOPE_VAR | SCOPE_CLASS)) {
+ return false;
+ }
+ }
+ }
+
+ get inNonArrowFunction() {
+ return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;
+ }
+
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+
+ createScope(flags) {
+ return new Scope(flags);
+ }
+
+ enter(flags) {
+ this.scopeStack.push(this.createScope(flags));
+ }
+
+ exit() {
+ this.scopeStack.pop();
+ }
+
+ treatFunctionsAsVarInScope(scope) {
+ return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM);
+ }
+
+ declareName(name, bindingType, pos) {
+ let scope = this.currentScope();
+
+ if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ scope.functions.add(name);
+ } else {
+ scope.lexical.add(name);
+ }
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ this.maybeExportDefined(scope, name);
+ }
+ } else if (bindingType & BIND_SCOPE_VAR) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ scope = this.scopeStack[i];
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ scope.var.add(name);
+ this.maybeExportDefined(scope, name);
+ if (scope.flags & SCOPE_VAR) break;
+ }
+ }
+
+ if (this.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ maybeExportDefined(scope, name) {
+ if (this.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ checkRedeclarationInScope(scope, name, bindingType, pos) {
+ if (this.isRedeclaredInScope(scope, name, bindingType)) {
+ this.raise(pos, ErrorMessages.VarRedeclaration, name);
+ }
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (!(bindingType & BIND_KIND_VALUE)) return false;
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
+ }
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
+ }
+
+ return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
+ }
+
+ checkLocalExport(id) {
+ const {
+ name
+ } = id;
+ const topLevelScope = this.scopeStack[0];
+
+ if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
+ this.undefinedExports.set(name, id.start);
+ }
+ }
+
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+
+ currentVarScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & SCOPE_VAR) {
+ return flags;
+ }
+ }
+ }
+
+ currentThisScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {
+ return flags;
+ }
+ }
+ }
+
+ }
+
+ class FlowScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.declareFunctions = new Set();
+ }
+
+ }
+
+ class FlowScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new FlowScope(flags);
+ }
+
+ declareName(name, bindingType, pos) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ this.maybeExportDefined(scope, name);
+ scope.declareFunctions.add(name);
+ return;
+ }
+
+ super.declareName(...arguments);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (super.isRedeclaredInScope(...arguments)) return true;
+
+ if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
+ return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
+ }
+
+ return false;
+ }
+
+ checkLocalExport(id) {
+ if (!this.scopeStack[0].declareFunctions.has(id.name)) {
+ super.checkLocalExport(id);
+ }
+ }
+
+ }
+
+ class State {
+ constructor() {
+ this.strict = void 0;
+ this.curLine = void 0;
+ this.startLoc = void 0;
+ this.endLoc = void 0;
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.maybeInArrowParameters = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.inPropertyName = false;
+ this.hasFlowComment = false;
+ this.isAmbientContext = false;
+ this.inAbstractClass = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.decoratorStack = [[]];
+ this.comments = [];
+ this.commentStack = [];
+ this.pos = 0;
+ this.lineStart = 0;
+ this.type = 7;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.lastTokStart = 0;
+ this.lastTokEnd = 0;
+ this.context = [types$1.brace];
+ this.exprAllowed = true;
+ this.containsEsc = false;
+ this.strictErrors = new Map();
+ this.tokensLength = 0;
+ }
+
+ init(options) {
+ this.strict = options.strictMode === false ? false : options.strictMode === true ? true : options.sourceType === "module";
+ this.curLine = options.startLine;
+ this.startLoc = this.endLoc = this.curPosition();
+ }
+
+ curPosition() {
+ return new Position(this.curLine, this.pos - this.lineStart);
+ }
+
+ clone(skipArrays) {
+ const state = new State();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+ let val = this[key];
+
+ if (!skipArrays && Array.isArray(val)) {
+ val = val.slice();
+ }
+
+ state[key] = val;
+ }
+
+ return state;
+ }
+
+ }
+
+ var _isDigit = function isDigit(code) {
+ return code >= 48 && code <= 57;
+ };
+ const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100]);
+ const forbiddenNumericSeparatorSiblings = {
+ decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
+ hex: [46, 88, 95, 120]
+ };
+ const allowedNumericSeparatorSiblings = {};
+ allowedNumericSeparatorSiblings.bin = [48, 49];
+ allowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55];
+ allowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57];
+ allowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102];
+ class Token {
+ constructor(state) {
+ this.type = state.type;
+ this.value = state.value;
+ this.start = state.start;
+ this.end = state.end;
+ this.loc = new SourceLocation(state.startLoc, state.endLoc);
+ }
+
+ }
+ class Tokenizer extends ParserError {
+ constructor(options, input) {
+ super();
+ this.isLookahead = void 0;
+ this.tokens = [];
+ this.state = new State();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.isLookahead = false;
+ }
+
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+
+ next() {
+ this.checkKeywordEscapes();
+
+ if (this.options.tokens) {
+ this.pushToken(new Token(this.state));
+ }
+
+ this.state.lastTokEnd = this.state.end;
+ this.state.lastTokStart = this.state.start;
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+
+ eat(type) {
+ if (this.match(type)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ match(type) {
+ return this.state.type === type;
+ }
+
+ createLookaheadState(state) {
+ return {
+ pos: state.pos,
+ value: null,
+ type: state.type,
+ start: state.start,
+ end: state.end,
+ lastTokEnd: state.end,
+ context: [this.curContext()],
+ inType: state.inType
+ };
+ }
+
+ lookahead() {
+ const old = this.state;
+ this.state = this.createLookaheadState(old);
+ this.isLookahead = true;
+ this.nextToken();
+ this.isLookahead = false;
+ const curr = this.state;
+ this.state = old;
+ return curr;
+ }
+
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+
+ nextTokenStartSince(pos) {
+ skipWhiteSpace.lastIndex = pos;
+ return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;
+ }
+
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+
+ codePointAtPos(pos) {
+ let cp = this.input.charCodeAt(pos);
+
+ if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {
+ const trail = this.input.charCodeAt(pos);
+
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+
+ return cp;
+ }
+
+ setStrict(strict) {
+ this.state.strict = strict;
+
+ if (strict) {
+ this.state.strictErrors.forEach((message, pos) => this.raise(pos, message));
+ this.state.strictErrors.clear();
+ }
+ }
+
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+
+ nextToken() {
+ const curContext = this.curContext();
+ if (!curContext.preserveSpace) this.skipSpace();
+ this.state.start = this.state.pos;
+ if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
+
+ if (this.state.pos >= this.length) {
+ this.finishToken(7);
+ return;
+ }
+
+ if (curContext === types$1.template) {
+ this.readTmplToken();
+ } else {
+ this.getTokenFromCode(this.codePointAtPos(this.state.pos));
+ }
+ }
+
+ skipBlockComment() {
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ const start = this.state.pos;
+ const end = this.input.indexOf("*/", start + 2);
+ if (end === -1) throw this.raise(start, ErrorMessages.UnterminatedComment);
+ this.state.pos = end + 2;
+ lineBreakG.lastIndex = start + 2;
+
+ while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {
+ ++this.state.curLine;
+ this.state.lineStart = lineBreakG.lastIndex;
+ }
+
+ if (this.isLookahead) return;
+ const comment = {
+ type: "CommentBlock",
+ value: this.input.slice(start + 2, end),
+ start,
+ end: end + 2,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+
+ skipLineComment(startSkip) {
+ const start = this.state.pos;
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ let ch = this.input.charCodeAt(this.state.pos += startSkip);
+
+ if (this.state.pos < this.length) {
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ }
+
+ if (this.isLookahead) return;
+ const end = this.state.pos;
+ const value = this.input.slice(start + startSkip, end);
+ const comment = {
+ type: "CommentLine",
+ value,
+ start,
+ end,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+
+ skipSpace() {
+ const spaceStart = this.state.pos;
+ const comments = [];
+
+ loop: while (this.state.pos < this.length) {
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42:
+ {
+ const comment = this.skipBlockComment();
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+
+ break;
+ }
+
+ case 47:
+ {
+ const comment = this.skipLineComment(2);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+
+ break;
+ }
+
+ default:
+ break loop;
+ }
+
+ break;
+
+ default:
+ if (isWhitespace(ch)) {
+ ++this.state.pos;
+ } else if (ch === 45 && !this.inModule) {
+ const pos = this.state.pos;
+
+ if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
+ const comment = this.skipLineComment(3);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else if (ch === 60 && !this.inModule) {
+ const pos = this.state.pos;
+
+ if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
+ const comment = this.skipLineComment(4);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else {
+ break loop;
+ }
+
+ }
+ }
+
+ if (comments.length > 0) {
+ const end = this.state.pos;
+ const CommentWhitespace = {
+ start: spaceStart,
+ end,
+ comments,
+ leadingNode: null,
+ trailingNode: null,
+ containingNode: null
+ };
+ this.state.commentStack.push(CommentWhitespace);
+ }
+ }
+
+ finishToken(type, val) {
+ this.state.end = this.state.pos;
+ const prevType = this.state.type;
+ this.state.type = type;
+ this.state.value = val;
+
+ if (!this.isLookahead) {
+ this.state.endLoc = this.state.curPosition();
+ this.updateContext(prevType);
+ }
+ }
+
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+
+ const nextPos = this.state.pos + 1;
+ const next = this.codePointAtPos(nextPos);
+
+ if (next >= 48 && next <= 57) {
+ throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash);
+ }
+
+ if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
+ this.expectPlugin("recordAndTuple");
+
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") {
+ throw this.raise(this.state.pos, next === 123 ? ErrorMessages.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages.TupleExpressionHashIncorrectStartSyntaxType);
+ }
+
+ this.state.pos += 2;
+
+ if (next === 123) {
+ this.finishToken(15);
+ } else {
+ this.finishToken(9);
+ }
+ } else if (isIdentifierStart(next)) {
+ ++this.state.pos;
+ this.finishToken(6, this.readWord1(next));
+ } else if (next === 92) {
+ ++this.state.pos;
+ this.finishToken(6, this.readWord1());
+ } else {
+ this.finishOp(33, 1);
+ }
+ }
+
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(29);
+ } else {
+ ++this.state.pos;
+ this.finishToken(24);
+ }
+ }
+
+ readToken_slash() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(37, 2);
+ } else {
+ this.finishOp(55, 1);
+ }
+ }
+
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ let ch = this.input.charCodeAt(this.state.pos + 1);
+ if (ch !== 33) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+
+ const value = this.input.slice(start + 2, this.state.pos);
+ this.finishToken(34, value);
+ return true;
+ }
+
+ readToken_mult_modulo(code) {
+ let type = code === 42 ? 54 : 53;
+ let width = 1;
+ let next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 42) {
+ width++;
+ next = this.input.charCodeAt(this.state.pos + 2);
+ type = 56;
+ }
+
+ if (next === 61 && !this.state.inType) {
+ width++;
+ type = code === 37 ? 38 : 36;
+ }
+
+ this.finishOp(type, width);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(36, 3);
+ } else {
+ this.finishOp(code === 124 ? 44 : 45, 2);
+ }
+
+ return;
+ }
+
+ if (code === 124) {
+ if (next === 62) {
+ this.finishOp(42, 2);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 125) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(17);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 93) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(12);
+ return;
+ }
+ }
+
+ if (next === 61) {
+ this.finishOp(36, 2);
+ return;
+ }
+
+ this.finishOp(code === 124 ? 46 : 48, 1);
+ }
+
+ readToken_caret() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(36, 2);
+ } else {
+ this.finishOp(47, 1);
+ }
+ }
+
+ readToken_plus_min(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ this.finishOp(39, 2);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(36, 2);
+ } else {
+ this.finishOp(52, 1);
+ }
+ }
+
+ readToken_lt_gt(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ let size = 1;
+
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
+
+ if (this.input.charCodeAt(this.state.pos + size) === 61) {
+ this.finishOp(36, size + 1);
+ return;
+ }
+
+ this.finishOp(51, size);
+ return;
+ }
+
+ if (next === 61) {
+ size = 2;
+ }
+
+ this.finishOp(50, size);
+ }
+
+ readToken_eq_excl(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(49, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+ return;
+ }
+
+ if (code === 61 && next === 62) {
+ this.state.pos += 2;
+ this.finishToken(27);
+ return;
+ }
+
+ this.finishOp(code === 61 ? 35 : 40, 1);
+ }
+
+ readToken_question() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ const next2 = this.input.charCodeAt(this.state.pos + 2);
+
+ if (next === 63) {
+ if (next2 === 61) {
+ this.finishOp(36, 3);
+ } else {
+ this.finishOp(43, 2);
+ }
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(26);
+ } else {
+ ++this.state.pos;
+ this.finishToken(25);
+ }
+ }
+
+ getTokenFromCode(code) {
+ switch (code) {
+ case 46:
+ this.readToken_dot();
+ return;
+
+ case 40:
+ ++this.state.pos;
+ this.finishToken(18);
+ return;
+
+ case 41:
+ ++this.state.pos;
+ this.finishToken(19);
+ return;
+
+ case 59:
+ ++this.state.pos;
+ this.finishToken(21);
+ return;
+
+ case 44:
+ ++this.state.pos;
+ this.finishToken(20);
+ return;
+
+ case 91:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(10);
+ } else {
+ ++this.state.pos;
+ this.finishToken(8);
+ }
+
+ return;
+
+ case 93:
+ ++this.state.pos;
+ this.finishToken(11);
+ return;
+
+ case 123:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(14);
+ } else {
+ ++this.state.pos;
+ this.finishToken(13);
+ }
+
+ return;
+
+ case 125:
+ ++this.state.pos;
+ this.finishToken(16);
+ return;
+
+ case 58:
+ if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+ this.finishOp(23, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(22);
+ }
+
+ return;
+
+ case 63:
+ this.readToken_question();
+ return;
+
+ case 96:
+ ++this.state.pos;
+ this.finishToken(30);
+ return;
+
+ case 48:
+ {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 120 || next === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+
+ if (next === 111 || next === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+
+ if (next === 98 || next === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+
+ case 34:
+ case 39:
+ this.readString(code);
+ return;
+
+ case 47:
+ this.readToken_slash();
+ return;
+
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(code);
+ return;
+
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(code);
+ return;
+
+ case 94:
+ this.readToken_caret();
+ return;
+
+ case 43:
+ case 45:
+ this.readToken_plus_min(code);
+ return;
+
+ case 60:
+ case 62:
+ this.readToken_lt_gt(code);
+ return;
+
+ case 61:
+ case 33:
+ this.readToken_eq_excl(code);
+ return;
+
+ case 126:
+ this.finishOp(41, 1);
+ return;
+
+ case 64:
+ ++this.state.pos;
+ this.finishToken(32);
+ return;
+
+ case 35:
+ this.readToken_numberSign();
+ return;
+
+ case 92:
+ this.readWord();
+ return;
+
+ default:
+ if (isIdentifierStart(code)) {
+ this.readWord(code);
+ return;
+ }
+
+ }
+
+ throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, String.fromCodePoint(code));
+ }
+
+ finishOp(type, size) {
+ const str = this.input.slice(this.state.pos, this.state.pos + size);
+ this.state.pos += size;
+ this.finishToken(type, str);
+ }
+
+ readRegexp() {
+ const start = this.state.start + 1;
+ let escaped, inClass;
+ let {
+ pos
+ } = this.state;
+
+ for (;; ++pos) {
+ if (pos >= this.length) {
+ throw this.raise(start, ErrorMessages.UnterminatedRegExp);
+ }
+
+ const ch = this.input.charCodeAt(pos);
+
+ if (isNewLine(ch)) {
+ throw this.raise(start, ErrorMessages.UnterminatedRegExp);
+ }
+
+ if (escaped) {
+ escaped = false;
+ } else {
+ if (ch === 91) {
+ inClass = true;
+ } else if (ch === 93 && inClass) {
+ inClass = false;
+ } else if (ch === 47 && !inClass) {
+ break;
+ }
+
+ escaped = ch === 92;
+ }
+ }
+
+ const content = this.input.slice(start, pos);
+ ++pos;
+ let mods = "";
+
+ while (pos < this.length) {
+ const cp = this.codePointAtPos(pos);
+ const char = String.fromCharCode(cp);
+
+ if (VALID_REGEX_FLAGS.has(cp)) {
+ if (mods.includes(char)) {
+ this.raise(pos + 1, ErrorMessages.DuplicateRegExpFlags);
+ }
+ } else if (isIdentifierChar(cp) || cp === 92) {
+ this.raise(pos + 1, ErrorMessages.MalformedRegExpFlags);
+ } else {
+ break;
+ }
+
+ ++pos;
+ mods += char;
+ }
+
+ this.state.pos = pos;
+ this.finishToken(3, {
+ pattern: content,
+ flags: mods
+ });
+ }
+
+ readInt(radix, len, forceLen, allowNumSeparator = true) {
+ const start = this.state.pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
+ const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin;
+ let invalid = false;
+ let total = 0;
+
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = this.input.charCodeAt(this.state.pos);
+ let val;
+
+ if (code === 95) {
+ const prev = this.input.charCodeAt(this.state.pos - 1);
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (allowedSiblings.indexOf(next) === -1) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);
+ } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);
+ }
+
+ if (!allowNumSeparator) {
+ this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence);
+ }
+
+ ++this.state.pos;
+ continue;
+ }
+
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+
+ if (val >= radix) {
+ if (this.options.errorRecovery && val <= 9) {
+ val = 0;
+ this.raise(this.state.start + i + 2, ErrorMessages.InvalidDigit, radix);
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+
+ ++this.state.pos;
+ total = total * radix + val;
+ }
+
+ if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {
+ return null;
+ }
+
+ return total;
+ }
+
+ readRadixNumber(radix) {
+ const start = this.state.pos;
+ let isBigInt = false;
+ this.state.pos += 2;
+ const val = this.readInt(radix);
+
+ if (val == null) {
+ this.raise(this.state.start + 2, ErrorMessages.InvalidDigit, radix);
+ }
+
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ } else if (next === 109) {
+ throw this.raise(start, ErrorMessages.InvalidDecimal);
+ }
+
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);
+ }
+
+ if (isBigInt) {
+ const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
+ this.finishToken(1, str);
+ return;
+ }
+
+ this.finishToken(0, val);
+ }
+
+ readNumber(startsWithDot) {
+ const start = this.state.pos;
+ let isFloat = false;
+ let isBigInt = false;
+ let isDecimal = false;
+ let hasExponent = false;
+ let isOctal = false;
+
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(start, ErrorMessages.InvalidNumber);
+ }
+
+ const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+
+ if (hasLeadingZero) {
+ const integer = this.input.slice(start, this.state.pos);
+ this.recordStrictModeErrors(start, ErrorMessages.StrictOctalLiteral);
+
+ if (!this.state.strict) {
+ const underscorePos = integer.indexOf("_");
+
+ if (underscorePos > 0) {
+ this.raise(underscorePos + start, ErrorMessages.ZeroDigitNumericSeparator);
+ }
+ }
+
+ isOctal = hasLeadingZero && !/[89]/.test(integer);
+ }
+
+ let next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 46 && !isOctal) {
+ ++this.state.pos;
+ this.readInt(10);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if ((next === 69 || next === 101) && !isOctal) {
+ next = this.input.charCodeAt(++this.state.pos);
+
+ if (next === 43 || next === 45) {
+ ++this.state.pos;
+ }
+
+ if (this.readInt(10) === null) {
+ this.raise(start, ErrorMessages.InvalidOrMissingExponent);
+ }
+
+ isFloat = true;
+ hasExponent = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if (next === 110) {
+ if (isFloat || hasLeadingZero) {
+ this.raise(start, ErrorMessages.InvalidBigIntLiteral);
+ }
+
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (next === 109) {
+ this.expectPlugin("decimal", this.state.pos);
+
+ if (hasExponent || hasLeadingZero) {
+ this.raise(start, ErrorMessages.InvalidDecimal);
+ }
+
+ ++this.state.pos;
+ isDecimal = true;
+ }
+
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);
+ }
+
+ const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
+
+ if (isBigInt) {
+ this.finishToken(1, str);
+ return;
+ }
+
+ if (isDecimal) {
+ this.finishToken(2, str);
+ return;
+ }
+
+ const val = isOctal ? parseInt(str, 8) : parseFloat(str);
+ this.finishToken(0, val);
+ }
+
+ readCodePoint(throwOnInvalid) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let code;
+
+ if (ch === 123) {
+ const codePos = ++this.state.pos;
+ code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid);
+ ++this.state.pos;
+
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages.InvalidCodePoint);
+ } else {
+ return null;
+ }
+ }
+ } else {
+ code = this.readHexChar(4, false, throwOnInvalid);
+ }
+
+ return code;
+ }
+
+ readString(quote) {
+ let out = "",
+ chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.readEscapedChar(false);
+ chunkStart = this.state.pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ this.finishToken(4, out);
+ }
+
+ readTmplToken() {
+ let out = "",
+ chunkStart = this.state.pos,
+ containsInvalid = false;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
+ if (this.state.pos === this.state.start && this.match(28)) {
+ if (ch === 36) {
+ this.state.pos += 2;
+ this.finishToken(31);
+ return;
+ } else {
+ ++this.state.pos;
+ this.finishToken(30);
+ return;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ this.finishToken(28, containsInvalid ? null : out);
+ return;
+ }
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ const escaped = this.readEscapedChar(true);
+
+ if (escaped === null) {
+ containsInvalid = true;
+ } else {
+ out += escaped;
+ }
+
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ out += "\n";
+ break;
+
+ default:
+ out += String.fromCharCode(ch);
+ break;
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ }
+
+ recordStrictModeErrors(pos, message) {
+ if (this.state.strict && !this.state.strictErrors.has(pos)) {
+ this.raise(pos, message);
+ } else {
+ this.state.strictErrors.set(pos, message);
+ }
+ }
+
+ readEscapedChar(inTemplate) {
+ const throwOnInvalid = !inTemplate;
+ const ch = this.input.charCodeAt(++this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 110:
+ return "\n";
+
+ case 114:
+ return "\r";
+
+ case 120:
+ {
+ const code = this.readHexChar(2, false, throwOnInvalid);
+ return code === null ? null : String.fromCharCode(code);
+ }
+
+ case 117:
+ {
+ const code = this.readCodePoint(throwOnInvalid);
+ return code === null ? null : String.fromCodePoint(code);
+ }
+
+ case 116:
+ return "\t";
+
+ case 98:
+ return "\b";
+
+ case 118:
+ return "\u000b";
+
+ case 102:
+ return "\f";
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ this.state.lineStart = this.state.pos;
+ ++this.state.curLine;
+
+ case 8232:
+ case 8233:
+ return "";
+
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return null;
+ } else {
+ this.recordStrictModeErrors(this.state.pos - 1, ErrorMessages.StrictNumericEscape);
+ }
+
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const codePos = this.state.pos - 1;
+ const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/);
+ let octalStr = match[0];
+ let octal = parseInt(octalStr, 8);
+
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+
+ this.state.pos += octalStr.length - 1;
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return null;
+ } else {
+ this.recordStrictModeErrors(codePos, ErrorMessages.StrictNumericEscape);
+ }
+ }
+
+ return String.fromCharCode(octal);
+ }
+
+ return String.fromCharCode(ch);
+ }
+ }
+
+ readHexChar(len, forceLen, throwOnInvalid) {
+ const codePos = this.state.pos;
+ const n = this.readInt(16, len, forceLen, false);
+
+ if (n === null) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages.InvalidEscapeSequence);
+ } else {
+ this.state.pos = codePos - 1;
+ }
+ }
+
+ return n;
+ }
+
+ readWord1(firstCode) {
+ this.state.containsEsc = false;
+ let word = "";
+ const start = this.state.pos;
+ let chunkStart = this.state.pos;
+
+ if (firstCode !== undefined) {
+ this.state.pos += firstCode <= 0xffff ? 1 : 2;
+ }
+
+ while (this.state.pos < this.length) {
+ const ch = this.codePointAtPos(this.state.pos);
+
+ if (isIdentifierChar(ch)) {
+ this.state.pos += ch <= 0xffff ? 1 : 2;
+ } else if (ch === 92) {
+ this.state.containsEsc = true;
+ word += this.input.slice(chunkStart, this.state.pos);
+ const escStart = this.state.pos;
+ const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
+
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(this.state.pos, ErrorMessages.MissingUnicodeEscape);
+ chunkStart = this.state.pos - 1;
+ continue;
+ }
+
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier);
+ }
+
+ word += String.fromCodePoint(esc);
+ }
+
+ chunkStart = this.state.pos;
+ } else {
+ break;
+ }
+ }
+
+ return word + this.input.slice(chunkStart, this.state.pos);
+ }
+
+ readWord(firstCode) {
+ const word = this.readWord1(firstCode);
+ const type = keywords$1.get(word) || 5;
+ this.finishToken(type, word);
+ }
+
+ checkKeywordEscapes() {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsKeyword(type) && this.state.containsEsc) {
+ this.raise(this.state.start, ErrorMessages.InvalidEscapedReservedWord, tokenLabelName(type));
+ }
+ }
+
+ updateContext(prevType) {
+ const {
+ context,
+ type
+ } = this.state;
+
+ switch (type) {
+ case 16:
+ context.pop();
+ break;
+
+ case 13:
+ case 15:
+ case 31:
+ context.push(types$1.brace);
+ break;
+
+ case 30:
+ if (context[context.length - 1] === types$1.template) {
+ context.pop();
+ } else {
+ context.push(types$1.template);
+ }
+
+ break;
+ }
+ }
+
+ }
+
+ class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+
+ }
+ class ClassScopeHandler {
+ constructor(raise) {
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ }
+
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+
+ for (const [name, pos] of Array.from(oldClassScope.undefinedPrivateNames)) {
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, pos);
+ }
+ } else {
+ this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);
+ }
+ }
+ }
+
+ declarePrivateName(name, elementType, pos) {
+ const classScope = this.current();
+ let redefined = classScope.privateNames.has(name);
+
+ if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
+ const accessor = redefined && classScope.loneAccessors.get(name);
+
+ if (accessor) {
+ const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
+ const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
+ const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
+ const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) classScope.loneAccessors.delete(name);
+ } else if (!redefined) {
+ classScope.loneAccessors.set(name, elementType);
+ }
+ }
+
+ if (redefined) {
+ this.raise(pos, ErrorMessages.PrivateNameRedeclaration, name);
+ }
+
+ classScope.privateNames.add(name);
+ classScope.undefinedPrivateNames.delete(name);
+ }
+
+ usePrivateName(name, pos) {
+ let classScope;
+
+ for (classScope of this.stack) {
+ if (classScope.privateNames.has(name)) return;
+ }
+
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, pos);
+ } else {
+ this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);
+ }
+ }
+
+ }
+
+ const kExpression = 0,
+ kMaybeArrowParameterDeclaration = 1,
+ kMaybeAsyncArrowParameterDeclaration = 2,
+ kParameterDeclaration = 3;
+
+ class ExpressionScope {
+ constructor(type = kExpression) {
+ this.type = void 0;
+ this.type = type;
+ }
+
+ canBeArrowParameterDeclaration() {
+ return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;
+ }
+
+ isCertainlyParameterDeclaration() {
+ return this.type === kParameterDeclaration;
+ }
+
+ }
+
+ class ArrowHeadParsingScope extends ExpressionScope {
+ constructor(type) {
+ super(type);
+ this.errors = new Map();
+ }
+
+ recordDeclarationError(pos, template) {
+ this.errors.set(pos, template);
+ }
+
+ clearDeclarationError(pos) {
+ this.errors.delete(pos);
+ }
+
+ iterateErrors(iterator) {
+ this.errors.forEach(iterator);
+ }
+
+ }
+
+ class ExpressionScopeHandler {
+ constructor(raise) {
+ this.stack = [new ExpressionScope()];
+ this.raise = raise;
+ }
+
+ enter(scope) {
+ this.stack.push(scope);
+ }
+
+ exit() {
+ this.stack.pop();
+ }
+
+ recordParameterInitializerError(pos, template) {
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+
+ while (!scope.isCertainlyParameterDeclaration()) {
+ if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(pos, template);
+ } else {
+ return;
+ }
+
+ scope = stack[--i];
+ }
+
+ this.raise(pos, template);
+ }
+
+ recordParenthesizedIdentifierError(pos, template) {
+ const {
+ stack
+ } = this;
+ const scope = stack[stack.length - 1];
+
+ if (scope.isCertainlyParameterDeclaration()) {
+ this.raise(pos, template);
+ } else if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(pos, template);
+ } else {
+ return;
+ }
+ }
+
+ recordAsyncArrowParametersError(pos, template) {
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+
+ while (scope.canBeArrowParameterDeclaration()) {
+ if (scope.type === kMaybeAsyncArrowParameterDeclaration) {
+ scope.recordDeclarationError(pos, template);
+ }
+
+ scope = stack[--i];
+ }
+ }
+
+ validateAsPattern() {
+ const {
+ stack
+ } = this;
+ const currentScope = stack[stack.length - 1];
+ if (!currentScope.canBeArrowParameterDeclaration()) return;
+ currentScope.iterateErrors((template, pos) => {
+ this.raise(pos, template);
+ let i = stack.length - 2;
+ let scope = stack[i];
+
+ while (scope.canBeArrowParameterDeclaration()) {
+ scope.clearDeclarationError(pos);
+ scope = stack[--i];
+ }
+ });
+ }
+
+ }
+ function newParameterDeclarationScope() {
+ return new ExpressionScope(kParameterDeclaration);
+ }
+ function newArrowHeadScope() {
+ return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);
+ }
+ function newAsyncArrowScope() {
+ return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);
+ }
+ function newExpressionScope() {
+ return new ExpressionScope();
+ }
+
+ const PARAM = 0b0000,
+ PARAM_YIELD = 0b0001,
+ PARAM_AWAIT = 0b0010,
+ PARAM_RETURN = 0b0100,
+ PARAM_IN = 0b1000;
+ class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+
+ exit() {
+ this.stacks.pop();
+ }
+
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+
+ get hasAwait() {
+ return (this.currentFlags() & PARAM_AWAIT) > 0;
+ }
+
+ get hasYield() {
+ return (this.currentFlags() & PARAM_YIELD) > 0;
+ }
+
+ get hasReturn() {
+ return (this.currentFlags() & PARAM_RETURN) > 0;
+ }
+
+ get hasIn() {
+ return (this.currentFlags() & PARAM_IN) > 0;
+ }
+
+ }
+ function functionFlags(isAsync, isGenerator) {
+ return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
+ }
+
+ class UtilParser extends Tokenizer {
+ addExtra(node, key, val) {
+ if (!node) return;
+ const extra = node.extra = node.extra || {};
+ extra[key] = val;
+ }
+
+ isRelational(op) {
+ return this.match(50) && this.state.value === op;
+ }
+
+ expectRelational(op) {
+ if (this.isRelational(op)) {
+ this.next();
+ } else {
+ this.unexpected(null, 50);
+ }
+ }
+
+ isContextual(name) {
+ return this.match(5) && this.state.value === name && !this.state.containsEsc;
+ }
+
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+
+ if (this.input.slice(nameStart, nameEnd) === name) {
+ const nextCh = this.input.charCodeAt(nameEnd);
+ return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800);
+ }
+
+ return false;
+ }
+
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, name);
+ }
+
+ eatContextual(name) {
+ return this.isContextual(name) && this.eat(5);
+ }
+
+ expectContextual(name, template) {
+ if (!this.eatContextual(name)) this.unexpected(null, template);
+ }
+
+ canInsertSemicolon() {
+ return this.match(7) || this.match(16) || this.hasPrecedingLineBreak();
+ }
+
+ hasPrecedingLineBreak() {
+ return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+ }
+
+ hasFollowingLineBreak() {
+ skipWhiteSpaceToLineBreak.lastIndex = this.state.end;
+ return skipWhiteSpaceToLineBreak.test(this.input);
+ }
+
+ isLineTerminator() {
+ return this.eat(21) || this.canInsertSemicolon();
+ }
+
+ semicolon(allowAsi = true) {
+ if (allowAsi ? this.isLineTerminator() : this.eat(21)) return;
+ this.raise(this.state.lastTokEnd, ErrorMessages.MissingSemicolon);
+ }
+
+ expect(type, pos) {
+ this.eat(type) || this.unexpected(pos, type);
+ }
+
+ assertNoSpace(message = "Unexpected space.") {
+ if (this.state.start > this.state.lastTokEnd) {
+ this.raise(this.state.lastTokEnd, {
+ code: ErrorCodes.SyntaxError,
+ reasonCode: "UnexpectedSpace",
+ template: message
+ });
+ }
+ }
+
+ unexpected(pos, messageOrType = {
+ code: ErrorCodes.SyntaxError,
+ reasonCode: "UnexpectedToken",
+ template: "Unexpected token"
+ }) {
+ if (isTokenType(messageOrType)) {
+ messageOrType = {
+ code: ErrorCodes.SyntaxError,
+ reasonCode: "UnexpectedToken",
+ template: `Unexpected token, expected "${tokenLabelName(messageOrType)}"`
+ };
+ }
+
+ throw this.raise(pos != null ? pos : this.state.start, messageOrType);
+ }
+
+ expectPlugin(name, pos) {
+ if (!this.hasPlugin(name)) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: [name]
+ }, `This experimental syntax requires enabling the parser plugin: '${name}'`);
+ }
+
+ return true;
+ }
+
+ expectOnePlugin(names, pos) {
+ if (!names.some(n => this.hasPlugin(n))) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: names
+ }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`);
+ }
+ }
+
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ this.state.tokensLength = failState.tokensLength;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+
+ throw error;
+ }
+ }
+
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssign,
+ doubleProto,
+ optionalParameters
+ } = refExpressionErrors;
+
+ if (!andThrow) {
+ return shorthandAssign >= 0 || doubleProto >= 0 || optionalParameters >= 0;
+ }
+
+ if (shorthandAssign >= 0) {
+ this.unexpected(shorthandAssign);
+ }
+
+ if (doubleProto >= 0) {
+ this.raise(doubleProto, ErrorMessages.DuplicateProto);
+ }
+
+ if (optionalParameters >= 0) {
+ this.unexpected(optionalParameters);
+ }
+ }
+
+ isLiteralPropertyName() {
+ return this.match(5) || tokenIsKeyword(this.state.type) || this.match(4) || this.match(0) || this.match(1) || this.match(2);
+ }
+
+ isPrivateName(node) {
+ return node.type === "PrivateName";
+ }
+
+ getPrivateNameSV(node) {
+ return node.id.name;
+ }
+
+ hasPropertyAsPrivateName(node) {
+ return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
+ }
+
+ isOptionalChain(node) {
+ return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression";
+ }
+
+ isObjectProperty(node) {
+ return node.type === "ObjectProperty";
+ }
+
+ isObjectMethod(node) {
+ return node.type === "ObjectMethod";
+ }
+
+ initializeScopes(inModule = this.options.sourceType === "module") {
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ const oldExportedIdentifiers = this.exportedIdentifiers;
+ this.exportedIdentifiers = new Set();
+ const oldInModule = this.inModule;
+ this.inModule = inModule;
+ const oldScope = this.scope;
+ const ScopeHandler = this.getScopeHandler();
+ this.scope = new ScopeHandler(this.raise.bind(this), this.inModule);
+ const oldProdParam = this.prodParam;
+ this.prodParam = new ProductionParameterHandler();
+ const oldClassScope = this.classScope;
+ this.classScope = new ClassScopeHandler(this.raise.bind(this));
+ const oldExpressionScope = this.expressionScope;
+ this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this));
+ return () => {
+ this.state.labels = oldLabels;
+ this.exportedIdentifiers = oldExportedIdentifiers;
+ this.inModule = oldInModule;
+ this.scope = oldScope;
+ this.prodParam = oldProdParam;
+ this.classScope = oldClassScope;
+ this.expressionScope = oldExpressionScope;
+ };
+ }
+
+ enterInitialScopes() {
+ let paramFlags = PARAM;
+
+ if (this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ }
+
+ }
+ class ExpressionErrors {
+ constructor() {
+ this.shorthandAssign = -1;
+ this.doubleProto = -1;
+ this.optionalParameters = -1;
+ }
+
+ }
+
+ class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation(loc);
+ if (parser != null && parser.options.ranges) this.range = [pos, 0];
+ if (parser != null && parser.filename) this.loc.filename = parser.filename;
+ }
+
+ }
+
+ const NodePrototype = Node.prototype;
+ {
+ NodePrototype.__clone = function () {
+ const newNode = new Node();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+
+ if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
+ newNode[key] = this[key];
+ }
+ }
+
+ return newNode;
+ };
+ }
+
+ function clonePlaceholder(node) {
+ return cloneIdentifier(node);
+ }
+
+ function cloneIdentifier(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra,
+ name
+ } = node;
+ const cloned = Object.create(NodePrototype);
+ cloned.type = type;
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ cloned.extra = extra;
+ cloned.name = name;
+
+ if (type === "Placeholder") {
+ cloned.expectedNode = node.expectedNode;
+ }
+
+ return cloned;
+ }
+ function cloneStringLiteral(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra
+ } = node;
+
+ if (type === "Placeholder") {
+ return clonePlaceholder(node);
+ }
+
+ const cloned = Object.create(NodePrototype);
+ cloned.type = "StringLiteral";
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ cloned.extra = extra;
+ cloned.value = node.value;
+ return cloned;
+ }
+ class NodeUtils extends UtilParser {
+ startNode() {
+ return new Node(this, this.state.start, this.state.startLoc);
+ }
+
+ startNodeAt(pos, loc) {
+ return new Node(this, pos, loc);
+ }
+
+ startNodeAtNode(type) {
+ return this.startNodeAt(type.start, type.loc.start);
+ }
+
+ finishNode(node, type) {
+ return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
+ }
+
+ finishNodeAt(node, type, pos, loc) {
+
+ node.type = type;
+ node.end = pos;
+ node.loc.end = loc;
+ if (this.options.ranges) node.range[1] = pos;
+ if (this.options.attachComment) this.processComment(node);
+ return node;
+ }
+
+ resetStartLocation(node, start, startLoc) {
+ node.start = start;
+ node.loc.start = startLoc;
+ if (this.options.ranges) node.range[0] = start;
+ }
+
+ resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) {
+ node.end = end;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = end;
+ }
+
+ resetStartLocationFromNode(node, locationNode) {
+ this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
+ }
+
+ }
+
+ const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+ const FlowErrors = makeErrorTemplates({
+ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
+ AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
+ AssignReservedType: "Cannot overwrite reserved type %0.",
+ DeclareClassElement: "The `declare` modifier can only appear on class fields.",
+ DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
+ DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.",
+ EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.",
+ EnumDuplicateMemberName: "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.",
+ EnumInconsistentMemberValues: "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.",
+ EnumInvalidExplicitType: "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidExplicitTypeUnknownSupplied: "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidMemberInitializerPrimaryType: "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.",
+ EnumInvalidMemberInitializerSymbolType: "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.",
+ EnumInvalidMemberInitializerUnknownType: "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.",
+ EnumInvalidMemberName: "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.",
+ EnumNumberMemberNotInitialized: "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.",
+ EnumStringMemberInconsistentlyInitailized: "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.",
+ GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.",
+ ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",
+ InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.",
+ InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.",
+ InexactVariance: "Explicit inexact syntax cannot have variance.",
+ InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.",
+ MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
+ NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.",
+ NestedFlowComment: "Cannot have a flow comment inside another flow comment.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.",
+ SpreadVariance: "Spread properties cannot have variance.",
+ ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.",
+ ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
+ ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.",
+ ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.",
+ ThisParamNoDefault: "The `this` parameter may not have a default value.",
+ TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.",
+ UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.",
+ UnexpectedReservedType: "Unexpected reserved type %0.",
+ UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.",
+ UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
+ UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.",
+ UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".',
+ UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.",
+ UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",
+ UnsupportedDeclareExportKind: "`declare export %0` is not supported. Use `%1` instead.",
+ UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
+ UnterminatedFlowComment: "Unterminated flow-comment."
+ }, ErrorCodes.SyntaxError, "flow");
+
+ function isEsModuleType(bodyElement) {
+ return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
+ }
+
+ function hasTypeImportKind(node) {
+ return node.importKind === "type" || node.importKind === "typeof";
+ }
+
+ function isMaybeDefaultImport(state) {
+ return (state.type === 5 || tokenIsKeyword(state.type)) && state.value !== "from";
+ }
+
+ const exportSuggestions = {
+ const: "declare export var",
+ let: "declare export var",
+ type: "export type",
+ interface: "export interface"
+ };
+
+ function partition(list, test) {
+ const list1 = [];
+ const list2 = [];
+
+ for (let i = 0; i < list.length; i++) {
+ (test(list[i], i, list) ? list1 : list2).push(list[i]);
+ }
+
+ return [list1, list2];
+ }
+
+ const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
+ var flow$1 = (superClass => class extends superClass {
+ constructor(...args) {
+ super(...args);
+ this.flowPragma = undefined;
+ }
+
+ getScopeHandler() {
+ return FlowScopeHandler;
+ }
+
+ shouldParseTypes() {
+ return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
+ }
+
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
+ finishToken(type, val) {
+ if (type !== 4 && type !== 21 && type !== 34) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+
+ return super.finishToken(type, val);
+ }
+
+ addComment(comment) {
+ if (this.flowPragma === undefined) {
+ const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
+
+ if (!matches) ; else if (matches[1] === "flow") {
+ this.flowPragma = "flow";
+ } else if (matches[1] === "noflow") {
+ this.flowPragma = "noflow";
+ } else {
+ throw new Error("Unexpected flow pragma");
+ }
+ }
+
+ return super.addComment(comment);
+ }
+
+ flowParseTypeInitialiser(tok) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(tok || 22);
+ const type = this.flowParseType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParsePredicate() {
+ const node = this.startNode();
+ const moduloPos = this.state.start;
+ this.next();
+ this.expectContextual("checks");
+
+ if (this.state.lastTokStart > moduloPos + 1) {
+ this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks);
+ }
+
+ if (this.eat(18)) {
+ node.value = this.parseExpression();
+ this.expect(19);
+ return this.finishNode(node, "DeclaredPredicate");
+ } else {
+ return this.finishNode(node, "InferredPredicate");
+ }
+ }
+
+ flowParseTypeAndPredicateInitialiser() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(22);
+ let type = null;
+ let predicate = null;
+
+ if (this.match(53)) {
+ this.state.inType = oldInType;
+ predicate = this.flowParsePredicate();
+ } else {
+ type = this.flowParseType();
+ this.state.inType = oldInType;
+
+ if (this.match(53)) {
+ predicate = this.flowParsePredicate();
+ }
+ }
+
+ return [type, predicate];
+ }
+
+ flowParseDeclareClass(node) {
+ this.next();
+ this.flowParseInterfaceish(node, true);
+ return this.finishNode(node, "DeclareClass");
+ }
+
+ flowParseDeclareFunction(node) {
+ this.next();
+ const id = node.id = this.parseIdentifier();
+ const typeNode = this.startNode();
+ const typeContainer = this.startNode();
+
+ if (this.isRelational("<")) {
+ typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ typeNode.typeParameters = null;
+ }
+
+ this.expect(18);
+ const tmp = this.flowParseFunctionTypeParams();
+ typeNode.params = tmp.params;
+ typeNode.rest = tmp.rest;
+ typeNode.this = tmp._this;
+ this.expect(19);
+ [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
+ id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
+ this.resetEndLocation(id);
+ this.semicolon();
+ this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.start);
+ return this.finishNode(node, "DeclareFunction");
+ }
+
+ flowParseDeclare(node, insideModule) {
+ if (this.match(79)) {
+ return this.flowParseDeclareClass(node);
+ } else if (this.match(67)) {
+ return this.flowParseDeclareFunction(node);
+ } else if (this.match(73)) {
+ return this.flowParseDeclareVariable(node);
+ } else if (this.eatContextual("module")) {
+ if (this.match(24)) {
+ return this.flowParseDeclareModuleExports(node);
+ } else {
+ if (insideModule) {
+ this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule);
+ }
+
+ return this.flowParseDeclareModule(node);
+ }
+ } else if (this.isContextual("type")) {
+ return this.flowParseDeclareTypeAlias(node);
+ } else if (this.isContextual("opaque")) {
+ return this.flowParseDeclareOpaqueType(node);
+ } else if (this.isContextual("interface")) {
+ return this.flowParseDeclareInterface(node);
+ } else if (this.match(81)) {
+ return this.flowParseDeclareExportDeclaration(node, insideModule);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ flowParseDeclareVariable(node) {
+ this.next();
+ node.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(node.id.name, BIND_VAR, node.id.start);
+ this.semicolon();
+ return this.finishNode(node, "DeclareVariable");
+ }
+
+ flowParseDeclareModule(node) {
+ this.scope.enter(SCOPE_OTHER);
+
+ if (this.match(4)) {
+ node.id = this.parseExprAtom();
+ } else {
+ node.id = this.parseIdentifier();
+ }
+
+ const bodyNode = node.body = this.startNode();
+ const body = bodyNode.body = [];
+ this.expect(13);
+
+ while (!this.match(16)) {
+ let bodyNode = this.startNode();
+
+ if (this.match(82)) {
+ this.next();
+
+ if (!this.isContextual("type") && !this.match(86)) {
+ this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule);
+ }
+
+ this.parseImport(bodyNode);
+ } else {
+ this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule);
+ bodyNode = this.flowParseDeclare(bodyNode, true);
+ }
+
+ body.push(bodyNode);
+ }
+
+ this.scope.exit();
+ this.expect(16);
+ this.finishNode(bodyNode, "BlockStatement");
+ let kind = null;
+ let hasModuleExport = false;
+ body.forEach(bodyElement => {
+ if (isEsModuleType(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports);
+ }
+
+ if (kind === "ES") {
+ this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "CommonJS";
+ hasModuleExport = true;
+ }
+ });
+ node.kind = kind || "CommonJS";
+ return this.finishNode(node, "DeclareModule");
+ }
+
+ flowParseDeclareExportDeclaration(node, insideModule) {
+ this.expect(81);
+
+ if (this.eat(64)) {
+ if (this.match(67) || this.match(79)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ node.declaration = this.flowParseType();
+ this.semicolon();
+ }
+
+ node.default = true;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else {
+ if (this.match(74) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) {
+ const label = this.state.value;
+ const suggestion = exportSuggestions[label];
+ throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion);
+ }
+
+ if (this.match(73) || this.match(67) || this.match(79) || this.isContextual("opaque")) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ node.default = false;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else if (this.match(54) || this.match(13) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) {
+ node = this.parseExport(node);
+
+ if (node.type === "ExportNamedDeclaration") {
+ node.type = "ExportDeclaration";
+ node.default = false;
+ delete node.exportKind;
+ }
+
+ node.type = "Declare" + node.type;
+ return node;
+ }
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParseDeclareModuleExports(node) {
+ this.next();
+ this.expectContextual("exports");
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(node, "DeclareModuleExports");
+ }
+
+ flowParseDeclareTypeAlias(node) {
+ this.next();
+ this.flowParseTypeAlias(node);
+ node.type = "DeclareTypeAlias";
+ return node;
+ }
+
+ flowParseDeclareOpaqueType(node) {
+ this.next();
+ this.flowParseOpaqueType(node, true);
+ node.type = "DeclareOpaqueType";
+ return node;
+ }
+
+ flowParseDeclareInterface(node) {
+ this.next();
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "DeclareInterface");
+ }
+
+ flowParseInterfaceish(node, isClass = false) {
+ node.id = this.flowParseRestrictedIdentifier(!isClass, true);
+ this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.extends = [];
+ node.implements = [];
+ node.mixins = [];
+
+ if (this.eat(80)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (!isClass && this.eat(20));
+ }
+
+ if (this.isContextual("mixins")) {
+ this.next();
+
+ do {
+ node.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(20));
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+
+ do {
+ node.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(20));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: isClass,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: isClass,
+ allowInexact: false
+ });
+ }
+
+ flowParseInterfaceExtends() {
+ const node = this.startNode();
+ node.id = this.flowParseQualifiedTypeIdentifier();
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ return this.finishNode(node, "InterfaceExtends");
+ }
+
+ flowParseInterface(node) {
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "InterfaceDeclaration");
+ }
+
+ checkNotUnderscore(word) {
+ if (word === "_") {
+ this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore);
+ }
+ }
+
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes.has(word)) return;
+ this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word);
+ }
+
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.start, declaration);
+ return this.parseIdentifier(liberal);
+ }
+
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.right = this.flowParseTypeInitialiser(35);
+ this.semicolon();
+ return this.finishNode(node, "TypeAlias");
+ }
+
+ flowParseOpaqueType(node, declare) {
+ this.expectContextual("type");
+ node.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.supertype = null;
+
+ if (this.match(22)) {
+ node.supertype = this.flowParseTypeInitialiser(22);
+ }
+
+ node.impltype = null;
+
+ if (!declare) {
+ node.impltype = this.flowParseTypeInitialiser(35);
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "OpaqueType");
+ }
+
+ flowParseTypeParameter(requireDefault = false) {
+ const nodeStart = this.state.start;
+ const node = this.startNode();
+ const variance = this.flowParseVariance();
+ const ident = this.flowParseTypeAnnotatableIdentifier();
+ node.name = ident.name;
+ node.variance = variance;
+ node.bound = ident.typeAnnotation;
+
+ if (this.match(35)) {
+ this.eat(35);
+ node.default = this.flowParseType();
+ } else {
+ if (requireDefault) {
+ this.raise(nodeStart, FlowErrors.MissingTypeParamDefault);
+ }
+ }
+
+ return this.finishNode(node, "TypeParameter");
+ }
+
+ flowParseTypeParameterDeclaration() {
+ const oldInType = this.state.inType;
+ const node = this.startNode();
+ node.params = [];
+ this.state.inType = true;
+
+ if (this.isRelational("<") || this.match(94)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ let defaultRequired = false;
+
+ do {
+ const typeParameter = this.flowParseTypeParameter(defaultRequired);
+ node.params.push(typeParameter);
+
+ if (typeParameter.default) {
+ defaultRequired = true;
+ }
+
+ if (!this.isRelational(">")) {
+ this.expect(20);
+ }
+ } while (!this.isRelational(">"));
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterDeclaration");
+ }
+
+ flowParseTypeParameterInstantiation() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseType());
+
+ if (!this.isRelational(">")) {
+ this.expect(20);
+ }
+ }
+
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseTypeOrImplicitInstantiation());
+
+ if (!this.isRelational(">")) {
+ this.expect(20);
+ }
+ }
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseInterfaceType() {
+ const node = this.startNode();
+ this.expectContextual("interface");
+ node.extends = [];
+
+ if (this.eat(80)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(20));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false
+ });
+ return this.finishNode(node, "InterfaceTypeAnnotation");
+ }
+
+ flowParseObjectPropertyKey() {
+ return this.match(0) || this.match(4) ? this.parseExprAtom() : this.parseIdentifier(true);
+ }
+
+ flowParseObjectTypeIndexer(node, isStatic, variance) {
+ node.static = isStatic;
+
+ if (this.lookahead().type === 22) {
+ node.id = this.flowParseObjectPropertyKey();
+ node.key = this.flowParseTypeInitialiser();
+ } else {
+ node.id = null;
+ node.key = this.flowParseType();
+ }
+
+ this.expect(11);
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ return this.finishNode(node, "ObjectTypeIndexer");
+ }
+
+ flowParseObjectTypeInternalSlot(node, isStatic) {
+ node.static = isStatic;
+ node.id = this.flowParseObjectPropertyKey();
+ this.expect(11);
+ this.expect(11);
+
+ if (this.isRelational("<") || this.match(18)) {
+ node.method = true;
+ node.optional = false;
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+ } else {
+ node.method = false;
+
+ if (this.eat(25)) {
+ node.optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ }
+
+ return this.finishNode(node, "ObjectTypeInternalSlot");
+ }
+
+ flowParseObjectTypeMethodish(node) {
+ node.params = [];
+ node.rest = null;
+ node.typeParameters = null;
+ node.this = null;
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ this.expect(18);
+
+ if (this.match(77)) {
+ node.this = this.flowParseFunctionTypeParam(true);
+ node.this.name = null;
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ while (!this.match(19) && !this.match(29)) {
+ node.params.push(this.flowParseFunctionTypeParam(false));
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ if (this.eat(29)) {
+ node.rest = this.flowParseFunctionTypeParam(false);
+ }
+
+ this.expect(19);
+ node.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ flowParseObjectTypeCallProperty(node, isStatic) {
+ const valueNode = this.startNode();
+ node.static = isStatic;
+ node.value = this.flowParseObjectTypeMethodish(valueNode);
+ return this.finishNode(node, "ObjectTypeCallProperty");
+ }
+
+ flowParseObjectType({
+ allowStatic,
+ allowExact,
+ allowSpread,
+ allowProto,
+ allowInexact
+ }) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const nodeStart = this.startNode();
+ nodeStart.callProperties = [];
+ nodeStart.properties = [];
+ nodeStart.indexers = [];
+ nodeStart.internalSlots = [];
+ let endDelim;
+ let exact;
+ let inexact = false;
+
+ if (allowExact && this.match(14)) {
+ this.expect(14);
+ endDelim = 17;
+ exact = true;
+ } else {
+ this.expect(13);
+ endDelim = 16;
+ exact = false;
+ }
+
+ nodeStart.exact = exact;
+
+ while (!this.match(endDelim)) {
+ let isStatic = false;
+ let protoStart = null;
+ let inexactStart = null;
+ const node = this.startNode();
+
+ if (allowProto && this.isContextual("proto")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== 22 && lookahead.type !== 25) {
+ this.next();
+ protoStart = this.state.start;
+ allowStatic = false;
+ }
+ }
+
+ if (allowStatic && this.isContextual("static")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== 22 && lookahead.type !== 25) {
+ this.next();
+ isStatic = true;
+ }
+ }
+
+ const variance = this.flowParseVariance();
+
+ if (this.eat(8)) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (this.eat(8)) {
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
+ } else {
+ nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
+ }
+ } else if (this.match(18) || this.isRelational("<")) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
+ } else {
+ let kind = "init";
+
+ if (this.isContextual("get") || this.isContextual("set")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type === 5 || lookahead.type === 4 || lookahead.type === 0) {
+ kind = this.state.value;
+ this.next();
+ }
+ }
+
+ const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
+
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStart = this.state.lastTokStart;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+
+ this.flowObjectTypeSemicolon();
+
+ if (inexactStart && !this.match(16) && !this.match(17)) {
+ this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject);
+ }
+ }
+
+ this.expect(endDelim);
+
+ if (allowSpread) {
+ nodeStart.inexact = inexact;
+ }
+
+ const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
+ this.state.inType = oldInType;
+ return out;
+ }
+
+ flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) {
+ if (this.eat(29)) {
+ const isInexactToken = this.match(20) || this.match(21) || this.match(16) || this.match(17);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject);
+ } else if (!allowInexact) {
+ this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors.InexactVariance);
+ }
+
+ return null;
+ }
+
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType);
+ }
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors.SpreadVariance);
+ }
+
+ node.argument = this.flowParseType();
+ return this.finishNode(node, "ObjectTypeSpreadProperty");
+ } else {
+ node.key = this.flowParseObjectPropertyKey();
+ node.static = isStatic;
+ node.proto = protoStart != null;
+ node.kind = kind;
+ let optional = false;
+
+ if (this.isRelational("<") || this.match(18)) {
+ node.method = true;
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+
+ if (kind === "get" || kind === "set") {
+ this.flowCheckGetterSetterParams(node);
+ }
+
+ if (!allowSpread && node.key.name === "constructor" && node.value.this) {
+ this.raise(node.value.this.start, FlowErrors.ThisParamBannedInConstructor);
+ }
+ } else {
+ if (kind !== "init") this.unexpected();
+ node.method = false;
+
+ if (this.eat(25)) {
+ optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ }
+
+ node.optional = optional;
+ return this.finishNode(node, "ObjectTypeProperty");
+ }
+ }
+
+ flowCheckGetterSetterParams(property) {
+ const paramCount = property.kind === "get" ? 0 : 1;
+ const start = property.start;
+ const length = property.value.params.length + (property.value.rest ? 1 : 0);
+
+ if (property.value.this) {
+ this.raise(property.value.this.start, property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam);
+ }
+
+ if (length !== paramCount) {
+ if (property.kind === "get") {
+ this.raise(start, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ }
+
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ flowObjectTypeSemicolon() {
+ if (!this.eat(21) && !this.eat(20) && !this.match(16) && !this.match(17)) {
+ this.unexpected();
+ }
+ }
+
+ flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ let node = id || this.flowParseRestrictedIdentifier(true);
+
+ while (this.eat(24)) {
+ const node2 = this.startNodeAt(startPos, startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ node = this.finishNode(node2, "QualifiedTypeIdentifier");
+ }
+
+ return node;
+ }
+
+ flowParseGenericType(startPos, startLoc, id) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = null;
+ node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ return this.finishNode(node, "GenericTypeAnnotation");
+ }
+
+ flowParseTypeofType() {
+ const node = this.startNode();
+ this.expect(86);
+ node.argument = this.flowParsePrimaryType();
+ return this.finishNode(node, "TypeofTypeAnnotation");
+ }
+
+ flowParseTupleType() {
+ const node = this.startNode();
+ node.types = [];
+ this.expect(8);
+
+ while (this.state.pos < this.length && !this.match(11)) {
+ node.types.push(this.flowParseType());
+ if (this.match(11)) break;
+ this.expect(20);
+ }
+
+ this.expect(11);
+ return this.finishNode(node, "TupleTypeAnnotation");
+ }
+
+ flowParseFunctionTypeParam(first) {
+ let name = null;
+ let optional = false;
+ let typeAnnotation = null;
+ const node = this.startNode();
+ const lh = this.lookahead();
+ const isThis = this.state.type === 77;
+
+ if (lh.type === 22 || lh.type === 25) {
+ if (isThis && !first) {
+ this.raise(node.start, FlowErrors.ThisParamMustBeFirst);
+ }
+
+ name = this.parseIdentifier(isThis);
+
+ if (this.eat(25)) {
+ optional = true;
+
+ if (isThis) {
+ this.raise(node.start, FlowErrors.ThisParamMayNotBeOptional);
+ }
+ }
+
+ typeAnnotation = this.flowParseTypeInitialiser();
+ } else {
+ typeAnnotation = this.flowParseType();
+ }
+
+ node.name = name;
+ node.optional = optional;
+ node.typeAnnotation = typeAnnotation;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ reinterpretTypeAsFunctionTypeParam(type) {
+ const node = this.startNodeAt(type.start, type.loc.start);
+ node.name = null;
+ node.optional = false;
+ node.typeAnnotation = type;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ flowParseFunctionTypeParams(params = []) {
+ let rest = null;
+ let _this = null;
+
+ if (this.match(77)) {
+ _this = this.flowParseFunctionTypeParam(true);
+ _this.name = null;
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ while (!this.match(19) && !this.match(29)) {
+ params.push(this.flowParseFunctionTypeParam(false));
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ if (this.eat(29)) {
+ rest = this.flowParseFunctionTypeParam(false);
+ }
+
+ return {
+ params,
+ rest,
+ _this
+ };
+ }
+
+ flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
+ switch (id.name) {
+ case "any":
+ return this.finishNode(node, "AnyTypeAnnotation");
+
+ case "bool":
+ case "boolean":
+ return this.finishNode(node, "BooleanTypeAnnotation");
+
+ case "mixed":
+ return this.finishNode(node, "MixedTypeAnnotation");
+
+ case "empty":
+ return this.finishNode(node, "EmptyTypeAnnotation");
+
+ case "number":
+ return this.finishNode(node, "NumberTypeAnnotation");
+
+ case "string":
+ return this.finishNode(node, "StringTypeAnnotation");
+
+ case "symbol":
+ return this.finishNode(node, "SymbolTypeAnnotation");
+
+ default:
+ this.checkNotUnderscore(id.name);
+ return this.flowParseGenericType(startPos, startLoc, id);
+ }
+ }
+
+ flowParsePrimaryType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.startNode();
+ let tmp;
+ let type;
+ let isGroupedType = false;
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+
+ switch (this.state.type) {
+ case 5:
+ if (this.isContextual("interface")) {
+ return this.flowParseInterfaceType();
+ }
+
+ return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
+
+ case 13:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true
+ });
+
+ case 14:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false
+ });
+
+ case 8:
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseTupleType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ return type;
+
+ case 50:
+ if (this.state.value === "<") {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(18);
+ tmp = this.flowParseFunctionTypeParams();
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(19);
+ this.expect(27);
+ node.returnType = this.flowParseType();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ break;
+
+ case 18:
+ this.next();
+
+ if (!this.match(19) && !this.match(29)) {
+ if (this.match(5) || this.match(77)) {
+ const token = this.lookahead().type;
+ isGroupedType = token !== 25 && token !== 22;
+ } else {
+ isGroupedType = true;
+ }
+ }
+
+ if (isGroupedType) {
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+
+ if (this.state.noAnonFunctionType || !(this.match(20) || this.match(19) && this.lookahead().type === 27)) {
+ this.expect(19);
+ return type;
+ } else {
+ this.eat(20);
+ }
+ }
+
+ if (type) {
+ tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
+ } else {
+ tmp = this.flowParseFunctionTypeParams();
+ }
+
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(19);
+ this.expect(27);
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+
+ case 4:
+ return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
+
+ case 84:
+ case 85:
+ node.value = this.match(84);
+ this.next();
+ return this.finishNode(node, "BooleanLiteralTypeAnnotation");
+
+ case 52:
+ if (this.state.value === "-") {
+ this.next();
+
+ if (this.match(0)) {
+ return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
+ }
+
+ if (this.match(1)) {
+ return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
+ }
+
+ throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand);
+ }
+
+ throw this.unexpected();
+
+ case 0:
+ return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
+
+ case 1:
+ return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
+
+ case 87:
+ this.next();
+ return this.finishNode(node, "VoidTypeAnnotation");
+
+ case 83:
+ this.next();
+ return this.finishNode(node, "NullLiteralTypeAnnotation");
+
+ case 77:
+ this.next();
+ return this.finishNode(node, "ThisTypeAnnotation");
+
+ case 54:
+ this.next();
+ return this.finishNode(node, "ExistsTypeAnnotation");
+
+ case 86:
+ return this.flowParseTypeofType();
+
+ default:
+ if (tokenIsKeyword(this.state.type)) {
+ const label = tokenLabelName(this.state.type);
+ this.next();
+ return super.createIdentifier(node, label);
+ }
+
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParsePostfixType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let type = this.flowParsePrimaryType();
+ let seenOptionalIndexedAccess = false;
+
+ while ((this.match(8) || this.match(26)) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const optional = this.eat(26);
+ seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;
+ this.expect(8);
+
+ if (!optional && this.match(11)) {
+ node.elementType = type;
+ this.next();
+ type = this.finishNode(node, "ArrayTypeAnnotation");
+ } else {
+ node.objectType = type;
+ node.indexType = this.flowParseType();
+ this.expect(11);
+
+ if (seenOptionalIndexedAccess) {
+ node.optional = optional;
+ type = this.finishNode(node, "OptionalIndexedAccessType");
+ } else {
+ type = this.finishNode(node, "IndexedAccessType");
+ }
+ }
+ }
+
+ return type;
+ }
+
+ flowParsePrefixType() {
+ const node = this.startNode();
+
+ if (this.eat(25)) {
+ node.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(node, "NullableTypeAnnotation");
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+
+ flowParseAnonFunctionWithoutParens() {
+ const param = this.flowParsePrefixType();
+
+ if (!this.state.noAnonFunctionType && this.eat(27)) {
+ const node = this.startNodeAt(param.start, param.loc.start);
+ node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
+ node.rest = null;
+ node.this = null;
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ return param;
+ }
+
+ flowParseIntersectionType() {
+ const node = this.startNode();
+ this.eat(48);
+ const type = this.flowParseAnonFunctionWithoutParens();
+ node.types = [type];
+
+ while (this.eat(48)) {
+ node.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
+ }
+
+ flowParseUnionType() {
+ const node = this.startNode();
+ this.eat(46);
+ const type = this.flowParseIntersectionType();
+ node.types = [type];
+
+ while (this.eat(46)) {
+ node.types.push(this.flowParseIntersectionType());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
+ }
+
+ flowParseType() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const type = this.flowParseUnionType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === 5 && this.state.value === "_") {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.parseIdentifier();
+ return this.flowParseGenericType(startPos, startLoc, node);
+ } else {
+ return this.flowParseType();
+ }
+ }
+
+ flowParseTypeAnnotation() {
+ const node = this.startNode();
+ node.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "TypeAnnotation");
+ }
+
+ flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
+ const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
+
+ if (this.match(22)) {
+ ident.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(ident);
+ }
+
+ return ident;
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ flowParseVariance() {
+ let variance = null;
+
+ if (this.match(52)) {
+ variance = this.startNode();
+
+ if (this.state.value === "+") {
+ variance.kind = "plus";
+ } else {
+ variance.kind = "minus";
+ }
+
+ this.next();
+ this.finishNode(variance, "Variance");
+ }
+
+ return variance;
+ }
+
+ parseFunctionBody(node, allowExpressionBody, isMethod = false) {
+ if (allowExpressionBody) {
+ return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
+ }
+
+ return super.parseFunctionBody(node, false, isMethod);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(22)) {
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.state.strict && this.match(5) && this.state.value === "interface") {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type === 5 || isKeyword(lookahead.value)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseInterface(node);
+ }
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ const stmt = super.parseStatement(context, topLevel);
+
+ if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
+ this.flowPragma = null;
+ }
+
+ return stmt;
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type === "Identifier") {
+ if (expr.name === "declare") {
+ if (this.match(79) || this.match(5) || this.match(67) || this.match(73) || this.match(81)) {
+ return this.flowParseDeclare(node);
+ }
+ } else if (this.match(5)) {
+ if (expr.name === "interface") {
+ return this.flowParseInterface(node);
+ } else if (expr.name === "type") {
+ return this.flowParseTypeAlias(node);
+ } else if (expr.name === "opaque") {
+ return this.flowParseOpaqueType(node, false);
+ }
+ }
+ }
+
+ return super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration();
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(5) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) {
+ return false;
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (!this.match(25)) return expr;
+
+ if (this.state.maybeInArrowParameters) {
+ const nextCh = this.lookaheadCharCode();
+
+ if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
+ this.setOptionalParametersError(refExpressionErrors);
+ return expr;
+ }
+ }
+
+ this.expect(25);
+ const state = this.state.clone();
+ const originalNoArrowAt = this.state.noArrowAt;
+ const node = this.startNodeAt(startPos, startLoc);
+ let {
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent();
+ let [valid, invalid] = this.getArrowLikeExpressions(consequent);
+
+ if (failed || invalid.length > 0) {
+ const noArrowAt = [...originalNoArrowAt];
+
+ if (invalid.length > 0) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt;
+
+ for (let i = 0; i < invalid.length; i++) {
+ noArrowAt.push(invalid[i].start);
+ }
+
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ }
+
+ if (failed && valid.length > 1) {
+ this.raise(state.start, FlowErrors.AmbiguousConditionalArrow);
+ }
+
+ if (failed && valid.length === 1) {
+ this.state = state;
+ noArrowAt.push(valid[0].start);
+ this.state.noArrowAt = noArrowAt;
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ }
+ }
+
+ this.getArrowLikeExpressions(consequent, true);
+ this.state.noArrowAt = originalNoArrowAt;
+ this.expect(22);
+ node.test = expr;
+ node.consequent = consequent;
+ node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined));
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const consequent = this.parseMaybeAssignAllowIn();
+ const failed = !this.match(22);
+ this.state.noArrowParamsConversionAt.pop();
+ return {
+ consequent,
+ failed
+ };
+ }
+
+ getArrowLikeExpressions(node, disallowInvalid) {
+ const stack = [node];
+ const arrows = [];
+
+ while (stack.length !== 0) {
+ const node = stack.pop();
+
+ if (node.type === "ArrowFunctionExpression") {
+ if (node.typeParameters || !node.returnType) {
+ this.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+
+ return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+
+ finishArrowValidation(node) {
+ var _node$extra;
+
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma, false);
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+
+ forwardNoArrowParamsConversionAt(node, parse) {
+ let result;
+
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ result = parse();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ result = parse();
+ }
+
+ return result;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(25)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(22)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TypeCastExpression");
+ }
+
+ return node;
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
+ return;
+ }
+
+ super.assertModuleNodeAllowed(node);
+ }
+
+ parseExport(node) {
+ const decl = super.parseExport(node);
+
+ if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") {
+ decl.exportKind = decl.exportKind || "value";
+ }
+
+ return decl;
+ }
+
+ parseExportDeclaration(node) {
+ if (this.isContextual("type")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+
+ if (this.match(13)) {
+ node.specifiers = this.parseExportSpecifiers();
+ this.parseExportFrom(node);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(declarationNode);
+ }
+ } else if (this.isContextual("opaque")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(declarationNode, false);
+ } else if (this.isContextual("interface")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
+ } else {
+ return super.parseExportDeclaration(node);
+ }
+ }
+
+ eatExportStar(node) {
+ if (super.eatExportStar(...arguments)) return true;
+
+ if (this.isContextual("type") && this.lookahead().type === 54) {
+ node.exportKind = "type";
+ this.next();
+ this.next();
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ const pos = this.state.start;
+ const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
+
+ if (hasNamespace && node.exportKind === "type") {
+ this.unexpected(pos);
+ }
+
+ return hasNamespace;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ super.parseClassId(node, isStatement, optionalId);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+
+ parseClassMember(classBody, member, state) {
+ const pos = this.state.start;
+
+ if (this.isContextual("declare")) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ member.declare = true;
+ }
+
+ super.parseClassMember(classBody, member, state);
+
+ if (member.declare) {
+ if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
+ this.raise(pos, FlowErrors.DeclareClassElement);
+ } else if (member.value) {
+ this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer);
+ }
+ }
+ }
+
+ isIterator(word) {
+ return word === "iterator" || word === "asyncIterator";
+ }
+
+ readIterator() {
+ const word = super.readWord1();
+ const fullWord = "@@" + word;
+
+ if (!this.isIterator(word) || !this.state.inType) {
+ this.raise(this.state.pos, ErrorMessages.InvalidIdentifier, fullWord);
+ }
+
+ this.finishToken(5, fullWord);
+ }
+
+ getTokenFromCode(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 123 && next === 124) {
+ return this.finishOp(14, 2);
+ } else if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(50, 1);
+ } else if (this.state.inType && code === 63) {
+ if (next === 46) {
+ return this.finishOp(26, 2);
+ }
+
+ return this.finishOp(25, 1);
+ } else if (isIteratorStart(code, next)) {
+ this.state.pos += 2;
+ return this.readIterator();
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ if (node.type === "TypeCastExpression") {
+ return this.isAssignable(node.expression, isBinding);
+ } else {
+ return super.isAssignable(node, isBinding);
+ }
+ }
+
+ toAssignable(node, isLHS = false) {
+ if (node.type === "TypeCastExpression") {
+ return super.toAssignable(this.typeCastToParameter(node), isLHS);
+ } else {
+ return super.toAssignable(node, isLHS);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos, isLHS) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ return super.toAssignableList(exprList, trailingCommaPos, isLHS);
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ var _expr$extra;
+
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern);
+ }
+ }
+
+ return exprList;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
+
+ if (canBePattern && !this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+
+ return node;
+ }
+
+ checkLVal(expr, ...args) {
+ if (expr.type !== "TypeCastExpression") {
+ return super.checkLVal(expr, ...args);
+ }
+ }
+
+ parseClassProperty(node) {
+ if (this.match(22)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (this.match(22)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassPrivateProperty(node);
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(22) || super.isClassProperty();
+ }
+
+ isNonstaticConstructor(method) {
+ return !this.match(22) && super.isNonstaticConstructor(method);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+
+ if (method.params && isConstructor) {
+ const params = method.params;
+
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(method.start, FlowErrors.ThisParamBannedInConstructor);
+ }
+ } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
+ const params = method.value.params;
+
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(method.start, FlowErrors.ThisParamBannedInConstructor);
+ }
+ }
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+ const implemented = node.implements = [];
+
+ do {
+ const node = this.startNode();
+ node.id = this.flowParseRestrictedIdentifier(true);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ implemented.push(this.finishNode(node, "ClassImplements"));
+ } while (this.eat(20));
+ }
+ }
+
+ checkGetterSetterParams(method) {
+ super.checkGetterSetterParams(method);
+ const params = this.getObjectOrClassMethodParams(method);
+
+ if (params.length > 0) {
+ const param = params[0];
+
+ if (this.isThisParam(param) && method.kind === "get") {
+ this.raise(param.start, FlowErrors.GetterMayNotHaveThisParam);
+ } else if (this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.SetterMayNotHaveThisParam);
+ }
+ }
+ }
+
+ parsePropertyName(node, isPrivateNameAllowed) {
+ const variance = this.flowParseVariance();
+ const key = super.parsePropertyName(node, isPrivateNameAllowed);
+ node.variance = variance;
+ return key;
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ if (prop.variance) {
+ this.unexpected(prop.variance.start);
+ }
+
+ delete prop.variance;
+ let typeParameters;
+
+ if (this.isRelational("<") && !isAccessor) {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ if (!this.match(18)) this.unexpected();
+ }
+
+ super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+
+ if (typeParameters) {
+ (prop.value || prop).typeParameters = typeParameters;
+ }
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(25)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, FlowErrors.PatternIsOptional);
+ }
+
+ if (this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.ThisParamMayNotBeOptional);
+ }
+
+ param.optional = true;
+ }
+
+ if (this.match(22)) {
+ param.typeAnnotation = this.flowParseTypeAnnotation();
+ } else if (this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.ThisParamAnnotationRequired);
+ }
+
+ if (this.match(35) && this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.ThisParamNoDefault);
+ }
+
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ const node = super.parseMaybeDefault(startPos, startLoc, left);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer);
+ }
+
+ return node;
+ }
+
+ shouldParseDefaultImport(node) {
+ if (!hasTypeImportKind(node)) {
+ return super.shouldParseDefaultImport(node);
+ }
+
+ return isMaybeDefaultImport(this.state);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
+ this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ node.importKind = "value";
+ let kind = null;
+
+ if (this.match(86)) {
+ kind = "typeof";
+ } else if (this.isContextual("type")) {
+ kind = "type";
+ }
+
+ if (kind) {
+ const lh = this.lookahead();
+
+ if (kind === "type" && lh.type === 54) {
+ this.unexpected(lh.start);
+ }
+
+ if (isMaybeDefaultImport(lh) || lh.type === 13 || lh.type === 54) {
+ this.next();
+ node.importKind = kind;
+ }
+ }
+
+ return super.maybeParseDefaultImportSpecifier(node);
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ const firstIdentIsString = this.match(4);
+ const firstIdent = this.parseModuleExportName();
+ let specifierTypeKind = null;
+
+ if (firstIdent.type === "Identifier") {
+ if (firstIdent.name === "type") {
+ specifierTypeKind = "type";
+ } else if (firstIdent.name === "typeof") {
+ specifierTypeKind = "typeof";
+ }
+ }
+
+ let isBinding = false;
+
+ if (this.isContextual("as") && !this.isLookaheadContextual("as")) {
+ const as_ident = this.parseIdentifier(true);
+
+ if (specifierTypeKind !== null && !this.match(5) && !tokenIsKeyword(this.state.type)) {
+ specifier.imported = as_ident;
+ specifier.importKind = specifierTypeKind;
+ specifier.local = cloneIdentifier(as_ident);
+ } else {
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = this.parseIdentifier();
+ }
+ } else {
+ if (specifierTypeKind !== null && (this.match(5) || tokenIsKeyword(this.state.type))) {
+ specifier.imported = this.parseIdentifier(true);
+ specifier.importKind = specifierTypeKind;
+ } else {
+ if (firstIdentIsString) {
+ throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, firstIdent.value);
+ }
+
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ }
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ isBinding = true;
+ specifier.local = cloneIdentifier(specifier.imported);
+ }
+ }
+
+ const nodeIsTypeImport = hasTypeImportKind(node);
+ const specifierIsTypeImport = hasTypeImportKind(specifier);
+
+ if (nodeIsTypeImport && specifierIsTypeImport) {
+ this.raise(specifier.start, FlowErrors.ImportTypeShorthandOnlyInPureImport);
+ }
+
+ if (nodeIsTypeImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.start, true);
+ }
+
+ if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {
+ this.checkReservedWord(specifier.local.name, specifier.start, true, true);
+ }
+
+ this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 77:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const kind = node.kind;
+
+ if (kind !== "get" && kind !== "set" && this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (this.match(22)) {
+ decl.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(22)) {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ node.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(22) || super.shouldParseAsyncArrow();
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ var _jsx;
+
+ let state = null;
+ let jsx;
+
+ if (this.hasPlugin("jsx") && (this.match(94) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+ const curContext = context[context.length - 1];
+
+ if (curContext === types$1.j_oTag) {
+ context.length -= 2;
+ } else if (curContext === types$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if ((_jsx = jsx) != null && _jsx.error || this.isRelational("<")) {
+ var _jsx2, _jsx3;
+
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(abort => {
+ var _arrowExpression$extr;
+
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {
+ const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ this.resetStartLocationFromNode(result, typeParameters);
+ return result;
+ });
+ if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();
+ const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);
+ if (expr.type !== "ArrowFunctionExpression") abort();
+ expr.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(expr, typeParameters);
+ return arrowExpression;
+ }, state);
+ let arrowExpression = null;
+
+ if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
+ if (!arrow.error && !arrow.aborted) {
+ if (arrow.node.async) {
+ this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction);
+ }
+
+ return arrow.node;
+ }
+
+ arrowExpression = arrow.node;
+ }
+
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter);
+ }
+
+ return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ }
+
+ parseArrow(node) {
+ if (this.match(22)) {
+ const result = this.tryParse(() => {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(27)) this.unexpected();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+
+ return super.parseArrow(node);
+ }
+
+ shouldParseArrow(params) {
+ return this.match(22) || super.shouldParseArrow(params);
+ }
+
+ setArrowFunctionParameters(node, params) {
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ node.params = params;
+ } else {
+ super.setArrowFunctionParameters(node, params);
+ }
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction) {
+ if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ return;
+ }
+
+ for (let i = 0; i < node.params.length; i++) {
+ if (this.isThisParam(node.params[i]) && i > 0) {
+ this.raise(node.params[i].start, FlowErrors.ThisParamMustBeFirst);
+ }
+ }
+
+ return super.checkParams(...arguments);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ base = this.finishNode(node, "CallExpression");
+ } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) {
+ const state = this.state.clone();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+
+ throw arrow.error || result.error;
+ }
+
+ return super.parseSubscripts(base, startPos, startLoc, noCalls);
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
+ if (this.match(26) && this.isLookaheadToken_lt()) {
+ subscriptState.optionalChainMember = true;
+
+ if (noCalls) {
+ subscriptState.stop = true;
+ return base;
+ }
+
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(18);
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ node.optional = true;
+ return this.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(18);
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ if (subscriptState.optionalChainMember) node.optional = false;
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);
+ }
+
+ parseNewArguments(node) {
+ let targs = null;
+
+ if (this.shouldParseTypes() && this.isRelational("<")) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+
+ node.typeArguments = targs;
+ super.parseNewArguments(node);
+ }
+
+ parseAsyncArrowWithTypeParameters(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.parseFunctionParams(node);
+ if (!this.parseArrow(node)) return;
+ return this.parseArrowExpression(node, undefined, true);
+ }
+
+ readToken_mult_modulo(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+
+ super.readToken_mult_modulo(code);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 124 && next === 125) {
+ this.finishOp(17, 2);
+ return;
+ }
+
+ super.readToken_pipe_amp(code);
+ }
+
+ parseTopLevel(file, program) {
+ const fileNode = super.parseTopLevel(file, program);
+
+ if (this.state.hasFlowComment) {
+ this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment);
+ }
+
+ return fileNode;
+ }
+
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ this.unexpected(null, FlowErrors.NestedFlowComment);
+ }
+
+ this.hasFlowCommentCompletion();
+ this.state.pos += this.skipFlowComment();
+ this.state.hasFlowComment = true;
+ return;
+ }
+
+ if (this.state.hasFlowComment) {
+ const end = this.input.indexOf("*-/", this.state.pos += 2);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment);
+ }
+
+ this.state.pos = end + 3;
+ return;
+ }
+
+ return super.skipBlockComment();
+ }
+
+ skipFlowComment() {
+ const {
+ pos
+ } = this.state;
+ let shiftToFirstNonWhiteSpace = 2;
+
+ while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
+ shiftToFirstNonWhiteSpace++;
+ }
+
+ const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
+ const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
+
+ if (ch2 === 58 && ch3 === 58) {
+ return shiftToFirstNonWhiteSpace + 2;
+ }
+
+ if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
+ return shiftToFirstNonWhiteSpace + 12;
+ }
+
+ if (ch2 === 58 && ch3 !== 58) {
+ return shiftToFirstNonWhiteSpace;
+ }
+
+ return false;
+ }
+
+ hasFlowCommentCompletion() {
+ const end = this.input.indexOf("*/", this.state.pos);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment);
+ }
+ }
+
+ flowEnumErrorBooleanMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName);
+ }
+
+ flowEnumErrorInvalidMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ const suggestion = memberName[0].toUpperCase() + memberName.slice(1);
+ this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName);
+ }
+
+ flowEnumErrorDuplicateMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);
+ }
+
+ flowEnumErrorInconsistentMemberValues(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);
+ }
+
+ flowEnumErrorInvalidExplicitType(pos, {
+ enumName,
+ suppliedType
+ }) {
+ return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType);
+ }
+
+ flowEnumErrorInvalidMemberInitializer(pos, {
+ enumName,
+ explicitType,
+ memberName
+ }) {
+ let message = null;
+
+ switch (explicitType) {
+ case "boolean":
+ case "number":
+ case "string":
+ message = FlowErrors.EnumInvalidMemberInitializerPrimaryType;
+ break;
+
+ case "symbol":
+ message = FlowErrors.EnumInvalidMemberInitializerSymbolType;
+ break;
+
+ default:
+ message = FlowErrors.EnumInvalidMemberInitializerUnknownType;
+ }
+
+ return this.raise(pos, message, enumName, memberName, explicitType);
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName);
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName);
+ }
+
+ flowEnumMemberInit() {
+ const startPos = this.state.start;
+
+ const endOfInit = () => this.match(20) || this.match(16);
+
+ switch (this.state.type) {
+ case 0:
+ {
+ const literal = this.parseNumericLiteral(this.state.value);
+
+ if (endOfInit()) {
+ return {
+ type: "number",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case 4:
+ {
+ const literal = this.parseStringLiteral(this.state.value);
+
+ if (endOfInit()) {
+ return {
+ type: "string",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case 84:
+ case 85:
+ {
+ const literal = this.parseBooleanLiteral(this.match(84));
+
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ default:
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+ }
+
+ flowEnumMemberRaw() {
+ const pos = this.state.start;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(35) ? this.flowEnumMemberInit() : {
+ type: "none",
+ pos
+ };
+ return {
+ id,
+ init
+ };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+
+ if (explicitType === null) {
+ return;
+ }
+
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(pos, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+ let hasUnknownMembers = false;
+
+ while (!this.match(16)) {
+ if (this.eat(29)) {
+ hasUnknownMembers = true;
+ break;
+ }
+
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+
+ if (memberName === "") {
+ continue;
+ }
+
+ if (/^[a-z]/.test(memberName)) {
+ this.flowEnumErrorInvalidMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ if (seenNames.has(memberName)) {
+ this.flowEnumErrorDuplicateMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
+ }
+
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);
+ break;
+
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
+ break;
+
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+
+ if (!this.match(16)) {
+ this.expect(20);
+ }
+ }
+
+ return {
+ members,
+ hasUnknownMembers
+ };
+ }
+
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (const member of initializedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return defaultedMembers;
+ } else {
+ for (const member of defaultedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return initializedMembers;
+ }
+ }
+
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (this.eatContextual("of")) {
+ if (!this.match(5)) {
+ throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: null
+ });
+ }
+
+ const {
+ value
+ } = this.state;
+ this.next();
+
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: value
+ });
+ }
+
+ return value;
+ }
+
+ return null;
+ }
+
+ flowEnumBody(node, {
+ enumName,
+ nameLoc
+ }) {
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(13);
+ const {
+ members,
+ hasUnknownMembers
+ } = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+ node.hasUnknownMembers = hasUnknownMembers;
+
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumBooleanBody");
+
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumNumberBody");
+
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(16);
+ return this.finishNode(node, "EnumStringBody");
+
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumSymbolBody");
+
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(16);
+ return this.finishNode(node, "EnumStringBody");
+ };
+
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(16);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.booleanMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorNumberMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.numberMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.flowEnumErrorInconsistentMemberValues(nameLoc, {
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), {
+ enumName: id.name,
+ nameLoc: id.start
+ });
+ return this.finishNode(node, "EnumDeclaration");
+ }
+
+ isLookaheadToken_lt() {
+ const next = this.nextTokenStart();
+
+ if (this.input.charCodeAt(next) === 60) {
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== 60 && afterNext !== 61;
+ }
+
+ return false;
+ }
+
+ maybeUnwrapTypeCastExpression(node) {
+ return node.type === "TypeCastExpression" ? node.expression : node;
+ }
+
+ });
+
+ const entities = {
+ quot: "\u0022",
+ amp: "&",
+ apos: "\u0027",
+ lt: "<",
+ gt: ">",
+ nbsp: "\u00A0",
+ iexcl: "\u00A1",
+ cent: "\u00A2",
+ pound: "\u00A3",
+ curren: "\u00A4",
+ yen: "\u00A5",
+ brvbar: "\u00A6",
+ sect: "\u00A7",
+ uml: "\u00A8",
+ copy: "\u00A9",
+ ordf: "\u00AA",
+ laquo: "\u00AB",
+ not: "\u00AC",
+ shy: "\u00AD",
+ reg: "\u00AE",
+ macr: "\u00AF",
+ deg: "\u00B0",
+ plusmn: "\u00B1",
+ sup2: "\u00B2",
+ sup3: "\u00B3",
+ acute: "\u00B4",
+ micro: "\u00B5",
+ para: "\u00B6",
+ middot: "\u00B7",
+ cedil: "\u00B8",
+ sup1: "\u00B9",
+ ordm: "\u00BA",
+ raquo: "\u00BB",
+ frac14: "\u00BC",
+ frac12: "\u00BD",
+ frac34: "\u00BE",
+ iquest: "\u00BF",
+ Agrave: "\u00C0",
+ Aacute: "\u00C1",
+ Acirc: "\u00C2",
+ Atilde: "\u00C3",
+ Auml: "\u00C4",
+ Aring: "\u00C5",
+ AElig: "\u00C6",
+ Ccedil: "\u00C7",
+ Egrave: "\u00C8",
+ Eacute: "\u00C9",
+ Ecirc: "\u00CA",
+ Euml: "\u00CB",
+ Igrave: "\u00CC",
+ Iacute: "\u00CD",
+ Icirc: "\u00CE",
+ Iuml: "\u00CF",
+ ETH: "\u00D0",
+ Ntilde: "\u00D1",
+ Ograve: "\u00D2",
+ Oacute: "\u00D3",
+ Ocirc: "\u00D4",
+ Otilde: "\u00D5",
+ Ouml: "\u00D6",
+ times: "\u00D7",
+ Oslash: "\u00D8",
+ Ugrave: "\u00D9",
+ Uacute: "\u00DA",
+ Ucirc: "\u00DB",
+ Uuml: "\u00DC",
+ Yacute: "\u00DD",
+ THORN: "\u00DE",
+ szlig: "\u00DF",
+ agrave: "\u00E0",
+ aacute: "\u00E1",
+ acirc: "\u00E2",
+ atilde: "\u00E3",
+ auml: "\u00E4",
+ aring: "\u00E5",
+ aelig: "\u00E6",
+ ccedil: "\u00E7",
+ egrave: "\u00E8",
+ eacute: "\u00E9",
+ ecirc: "\u00EA",
+ euml: "\u00EB",
+ igrave: "\u00EC",
+ iacute: "\u00ED",
+ icirc: "\u00EE",
+ iuml: "\u00EF",
+ eth: "\u00F0",
+ ntilde: "\u00F1",
+ ograve: "\u00F2",
+ oacute: "\u00F3",
+ ocirc: "\u00F4",
+ otilde: "\u00F5",
+ ouml: "\u00F6",
+ divide: "\u00F7",
+ oslash: "\u00F8",
+ ugrave: "\u00F9",
+ uacute: "\u00FA",
+ ucirc: "\u00FB",
+ uuml: "\u00FC",
+ yacute: "\u00FD",
+ thorn: "\u00FE",
+ yuml: "\u00FF",
+ OElig: "\u0152",
+ oelig: "\u0153",
+ Scaron: "\u0160",
+ scaron: "\u0161",
+ Yuml: "\u0178",
+ fnof: "\u0192",
+ circ: "\u02C6",
+ tilde: "\u02DC",
+ Alpha: "\u0391",
+ Beta: "\u0392",
+ Gamma: "\u0393",
+ Delta: "\u0394",
+ Epsilon: "\u0395",
+ Zeta: "\u0396",
+ Eta: "\u0397",
+ Theta: "\u0398",
+ Iota: "\u0399",
+ Kappa: "\u039A",
+ Lambda: "\u039B",
+ Mu: "\u039C",
+ Nu: "\u039D",
+ Xi: "\u039E",
+ Omicron: "\u039F",
+ Pi: "\u03A0",
+ Rho: "\u03A1",
+ Sigma: "\u03A3",
+ Tau: "\u03A4",
+ Upsilon: "\u03A5",
+ Phi: "\u03A6",
+ Chi: "\u03A7",
+ Psi: "\u03A8",
+ Omega: "\u03A9",
+ alpha: "\u03B1",
+ beta: "\u03B2",
+ gamma: "\u03B3",
+ delta: "\u03B4",
+ epsilon: "\u03B5",
+ zeta: "\u03B6",
+ eta: "\u03B7",
+ theta: "\u03B8",
+ iota: "\u03B9",
+ kappa: "\u03BA",
+ lambda: "\u03BB",
+ mu: "\u03BC",
+ nu: "\u03BD",
+ xi: "\u03BE",
+ omicron: "\u03BF",
+ pi: "\u03C0",
+ rho: "\u03C1",
+ sigmaf: "\u03C2",
+ sigma: "\u03C3",
+ tau: "\u03C4",
+ upsilon: "\u03C5",
+ phi: "\u03C6",
+ chi: "\u03C7",
+ psi: "\u03C8",
+ omega: "\u03C9",
+ thetasym: "\u03D1",
+ upsih: "\u03D2",
+ piv: "\u03D6",
+ ensp: "\u2002",
+ emsp: "\u2003",
+ thinsp: "\u2009",
+ zwnj: "\u200C",
+ zwj: "\u200D",
+ lrm: "\u200E",
+ rlm: "\u200F",
+ ndash: "\u2013",
+ mdash: "\u2014",
+ lsquo: "\u2018",
+ rsquo: "\u2019",
+ sbquo: "\u201A",
+ ldquo: "\u201C",
+ rdquo: "\u201D",
+ bdquo: "\u201E",
+ dagger: "\u2020",
+ Dagger: "\u2021",
+ bull: "\u2022",
+ hellip: "\u2026",
+ permil: "\u2030",
+ prime: "\u2032",
+ Prime: "\u2033",
+ lsaquo: "\u2039",
+ rsaquo: "\u203A",
+ oline: "\u203E",
+ frasl: "\u2044",
+ euro: "\u20AC",
+ image: "\u2111",
+ weierp: "\u2118",
+ real: "\u211C",
+ trade: "\u2122",
+ alefsym: "\u2135",
+ larr: "\u2190",
+ uarr: "\u2191",
+ rarr: "\u2192",
+ darr: "\u2193",
+ harr: "\u2194",
+ crarr: "\u21B5",
+ lArr: "\u21D0",
+ uArr: "\u21D1",
+ rArr: "\u21D2",
+ dArr: "\u21D3",
+ hArr: "\u21D4",
+ forall: "\u2200",
+ part: "\u2202",
+ exist: "\u2203",
+ empty: "\u2205",
+ nabla: "\u2207",
+ isin: "\u2208",
+ notin: "\u2209",
+ ni: "\u220B",
+ prod: "\u220F",
+ sum: "\u2211",
+ minus: "\u2212",
+ lowast: "\u2217",
+ radic: "\u221A",
+ prop: "\u221D",
+ infin: "\u221E",
+ ang: "\u2220",
+ and: "\u2227",
+ or: "\u2228",
+ cap: "\u2229",
+ cup: "\u222A",
+ int: "\u222B",
+ there4: "\u2234",
+ sim: "\u223C",
+ cong: "\u2245",
+ asymp: "\u2248",
+ ne: "\u2260",
+ equiv: "\u2261",
+ le: "\u2264",
+ ge: "\u2265",
+ sub: "\u2282",
+ sup: "\u2283",
+ nsub: "\u2284",
+ sube: "\u2286",
+ supe: "\u2287",
+ oplus: "\u2295",
+ otimes: "\u2297",
+ perp: "\u22A5",
+ sdot: "\u22C5",
+ lceil: "\u2308",
+ rceil: "\u2309",
+ lfloor: "\u230A",
+ rfloor: "\u230B",
+ lang: "\u2329",
+ rang: "\u232A",
+ loz: "\u25CA",
+ spades: "\u2660",
+ clubs: "\u2663",
+ hearts: "\u2665",
+ diams: "\u2666"
+ };
+
+ const HEX_NUMBER = /^[\da-fA-F]+$/;
+ const DECIMAL_NUMBER = /^\d+$/;
+ const JsxErrors = makeErrorTemplates({
+ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
+ MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>.",
+ MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
+ UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
+ UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
+ UnterminatedJsxContent: "Unterminated JSX contents.",
+ UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
+ }, ErrorCodes.SyntaxError, "jsx");
+ types$1.j_oTag = new TokContext("<tag");
+ types$1.j_cTag = new TokContext("</tag");
+ types$1.j_expr = new TokContext("<tag>...</tag>", true);
+
+ function isFragment(object) {
+ return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
+ }
+
+ function getQualifiedJSXName(object) {
+ if (object.type === "JSXIdentifier") {
+ return object.name;
+ }
+
+ if (object.type === "JSXNamespacedName") {
+ return object.namespace.name + ":" + object.name.name;
+ }
+
+ if (object.type === "JSXMemberExpression") {
+ return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
+ }
+
+ throw new Error("Node had unexpected type: " + object.type);
+ }
+
+ var jsx$1 = (superClass => class extends superClass {
+ jsxReadToken() {
+ let out = "";
+ let chunkStart = this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (ch === 60 && this.state.exprAllowed) {
+ ++this.state.pos;
+ return this.finishToken(94);
+ }
+
+ return super.getTokenFromCode(ch);
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ return this.finishToken(93, out);
+
+ case 38:
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ break;
+
+ case 62:
+ case 125:
+
+ default:
+ if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(true);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+
+ }
+ }
+ }
+
+ jsxReadNewLine(normalizeCRLF) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let out;
+ ++this.state.pos;
+
+ if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ out = normalizeCRLF ? "\n" : "\r\n";
+ } else {
+ out = String.fromCharCode(ch);
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return out;
+ }
+
+ jsxReadString(quote) {
+ let out = "";
+ let chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 38) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(false);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ return this.finishToken(4, out);
+ }
+
+ jsxReadEntity() {
+ let str = "";
+ let count = 0;
+ let entity;
+ let ch = this.input[this.state.pos];
+ const startPos = ++this.state.pos;
+
+ while (this.state.pos < this.length && count++ < 10) {
+ ch = this.input[this.state.pos++];
+
+ if (ch === ";") {
+ if (str[0] === "#") {
+ if (str[1] === "x") {
+ str = str.substr(2);
+
+ if (HEX_NUMBER.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 16));
+ }
+ } else {
+ str = str.substr(1);
+
+ if (DECIMAL_NUMBER.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 10));
+ }
+ }
+ } else {
+ entity = entities[str];
+ }
+
+ break;
+ }
+
+ str += ch;
+ }
+
+ if (!entity) {
+ this.state.pos = startPos;
+ return "&";
+ }
+
+ return entity;
+ }
+
+ jsxReadWord() {
+ let ch;
+ const start = this.state.pos;
+
+ do {
+ ch = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar(ch) || ch === 45);
+
+ return this.finishToken(92, this.input.slice(start, this.state.pos));
+ }
+
+ jsxParseIdentifier() {
+ const node = this.startNode();
+
+ if (this.match(92)) {
+ node.name = this.state.value;
+ } else if (tokenIsKeyword(this.state.type)) {
+ node.name = tokenLabelName(this.state.type);
+ } else {
+ this.unexpected();
+ }
+
+ this.next();
+ return this.finishNode(node, "JSXIdentifier");
+ }
+
+ jsxParseNamespacedName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const name = this.jsxParseIdentifier();
+ if (!this.eat(22)) return name;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.namespace = name;
+ node.name = this.jsxParseIdentifier();
+ return this.finishNode(node, "JSXNamespacedName");
+ }
+
+ jsxParseElementName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let node = this.jsxParseNamespacedName();
+
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+
+ while (this.eat(24)) {
+ const newNode = this.startNodeAt(startPos, startLoc);
+ newNode.object = node;
+ newNode.property = this.jsxParseIdentifier();
+ node = this.finishNode(newNode, "JSXMemberExpression");
+ }
+
+ return node;
+ }
+
+ jsxParseAttributeValue() {
+ let node;
+
+ switch (this.state.type) {
+ case 13:
+ node = this.startNode();
+ this.next();
+ node = this.jsxParseExpressionContainer(node);
+
+ if (node.expression.type === "JSXEmptyExpression") {
+ this.raise(node.start, JsxErrors.AttributeIsEmpty);
+ }
+
+ return node;
+
+ case 94:
+ case 4:
+ return this.parseExprAtom();
+
+ default:
+ throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);
+ }
+ }
+
+ jsxParseEmptyExpression() {
+ const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
+ return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
+ }
+
+ jsxParseSpreadChild(node) {
+ this.next();
+ node.expression = this.parseExpression();
+ this.expect(16);
+ return this.finishNode(node, "JSXSpreadChild");
+ }
+
+ jsxParseExpressionContainer(node) {
+ if (this.match(16)) {
+ node.expression = this.jsxParseEmptyExpression();
+ } else {
+ const expression = this.parseExpression();
+ node.expression = expression;
+ }
+
+ this.expect(16);
+ return this.finishNode(node, "JSXExpressionContainer");
+ }
+
+ jsxParseAttribute() {
+ const node = this.startNode();
+
+ if (this.eat(13)) {
+ this.expect(29);
+ node.argument = this.parseMaybeAssignAllowIn();
+ this.expect(16);
+ return this.finishNode(node, "JSXSpreadAttribute");
+ }
+
+ node.name = this.jsxParseNamespacedName();
+ node.value = this.eat(35) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(node, "JSXAttribute");
+ }
+
+ jsxParseOpeningElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(95)) {
+ this.expect(95);
+ return this.finishNode(node, "JSXOpeningFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(node);
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ const attributes = [];
+
+ while (!this.match(55) && !this.match(95)) {
+ attributes.push(this.jsxParseAttribute());
+ }
+
+ node.attributes = attributes;
+ node.selfClosing = this.eat(55);
+ this.expect(95);
+ return this.finishNode(node, "JSXOpeningElement");
+ }
+
+ jsxParseClosingElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(95)) {
+ this.expect(95);
+ return this.finishNode(node, "JSXClosingFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ this.expect(95);
+ return this.finishNode(node, "JSXClosingElement");
+ }
+
+ jsxParseElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const children = [];
+ const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
+ let closingElement = null;
+
+ if (!openingElement.selfClosing) {
+ contents: for (;;) {
+ switch (this.state.type) {
+ case 94:
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ this.next();
+
+ if (this.eat(55)) {
+ closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
+ break contents;
+ }
+
+ children.push(this.jsxParseElementAt(startPos, startLoc));
+ break;
+
+ case 93:
+ children.push(this.parseExprAtom());
+ break;
+
+ case 13:
+ {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(29)) {
+ children.push(this.jsxParseSpreadChild(node));
+ } else {
+ children.push(this.jsxParseExpressionContainer(node));
+ }
+
+ break;
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ if (isFragment(openingElement) && !isFragment(closingElement)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment);
+ } else if (!isFragment(openingElement) && isFragment(closingElement)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
+ } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
+ }
+ }
+ }
+
+ if (isFragment(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+
+ node.children = children;
+
+ if (this.isRelational("<")) {
+ throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements);
+ }
+
+ return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
+ }
+
+ jsxParseElement() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(startPos, startLoc);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.match(93)) {
+ return this.parseLiteral(this.state.value, "JSXText");
+ } else if (this.match(94)) {
+ return this.jsxParseElement();
+ } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) {
+ this.finishToken(94);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ createLookaheadState(state) {
+ const lookaheadState = super.createLookaheadState(state);
+ lookaheadState.inPropertyName = state.inPropertyName;
+ return lookaheadState;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inPropertyName) return super.getTokenFromCode(code);
+ const context = this.curContext();
+
+ if (context === types$1.j_expr) {
+ return this.jsxReadToken();
+ }
+
+ if (context === types$1.j_oTag || context === types$1.j_cTag) {
+ if (isIdentifierStart(code)) {
+ return this.jsxReadWord();
+ }
+
+ if (code === 62) {
+ ++this.state.pos;
+ return this.finishToken(95);
+ }
+
+ if ((code === 34 || code === 39) && context === types$1.j_oTag) {
+ return this.jsxReadString(code);
+ }
+ }
+
+ if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {
+ ++this.state.pos;
+ return this.finishToken(94);
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ updateContext(prevType) {
+ super.updateContext(prevType);
+ const {
+ context,
+ type
+ } = this.state;
+
+ if (type === 55 && prevType === 94) {
+ context.splice(-2, 2, types$1.j_cTag);
+ this.state.exprAllowed = false;
+ } else if (type === 94) {
+ context.push(types$1.j_expr, types$1.j_oTag);
+ } else if (type === 95) {
+ const out = context.pop();
+
+ if (out === types$1.j_oTag && prevType === 55 || out === types$1.j_cTag) {
+ context.pop();
+ this.state.exprAllowed = context[context.length - 1] === types$1.j_expr;
+ } else {
+ this.state.exprAllowed = true;
+ }
+ } else if (tokenIsKeyword(type) && (prevType === 24 || prevType === 26)) {
+ this.state.exprAllowed = false;
+ } else {
+ this.state.exprAllowed = tokenComesBeforeExpression(type);
+ }
+ }
+
+ });
+
+ class TypeScriptScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.types = new Set();
+ this.enums = new Set();
+ this.constEnums = new Set();
+ this.classes = new Set();
+ this.exportOnlyBindings = new Set();
+ }
+
+ }
+
+ class TypeScriptScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new TypeScriptScope(flags);
+ }
+
+ declareName(name, bindingType, pos) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
+ this.maybeExportDefined(scope, name);
+ scope.exportOnlyBindings.add(name);
+ return;
+ }
+
+ super.declareName(...arguments);
+
+ if (bindingType & BIND_KIND_TYPE) {
+ if (!(bindingType & BIND_KIND_VALUE)) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ this.maybeExportDefined(scope, name);
+ }
+
+ scope.types.add(name);
+ }
+
+ if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);
+ if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);
+ if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (scope.enums.has(name)) {
+ if (bindingType & BIND_FLAGS_TS_ENUM) {
+ const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
+ const wasConst = scope.constEnums.has(name);
+ return isConst !== wasConst;
+ }
+
+ return true;
+ }
+
+ if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
+ if (scope.lexical.has(name)) {
+ return !!(bindingType & BIND_KIND_VALUE);
+ } else {
+ return false;
+ }
+ }
+
+ if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
+ return true;
+ }
+
+ return super.isRedeclaredInScope(...arguments);
+ }
+
+ checkLocalExport(id) {
+ const topLevelScope = this.scopeStack[0];
+ const {
+ name
+ } = id;
+
+ if (!topLevelScope.types.has(name) && !topLevelScope.exportOnlyBindings.has(name)) {
+ super.checkLocalExport(id);
+ }
+ }
+
+ }
+
+ function nonNull(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+
+ return x;
+ }
+
+ function assert(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+ }
+
+ const TSErrors = makeErrorTemplates({
+ AbstractMethodHasImplementation: "Method '%0' cannot have an implementation because it is marked abstract.",
+ AbstractPropertyHasInitializer: "Property '%0' cannot have an initializer because it is marked abstract.",
+ AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
+ AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
+ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
+ ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
+ ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
+ DeclareAccessor: "'declare' is not allowed in %0ters.",
+ DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
+ DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
+ DuplicateAccessibilityModifier: "Accessibility modifier already seen.",
+ DuplicateModifier: "Duplicate modifier: '%0'.",
+ EmptyHeritageClauseType: "'%0' list cannot be empty.",
+ EmptyTypeArguments: "Type argument list cannot be empty.",
+ EmptyTypeParameters: "Type parameter list cannot be empty.",
+ ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.",
+ ImportAliasHasImportType: "An import alias can not use 'import type'.",
+ IncompatibleModifiers: "'%0' modifier cannot be used with '%1' modifier.",
+ IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.",
+ IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0').",
+ IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.",
+ IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
+ IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
+ InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.",
+ InvalidModifiersOrder: "'%0' modifier must precede '%1' modifier.",
+ InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
+ MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
+ MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.",
+ NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
+ NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.",
+ OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
+ OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0').",
+ ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
+ SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
+ SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
+ SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
+ StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.",
+ TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.",
+ UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.",
+ UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
+ UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
+ UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.",
+ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
+ UnsupportedSignatureParameterKind: "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0."
+ }, ErrorCodes.SyntaxError, "typescript");
+
+ function keywordTypeFromName(value) {
+ switch (value) {
+ case "any":
+ return "TSAnyKeyword";
+
+ case "boolean":
+ return "TSBooleanKeyword";
+
+ case "bigint":
+ return "TSBigIntKeyword";
+
+ case "never":
+ return "TSNeverKeyword";
+
+ case "number":
+ return "TSNumberKeyword";
+
+ case "object":
+ return "TSObjectKeyword";
+
+ case "string":
+ return "TSStringKeyword";
+
+ case "symbol":
+ return "TSSymbolKeyword";
+
+ case "undefined":
+ return "TSUndefinedKeyword";
+
+ case "unknown":
+ return "TSUnknownKeyword";
+
+ default:
+ return undefined;
+ }
+ }
+
+ function tsIsAccessModifier(modifier) {
+ return modifier === "private" || modifier === "public" || modifier === "protected";
+ }
+
+ var typescript$1 = (superClass => class extends superClass {
+ getScopeHandler() {
+ return TypeScriptScopeHandler;
+ }
+
+ tsIsIdentifier() {
+ return this.match(5);
+ }
+
+ tsTokenCanFollowModifier() {
+ return (this.match(8) || this.match(13) || this.match(54) || this.match(29) || this.match(6) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
+ }
+
+ tsNextTokenCanFollowModifier() {
+ this.next();
+ return this.tsTokenCanFollowModifier();
+ }
+
+ tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
+ if (!this.match(5)) {
+ return undefined;
+ }
+
+ const modifier = this.state.value;
+
+ if (allowedModifiers.indexOf(modifier) !== -1) {
+ if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
+ return undefined;
+ }
+
+ if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
+ return modifier;
+ }
+ }
+
+ return undefined;
+ }
+
+ tsParseModifiers(modified, allowedModifiers, disallowedModifiers, errorTemplate, stopOnStartOfClassStaticBlock) {
+ const enforceOrder = (pos, modifier, before, after) => {
+ if (modifier === before && modified[after]) {
+ this.raise(pos, TSErrors.InvalidModifiersOrder, before, after);
+ }
+ };
+
+ const incompatible = (pos, modifier, mod1, mod2) => {
+ if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
+ this.raise(pos, TSErrors.IncompatibleModifiers, mod1, mod2);
+ }
+ };
+
+ for (;;) {
+ const startPos = this.state.start;
+ const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);
+ if (!modifier) break;
+
+ if (tsIsAccessModifier(modifier)) {
+ if (modified.accessibility) {
+ this.raise(startPos, TSErrors.DuplicateAccessibilityModifier);
+ } else {
+ enforceOrder(startPos, modifier, modifier, "override");
+ enforceOrder(startPos, modifier, modifier, "static");
+ enforceOrder(startPos, modifier, modifier, "readonly");
+ modified.accessibility = modifier;
+ }
+ } else {
+ if (Object.hasOwnProperty.call(modified, modifier)) {
+ this.raise(startPos, TSErrors.DuplicateModifier, modifier);
+ } else {
+ enforceOrder(startPos, modifier, "static", "readonly");
+ enforceOrder(startPos, modifier, "static", "override");
+ enforceOrder(startPos, modifier, "override", "readonly");
+ enforceOrder(startPos, modifier, "abstract", "override");
+ incompatible(startPos, modifier, "declare", "override");
+ incompatible(startPos, modifier, "static", "abstract");
+ }
+
+ modified[modifier] = true;
+ }
+
+ if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
+ this.raise(startPos, errorTemplate, modifier);
+ }
+ }
+ }
+
+ tsIsListTerminator(kind) {
+ switch (kind) {
+ case "EnumMembers":
+ case "TypeMembers":
+ return this.match(16);
+
+ case "HeritageClauseElement":
+ return this.match(13);
+
+ case "TupleElementTypes":
+ return this.match(11);
+
+ case "TypeParametersOrArguments":
+ return this.isRelational(">");
+ }
+
+ throw new Error("Unreachable");
+ }
+
+ tsParseList(kind, parseElement) {
+ const result = [];
+
+ while (!this.tsIsListTerminator(kind)) {
+ result.push(parseElement());
+ }
+
+ return result;
+ }
+
+ tsParseDelimitedList(kind, parseElement) {
+ return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true));
+ }
+
+ tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {
+ const result = [];
+
+ for (;;) {
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ const element = parseElement();
+
+ if (element == null) {
+ return undefined;
+ }
+
+ result.push(element);
+
+ if (this.eat(20)) {
+ continue;
+ }
+
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ if (expectSuccess) {
+ this.expect(20);
+ }
+
+ return undefined;
+ }
+
+ return result;
+ }
+
+ tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {
+ if (!skipFirstToken) {
+ if (bracket) {
+ this.expect(8);
+ } else {
+ this.expectRelational("<");
+ }
+ }
+
+ const result = this.tsParseDelimitedList(kind, parseElement);
+
+ if (bracket) {
+ this.expect(11);
+ } else {
+ this.expectRelational(">");
+ }
+
+ return result;
+ }
+
+ tsParseImportType() {
+ const node = this.startNode();
+ this.expect(82);
+ this.expect(18);
+
+ if (!this.match(4)) {
+ this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument);
+ }
+
+ node.argument = this.parseExprAtom();
+ this.expect(19);
+
+ if (this.eat(24)) {
+ node.qualifier = this.tsParseEntityName(true);
+ }
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSImportType");
+ }
+
+ tsParseEntityName(allowReservedWords) {
+ let entity = this.parseIdentifier();
+
+ while (this.eat(24)) {
+ const node = this.startNodeAtNode(entity);
+ node.left = entity;
+ node.right = this.parseIdentifier(allowReservedWords);
+ entity = this.finishNode(node, "TSQualifiedName");
+ }
+
+ return entity;
+ }
+
+ tsParseTypeReference() {
+ const node = this.startNode();
+ node.typeName = this.tsParseEntityName(false);
+
+ if (!this.hasPrecedingLineBreak() && this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSTypeReference");
+ }
+
+ tsParseThisTypePredicate(lhs) {
+ this.next();
+ const node = this.startNodeAtNode(lhs);
+ node.parameterName = lhs;
+ node.typeAnnotation = this.tsParseTypeAnnotation(false);
+ node.asserts = false;
+ return this.finishNode(node, "TSTypePredicate");
+ }
+
+ tsParseThisTypeNode() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSThisType");
+ }
+
+ tsParseTypeQuery() {
+ const node = this.startNode();
+ this.expect(86);
+
+ if (this.match(82)) {
+ node.exprName = this.tsParseImportType();
+ } else {
+ node.exprName = this.tsParseEntityName(true);
+ }
+
+ return this.finishNode(node, "TSTypeQuery");
+ }
+
+ tsParseTypeParameter() {
+ const node = this.startNode();
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsEatThenParseType(80);
+ node.default = this.tsEatThenParseType(35);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsTryParseTypeParameters() {
+ if (this.isRelational("<")) {
+ return this.tsParseTypeParameters();
+ }
+ }
+
+ tsParseTypeParameters() {
+ const node = this.startNode();
+
+ if (this.isRelational("<") || this.match(94)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true);
+
+ if (node.params.length === 0) {
+ this.raise(node.start, TSErrors.EmptyTypeParameters);
+ }
+
+ return this.finishNode(node, "TSTypeParameterDeclaration");
+ }
+
+ tsTryNextParseConstantContext() {
+ if (this.lookahead().type === 74) {
+ this.next();
+ return this.tsParseTypeReference();
+ }
+
+ return null;
+ }
+
+ tsFillSignature(returnToken, signature) {
+ const returnTokenRequired = returnToken === 27;
+ signature.typeParameters = this.tsTryParseTypeParameters();
+ this.expect(18);
+ signature.parameters = this.tsParseBindingListForSignature();
+
+ if (returnTokenRequired) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ } else if (this.match(returnToken)) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ }
+ }
+
+ tsParseBindingListForSignature() {
+ return this.parseBindingList(19, 41).map(pattern => {
+ if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
+ this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, pattern.type);
+ }
+
+ return pattern;
+ });
+ }
+
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(20) && !this.isLineTerminator()) {
+ this.expect(21);
+ }
+ }
+
+ tsParseSignatureMember(kind, node) {
+ this.tsFillSignature(22, node);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, kind);
+ }
+
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+ return this.eat(5) && this.match(22);
+ }
+
+ tsTryParseIndexSignature(node) {
+ if (!(this.match(8) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
+ return undefined;
+ }
+
+ this.expect(8);
+ const id = this.parseIdentifier();
+ id.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(id);
+ this.expect(11);
+ node.parameters = [id];
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, "TSIndexSignature");
+ }
+
+ tsParsePropertyOrMethodSignature(node, readonly) {
+ if (this.eat(25)) node.optional = true;
+ const nodeAny = node;
+
+ if (this.match(18) || this.isRelational("<")) {
+ if (readonly) {
+ this.raise(node.start, TSErrors.ReadonlyForMethodSignature);
+ }
+
+ const method = nodeAny;
+
+ if (method.kind && this.isRelational("<")) {
+ this.raise(this.state.pos, TSErrors.AccesorCannotHaveTypeParameters);
+ }
+
+ this.tsFillSignature(22, method);
+ this.tsParseTypeMemberSemicolon();
+
+ if (method.kind === "get") {
+ if (method.parameters.length > 0) {
+ this.raise(this.state.pos, ErrorMessages.BadGetterArity);
+
+ if (this.isThisParam(method.parameters[0])) {
+ this.raise(this.state.pos, TSErrors.AccesorCannotDeclareThisParameter);
+ }
+ }
+ } else if (method.kind === "set") {
+ if (method.parameters.length !== 1) {
+ this.raise(this.state.pos, ErrorMessages.BadSetterArity);
+ } else {
+ const firstParameter = method.parameters[0];
+
+ if (this.isThisParam(firstParameter)) {
+ this.raise(this.state.pos, TSErrors.AccesorCannotDeclareThisParameter);
+ }
+
+ if (firstParameter.type === "Identifier" && firstParameter.optional) {
+ this.raise(this.state.pos, TSErrors.SetAccesorCannotHaveOptionalParameter);
+ }
+
+ if (firstParameter.type === "RestElement") {
+ this.raise(this.state.pos, TSErrors.SetAccesorCannotHaveRestParameter);
+ }
+ }
+
+ if (method.typeAnnotation) {
+ this.raise(method.typeAnnotation.start, TSErrors.SetAccesorCannotHaveReturnType);
+ }
+ } else {
+ method.kind = "method";
+ }
+
+ return this.finishNode(method, "TSMethodSignature");
+ } else {
+ const property = nodeAny;
+ if (readonly) property.readonly = true;
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) property.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(property, "TSPropertySignature");
+ }
+ }
+
+ tsParseTypeMember() {
+ const node = this.startNode();
+
+ if (this.match(18) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
+ }
+
+ if (this.match(76)) {
+ const id = this.startNode();
+ this.next();
+
+ if (this.match(18) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
+ } else {
+ node.key = this.createIdentifier(id, "new");
+ return this.tsParsePropertyOrMethodSignature(node, false);
+ }
+ }
+
+ this.tsParseModifiers(node, ["readonly"], ["declare", "abstract", "private", "protected", "public", "static", "override"], TSErrors.InvalidModifierOnTypeMember);
+ const idx = this.tsTryParseIndexSignature(node);
+
+ if (idx) {
+ return idx;
+ }
+
+ this.parsePropertyName(node, false);
+
+ if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) {
+ node.kind = node.key.name;
+ this.parsePropertyName(node, false);
+ }
+
+ return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);
+ }
+
+ tsParseTypeLiteral() {
+ const node = this.startNode();
+ node.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(node, "TSTypeLiteral");
+ }
+
+ tsParseObjectTypeMembers() {
+ this.expect(13);
+ const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
+ this.expect(16);
+ return members;
+ }
+
+ tsIsStartOfMappedType() {
+ this.next();
+
+ if (this.eat(52)) {
+ return this.isContextual("readonly");
+ }
+
+ if (this.isContextual("readonly")) {
+ this.next();
+ }
+
+ if (!this.match(8)) {
+ return false;
+ }
+
+ this.next();
+
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+
+ this.next();
+ return this.match(57);
+ }
+
+ tsParseMappedTypeParameter() {
+ const node = this.startNode();
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsExpectThenParseType(57);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsParseMappedType() {
+ const node = this.startNode();
+ this.expect(13);
+
+ if (this.match(52)) {
+ node.readonly = this.state.value;
+ this.next();
+ this.expectContextual("readonly");
+ } else if (this.eatContextual("readonly")) {
+ node.readonly = true;
+ }
+
+ this.expect(8);
+ node.typeParameter = this.tsParseMappedTypeParameter();
+ node.nameType = this.eatContextual("as") ? this.tsParseType() : null;
+ this.expect(11);
+
+ if (this.match(52)) {
+ node.optional = this.state.value;
+ this.next();
+ this.expect(25);
+ } else if (this.eat(25)) {
+ node.optional = true;
+ }
+
+ node.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(16);
+ return this.finishNode(node, "TSMappedType");
+ }
+
+ tsParseTupleType() {
+ const node = this.startNode();
+ node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
+ let seenOptionalElement = false;
+ let labeledElements = null;
+ node.elementTypes.forEach(elementNode => {
+ var _labeledElements;
+
+ let {
+ type
+ } = elementNode;
+
+ if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
+ this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired);
+ }
+
+ seenOptionalElement = seenOptionalElement || type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType";
+
+ if (type === "TSRestType") {
+ elementNode = elementNode.typeAnnotation;
+ type = elementNode.type;
+ }
+
+ const isLabeled = type === "TSNamedTupleMember";
+ labeledElements = (_labeledElements = labeledElements) != null ? _labeledElements : isLabeled;
+
+ if (labeledElements !== isLabeled) {
+ this.raise(elementNode.start, TSErrors.MixedLabeledAndUnlabeledElements);
+ }
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+
+ tsParseTupleElementType() {
+ const {
+ start: startPos,
+ startLoc
+ } = this.state;
+ const rest = this.eat(29);
+ let type = this.tsParseType();
+ const optional = this.eat(25);
+ const labeled = this.eat(22);
+
+ if (labeled) {
+ const labeledNode = this.startNodeAtNode(type);
+ labeledNode.optional = optional;
+
+ if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") {
+ labeledNode.label = type.typeName;
+ } else {
+ this.raise(type.start, TSErrors.InvalidTupleMemberLabel);
+ labeledNode.label = type;
+ }
+
+ labeledNode.elementType = this.tsParseType();
+ type = this.finishNode(labeledNode, "TSNamedTupleMember");
+ } else if (optional) {
+ const optionalTypeNode = this.startNodeAtNode(type);
+ optionalTypeNode.typeAnnotation = type;
+ type = this.finishNode(optionalTypeNode, "TSOptionalType");
+ }
+
+ if (rest) {
+ const restNode = this.startNodeAt(startPos, startLoc);
+ restNode.typeAnnotation = type;
+ type = this.finishNode(restNode, "TSRestType");
+ }
+
+ return type;
+ }
+
+ tsParseParenthesizedType() {
+ const node = this.startNode();
+ this.expect(18);
+ node.typeAnnotation = this.tsParseType();
+ this.expect(19);
+ return this.finishNode(node, "TSParenthesizedType");
+ }
+
+ tsParseFunctionOrConstructorType(type, abstract) {
+ const node = this.startNode();
+
+ if (type === "TSConstructorType") {
+ node.abstract = !!abstract;
+ if (abstract) this.next();
+ this.next();
+ }
+
+ this.tsFillSignature(27, node);
+ return this.finishNode(node, type);
+ }
+
+ tsParseLiteralTypeNode() {
+ const node = this.startNode();
+
+ node.literal = (() => {
+ switch (this.state.type) {
+ case 0:
+ case 1:
+ case 4:
+ case 84:
+ case 85:
+ return this.parseExprAtom();
+
+ default:
+ throw this.unexpected();
+ }
+ })();
+
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseTemplateLiteralType() {
+ const node = this.startNode();
+ node.literal = this.parseTemplate(false);
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ parseTemplateSubstitution() {
+ if (this.state.inType) return this.tsParseType();
+ return super.parseTemplateSubstitution();
+ }
+
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case 5:
+ case 87:
+ case 83:
+ {
+ const type = this.match(87) ? "TSVoidKeyword" : this.match(83) ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
+
+ if (type !== undefined && this.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ return this.tsParseTypeReference();
+ }
+
+ case 4:
+ case 0:
+ case 1:
+ case 84:
+ case 85:
+ return this.tsParseLiteralTypeNode();
+
+ case 52:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+ const nextToken = this.lookahead();
+
+ if (nextToken.type !== 0 && nextToken.type !== 1) {
+ throw this.unexpected();
+ }
+
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ break;
+
+ case 77:
+ return this.tsParseThisTypeOrThisTypePredicate();
+
+ case 86:
+ return this.tsParseTypeQuery();
+
+ case 82:
+ return this.tsParseImportType();
+
+ case 13:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
+
+ case 8:
+ return this.tsParseTupleType();
+
+ case 18:
+ return this.tsParseParenthesizedType();
+
+ case 30:
+ return this.tsParseTemplateLiteralType();
+ }
+
+ throw this.unexpected();
+ }
+
+ tsParseArrayTypeOrHigher() {
+ let type = this.tsParseNonArrayType();
+
+ while (!this.hasPrecedingLineBreak() && this.eat(8)) {
+ if (this.match(11)) {
+ const node = this.startNodeAtNode(type);
+ node.elementType = type;
+ this.expect(11);
+ type = this.finishNode(node, "TSArrayType");
+ } else {
+ const node = this.startNodeAtNode(type);
+ node.objectType = type;
+ node.indexType = this.tsParseType();
+ this.expect(11);
+ type = this.finishNode(node, "TSIndexedAccessType");
+ }
+ }
+
+ return type;
+ }
+
+ tsParseTypeOperator(operator) {
+ const node = this.startNode();
+ this.expectContextual(operator);
+ node.operator = operator;
+ node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+
+ if (operator === "readonly") {
+ this.tsCheckTypeAnnotationForReadOnly(node);
+ }
+
+ return this.finishNode(node, "TSTypeOperator");
+ }
+
+ tsCheckTypeAnnotationForReadOnly(node) {
+ switch (node.typeAnnotation.type) {
+ case "TSTupleType":
+ case "TSArrayType":
+ return;
+
+ default:
+ this.raise(node.start, TSErrors.UnexpectedReadonly);
+ }
+ }
+
+ tsParseInferType() {
+ const node = this.startNode();
+ this.expectContextual("infer");
+ const typeParameter = this.startNode();
+ typeParameter.name = this.tsParseTypeParameterName();
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ return this.finishNode(node, "TSInferType");
+ }
+
+ tsParseTypeOperatorOrHigher() {
+ const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw));
+ return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
+ }
+
+ tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
+ const node = this.startNode();
+ const hasLeadingOperator = this.eat(operator);
+ const types = [];
+
+ do {
+ types.push(parseConstituentType());
+ } while (this.eat(operator));
+
+ if (types.length === 1 && !hasLeadingOperator) {
+ return types[0];
+ }
+
+ node.types = types;
+ return this.finishNode(node, kind);
+ }
+
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 48);
+ }
+
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 46);
+ }
+
+ tsIsStartOfFunctionType() {
+ if (this.isRelational("<")) {
+ return true;
+ }
+
+ return this.match(18) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
+ }
+
+ tsSkipParameterStart() {
+ if (this.match(5) || this.match(77)) {
+ this.next();
+ return true;
+ }
+
+ if (this.match(13)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(13)) {
+ ++braceStackCounter;
+ } else if (this.match(16)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ if (this.match(8)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(8)) {
+ ++braceStackCounter;
+ } else if (this.match(11)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+
+ if (this.match(19) || this.match(29)) {
+ return true;
+ }
+
+ if (this.tsSkipParameterStart()) {
+ if (this.match(22) || this.match(20) || this.match(25) || this.match(35)) {
+ return true;
+ }
+
+ if (this.match(19)) {
+ this.next();
+
+ if (this.match(27)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ tsParseTypeOrTypePredicateAnnotation(returnToken) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(returnToken);
+ const node = this.startNode();
+ const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+
+ if (asserts && this.match(77)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+
+ if (thisTypePredicate.type === "TSThisType") {
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ node.typeAnnotation = null;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ this.resetStartLocationFromNode(thisTypePredicate, node);
+ thisTypePredicate.asserts = true;
+ }
+
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ node.typeAnnotation = null;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const type = this.tsParseTypeAnnotation(false);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ });
+ }
+
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ return this.match(22) ? this.tsParseTypeOrTypePredicateAnnotation(22) : undefined;
+ }
+
+ tsTryParseTypeAnnotation() {
+ return this.match(22) ? this.tsParseTypeAnnotation() : undefined;
+ }
+
+ tsTryParseType() {
+ return this.tsEatThenParseType(22);
+ }
+
+ tsParseTypePredicatePrefix() {
+ const id = this.parseIdentifier();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return id;
+ }
+ }
+
+ tsParseTypePredicateAsserts() {
+ if (!this.match(5) || this.state.value !== "asserts") {
+ return false;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.next();
+
+ if (!this.match(5) && !this.match(77)) {
+ return false;
+ }
+
+ if (containsEsc) {
+ this.raise(this.state.lastTokStart, ErrorMessages.InvalidEscapedReservedWord, "asserts");
+ }
+
+ return true;
+ }
+
+ tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (eatColon) this.expect(22);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ tsParseType() {
+ assert(this.state.inType);
+ const type = this.tsParseNonConditionalType();
+
+ if (this.hasPrecedingLineBreak() || !this.eat(80)) {
+ return type;
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.checkType = type;
+ node.extendsType = this.tsParseNonConditionalType();
+ this.expect(25);
+ node.trueType = this.tsParseType();
+ this.expect(22);
+ node.falseType = this.tsParseType();
+ return this.finishNode(node, "TSConditionalType");
+ }
+
+ isAbstractConstructorSignature() {
+ return this.isContextual("abstract") && this.lookahead().type === 76;
+ }
+
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType("TSFunctionType");
+ }
+
+ if (this.match(76)) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType");
+ } else if (this.isAbstractConstructorSignature()) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
+ }
+
+ return this.tsParseUnionTypeOrHigher();
+ }
+
+ tsParseTypeAssertion() {
+ const node = this.startNode();
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ node.typeAnnotation = _const || this.tsNextThenParseType();
+ this.expectRelational(">");
+ node.expression = this.parseMaybeUnary();
+ return this.finishNode(node, "TSTypeAssertion");
+ }
+
+ tsParseHeritageClause(descriptor) {
+ const originalStart = this.state.start;
+ const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this));
+
+ if (!delimitedList.length) {
+ this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor);
+ }
+
+ return delimitedList;
+ }
+
+ tsParseExpressionWithTypeArguments() {
+ const node = this.startNode();
+ node.expression = this.tsParseEntityName(false);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSExpressionWithTypeArguments");
+ }
+
+ tsParseInterfaceDeclaration(node) {
+ if (this.match(5)) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "typescript interface declaration", BIND_TS_INTERFACE);
+ } else {
+ node.id = null;
+ this.raise(this.state.start, TSErrors.MissingInterfaceName);
+ }
+
+ node.typeParameters = this.tsTryParseTypeParameters();
+
+ if (this.eat(80)) {
+ node.extends = this.tsParseHeritageClause("extends");
+ }
+
+ const body = this.startNode();
+ body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ node.body = this.finishNode(body, "TSInterfaceBody");
+ return this.finishNode(node, "TSInterfaceDeclaration");
+ }
+
+ tsParseTypeAliasDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "typescript type alias", BIND_TS_TYPE);
+ node.typeParameters = this.tsTryParseTypeParameters();
+ node.typeAnnotation = this.tsInType(() => {
+ this.expect(35);
+
+ if (this.isContextual("intrinsic") && this.lookahead().type !== 24) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSIntrinsicKeyword");
+ }
+
+ return this.tsParseType();
+ });
+ this.semicolon();
+ return this.finishNode(node, "TSTypeAliasDeclaration");
+ }
+
+ tsInNoContext(cb) {
+ const oldContext = this.state.context;
+ this.state.context = [oldContext[0]];
+
+ try {
+ return cb();
+ } finally {
+ this.state.context = oldContext;
+ }
+ }
+
+ tsInType(cb) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inType = oldInType;
+ }
+ }
+
+ tsEatThenParseType(token) {
+ return !this.match(token) ? undefined : this.tsNextThenParseType();
+ }
+
+ tsExpectThenParseType(token) {
+ return this.tsDoThenParseType(() => this.expect(token));
+ }
+
+ tsNextThenParseType() {
+ return this.tsDoThenParseType(() => this.next());
+ }
+
+ tsDoThenParseType(cb) {
+ return this.tsInType(() => {
+ cb();
+ return this.tsParseType();
+ });
+ }
+
+ tsParseEnumMember() {
+ const node = this.startNode();
+ node.id = this.match(4) ? this.parseExprAtom() : this.parseIdentifier(true);
+
+ if (this.eat(35)) {
+ node.initializer = this.parseMaybeAssignAllowIn();
+ }
+
+ return this.finishNode(node, "TSEnumMember");
+ }
+
+ tsParseEnumDeclaration(node, isConst) {
+ if (isConst) node.const = true;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "typescript enum declaration", isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM);
+ this.expect(13);
+ node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
+ this.expect(16);
+ return this.finishNode(node, "TSEnumDeclaration");
+ }
+
+ tsParseModuleBlock() {
+ const node = this.startNode();
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(13);
+ this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 16);
+ this.scope.exit();
+ return this.finishNode(node, "TSModuleBlock");
+ }
+
+ tsParseModuleOrNamespaceDeclaration(node, nested = false) {
+ node.id = this.parseIdentifier();
+
+ if (!nested) {
+ this.checkLVal(node.id, "module or namespace declaration", BIND_TS_NAMESPACE);
+ }
+
+ if (this.eat(24)) {
+ const inner = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(inner, true);
+ node.body = inner;
+ } else {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseAmbientExternalModuleDeclaration(node) {
+ if (this.isContextual("global")) {
+ node.global = true;
+ node.id = this.parseIdentifier();
+ } else if (this.match(4)) {
+ node.id = this.parseExprAtom();
+ } else {
+ this.unexpected();
+ }
+
+ if (this.match(13)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseImportEqualsDeclaration(node, isExport) {
+ node.isExport = isExport || false;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "import equals declaration", BIND_LEXICAL);
+ this.expect(35);
+ const moduleReference = this.tsParseModuleReference();
+
+ if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
+ this.raise(moduleReference.start, TSErrors.ImportAliasHasImportType);
+ }
+
+ node.moduleReference = moduleReference;
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+
+ tsIsExternalModuleReference() {
+ return this.isContextual("require") && this.lookaheadCharCode() === 40;
+ }
+
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
+ }
+
+ tsParseExternalModuleReference() {
+ const node = this.startNode();
+ this.expectContextual("require");
+ this.expect(18);
+
+ if (!this.match(4)) {
+ throw this.unexpected();
+ }
+
+ node.expression = this.parseExprAtom();
+ this.expect(19);
+ return this.finishNode(node, "TSExternalModuleReference");
+ }
+
+ tsLookAhead(f) {
+ const state = this.state.clone();
+ const res = f();
+ this.state = state;
+ return res;
+ }
+
+ tsTryParseAndCatch(f) {
+ const result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ tsTryParse(f) {
+ const state = this.state.clone();
+ const result = f();
+
+ if (result !== undefined && result !== false) {
+ return result;
+ } else {
+ this.state = state;
+ return undefined;
+ }
+ }
+
+ tsTryParseDeclare(nany) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+
+ let starttype = this.state.type;
+ let kind;
+
+ if (this.isContextual("let")) {
+ starttype = 73;
+ kind = "let";
+ }
+
+ return this.tsInAmbientContext(() => {
+ switch (starttype) {
+ case 67:
+ nany.declare = true;
+ return this.parseFunctionStatement(nany, false, true);
+
+ case 79:
+ nany.declare = true;
+ return this.parseClass(nany, true, false);
+
+ case 74:
+ if (this.match(74) && this.isLookaheadContextual("enum")) {
+ this.expect(74);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(nany, true);
+ }
+
+ case 73:
+ kind = kind || this.state.value;
+ return this.parseVarStatement(nany, kind);
+
+ case 5:
+ {
+ const value = this.state.value;
+
+ if (value === "global") {
+ return this.tsParseAmbientExternalModuleDeclaration(nany);
+ } else {
+ return this.tsParseDeclaration(nany, value, true);
+ }
+ }
+ }
+ });
+ }
+
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ }
+
+ tsParseExpressionStatement(node, expr) {
+ switch (expr.name) {
+ case "declare":
+ {
+ const declaration = this.tsTryParseDeclare(node);
+
+ if (declaration) {
+ declaration.declare = true;
+ return declaration;
+ }
+
+ break;
+ }
+
+ case "global":
+ if (this.match(13)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(mod, "TSModuleDeclaration");
+ }
+
+ break;
+
+ default:
+ return this.tsParseDeclaration(node, expr.name, false);
+ }
+ }
+
+ tsParseDeclaration(node, value, next) {
+ switch (value) {
+ case "abstract":
+ if (this.tsCheckLineTerminator(next) && (this.match(79) || this.match(5))) {
+ return this.tsParseAbstractDeclaration(node);
+ }
+
+ break;
+
+ case "enum":
+ if (next || this.match(5)) {
+ if (next) this.next();
+ return this.tsParseEnumDeclaration(node, false);
+ }
+
+ break;
+
+ case "interface":
+ if (this.tsCheckLineTerminator(next) && this.match(5)) {
+ return this.tsParseInterfaceDeclaration(node);
+ }
+
+ break;
+
+ case "module":
+ if (this.tsCheckLineTerminator(next)) {
+ if (this.match(4)) {
+ return this.tsParseAmbientExternalModuleDeclaration(node);
+ } else if (this.match(5)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+ }
+
+ break;
+
+ case "namespace":
+ if (this.tsCheckLineTerminator(next) && this.match(5)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "type":
+ if (this.tsCheckLineTerminator(next) && this.match(5)) {
+ return this.tsParseTypeAliasDeclaration(node);
+ }
+
+ break;
+ }
+ }
+
+ tsCheckLineTerminator(next) {
+ if (next) {
+ if (this.hasFollowingLineBreak()) return false;
+ this.next();
+ return true;
+ }
+
+ return !this.isLineTerminator();
+ }
+
+ tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
+ if (!this.isRelational("<")) {
+ return undefined;
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = true;
+ const res = this.tsTryParseAndCatch(() => {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = this.tsParseTypeParameters();
+ super.parseFunctionParams(node);
+ node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(27);
+ return node;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+
+ if (!res) {
+ return undefined;
+ }
+
+ return this.parseArrowExpression(res, null, true);
+ }
+
+ tsParseTypeArguments() {
+ const node = this.startNode();
+ node.params = this.tsInType(() => this.tsInNoContext(() => {
+ this.expectRelational("<");
+ return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
+ }));
+
+ if (node.params.length === 0) {
+ this.raise(node.start, TSErrors.EmptyTypeArguments);
+ }
+
+ this.expectRelational(">");
+ return this.finishNode(node, "TSTypeParameterInstantiation");
+ }
+
+ tsIsDeclarationStart() {
+ if (this.match(5)) {
+ switch (this.state.value) {
+ case "abstract":
+ case "declare":
+ case "enum":
+ case "interface":
+ case "module":
+ case "namespace":
+ case "type":
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let accessibility;
+ let readonly = false;
+ let override = false;
+
+ if (allowModifiers !== undefined) {
+ const modified = {};
+ this.tsParseModifiers(modified, ["public", "private", "protected", "override", "readonly"]);
+ accessibility = modified.accessibility;
+ override = modified.override;
+ readonly = modified.readonly;
+
+ if (allowModifiers === false && (accessibility || readonly || override)) {
+ this.raise(startPos, TSErrors.UnexpectedParameterModifier);
+ }
+ }
+
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (accessibility || readonly || override) {
+ const pp = this.startNodeAt(startPos, startLoc);
+
+ if (decorators.length) {
+ pp.decorators = decorators;
+ }
+
+ if (accessibility) pp.accessibility = accessibility;
+ if (readonly) pp.readonly = readonly;
+ if (override) pp.override = override;
+
+ if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
+ this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind);
+ }
+
+ pp.parameter = elt;
+ return this.finishNode(pp, "TSParameterProperty");
+ }
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(22)) {
+ node.returnType = this.tsParseTypeOrTypePredicateAnnotation(22);
+ }
+
+ const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined;
+
+ if (bodilessType && !this.match(13) && this.isLineTerminator()) {
+ this.finishNode(node, bodilessType);
+ return;
+ }
+
+ if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
+ this.raise(node.start, TSErrors.DeclareFunctionHasImplementation);
+
+ if (node.declare) {
+ super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);
+ return;
+ }
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkLVal(node.id, "function name", BIND_TS_AMBIENT);
+ } else {
+ super.registerFunctionStatementId(...arguments);
+ }
+ }
+
+ tsCheckForInvalidTypeCasts(items) {
+ items.forEach(node => {
+ if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") {
+ this.raise(node.typeAnnotation.start, TSErrors.UnexpectedTypeAnnotation);
+ }
+ });
+ }
+
+ toReferencedList(exprList, isInParens) {
+ this.tsCheckForInvalidTypeCasts(exprList);
+ return exprList;
+ }
+
+ parseArrayLike(...args) {
+ const node = super.parseArrayLike(...args);
+
+ if (node.type === "ArrayExpression") {
+ this.tsCheckForInvalidTypeCasts(node.elements);
+ }
+
+ return node;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!this.hasPrecedingLineBreak() && this.match(40)) {
+ this.state.exprAllowed = false;
+ this.next();
+ const nonNullExpression = this.startNodeAt(startPos, startLoc);
+ nonNullExpression.expression = base;
+ return this.finishNode(nonNullExpression, "TSNonNullExpression");
+ }
+
+ let isOptionalCall = false;
+
+ if (this.match(26) && this.lookaheadCharCode() === 60) {
+ if (noCalls) {
+ state.stop = true;
+ return base;
+ }
+
+ state.optionalChainMember = isOptionalCall = true;
+ this.next();
+ }
+
+ if (this.isRelational("<")) {
+ let missingParenErrorPos;
+ const result = this.tsTryParseAndCatch(() => {
+ if (!noCalls && this.atPossibleAsyncArrow(base)) {
+ const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
+
+ if (asyncArrowFn) {
+ return asyncArrowFn;
+ }
+ }
+
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (typeArguments) {
+ if (isOptionalCall && !this.match(18)) {
+ missingParenErrorPos = this.state.pos;
+ this.unexpected();
+ }
+
+ if (!noCalls && this.eat(18)) {
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ this.tsCheckForInvalidTypeCasts(node.arguments);
+ node.typeParameters = typeArguments;
+
+ if (state.optionalChainMember) {
+ node.optional = isOptionalCall;
+ }
+
+ return this.finishCallExpression(node, state.optionalChainMember);
+ } else if (this.match(30)) {
+ const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state);
+ result.typeParameters = typeArguments;
+ return result;
+ }
+ }
+
+ this.unexpected();
+ });
+
+ if (missingParenErrorPos) {
+ this.unexpected(missingParenErrorPos, 18);
+ }
+
+ if (result) return result;
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, state);
+ }
+
+ parseNewArguments(node) {
+ if (this.isRelational("<")) {
+ const typeParameters = this.tsTryParseAndCatch(() => {
+ const args = this.tsParseTypeArguments();
+ if (!this.match(18)) this.unexpected();
+ return args;
+ });
+
+ if (typeParameters) {
+ node.typeParameters = typeParameters;
+ }
+ }
+
+ super.parseNewArguments(node);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
+ if (tokenOperatorPrecedence(57) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) {
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.expression = left;
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ if (_const) {
+ node.typeAnnotation = _const;
+ } else {
+ node.typeAnnotation = this.tsNextThenParseType();
+ }
+
+ this.finishNode(node, "TSAsExpression");
+ this.reScan_lt_gt();
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);
+ }
+
+ return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec);
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {}
+
+ checkDuplicateExports() {}
+
+ parseImport(node) {
+ node.importKind = "value";
+
+ if (this.match(5) || this.match(54) || this.match(13)) {
+ let ahead = this.lookahead();
+
+ if (this.isContextual("type") && ahead.type !== 20 && !(ahead.type === 5 && ahead.value === "from") && ahead.type !== 35) {
+ node.importKind = "type";
+ this.next();
+ ahead = this.lookahead();
+ }
+
+ if (this.match(5) && ahead.type === 35) {
+ return this.tsParseImportEqualsDeclaration(node);
+ }
+ }
+
+ const importNode = super.parseImport(node);
+
+ if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
+ this.raise(importNode.start, TSErrors.TypeImportCannotSpecifyDefaultAndNamed);
+ }
+
+ return importNode;
+ }
+
+ parseExport(node) {
+ if (this.match(82)) {
+ this.next();
+
+ if (this.isContextual("type") && this.lookaheadCharCode() !== 61) {
+ node.importKind = "type";
+ this.next();
+ } else {
+ node.importKind = "value";
+ }
+
+ return this.tsParseImportEqualsDeclaration(node, true);
+ } else if (this.eat(35)) {
+ const assign = node;
+ assign.expression = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(assign, "TSExportAssignment");
+ } else if (this.eatContextual("as")) {
+ const decl = node;
+ this.expectContextual("namespace");
+ decl.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(decl, "TSNamespaceExportDeclaration");
+ } else {
+ if (this.isContextual("type") && this.lookahead().type === 13) {
+ this.next();
+ node.exportKind = "type";
+ } else {
+ node.exportKind = "value";
+ }
+
+ return super.parseExport(node);
+ }
+ }
+
+ isAbstractClass() {
+ return this.isContextual("abstract") && this.lookahead().type === 79;
+ }
+
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const cls = this.startNode();
+ this.next();
+ cls.abstract = true;
+ this.parseClass(cls, true, true);
+ return cls;
+ }
+
+ if (this.state.value === "interface") {
+ const interfaceNode = this.startNode();
+ this.next();
+ const result = this.tsParseInterfaceDeclaration(interfaceNode);
+ if (result) return result;
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseStatementContent(context, topLevel) {
+ if (this.state.type === 74) {
+ const ahead = this.lookahead();
+
+ if (ahead.type === 5 && ahead.value === "enum") {
+ const node = this.startNode();
+ this.expect(74);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(node, true);
+ }
+ }
+
+ return super.parseStatementContent(context, topLevel);
+ }
+
+ parseAccessModifier() {
+ return this.tsParseModifier(["public", "protected", "private"]);
+ }
+
+ tsHasSomeModifiers(member, modifiers) {
+ return modifiers.some(modifier => {
+ if (tsIsAccessModifier(modifier)) {
+ return member.accessibility === modifier;
+ }
+
+ return !!member[modifier];
+ });
+ }
+
+ tsIsStartOfStaticBlocks() {
+ return this.isContextual("static") && this.lookaheadCharCode() === 123;
+ }
+
+ parseClassMember(classBody, member, state) {
+ const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"];
+ this.tsParseModifiers(member, modifiers, undefined, undefined, true);
+
+ const callParseClassMemberWithIsStatic = () => {
+ if (this.tsIsStartOfStaticBlocks()) {
+ this.next();
+ this.next();
+
+ if (this.tsHasSomeModifiers(member, modifiers)) {
+ this.raise(this.state.pos, TSErrors.StaticBlockCannotHaveModifier);
+ }
+
+ this.parseClassStaticBlock(classBody, member);
+ } else {
+ this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);
+ }
+ };
+
+ if (member.declare) {
+ this.tsInAmbientContext(callParseClassMemberWithIsStatic);
+ } else {
+ callParseClassMemberWithIsStatic();
+ }
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const idx = this.tsTryParseIndexSignature(member);
+
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (member.abstract) {
+ this.raise(member.start, TSErrors.IndexSignatureHasAbstract);
+ }
+
+ if (member.accessibility) {
+ this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility);
+ }
+
+ if (member.declare) {
+ this.raise(member.start, TSErrors.IndexSignatureHasDeclare);
+ }
+
+ if (member.override) {
+ this.raise(member.start, TSErrors.IndexSignatureHasOverride);
+ }
+
+ return;
+ }
+
+ if (!this.state.inAbstractClass && member.abstract) {
+ this.raise(member.start, TSErrors.NonAbstractClassHasAbstractMethod);
+ }
+
+ if (member.override) {
+ if (!state.hadSuperClass) {
+ this.raise(member.start, TSErrors.OverrideNotInSubClass);
+ }
+ }
+
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(25);
+ if (optional) methodOrProp.optional = true;
+
+ if (methodOrProp.readonly && this.match(18)) {
+ this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly);
+ }
+
+ if (methodOrProp.declare && this.match(18)) {
+ this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare);
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
+ return decl || super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (!this.state.maybeInArrowParameters || !this.match(25)) {
+ return super.parseConditional(expr, startPos, startLoc, refExpressionErrors);
+ }
+
+ const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc));
+
+ if (!result.node) {
+ if (result.error) {
+ super.setOptionalParametersError(refExpressionErrors, result.error);
+ }
+
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(25)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(22)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TSTypeCastExpression");
+ }
+
+ return node;
+ }
+
+ parseExportDeclaration(node) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isDeclare = this.eatContextual("declare");
+
+ if (isDeclare && (this.isContextual("declare") || !this.shouldParseExportDeclaration())) {
+ throw this.raise(this.state.start, TSErrors.ExpectedAmbientAfterExportDeclare);
+ }
+
+ let declaration;
+
+ if (this.match(5)) {
+ declaration = this.tsTryParseExportDeclaration();
+ }
+
+ if (!declaration) {
+ declaration = super.parseExportDeclaration(node);
+ }
+
+ if (declaration && (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare)) {
+ node.exportKind = "type";
+ }
+
+ if (declaration && isDeclare) {
+ this.resetStartLocation(declaration, startPos, startLoc);
+ declaration.declare = true;
+ }
+
+ return declaration;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ if ((!isStatement || optionalId) && this.isContextual("implements")) {
+ return;
+ }
+
+ super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional && this.eat(40)) {
+ node.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+
+ if (this.state.isAmbientContext && this.match(35)) {
+ this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);
+ }
+
+ if (node.abstract && this.match(35)) {
+ const {
+ key
+ } = node;
+ this.raise(this.state.start, TSErrors.AbstractPropertyHasInitializer, key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`);
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(node.start, TSErrors.PrivateElementHasAbstract);
+ }
+
+ if (node.accessibility) {
+ this.raise(node.start, TSErrors.PrivateElementHasAccessibility, node.accessibility);
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ const typeParameters = this.tsTryParseTypeParameters();
+
+ if (typeParameters && isConstructor) {
+ this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters);
+ }
+
+ if (method.declare && (method.kind === "get" || method.kind === "set")) {
+ this.raise(method.start, TSErrors.DeclareAccessor, method.kind);
+ }
+
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.tsParseTypeArguments();
+ }
+
+ if (this.eatContextual("implements")) {
+ node.implements = this.tsParseHeritageClause("implements");
+ }
+ }
+
+ parseObjPropValue(prop, ...args) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) prop.typeParameters = typeParameters;
+ super.parseObjPropValue(prop, ...args);
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (decl.id.type === "Identifier" && this.eat(40)) {
+ decl.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ decl.id.typeAnnotation = type;
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(22)) {
+ node.returnType = this.tsParseTypeAnnotation();
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ parseMaybeAssign(...args) {
+ var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;
+
+ let state;
+ let jsx;
+ let typeCast;
+
+ if (this.hasPlugin("jsx") && (this.match(94) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (!((_jsx = jsx) != null && _jsx.error) && !this.isRelational("<")) {
+ return super.parseMaybeAssign(...args);
+ }
+
+ let typeParameters;
+ state = state || this.state.clone();
+ const arrow = this.tryParse(abort => {
+ var _expr$extra, _typeParameters;
+
+ typeParameters = this.tsParseTypeParameters();
+ const expr = super.parseMaybeAssign(...args);
+
+ if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
+ abort();
+ }
+
+ if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+
+ if (!jsx) {
+ assert(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if ((_typeCast = typeCast) != null && _typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error;
+ throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (!this.hasPlugin("jsx") && this.isRelational("<")) {
+ return this.tsParseTypeAssertion();
+ } else {
+ return super.parseMaybeUnary(refExpressionErrors);
+ }
+ }
+
+ parseArrow(node) {
+ if (this.match(22)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(22);
+ if (this.canInsertSemicolon() || !this.match(27)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+
+ return super.parseArrow(node);
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(25)) {
+ if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) {
+ this.raise(param.start, TSErrors.PatternIsOptional);
+ }
+
+ param.optional = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return this.isAssignable(node.expression, isBinding);
+
+ case "TSParameterProperty":
+ return true;
+
+ default:
+ return super.isAssignable(node, isBinding);
+ }
+ }
+
+ toAssignable(node, isLHS = false) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return super.toAssignable(this.typeCastToParameter(node), isLHS);
+
+ case "TSParameterProperty":
+ return super.toAssignable(node, isLHS);
+
+ case "ParenthesizedExpression":
+ return this.toAssignableParenthesizedExpression(node, isLHS);
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ node.expression = this.toAssignable(node.expression, isLHS);
+ return node;
+
+ default:
+ return super.toAssignable(node, isLHS);
+ }
+ }
+
+ toAssignableParenthesizedExpression(node, isLHS) {
+ switch (node.expression.type) {
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ case "ParenthesizedExpression":
+ node.expression = this.toAssignable(node.expression, isLHS);
+ return node;
+
+ default:
+ return super.toAssignable(node, isLHS);
+ }
+ }
+
+ checkLVal(expr, contextDescription, ...args) {
+ var _expr$extra2;
+
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ return;
+
+ case "TSParameterProperty":
+ this.checkLVal(expr.parameter, "parameter property", ...args);
+ return;
+
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ if (!args[0] && contextDescription !== "parenthesized expression" && !((_expr$extra2 = expr.extra) != null && _expr$extra2.parenthesized)) {
+ this.raise(expr.start, ErrorMessages.InvalidLhs, contextDescription);
+ break;
+ }
+
+ this.checkLVal(expr.expression, "parenthesized expression", ...args);
+ return;
+
+ case "TSNonNullExpression":
+ this.checkLVal(expr.expression, contextDescription, ...args);
+ return;
+
+ default:
+ super.checkLVal(expr, contextDescription, ...args);
+ return;
+ }
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 77:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (this.match(18)) {
+ const call = super.parseMaybeDecoratorArguments(expr);
+ call.typeParameters = typeArguments;
+ return call;
+ }
+
+ this.unexpected(this.state.start, 18);
+ }
+
+ return super.parseMaybeDecoratorArguments(expr);
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.state.isAmbientContext && this.match(20) && this.lookaheadCharCode() === close) {
+ this.next();
+ } else {
+ super.checkCommaAfterRest(close);
+ }
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(40) || this.match(22) || super.isClassProperty();
+ }
+
+ parseMaybeDefault(...args) {
+ const node = super.parseMaybeDefault(...args);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, TSErrors.TypeAnnotationAfterAssign);
+ }
+
+ return node;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(50, 1);
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ reScan_lt_gt() {
+ if (this.match(50)) {
+ const code = this.input.charCodeAt(this.state.start);
+
+ if (code === 60 || code === 62) {
+ this.state.pos -= 1;
+ this.readToken_lt_gt(code);
+ }
+ }
+ }
+
+ toAssignableList(exprList) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+ if (!expr) continue;
+
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ exprList[i] = this.typeCastToParameter(expr);
+ break;
+
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ if (!this.state.maybeInArrowParameters) {
+ exprList[i] = this.typeCastToParameter(expr);
+ } else {
+ this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter);
+ }
+
+ break;
+ }
+ }
+
+ return super.toAssignableList(...arguments);
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ shouldParseArrow(params) {
+ if (this.match(22)) {
+ return params.every(expr => this.isAssignable(expr, true));
+ }
+
+ return super.shouldParseArrow(params);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(22) || super.shouldParseAsyncArrow();
+ }
+
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments());
+ if (typeArguments) node.typeParameters = typeArguments;
+ }
+
+ return super.jsxParseOpeningElementAfterName(node);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ const baseCount = super.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ const firstParam = params[0];
+ const hasContextParam = firstParam && this.isThisParam(firstParam);
+ return hasContextParam ? baseCount + 1 : baseCount;
+ }
+
+ parseCatchClauseParam() {
+ const param = super.parseCatchClauseParam();
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ }
+
+ return param;
+ }
+
+ tsInAmbientContext(cb) {
+ const oldIsAmbientContext = this.state.isAmbientContext;
+ this.state.isAmbientContext = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.isAmbientContext = oldIsAmbientContext;
+ }
+ }
+
+ parseClass(node, ...args) {
+ const oldInAbstractClass = this.state.inAbstractClass;
+ this.state.inAbstractClass = !!node.abstract;
+
+ try {
+ return super.parseClass(node, ...args);
+ } finally {
+ this.state.inAbstractClass = oldInAbstractClass;
+ }
+ }
+
+ tsParseAbstractDeclaration(node) {
+ if (this.match(79)) {
+ node.abstract = true;
+ return this.parseClass(node, true, false);
+ } else if (this.isContextual("interface")) {
+ if (!this.hasFollowingLineBreak()) {
+ node.abstract = true;
+ this.raise(node.start, TSErrors.NonClassMethodPropertyHasAbstractModifer);
+ this.next();
+ return this.tsParseInterfaceDeclaration(node);
+ }
+ } else {
+ this.unexpected(null, 79);
+ }
+ }
+
+ parseMethod(...args) {
+ const method = super.parseMethod(...args);
+
+ if (method.abstract) {
+ const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
+
+ if (hasBody) {
+ const {
+ key
+ } = method;
+ this.raise(method.start, TSErrors.AbstractMethodHasImplementation, key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`);
+ }
+ }
+
+ return method;
+ }
+
+ tsParseTypeParameterName() {
+ const typeName = this.parseIdentifier();
+ return typeName.name;
+ }
+
+ shouldParseAsAmbientContext() {
+ return !!this.getPluginOption("typescript", "dts");
+ }
+
+ parse() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+
+ return super.parse();
+ }
+
+ getExpression() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+
+ return super.getExpression();
+ }
+
+ });
+
+ const PlaceHolderErrors = makeErrorTemplates({
+ ClassNameIsRequired: "A class name is required."
+ }, ErrorCodes.SyntaxError);
+ var placeholders = (superClass => class extends superClass {
+ parsePlaceholder(expectedNode) {
+ if (this.match(96)) {
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace("Unexpected space in placeholder.");
+ node.name = super.parseIdentifier(true);
+ this.assertNoSpace("Unexpected space in placeholder.");
+ this.expect(96);
+ return this.finishPlaceholder(node, expectedNode);
+ }
+ }
+
+ finishPlaceholder(node, expectedNode) {
+ const isFinished = !!(node.expectedNode && node.type === "Placeholder");
+ node.expectedNode = expectedNode;
+ return isFinished ? node : this.finishNode(node, "Placeholder");
+ }
+
+ getTokenFromCode(code) {
+ if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ return this.finishOp(96, 2);
+ }
+
+ return super.getTokenFromCode(...arguments);
+ }
+
+ parseExprAtom() {
+ return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments);
+ }
+
+ parseIdentifier() {
+ return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments);
+ }
+
+ checkReservedWord(word) {
+ if (word !== undefined) super.checkReservedWord(...arguments);
+ }
+
+ parseBindingAtom() {
+ return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments);
+ }
+
+ checkLVal(expr) {
+ if (expr.type !== "Placeholder") super.checkLVal(...arguments);
+ }
+
+ toAssignable(node) {
+ if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
+ node.expectedNode = "Pattern";
+ return node;
+ }
+
+ return super.toAssignable(...arguments);
+ }
+
+ isLet(context) {
+ if (super.isLet(context)) {
+ return true;
+ }
+
+ if (!this.isContextual("let")) {
+ return false;
+ }
+
+ if (context) return false;
+ const nextToken = this.lookahead();
+
+ if (nextToken.type === 96) {
+ return true;
+ }
+
+ return false;
+ }
+
+ verifyBreakContinue(node) {
+ if (node.label && node.label.type === "Placeholder") return;
+ super.verifyBreakContinue(...arguments);
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
+ return super.parseExpressionStatement(...arguments);
+ }
+
+ if (this.match(22)) {
+ const stmt = node;
+ stmt.label = this.finishPlaceholder(expr, "Identifier");
+ this.next();
+ stmt.body = this.parseStatement("label");
+ return this.finishNode(stmt, "LabeledStatement");
+ }
+
+ this.semicolon();
+ node.name = expr.name;
+ return this.finishPlaceholder(node, "Statement");
+ }
+
+ parseBlock() {
+ return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments);
+ }
+
+ parseFunctionId() {
+ return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ const type = isStatement ? "ClassDeclaration" : "ClassExpression";
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ const placeholder = this.parsePlaceholder("Identifier");
+
+ if (placeholder) {
+ if (this.match(80) || this.match(96) || this.match(13)) {
+ node.id = placeholder;
+ } else if (optionalId || !isStatement) {
+ node.id = null;
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
+ return this.finishNode(node, type);
+ } else {
+ this.unexpected(null, PlaceHolderErrors.ClassNameIsRequired);
+ }
+ } else {
+ this.parseClassId(node, isStatement, optionalId);
+ }
+
+ this.parseClassSuper(node);
+ node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, type);
+ }
+
+ parseExport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseExport(...arguments);
+
+ if (!this.isContextual("from") && !this.match(20)) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.finishPlaceholder(placeholder, "Declaration");
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = placeholder;
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return super.parseExport(node);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(64)) {
+ const next = this.nextTokenStart();
+
+ if (this.isUnparsedContextual(next, "from")) {
+ if (this.input.startsWith(tokenLabelName(96), this.nextTokenStartSince(next + 4))) {
+ return true;
+ }
+ }
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (node.specifiers && node.specifiers.length > 0) {
+ return true;
+ }
+
+ return super.maybeParseExportDefaultSpecifier(...arguments);
+ }
+
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+
+ if (specifiers != null && specifiers.length) {
+ node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
+ }
+
+ super.checkExport(node);
+ node.specifiers = specifiers;
+ }
+
+ parseImport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseImport(...arguments);
+ node.specifiers = [];
+
+ if (!this.isContextual("from") && !this.match(20)) {
+ node.source = this.finishPlaceholder(placeholder, "StringLiteral");
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ const specifier = this.startNodeAtNode(placeholder);
+ specifier.local = placeholder;
+ this.finishNode(specifier, "ImportDefaultSpecifier");
+ node.specifiers.push(specifier);
+
+ if (this.eat(20)) {
+ const hasStarImport = this.maybeParseStarImportSpecifier(node);
+ if (!hasStarImport) this.parseNamedImportSpecifiers(node);
+ }
+
+ this.expectContextual("from");
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments);
+ }
+
+ });
+
+ var v8intrinsic = (superClass => class extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(53)) {
+ const v8IntrinsicStart = this.state.start;
+ const node = this.startNode();
+ this.eat(53);
+
+ if (this.match(5)) {
+ const name = this.parseIdentifierName(this.state.start);
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+
+ if (this.match(18)) {
+ return identifier;
+ }
+ }
+
+ this.unexpected(v8IntrinsicStart);
+ }
+ }
+
+ parseExprAtom() {
+ return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);
+ }
+
+ });
+
+ function hasPlugin(plugins, name) {
+ return plugins.some(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+ }
+ function getPluginOption(plugins, name, option) {
+ const plugin = plugins.find(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+
+ if (plugin && Array.isArray(plugin)) {
+ return plugin[1][option];
+ }
+
+ return null;
+ }
+ const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
+ const TOPIC_TOKENS = ["%", "#"];
+ const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
+ function validatePlugins(plugins) {
+ if (hasPlugin(plugins, "decorators")) {
+ if (hasPlugin(plugins, "decorators-legacy")) {
+ throw new Error("Cannot use the decorators and decorators-legacy plugin together");
+ }
+
+ const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
+
+ if (decoratorsBeforeExport == null) {
+ throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
+ } else if (typeof decoratorsBeforeExport !== "boolean") {
+ throw new Error("'decoratorsBeforeExport' must be a boolean.");
+ }
+ }
+
+ if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
+ throw new Error("Cannot combine flow and typescript plugins.");
+ }
+
+ if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
+ }
+
+ if (hasPlugin(plugins, "pipelineOperator")) {
+ const proposal = getPluginOption(plugins, "pipelineOperator", "proposal");
+
+ if (!PIPELINE_PROPOSALS.includes(proposal)) {
+ const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
+ throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
+ }
+
+ const tupleSyntaxIsHash = hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") === "hash";
+
+ if (proposal === "hack") {
+ if (hasPlugin(plugins, "placeholders")) {
+ throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
+ }
+
+ if (hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
+ }
+
+ const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken");
+
+ if (!TOPIC_TOKENS.includes(topicToken)) {
+ const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
+ throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
+ }
+
+ if (topicToken === "#" && tupleSyntaxIsHash) {
+ throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
+ }
+ } else if (proposal === "smart" && tupleSyntaxIsHash) {
+ throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
+ }
+ }
+
+ if (hasPlugin(plugins, "moduleAttributes")) {
+ {
+ if (hasPlugin(plugins, "importAssertions")) {
+ throw new Error("Cannot combine importAssertions and moduleAttributes plugins.");
+ }
+
+ const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
+
+ if (moduleAttributesVerionPluginOption !== "may-2020") {
+ throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
+ }
+ }
+ }
+
+ if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
+ throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
+ }
+
+ if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) {
+ const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
+ error.missingPlugins = "doExpressions";
+ throw error;
+ }
+ }
+ const mixinPlugins = {
+ estree,
+ jsx: jsx$1,
+ flow: flow$1,
+ typescript: typescript$1,
+ v8intrinsic,
+ placeholders
+ };
+ const mixinPluginNames = Object.keys(mixinPlugins);
+
+ const defaultOptions = {
+ sourceType: "script",
+ sourceFilename: undefined,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false,
+ attachComment: true
+ };
+ function getOptions(opts) {
+ const options = {};
+
+ for (const key of Object.keys(defaultOptions)) {
+ options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
+ }
+
+ return options;
+ }
+
+ const unwrapParenthesizedExpression = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
+ };
+
+ class LValParser extends NodeUtils {
+ toAssignable(node, isLHS = false) {
+ var _node$extra, _node$extra3;
+
+ let parenthesized = undefined;
+
+ if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
+ parenthesized = unwrapParenthesizedExpression(node);
+
+ if (isLHS) {
+ if (parenthesized.type === "Identifier") {
+ this.expressionScope.recordParenthesizedIdentifierError(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ } else if (parenthesized.type !== "MemberExpression") {
+ this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ }
+ } else {
+ this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ }
+ }
+
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ break;
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+
+ for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
+ var _node$extra2;
+
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
+
+ if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingComma) {
+ this.raiseRestNotLast(node.extra.trailingComma);
+ }
+ }
+
+ break;
+
+ case "ObjectProperty":
+ this.toAssignable(node.value, isLHS);
+ break;
+
+ case "SpreadElement":
+ {
+ this.checkToRestConversion(node);
+ node.type = "RestElement";
+ const arg = node.argument;
+ this.toAssignable(arg, isLHS);
+ break;
+ }
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma, isLHS);
+ break;
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(node.left.end, ErrorMessages.MissingEqInAssignment);
+ }
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isLHS);
+ break;
+
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized, isLHS);
+ break;
+ }
+
+ return node;
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast, isLHS) {
+ if (prop.type === "ObjectMethod") {
+ const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod;
+ this.raise(prop.key.start, error);
+ } else if (prop.type === "SpreadElement" && !isLast) {
+ this.raiseRestNotLast(prop.start);
+ } else {
+ this.toAssignable(prop, isLHS);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos, isLHS) {
+ let end = exprList.length;
+
+ if (end) {
+ const last = exprList[end - 1];
+
+ if ((last == null ? void 0 : last.type) === "RestElement") {
+ --end;
+ } else if ((last == null ? void 0 : last.type) === "SpreadElement") {
+ last.type = "RestElement";
+ let arg = last.argument;
+ this.toAssignable(arg, isLHS);
+ arg = unwrapParenthesizedExpression(arg);
+
+ if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
+ this.unexpected(arg.start);
+ }
+
+ if (trailingCommaPos) {
+ this.raiseTrailingCommaAfterRest(trailingCommaPos);
+ }
+
+ --end;
+ }
+ }
+
+ for (let i = 0; i < end; i++) {
+ const elt = exprList[i];
+
+ if (elt) {
+ this.toAssignable(elt, isLHS);
+
+ if (elt.type === "RestElement") {
+ this.raiseRestNotLast(elt.start);
+ }
+ }
+ }
+
+ return exprList;
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ return true;
+
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => element === null || this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ return exprList;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ this.toReferencedList(exprList, isParenthesizedExpr);
+
+ for (const expr of exprList) {
+ if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+
+ parseSpread(refExpressionErrors, refNeedsArrowPos) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos);
+ return this.finishNode(node, "SpreadElement");
+ }
+
+ parseRestBinding() {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseBindingAtom();
+ return this.finishNode(node, "RestElement");
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 8:
+ {
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(11, 93, true);
+ return this.finishNode(node, "ArrayPattern");
+ }
+
+ case 13:
+ return this.parseObjectLike(16, true);
+ }
+
+ return this.parseIdentifier();
+ }
+
+ parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+ }
+
+ if (allowEmpty && this.match(20)) {
+ elts.push(null);
+ } else if (this.eat(close)) {
+ break;
+ } else if (this.match(29)) {
+ elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
+ this.checkCommaAfterRest(closeCharCode);
+ this.expect(close);
+ break;
+ } else {
+ const decorators = [];
+
+ if (this.match(32) && this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator);
+ }
+
+ while (this.match(32)) {
+ decorators.push(this.parseDecorator());
+ }
+
+ elts.push(this.parseAssignableListItem(allowModifiers, decorators));
+ }
+ }
+
+ return elts;
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseAssignableListItemTypes(param) {
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ var _startLoc, _startPos, _left;
+
+ startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc;
+ startPos = (_startPos = startPos) != null ? _startPos : this.state.start;
+ left = (_left = left) != null ? _left : this.parseBindingAtom();
+ if (!this.eat(35)) return left;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssignAllowIn();
+ return this.finishNode(node, "AssignmentPattern");
+ }
+
+ checkLVal(expr, contextDescription, bindingType = BIND_NONE, checkClashes, disallowLetBinding, strictModeChanged = false) {
+ switch (expr.type) {
+ case "Identifier":
+ {
+ const {
+ name
+ } = expr;
+
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(name, this.inModule) : isStrictBindOnlyReservedWord(name))) {
+ this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, name);
+ }
+
+ if (checkClashes) {
+ if (checkClashes.has(name)) {
+ this.raise(expr.start, ErrorMessages.ParamDupe);
+ } else {
+ checkClashes.add(name);
+ }
+ }
+
+ if (disallowLetBinding && name === "let") {
+ this.raise(expr.start, ErrorMessages.LetInLexicalBinding);
+ }
+
+ if (!(bindingType & BIND_NONE)) {
+ this.scope.declareName(name, bindingType, expr.start);
+ }
+
+ break;
+ }
+
+ case "MemberExpression":
+ if (bindingType !== BIND_NONE) {
+ this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern);
+ }
+
+ break;
+
+ case "ObjectPattern":
+ for (let prop of expr.properties) {
+ if (this.isObjectProperty(prop)) prop = prop.value;else if (this.isObjectMethod(prop)) continue;
+ this.checkLVal(prop, "object destructuring pattern", bindingType, checkClashes, disallowLetBinding);
+ }
+
+ break;
+
+ case "ArrayPattern":
+ for (const elem of expr.elements) {
+ if (elem) {
+ this.checkLVal(elem, "array destructuring pattern", bindingType, checkClashes, disallowLetBinding);
+ }
+ }
+
+ break;
+
+ case "AssignmentPattern":
+ this.checkLVal(expr.left, "assignment pattern", bindingType, checkClashes);
+ break;
+
+ case "RestElement":
+ this.checkLVal(expr.argument, "rest element", bindingType, checkClashes);
+ break;
+
+ case "ParenthesizedExpression":
+ this.checkLVal(expr.expression, "parenthesized expression", bindingType, checkClashes);
+ break;
+
+ default:
+ {
+ this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.InvalidLhs : ErrorMessages.InvalidLhsBinding, contextDescription);
+ }
+ }
+ }
+
+ checkToRestConversion(node) {
+ if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
+ this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern);
+ }
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.match(20)) {
+ if (this.lookaheadCharCode() === close) {
+ this.raiseTrailingCommaAfterRest(this.state.start);
+ } else {
+ this.raiseRestNotLast(this.state.start);
+ }
+ }
+ }
+
+ raiseRestNotLast(pos) {
+ throw this.raise(pos, ErrorMessages.ElementAfterRest);
+ }
+
+ raiseTrailingCommaAfterRest(pos) {
+ this.raise(pos, ErrorMessages.RestTrailingComma);
+ }
+
+ }
+
+ const invalidHackPipeBodies = new Map([["ArrowFunctionExpression", "arrow function"], ["AssignmentExpression", "assignment"], ["ConditionalExpression", "conditional"], ["YieldExpression", "yield"]]);
+ class ExpressionParser extends LValParser {
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : key.value;
+
+ if (name === "__proto__") {
+ if (isRecord) {
+ this.raise(key.start, ErrorMessages.RecordNoProto);
+ return;
+ }
+
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProto === -1) {
+ refExpressionErrors.doubleProto = key.start;
+ }
+ } else {
+ this.raise(key.start, ErrorMessages.DuplicateProto);
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ shouldExitDescending(expr, potentialArrowAt) {
+ return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
+ }
+
+ getExpression() {
+ this.enterInitialScopes();
+ this.nextToken();
+ const expr = this.parseExpression();
+
+ if (!this.match(7)) {
+ this.unexpected();
+ }
+
+ this.finalizeRemainingComments();
+ expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
+
+ if (this.options.tokens) {
+ expr.tokens = this.tokens;
+ }
+
+ return expr;
+ }
+
+ parseExpression(disallowIn, refExpressionErrors) {
+ if (disallowIn) {
+ return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+
+ return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+
+ parseExpressionBase(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(refExpressionErrors);
+
+ if (this.match(20)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+
+ while (this.eat(20)) {
+ node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
+ }
+
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
+ return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+
+ parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
+ return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+
+ setOptionalParametersError(refExpressionErrors, resultError) {
+ var _resultError$pos;
+
+ refExpressionErrors.optionalParameters = (_resultError$pos = resultError == null ? void 0 : resultError.pos) != null ? _resultError$pos : this.state.start;
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ if (this.isContextual("yield")) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield();
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ return left;
+ }
+ }
+
+ let ownExpressionErrors;
+
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors();
+ ownExpressionErrors = true;
+ }
+
+ if (this.match(18) || this.match(5)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+
+ let left = this.parseMaybeConditional(refExpressionErrors);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ if (tokenIsAssignment(this.state.type)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const operator = this.state.value;
+ node.operator = operator;
+
+ if (this.match(35)) {
+ node.left = this.toAssignable(left, true);
+ refExpressionErrors.doubleProto = -1;
+ } else {
+ node.left = left;
+ }
+
+ if (refExpressionErrors.shorthandAssign >= node.left.start) {
+ refExpressionErrors.shorthandAssign = -1;
+ }
+
+ this.checkLVal(left, "assignment expression");
+ this.next();
+ node.right = this.parseMaybeAssign();
+ return this.finishNode(node, "AssignmentExpression");
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ return left;
+ }
+
+ parseMaybeConditional(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseConditional(expr, startPos, startLoc, refExpressionErrors);
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (this.eat(25)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssignAllowIn();
+ this.expect(22);
+ node.alternate = this.parseMaybeAssign();
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeUnaryOrPrivate(refExpressionErrors) {
+ return this.match(6) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
+ }
+
+ parseExprOps(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseExprOp(expr, startPos, startLoc, -1);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
+ if (this.isPrivateName(left)) {
+ const value = this.getPrivateNameSV(left);
+ const {
+ start
+ } = left;
+
+ if (minPrec >= tokenOperatorPrecedence(57) || !this.prodParam.hasIn || !this.match(57)) {
+ this.raise(start, ErrorMessages.PrivateInExpectedIn, value);
+ }
+
+ this.classScope.usePrivateName(value, start);
+ }
+
+ const op = this.state.type;
+
+ if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(57))) {
+ let prec = tokenOperatorPrecedence(op);
+
+ if (prec > minPrec) {
+ if (op === 42) {
+ this.expectPlugin("pipelineOperator");
+
+ if (this.state.inFSharpPipelineDirectBody) {
+ return left;
+ }
+
+ this.checkPipelineAtInfixOperator(left, leftStartPos);
+ }
+
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.left = left;
+ node.operator = this.state.value;
+ const logical = op === 44 || op === 45;
+ const coalesce = op === 43;
+
+ if (coalesce) {
+ prec = tokenOperatorPrecedence(45);
+ }
+
+ this.next();
+
+ if (op === 42 && this.getPluginOption("pipelineOperator", "proposal") === "minimal") {
+ if (this.match(5) && this.state.value === "await" && this.prodParam.hasAwait) {
+ throw this.raise(this.state.start, ErrorMessages.UnexpectedAwaitAfterPipelineBody);
+ }
+ }
+
+ node.right = this.parseExprOpRightExpr(op, prec);
+ this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+
+ if (coalesce && (nextOp === 44 || nextOp === 45) || logical && nextOp === 43) {
+ throw this.raise(this.state.start, ErrorMessages.MixingCoalesceWithLogical);
+ }
+
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);
+ }
+ }
+
+ return left;
+ }
+
+ parseExprOpRightExpr(op, prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ switch (op) {
+ case 42:
+ switch (this.getPluginOption("pipelineOperator", "proposal")) {
+ case "hack":
+ return this.withTopicBindingContext(() => {
+ return this.parseHackPipeBody();
+ });
+
+ case "smart":
+ return this.withTopicBindingContext(() => {
+ if (this.prodParam.hasYield && this.isContextual("yield")) {
+ throw this.raise(this.state.start, ErrorMessages.PipeBodyIsTighter, this.state.value);
+ }
+
+ return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc);
+ });
+
+ case "fsharp":
+ return this.withSoloAwaitPermittingContext(() => {
+ return this.parseFSharpPipelineBody(prec);
+ });
+ }
+
+ default:
+ return this.parseExprOpBaseRightExpr(op, prec);
+ }
+ }
+
+ parseExprOpBaseRightExpr(op, prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
+ }
+
+ parseHackPipeBody() {
+ var _body$extra;
+
+ const {
+ start
+ } = this.state;
+ const body = this.parseMaybeAssign();
+
+ if (invalidHackPipeBodies.has(body.type) && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
+ this.raise(start, ErrorMessages.PipeUnparenthesizedBody, invalidHackPipeBodies.get(body.type));
+ }
+
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(start, ErrorMessages.PipeTopicUnused);
+ }
+
+ return body;
+ }
+
+ checkExponentialAfterUnary(node) {
+ if (this.match(56)) {
+ this.raise(node.argument.start, ErrorMessages.UnexpectedTokenUnaryExponentiation);
+ }
+ }
+
+ parseMaybeUnary(refExpressionErrors, sawUnary) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isAwait = this.isContextual("await");
+
+ if (isAwait && this.isAwaitAllowed()) {
+ this.next();
+ const expr = this.parseAwait(startPos, startLoc);
+ if (!sawUnary) this.checkExponentialAfterUnary(expr);
+ return expr;
+ }
+
+ const update = this.match(39);
+ const node = this.startNode();
+
+ if (tokenIsPrefix(this.state.type)) {
+ node.operator = this.state.value;
+ node.prefix = true;
+
+ if (this.match(71)) {
+ this.expectPlugin("throwExpressions");
+ }
+
+ const isDelete = this.match(88);
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true);
+ this.checkExpressionErrors(refExpressionErrors, true);
+
+ if (this.state.strict && isDelete) {
+ const arg = node.argument;
+
+ if (arg.type === "Identifier") {
+ this.raise(node.start, ErrorMessages.StrictDelete);
+ } else if (this.hasPropertyAsPrivateName(arg)) {
+ this.raise(node.start, ErrorMessages.DeletePrivateField);
+ }
+ }
+
+ if (!update) {
+ if (!sawUnary) this.checkExponentialAfterUnary(node);
+ return this.finishNode(node, "UnaryExpression");
+ }
+ }
+
+ const expr = this.parseUpdate(node, update, refExpressionErrors);
+
+ if (isAwait) {
+ const {
+ type
+ } = this.state;
+ const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(53);
+
+ if (startsExpr && !this.isAmbiguousAwait()) {
+ this.raiseOverwrite(startPos, ErrorMessages.AwaitNotInAsyncContext);
+ return this.parseAwait(startPos, startLoc);
+ }
+ }
+
+ return expr;
+ }
+
+ parseUpdate(node, update, refExpressionErrors) {
+ if (update) {
+ this.checkLVal(node.argument, "prefix operation");
+ return this.finishNode(node, "UpdateExpression");
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+
+ while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.state.value;
+ node.prefix = false;
+ node.argument = expr;
+ this.checkLVal(expr, "postfix operation");
+ this.next();
+ expr = this.finishNode(node, "UpdateExpression");
+ }
+
+ return expr;
+ }
+
+ parseExprSubscripts(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseSubscripts(expr, startPos, startLoc);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(base),
+ stop: false
+ };
+
+ do {
+ base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ } while (!state.stop);
+
+ return base;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!noCalls && this.eat(23)) {
+ return this.parseBind(base, startPos, startLoc, noCalls, state);
+ } else if (this.match(30)) {
+ return this.parseTaggedTemplateExpression(base, startPos, startLoc, state);
+ }
+
+ let optional = false;
+
+ if (this.match(26)) {
+ if (noCalls && this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+
+ state.optionalChainMember = optional = true;
+ this.next();
+ }
+
+ if (!noCalls && this.match(18)) {
+ return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional);
+ } else {
+ const computed = this.eat(8);
+
+ if (computed || optional || this.eat(24)) {
+ return this.parseMember(base, startPos, startLoc, state, computed, optional);
+ } else {
+ state.stop = true;
+ return base;
+ }
+ }
+ }
+
+ parseMember(base, startPos, startLoc, state, computed, optional) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.computed = computed;
+ const privateName = !computed && this.match(6) && this.state.value;
+ const property = computed ? this.parseExpression() : privateName ? this.parsePrivateName() : this.parseIdentifier(true);
+
+ if (privateName !== false) {
+ if (node.object.type === "Super") {
+ this.raise(startPos, ErrorMessages.SuperPrivateField);
+ }
+
+ this.classScope.usePrivateName(privateName, property.start);
+ }
+
+ node.property = property;
+
+ if (computed) {
+ this.expect(11);
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ return this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ parseBind(base, startPos, startLoc, noCalls, state) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.callee = this.parseNoCallExpr();
+ state.stop = true;
+ return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
+ }
+
+ parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ let refExpressionErrors = null;
+ this.state.maybeInArrowParameters = true;
+ this.next();
+ let node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+
+ if (state.maybeAsyncArrow) {
+ this.expressionScope.enter(newAsyncArrowScope());
+ refExpressionErrors = new ExpressionErrors();
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ }
+
+ if (optional) {
+ node.arguments = this.parseCallExpressionArguments(19);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(19, base.type === "Import", base.type !== "Super", node, refExpressionErrors);
+ }
+
+ this.finishCallExpression(node, state.optionalChainMember);
+
+ if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
+ } else {
+ if (state.maybeAsyncArrow) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.expressionScope.exit();
+ }
+
+ this.toReferencedArguments(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ }
+
+ toReferencedArguments(node, isParenthesizedExpr) {
+ this.toReferencedListDeep(node.arguments, isParenthesizedExpr);
+ }
+
+ parseTaggedTemplateExpression(base, startPos, startLoc, state) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.tag = base;
+ node.quasi = this.parseTemplate(true);
+
+ if (state.optionalChainMember) {
+ this.raise(startPos, ErrorMessages.OptionalChainingNoTemplate);
+ }
+
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+
+ atPossibleAsyncArrow(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
+ }
+
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length === 2) {
+ {
+ if (!this.hasPlugin("moduleAttributes")) {
+ this.expectPlugin("importAssertions");
+ }
+ }
+ }
+
+ if (node.arguments.length === 0 || node.arguments.length > 2) {
+ this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument");
+ } else {
+ for (const arg of node.arguments) {
+ if (arg.type === "SpreadElement") {
+ this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument);
+ }
+ }
+ }
+ }
+
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+
+ parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) {
+ const elts = [];
+ let first = true;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+
+ if (this.match(close)) {
+ if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {
+ this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma);
+ }
+
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return elts;
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(27) && !this.canInsertSemicolon();
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ var _call$extra;
+
+ this.resetPreviousNodeTrailingComments(call);
+ this.expect(27);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);
+ setInnerComments(node, call.innerComments);
+ setInnerComments(node, call.callee.trailingComments);
+ return node;
+ }
+
+ parseNoCallExpr() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ let node;
+
+ switch (this.state.type) {
+ case 78:
+ return this.parseSuper();
+
+ case 82:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(24)) {
+ return this.parseImportMetaProperty(node);
+ }
+
+ if (!this.match(18)) {
+ this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport);
+ }
+
+ return this.finishNode(node, "Import");
+
+ case 77:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression");
+
+ case 5:
+ {
+ if (this.isContextual("module") && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) {
+ return this.parseModuleExpression();
+ }
+
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ const containsEsc = this.state.containsEsc;
+ const id = this.parseIdentifier();
+
+ if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
+ if (this.match(67)) {
+ this.resetPreviousNodeTrailingComments(id);
+ this.next();
+ return this.parseFunction(this.startNodeAtNode(id), undefined, true);
+ } else if (this.match(5)) {
+ if (this.lookaheadCharCode() === 61) {
+ return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
+ } else {
+ return id;
+ }
+ } else if (this.match(89)) {
+ this.resetPreviousNodeTrailingComments(id);
+ return this.parseDo(this.startNodeAtNode(id), true);
+ }
+ }
+
+ if (canBeArrow && this.match(27) && !this.canInsertSemicolon()) {
+ this.next();
+ return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
+ }
+
+ return id;
+ }
+
+ case 89:
+ {
+ return this.parseDo(this.startNode(), false);
+ }
+
+ case 55:
+ case 37:
+ {
+ this.readRegexp();
+ return this.parseRegExpLiteral(this.state.value);
+ }
+
+ case 0:
+ return this.parseNumericLiteral(this.state.value);
+
+ case 1:
+ return this.parseBigIntLiteral(this.state.value);
+
+ case 2:
+ return this.parseDecimalLiteral(this.state.value);
+
+ case 4:
+ return this.parseStringLiteral(this.state.value);
+
+ case 83:
+ return this.parseNullLiteral();
+
+ case 84:
+ return this.parseBooleanLiteral(true);
+
+ case 85:
+ return this.parseBooleanLiteral(false);
+
+ case 18:
+ {
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ return this.parseParenAndDistinguishExpression(canBeArrow);
+ }
+
+ case 10:
+ case 9:
+ {
+ return this.parseArrayLike(this.state.type === 10 ? 12 : 11, false, true, refExpressionErrors);
+ }
+
+ case 8:
+ {
+ return this.parseArrayLike(11, true, false, refExpressionErrors);
+ }
+
+ case 14:
+ case 15:
+ {
+ return this.parseObjectLike(this.state.type === 14 ? 17 : 16, false, true, refExpressionErrors);
+ }
+
+ case 13:
+ {
+ return this.parseObjectLike(16, false, false, refExpressionErrors);
+ }
+
+ case 67:
+ return this.parseFunctionOrFunctionSent();
+
+ case 32:
+ this.parseDecorators();
+
+ case 79:
+ node = this.startNode();
+ this.takeDecorators(node);
+ return this.parseClass(node, false);
+
+ case 76:
+ return this.parseNewOrNewTarget();
+
+ case 30:
+ return this.parseTemplate(false);
+
+ case 23:
+ {
+ node = this.startNode();
+ this.next();
+ node.object = null;
+ const callee = node.callee = this.parseNoCallExpr();
+
+ if (callee.type === "MemberExpression") {
+ return this.finishNode(node, "BindExpression");
+ } else {
+ throw this.raise(callee.start, ErrorMessages.UnsupportedBind);
+ }
+ }
+
+ case 6:
+ {
+ this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, this.state.value);
+ return this.parsePrivateName();
+ }
+
+ case 38:
+ if (this.getPluginOption("pipelineOperator", "proposal") === "hack" && this.getPluginOption("pipelineOperator", "topicToken") === "%") {
+ this.state.value = "%";
+ this.state.type = 53;
+ this.state.pos--;
+ this.state.end--;
+ this.state.endLoc.column--;
+ } else {
+ throw this.unexpected();
+ }
+
+ case 53:
+ case 33:
+ {
+ const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
+
+ if (pipeProposal) {
+ node = this.startNode();
+ const start = this.state.start;
+ const tokenType = this.state.type;
+ this.next();
+ return this.finishTopicReference(node, start, pipeProposal, tokenType);
+ }
+ }
+
+ case 50:
+ {
+ if (this.state.value === "<") {
+ const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
+
+ if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
+ this.expectOnePlugin(["jsx", "flow", "typescript"]);
+ }
+ }
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ finishTopicReference(node, start, pipeProposal, tokenType) {
+ if (this.testTopicReferenceConfiguration(pipeProposal, start, tokenType)) {
+ let nodeType;
+
+ if (pipeProposal === "smart") {
+ nodeType = "PipelinePrimaryTopicReference";
+ } else {
+ nodeType = "TopicReference";
+ }
+
+ if (!this.topicReferenceIsAllowedInCurrentContext()) {
+ if (pipeProposal === "smart") {
+ this.raise(start, ErrorMessages.PrimaryTopicNotAllowed);
+ } else {
+ this.raise(start, ErrorMessages.PipeTopicUnbound);
+ }
+ }
+
+ this.registerTopicReference();
+ return this.finishNode(node, nodeType);
+ } else {
+ throw this.raise(start, ErrorMessages.PipeTopicUnconfiguredToken, tokenLabelName(tokenType));
+ }
+ }
+
+ testTopicReferenceConfiguration(pipeProposal, start, tokenType) {
+ switch (pipeProposal) {
+ case "hack":
+ {
+ const pluginTopicToken = this.getPluginOption("pipelineOperator", "topicToken");
+ return tokenLabelName(tokenType) === pluginTopicToken;
+ }
+
+ case "smart":
+ return tokenType === 33;
+
+ default:
+ throw this.raise(start, ErrorMessages.PipeTopicRequiresHackPipes);
+ }
+ }
+
+ parseAsyncArrowUnaryFunction(node) {
+ this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
+ const params = [this.parseIdentifier()];
+ this.prodParam.exit();
+
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(this.state.pos, ErrorMessages.LineTerminatorBeforeArrow);
+ }
+
+ this.expect(27);
+ this.parseArrowExpression(node, params, true);
+ return node;
+ }
+
+ parseDo(node, isAsync) {
+ this.expectPlugin("doExpressions");
+
+ if (isAsync) {
+ this.expectPlugin("asyncDoExpressions");
+ }
+
+ node.async = isAsync;
+ this.next();
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+
+ if (isAsync) {
+ this.prodParam.enter(PARAM_AWAIT);
+ node.body = this.parseBlock();
+ this.prodParam.exit();
+ } else {
+ node.body = this.parseBlock();
+ }
+
+ this.state.labels = oldLabels;
+ return this.finishNode(node, "DoExpression");
+ }
+
+ parseSuper() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(18) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages.SuperNotAllowed);
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages.UnexpectedSuper);
+ }
+
+ if (!this.match(18) && !this.match(8) && !this.match(24)) {
+ this.raise(node.start, ErrorMessages.UnsupportedSuper);
+ }
+
+ return this.finishNode(node, "Super");
+ }
+
+ parseMaybePrivateName(isPrivateNameAllowed) {
+ const isPrivate = this.match(6);
+
+ if (isPrivate) {
+ if (!isPrivateNameAllowed) {
+ this.raise(this.state.start + 1, ErrorMessages.UnexpectedPrivateField);
+ }
+
+ return this.parsePrivateName();
+ } else {
+ return this.parseIdentifier(true);
+ }
+ }
+
+ parsePrivateName() {
+ const node = this.startNode();
+ const id = this.startNodeAt(this.state.start + 1, new Position(this.state.curLine, this.state.start + 1 - this.state.lineStart));
+ const name = this.state.value;
+ this.next();
+ node.id = this.createIdentifier(id, name);
+ return this.finishNode(node, "PrivateName");
+ }
+
+ parseFunctionOrFunctionSent() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.prodParam.hasYield && this.match(24)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "function");
+ this.next();
+ return this.parseMetaProperty(node, meta, "sent");
+ }
+
+ return this.parseFunction(node);
+ }
+
+ parseMetaProperty(node, meta, propertyName) {
+ node.meta = meta;
+
+ if (meta.name === "function" && propertyName === "sent") {
+ if (this.isContextual(propertyName)) {
+ this.expectPlugin("functionSent");
+ } else if (!this.hasPlugin("functionSent")) {
+ this.unexpected();
+ }
+ }
+
+ const containsEsc = this.state.containsEsc;
+ node.property = this.parseIdentifier(true);
+
+ if (node.property.name !== propertyName || containsEsc) {
+ this.raise(node.property.start, ErrorMessages.UnsupportedMetaProperty, meta.name, propertyName);
+ }
+
+ return this.finishNode(node, "MetaProperty");
+ }
+
+ parseImportMetaProperty(node) {
+ const id = this.createIdentifier(this.startNodeAtNode(node), "import");
+ this.next();
+
+ if (this.isContextual("meta")) {
+ if (!this.inModule) {
+ this.raise(id.start, SourceTypeModuleErrorMessages.ImportMetaOutsideModule);
+ }
+
+ this.sawUnambiguousESM = true;
+ }
+
+ return this.parseMetaProperty(node, id, "meta");
+ }
+
+ parseLiteralAtNode(value, type, node) {
+ this.addExtra(node, "rawValue", value);
+ this.addExtra(node, "raw", this.input.slice(node.start, this.state.end));
+ node.value = value;
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ parseLiteral(value, type) {
+ const node = this.startNode();
+ return this.parseLiteralAtNode(value, type, node);
+ }
+
+ parseStringLiteral(value) {
+ return this.parseLiteral(value, "StringLiteral");
+ }
+
+ parseNumericLiteral(value) {
+ return this.parseLiteral(value, "NumericLiteral");
+ }
+
+ parseBigIntLiteral(value) {
+ return this.parseLiteral(value, "BigIntLiteral");
+ }
+
+ parseDecimalLiteral(value) {
+ return this.parseLiteral(value, "DecimalLiteral");
+ }
+
+ parseRegExpLiteral(value) {
+ const node = this.parseLiteral(value.value, "RegExpLiteral");
+ node.pattern = value.pattern;
+ node.flags = value.flags;
+ return node;
+ }
+
+ parseBooleanLiteral(value) {
+ const node = this.startNode();
+ node.value = value;
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+
+ parseNullLiteral() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "NullLiteral");
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let val;
+ this.next();
+ this.expressionScope.enter(newArrowHeadScope());
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartPos = this.state.start;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors();
+ let first = true;
+ let spreadStart;
+ let optionalCommaStart;
+
+ while (!this.match(19)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20, refExpressionErrors.optionalParameters === -1 ? null : refExpressionErrors.optionalParameters);
+
+ if (this.match(19)) {
+ optionalCommaStart = this.state.start;
+ break;
+ }
+ }
+
+ if (this.match(29)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ spreadStart = this.state.start;
+ exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));
+ this.checkCommaAfterRest(41);
+ break;
+ } else {
+ exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));
+ }
+ }
+
+ const innerEndPos = this.state.lastTokEnd;
+ const innerEndLoc = this.state.lastTokEndLoc;
+ this.expect(19);
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let arrowNode = this.startNodeAt(startPos, startLoc);
+
+ if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+
+ this.expressionScope.exit();
+
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStart);
+ }
+
+ if (optionalCommaStart) this.unexpected(optionalCommaStart);
+ if (spreadStart) this.unexpected(spreadStart);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.toReferencedListDeep(exprList, true);
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNode(val, "SequenceExpression");
+ this.resetEndLocation(val, innerEndPos, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(val, "parenthesized", true);
+ this.addExtra(val, "parenStart", startPos);
+ return val;
+ }
+
+ const parenExpression = this.startNodeAt(startPos, startLoc);
+ parenExpression.expression = val;
+ this.finishNode(parenExpression, "ParenthesizedExpression");
+ return parenExpression;
+ }
+
+ shouldParseArrow(params) {
+ return !this.canInsertSemicolon();
+ }
+
+ parseArrow(node) {
+ if (this.eat(27)) {
+ return node;
+ }
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ return node;
+ }
+
+ parseNewOrNewTarget() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(24)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
+ this.next();
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
+ this.raise(metaProp.start, ErrorMessages.UnexpectedNewTarget);
+ }
+
+ return metaProp;
+ }
+
+ return this.parseNew(node);
+ }
+
+ parseNew(node) {
+ node.callee = this.parseNoCallExpr();
+
+ if (node.callee.type === "Import") {
+ this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression);
+ } else if (this.isOptionalChain(node.callee)) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew);
+ } else if (this.eat(26)) {
+ this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew);
+ }
+
+ this.parseNewArguments(node);
+ return this.finishNode(node, "NewExpression");
+ }
+
+ parseNewArguments(node) {
+ if (this.eat(18)) {
+ const args = this.parseExprList(19);
+ this.toReferencedList(args);
+ node.arguments = args;
+ } else {
+ node.arguments = [];
+ }
+ }
+
+ parseTemplateElement(isTagged) {
+ const elem = this.startNode();
+
+ if (this.state.value === null) {
+ if (!isTagged) {
+ this.raise(this.state.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate);
+ }
+ }
+
+ elem.value = {
+ raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
+ cooked: this.state.value
+ };
+ this.next();
+ elem.tail = this.match(30);
+ return this.finishNode(elem, "TemplateElement");
+ }
+
+ parseTemplate(isTagged) {
+ const node = this.startNode();
+ this.next();
+ node.expressions = [];
+ let curElt = this.parseTemplateElement(isTagged);
+ node.quasis = [curElt];
+
+ while (!curElt.tail) {
+ this.expect(31);
+ node.expressions.push(this.parseTemplateSubstitution());
+ this.expect(16);
+ node.quasis.push(curElt = this.parseTemplateElement(isTagged));
+ }
+
+ this.next();
+ return this.finishNode(node, "TemplateLiteral");
+ }
+
+ parseTemplateSubstitution() {
+ return this.parseExpression();
+ }
+
+ parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {
+ if (isRecord) {
+ this.expectPlugin("recordAndTuple");
+ }
+
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+
+ while (!this.match(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+
+ if (this.match(close)) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStart);
+ break;
+ }
+ }
+
+ const prop = this.parsePropertyDefinition(isPattern, refExpressionErrors);
+
+ if (!isPattern) {
+ this.checkProto(prop, isRecord, propHash, refExpressionErrors);
+ }
+
+ if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
+ this.raise(prop.start, ErrorMessages.InvalidRecordProperty);
+ }
+
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+
+ node.properties.push(prop);
+ }
+
+ this.next();
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let type = "ObjectExpression";
+
+ if (isPattern) {
+ type = "ObjectPattern";
+ } else if (isRecord) {
+ type = "RecordExpression";
+ }
+
+ return this.finishNode(node, type);
+ }
+
+ maybeAsyncOrAccessorProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(8) || this.match(54));
+ }
+
+ parsePropertyDefinition(isPattern, refExpressionErrors) {
+ let decorators = [];
+
+ if (this.match(32)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages.UnsupportedPropertyDecorator);
+ }
+
+ while (this.match(32)) {
+ decorators.push(this.parseDecorator());
+ }
+ }
+
+ const prop = this.startNode();
+ let isGenerator = false;
+ let isAsync = false;
+ let isAccessor = false;
+ let startPos;
+ let startLoc;
+
+ if (this.match(29)) {
+ if (decorators.length) this.unexpected();
+
+ if (isPattern) {
+ this.next();
+ prop.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(prop, "RestElement");
+ }
+
+ return this.parseSpread();
+ }
+
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+
+ prop.method = false;
+
+ if (isPattern || refExpressionErrors) {
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ }
+
+ if (!isPattern) {
+ isGenerator = this.eat(54);
+ }
+
+ const containsEsc = this.state.containsEsc;
+ const key = this.parsePropertyName(prop, false);
+
+ if (!isPattern && !isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
+ const keyName = key.name;
+
+ if (keyName === "async" && !this.hasPrecedingLineBreak()) {
+ isAsync = true;
+ this.resetPreviousNodeTrailingComments(key);
+ isGenerator = this.eat(54);
+ this.parsePropertyName(prop, false);
+ }
+
+ if (keyName === "get" || keyName === "set") {
+ isAccessor = true;
+ this.resetPreviousNodeTrailingComments(key);
+ prop.kind = keyName;
+
+ if (this.match(54)) {
+ isGenerator = true;
+ this.raise(this.state.pos, ErrorMessages.AccessorIsGenerator, keyName);
+ this.next();
+ }
+
+ this.parsePropertyName(prop, false);
+ }
+ }
+
+ this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+ return prop;
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ return method.kind === "get" ? 0 : 1;
+ }
+
+ getObjectOrClassMethodParams(method) {
+ return method.params;
+ }
+
+ checkGetterSetterParams(method) {
+ var _params;
+
+ const paramCount = this.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ const start = method.start;
+
+ if (params.length !== paramCount) {
+ if (method.kind === "get") {
+ this.raise(start, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ }
+
+ if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ if (isAccessor) {
+ this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(prop);
+ return prop;
+ }
+
+ if (isAsync || isGenerator || this.match(18)) {
+ if (isPattern) this.unexpected();
+ prop.kind = "method";
+ prop.method = true;
+ return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
+ }
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+
+ if (this.eat(22)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);
+ return this.finishNode(prop, "ObjectProperty");
+ }
+
+ if (!prop.computed && prop.key.type === "Identifier") {
+ this.checkReservedWord(prop.key.name, prop.key.start, true, false);
+
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key));
+ } else if (this.match(35) && refExpressionErrors) {
+ if (refExpressionErrors.shorthandAssign === -1) {
+ refExpressionErrors.shorthandAssign = this.state.start;
+ }
+
+ prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key));
+ } else {
+ prop.value = cloneIdentifier(prop.key);
+ }
+
+ prop.shorthand = true;
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+
+ parsePropertyName(prop, isPrivateNameAllowed) {
+ if (this.eat(8)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssignAllowIn();
+ this.expect(11);
+ } else {
+ const oldInPropertyName = this.state.inPropertyName;
+ this.state.inPropertyName = true;
+ const type = this.state.type;
+ prop.key = type === 0 || type === 4 || type === 1 || type === 2 ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);
+
+ if (type !== 6) {
+ prop.computed = false;
+ }
+
+ this.state.inPropertyName = oldInPropertyName;
+ }
+
+ return prop.key;
+ }
+
+ initFunction(node, isAsync) {
+ node.id = null;
+ node.generator = false;
+ node.async = !!isAsync;
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ this.initFunction(node, isAsync);
+ node.generator = !!isGenerator;
+ const allowModifiers = isConstructor;
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ this.parseFunctionParams(node, allowModifiers);
+ this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ return node;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ if (isTuple) {
+ this.expectPlugin("recordAndTuple");
+ }
+
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
+ }
+
+ parseArrowExpression(node, params, isAsync, trailingCommaPos) {
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ let flags = functionFlags(isAsync, false);
+
+ if (!this.match(8) && this.prodParam.hasIn) {
+ flags |= PARAM_IN;
+ }
+
+ this.prodParam.enter(flags);
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaPos);
+ }
+
+ this.state.maybeInArrowParameters = false;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+
+ setArrowFunctionParameters(node, params, trailingCommaPos) {
+ node.params = this.toAssignableList(params, trailingCommaPos, false);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ this.parseFunctionBody(node, false, isMethod);
+ this.finishNode(node, type);
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ const isExpression = allowExpression && !this.match(13);
+ this.expressionScope.enter(newExpressionScope());
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const oldStrict = this.state.strict;
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);
+ node.body = this.parseBlock(true, false, hasStrictModeDirective => {
+ const nonSimple = !this.isSimpleParamList(node.params);
+
+ if (hasStrictModeDirective && nonSimple) {
+ const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start;
+ this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective);
+ }
+
+ const strictModeChanged = !oldStrict && this.state.strict;
+ this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
+
+ if (this.state.strict && node.id) {
+ this.checkLVal(node.id, "function name", BIND_OUTSIDE, undefined, undefined, strictModeChanged);
+ }
+ });
+ this.prodParam.exit();
+ this.expressionScope.exit();
+ this.state.labels = oldLabels;
+ }
+ }
+
+ isSimpleParamList(params) {
+ for (let i = 0, len = params.length; i < len; i++) {
+ if (params[i].type !== "Identifier") return false;
+ }
+
+ return true;
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ const checkClashes = new Set();
+
+ for (const param of node.params) {
+ this.checkLVal(param, "function parameter list", BIND_VAR, allowDuplicates ? null : checkClashes, undefined, strictModeChanged);
+ }
+ }
+
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+
+ return elts;
+ }
+
+ parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {
+ let elt;
+
+ if (this.match(20)) {
+ if (!allowEmpty) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedToken, ",");
+ }
+
+ elt = null;
+ } else if (this.match(29)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartPos, spreadNodeStartLoc);
+ } else if (this.match(25)) {
+ this.expectPlugin("partialApplication");
+
+ if (!allowPlaceholder) {
+ this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder);
+ }
+
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);
+ }
+
+ return elt;
+ }
+
+ parseIdentifier(liberal) {
+ const node = this.startNode();
+ const name = this.parseIdentifierName(node.start, liberal);
+ return this.createIdentifier(node, name);
+ }
+
+ createIdentifier(node, name) {
+ node.name = name;
+ node.loc.identifierName = name;
+ return this.finishNode(node, "Identifier");
+ }
+
+ parseIdentifierName(pos, liberal) {
+ let name;
+ const {
+ start,
+ type
+ } = this.state;
+
+ if (type === 5) {
+ name = this.state.value;
+ } else if (tokenIsKeyword(type)) {
+ name = tokenLabelName(type);
+ } else {
+ throw this.unexpected();
+ }
+
+ if (liberal) {
+ this.state.type = 5;
+ } else {
+ this.checkReservedWord(name, start, tokenIsKeyword(type), false);
+ }
+
+ this.next();
+ return name;
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (word.length > 10) {
+ return;
+ }
+
+ if (!canBeReservedWord(word)) {
+ return;
+ }
+
+ if (word === "yield") {
+ if (this.prodParam.hasYield) {
+ this.raise(startLoc, ErrorMessages.YieldBindingIdentifier);
+ return;
+ }
+ } else if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier);
+ return;
+ } else if (this.scope.inStaticBlock) {
+ this.raise(startLoc, ErrorMessages.AwaitBindingIdentifierInStaticBlock);
+ return;
+ } else {
+ this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier);
+ }
+ } else if (word === "arguments") {
+ if (this.scope.inClassAndNotInNonArrowFunction) {
+ this.raise(startLoc, ErrorMessages.ArgumentsInClass);
+ return;
+ }
+ }
+
+ if (checkKeywords && isKeyword(word)) {
+ this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word);
+ return;
+ }
+
+ const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
+
+ if (reservedTest(word, this.inModule)) {
+ this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word);
+ }
+ }
+
+ isAwaitAllowed() {
+ if (this.prodParam.hasAwait) return true;
+
+ if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {
+ return true;
+ }
+
+ return false;
+ }
+
+ parseAwait(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter);
+
+ if (this.eat(54)) {
+ this.raise(node.start, ErrorMessages.ObsoleteAwaitStar);
+ }
+
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.isAmbiguousAwait()) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary(null, true);
+ }
+
+ return this.finishNode(node, "AwaitExpression");
+ }
+
+ isAmbiguousAwait() {
+ return this.hasPrecedingLineBreak() || this.match(52) || this.match(18) || this.match(8) || this.match(30) || this.match(3) || this.match(55) || this.hasPlugin("v8intrinsic") && this.match(53);
+ }
+
+ parseYield() {
+ const node = this.startNode();
+ this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter);
+ this.next();
+ let delegating = false;
+ let argument = null;
+
+ if (!this.hasPrecedingLineBreak()) {
+ delegating = this.eat(54);
+
+ switch (this.state.type) {
+ case 21:
+ case 7:
+ case 16:
+ case 19:
+ case 11:
+ case 17:
+ case 22:
+ case 20:
+ if (!delegating) break;
+
+ default:
+ argument = this.parseMaybeAssign();
+ }
+ }
+
+ node.delegate = delegating;
+ node.argument = argument;
+ return this.finishNode(node, "YieldExpression");
+ }
+
+ checkPipelineAtInfixOperator(left, leftStartPos) {
+ if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
+ if (left.type === "SequenceExpression") {
+ this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression);
+ }
+ }
+ }
+
+ checkHackPipeBodyEarlyErrors(startPos) {
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(startPos, ErrorMessages.PipeTopicUnused);
+ }
+ }
+
+ parseSmartPipelineBodyInStyle(childExpr, startPos, startLoc) {
+ const bodyNode = this.startNodeAt(startPos, startLoc);
+
+ if (this.isSimpleReference(childExpr)) {
+ bodyNode.callee = childExpr;
+ return this.finishNode(bodyNode, "PipelineBareFunction");
+ } else {
+ this.checkSmartPipeTopicBodyEarlyErrors(startPos);
+ bodyNode.expression = childExpr;
+ return this.finishNode(bodyNode, "PipelineTopicExpression");
+ }
+ }
+
+ isSimpleReference(expression) {
+ switch (expression.type) {
+ case "MemberExpression":
+ return !expression.computed && this.isSimpleReference(expression.object);
+
+ case "Identifier":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ checkSmartPipeTopicBodyEarlyErrors(startPos) {
+ if (this.match(27)) {
+ throw this.raise(this.state.start, ErrorMessages.PipelineBodyNoArrow);
+ } else if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(startPos, ErrorMessages.PipelineTopicUnused);
+ }
+ }
+
+ withTopicBindingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withSmartMixTopicForbiddingContext(callback) {
+ const proposal = this.getPluginOption("pipelineOperator", "proposal");
+
+ if (proposal === "smart") {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ } else {
+ return callback();
+ }
+ }
+
+ withSoloAwaitPermittingContext(callback) {
+ const outerContextSoloAwaitState = this.state.soloAwait;
+ this.state.soloAwait = true;
+
+ try {
+ return callback();
+ } finally {
+ this.state.soloAwait = outerContextSoloAwaitState;
+ }
+ }
+
+ allowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToSet = PARAM_IN & ~flags;
+
+ if (prodParamToSet) {
+ this.prodParam.enter(flags | PARAM_IN);
+
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+
+ return callback();
+ }
+
+ disallowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToClear = PARAM_IN & flags;
+
+ if (prodParamToClear) {
+ this.prodParam.enter(flags & ~PARAM_IN);
+
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+
+ return callback();
+ }
+
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+
+ topicReferenceIsAllowedInCurrentContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+
+ topicReferenceWasUsedInCurrentContext() {
+ return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
+ }
+
+ parseFSharpPipelineBody(prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, prec);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ parseModuleExpression() {
+ this.expectPlugin("moduleBlocks");
+ const node = this.startNode();
+ this.next();
+ this.eat(13);
+ const revertScopes = this.initializeScopes(true);
+ this.enterInitialScopes();
+ const program = this.startNode();
+
+ try {
+ node.body = this.parseProgram(program, 16, "module");
+ } finally {
+ revertScopes();
+ }
+
+ this.eat(16);
+ return this.finishNode(node, "ModuleExpression");
+ }
+
+ }
+
+ const loopLabel = {
+ kind: "loop"
+ },
+ switchLabel = {
+ kind: "switch"
+ };
+ const FUNC_NO_FLAGS = 0b000,
+ FUNC_STATEMENT = 0b001,
+ FUNC_HANGING_STATEMENT = 0b010,
+ FUNC_NULLABLE_ID = 0b100;
+ const loneSurrogate = /[\uD800-\uDFFF]/u;
+ const keywordRelationalOperator = /in(?:stanceof)?/y;
+
+ function babel7CompatTokens(tokens) {
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i];
+ const {
+ type
+ } = token;
+
+ if (type === 6) {
+ {
+ const {
+ loc,
+ start,
+ value,
+ end
+ } = token;
+ const hashEndPos = start + 1;
+ const hashEndLoc = new Position(loc.start.line, loc.start.column + 1);
+ tokens.splice(i, 1, new Token({
+ type: getExportedToken(33),
+ value: "#",
+ start: start,
+ end: hashEndPos,
+ startLoc: loc.start,
+ endLoc: hashEndLoc
+ }), new Token({
+ type: getExportedToken(5),
+ value: value,
+ start: hashEndPos,
+ end: end,
+ startLoc: hashEndLoc,
+ endLoc: loc.end
+ }));
+ i++;
+ continue;
+ }
+ }
+
+ if (typeof type === "number") {
+ token.type = getExportedToken(type);
+ }
+ }
+
+ return tokens;
+ }
+
+ class StatementParser extends ExpressionParser {
+ parseTopLevel(file, program) {
+ file.program = this.parseProgram(program);
+ file.comments = this.state.comments;
+ if (this.options.tokens) file.tokens = babel7CompatTokens(this.tokens);
+ return this.finishNode(file, "File");
+ }
+
+ parseProgram(program, end = 7, sourceType = this.options.sourceType) {
+ program.sourceType = sourceType;
+ program.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(program, true, true, end);
+
+ if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
+ for (const [name] of Array.from(this.scope.undefinedExports)) {
+ const pos = this.scope.undefinedExports.get(name);
+ this.raise(pos, ErrorMessages.ModuleExportUndefined, name);
+ }
+ }
+
+ return this.finishNode(program, "Program");
+ }
+
+ stmtToDirective(stmt) {
+ const directive = stmt;
+ directive.type = "Directive";
+ directive.value = directive.expression;
+ delete directive.expression;
+ const directiveLiteral = directive.value;
+ const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);
+ const val = directiveLiteral.value = raw.slice(1, -1);
+ this.addExtra(directiveLiteral, "raw", raw);
+ this.addExtra(directiveLiteral, "rawValue", val);
+ directiveLiteral.type = "DirectiveLiteral";
+ return directive;
+ }
+
+ parseInterpreterDirective() {
+ if (!this.match(34)) {
+ return null;
+ }
+
+ const node = this.startNode();
+ node.value = this.state.value;
+ this.next();
+ return this.finishNode(node, "InterpreterDirective");
+ }
+
+ isLet(context) {
+ if (!this.isContextual("let")) {
+ return false;
+ }
+
+ return this.isLetKeyword(context);
+ }
+
+ isLetKeyword(context) {
+ const next = this.nextTokenStart();
+ const nextCh = this.codePointAtPos(next);
+
+ if (nextCh === 92 || nextCh === 91) {
+ return true;
+ }
+
+ if (context) return false;
+ if (nextCh === 123) return true;
+
+ if (isIdentifierStart(nextCh)) {
+ keywordRelationalOperator.lastIndex = next;
+
+ if (keywordRelationalOperator.test(this.input)) {
+ const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);
+
+ if (!isIdentifierChar(endCh) && endCh !== 92) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.match(32)) {
+ this.parseDecorators(true);
+ }
+
+ return this.parseStatementContent(context, topLevel);
+ }
+
+ parseStatementContent(context, topLevel) {
+ let starttype = this.state.type;
+ const node = this.startNode();
+ let kind;
+
+ if (this.isLet(context)) {
+ starttype = 73;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case 59:
+ return this.parseBreakContinueStatement(node, true);
+
+ case 62:
+ return this.parseBreakContinueStatement(node, false);
+
+ case 63:
+ return this.parseDebuggerStatement(node);
+
+ case 89:
+ return this.parseDoStatement(node);
+
+ case 90:
+ return this.parseForStatement(node);
+
+ case 67:
+ if (this.lookaheadCharCode() === 46) break;
+
+ if (context) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages.StrictFunction);
+ } else if (context !== "if" && context !== "label") {
+ this.raise(this.state.start, ErrorMessages.SloppyFunction);
+ }
+ }
+
+ return this.parseFunctionStatement(node, false, !context);
+
+ case 79:
+ if (context) this.unexpected();
+ return this.parseClass(node, true);
+
+ case 68:
+ return this.parseIfStatement(node);
+
+ case 69:
+ return this.parseReturnStatement(node);
+
+ case 70:
+ return this.parseSwitchStatement(node);
+
+ case 71:
+ return this.parseThrowStatement(node);
+
+ case 72:
+ return this.parseTryStatement(node);
+
+ case 74:
+ case 73:
+ kind = kind || this.state.value;
+
+ if (context && kind !== "var") {
+ this.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration);
+ }
+
+ return this.parseVarStatement(node, kind);
+
+ case 91:
+ return this.parseWhileStatement(node);
+
+ case 75:
+ return this.parseWithStatement(node);
+
+ case 13:
+ return this.parseBlock();
+
+ case 21:
+ return this.parseEmptyStatement(node);
+
+ case 82:
+ {
+ const nextTokenCharCode = this.lookaheadCharCode();
+
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+ }
+
+ case 81:
+ {
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(this.state.start, ErrorMessages.UnexpectedImportExport);
+ }
+
+ this.next();
+ let result;
+
+ if (starttype === 82) {
+ result = this.parseImport(node);
+
+ if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ result = this.parseExport(node);
+
+ if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ this.assertModuleNodeAllowed(node);
+ return result;
+ }
+
+ default:
+ {
+ if (this.isAsyncFunction()) {
+ if (context) {
+ this.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext);
+ }
+
+ this.next();
+ return this.parseFunctionStatement(node, true, !context);
+ }
+ }
+ }
+
+ const maybeName = this.state.value;
+ const expr = this.parseExpression();
+
+ if (starttype === 5 && expr.type === "Identifier" && this.eat(22)) {
+ return this.parseLabeledStatement(node, maybeName, expr, context);
+ } else {
+ return this.parseExpressionStatement(node, expr);
+ }
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raise(node.start, SourceTypeModuleErrorMessages.ImportOutsideModule);
+ }
+ }
+
+ takeDecorators(node) {
+ const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (decorators.length) {
+ node.decorators = decorators;
+ this.resetStartLocationFromNode(node, decorators[0]);
+ this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
+ }
+ }
+
+ canHaveLeadingDecorator() {
+ return this.match(79);
+ }
+
+ parseDecorators(allowExport) {
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ while (this.match(32)) {
+ const decorator = this.parseDecorator();
+ currentContextDecorators.push(decorator);
+ }
+
+ if (this.match(81)) {
+ if (!allowExport) {
+ this.unexpected();
+ }
+
+ if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, ErrorMessages.DecoratorExportClass);
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator);
+ }
+ }
+
+ parseDecorator() {
+ this.expectOnePlugin(["decorators-legacy", "decorators"]);
+ const node = this.startNode();
+ this.next();
+
+ if (this.hasPlugin("decorators")) {
+ this.state.decoratorStack.push([]);
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr;
+
+ if (this.eat(18)) {
+ expr = this.parseExpression();
+ this.expect(19);
+ } else {
+ expr = this.parseIdentifier(false);
+
+ while (this.eat(24)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = expr;
+ node.property = this.parseIdentifier(true);
+ node.computed = false;
+ expr = this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ this.state.decoratorStack.pop();
+ } else {
+ node.expression = this.parseExprSubscripts();
+ }
+
+ return this.finishNode(node, "Decorator");
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.eat(18)) {
+ const node = this.startNodeAtNode(expr);
+ node.callee = expr;
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ this.toReferencedList(node.arguments);
+ return this.finishNode(node, "CallExpression");
+ }
+
+ return expr;
+ }
+
+ parseBreakContinueStatement(node, isBreak) {
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.label = null;
+ } else {
+ node.label = this.parseIdentifier();
+ this.semicolon();
+ }
+
+ this.verifyBreakContinue(node, isBreak);
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+ }
+
+ verifyBreakContinue(node, isBreak) {
+ let i;
+
+ for (i = 0; i < this.state.labels.length; ++i) {
+ const lab = this.state.labels[i];
+
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
+ if (node.label && isBreak) break;
+ }
+ }
+
+ if (i === this.state.labels.length) {
+ this.raise(node.start, ErrorMessages.IllegalBreakContinue, isBreak ? "break" : "continue");
+ }
+ }
+
+ parseDebuggerStatement(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement");
+ }
+
+ parseHeaderExpression() {
+ this.expect(18);
+ const val = this.parseExpression();
+ this.expect(19);
+ return val;
+ }
+
+ parseDoStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("do"));
+ this.state.labels.pop();
+ this.expect(91);
+ node.test = this.parseHeaderExpression();
+ this.eat(21);
+ return this.finishNode(node, "DoWhileStatement");
+ }
+
+ parseForStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ let awaitAt = -1;
+
+ if (this.isAwaitAllowed() && this.eatContextual("await")) {
+ awaitAt = this.state.lastTokStart;
+ }
+
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(18);
+
+ if (this.match(21)) {
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, null);
+ }
+
+ const startsWithLet = this.isContextual("let");
+ const isLet = startsWithLet && this.isLetKeyword();
+
+ if (this.match(73) || this.match(74) || isLet) {
+ const init = this.startNode();
+ const kind = isLet ? "let" : this.state.value;
+ this.next();
+ this.parseVar(init, true, kind);
+ this.finishNode(init, "VariableDeclaration");
+
+ if ((this.match(57) || this.isContextual("of")) && init.declarations.length === 1) {
+ return this.parseForIn(node, init, awaitAt);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ const startsWithUnescapedName = this.match(5) && !this.state.containsEsc;
+ const refExpressionErrors = new ExpressionErrors();
+ const init = this.parseExpression(true, refExpressionErrors);
+ const isForOf = this.isContextual("of");
+
+ if (isForOf) {
+ if (startsWithLet) {
+ this.raise(init.start, ErrorMessages.ForOfLet);
+ } else if (awaitAt === -1 && startsWithUnescapedName && init.type === "Identifier" && init.name === "async") {
+ this.raise(init.start, ErrorMessages.ForOfAsync);
+ }
+ }
+
+ if (isForOf || this.match(57)) {
+ this.toAssignable(init, true);
+ const description = isForOf ? "for-of statement" : "for-in statement";
+ this.checkLVal(init, description);
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ parseFunctionStatement(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync);
+ }
+
+ parseIfStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(65) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement");
+ }
+
+ parseReturnStatement(node) {
+ if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(this.state.start, ErrorMessages.IllegalReturn);
+ }
+
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.argument = null;
+ } else {
+ node.argument = this.parseExpression();
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "ReturnStatement");
+ }
+
+ parseSwitchStatement(node) {
+ this.next();
+ node.discriminant = this.parseHeaderExpression();
+ const cases = node.cases = [];
+ this.expect(13);
+ this.state.labels.push(switchLabel);
+ this.scope.enter(SCOPE_OTHER);
+ let cur;
+
+ for (let sawDefault; !this.match(16);) {
+ if (this.match(60) || this.match(64)) {
+ const isCase = this.match(60);
+ if (cur) this.finishNode(cur, "SwitchCase");
+ cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) {
+ this.raise(this.state.lastTokStart, ErrorMessages.MultipleDefaultsInSwitch);
+ }
+
+ sawDefault = true;
+ cur.test = null;
+ }
+
+ this.expect(22);
+ } else {
+ if (cur) {
+ cur.consequent.push(this.parseStatement(null));
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+
+ this.scope.exit();
+ if (cur) this.finishNode(cur, "SwitchCase");
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(node, "SwitchStatement");
+ }
+
+ parseThrowStatement(node) {
+ this.next();
+
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.NewlineAfterThrow);
+ }
+
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement");
+ }
+
+ parseCatchClauseParam() {
+ const param = this.parseBindingAtom();
+ const simple = param.type === "Identifier";
+ this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);
+ this.checkLVal(param, "catch clause", BIND_LEXICAL);
+ return param;
+ }
+
+ parseTryStatement(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+
+ if (this.match(61)) {
+ const clause = this.startNode();
+ this.next();
+
+ if (this.match(18)) {
+ this.expect(18);
+ clause.param = this.parseCatchClauseParam();
+ this.expect(19);
+ } else {
+ clause.param = null;
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
+ this.scope.exit();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+
+ node.finalizer = this.eat(66) ? this.parseBlock() : null;
+
+ if (!node.handler && !node.finalizer) {
+ this.raise(node.start, ErrorMessages.NoCatchOrFinally);
+ }
+
+ return this.finishNode(node, "TryStatement");
+ }
+
+ parseVarStatement(node, kind) {
+ this.next();
+ this.parseVar(node, false, kind);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration");
+ }
+
+ parseWhileStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("while"));
+ this.state.labels.pop();
+ return this.finishNode(node, "WhileStatement");
+ }
+
+ parseWithStatement(node) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages.StrictWith);
+ }
+
+ this.next();
+ node.object = this.parseHeaderExpression();
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("with"));
+ return this.finishNode(node, "WithStatement");
+ }
+
+ parseEmptyStatement(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement");
+ }
+
+ parseLabeledStatement(node, maybeName, expr, context) {
+ for (const label of this.state.labels) {
+ if (label.name === maybeName) {
+ this.raise(expr.start, ErrorMessages.LabelRedeclaration, maybeName);
+ }
+ }
+
+ const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(70) ? "switch" : null;
+
+ for (let i = this.state.labels.length - 1; i >= 0; i--) {
+ const label = this.state.labels[i];
+
+ if (label.statementStart === node.start) {
+ label.statementStart = this.state.start;
+ label.kind = kind;
+ } else {
+ break;
+ }
+ }
+
+ this.state.labels.push({
+ name: maybeName,
+ kind: kind,
+ statementStart: this.state.start
+ });
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.state.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement");
+ }
+
+ parseExpressionStatement(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement");
+ }
+
+ parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
+ const node = this.startNode();
+
+ if (allowDirectives) {
+ this.state.strictErrors.clear();
+ }
+
+ this.expect(13);
+
+ if (createNewLexicalScope) {
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ this.parseBlockBody(node, allowDirectives, false, 16, afterBlockParse);
+
+ if (createNewLexicalScope) {
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "BlockStatement");
+ }
+
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
+ }
+
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
+ const oldStrict = this.state.strict;
+ let hasStrictModeDirective = false;
+ let parsedNonDirective = false;
+
+ while (!this.match(end)) {
+ const stmt = this.parseStatement(null, topLevel);
+
+ if (directives && !parsedNonDirective) {
+ if (this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+
+ if (!hasStrictModeDirective && directive.value.value === "use strict") {
+ hasStrictModeDirective = true;
+ this.setStrict(true);
+ }
+
+ continue;
+ }
+
+ parsedNonDirective = true;
+ this.state.strictErrors.clear();
+ }
+
+ body.push(stmt);
+ }
+
+ if (afterBlockParse) {
+ afterBlockParse.call(this, hasStrictModeDirective);
+ }
+
+ if (!oldStrict) {
+ this.setStrict(false);
+ }
+
+ this.next();
+ }
+
+ parseFor(node, init) {
+ node.init = init;
+ this.semicolon(false);
+ node.test = this.match(21) ? null : this.parseExpression();
+ this.semicolon(false);
+ node.update = this.match(19) ? null : this.parseExpression();
+ this.expect(19);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, "ForStatement");
+ }
+
+ parseForIn(node, init, awaitAt) {
+ const isForIn = this.match(57);
+ this.next();
+
+ if (isForIn) {
+ if (awaitAt > -1) this.unexpected(awaitAt);
+ } else {
+ node.await = awaitAt > -1;
+ }
+
+ if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
+ this.raise(init.start, ErrorMessages.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of");
+ } else if (init.type === "AssignmentPattern") {
+ this.raise(init.start, ErrorMessages.InvalidLhs, "for-loop");
+ }
+
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
+ this.expect(19);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
+ }
+
+ parseVar(node, isFor, kind) {
+ const declarations = node.declarations = [];
+ const isTypescript = this.hasPlugin("typescript");
+ node.kind = kind;
+
+ for (;;) {
+ const decl = this.startNode();
+ this.parseVarId(decl, kind);
+
+ if (this.eat(35)) {
+ decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
+ } else {
+ if (kind === "const" && !(this.match(57) || this.isContextual("of"))) {
+ if (!isTypescript) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Const declarations");
+ }
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(57) || this.isContextual("of")))) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns");
+ }
+
+ decl.init = null;
+ }
+
+ declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(20)) break;
+ }
+
+ return node;
+ }
+
+ parseVarId(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLVal(decl.id, "variable declaration", kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, kind !== "var");
+ }
+
+ parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) {
+ const isStatement = statement & FUNC_STATEMENT;
+ const isHangingStatement = statement & FUNC_HANGING_STATEMENT;
+ const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);
+ this.initFunction(node, isAsync);
+
+ if (this.match(54) && isHangingStatement) {
+ this.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext);
+ }
+
+ node.generator = this.eat(54);
+
+ if (isStatement) {
+ node.id = this.parseFunctionId(requireId);
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = false;
+ this.scope.enter(SCOPE_FUNCTION);
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+
+ if (!isStatement) {
+ node.id = this.parseFunctionId();
+ }
+
+ this.parseFunctionParams(node, false);
+ this.withSmartMixTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+
+ if (isStatement && !isHangingStatement) {
+ this.registerFunctionStatementId(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ }
+
+ parseFunctionId(requireId) {
+ return requireId || this.match(5) ? this.parseIdentifier() : null;
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ this.expect(18);
+ this.expressionScope.enter(newParameterDeclarationScope());
+ node.params = this.parseBindingList(19, 41, false, allowModifiers);
+ this.expressionScope.exit();
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(node, isStatement, optionalId);
+ this.parseClassSuper(node);
+ node.body = this.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+ }
+
+ isClassProperty() {
+ return this.match(35) || this.match(21) || this.match(16);
+ }
+
+ isClassMethod() {
+ return this.match(18);
+ }
+
+ isNonstaticConstructor(method) {
+ return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
+ }
+
+ parseClassBody(hadSuperClass, oldStrict) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false,
+ hadSuperClass
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(13);
+ this.withSmartMixTopicForbiddingContext(() => {
+ while (!this.match(16)) {
+ if (this.eat(21)) {
+ if (decorators.length > 0) {
+ throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon);
+ }
+
+ continue;
+ }
+
+ if (this.match(32)) {
+ decorators.push(this.parseDecorator());
+ continue;
+ }
+
+ const member = this.startNode();
+
+ if (decorators.length) {
+ member.decorators = decorators;
+ this.resetStartLocationFromNode(member, decorators[0]);
+ decorators = [];
+ }
+
+ this.parseClassMember(classBody, member, state);
+
+ if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
+ this.raise(member.start, ErrorMessages.DecoratorConstructor);
+ }
+ }
+ });
+ this.state.strict = oldStrict;
+ this.next();
+
+ if (decorators.length) {
+ throw this.raise(this.state.start, ErrorMessages.TrailingDecorator);
+ }
+
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+
+ parseClassMemberFromModifier(classBody, member) {
+ const key = this.parseIdentifier(true);
+
+ if (this.isClassMethod()) {
+ const method = member;
+ method.kind = "method";
+ method.computed = false;
+ method.key = key;
+ method.static = false;
+ this.pushClassMethod(classBody, method, false, false, false, false);
+ return true;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return true;
+ }
+
+ this.resetPreviousNodeTrailingComments(key);
+ return false;
+ }
+
+ parseClassMember(classBody, member, state) {
+ const isStatic = this.isContextual("static");
+
+ if (isStatic) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ if (this.eat(13)) {
+ this.parseClassStaticBlock(classBody, member);
+ return;
+ }
+ }
+
+ this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const publicMethod = member;
+ const privateMethod = member;
+ const publicProp = member;
+ const privateProp = member;
+ const method = publicMethod;
+ const publicMember = publicMethod;
+ member.static = isStatic;
+
+ if (this.eat(54)) {
+ method.kind = "method";
+ const isPrivateName = this.match(6);
+ this.parseClassElementName(method);
+
+ if (isPrivateName) {
+ this.pushClassPrivateMethod(classBody, privateMethod, true, false);
+ return;
+ }
+
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsGenerator);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, true, false, false, false);
+ return;
+ }
+
+ const isContextual = this.match(5) && !this.state.containsEsc;
+ const isPrivate = this.match(6);
+ const key = this.parseClassElementName(member);
+ const maybeQuestionTokenStart = this.state.start;
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (this.isClassMethod()) {
+ method.kind = "method";
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ return;
+ }
+
+ const isConstructor = this.isNonstaticConstructor(publicMethod);
+ let allowsDirectSuper = false;
+
+ if (isConstructor) {
+ publicMethod.kind = "constructor";
+
+ if (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(key.start, ErrorMessages.DuplicateConstructor);
+ }
+
+ if (isConstructor && this.hasPlugin("typescript") && member.override) {
+ this.raise(key.start, ErrorMessages.OverrideOnConstructor);
+ }
+
+ state.hadConstructor = true;
+ allowsDirectSuper = state.hadSuperClass;
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
+ } else if (this.isClassProperty()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else if (isContextual && key.name === "async" && !this.isLineTerminator()) {
+ this.resetPreviousNodeTrailingComments(key);
+ const isGenerator = this.eat(54);
+
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStart);
+ }
+
+ method.kind = "method";
+ const isPrivate = this.match(6);
+ this.parseClassElementName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAsync);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
+ }
+ } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(54) && this.isLineTerminator())) {
+ this.resetPreviousNodeTrailingComments(key);
+ method.kind = key.name;
+ const isPrivate = this.match(6);
+ this.parseClassElementName(publicMethod);
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAccessor);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, false, false);
+ }
+
+ this.checkGetterSetterParams(publicMethod);
+ } else if (this.isLineTerminator()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+
+ parseClassElementName(member) {
+ const {
+ type,
+ value,
+ start
+ } = this.state;
+
+ if ((type === 5 || type === 4) && member.static && value === "prototype") {
+ this.raise(start, ErrorMessages.StaticPrototype);
+ }
+
+ if (type === 6 && value === "constructor") {
+ this.raise(start, ErrorMessages.ConstructorClassPrivateField);
+ }
+
+ return this.parsePropertyName(member, true);
+ }
+
+ parseClassStaticBlock(classBody, member) {
+ var _member$decorators;
+
+ this.expectPlugin("classStaticBlock", member.start);
+ this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(PARAM);
+ const body = member.body = [];
+ this.parseBlockOrModuleBlockBody(body, undefined, false, 16);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.labels = oldLabels;
+ classBody.body.push(this.finishNode(member, "StaticBlock"));
+
+ if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
+ this.raise(member.start, ErrorMessages.DecoratorStaticBlock);
+ }
+ }
+
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
+ this.raise(prop.key.start, ErrorMessages.ConstructorClassField);
+ }
+
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+
+ pushClassPrivateProperty(classBody, prop) {
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.start);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.start);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {}
+
+ parseClassPrivateProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+
+ parseClassProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassProperty");
+ }
+
+ parseInitializer(node) {
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.expressionScope.enter(newExpressionScope());
+ this.prodParam.enter(PARAM);
+ node.value = this.eat(35) ? this.parseMaybeAssignAllowIn() : null;
+ this.expressionScope.exit();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {
+ if (this.match(5)) {
+ node.id = this.parseIdentifier();
+
+ if (isStatement) {
+ this.checkLVal(node.id, "class name", bindingType);
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ this.unexpected(null, ErrorMessages.MissingClassName);
+ }
+ }
+ }
+
+ parseClassSuper(node) {
+ node.superClass = this.eat(80) ? this.parseExprSubscripts() : null;
+ }
+
+ parseExport(node) {
+ const hasDefault = this.maybeParseExportDefaultSpecifier(node);
+ const parseAfterDefault = !hasDefault || this.eat(20);
+ const hasStar = parseAfterDefault && this.eatExportStar(node);
+ const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
+ const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(20));
+ const isFromRequired = hasDefault || hasStar;
+
+ if (hasStar && !hasNamespace) {
+ if (hasDefault) this.unexpected();
+ this.parseExportFrom(node, true);
+ return this.finishNode(node, "ExportAllDeclaration");
+ }
+
+ const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
+
+ if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
+ throw this.unexpected(null, 13);
+ }
+
+ let hasDeclaration;
+
+ if (isFromRequired || hasSpecifiers) {
+ hasDeclaration = false;
+ this.parseExportFrom(node, isFromRequired);
+ } else {
+ hasDeclaration = this.maybeParseExportDeclaration(node);
+ }
+
+ if (isFromRequired || hasSpecifiers || hasDeclaration) {
+ this.checkExport(node, true, false, !!node.source);
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ if (this.eat(64)) {
+ node.declaration = this.parseExportDefaultExpression();
+ this.checkExport(node, true, true);
+ return this.finishNode(node, "ExportDefaultDeclaration");
+ }
+
+ throw this.unexpected(null, 13);
+ }
+
+ eatExportStar(node) {
+ return this.eat(54);
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (this.isExportDefaultSpecifier()) {
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ if (this.isContextual("as")) {
+ if (!node.specifiers) node.specifiers = [];
+ const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
+ this.next();
+ specifier.exported = this.parseModuleExportName();
+ node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamedSpecifiers(node) {
+ if (this.match(13)) {
+ if (!node.specifiers) node.specifiers = [];
+ node.specifiers.push(...this.parseExportSpecifiers());
+ node.source = null;
+ node.declaration = null;
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportDeclaration(node) {
+ if (this.shouldParseExportDeclaration()) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+
+ return false;
+ }
+
+ isAsyncFunction() {
+ if (!this.isContextual("async")) return false;
+ const next = this.nextTokenStart();
+ return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
+ }
+
+ parseExportDefaultExpression() {
+ const expr = this.startNode();
+ const isAsync = this.isAsyncFunction();
+
+ if (this.match(67) || isAsync) {
+ this.next();
+
+ if (isAsync) {
+ this.next();
+ }
+
+ return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);
+ } else if (this.match(79)) {
+ return this.parseClass(expr, true, true);
+ } else if (this.match(32)) {
+ if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, ErrorMessages.DecoratorBeforeExport);
+ }
+
+ this.parseDecorators(false);
+ return this.parseClass(expr, true, true);
+ } else if (this.match(74) || this.match(73) || this.isLet()) {
+ throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport);
+ } else {
+ const res = this.parseMaybeAssignAllowIn();
+ this.semicolon();
+ return res;
+ }
+ }
+
+ parseExportDeclaration(node) {
+ return this.parseStatement(null);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(5)) {
+ const value = this.state.value;
+
+ if (value === "async" && !this.state.containsEsc || value === "let") {
+ return false;
+ }
+
+ if ((value === "type" || value === "interface") && !this.state.containsEsc) {
+ const l = this.lookahead();
+
+ if (l.type === 5 && l.value !== "from" || l.type === 13) {
+ this.expectOnePlugin(["flow", "typescript"]);
+ return false;
+ }
+ }
+ } else if (!this.match(64)) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const hasFrom = this.isUnparsedContextual(next, "from");
+
+ if (this.input.charCodeAt(next) === 44 || this.match(5) && hasFrom) {
+ return true;
+ }
+
+ if (this.match(64) && hasFrom) {
+ const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
+ return nextAfterFrom === 34 || nextAfterFrom === 39;
+ }
+
+ return false;
+ }
+
+ parseExportFrom(node, expect) {
+ if (this.eatContextual("from")) {
+ node.source = this.parseImportSource();
+ this.checkExport(node);
+ const assertions = this.maybeParseImportAssertions();
+
+ if (assertions) {
+ node.assertions = assertions;
+ }
+ } else {
+ if (expect) {
+ this.unexpected();
+ } else {
+ node.source = null;
+ }
+ }
+
+ this.semicolon();
+ }
+
+ shouldParseExportDeclaration() {
+ const {
+ type
+ } = this.state;
+
+ if (type === 32) {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+
+ if (this.hasPlugin("decorators")) {
+ if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.unexpected(this.state.start, ErrorMessages.DecoratorBeforeExport);
+ } else {
+ return true;
+ }
+ }
+ }
+
+ return type === 73 || type === 74 || type === 67 || type === 79 || this.isLet() || this.isAsyncFunction();
+ }
+
+ checkExport(node, checkNames, isDefault, isFrom) {
+ if (checkNames) {
+ if (isDefault) {
+ this.checkDuplicateExports(node, "default");
+
+ if (this.hasPlugin("exportDefaultFrom")) {
+ var _declaration$extra;
+
+ const declaration = node.declaration;
+
+ if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
+ this.raise(declaration.start, ErrorMessages.ExportDefaultFromAsIdentifier);
+ }
+ }
+ } else if (node.specifiers && node.specifiers.length) {
+ for (const specifier of node.specifiers) {
+ const {
+ exported
+ } = specifier;
+ const exportedName = exported.type === "Identifier" ? exported.name : exported.value;
+ this.checkDuplicateExports(specifier, exportedName);
+
+ if (!isFrom && specifier.local) {
+ const {
+ local
+ } = specifier;
+
+ if (local.type !== "Identifier") {
+ this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.value, exportedName);
+ } else {
+ this.checkReservedWord(local.name, local.start, true, false);
+ this.scope.checkLocalExport(local);
+ }
+ }
+ }
+ } else if (node.declaration) {
+ if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
+ const id = node.declaration.id;
+ if (!id) throw new Error("Assertion failure");
+ this.checkDuplicateExports(node, id.name);
+ } else if (node.declaration.type === "VariableDeclaration") {
+ for (const declaration of node.declaration.declarations) {
+ this.checkDeclaration(declaration.id);
+ }
+ }
+ }
+ }
+
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (currentContextDecorators.length) {
+ throw this.raise(node.start, ErrorMessages.UnsupportedDecoratorExport);
+ }
+ }
+
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (const prop of node.properties) {
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (const elem of node.elements) {
+ if (elem) {
+ this.checkDeclaration(elem);
+ }
+ }
+ } else if (node.type === "ObjectProperty") {
+ this.checkDeclaration(node.value);
+ } else if (node.type === "RestElement") {
+ this.checkDeclaration(node.argument);
+ } else if (node.type === "AssignmentPattern") {
+ this.checkDeclaration(node.left);
+ }
+ }
+
+ checkDuplicateExports(node, name) {
+ if (this.exportedIdentifiers.has(name)) {
+ this.raise(node.start, name === "default" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name);
+ }
+
+ this.exportedIdentifiers.add(name);
+ }
+
+ parseExportSpecifiers() {
+ const nodes = [];
+ let first = true;
+ this.expect(13);
+
+ while (!this.eat(16)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+ if (this.eat(16)) break;
+ }
+
+ const node = this.startNode();
+ const isString = this.match(4);
+ const local = this.parseModuleExportName();
+ node.local = local;
+
+ if (this.eatContextual("as")) {
+ node.exported = this.parseModuleExportName();
+ } else if (isString) {
+ node.exported = cloneStringLiteral(local);
+ } else {
+ node.exported = cloneIdentifier(local);
+ }
+
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
+ }
+
+ return nodes;
+ }
+
+ parseModuleExportName() {
+ if (this.match(4)) {
+ const result = this.parseStringLiteral(this.state.value);
+ const surrogate = result.value.match(loneSurrogate);
+
+ if (surrogate) {
+ this.raise(result.start, ErrorMessages.ModuleExportNameHasLoneSurrogate, surrogate[0].charCodeAt(0).toString(16));
+ }
+
+ return result;
+ }
+
+ return this.parseIdentifier(true);
+ }
+
+ parseImport(node) {
+ node.specifiers = [];
+
+ if (!this.match(4)) {
+ const hasDefault = this.maybeParseDefaultImportSpecifier(node);
+ const parseNext = !hasDefault || this.eat(20);
+ const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
+ if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
+ this.expectContextual("from");
+ }
+
+ node.source = this.parseImportSource();
+ const assertions = this.maybeParseImportAssertions();
+
+ if (assertions) {
+ node.assertions = assertions;
+ } else {
+ const attributes = this.maybeParseModuleAttributes();
+
+ if (attributes) {
+ node.attributes = attributes;
+ }
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ if (!this.match(4)) this.unexpected();
+ return this.parseExprAtom();
+ }
+
+ shouldParseDefaultImport(node) {
+ return this.match(5);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = this.parseIdentifier();
+ this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ parseAssertEntries() {
+ const attrs = [];
+ const attrNames = new Set();
+
+ do {
+ if (this.match(16)) {
+ break;
+ }
+
+ const node = this.startNode();
+ const keyName = this.state.value;
+
+ if (attrNames.has(keyName)) {
+ this.raise(this.state.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, keyName);
+ }
+
+ attrNames.add(keyName);
+
+ if (this.match(4)) {
+ node.key = this.parseStringLiteral(keyName);
+ } else {
+ node.key = this.parseIdentifier(true);
+ }
+
+ this.expect(22);
+
+ if (!this.match(4)) {
+ throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);
+ }
+
+ node.value = this.parseStringLiteral(this.state.value);
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(20));
+
+ return attrs;
+ }
+
+ maybeParseModuleAttributes() {
+ if (this.match(75) && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("moduleAttributes");
+ this.next();
+ } else {
+ if (this.hasPlugin("moduleAttributes")) return [];
+ return null;
+ }
+
+ const attrs = [];
+ const attributes = new Set();
+
+ do {
+ const node = this.startNode();
+ node.key = this.parseIdentifier(true);
+
+ if (node.key.name !== "type") {
+ this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, node.key.name);
+ }
+
+ if (attributes.has(node.key.name)) {
+ this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, node.key.name);
+ }
+
+ attributes.add(node.key.name);
+ this.expect(22);
+
+ if (!this.match(4)) {
+ throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);
+ }
+
+ node.value = this.parseStringLiteral(this.state.value);
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(20));
+
+ return attrs;
+ }
+
+ maybeParseImportAssertions() {
+ if (this.isContextual("assert") && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("importAssertions");
+ this.next();
+ } else {
+ if (this.hasPlugin("importAssertions")) return [];
+ return null;
+ }
+
+ this.eat(13);
+ const attrs = this.parseAssertEntries();
+ this.eat(16);
+ return attrs;
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ if (this.shouldParseDefaultImport(node)) {
+ this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseStarImportSpecifier(node) {
+ if (this.match(54)) {
+ const specifier = this.startNode();
+ this.next();
+ this.expectContextual("as");
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ parseNamedImportSpecifiers(node) {
+ let first = true;
+ this.expect(13);
+
+ while (!this.eat(16)) {
+ if (first) {
+ first = false;
+ } else {
+ if (this.eat(22)) {
+ throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport);
+ }
+
+ this.expect(20);
+ if (this.eat(16)) break;
+ }
+
+ this.parseImportSpecifier(node);
+ }
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ const importedIsString = this.match(4);
+ specifier.imported = this.parseModuleExportName();
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ const {
+ imported
+ } = specifier;
+
+ if (importedIsString) {
+ throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, imported.value);
+ }
+
+ this.checkReservedWord(imported.name, specifier.start, true, true);
+ specifier.local = cloneIdentifier(imported);
+ }
+
+ this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ isThisParam(param) {
+ return param.type === "Identifier" && param.name === "this";
+ }
+
+ }
+
+ class Parser extends StatementParser {
+ constructor(options, input) {
+ options = getOptions(options);
+ super(options, input);
+ this.options = options;
+ this.initializeScopes();
+ this.plugins = pluginsMap(this.options.plugins);
+ this.filename = options.sourceFilename;
+ }
+
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+
+ parse() {
+ this.enterInitialScopes();
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
+ }
+
+ }
+
+ function pluginsMap(plugins) {
+ const pluginMap = new Map();
+
+ for (const plugin of plugins) {
+ const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
+ if (!pluginMap.has(name)) pluginMap.set(name, options || {});
+ }
+
+ return pluginMap;
+ }
+
+ function parse$1(input, options) {
+ var _options;
+
+ if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
+ options = Object.assign({}, options);
+
+ try {
+ options.sourceType = "module";
+ const parser = getParser(options, input);
+ const ast = parser.parse();
+
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused2) {}
+
+ throw moduleError;
+ }
+ } else {
+ return getParser(options, input).parse();
+ }
+ }
+ function parseExpression(input, options) {
+ const parser = getParser(options, input);
+
+ if (parser.options.strictMode) {
+ parser.state.strict = true;
+ }
+
+ return parser.getExpression();
+ }
+
+ function generateExportedTokenTypes(internalTokenTypes) {
+ const tokenTypes = {};
+
+ for (const typeName of Object.keys(internalTokenTypes)) {
+ tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);
+ }
+
+ return tokenTypes;
+ }
+
+ const tokTypes = generateExportedTokenTypes(tt);
+
+ function getParser(options, input) {
+ let cls = Parser;
+
+ if (options != null && options.plugins) {
+ validatePlugins(options.plugins);
+ cls = getParserClass(options.plugins);
+ }
+
+ return new cls(options, input);
+ }
+
+ const parserClassCache = {};
+
+ function getParserClass(pluginsFromOptions) {
+ const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));
+ const key = pluginList.join("/");
+ let cls = parserClassCache[key];
+
+ if (!cls) {
+ cls = Parser;
+
+ for (const plugin of pluginList) {
+ cls = mixinPlugins[plugin](cls);
+ }
+
+ parserClassCache[key] = cls;
+ }
+
+ return cls;
+ }
+
+ var parse_1 = lib$1.parse = parse$1;
+ lib$1.parseExpression = parseExpression;
+ lib$1.tokTypes = tokTypes;
+
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+ const cachedSources = new Map();
+
+ function setSource(source) {
+ cachedSources.set(source.id, source);
+ }
+
+ function getSource(sourceId) {
+ const source = cachedSources.get(sourceId);
+ if (!source) {
+ throw new Error(`Parser: source ${sourceId} was not provided.`);
+ }
+
+ return source;
+ }
+
+ function clearSources() {
+ cachedSources.clear();
+ }
+
+ let ASTs = new Map();
+
+ function _parse(code, opts) {
+ return parse_1(code, {
+ ...opts,
+ tokens: true,
+ });
+ }
+
+ const sourceOptions = {
+ generated: {
+ sourceType: "unambiguous",
+ tokens: true,
+ plugins: [
+ "classStaticBlock",
+ "classPrivateProperties",
+ "classPrivateMethods",
+ "classProperties",
+ "objectRestSpread",
+ "optionalChaining",
+ "privateIn",
+ "nullishCoalescingOperator",
+ ],
+ },
+ original: {
+ sourceType: "unambiguous",
+ tokens: true,
+ plugins: [
+ "jsx",
+ "flow",
+ "doExpressions",
+ "optionalChaining",
+ "nullishCoalescingOperator",
+ "decorators-legacy",
+ "objectRestSpread",
+ "classStaticBlock",
+ "classPrivateProperties",
+ "classPrivateMethods",
+ "classProperties",
+ "exportDefaultFrom",
+ "exportNamespaceFrom",
+ "asyncGenerators",
+ "functionBind",
+ "functionSent",
+ "dynamicImport",
+ "react-jsx",
+ ],
+ },
+ };
+
+ function parse(text, opts) {
+ let ast = {};
+ if (!text) {
+ return ast;
+ }
+
+ try {
+ ast = _parse(text, opts);
+ } catch (error) {
+ console.error(error);
+ }
+
+ return ast;
+ }
+
+ // Custom parser for parse-script-tags that adapts its input structure to
+ // our parser's signature
+ function htmlParser({ source, line }) {
+ return parse(source, { startLine: line, ...sourceOptions.generated });
+ }
+
+ const VUE_COMPONENT_START = /^\s*</;
+ function vueParser({ source, line }) {
+ return parse(source, {
+ startLine: line,
+ ...sourceOptions.original,
+ });
+ }
+ function parseVueScript(code) {
+ if (typeof code !== "string") {
+ return {};
+ }
+
+ let ast;
+
+ // .vue files go through several passes, so while there is a
+ // single-file-component Vue template, there are also generally .vue files
+ // that are still just JS as well.
+ if (code.match(VUE_COMPONENT_START)) {
+ ast = _default$2(code, vueParser);
+ if (lib$6.isFile(ast)) {
+ // parseScriptTags is currently hard-coded to return scripts, but Vue
+ // always expects ESM syntax, so we just hard-code it.
+ ast.program.sourceType = "module";
+ }
+ } else {
+ ast = parse(code, sourceOptions.original);
+ }
+ return ast;
+ }
+
+ function parseConsoleScript(text, opts) {
+ try {
+ return _parse(text, {
+ plugins: [
+ "classStaticBlock",
+ "classPrivateProperties",
+ "classPrivateMethods",
+ "objectRestSpread",
+ "dynamicImport",
+ "nullishCoalescingOperator",
+ "optionalChaining",
+ ],
+ ...opts,
+ allowAwaitOutsideFunction: true,
+ });
+ } catch (e) {
+ return null;
+ }
+ }
+
+ function parseScript(text, opts) {
+ return _parse(text, opts);
+ }
+
+ function getAst(sourceId) {
+ if (ASTs.has(sourceId)) {
+ return ASTs.get(sourceId);
+ }
+
+ const source = getSource(sourceId);
+
+ if (source.isWasm) {
+ return null;
+ }
+
+ let ast = {};
+ const { contentType } = source;
+ if (contentType == "text/html") {
+ ast = _default$2(source.text, htmlParser) || {};
+ } else if (contentType && contentType === "text/vue") {
+ ast = parseVueScript(source.text) || {};
+ } else if (
+ contentType &&
+ contentType.match(/(javascript|jsx)/) &&
+ !contentType.match(/typescript-jsx/)
+ ) {
+ const type = source.id.includes("original") ? "original" : "generated";
+ const options = sourceOptions[type];
+ ast = parse(source.text, options);
+ } else if (contentType && contentType.match(/typescript/)) {
+ const options = {
+ ...sourceOptions.original,
+ plugins: [
+ ...sourceOptions.original.plugins.filter(
+ p =>
+ p !== "flow" &&
+ p !== "decorators" &&
+ p !== "decorators2" &&
+ (p !== "jsx" || contentType.match(/typescript-jsx/))
+ ),
+ "decorators-legacy",
+ "typescript",
+ ],
+ };
+ ast = parse(source.text, options);
+ }
+
+ ASTs.set(source.id, ast);
+ return ast;
+ }
+
+ function clearASTs() {
+ ASTs = new Map();
+ }
+
+ function traverseAst(sourceId, visitor, state) {
+ const ast = getAst(sourceId);
+ if (!ast || !Object.keys(ast).length) {
+ return null;
+ }
+
+ lib$6.traverse(ast, visitor, state);
+ return ast;
+ }
+
+ function hasNode(rootNode, predicate) {
+ try {
+ lib$6.traverse(rootNode, {
+ enter: (node, ancestors) => {
+ if (predicate(node, ancestors)) {
+ throw new Error("MATCH");
+ }
+ },
+ });
+ } catch (e) {
+ if (e.message === "MATCH") {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function replaceNode$1(ancestors, node) {
+ const parent = ancestors[ancestors.length - 1];
+
+ if (typeof parent.index === "number") {
+ if (Array.isArray(node)) {
+ parent.node[parent.key].splice(parent.index, 1, ...node);
+ } else {
+ parent.node[parent.key][parent.index] = node;
+ }
+ } else {
+ parent.node[parent.key] = node;
+ }
+ }
+
+ var lib = {};
+
+ var sourceMap$1 = {};
+
+ var sourceMap = {};
+
+ var sourceMapGenerator = {};
+
+ var base64Vlq = {};
+
+ var base64$1 = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+ /**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+ base64$1.encode = function (number) {
+ if (0 <= number && number < intToCharMap.length) {
+ return intToCharMap[number];
+ }
+ throw new TypeError("Must be between 0 and 63: " + number);
+ };
+
+ /**
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
+ * failure.
+ */
+ base64$1.decode = function (charCode) {
+ var bigA = 65; // 'A'
+ var bigZ = 90; // 'Z'
+
+ var littleA = 97; // 'a'
+ var littleZ = 122; // 'z'
+
+ var zero = 48; // '0'
+ var nine = 57; // '9'
+
+ var plus = 43; // '+'
+ var slash = 47; // '/'
+
+ var littleOffset = 26;
+ var numberOffset = 52;
+
+ // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ if (bigA <= charCode && charCode <= bigZ) {
+ return (charCode - bigA);
+ }
+
+ // 26 - 51: abcdefghijklmnopqrstuvwxyz
+ if (littleA <= charCode && charCode <= littleZ) {
+ return (charCode - littleA + littleOffset);
+ }
+
+ // 52 - 61: 0123456789
+ if (zero <= charCode && charCode <= nine) {
+ return (charCode - zero + numberOffset);
+ }
+
+ // 62: +
+ if (charCode == plus) {
+ return 62;
+ }
+
+ // 63: /
+ if (charCode == slash) {
+ return 63;
+ }
+
+ // Invalid base64 digit.
+ return -1;
+ };
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ var base64 = base64$1;
+
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
+ // length quantities we use in the source map spec, the first bit is the sign,
+ // the next four bits are the actual value, and the 6th bit is the
+ // continuation bit. The continuation bit tells us whether there are more
+ // digits in this value following this digit.
+ //
+ // Continuation
+ // | Sign
+ // | |
+ // V V
+ // 101011
+
+ var VLQ_BASE_SHIFT = 5;
+
+ // binary: 100000
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+ // binary: 011111
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+ // binary: 100000
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+ /**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+ function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+ }
+
+ /**
+ * Converts to a two-complement value from a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+ function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+ }
+
+ /**
+ * Returns the base 64 VLQ encoded value.
+ */
+ base64Vlq.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+ };
+
+ /**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string via the out parameter.
+ */
+ base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (aIndex >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
+ if (digit === -1) {
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
+ }
+
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ aOutParam.value = fromVLQSigned(result);
+ aOutParam.rest = aIndex;
+ };
+
+ var util$5 = {};
+
+ (function (exports) {
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ /**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+ function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+ }
+ exports.getArg = getArg;
+
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
+ var dataUrlRegexp = /^data:.+\,.+$/;
+
+ function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+ }
+ exports.urlParse = urlParse;
+
+ function urlGenerate(aParsedUrl) {
+ var url = '';
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ':';
+ }
+ url += '//';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port;
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+ }
+ exports.urlGenerate = urlGenerate;
+
+ /**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consecutive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '<dir>/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+ function normalize(aPath) {
+ var path = aPath;
+ var url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ var isAbsolute = exports.isAbsolute(path);
+
+ var parts = path.split(/\/+/);
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
+ part = parts[i];
+ if (part === '.') {
+ parts.splice(i, 1);
+ } else if (part === '..') {
+ up++;
+ } else if (up > 0) {
+ if (part === '') {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join('/');
+
+ if (path === '') {
+ path = isAbsolute ? '/' : '.';
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+ }
+ exports.normalize = normalize;
+
+ /**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+ function join(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+ if (aPath === "") {
+ aPath = ".";
+ }
+ var aPathUrl = urlParse(aPath);
+ var aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || '/';
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ var joined = aPath.charAt(0) === '/'
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+ }
+ exports.join = join;
+
+ exports.isAbsolute = function (aPath) {
+ return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
+ };
+
+ /**
+ * Make a path relative to a URL or another path.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ */
+ function relative(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+
+ aRoot = aRoot.replace(/\/$/, '');
+
+ // It is possible for the path to be above the root. In this case, simply
+ // checking whether the root is a prefix of the path won't work. Instead, we
+ // need to remove components from the root one by one, until either we find
+ // a prefix that fits, or we run out of components to remove.
+ var level = 0;
+ while (aPath.indexOf(aRoot + '/') !== 0) {
+ var index = aRoot.lastIndexOf("/");
+ if (index < 0) {
+ return aPath;
+ }
+
+ // If the only part of the root that is left is the scheme (i.e. http://,
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
+ // have exhausted all components, so the path is not relative to the root.
+ aRoot = aRoot.slice(0, index);
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
+ return aPath;
+ }
+
+ ++level;
+ }
+
+ // Make sure we add a "../" for each component we removed from the root.
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
+ }
+ exports.relative = relative;
+
+ var supportsNullProto = (function () {
+ var obj = Object.create(null);
+ return !('__proto__' in obj);
+ }());
+
+ function identity (s) {
+ return s;
+ }
+
+ /**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+ function toSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return '$' + aStr;
+ }
+
+ return aStr;
+ }
+ exports.toSetString = supportsNullProto ? identity : toSetString;
+
+ function fromSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return aStr.slice(1);
+ }
+
+ return aStr;
+ }
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
+
+ function isProtoString(s) {
+ if (!s) {
+ return false;
+ }
+
+ var length = s.length;
+
+ if (length < 9 /* "__proto__".length */) {
+ return false;
+ }
+
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
+ return false;
+ }
+
+ for (var i = length - 10; i >= 0; i--) {
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp = mappingA.source - mappingB.source;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0 || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return mappingA.name - mappingB.name;
+ }
+ exports.compareByOriginalPositions = compareByOriginalPositions;
+
+ /**
+ * Comparator between two mappings with deflated source and name indices where
+ * the generated positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0 || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = mappingA.source - mappingB.source;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return mappingA.name - mappingB.name;
+ }
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+ function strcmp(aStr1, aStr2) {
+ if (aStr1 === aStr2) {
+ return 0;
+ }
+
+ if (aStr1 > aStr2) {
+ return 1;
+ }
+
+ return -1;
+ }
+
+ /**
+ * Comparator between two mappings with inflated source and name strings where
+ * the generated positions are compared.
+ */
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ }
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
+ } (util$5));
+
+ var arraySet = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ var util$4 = util$5;
+ var has = Object.prototype.hasOwnProperty;
+ var hasNativeMap = typeof Map !== "undefined";
+
+ /**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+ function ArraySet$2() {
+ this._array = [];
+ this._set = hasNativeMap ? new Map() : Object.create(null);
+ }
+
+ /**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet$2();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+ };
+
+ /**
+ * Return how many unique items are in this ArraySet. If duplicates have been
+ * added, than those do not count towards the size.
+ *
+ * @returns Number
+ */
+ ArraySet$2.prototype.size = function ArraySet_size() {
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
+ };
+
+ /**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var sStr = hasNativeMap ? aStr : util$4.toSetString(aStr);
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ if (hasNativeMap) {
+ this._set.set(aStr, idx);
+ } else {
+ this._set[sStr] = idx;
+ }
+ }
+ };
+
+ /**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ ArraySet$2.prototype.has = function ArraySet_has(aStr) {
+ if (hasNativeMap) {
+ return this._set.has(aStr);
+ } else {
+ var sStr = util$4.toSetString(aStr);
+ return has.call(this._set, sStr);
+ }
+ };
+
+ /**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (hasNativeMap) {
+ var idx = this._set.get(aStr);
+ if (idx >= 0) {
+ return idx;
+ }
+ } else {
+ var sStr = util$4.toSetString(aStr);
+ if (has.call(this._set, sStr)) {
+ return this._set[sStr];
+ }
+ }
+
+ throw new Error('"' + aStr + '" is not in the set.');
+ };
+
+ /**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+ };
+
+ /**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ ArraySet$2.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+ };
+
+ arraySet.ArraySet = ArraySet$2;
+
+ var mappingList = {};
+
+ /*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ var util$3 = util$5;
+
+ /**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+ function generatedPositionAfter(mappingA, mappingB) {
+ // Optimized for most common case
+ var lineA = mappingA.generatedLine;
+ var lineB = mappingB.generatedLine;
+ var columnA = mappingA.generatedColumn;
+ var columnB = mappingB.generatedColumn;
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
+ util$3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+ }
+
+ /**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a neglibable overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+ function MappingList$1() {
+ this._array = [];
+ this._sorted = true;
+ // Serves as infimum
+ this._last = {generatedLine: -1, generatedColumn: 0};
+ }
+
+ /**
+ * Iterate through internal items. This method takes the same arguments that
+ * `Array.prototype.forEach` takes.
+ *
+ * NOTE: The order of the mappings is NOT guaranteed.
+ */
+ MappingList$1.prototype.unsortedForEach =
+ function MappingList_forEach(aCallback, aThisArg) {
+ this._array.forEach(aCallback, aThisArg);
+ };
+
+ /**
+ * Add the given source mapping.
+ *
+ * @param Object aMapping
+ */
+ MappingList$1.prototype.add = function MappingList_add(aMapping) {
+ if (generatedPositionAfter(this._last, aMapping)) {
+ this._last = aMapping;
+ this._array.push(aMapping);
+ } else {
+ this._sorted = false;
+ this._array.push(aMapping);
+ }
+ };
+
+ /**
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
+ * generated position.
+ *
+ * WARNING: This method returns internal data without copying, for
+ * performance. The return value must NOT be mutated, and should be treated as
+ * an immutable borrow. If you want to take ownership, you must make your own
+ * copy.
+ */
+ MappingList$1.prototype.toArray = function MappingList_toArray() {
+ if (!this._sorted) {
+ this._array.sort(util$3.compareByGeneratedPositionsInflated);
+ this._sorted = true;
+ }
+ return this._array;
+ };
+
+ mappingList.MappingList = MappingList$1;
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ var base64VLQ$1 = base64Vlq;
+ var util$2 = util$5;
+ var ArraySet$1 = arraySet.ArraySet;
+ var MappingList = mappingList.MappingList;
+
+ /**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+ function SourceMapGenerator$1(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util$2.getArg(aArgs, 'file', null);
+ this._sourceRoot = util$2.getArg(aArgs, 'sourceRoot', null);
+ this._skipValidation = util$2.getArg(aArgs, 'skipValidation', false);
+ this._sources = new ArraySet$1();
+ this._names = new ArraySet$1();
+ this._mappings = new MappingList();
+ this._sourcesContents = null;
+ }
+
+ SourceMapGenerator$1.prototype._version = 3;
+
+ /**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+ SourceMapGenerator$1.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator$1({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source != null) {
+ newMapping.source = mapping.source;
+ if (sourceRoot != null) {
+ newMapping.source = util$2.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name != null) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+ /**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+ SourceMapGenerator$1.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util$2.getArg(aArgs, 'generated');
+ var original = util$2.getArg(aArgs, 'original', null);
+ var source = util$2.getArg(aArgs, 'source', null);
+ var name = util$2.getArg(aArgs, 'name', null);
+
+ if (!this._skipValidation) {
+ this._validateMapping(generated, original, source, name);
+ }
+
+ if (source != null) {
+ source = String(source);
+ if (!this._sources.has(source)) {
+ this._sources.add(source);
+ }
+ }
+
+ if (name != null) {
+ name = String(name);
+ if (!this._names.has(name)) {
+ this._names.add(name);
+ }
+ }
+
+ this._mappings.add({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+ /**
+ * Set the source content for a source file.
+ */
+ SourceMapGenerator$1.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot != null) {
+ source = util$2.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent != null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = Object.create(null);
+ }
+ this._sourcesContents[util$2.toSetString(source)] = aSourceContent;
+ } else if (this._sourcesContents) {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util$2.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+ /**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+ SourceMapGenerator$1.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ var sourceFile = aSourceFile;
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (aSourceFile == null) {
+ if (aSourceMapConsumer.file == null) {
+ throw new Error(
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ sourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "sourceFile" relative if an absolute Url is passed.
+ if (sourceRoot != null) {
+ sourceFile = util$2.relative(sourceRoot, sourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet$1();
+ var newNames = new ArraySet$1();
+
+ // Find mappings for the "sourceFile"
+ this._mappings.unsortedForEach(function (mapping) {
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source != null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath != null) {
+ mapping.source = util$2.join(aSourceMapPath, mapping.source);
+ }
+ if (sourceRoot != null) {
+ mapping.source = util$2.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name != null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source != null && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name != null && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aSourceMapPath != null) {
+ sourceFile = util$2.join(aSourceMapPath, sourceFile);
+ }
+ if (sourceRoot != null) {
+ sourceFile = util$2.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+ /**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+ SourceMapGenerator$1.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ // When aOriginal is truthy but has empty values for .line and .column,
+ // it is most likely a programmer error. In this case we throw a very
+ // specific error message to try to guide them the right way.
+ // For example: https://github.com/Polymer/polymer-bundler/pull/519
+ if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
+ throw new Error(
+ 'original.line and original.column are not numbers -- you probably meant to omit ' +
+ 'the original mapping entirely and only map the generated position. If so, pass ' +
+ 'null for the original mapping instead of an object with empty or null values.'
+ );
+ }
+
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+ /**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+ SourceMapGenerator$1.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var next;
+ var mapping;
+ var nameIdx;
+ var sourceIdx;
+
+ var mappings = this._mappings.toArray();
+ for (var i = 0, len = mappings.length; i < len; i++) {
+ mapping = mappings[i];
+ next = '';
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ next += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util$2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
+ continue;
+ }
+ next += ',';
+ }
+ }
+
+ next += base64VLQ$1.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source != null) {
+ sourceIdx = this._sources.indexOf(mapping.source);
+ next += base64VLQ$1.encode(sourceIdx - previousSource);
+ previousSource = sourceIdx;
+
+ // lines are stored 0-based in SourceMap spec version 3
+ next += base64VLQ$1.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ next += base64VLQ$1.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name != null) {
+ nameIdx = this._names.indexOf(mapping.name);
+ next += base64VLQ$1.encode(nameIdx - previousName);
+ previousName = nameIdx;
+ }
+ }
+
+ result += next;
+ }
+
+ return result;
+ };
+
+ SourceMapGenerator$1.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot != null) {
+ source = util$2.relative(aSourceRoot, source);
+ }
+ var key = util$2.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+ /**
+ * Externalize the source map.
+ */
+ SourceMapGenerator$1.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._file != null) {
+ map.file = this._file;
+ }
+ if (this._sourceRoot != null) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+ /**
+ * Render the source map being generated to a string.
+ */
+ SourceMapGenerator$1.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this.toJSON());
+ };
+
+ sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
+
+ var sourceMapConsumer = {};
+
+ var binarySearch$1 = {};
+
+ (function (exports) {
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ exports.GREATEST_LOWER_BOUND = 1;
+ exports.LEAST_UPPER_BOUND = 2;
+
+ /**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ */
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the index of
+ // the next-closest element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element than the one we are searching for, so we return -1.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return mid;
+ }
+ else if (cmp > 0) {
+ // Our needle is greater than aHaystack[mid].
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return aHigh < aHaystack.length ? aHigh : -1;
+ } else {
+ return mid;
+ }
+ }
+ else {
+ // Our needle is less than aHaystack[mid].
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return mid;
+ } else {
+ return aLow < 0 ? -1 : aLow;
+ }
+ }
+ }
+
+ /**
+ * This is an implementation of binary search which will always try and return
+ * the index of the closest element if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
+ */
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
+ if (aHaystack.length === 0) {
+ return -1;
+ }
+
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
+ aCompare, aBias || exports.GREATEST_LOWER_BOUND);
+ if (index < 0) {
+ return -1;
+ }
+
+ // We have found either the exact element, or the next-closest element than
+ // the one we are searching for. However, there may be more than one such
+ // element. Make sure we always return the smallest of these.
+ while (index - 1 >= 0) {
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
+ break;
+ }
+ --index;
+ }
+
+ return index;
+ };
+ } (binarySearch$1));
+
+ var quickSort$1 = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ // It turns out that some (most?) JavaScript engines don't self-host
+ // `Array.prototype.sort`. This makes sense because C++ will likely remain
+ // faster than JS when doing raw CPU-intensive sorting. However, when using a
+ // custom comparator function, calling back and forth between the VM's C++ and
+ // JIT'd JS is rather slow *and* loses JIT type information, resulting in
+ // worse generated code for the comparator function than would be optimal. In
+ // fact, when sorting with a comparator, these costs outweigh the benefits of
+ // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
+ // a ~3500ms mean speed-up in `bench/bench.html`.
+
+ /**
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
+ *
+ * @param {Array} ary
+ * The array.
+ * @param {Number} x
+ * The index of the first item.
+ * @param {Number} y
+ * The index of the second item.
+ */
+ function swap$1(ary, x, y) {
+ var temp = ary[x];
+ ary[x] = ary[y];
+ ary[y] = temp;
+ }
+
+ /**
+ * Returns a random integer within the range `low .. high` inclusive.
+ *
+ * @param {Number} low
+ * The lower bound on the range.
+ * @param {Number} high
+ * The upper bound on the range.
+ */
+ function randomIntInRange(low, high) {
+ return Math.round(low + (Math.random() * (high - low)));
+ }
+
+ /**
+ * The Quick Sort algorithm.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ * @param {Number} p
+ * Start index of the array
+ * @param {Number} r
+ * End index of the array
+ */
+ function doQuickSort(ary, comparator, p, r) {
+ // If our lower bound is less than our upper bound, we (1) partition the
+ // array into two pieces and (2) recurse on each half. If it is not, this is
+ // the empty array and our base case.
+
+ if (p < r) {
+ // (1) Partitioning.
+ //
+ // The partitioning chooses a pivot between `p` and `r` and moves all
+ // elements that are less than or equal to the pivot to the before it, and
+ // all the elements that are greater than it after it. The effect is that
+ // once partition is done, the pivot is in the exact place it will be when
+ // the array is put in sorted order, and it will not need to be moved
+ // again. This runs in O(n) time.
+
+ // Always choose a random pivot so that an input array which is reverse
+ // sorted does not cause O(n^2) running time.
+ var pivotIndex = randomIntInRange(p, r);
+ var i = p - 1;
+
+ swap$1(ary, pivotIndex, r);
+ var pivot = ary[r];
+
+ // Immediately after `j` is incremented in this loop, the following hold
+ // true:
+ //
+ // * Every element in `ary[p .. i]` is less than or equal to the pivot.
+ //
+ // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
+ for (var j = p; j < r; j++) {
+ if (comparator(ary[j], pivot) <= 0) {
+ i += 1;
+ swap$1(ary, i, j);
+ }
+ }
+
+ swap$1(ary, i + 1, j);
+ var q = i + 1;
+
+ // (2) Recurse on each half.
+
+ doQuickSort(ary, comparator, p, q - 1);
+ doQuickSort(ary, comparator, q + 1, r);
+ }
+ }
+
+ /**
+ * Sort the given array in-place with the given comparator function.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ */
+ quickSort$1.quickSort = function (ary, comparator) {
+ doQuickSort(ary, comparator, 0, ary.length - 1);
+ };
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ var util$1 = util$5;
+ var binarySearch = binarySearch$1;
+ var ArraySet = arraySet.ArraySet;
+ var base64VLQ = base64Vlq;
+ var quickSort = quickSort$1.quickSort;
+
+ function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ return sourceMap.sections != null
+ ? new IndexedSourceMapConsumer(sourceMap)
+ : new BasicSourceMapConsumer(sourceMap);
+ }
+
+ SourceMapConsumer.fromSourceMap = function(aSourceMap) {
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
+ };
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ SourceMapConsumer.prototype._version = 3;
+
+ // `__generatedMappings` and `__originalMappings` are arrays that hold the
+ // parsed mapping coordinates from the source map's "mappings" attribute. They
+ // are lazily instantiated, accessed via the `_generatedMappings` and
+ // `_originalMappings` getters respectively, and we only parse the mappings
+ // and create these arrays once queried for a source location. We jump through
+ // these hoops because there can be many thousands of mappings, and parsing
+ // them is expensive, so we only want to do it if we must.
+ //
+ // Each object in the arrays is of the form:
+ //
+ // {
+ // generatedLine: The line number in the generated code,
+ // generatedColumn: The column number in the generated code,
+ // source: The path to the original source file that generated this
+ // chunk of code,
+ // originalLine: The line number in the original source that
+ // corresponds to this chunk of generated code,
+ // originalColumn: The column number in the original source that
+ // corresponds to this chunk of generated code,
+ // name: The name of the original symbol which generated this chunk of
+ // code.
+ // }
+ //
+ // All properties except for `generatedLine` and `generatedColumn` can be
+ // `null`.
+ //
+ // `_generatedMappings` is ordered by the generated positions.
+ //
+ // `_originalMappings` is ordered by the original positions.
+
+ SourceMapConsumer.prototype.__generatedMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+ });
+
+ SourceMapConsumer.prototype.__originalMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+ });
+
+ SourceMapConsumer.prototype._charIsMappingSeparator =
+ function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
+ var c = aStr.charAt(index);
+ return c === ";" || c === ",";
+ };
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ throw new Error("Subclasses must implement _parseMappings");
+ };
+
+ SourceMapConsumer.GENERATED_ORDER = 1;
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
+
+ /**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+ SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
+ if (source != null && sourceRoot != null) {
+ source = util$1.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name === null ? null : this._names.at(mapping.name)
+ };
+ }, this).forEach(aCallback, context);
+ };
+
+ /**
+ * Returns all generated line and column information for the original source,
+ * line, and column provided. If no column is provided, returns all mappings
+ * corresponding to a either the line we are searching for or the next
+ * closest line that has any mappings. Otherwise, returns all mappings
+ * corresponding to the given line and either the column we are searching for
+ * or the next closest column that has any offsets.
+ *
+ * The only argument is an object with the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: Optional. the column number in the original source.
+ *
+ * and an array of objects is returned, each with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ SourceMapConsumer.prototype.allGeneratedPositionsFor =
+ function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
+ var line = util$1.getArg(aArgs, 'line');
+
+ // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
+ // returns the index of the closest mapping less than the needle. By
+ // setting needle.originalColumn to 0, we thus find the last mapping for
+ // the given line, provided such a mapping exists.
+ var needle = {
+ source: util$1.getArg(aArgs, 'source'),
+ originalLine: line,
+ originalColumn: util$1.getArg(aArgs, 'column', 0)
+ };
+
+ if (this.sourceRoot != null) {
+ needle.source = util$1.relative(this.sourceRoot, needle.source);
+ }
+ if (!this._sources.has(needle.source)) {
+ return [];
+ }
+ needle.source = this._sources.indexOf(needle.source);
+
+ var mappings = [];
+
+ var index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util$1.compareByOriginalPositions,
+ binarySearch.LEAST_UPPER_BOUND);
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (aArgs.column === undefined) {
+ var originalLine = mapping.originalLine;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we found. Since
+ // mappings are sorted, this is guaranteed to find all mappings for
+ // the line we found.
+ while (mapping && mapping.originalLine === originalLine) {
+ mappings.push({
+ line: util$1.getArg(mapping, 'generatedLine', null),
+ column: util$1.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ } else {
+ var originalColumn = mapping.originalColumn;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we were searching for.
+ // Since mappings are sorted, this is guaranteed to find all mappings for
+ // the line we are searching for.
+ while (mapping &&
+ mapping.originalLine === line &&
+ mapping.originalColumn == originalColumn) {
+ mappings.push({
+ line: util$1.getArg(mapping, 'generatedLine', null),
+ column: util$1.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ }
+ }
+
+ return mappings;
+ };
+
+ sourceMapConsumer.SourceMapConsumer = SourceMapConsumer;
+
+ /**
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The only parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+ function BasicSourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util$1.getArg(sourceMap, 'version');
+ var sources = util$1.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util$1.getArg(sourceMap, 'names', []);
+ var sourceRoot = util$1.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util$1.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util$1.getArg(sourceMap, 'mappings');
+ var file = util$1.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ sources = sources
+ .map(String)
+ // Some source maps produce relative source paths like "./foo.js" instead of
+ // "foo.js". Normalize these first so that future comparisons will succeed.
+ // See bugzil.la/1090768.
+ .map(util$1.normalize)
+ // Always ensure that absolute sources are internally stored relative to
+ // the source root, if the source root is absolute. Not doing this would
+ // be particularly problematic when the source root is a prefix of the
+ // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
+ .map(function (source) {
+ return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source)
+ ? util$1.relative(sourceRoot, source)
+ : source;
+ });
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names.map(String), true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+ }
+
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
+
+ /**
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @returns BasicSourceMapConsumer
+ */
+ BasicSourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
+
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+
+ // Because we are modifying the entries (by converting string sources and
+ // names to indices into the sources and names ArraySets), we have to make
+ // a copy of the entry or else bad things happen. Shared mutable state
+ // strikes again! See github issue #191.
+
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
+ var destGeneratedMappings = smc.__generatedMappings = [];
+ var destOriginalMappings = smc.__originalMappings = [];
+
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
+ var srcMapping = generatedMappings[i];
+ var destMapping = new Mapping;
+ destMapping.generatedLine = srcMapping.generatedLine;
+ destMapping.generatedColumn = srcMapping.generatedColumn;
+
+ if (srcMapping.source) {
+ destMapping.source = sources.indexOf(srcMapping.source);
+ destMapping.originalLine = srcMapping.originalLine;
+ destMapping.originalColumn = srcMapping.originalColumn;
+
+ if (srcMapping.name) {
+ destMapping.name = names.indexOf(srcMapping.name);
+ }
+
+ destOriginalMappings.push(destMapping);
+ }
+
+ destGeneratedMappings.push(destMapping);
+ }
+
+ quickSort(smc.__originalMappings, util$1.compareByOriginalPositions);
+
+ return smc;
+ };
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ BasicSourceMapConsumer.prototype._version = 3;
+
+ /**
+ * The list of original sources.
+ */
+ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot != null ? util$1.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+ });
+
+ /**
+ * Provide the JIT with a nice shape / hidden class.
+ */
+ function Mapping() {
+ this.generatedLine = 0;
+ this.generatedColumn = 0;
+ this.source = null;
+ this.originalLine = null;
+ this.originalColumn = null;
+ this.name = null;
+ }
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ BasicSourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var length = aStr.length;
+ var index = 0;
+ var cachedSegments = {};
+ var temp = {};
+ var originalMappings = [];
+ var generatedMappings = [];
+ var mapping, str, segment, end, value;
+
+ while (index < length) {
+ if (aStr.charAt(index) === ';') {
+ generatedLine++;
+ index++;
+ previousGeneratedColumn = 0;
+ }
+ else if (aStr.charAt(index) === ',') {
+ index++;
+ }
+ else {
+ mapping = new Mapping();
+ mapping.generatedLine = generatedLine;
+
+ // Because each offset is encoded relative to the previous one,
+ // many segments often have the same encoding. We can exploit this
+ // fact by caching the parsed variable length fields of each segment,
+ // allowing us to avoid a second parse if we encounter the same
+ // segment again.
+ for (end = index; end < length; end++) {
+ if (this._charIsMappingSeparator(aStr, end)) {
+ break;
+ }
+ }
+ str = aStr.slice(index, end);
+
+ segment = cachedSegments[str];
+ if (segment) {
+ index += str.length;
+ } else {
+ segment = [];
+ while (index < end) {
+ base64VLQ.decode(aStr, index, temp);
+ value = temp.value;
+ index = temp.rest;
+ segment.push(value);
+ }
+
+ if (segment.length === 2) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ if (segment.length === 3) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ cachedSegments[str] = segment;
+ }
+
+ // Generated column.
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (segment.length > 1) {
+ // Original source.
+ mapping.source = previousSource + segment[1];
+ previousSource += segment[1];
+
+ // Original line.
+ mapping.originalLine = previousOriginalLine + segment[2];
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+
+ // Original column.
+ mapping.originalColumn = previousOriginalColumn + segment[3];
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (segment.length > 4) {
+ // Original name.
+ mapping.name = previousName + segment[4];
+ previousName += segment[4];
+ }
+ }
+
+ generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ originalMappings.push(mapping);
+ }
+ }
+ }
+
+ quickSort(generatedMappings, util$1.compareByGeneratedPositionsDeflated);
+ this.__generatedMappings = generatedMappings;
+
+ quickSort(originalMappings, util$1.compareByOriginalPositions);
+ this.__originalMappings = originalMappings;
+ };
+
+ /**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+ BasicSourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator, aBias) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
+ };
+
+ /**
+ * Compute the last column for each generated mapping. The last column is
+ * inclusive.
+ */
+ BasicSourceMapConsumer.prototype.computeColumnSpans =
+ function SourceMapConsumer_computeColumnSpans() {
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
+ var mapping = this._generatedMappings[index];
+
+ // Mappings do not contain a field for the last generated columnt. We
+ // can come up with an optimistic estimate, however, by assuming that
+ // mappings are contiguous (i.e. given two consecutive mappings, the
+ // first mapping ends where the second one starts).
+ if (index + 1 < this._generatedMappings.length) {
+ var nextMapping = this._generatedMappings[index + 1];
+
+ if (mapping.generatedLine === nextMapping.generatedLine) {
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
+ continue;
+ }
+ }
+
+ // The last mapping for each line spans the entire line.
+ mapping.lastGeneratedColumn = Infinity;
+ }
+ };
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+ BasicSourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util$1.getArg(aArgs, 'line'),
+ generatedColumn: util$1.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util$1.compareByGeneratedPositionsDeflated,
+ util$1.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._generatedMappings[index];
+
+ if (mapping.generatedLine === needle.generatedLine) {
+ var source = util$1.getArg(mapping, 'source', null);
+ if (source !== null) {
+ source = this._sources.at(source);
+ if (this.sourceRoot != null) {
+ source = util$1.join(this.sourceRoot, source);
+ }
+ }
+ var name = util$1.getArg(mapping, 'name', null);
+ if (name !== null) {
+ name = this._names.at(name);
+ }
+ return {
+ source: source,
+ line: util$1.getArg(mapping, 'originalLine', null),
+ column: util$1.getArg(mapping, 'originalColumn', null),
+ name: name
+ };
+ }
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+ /**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function BasicSourceMapConsumer_hasContentsOfAllSources() {
+ if (!this.sourcesContent) {
+ return false;
+ }
+ return this.sourcesContent.length >= this._sources.size() &&
+ !this.sourcesContent.some(function (sc) { return sc == null; });
+ };
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+ BasicSourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ if (this.sourceRoot != null) {
+ aSource = util$1.relative(this.sourceRoot, aSource);
+ }
+
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+
+ var url;
+ if (this.sourceRoot != null
+ && (url = util$1.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + aSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
+ }
+ }
+
+ // This function is used recursively from
+ // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
+ // don't want to throw if we can't find the source - we just want to
+ // return null, so we provide a flag to exit gracefully.
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ BasicSourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var source = util$1.getArg(aArgs, 'source');
+ if (this.sourceRoot != null) {
+ source = util$1.relative(this.sourceRoot, source);
+ }
+ if (!this._sources.has(source)) {
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ }
+ source = this._sources.indexOf(source);
+
+ var needle = {
+ source: source,
+ originalLine: util$1.getArg(aArgs, 'line'),
+ originalColumn: util$1.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util$1.compareByOriginalPositions,
+ util$1.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (mapping.source === needle.source) {
+ return {
+ line: util$1.getArg(mapping, 'generatedLine', null),
+ column: util$1.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
+ };
+ }
+ }
+
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ };
+
+ sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer;
+
+ /**
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
+ * we can query for information. It differs from BasicSourceMapConsumer in
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
+ * input.
+ *
+ * The only parameter is a raw source map (either as a JSON string, or already
+ * parsed to an object). According to the spec for indexed source maps, they
+ * have the following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - file: Optional. The generated file this source map is associated with.
+ * - sections: A list of section definitions.
+ *
+ * Each value under the "sections" field has two fields:
+ * - offset: The offset into the original specified at which this section
+ * begins to apply, defined as an object with a "line" and "column"
+ * field.
+ * - map: A source map definition. This source map could also be indexed,
+ * but doesn't have to be.
+ *
+ * Instead of the "map" field, it's also possible to have a "url" field
+ * specifying a URL to retrieve a source map from, but that's currently
+ * unsupported.
+ *
+ * Here's an example source map, taken from the source map spec[0], but
+ * modified to omit a section which uses the "url" field.
+ *
+ * {
+ * version : 3,
+ * file: "app.js",
+ * sections: [{
+ * offset: {line:100, column:10},
+ * map: {
+ * version : 3,
+ * file: "section.js",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AAAA,E;;ABCDE;"
+ * }
+ * }],
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
+ */
+ function IndexedSourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util$1.getArg(sourceMap, 'version');
+ var sections = util$1.getArg(sourceMap, 'sections');
+
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+
+ var lastOffset = {
+ line: -1,
+ column: 0
+ };
+ this._sections = sections.map(function (s) {
+ if (s.url) {
+ // The url field will require support for asynchronicity.
+ // See https://github.com/mozilla/source-map/issues/16
+ throw new Error('Support for url field in sections not implemented.');
+ }
+ var offset = util$1.getArg(s, 'offset');
+ var offsetLine = util$1.getArg(offset, 'line');
+ var offsetColumn = util$1.getArg(offset, 'column');
+
+ if (offsetLine < lastOffset.line ||
+ (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
+ throw new Error('Section offsets must be ordered and non-overlapping.');
+ }
+ lastOffset = offset;
+
+ return {
+ generatedOffset: {
+ // The offset fields are 0-based, but we use 1-based indices when
+ // encoding/decoding from VLQ.
+ generatedLine: offsetLine + 1,
+ generatedColumn: offsetColumn + 1
+ },
+ consumer: new SourceMapConsumer(util$1.getArg(s, 'map'))
+ }
+ });
+ }
+
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ IndexedSourceMapConsumer.prototype._version = 3;
+
+ /**
+ * The list of original sources.
+ */
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ var sources = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
+ sources.push(this._sections[i].consumer.sources[j]);
+ }
+ }
+ return sources;
+ }
+ });
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+ IndexedSourceMapConsumer.prototype.originalPositionFor =
+ function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util$1.getArg(aArgs, 'line'),
+ generatedColumn: util$1.getArg(aArgs, 'column')
+ };
+
+ // Find the section containing the generated position we're trying to map
+ // to an original position.
+ var sectionIndex = binarySearch.search(needle, this._sections,
+ function(needle, section) {
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return (needle.generatedColumn -
+ section.generatedOffset.generatedColumn);
+ });
+ var section = this._sections[sectionIndex];
+
+ if (!section) {
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ }
+
+ return section.consumer.originalPositionFor({
+ line: needle.generatedLine -
+ (section.generatedOffset.generatedLine - 1),
+ column: needle.generatedColumn -
+ (section.generatedOffset.generatedLine === needle.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ bias: aArgs.bias
+ });
+ };
+
+ /**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function IndexedSourceMapConsumer_hasContentsOfAllSources() {
+ return this._sections.every(function (s) {
+ return s.consumer.hasContentsOfAllSources();
+ });
+ };
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+ IndexedSourceMapConsumer.prototype.sourceContentFor =
+ function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ var content = section.consumer.sourceContentFor(aSource, true);
+ if (content) {
+ return content;
+ }
+ }
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ IndexedSourceMapConsumer.prototype.generatedPositionFor =
+ function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ // Only consider this section if the requested source is in the list of
+ // sources of the consumer.
+ if (section.consumer.sources.indexOf(util$1.getArg(aArgs, 'source')) === -1) {
+ continue;
+ }
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
+ if (generatedPosition) {
+ var ret = {
+ line: generatedPosition.line +
+ (section.generatedOffset.generatedLine - 1),
+ column: generatedPosition.column +
+ (section.generatedOffset.generatedLine === generatedPosition.line
+ ? section.generatedOffset.generatedColumn - 1
+ : 0)
+ };
+ return ret;
+ }
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ };
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ IndexedSourceMapConsumer.prototype._parseMappings =
+ function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+ var sectionMappings = section.consumer._generatedMappings;
+ for (var j = 0; j < sectionMappings.length; j++) {
+ var mapping = sectionMappings[j];
+
+ var source = section.consumer._sources.at(mapping.source);
+ if (section.consumer.sourceRoot !== null) {
+ source = util$1.join(section.consumer.sourceRoot, source);
+ }
+ this._sources.add(source);
+ source = this._sources.indexOf(source);
+
+ var name = section.consumer._names.at(mapping.name);
+ this._names.add(name);
+ name = this._names.indexOf(name);
+
+ // The mappings coming from the consumer for the section have
+ // generated positions relative to the start of the section, so we
+ // need to offset them to be relative to the start of the concatenated
+ // generated file.
+ var adjustedMapping = {
+ source: source,
+ generatedLine: mapping.generatedLine +
+ (section.generatedOffset.generatedLine - 1),
+ generatedColumn: mapping.generatedColumn +
+ (section.generatedOffset.generatedLine === mapping.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: name
+ };
+
+ this.__generatedMappings.push(adjustedMapping);
+ if (typeof adjustedMapping.originalLine === 'number') {
+ this.__originalMappings.push(adjustedMapping);
+ }
+ }
+ }
+
+ quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated);
+ quickSort(this.__originalMappings, util$1.compareByOriginalPositions);
+ };
+
+ sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
+
+ var sourceNode = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ var SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
+ var util = util$5;
+
+ // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+ // operating systems these days (capturing the result).
+ var REGEX_NEWLINE = /(\r?\n)/;
+
+ // Newline character code for charCodeAt() comparisons
+ var NEWLINE_CODE = 10;
+
+ // Private symbol for identifying `SourceNode`s when multiple versions of
+ // the source-map library are loaded. This MUST NOT CHANGE across
+ // versions!
+ var isSourceNode = "$$$isSourceNode$$$";
+
+ /**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine == null ? null : aLine;
+ this.column = aColumn == null ? null : aColumn;
+ this.source = aSource == null ? null : aSource;
+ this.name = aName == null ? null : aName;
+ this[isSourceNode] = true;
+ if (aChunks != null) this.add(aChunks);
+ }
+
+ /**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ * @param aRelativePath Optional. The path that relative sources in the
+ * SourceMapConsumer should be relative to.
+ */
+ SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are accessed by calling `shiftNextLine`.
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ var remainingLinesIndex = 0;
+ var shiftNextLine = function() {
+ var lineContents = getNextLine();
+ // The last line of a file might not have a newline.
+ var newLine = getNextLine() || "";
+ return lineContents + newLine;
+
+ function getNextLine() {
+ return remainingLinesIndex < remainingLines.length ?
+ remainingLines[remainingLinesIndex++] : undefined;
+ }
+ };
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[remainingLinesIndex];
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[remainingLinesIndex];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLinesIndex < remainingLines.length) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aRelativePath != null) {
+ sourceFile = util.join(aRelativePath, sourceFile);
+ }
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ var source = aRelativePath
+ ? util.join(aRelativePath, mapping.source)
+ : mapping.source;
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+ /**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk[isSourceNode]) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+ };
+
+ /**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+ };
+
+ /**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild[isSourceNode]) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+ };
+
+ /**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+ SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+ /**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i][isSourceNode]) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+ /**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+ SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+ };
+
+ /**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column++;
+ }
+ }
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+ };
+
+ sourceNode.SourceNode = SourceNode;
+
+ sourceMap.SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
+ sourceMap.SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
+ sourceMap.SourceNode = sourceNode.SourceNode;
+
+ Object.defineProperty(sourceMap$1, "__esModule", {
+ value: true
+ });
+ sourceMap$1.default = void 0;
+
+ var _sourceMap$1 = sourceMap;
+
+ class SourceMap {
+ constructor(opts, code) {
+ this._cachedMap = void 0;
+ this._code = void 0;
+ this._opts = void 0;
+ this._rawMappings = void 0;
+ this._lastGenLine = void 0;
+ this._lastSourceLine = void 0;
+ this._lastSourceColumn = void 0;
+ this._cachedMap = null;
+ this._code = code;
+ this._opts = opts;
+ this._rawMappings = [];
+ }
+
+ get() {
+ if (!this._cachedMap) {
+ const map = this._cachedMap = new _sourceMap$1.SourceMapGenerator({
+ sourceRoot: this._opts.sourceRoot
+ });
+ const code = this._code;
+
+ if (typeof code === "string") {
+ map.setSourceContent(this._opts.sourceFileName.replace(/\\/g, "/"), code);
+ } else if (typeof code === "object") {
+ Object.keys(code).forEach(sourceFileName => {
+ map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
+ });
+ }
+
+ this._rawMappings.forEach(mapping => map.addMapping(mapping), map);
+ }
+
+ return this._cachedMap.toJSON();
+ }
+
+ getRawMappings() {
+ return this._rawMappings.slice();
+ }
+
+ mark(generatedLine, generatedColumn, line, column, identifierName, filename, force) {
+ if (this._lastGenLine !== generatedLine && line === null) return;
+
+ if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {
+ return;
+ }
+
+ this._cachedMap = null;
+ this._lastGenLine = generatedLine;
+ this._lastSourceLine = line;
+ this._lastSourceColumn = column;
+
+ this._rawMappings.push({
+ name: identifierName || undefined,
+ generated: {
+ line: generatedLine,
+ column: generatedColumn
+ },
+ source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\/g, "/"),
+ original: line == null ? undefined : {
+ line: line,
+ column: column
+ }
+ });
+ }
+
+ }
+
+ sourceMap$1.default = SourceMap;
+
+ var printer = {};
+
+ var buffer = {};
+
+ Object.defineProperty(buffer, "__esModule", {
+ value: true
+ });
+ buffer.default = void 0;
+ const SPACES_RE = /^[ \t]+$/;
+
+ let Buffer$1 = class Buffer {
+ constructor(map) {
+ this._map = null;
+ this._buf = "";
+ this._last = 0;
+ this._queue = [];
+ this._position = {
+ line: 1,
+ column: 0
+ };
+ this._sourcePosition = {
+ identifierName: null,
+ line: null,
+ column: null,
+ filename: null
+ };
+ this._disallowedPop = null;
+ this._map = map;
+ }
+
+ get() {
+ this._flush();
+
+ const map = this._map;
+ const result = {
+ code: this._buf.trimRight(),
+ map: null,
+ rawMappings: map == null ? void 0 : map.getRawMappings()
+ };
+
+ if (map) {
+ Object.defineProperty(result, "map", {
+ configurable: true,
+ enumerable: true,
+
+ get() {
+ return this.map = map.get();
+ },
+
+ set(value) {
+ Object.defineProperty(this, "map", {
+ value,
+ writable: true
+ });
+ }
+
+ });
+ }
+
+ return result;
+ }
+
+ append(str) {
+ this._flush();
+
+ const {
+ line,
+ column,
+ filename,
+ identifierName,
+ force
+ } = this._sourcePosition;
+
+ this._append(str, line, column, identifierName, filename, force);
+ }
+
+ queue(str) {
+ if (str === "\n") {
+ while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
+ this._queue.shift();
+ }
+ }
+
+ const {
+ line,
+ column,
+ filename,
+ identifierName,
+ force
+ } = this._sourcePosition;
+
+ this._queue.unshift([str, line, column, identifierName, filename, force]);
+ }
+
+ _flush() {
+ let item;
+
+ while (item = this._queue.pop()) {
+ this._append(...item);
+ }
+ }
+
+ _append(str, line, column, identifierName, filename, force) {
+ this._buf += str;
+ this._last = str.charCodeAt(str.length - 1);
+ let i = str.indexOf("\n");
+ let last = 0;
+
+ if (i !== 0) {
+ this._mark(line, column, identifierName, filename, force);
+ }
+
+ while (i !== -1) {
+ this._position.line++;
+ this._position.column = 0;
+ last = i + 1;
+
+ if (last < str.length) {
+ this._mark(++line, 0, identifierName, filename, force);
+ }
+
+ i = str.indexOf("\n", last);
+ }
+
+ this._position.column += str.length - last;
+ }
+
+ _mark(line, column, identifierName, filename, force) {
+ var _this$_map;
+
+ (_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);
+ }
+
+ removeTrailingNewline() {
+ if (this._queue.length > 0 && this._queue[0][0] === "\n") {
+ this._queue.shift();
+ }
+ }
+
+ removeLastSemicolon() {
+ if (this._queue.length > 0 && this._queue[0][0] === ";") {
+ this._queue.shift();
+ }
+ }
+
+ getLastChar() {
+ let last;
+
+ if (this._queue.length > 0) {
+ const str = this._queue[0][0];
+ last = str.charCodeAt(0);
+ } else {
+ last = this._last;
+ }
+
+ return last;
+ }
+
+ endsWithCharAndNewline() {
+ const queue = this._queue;
+
+ if (queue.length > 0) {
+ const last = queue[0][0];
+ const lastCp = last.charCodeAt(0);
+ if (lastCp !== 10) return;
+
+ if (queue.length > 1) {
+ const secondLast = queue[1][0];
+ return secondLast.charCodeAt(0);
+ } else {
+ return this._last;
+ }
+ }
+ }
+
+ hasContent() {
+ return this._queue.length > 0 || !!this._last;
+ }
+
+ exactSource(loc, cb) {
+ this.source("start", loc, true);
+ cb();
+ this.source("end", loc);
+
+ this._disallowPop("start", loc);
+ }
+
+ source(prop, loc, force) {
+ if (prop && !loc) return;
+
+ this._normalizePosition(prop, loc, this._sourcePosition, force);
+ }
+
+ withSource(prop, loc, cb) {
+ if (!this._map) return cb();
+ const originalLine = this._sourcePosition.line;
+ const originalColumn = this._sourcePosition.column;
+ const originalFilename = this._sourcePosition.filename;
+ const originalIdentifierName = this._sourcePosition.identifierName;
+ this.source(prop, loc);
+ cb();
+
+ if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
+ this._sourcePosition.line = originalLine;
+ this._sourcePosition.column = originalColumn;
+ this._sourcePosition.filename = originalFilename;
+ this._sourcePosition.identifierName = originalIdentifierName;
+ this._sourcePosition.force = false;
+ this._disallowedPop = null;
+ }
+ }
+
+ _disallowPop(prop, loc) {
+ if (prop && !loc) return;
+ this._disallowedPop = this._normalizePosition(prop, loc);
+ }
+
+ _normalizePosition(prop, loc, targetObj, force) {
+ const pos = loc ? loc[prop] : null;
+
+ if (targetObj === undefined) {
+ targetObj = {
+ identifierName: null,
+ line: null,
+ column: null,
+ filename: null,
+ force: false
+ };
+ }
+
+ const origLine = targetObj.line;
+ const origColumn = targetObj.column;
+ const origFilename = targetObj.filename;
+ targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null;
+ targetObj.line = pos == null ? void 0 : pos.line;
+ targetObj.column = pos == null ? void 0 : pos.column;
+ targetObj.filename = loc == null ? void 0 : loc.filename;
+
+ if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
+ targetObj.force = force;
+ }
+
+ return targetObj;
+ }
+
+ getCurrentColumn() {
+ const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ const lastIndex = extra.lastIndexOf("\n");
+ return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
+ }
+
+ getCurrentLine() {
+ const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ let count = 0;
+
+ for (let i = 0; i < extra.length; i++) {
+ if (extra[i] === "\n") count++;
+ }
+
+ return this._position.line + count;
+ }
+
+ };
+
+ buffer.default = Buffer$1;
+
+ var node = {};
+
+ var whitespace$1 = {};
+
+ Object.defineProperty(whitespace$1, "__esModule", {
+ value: true
+ });
+ whitespace$1.list = whitespace$1.nodes = void 0;
+
+ var _t$9 = lib$6;
+
+ const {
+ FLIPPED_ALIAS_KEYS: FLIPPED_ALIAS_KEYS$1,
+ isArrayExpression,
+ isAssignmentExpression: isAssignmentExpression$1,
+ isBinary: isBinary$1,
+ isBlockStatement,
+ isCallExpression: isCallExpression$3,
+ isFunction: isFunction$2,
+ isIdentifier: isIdentifier$2,
+ isLiteral: isLiteral$1,
+ isMemberExpression: isMemberExpression$3,
+ isObjectExpression,
+ isOptionalCallExpression: isOptionalCallExpression$1,
+ isOptionalMemberExpression: isOptionalMemberExpression$1,
+ isStringLiteral
+ } = _t$9;
+
+ function crawl(node, state = {}) {
+ if (isMemberExpression$3(node) || isOptionalMemberExpression$1(node)) {
+ crawl(node.object, state);
+ if (node.computed) crawl(node.property, state);
+ } else if (isBinary$1(node) || isAssignmentExpression$1(node)) {
+ crawl(node.left, state);
+ crawl(node.right, state);
+ } else if (isCallExpression$3(node) || isOptionalCallExpression$1(node)) {
+ state.hasCall = true;
+ crawl(node.callee, state);
+ } else if (isFunction$2(node)) {
+ state.hasFunction = true;
+ } else if (isIdentifier$2(node)) {
+ state.hasHelper = state.hasHelper || isHelper(node.callee);
+ }
+
+ return state;
+ }
+
+ function isHelper(node) {
+ if (isMemberExpression$3(node)) {
+ return isHelper(node.object) || isHelper(node.property);
+ } else if (isIdentifier$2(node)) {
+ return node.name === "require" || node.name[0] === "_";
+ } else if (isCallExpression$3(node)) {
+ return isHelper(node.callee);
+ } else if (isBinary$1(node) || isAssignmentExpression$1(node)) {
+ return isIdentifier$2(node.left) && isHelper(node.left) || isHelper(node.right);
+ } else {
+ return false;
+ }
+ }
+
+ function isType(node) {
+ return isLiteral$1(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier$2(node) || isMemberExpression$3(node);
+ }
+
+ const nodes = {
+ AssignmentExpression(node) {
+ const state = crawl(node.right);
+
+ if (state.hasCall && state.hasHelper || state.hasFunction) {
+ return {
+ before: state.hasFunction,
+ after: true
+ };
+ }
+ },
+
+ SwitchCase(node, parent) {
+ return {
+ before: !!node.consequent.length || parent.cases[0] === node,
+ after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node
+ };
+ },
+
+ LogicalExpression(node) {
+ if (isFunction$2(node.left) || isFunction$2(node.right)) {
+ return {
+ after: true
+ };
+ }
+ },
+
+ Literal(node) {
+ if (isStringLiteral(node) && node.value === "use strict") {
+ return {
+ after: true
+ };
+ }
+ },
+
+ CallExpression(node) {
+ if (isFunction$2(node.callee) || isHelper(node)) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ },
+
+ OptionalCallExpression(node) {
+ if (isFunction$2(node.callee)) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ },
+
+ VariableDeclaration(node) {
+ for (let i = 0; i < node.declarations.length; i++) {
+ const declar = node.declarations[i];
+ let enabled = isHelper(declar.id) && !isType(declar.init);
+
+ if (!enabled) {
+ const state = crawl(declar.init);
+ enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
+ }
+
+ if (enabled) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ }
+ },
+
+ IfStatement(node) {
+ if (isBlockStatement(node.consequent)) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ }
+
+ };
+ whitespace$1.nodes = nodes;
+
+ nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
+ if (parent.properties[0] === node) {
+ return {
+ before: true
+ };
+ }
+ };
+
+ nodes.ObjectTypeCallProperty = function (node, parent) {
+ var _parent$properties;
+
+ if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) {
+ return {
+ before: true
+ };
+ }
+ };
+
+ nodes.ObjectTypeIndexer = function (node, parent) {
+ var _parent$properties2, _parent$callPropertie;
+
+ if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) {
+ return {
+ before: true
+ };
+ }
+ };
+
+ nodes.ObjectTypeInternalSlot = function (node, parent) {
+ var _parent$properties3, _parent$callPropertie2, _parent$indexers;
+
+ if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) {
+ return {
+ before: true
+ };
+ }
+ };
+
+ const list = {
+ VariableDeclaration(node) {
+ return node.declarations.map(decl => decl.init);
+ },
+
+ ArrayExpression(node) {
+ return node.elements;
+ },
+
+ ObjectExpression(node) {
+ return node.properties;
+ }
+
+ };
+ whitespace$1.list = list;
+ [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
+ if (typeof amounts === "boolean") {
+ amounts = {
+ after: amounts,
+ before: amounts
+ };
+ }
+
+ [type].concat(FLIPPED_ALIAS_KEYS$1[type] || []).forEach(function (type) {
+ nodes[type] = function () {
+ return amounts;
+ };
+ });
+ });
+
+ var parentheses = {};
+
+ Object.defineProperty(parentheses, "__esModule", {
+ value: true
+ });
+ parentheses.NullableTypeAnnotation = NullableTypeAnnotation;
+ parentheses.FunctionTypeAnnotation = FunctionTypeAnnotation;
+ parentheses.UpdateExpression = UpdateExpression$1;
+ parentheses.ObjectExpression = ObjectExpression$1;
+ parentheses.DoExpression = DoExpression$1;
+ parentheses.Binary = Binary;
+ parentheses.IntersectionTypeAnnotation = parentheses.UnionTypeAnnotation = UnionTypeAnnotation;
+ parentheses.OptionalIndexedAccessType = OptionalIndexedAccessType;
+ parentheses.TSAsExpression = TSAsExpression$1;
+ parentheses.TSTypeAssertion = TSTypeAssertion$1;
+ parentheses.TSIntersectionType = parentheses.TSUnionType = TSUnionType$1;
+ parentheses.TSInferType = TSInferType$1;
+ parentheses.BinaryExpression = BinaryExpression;
+ parentheses.SequenceExpression = SequenceExpression$1;
+ parentheses.AwaitExpression = parentheses.YieldExpression = YieldExpression$1;
+ parentheses.ClassExpression = ClassExpression;
+ parentheses.UnaryLike = UnaryLike;
+ parentheses.FunctionExpression = FunctionExpression$1;
+ parentheses.ArrowFunctionExpression = ArrowFunctionExpression$1;
+ parentheses.ConditionalExpression = ConditionalExpression$1;
+ parentheses.OptionalCallExpression = parentheses.OptionalMemberExpression = OptionalMemberExpression$1;
+ parentheses.AssignmentExpression = AssignmentExpression$1;
+ parentheses.LogicalExpression = LogicalExpression;
+ parentheses.Identifier = Identifier$1;
+
+ var _t$8 = lib$6;
+
+ const {
+ isArrayTypeAnnotation,
+ isArrowFunctionExpression,
+ isAssignmentExpression,
+ isAwaitExpression,
+ isBinary,
+ isBinaryExpression,
+ isCallExpression: isCallExpression$2,
+ isClassDeclaration: isClassDeclaration$1,
+ isClassExpression,
+ isConditional,
+ isConditionalExpression,
+ isExportDeclaration,
+ isExportDefaultDeclaration: isExportDefaultDeclaration$1,
+ isExpressionStatement: isExpressionStatement$1,
+ isFor: isFor$1,
+ isForInStatement,
+ isForOfStatement,
+ isForStatement: isForStatement$1,
+ isIfStatement: isIfStatement$1,
+ isIndexedAccessType,
+ isIntersectionTypeAnnotation,
+ isLogicalExpression,
+ isMemberExpression: isMemberExpression$2,
+ isNewExpression: isNewExpression$2,
+ isNullableTypeAnnotation,
+ isObjectPattern,
+ isOptionalCallExpression,
+ isOptionalMemberExpression,
+ isReturnStatement,
+ isSequenceExpression,
+ isSwitchStatement,
+ isTSArrayType,
+ isTSAsExpression,
+ isTSIntersectionType,
+ isTSNonNullExpression,
+ isTSOptionalType,
+ isTSRestType,
+ isTSTypeAssertion,
+ isTSUnionType,
+ isTaggedTemplateExpression,
+ isThrowStatement,
+ isTypeAnnotation,
+ isUnaryLike,
+ isUnionTypeAnnotation,
+ isVariableDeclarator,
+ isWhileStatement,
+ isYieldExpression
+ } = _t$8;
+ const PRECEDENCE = {
+ "||": 0,
+ "??": 0,
+ "&&": 1,
+ "|": 2,
+ "^": 3,
+ "&": 4,
+ "==": 5,
+ "===": 5,
+ "!=": 5,
+ "!==": 5,
+ "<": 6,
+ ">": 6,
+ "<=": 6,
+ ">=": 6,
+ in: 6,
+ instanceof: 6,
+ ">>": 7,
+ "<<": 7,
+ ">>>": 7,
+ "+": 8,
+ "-": 8,
+ "*": 9,
+ "/": 9,
+ "%": 9,
+ "**": 10
+ };
+
+ const isClassExtendsClause = (node, parent) => (isClassDeclaration$1(parent) || isClassExpression(parent)) && parent.superClass === node;
+
+ const hasPostfixPart = (node, parent) => (isMemberExpression$2(parent) || isOptionalMemberExpression(parent)) && parent.object === node || (isCallExpression$2(parent) || isOptionalCallExpression(parent) || isNewExpression$2(parent)) && parent.callee === node || isTaggedTemplateExpression(parent) && parent.tag === node || isTSNonNullExpression(parent);
+
+ function NullableTypeAnnotation(node, parent) {
+ return isArrayTypeAnnotation(parent);
+ }
+
+ function FunctionTypeAnnotation(node, parent, printStack) {
+ return isUnionTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isArrayTypeAnnotation(parent) || isTypeAnnotation(parent) && isArrowFunctionExpression(printStack[printStack.length - 3]);
+ }
+
+ function UpdateExpression$1(node, parent) {
+ return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
+ }
+
+ function ObjectExpression$1(node, parent, printStack) {
+ return isFirstInContext(printStack, {
+ expressionStatement: true,
+ arrowBody: true
+ });
+ }
+
+ function DoExpression$1(node, parent, printStack) {
+ return !node.async && isFirstInContext(printStack, {
+ expressionStatement: true
+ });
+ }
+
+ function Binary(node, parent) {
+ if (node.operator === "**" && isBinaryExpression(parent, {
+ operator: "**"
+ })) {
+ return parent.left === node;
+ }
+
+ if (isClassExtendsClause(node, parent)) {
+ return true;
+ }
+
+ if (hasPostfixPart(node, parent) || isUnaryLike(parent) || isAwaitExpression(parent)) {
+ return true;
+ }
+
+ if (isBinary(parent)) {
+ const parentOp = parent.operator;
+ const parentPos = PRECEDENCE[parentOp];
+ const nodeOp = node.operator;
+ const nodePos = PRECEDENCE[nodeOp];
+
+ if (parentPos === nodePos && parent.right === node && !isLogicalExpression(parent) || parentPos > nodePos) {
+ return true;
+ }
+ }
+ }
+
+ function UnionTypeAnnotation(node, parent) {
+ return isArrayTypeAnnotation(parent) || isNullableTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isUnionTypeAnnotation(parent);
+ }
+
+ function OptionalIndexedAccessType(node, parent) {
+ return isIndexedAccessType(parent, {
+ objectType: node
+ });
+ }
+
+ function TSAsExpression$1() {
+ return true;
+ }
+
+ function TSTypeAssertion$1() {
+ return true;
+ }
+
+ function TSUnionType$1(node, parent) {
+ return isTSArrayType(parent) || isTSOptionalType(parent) || isTSIntersectionType(parent) || isTSUnionType(parent) || isTSRestType(parent);
+ }
+
+ function TSInferType$1(node, parent) {
+ return isTSArrayType(parent) || isTSOptionalType(parent);
+ }
+
+ function BinaryExpression(node, parent) {
+ return node.operator === "in" && (isVariableDeclarator(parent) || isFor$1(parent));
+ }
+
+ function SequenceExpression$1(node, parent) {
+ if (isForStatement$1(parent) || isThrowStatement(parent) || isReturnStatement(parent) || isIfStatement$1(parent) && parent.test === node || isWhileStatement(parent) && parent.test === node || isForInStatement(parent) && parent.right === node || isSwitchStatement(parent) && parent.discriminant === node || isExpressionStatement$1(parent) && parent.expression === node) {
+ return false;
+ }
+
+ return true;
+ }
+
+ function YieldExpression$1(node, parent) {
+ return isBinary(parent) || isUnaryLike(parent) || hasPostfixPart(node, parent) || isAwaitExpression(parent) && isYieldExpression(node) || isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
+ }
+
+ function ClassExpression(node, parent, printStack) {
+ return isFirstInContext(printStack, {
+ expressionStatement: true,
+ exportDefault: true
+ });
+ }
+
+ function UnaryLike(node, parent) {
+ return hasPostfixPart(node, parent) || isBinaryExpression(parent, {
+ operator: "**",
+ left: node
+ }) || isClassExtendsClause(node, parent);
+ }
+
+ function FunctionExpression$1(node, parent, printStack) {
+ return isFirstInContext(printStack, {
+ expressionStatement: true,
+ exportDefault: true
+ });
+ }
+
+ function ArrowFunctionExpression$1(node, parent) {
+ return isExportDeclaration(parent) || ConditionalExpression$1(node, parent);
+ }
+
+ function ConditionalExpression$1(node, parent) {
+ if (isUnaryLike(parent) || isBinary(parent) || isConditionalExpression(parent, {
+ test: node
+ }) || isAwaitExpression(parent) || isTSTypeAssertion(parent) || isTSAsExpression(parent)) {
+ return true;
+ }
+
+ return UnaryLike(node, parent);
+ }
+
+ function OptionalMemberExpression$1(node, parent) {
+ return isCallExpression$2(parent, {
+ callee: node
+ }) || isMemberExpression$2(parent, {
+ object: node
+ });
+ }
+
+ function AssignmentExpression$1(node, parent) {
+ if (isObjectPattern(node.left)) {
+ return true;
+ } else {
+ return ConditionalExpression$1(node, parent);
+ }
+ }
+
+ function LogicalExpression(node, parent) {
+ switch (node.operator) {
+ case "||":
+ if (!isLogicalExpression(parent)) return false;
+ return parent.operator === "??" || parent.operator === "&&";
+
+ case "&&":
+ return isLogicalExpression(parent, {
+ operator: "??"
+ });
+
+ case "??":
+ return isLogicalExpression(parent) && parent.operator !== "??";
+ }
+ }
+
+ function Identifier$1(node, parent, printStack) {
+ if (node.name === "let") {
+ const isFollowedByBracket = isMemberExpression$2(parent, {
+ object: node,
+ computed: true
+ }) || isOptionalMemberExpression(parent, {
+ object: node,
+ computed: true,
+ optional: false
+ });
+ return isFirstInContext(printStack, {
+ expressionStatement: isFollowedByBracket,
+ forHead: isFollowedByBracket,
+ forInHead: isFollowedByBracket,
+ forOfHead: true
+ });
+ }
+
+ return node.name === "async" && isForOfStatement(parent) && node === parent.left;
+ }
+
+ function isFirstInContext(printStack, {
+ expressionStatement = false,
+ arrowBody = false,
+ exportDefault = false,
+ forHead = false,
+ forInHead = false,
+ forOfHead = false
+ }) {
+ let i = printStack.length - 1;
+ let node = printStack[i];
+ i--;
+ let parent = printStack[i];
+
+ while (i >= 0) {
+ if (expressionStatement && isExpressionStatement$1(parent, {
+ expression: node
+ }) || exportDefault && isExportDefaultDeclaration$1(parent, {
+ declaration: node
+ }) || arrowBody && isArrowFunctionExpression(parent, {
+ body: node
+ }) || forHead && isForStatement$1(parent, {
+ init: node
+ }) || forInHead && isForInStatement(parent, {
+ left: node
+ }) || forOfHead && isForOfStatement(parent, {
+ left: node
+ })) {
+ return true;
+ }
+
+ if (hasPostfixPart(node, parent) && !isNewExpression$2(parent) || isSequenceExpression(parent) && parent.expressions[0] === node || isConditional(parent, {
+ test: node
+ }) || isBinary(parent, {
+ left: node
+ }) || isAssignmentExpression(parent, {
+ left: node
+ })) {
+ node = parent;
+ i--;
+ parent = printStack[i];
+ } else {
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+ Object.defineProperty(node, "__esModule", {
+ value: true
+ });
+ node.needsWhitespace = needsWhitespace;
+ node.needsWhitespaceBefore = needsWhitespaceBefore$1;
+ node.needsWhitespaceAfter = needsWhitespaceAfter$1;
+ node.needsParens = needsParens$1;
+
+ var whitespace = whitespace$1;
+
+ var parens = parentheses;
+
+ var _t$7 = lib$6;
+
+ const {
+ FLIPPED_ALIAS_KEYS,
+ isCallExpression: isCallExpression$1,
+ isExpressionStatement,
+ isMemberExpression: isMemberExpression$1,
+ isNewExpression: isNewExpression$1
+ } = _t$7;
+
+ function expandAliases(obj) {
+ const newObj = {};
+
+ function add(type, func) {
+ const fn = newObj[type];
+ newObj[type] = fn ? function (node, parent, stack) {
+ const result = fn(node, parent, stack);
+ return result == null ? func(node, parent, stack) : result;
+ } : func;
+ }
+
+ for (const type of Object.keys(obj)) {
+ const aliases = FLIPPED_ALIAS_KEYS[type];
+
+ if (aliases) {
+ for (const alias of aliases) {
+ add(alias, obj[type]);
+ }
+ } else {
+ add(type, obj[type]);
+ }
+ }
+
+ return newObj;
+ }
+
+ const expandedParens = expandAliases(parens);
+ const expandedWhitespaceNodes = expandAliases(whitespace.nodes);
+ const expandedWhitespaceList = expandAliases(whitespace.list);
+
+ function find(obj, node, parent, printStack) {
+ const fn = obj[node.type];
+ return fn ? fn(node, parent, printStack) : null;
+ }
+
+ function isOrHasCallExpression(node) {
+ if (isCallExpression$1(node)) {
+ return true;
+ }
+
+ return isMemberExpression$1(node) && isOrHasCallExpression(node.object);
+ }
+
+ function needsWhitespace(node, parent, type) {
+ if (!node) return 0;
+
+ if (isExpressionStatement(node)) {
+ node = node.expression;
+ }
+
+ let linesInfo = find(expandedWhitespaceNodes, node, parent);
+
+ if (!linesInfo) {
+ const items = find(expandedWhitespaceList, node, parent);
+
+ if (items) {
+ for (let i = 0; i < items.length; i++) {
+ linesInfo = needsWhitespace(items[i], node, type);
+ if (linesInfo) break;
+ }
+ }
+ }
+
+ if (typeof linesInfo === "object" && linesInfo !== null) {
+ return linesInfo[type] || 0;
+ }
+
+ return 0;
+ }
+
+ function needsWhitespaceBefore$1(node, parent) {
+ return needsWhitespace(node, parent, "before");
+ }
+
+ function needsWhitespaceAfter$1(node, parent) {
+ return needsWhitespace(node, parent, "after");
+ }
+
+ function needsParens$1(node, parent, printStack) {
+ if (!parent) return false;
+
+ if (isNewExpression$1(parent) && parent.callee === node) {
+ if (isOrHasCallExpression(node)) return true;
+ }
+
+ return find(expandedParens, node, parent, printStack);
+ }
+
+ var generators = {};
+
+ var templateLiterals = {};
+
+ Object.defineProperty(templateLiterals, "__esModule", {
+ value: true
+ });
+ templateLiterals.TaggedTemplateExpression = TaggedTemplateExpression;
+ templateLiterals.TemplateElement = TemplateElement;
+ templateLiterals.TemplateLiteral = TemplateLiteral;
+
+ function TaggedTemplateExpression(node) {
+ this.print(node.tag, node);
+ this.print(node.typeParameters, node);
+ this.print(node.quasi, node);
+ }
+
+ function TemplateElement(node, parent) {
+ const isFirst = parent.quasis[0] === node;
+ const isLast = parent.quasis[parent.quasis.length - 1] === node;
+ const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
+ this.token(value);
+ }
+
+ function TemplateLiteral(node) {
+ const quasis = node.quasis;
+
+ for (let i = 0; i < quasis.length; i++) {
+ this.print(quasis[i], node);
+
+ if (i + 1 < quasis.length) {
+ this.print(node.expressions[i], node);
+ }
+ }
+ }
+
+ var expressions = {};
+
+ Object.defineProperty(expressions, "__esModule", {
+ value: true
+ });
+ expressions.UnaryExpression = UnaryExpression;
+ expressions.DoExpression = DoExpression;
+ expressions.ParenthesizedExpression = ParenthesizedExpression;
+ expressions.UpdateExpression = UpdateExpression;
+ expressions.ConditionalExpression = ConditionalExpression;
+ expressions.NewExpression = NewExpression;
+ expressions.SequenceExpression = SequenceExpression;
+ expressions.ThisExpression = ThisExpression;
+ expressions.Super = Super;
+ expressions.Decorator = Decorator;
+ expressions.OptionalMemberExpression = OptionalMemberExpression;
+ expressions.OptionalCallExpression = OptionalCallExpression;
+ expressions.CallExpression = CallExpression;
+ expressions.Import = Import;
+ expressions.EmptyStatement = EmptyStatement;
+ expressions.ExpressionStatement = ExpressionStatement;
+ expressions.AssignmentPattern = AssignmentPattern;
+ expressions.LogicalExpression = expressions.BinaryExpression = expressions.AssignmentExpression = AssignmentExpression;
+ expressions.BindExpression = BindExpression;
+ expressions.MemberExpression = MemberExpression;
+ expressions.MetaProperty = MetaProperty;
+ expressions.PrivateName = PrivateName;
+ expressions.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
+ expressions.ModuleExpression = ModuleExpression;
+ expressions.AwaitExpression = expressions.YieldExpression = void 0;
+
+ var _t$6 = lib$6;
+
+ var n$1 = node;
+
+ const {
+ isCallExpression,
+ isLiteral,
+ isMemberExpression,
+ isNewExpression
+ } = _t$6;
+
+ function UnaryExpression(node) {
+ if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
+ this.word(node.operator);
+ this.space();
+ } else {
+ this.token(node.operator);
+ }
+
+ this.print(node.argument, node);
+ }
+
+ function DoExpression(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ this.word("do");
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function ParenthesizedExpression(node) {
+ this.token("(");
+ this.print(node.expression, node);
+ this.token(")");
+ }
+
+ function UpdateExpression(node) {
+ if (node.prefix) {
+ this.token(node.operator);
+ this.print(node.argument, node);
+ } else {
+ this.startTerminatorless(true);
+ this.print(node.argument, node);
+ this.endTerminatorless();
+ this.token(node.operator);
+ }
+ }
+
+ function ConditionalExpression(node) {
+ this.print(node.test, node);
+ this.space();
+ this.token("?");
+ this.space();
+ this.print(node.consequent, node);
+ this.space();
+ this.token(":");
+ this.space();
+ this.print(node.alternate, node);
+ }
+
+ function NewExpression(node, parent) {
+ this.word("new");
+ this.space();
+ this.print(node.callee, node);
+
+ if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
+ callee: node
+ }) && !isMemberExpression(parent) && !isNewExpression(parent)) {
+ return;
+ }
+
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+ }
+
+ function SequenceExpression(node) {
+ this.printList(node.expressions, node);
+ }
+
+ function ThisExpression() {
+ this.word("this");
+ }
+
+ function Super() {
+ this.word("super");
+ }
+
+ function Decorator(node) {
+ this.token("@");
+ this.print(node.expression, node);
+ this.newline();
+ }
+
+ function OptionalMemberExpression(node) {
+ this.print(node.object, node);
+
+ if (!node.computed && isMemberExpression(node.property)) {
+ throw new TypeError("Got a MemberExpression for MemberExpression property");
+ }
+
+ let computed = node.computed;
+
+ if (isLiteral(node.property) && typeof node.property.value === "number") {
+ computed = true;
+ }
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ if (computed) {
+ this.token("[");
+ this.print(node.property, node);
+ this.token("]");
+ } else {
+ if (!node.optional) {
+ this.token(".");
+ }
+
+ this.print(node.property, node);
+ }
+ }
+
+ function OptionalCallExpression(node) {
+ this.print(node.callee, node);
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+ }
+
+ function CallExpression(node) {
+ this.print(node.callee, node);
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+ }
+
+ function Import() {
+ this.word("import");
+ }
+
+ function buildYieldAwait(keyword) {
+ return function (node) {
+ this.word(keyword);
+
+ if (node.delegate) {
+ this.token("*");
+ }
+
+ if (node.argument) {
+ this.space();
+ const terminatorState = this.startTerminatorless();
+ this.print(node.argument, node);
+ this.endTerminatorless(terminatorState);
+ }
+ };
+ }
+
+ const YieldExpression = buildYieldAwait("yield");
+ expressions.YieldExpression = YieldExpression;
+ const AwaitExpression = buildYieldAwait("await");
+ expressions.AwaitExpression = AwaitExpression;
+
+ function EmptyStatement() {
+ this.semicolon(true);
+ }
+
+ function ExpressionStatement(node) {
+ this.print(node.expression, node);
+ this.semicolon();
+ }
+
+ function AssignmentPattern(node) {
+ this.print(node.left, node);
+ if (node.left.optional) this.token("?");
+ this.print(node.left.typeAnnotation, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.right, node);
+ }
+
+ function AssignmentExpression(node, parent) {
+ const parens = this.inForStatementInitCounter && node.operator === "in" && !n$1.needsParens(node, parent);
+
+ if (parens) {
+ this.token("(");
+ }
+
+ this.print(node.left, node);
+ this.space();
+
+ if (node.operator === "in" || node.operator === "instanceof") {
+ this.word(node.operator);
+ } else {
+ this.token(node.operator);
+ }
+
+ this.space();
+ this.print(node.right, node);
+
+ if (parens) {
+ this.token(")");
+ }
+ }
+
+ function BindExpression(node) {
+ this.print(node.object, node);
+ this.token("::");
+ this.print(node.callee, node);
+ }
+
+ function MemberExpression(node) {
+ this.print(node.object, node);
+
+ if (!node.computed && isMemberExpression(node.property)) {
+ throw new TypeError("Got a MemberExpression for MemberExpression property");
+ }
+
+ let computed = node.computed;
+
+ if (isLiteral(node.property) && typeof node.property.value === "number") {
+ computed = true;
+ }
+
+ if (computed) {
+ this.token("[");
+ this.print(node.property, node);
+ this.token("]");
+ } else {
+ this.token(".");
+ this.print(node.property, node);
+ }
+ }
+
+ function MetaProperty(node) {
+ this.print(node.meta, node);
+ this.token(".");
+ this.print(node.property, node);
+ }
+
+ function PrivateName(node) {
+ this.token("#");
+ this.print(node.id, node);
+ }
+
+ function V8IntrinsicIdentifier(node) {
+ this.token("%");
+ this.word(node.name);
+ }
+
+ function ModuleExpression(node) {
+ this.word("module");
+ this.space();
+ this.token("{");
+
+ if (node.body.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.printSequence(node.body.body, node, {
+ indent: true
+ });
+ this.rightBrace();
+ }
+ }
+
+ var statements = {};
+
+ Object.defineProperty(statements, "__esModule", {
+ value: true
+ });
+ statements.WithStatement = WithStatement;
+ statements.IfStatement = IfStatement;
+ statements.ForStatement = ForStatement;
+ statements.WhileStatement = WhileStatement;
+ statements.DoWhileStatement = DoWhileStatement;
+ statements.LabeledStatement = LabeledStatement;
+ statements.TryStatement = TryStatement;
+ statements.CatchClause = CatchClause;
+ statements.SwitchStatement = SwitchStatement;
+ statements.SwitchCase = SwitchCase;
+ statements.DebuggerStatement = DebuggerStatement;
+ statements.VariableDeclaration = VariableDeclaration;
+ statements.VariableDeclarator = VariableDeclarator;
+ statements.ThrowStatement = statements.BreakStatement = statements.ReturnStatement = statements.ContinueStatement = statements.ForOfStatement = statements.ForInStatement = void 0;
+
+ var _t$5 = lib$6;
+
+ const {
+ isFor,
+ isForStatement,
+ isIfStatement,
+ isStatement: isStatement$1
+ } = _t$5;
+
+ function WithStatement(node) {
+ this.word("with");
+ this.space();
+ this.token("(");
+ this.print(node.object, node);
+ this.token(")");
+ this.printBlock(node);
+ }
+
+ function IfStatement(node) {
+ this.word("if");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.space();
+ const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent));
+
+ if (needsBlock) {
+ this.token("{");
+ this.newline();
+ this.indent();
+ }
+
+ this.printAndIndentOnComments(node.consequent, node);
+
+ if (needsBlock) {
+ this.dedent();
+ this.newline();
+ this.token("}");
+ }
+
+ if (node.alternate) {
+ if (this.endsWith(125)) this.space();
+ this.word("else");
+ this.space();
+ this.printAndIndentOnComments(node.alternate, node);
+ }
+ }
+
+ function getLastStatement(statement) {
+ if (!isStatement$1(statement.body)) return statement;
+ return getLastStatement(statement.body);
+ }
+
+ function ForStatement(node) {
+ this.word("for");
+ this.space();
+ this.token("(");
+ this.inForStatementInitCounter++;
+ this.print(node.init, node);
+ this.inForStatementInitCounter--;
+ this.token(";");
+
+ if (node.test) {
+ this.space();
+ this.print(node.test, node);
+ }
+
+ this.token(";");
+
+ if (node.update) {
+ this.space();
+ this.print(node.update, node);
+ }
+
+ this.token(")");
+ this.printBlock(node);
+ }
+
+ function WhileStatement(node) {
+ this.word("while");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.printBlock(node);
+ }
+
+ const buildForXStatement = function (op) {
+ return function (node) {
+ this.word("for");
+ this.space();
+
+ if (op === "of" && node.await) {
+ this.word("await");
+ this.space();
+ }
+
+ this.token("(");
+ this.print(node.left, node);
+ this.space();
+ this.word(op);
+ this.space();
+ this.print(node.right, node);
+ this.token(")");
+ this.printBlock(node);
+ };
+ };
+
+ const ForInStatement = buildForXStatement("in");
+ statements.ForInStatement = ForInStatement;
+ const ForOfStatement = buildForXStatement("of");
+ statements.ForOfStatement = ForOfStatement;
+
+ function DoWhileStatement(node) {
+ this.word("do");
+ this.space();
+ this.print(node.body, node);
+ this.space();
+ this.word("while");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.semicolon();
+ }
+
+ function buildLabelStatement(prefix, key = "label") {
+ return function (node) {
+ this.word(prefix);
+ const label = node[key];
+
+ if (label) {
+ this.space();
+ const isLabel = key == "label";
+ const terminatorState = this.startTerminatorless(isLabel);
+ this.print(label, node);
+ this.endTerminatorless(terminatorState);
+ }
+
+ this.semicolon();
+ };
+ }
+
+ const ContinueStatement = buildLabelStatement("continue");
+ statements.ContinueStatement = ContinueStatement;
+ const ReturnStatement = buildLabelStatement("return", "argument");
+ statements.ReturnStatement = ReturnStatement;
+ const BreakStatement = buildLabelStatement("break");
+ statements.BreakStatement = BreakStatement;
+ const ThrowStatement = buildLabelStatement("throw", "argument");
+ statements.ThrowStatement = ThrowStatement;
+
+ function LabeledStatement(node) {
+ this.print(node.label, node);
+ this.token(":");
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function TryStatement(node) {
+ this.word("try");
+ this.space();
+ this.print(node.block, node);
+ this.space();
+
+ if (node.handlers) {
+ this.print(node.handlers[0], node);
+ } else {
+ this.print(node.handler, node);
+ }
+
+ if (node.finalizer) {
+ this.space();
+ this.word("finally");
+ this.space();
+ this.print(node.finalizer, node);
+ }
+ }
+
+ function CatchClause(node) {
+ this.word("catch");
+ this.space();
+
+ if (node.param) {
+ this.token("(");
+ this.print(node.param, node);
+ this.print(node.param.typeAnnotation, node);
+ this.token(")");
+ this.space();
+ }
+
+ this.print(node.body, node);
+ }
+
+ function SwitchStatement(node) {
+ this.word("switch");
+ this.space();
+ this.token("(");
+ this.print(node.discriminant, node);
+ this.token(")");
+ this.space();
+ this.token("{");
+ this.printSequence(node.cases, node, {
+ indent: true,
+
+ addNewlines(leading, cas) {
+ if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
+ }
+
+ });
+ this.token("}");
+ }
+
+ function SwitchCase(node) {
+ if (node.test) {
+ this.word("case");
+ this.space();
+ this.print(node.test, node);
+ this.token(":");
+ } else {
+ this.word("default");
+ this.token(":");
+ }
+
+ if (node.consequent.length) {
+ this.newline();
+ this.printSequence(node.consequent, node, {
+ indent: true
+ });
+ }
+ }
+
+ function DebuggerStatement() {
+ this.word("debugger");
+ this.semicolon();
+ }
+
+ function variableDeclarationIndent() {
+ this.token(",");
+ this.newline();
+
+ if (this.endsWith(10)) {
+ for (let i = 0; i < 4; i++) this.space(true);
+ }
+ }
+
+ function constDeclarationIndent() {
+ this.token(",");
+ this.newline();
+
+ if (this.endsWith(10)) {
+ for (let i = 0; i < 6; i++) this.space(true);
+ }
+ }
+
+ function VariableDeclaration(node, parent) {
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word(node.kind);
+ this.space();
+ let hasInits = false;
+
+ if (!isFor(parent)) {
+ for (const declar of node.declarations) {
+ if (declar.init) {
+ hasInits = true;
+ }
+ }
+ }
+
+ let separator;
+
+ if (hasInits) {
+ separator = node.kind === "const" ? constDeclarationIndent : variableDeclarationIndent;
+ }
+
+ this.printList(node.declarations, node, {
+ separator
+ });
+
+ if (isFor(parent)) {
+ if (isForStatement(parent)) {
+ if (parent.init === node) return;
+ } else {
+ if (parent.left === node) return;
+ }
+ }
+
+ this.semicolon();
+ }
+
+ function VariableDeclarator(node) {
+ this.print(node.id, node);
+ if (node.definite) this.token("!");
+ this.print(node.id.typeAnnotation, node);
+
+ if (node.init) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.init, node);
+ }
+ }
+
+ var classes = {};
+
+ Object.defineProperty(classes, "__esModule", {
+ value: true
+ });
+ classes.ClassExpression = classes.ClassDeclaration = ClassDeclaration;
+ classes.ClassBody = ClassBody;
+ classes.ClassProperty = ClassProperty;
+ classes.ClassPrivateProperty = ClassPrivateProperty;
+ classes.ClassMethod = ClassMethod;
+ classes.ClassPrivateMethod = ClassPrivateMethod;
+ classes._classMethodHead = _classMethodHead;
+ classes.StaticBlock = StaticBlock;
+
+ var _t$4 = lib$6;
+
+ const {
+ isExportDefaultDeclaration,
+ isExportNamedDeclaration
+ } = _t$4;
+
+ function ClassDeclaration(node, parent) {
+ if (!this.format.decoratorsBeforeExport || !isExportDefaultDeclaration(parent) && !isExportNamedDeclaration(parent)) {
+ this.printJoin(node.decorators, node);
+ }
+
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ this.word("class");
+
+ if (node.id) {
+ this.space();
+ this.print(node.id, node);
+ }
+
+ this.print(node.typeParameters, node);
+
+ if (node.superClass) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.superClass, node);
+ this.print(node.superTypeParameters, node);
+ }
+
+ if (node.implements) {
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function ClassBody(node) {
+ this.token("{");
+ this.printInnerComments(node);
+
+ if (node.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.indent();
+ this.printSequence(node.body, node);
+ this.dedent();
+ if (!this.endsWith(10)) this.newline();
+ this.rightBrace();
+ }
+ }
+
+ function ClassProperty(node) {
+ this.printJoin(node.decorators, node);
+ this.source("end", node.key.loc);
+ this.tsPrintClassMemberModifiers(node, true);
+
+ if (node.computed) {
+ this.token("[");
+ this.print(node.key, node);
+ this.token("]");
+ } else {
+ this._variance(node);
+
+ this.print(node.key, node);
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+
+ if (node.definite) {
+ this.token("!");
+ }
+
+ this.print(node.typeAnnotation, node);
+
+ if (node.value) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ this.semicolon();
+ }
+
+ function ClassPrivateProperty(node) {
+ this.printJoin(node.decorators, node);
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.print(node.key, node);
+ this.print(node.typeAnnotation, node);
+
+ if (node.value) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ this.semicolon();
+ }
+
+ function ClassMethod(node) {
+ this._classMethodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function ClassPrivateMethod(node) {
+ this._classMethodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function _classMethodHead(node) {
+ this.printJoin(node.decorators, node);
+ this.source("end", node.key.loc);
+ this.tsPrintClassMemberModifiers(node, false);
+
+ this._methodHead(node);
+ }
+
+ function StaticBlock(node) {
+ this.word("static");
+ this.space();
+ this.token("{");
+
+ if (node.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.printSequence(node.body, node, {
+ indent: true
+ });
+ this.rightBrace();
+ }
+ }
+
+ var methods = {};
+
+ Object.defineProperty(methods, "__esModule", {
+ value: true
+ });
+ methods._params = _params;
+ methods._parameters = _parameters;
+ methods._param = _param;
+ methods._methodHead = _methodHead;
+ methods._predicate = _predicate;
+ methods._functionHead = _functionHead;
+ methods.FunctionDeclaration = methods.FunctionExpression = FunctionExpression;
+ methods.ArrowFunctionExpression = ArrowFunctionExpression;
+
+ var _t$3 = lib$6;
+
+ const {
+ isIdentifier: isIdentifier$1
+ } = _t$3;
+
+ function _params(node) {
+ this.print(node.typeParameters, node);
+ this.token("(");
+
+ this._parameters(node.params, node);
+
+ this.token(")");
+ this.print(node.returnType, node);
+ }
+
+ function _parameters(parameters, parent) {
+ for (let i = 0; i < parameters.length; i++) {
+ this._param(parameters[i], parent);
+
+ if (i < parameters.length - 1) {
+ this.token(",");
+ this.space();
+ }
+ }
+ }
+
+ function _param(parameter, parent) {
+ this.printJoin(parameter.decorators, parameter);
+ this.print(parameter, parent);
+ if (parameter.optional) this.token("?");
+ this.print(parameter.typeAnnotation, parameter);
+ }
+
+ function _methodHead(node) {
+ const kind = node.kind;
+ const key = node.key;
+
+ if (kind === "get" || kind === "set") {
+ this.word(kind);
+ this.space();
+ }
+
+ if (node.async) {
+ this._catchUp("start", key.loc);
+
+ this.word("async");
+ this.space();
+ }
+
+ if (kind === "method" || kind === "init") {
+ if (node.generator) {
+ this.token("*");
+ }
+ }
+
+ if (node.computed) {
+ this.token("[");
+ this.print(key, node);
+ this.token("]");
+ } else {
+ this.print(key, node);
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+
+ this._params(node);
+ }
+
+ function _predicate(node) {
+ if (node.predicate) {
+ if (!node.returnType) {
+ this.token(":");
+ }
+
+ this.space();
+ this.print(node.predicate, node);
+ }
+ }
+
+ function _functionHead(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ this.word("function");
+ if (node.generator) this.token("*");
+ this.space();
+
+ if (node.id) {
+ this.print(node.id, node);
+ }
+
+ this._params(node);
+
+ this._predicate(node);
+ }
+
+ function FunctionExpression(node) {
+ this._functionHead(node);
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function ArrowFunctionExpression(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ const firstParam = node.params[0];
+
+ if (!this.format.retainLines && !this.format.auxiliaryCommentBefore && !this.format.auxiliaryCommentAfter && node.params.length === 1 && isIdentifier$1(firstParam) && !hasTypesOrComments(node, firstParam)) {
+ this.print(firstParam, node);
+ } else {
+ this._params(node);
+ }
+
+ this._predicate(node);
+
+ this.space();
+ this.token("=>");
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function hasTypesOrComments(node, param) {
+ var _param$leadingComment, _param$trailingCommen;
+
+ return !!(node.typeParameters || node.returnType || node.predicate || param.typeAnnotation || param.optional || (_param$leadingComment = param.leadingComments) != null && _param$leadingComment.length || (_param$trailingCommen = param.trailingComments) != null && _param$trailingCommen.length);
+ }
+
+ var modules = {};
+
+ Object.defineProperty(modules, "__esModule", {
+ value: true
+ });
+ modules.ImportSpecifier = ImportSpecifier;
+ modules.ImportDefaultSpecifier = ImportDefaultSpecifier;
+ modules.ExportDefaultSpecifier = ExportDefaultSpecifier;
+ modules.ExportSpecifier = ExportSpecifier;
+ modules.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
+ modules.ExportAllDeclaration = ExportAllDeclaration;
+ modules.ExportNamedDeclaration = ExportNamedDeclaration;
+ modules.ExportDefaultDeclaration = ExportDefaultDeclaration;
+ modules.ImportDeclaration = ImportDeclaration;
+ modules.ImportAttribute = ImportAttribute;
+ modules.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
+
+ var _t$2 = lib$6;
+
+ const {
+ isClassDeclaration,
+ isExportDefaultSpecifier,
+ isExportNamespaceSpecifier,
+ isImportDefaultSpecifier,
+ isImportNamespaceSpecifier,
+ isStatement
+ } = _t$2;
+
+ function ImportSpecifier(node) {
+ if (node.importKind === "type" || node.importKind === "typeof") {
+ this.word(node.importKind);
+ this.space();
+ }
+
+ this.print(node.imported, node);
+
+ if (node.local && node.local.name !== node.imported.name) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+ }
+ }
+
+ function ImportDefaultSpecifier(node) {
+ this.print(node.local, node);
+ }
+
+ function ExportDefaultSpecifier(node) {
+ this.print(node.exported, node);
+ }
+
+ function ExportSpecifier(node) {
+ this.print(node.local, node);
+
+ if (node.exported && node.local.name !== node.exported.name) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.exported, node);
+ }
+ }
+
+ function ExportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.exported, node);
+ }
+
+ function ExportAllDeclaration(node) {
+ this.word("export");
+ this.space();
+
+ if (node.exportKind === "type") {
+ this.word("type");
+ this.space();
+ }
+
+ this.token("*");
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ this.printAssertions(node);
+ this.semicolon();
+ }
+
+ function ExportNamedDeclaration(node) {
+ if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
+ this.printJoin(node.declaration.decorators, node);
+ }
+
+ this.word("export");
+ this.space();
+ ExportDeclaration.apply(this, arguments);
+ }
+
+ function ExportDefaultDeclaration(node) {
+ if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
+ this.printJoin(node.declaration.decorators, node);
+ }
+
+ this.word("export");
+ this.space();
+ this.word("default");
+ this.space();
+ ExportDeclaration.apply(this, arguments);
+ }
+
+ function ExportDeclaration(node) {
+ if (node.declaration) {
+ const declar = node.declaration;
+ this.print(declar, node);
+ if (!isStatement(declar)) this.semicolon();
+ } else {
+ if (node.exportKind === "type") {
+ this.word("type");
+ this.space();
+ }
+
+ const specifiers = node.specifiers.slice(0);
+ let hasSpecial = false;
+
+ for (;;) {
+ const first = specifiers[0];
+
+ if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
+ hasSpecial = true;
+ this.print(specifiers.shift(), node);
+
+ if (specifiers.length) {
+ this.token(",");
+ this.space();
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (specifiers.length || !specifiers.length && !hasSpecial) {
+ this.token("{");
+
+ if (specifiers.length) {
+ this.space();
+ this.printList(specifiers, node);
+ this.space();
+ }
+
+ this.token("}");
+ }
+
+ if (node.source) {
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ this.printAssertions(node);
+ }
+
+ this.semicolon();
+ }
+ }
+
+ function ImportDeclaration(node) {
+ this.word("import");
+ this.space();
+
+ if (node.importKind === "type" || node.importKind === "typeof") {
+ this.word(node.importKind);
+ this.space();
+ }
+
+ const specifiers = node.specifiers.slice(0);
+
+ if (specifiers != null && specifiers.length) {
+ for (;;) {
+ const first = specifiers[0];
+
+ if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
+ this.print(specifiers.shift(), node);
+
+ if (specifiers.length) {
+ this.token(",");
+ this.space();
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (specifiers.length) {
+ this.token("{");
+ this.space();
+ this.printList(specifiers, node);
+ this.space();
+ this.token("}");
+ }
+
+ this.space();
+ this.word("from");
+ this.space();
+ }
+
+ this.print(node.source, node);
+ this.printAssertions(node);
+ {
+ var _node$attributes;
+
+ if ((_node$attributes = node.attributes) != null && _node$attributes.length) {
+ this.space();
+ this.word("with");
+ this.space();
+ this.printList(node.attributes, node);
+ }
+ }
+ this.semicolon();
+ }
+
+ function ImportAttribute(node) {
+ this.print(node.key);
+ this.token(":");
+ this.space();
+ this.print(node.value);
+ }
+
+ function ImportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+ }
+
+ var types = {};
+
+ var lookup = [];
+ var revLookup = [];
+ var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
+ var inited = false;
+ function init () {
+ inited = true;
+ var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+ for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i];
+ revLookup[code.charCodeAt(i)] = i;
+ }
+
+ revLookup['-'.charCodeAt(0)] = 62;
+ revLookup['_'.charCodeAt(0)] = 63;
+ }
+
+ function toByteArray (b64) {
+ if (!inited) {
+ init();
+ }
+ var i, j, l, tmp, placeHolders, arr;
+ var len = b64.length;
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // the number of equal signs (place holders)
+ // if there are two placeholders, than the two characters before it
+ // represent one byte
+ // if there is only one, then the three characters before it represent 2 bytes
+ // this is just a cheap hack to not do indexOf twice
+ placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
+
+ // base64 is 4/3 + up to two characters of the original data
+ arr = new Arr(len * 3 / 4 - placeHolders);
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ l = placeHolders > 0 ? len - 4 : len;
+
+ var L = 0;
+
+ for (i = 0, j = 0; i < l; i += 4, j += 3) {
+ tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];
+ arr[L++] = (tmp >> 16) & 0xFF;
+ arr[L++] = (tmp >> 8) & 0xFF;
+ arr[L++] = tmp & 0xFF;
+ }
+
+ if (placeHolders === 2) {
+ tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
+ arr[L++] = tmp & 0xFF;
+ } else if (placeHolders === 1) {
+ tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);
+ arr[L++] = (tmp >> 8) & 0xFF;
+ arr[L++] = tmp & 0xFF;
+ }
+
+ return arr
+ }
+
+ function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
+ }
+
+ function encodeChunk (uint8, start, end) {
+ var tmp;
+ var output = [];
+ for (var i = start; i < end; i += 3) {
+ tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
+ output.push(tripletToBase64(tmp));
+ }
+ return output.join('')
+ }
+
+ function fromByteArray (uint8) {
+ if (!inited) {
+ init();
+ }
+ var tmp;
+ var len = uint8.length;
+ var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
+ var output = '';
+ var parts = [];
+ var maxChunkLength = 16383; // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1];
+ output += lookup[tmp >> 2];
+ output += lookup[(tmp << 4) & 0x3F];
+ output += '==';
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);
+ output += lookup[tmp >> 10];
+ output += lookup[(tmp >> 4) & 0x3F];
+ output += lookup[(tmp << 2) & 0x3F];
+ output += '=';
+ }
+
+ parts.push(output);
+
+ return parts.join('')
+ }
+
+ function read (buffer, offset, isLE, mLen, nBytes) {
+ var e, m;
+ var eLen = nBytes * 8 - mLen - 1;
+ var eMax = (1 << eLen) - 1;
+ var eBias = eMax >> 1;
+ var nBits = -7;
+ var i = isLE ? (nBytes - 1) : 0;
+ var d = isLE ? -1 : 1;
+ var s = buffer[offset + i];
+
+ i += d;
+
+ e = s & ((1 << (-nBits)) - 1);
+ s >>= (-nBits);
+ nBits += eLen;
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1);
+ e >>= (-nBits);
+ nBits += mLen;
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias;
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen);
+ e = e - eBias;
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+ }
+
+ function write (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c;
+ var eLen = nBytes * 8 - mLen - 1;
+ var eMax = (1 << eLen) - 1;
+ var eBias = eMax >> 1;
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);
+ var i = isLE ? 0 : (nBytes - 1);
+ var d = isLE ? 1 : -1;
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
+
+ value = Math.abs(value);
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0;
+ e = eMax;
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2);
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--;
+ c *= 2;
+ }
+ if (e + eBias >= 1) {
+ value += rt / c;
+ } else {
+ value += rt * Math.pow(2, 1 - eBias);
+ }
+ if (value * c >= 2) {
+ e++;
+ c /= 2;
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0;
+ e = eMax;
+ } else if (e + eBias >= 1) {
+ m = (value * c - 1) * Math.pow(2, mLen);
+ e = e + eBias;
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
+ e = 0;
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m;
+ eLen += mLen;
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128;
+ }
+
+ var toString$1 = {}.toString;
+
+ var isArray$1 = Array.isArray || function (arr) {
+ return toString$1.call(arr) == '[object Array]';
+ };
+
+ /*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+ * @license MIT
+ */
+
+ var INSPECT_MAX_BYTES = 50;
+
+ /**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Use Object implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * Due to various browser bugs, sometimes the Object implementation will be used even
+ * when the browser supports typed arrays.
+ *
+ * Note:
+ *
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
+ *
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
+ *
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
+ * incorrect length in some situations.
+
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
+ * get the Object implementation, which is slower but behaves correctly.
+ */
+ Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
+ ? global$1.TYPED_ARRAY_SUPPORT
+ : true;
+
+ /*
+ * Export kMaxLength after typed array support is determined.
+ */
+ kMaxLength();
+
+ function kMaxLength () {
+ return Buffer.TYPED_ARRAY_SUPPORT
+ ? 0x7fffffff
+ : 0x3fffffff
+ }
+
+ function createBuffer (that, length) {
+ if (kMaxLength() < length) {
+ throw new RangeError('Invalid typed array length')
+ }
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = new Uint8Array(length);
+ that.__proto__ = Buffer.prototype;
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ if (that === null) {
+ that = new Buffer(length);
+ }
+ that.length = length;
+ }
+
+ return that
+ }
+
+ /**
+ * The Buffer constructor returns instances of `Uint8Array` that have their
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+ * returns a single octet.
+ *
+ * The `Uint8Array` prototype remains unmodified.
+ */
+
+ function Buffer (arg, encodingOrOffset, length) {
+ if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
+ return new Buffer(arg, encodingOrOffset, length)
+ }
+
+ // Common case.
+ if (typeof arg === 'number') {
+ if (typeof encodingOrOffset === 'string') {
+ throw new Error(
+ 'If encoding is specified then the first argument must be a string'
+ )
+ }
+ return allocUnsafe(this, arg)
+ }
+ return from(this, arg, encodingOrOffset, length)
+ }
+
+ Buffer.poolSize = 8192; // not used by this implementation
+
+ // TODO: Legacy, not needed anymore. Remove in next major version.
+ Buffer._augment = function (arr) {
+ arr.__proto__ = Buffer.prototype;
+ return arr
+ };
+
+ function from (that, value, encodingOrOffset, length) {
+ if (typeof value === 'number') {
+ throw new TypeError('"value" argument must not be a number')
+ }
+
+ if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
+ return fromArrayBuffer(that, value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'string') {
+ return fromString(that, value, encodingOrOffset)
+ }
+
+ return fromObject(that, value)
+ }
+
+ /**
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+ * if value is a number.
+ * Buffer.from(str[, encoding])
+ * Buffer.from(array)
+ * Buffer.from(buffer)
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
+ **/
+ Buffer.from = function (value, encodingOrOffset, length) {
+ return from(null, value, encodingOrOffset, length)
+ };
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ Buffer.prototype.__proto__ = Uint8Array.prototype;
+ Buffer.__proto__ = Uint8Array;
+ }
+
+ function assertSize (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('"size" argument must be a number')
+ } else if (size < 0) {
+ throw new RangeError('"size" argument must not be negative')
+ }
+ }
+
+ function alloc (that, size, fill, encoding) {
+ assertSize(size);
+ if (size <= 0) {
+ return createBuffer(that, size)
+ }
+ if (fill !== undefined) {
+ // Only pay attention to encoding if it's a string. This
+ // prevents accidentally sending in a number that would
+ // be interpretted as a start offset.
+ return typeof encoding === 'string'
+ ? createBuffer(that, size).fill(fill, encoding)
+ : createBuffer(that, size).fill(fill)
+ }
+ return createBuffer(that, size)
+ }
+
+ /**
+ * Creates a new filled Buffer instance.
+ * alloc(size[, fill[, encoding]])
+ **/
+ Buffer.alloc = function (size, fill, encoding) {
+ return alloc(null, size, fill, encoding)
+ };
+
+ function allocUnsafe (that, size) {
+ assertSize(size);
+ that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
+ for (var i = 0; i < size; ++i) {
+ that[i] = 0;
+ }
+ }
+ return that
+ }
+
+ /**
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+ * */
+ Buffer.allocUnsafe = function (size) {
+ return allocUnsafe(null, size)
+ };
+ /**
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+ */
+ Buffer.allocUnsafeSlow = function (size) {
+ return allocUnsafe(null, size)
+ };
+
+ function fromString (that, string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8';
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('"encoding" must be a valid string encoding')
+ }
+
+ var length = byteLength(string, encoding) | 0;
+ that = createBuffer(that, length);
+
+ var actual = that.write(string, encoding);
+
+ if (actual !== length) {
+ // Writing a hex string, for example, that contains invalid characters will
+ // cause everything after the first invalid character to be ignored. (e.g.
+ // 'abxxcd' will be treated as 'ab')
+ that = that.slice(0, actual);
+ }
+
+ return that
+ }
+
+ function fromArrayLike (that, array) {
+ var length = array.length < 0 ? 0 : checked(array.length) | 0;
+ that = createBuffer(that, length);
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255;
+ }
+ return that
+ }
+
+ function fromArrayBuffer (that, array, byteOffset, length) {
+ array.byteLength; // this throws if `array` is not a valid ArrayBuffer
+
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
+ throw new RangeError('\'offset\' is out of bounds')
+ }
+
+ if (array.byteLength < byteOffset + (length || 0)) {
+ throw new RangeError('\'length\' is out of bounds')
+ }
+
+ if (byteOffset === undefined && length === undefined) {
+ array = new Uint8Array(array);
+ } else if (length === undefined) {
+ array = new Uint8Array(array, byteOffset);
+ } else {
+ array = new Uint8Array(array, byteOffset, length);
+ }
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = array;
+ that.__proto__ = Buffer.prototype;
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ that = fromArrayLike(that, array);
+ }
+ return that
+ }
+
+ function fromObject (that, obj) {
+ if (internalIsBuffer(obj)) {
+ var len = checked(obj.length) | 0;
+ that = createBuffer(that, len);
+
+ if (that.length === 0) {
+ return that
+ }
+
+ obj.copy(that, 0, 0, len);
+ return that
+ }
+
+ if (obj) {
+ if ((typeof ArrayBuffer !== 'undefined' &&
+ obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
+ if (typeof obj.length !== 'number' || isnan(obj.length)) {
+ return createBuffer(that, 0)
+ }
+ return fromArrayLike(that, obj)
+ }
+
+ if (obj.type === 'Buffer' && isArray$1(obj.data)) {
+ return fromArrayLike(that, obj.data)
+ }
+ }
+
+ throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
+ }
+
+ function checked (length) {
+ // Note: cannot use `length < kMaxLength()` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= kMaxLength()) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + kMaxLength().toString(16) + ' bytes')
+ }
+ return length | 0
+ }
+ Buffer.isBuffer = isBuffer$1;
+ function internalIsBuffer (b) {
+ return !!(b != null && b._isBuffer)
+ }
+
+ Buffer.compare = function compare (a, b) {
+ if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
+ throw new TypeError('Arguments must be Buffers')
+ }
+
+ if (a === b) return 0
+
+ var x = a.length;
+ var y = b.length;
+
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
+ if (a[i] !== b[i]) {
+ x = a[i];
+ y = b[i];
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+ };
+
+ Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ case 'base64':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+ };
+
+ Buffer.concat = function concat (list, length) {
+ if (!isArray$1(list)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+
+ if (list.length === 0) {
+ return Buffer.alloc(0)
+ }
+
+ var i;
+ if (length === undefined) {
+ length = 0;
+ for (i = 0; i < list.length; ++i) {
+ length += list[i].length;
+ }
+ }
+
+ var buffer = Buffer.allocUnsafe(length);
+ var pos = 0;
+ for (i = 0; i < list.length; ++i) {
+ var buf = list[i];
+ if (!internalIsBuffer(buf)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+ buf.copy(buffer, pos);
+ pos += buf.length;
+ }
+ return buffer
+ };
+
+ function byteLength (string, encoding) {
+ if (internalIsBuffer(string)) {
+ return string.length
+ }
+ if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
+ (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
+ return string.byteLength
+ }
+ if (typeof string !== 'string') {
+ string = '' + string;
+ }
+
+ var len = string.length;
+ if (len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ var loweredCase = false;
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ case undefined:
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) return utf8ToBytes(string).length // assume utf8
+ encoding = ('' + encoding).toLowerCase();
+ loweredCase = true;
+ }
+ }
+ }
+ Buffer.byteLength = byteLength;
+
+ function slowToString (encoding, start, end) {
+ var loweredCase = false;
+
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+ // property of a typed array.
+
+ // This behaves neither like String nor Uint8Array in that we set start/end
+ // to their upper/lower bounds if the value passed is out of range.
+ // undefined is handled specially as per ECMA-262 6th Edition,
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+ if (start === undefined || start < 0) {
+ start = 0;
+ }
+ // Return early if start > this.length. Done here to prevent potential uint32
+ // coercion fail below.
+ if (start > this.length) {
+ return ''
+ }
+
+ if (end === undefined || end > this.length) {
+ end = this.length;
+ }
+
+ if (end <= 0) {
+ return ''
+ }
+
+ // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
+ end >>>= 0;
+ start >>>= 0;
+
+ if (end <= start) {
+ return ''
+ }
+
+ if (!encoding) encoding = 'utf8';
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Slice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase();
+ loweredCase = true;
+ }
+ }
+ }
+
+ // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
+ // Buffer instances.
+ Buffer.prototype._isBuffer = true;
+
+ function swap (b, n, m) {
+ var i = b[n];
+ b[n] = b[m];
+ b[m] = i;
+ }
+
+ Buffer.prototype.swap16 = function swap16 () {
+ var len = this.length;
+ if (len % 2 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
+ }
+ for (var i = 0; i < len; i += 2) {
+ swap(this, i, i + 1);
+ }
+ return this
+ };
+
+ Buffer.prototype.swap32 = function swap32 () {
+ var len = this.length;
+ if (len % 4 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
+ }
+ for (var i = 0; i < len; i += 4) {
+ swap(this, i, i + 3);
+ swap(this, i + 1, i + 2);
+ }
+ return this
+ };
+
+ Buffer.prototype.swap64 = function swap64 () {
+ var len = this.length;
+ if (len % 8 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
+ }
+ for (var i = 0; i < len; i += 8) {
+ swap(this, i, i + 7);
+ swap(this, i + 1, i + 6);
+ swap(this, i + 2, i + 5);
+ swap(this, i + 3, i + 4);
+ }
+ return this
+ };
+
+ Buffer.prototype.toString = function toString () {
+ var length = this.length | 0;
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+ };
+
+ Buffer.prototype.equals = function equals (b) {
+ if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+ };
+
+ Buffer.prototype.inspect = function inspect () {
+ var str = '';
+ var max = INSPECT_MAX_BYTES;
+ if (this.length > 0) {
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
+ if (this.length > max) str += ' ... ';
+ }
+ return '<Buffer ' + str + '>'
+ };
+
+ Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+ if (!internalIsBuffer(target)) {
+ throw new TypeError('Argument must be a Buffer')
+ }
+
+ if (start === undefined) {
+ start = 0;
+ }
+ if (end === undefined) {
+ end = target ? target.length : 0;
+ }
+ if (thisStart === undefined) {
+ thisStart = 0;
+ }
+ if (thisEnd === undefined) {
+ thisEnd = this.length;
+ }
+
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+ throw new RangeError('out of range index')
+ }
+
+ if (thisStart >= thisEnd && start >= end) {
+ return 0
+ }
+ if (thisStart >= thisEnd) {
+ return -1
+ }
+ if (start >= end) {
+ return 1
+ }
+
+ start >>>= 0;
+ end >>>= 0;
+ thisStart >>>= 0;
+ thisEnd >>>= 0;
+
+ if (this === target) return 0
+
+ var x = thisEnd - thisStart;
+ var y = end - start;
+ var len = Math.min(x, y);
+
+ var thisCopy = this.slice(thisStart, thisEnd);
+ var targetCopy = target.slice(start, end);
+
+ for (var i = 0; i < len; ++i) {
+ if (thisCopy[i] !== targetCopy[i]) {
+ x = thisCopy[i];
+ y = targetCopy[i];
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+ };
+
+ // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+ // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+ //
+ // Arguments:
+ // - buffer - a Buffer to search
+ // - val - a string, Buffer, or number
+ // - byteOffset - an index into `buffer`; will be clamped to an int32
+ // - encoding - an optional encoding, relevant is val is a string
+ // - dir - true for indexOf, false for lastIndexOf
+ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
+ // Empty buffer means no match
+ if (buffer.length === 0) return -1
+
+ // Normalize byteOffset
+ if (typeof byteOffset === 'string') {
+ encoding = byteOffset;
+ byteOffset = 0;
+ } else if (byteOffset > 0x7fffffff) {
+ byteOffset = 0x7fffffff;
+ } else if (byteOffset < -0x80000000) {
+ byteOffset = -0x80000000;
+ }
+ byteOffset = +byteOffset; // Coerce to Number.
+ if (isNaN(byteOffset)) {
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+ byteOffset = dir ? 0 : (buffer.length - 1);
+ }
+
+ // Normalize byteOffset: negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
+ if (byteOffset >= buffer.length) {
+ if (dir) return -1
+ else byteOffset = buffer.length - 1;
+ } else if (byteOffset < 0) {
+ if (dir) byteOffset = 0;
+ else return -1
+ }
+
+ // Normalize val
+ if (typeof val === 'string') {
+ val = Buffer.from(val, encoding);
+ }
+
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
+ if (internalIsBuffer(val)) {
+ // Special case: looking for empty string/buffer always fails
+ if (val.length === 0) {
+ return -1
+ }
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
+ } else if (typeof val === 'number') {
+ val = val & 0xFF; // Search for a byte value [0-255]
+ if (Buffer.TYPED_ARRAY_SUPPORT &&
+ typeof Uint8Array.prototype.indexOf === 'function') {
+ if (dir) {
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
+ } else {
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
+ }
+ }
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+ }
+
+ function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
+ var indexSize = 1;
+ var arrLength = arr.length;
+ var valLength = val.length;
+
+ if (encoding !== undefined) {
+ encoding = String(encoding).toLowerCase();
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
+ encoding === 'utf16le' || encoding === 'utf-16le') {
+ if (arr.length < 2 || val.length < 2) {
+ return -1
+ }
+ indexSize = 2;
+ arrLength /= 2;
+ valLength /= 2;
+ byteOffset /= 2;
+ }
+ }
+
+ function read (buf, i) {
+ if (indexSize === 1) {
+ return buf[i]
+ } else {
+ return buf.readUInt16BE(i * indexSize)
+ }
+ }
+
+ var i;
+ if (dir) {
+ var foundIndex = -1;
+ for (i = byteOffset; i < arrLength; i++) {
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+ if (foundIndex === -1) foundIndex = i;
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
+ } else {
+ if (foundIndex !== -1) i -= i - foundIndex;
+ foundIndex = -1;
+ }
+ }
+ } else {
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
+ for (i = byteOffset; i >= 0; i--) {
+ var found = true;
+ for (var j = 0; j < valLength; j++) {
+ if (read(arr, i + j) !== read(val, j)) {
+ found = false;
+ break
+ }
+ }
+ if (found) return i
+ }
+ }
+
+ return -1
+ }
+
+ Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+ return this.indexOf(val, byteOffset, encoding) !== -1
+ };
+
+ Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
+ };
+
+ Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
+ };
+
+ function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0;
+ var remaining = buf.length - offset;
+ if (!length) {
+ length = remaining;
+ } else {
+ length = Number(length);
+ if (length > remaining) {
+ length = remaining;
+ }
+ }
+
+ // must be an even number of digits
+ var strLen = string.length;
+ if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
+
+ if (length > strLen / 2) {
+ length = strLen / 2;
+ }
+ for (var i = 0; i < length; ++i) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16);
+ if (isNaN(parsed)) return i
+ buf[offset + i] = parsed;
+ }
+ return i
+ }
+
+ function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+ }
+
+ function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+ }
+
+ function latin1Write (buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length)
+ }
+
+ function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+ }
+
+ function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+ }
+
+ Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8';
+ length = this.length;
+ offset = 0;
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset;
+ length = this.length;
+ offset = 0;
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset | 0;
+ if (isFinite(length)) {
+ length = length | 0;
+ if (encoding === undefined) encoding = 'utf8';
+ } else {
+ encoding = length;
+ length = undefined;
+ }
+ // legacy write(string, encoding, offset, length) - remove in v0.13
+ } else {
+ throw new Error(
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
+ )
+ }
+
+ var remaining = this.length - offset;
+ if (length === undefined || length > remaining) length = remaining;
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('Attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8';
+
+ var loweredCase = false;
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Write(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase();
+ loweredCase = true;
+ }
+ }
+ };
+
+ Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+ };
+
+ function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return fromByteArray(buf)
+ } else {
+ return fromByteArray(buf.slice(start, end))
+ }
+ }
+
+ function utf8Slice (buf, start, end) {
+ end = Math.min(buf.length, end);
+ var res = [];
+
+ var i = start;
+ while (i < end) {
+ var firstByte = buf[i];
+ var codePoint = null;
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
+ : (firstByte > 0xDF) ? 3
+ : (firstByte > 0xBF) ? 2
+ : 1;
+
+ if (i + bytesPerSequence <= end) {
+ var secondByte, thirdByte, fourthByte, tempCodePoint;
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte;
+ }
+ break
+ case 2:
+ secondByte = buf[i + 1];
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint;
+ }
+ }
+ break
+ case 3:
+ secondByte = buf[i + 1];
+ thirdByte = buf[i + 2];
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint;
+ }
+ }
+ break
+ case 4:
+ secondByte = buf[i + 1];
+ thirdByte = buf[i + 2];
+ fourthByte = buf[i + 3];
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint;
+ }
+ }
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD;
+ bytesPerSequence = 1;
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000;
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800);
+ codePoint = 0xDC00 | codePoint & 0x3FF;
+ }
+
+ res.push(codePoint);
+ i += bytesPerSequence;
+ }
+
+ return decodeCodePointsArray(res)
+ }
+
+ // Based on http://stackoverflow.com/a/22747272/680742, the browser with
+ // the lowest limit is Chrome, with 0x10000 args.
+ // We go 1 magnitude less, for safety
+ var MAX_ARGUMENTS_LENGTH = 0x1000;
+
+ function decodeCodePointsArray (codePoints) {
+ var len = codePoints.length;
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+ }
+
+ // Decode in chunks to avoid "call stack size exceeded".
+ var res = '';
+ var i = 0;
+ while (i < len) {
+ res += String.fromCharCode.apply(
+ String,
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+ );
+ }
+ return res
+ }
+
+ function asciiSlice (buf, start, end) {
+ var ret = '';
+ end = Math.min(buf.length, end);
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i] & 0x7F);
+ }
+ return ret
+ }
+
+ function latin1Slice (buf, start, end) {
+ var ret = '';
+ end = Math.min(buf.length, end);
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i]);
+ }
+ return ret
+ }
+
+ function hexSlice (buf, start, end) {
+ var len = buf.length;
+
+ if (!start || start < 0) start = 0;
+ if (!end || end < 0 || end > len) end = len;
+
+ var out = '';
+ for (var i = start; i < end; ++i) {
+ out += toHex(buf[i]);
+ }
+ return out
+ }
+
+ function utf16leSlice (buf, start, end) {
+ var bytes = buf.slice(start, end);
+ var res = '';
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
+ }
+ return res
+ }
+
+ Buffer.prototype.slice = function slice (start, end) {
+ var len = this.length;
+ start = ~~start;
+ end = end === undefined ? len : ~~end;
+
+ if (start < 0) {
+ start += len;
+ if (start < 0) start = 0;
+ } else if (start > len) {
+ start = len;
+ }
+
+ if (end < 0) {
+ end += len;
+ if (end < 0) end = 0;
+ } else if (end > len) {
+ end = len;
+ }
+
+ if (end < start) end = start;
+
+ var newBuf;
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ newBuf = this.subarray(start, end);
+ newBuf.__proto__ = Buffer.prototype;
+ } else {
+ var sliceLen = end - start;
+ newBuf = new Buffer(sliceLen, undefined);
+ for (var i = 0; i < sliceLen; ++i) {
+ newBuf[i] = this[i + start];
+ }
+ }
+
+ return newBuf
+ };
+
+ /*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+ function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+ }
+
+ Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
+
+ var val = this[offset];
+ var mul = 1;
+ var i = 0;
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul;
+ }
+
+ return val
+ };
+
+ Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length);
+ }
+
+ var val = this[offset + --byteLength];
+ var mul = 1;
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul;
+ }
+
+ return val
+ };
+
+ Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length);
+ return this[offset]
+ };
+
+ Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ return this[offset] | (this[offset + 1] << 8)
+ };
+
+ Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ return (this[offset] << 8) | this[offset + 1]
+ };
+
+ Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+ };
+
+ Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+ };
+
+ Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
+
+ var val = this[offset];
+ var mul = 1;
+ var i = 0;
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul;
+ }
+ mul *= 0x80;
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
+
+ return val
+ };
+
+ Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
+
+ var i = byteLength;
+ var mul = 1;
+ var val = this[offset + --i];
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul;
+ }
+ mul *= 0x80;
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
+
+ return val
+ };
+
+ Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length);
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+ };
+
+ Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ var val = this[offset] | (this[offset + 1] << 8);
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+ };
+
+ Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ var val = this[offset + 1] | (this[offset] << 8);
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+ };
+
+ Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+ };
+
+ Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+ };
+
+ Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return read(this, offset, true, 23, 4)
+ };
+
+ Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return read(this, offset, false, 23, 4)
+ };
+
+ Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length);
+ return read(this, offset, true, 52, 8)
+ };
+
+ Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length);
+ return read(this, offset, false, 52, 8)
+ };
+
+ function checkInt (buf, value, offset, ext, max, min) {
+ if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+ }
+
+ Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
+ }
+
+ var mul = 1;
+ var i = 0;
+ this[offset] = value & 0xFF;
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF;
+ }
+
+ return offset + byteLength
+ };
+
+ Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
+ }
+
+ var i = byteLength - 1;
+ var mul = 1;
+ this[offset + i] = value & 0xFF;
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF;
+ }
+
+ return offset + byteLength
+ };
+
+ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
+ this[offset] = (value & 0xff);
+ return offset + 1
+ };
+
+ function objectWriteUInt16 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffff + value + 1;
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
+ buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
+ (littleEndian ? i : 1 - i) * 8;
+ }
+ }
+
+ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value & 0xff);
+ this[offset + 1] = (value >>> 8);
+ } else {
+ objectWriteUInt16(this, value, offset, true);
+ }
+ return offset + 2
+ };
+
+ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8);
+ this[offset + 1] = (value & 0xff);
+ } else {
+ objectWriteUInt16(this, value, offset, false);
+ }
+ return offset + 2
+ };
+
+ function objectWriteUInt32 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffffffff + value + 1;
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
+ buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;
+ }
+ }
+
+ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset + 3] = (value >>> 24);
+ this[offset + 2] = (value >>> 16);
+ this[offset + 1] = (value >>> 8);
+ this[offset] = (value & 0xff);
+ } else {
+ objectWriteUInt32(this, value, offset, true);
+ }
+ return offset + 4
+ };
+
+ Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24);
+ this[offset + 1] = (value >>> 16);
+ this[offset + 2] = (value >>> 8);
+ this[offset + 3] = (value & 0xff);
+ } else {
+ objectWriteUInt32(this, value, offset, false);
+ }
+ return offset + 4
+ };
+
+ Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1);
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
+ }
+
+ var i = 0;
+ var mul = 1;
+ var sub = 0;
+ this[offset] = value & 0xFF;
+ while (++i < byteLength && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+ sub = 1;
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
+ }
+
+ return offset + byteLength
+ };
+
+ Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1);
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
+ }
+
+ var i = byteLength - 1;
+ var mul = 1;
+ var sub = 0;
+ this[offset + i] = value & 0xFF;
+ while (--i >= 0 && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+ sub = 1;
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
+ }
+
+ return offset + byteLength
+ };
+
+ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
+ if (value < 0) value = 0xff + value + 1;
+ this[offset] = (value & 0xff);
+ return offset + 1
+ };
+
+ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value & 0xff);
+ this[offset + 1] = (value >>> 8);
+ } else {
+ objectWriteUInt16(this, value, offset, true);
+ }
+ return offset + 2
+ };
+
+ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8);
+ this[offset + 1] = (value & 0xff);
+ } else {
+ objectWriteUInt16(this, value, offset, false);
+ }
+ return offset + 2
+ };
+
+ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value & 0xff);
+ this[offset + 1] = (value >>> 8);
+ this[offset + 2] = (value >>> 16);
+ this[offset + 3] = (value >>> 24);
+ } else {
+ objectWriteUInt32(this, value, offset, true);
+ }
+ return offset + 4
+ };
+
+ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
+ if (value < 0) value = 0xffffffff + value + 1;
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24);
+ this[offset + 1] = (value >>> 16);
+ this[offset + 2] = (value >>> 8);
+ this[offset + 3] = (value & 0xff);
+ } else {
+ objectWriteUInt32(this, value, offset, false);
+ }
+ return offset + 4
+ };
+
+ function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+ if (offset < 0) throw new RangeError('Index out of range')
+ }
+
+ function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4);
+ }
+ write(buf, value, offset, littleEndian, 23, 4);
+ return offset + 4
+ }
+
+ Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+ };
+
+ Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+ };
+
+ function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8);
+ }
+ write(buf, value, offset, littleEndian, 52, 8);
+ return offset + 8
+ }
+
+ Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+ };
+
+ Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+ };
+
+ // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!start) start = 0;
+ if (!end && end !== 0) end = this.length;
+ if (targetStart >= target.length) targetStart = target.length;
+ if (!targetStart) targetStart = 0;
+ if (end > 0 && end < start) end = start;
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length;
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start;
+ }
+
+ var len = end - start;
+ var i;
+
+ if (this === target && start < targetStart && targetStart < end) {
+ // descending copy from end
+ for (i = len - 1; i >= 0; --i) {
+ target[i + targetStart] = this[i + start];
+ }
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+ // ascending copy from start
+ for (i = 0; i < len; ++i) {
+ target[i + targetStart] = this[i + start];
+ }
+ } else {
+ Uint8Array.prototype.set.call(
+ target,
+ this.subarray(start, start + len),
+ targetStart
+ );
+ }
+
+ return len
+ };
+
+ // Usage:
+ // buffer.fill(number[, offset[, end]])
+ // buffer.fill(buffer[, offset[, end]])
+ // buffer.fill(string[, offset[, end]][, encoding])
+ Buffer.prototype.fill = function fill (val, start, end, encoding) {
+ // Handle string cases:
+ if (typeof val === 'string') {
+ if (typeof start === 'string') {
+ encoding = start;
+ start = 0;
+ end = this.length;
+ } else if (typeof end === 'string') {
+ encoding = end;
+ end = this.length;
+ }
+ if (val.length === 1) {
+ var code = val.charCodeAt(0);
+ if (code < 256) {
+ val = code;
+ }
+ }
+ if (encoding !== undefined && typeof encoding !== 'string') {
+ throw new TypeError('encoding must be a string')
+ }
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+ } else if (typeof val === 'number') {
+ val = val & 255;
+ }
+
+ // Invalid ranges are not set to a default, so can range check early.
+ if (start < 0 || this.length < start || this.length < end) {
+ throw new RangeError('Out of range index')
+ }
+
+ if (end <= start) {
+ return this
+ }
+
+ start = start >>> 0;
+ end = end === undefined ? this.length : end >>> 0;
+
+ if (!val) val = 0;
+
+ var i;
+ if (typeof val === 'number') {
+ for (i = start; i < end; ++i) {
+ this[i] = val;
+ }
+ } else {
+ var bytes = internalIsBuffer(val)
+ ? val
+ : utf8ToBytes(new Buffer(val, encoding).toString());
+ var len = bytes.length;
+ for (i = 0; i < end - start; ++i) {
+ this[i + start] = bytes[i % len];
+ }
+ }
+
+ return this
+ };
+
+ // HELPER FUNCTIONS
+ // ================
+
+ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
+
+ function base64clean (str) {
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = stringtrim(str).replace(INVALID_BASE64_RE, '');
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '=';
+ }
+ return str
+ }
+
+ function stringtrim (str) {
+ if (str.trim) return str.trim()
+ return str.replace(/^\s+|\s+$/g, '')
+ }
+
+ function toHex (n) {
+ if (n < 16) return '0' + n.toString(16)
+ return n.toString(16)
+ }
+
+ function utf8ToBytes (string, units) {
+ units = units || Infinity;
+ var codePoint;
+ var length = string.length;
+ var leadSurrogate = null;
+ var bytes = [];
+
+ for (var i = 0; i < length; ++i) {
+ codePoint = string.charCodeAt(i);
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ continue
+ }
+
+ // valid lead
+ leadSurrogate = codePoint;
+
+ continue
+ }
+
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ leadSurrogate = codePoint;
+ continue
+ }
+
+ // valid surrogate pair
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ }
+
+ leadSurrogate = null;
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint);
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ );
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ );
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ );
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+ }
+
+ function asciiToBytes (str) {
+ var byteArray = [];
+ for (var i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF);
+ }
+ return byteArray
+ }
+
+ function utf16leToBytes (str, units) {
+ var c, hi, lo;
+ var byteArray = [];
+ for (var i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i);
+ hi = c >> 8;
+ lo = c % 256;
+ byteArray.push(lo);
+ byteArray.push(hi);
+ }
+
+ return byteArray
+ }
+
+
+ function base64ToBytes (str) {
+ return toByteArray(base64clean(str))
+ }
+
+ function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; ++i) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i];
+ }
+ return i
+ }
+
+ function isnan (val) {
+ return val !== val // eslint-disable-line no-self-compare
+ }
+
+
+ // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
+ // The _isBuffer check is for Safari 5-7 support, because it's missing
+ // Object.prototype.constructor. Remove this eventually
+ function isBuffer$1(obj) {
+ return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
+ }
+
+ function isFastBuffer (obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+ }
+
+ // For Node v0.10 support. Remove this eventually.
+ function isSlowBuffer (obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
+ }
+
+ const object = {};
+ const hasOwnProperty = object.hasOwnProperty;
+ const forOwn = (object, callback) => {
+ for (const key in object) {
+ if (hasOwnProperty.call(object, key)) {
+ callback(key, object[key]);
+ }
+ }
+ };
+
+ const extend = (destination, source) => {
+ if (!source) {
+ return destination;
+ }
+ forOwn(source, (key, value) => {
+ destination[key] = value;
+ });
+ return destination;
+ };
+
+ const forEach = (array, callback) => {
+ const length = array.length;
+ let index = -1;
+ while (++index < length) {
+ callback(array[index]);
+ }
+ };
+
+ const toString = object.toString;
+ const isArray = Array.isArray;
+ const isBuffer = Buffer.isBuffer;
+ const isObject = (value) => {
+ // This is a very simple check, but it’s good enough for what we need.
+ return toString.call(value) == '[object Object]';
+ };
+ const isString = (value) => {
+ return typeof value == 'string' ||
+ toString.call(value) == '[object String]';
+ };
+ const isNumber = (value) => {
+ return typeof value == 'number' ||
+ toString.call(value) == '[object Number]';
+ };
+ const isFunction$1 = (value) => {
+ return typeof value == 'function';
+ };
+ const isMap = (value) => {
+ return toString.call(value) == '[object Map]';
+ };
+ const isSet = (value) => {
+ return toString.call(value) == '[object Set]';
+ };
+
+ /*--------------------------------------------------------------------------*/
+
+ // https://mathiasbynens.be/notes/javascript-escapes#single
+ const singleEscapes = {
+ '"': '\\"',
+ '\'': '\\\'',
+ '\\': '\\\\',
+ '\b': '\\b',
+ '\f': '\\f',
+ '\n': '\\n',
+ '\r': '\\r',
+ '\t': '\\t'
+ // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
+ // '\v': '\\x0B'
+ };
+ const regexSingleEscape = /["'\\\b\f\n\r\t]/;
+
+ const regexDigit = /[0-9]/;
+ const regexWhitelist = /[ !#-&\(-\[\]-_a-~]/;
+
+ const jsesc = (argument, options) => {
+ const increaseIndentation = () => {
+ oldIndent = indent;
+ ++options.indentLevel;
+ indent = options.indent.repeat(options.indentLevel);
+ };
+ // Handle options
+ const defaults = {
+ 'escapeEverything': false,
+ 'minimal': false,
+ 'isScriptContext': false,
+ 'quotes': 'single',
+ 'wrap': false,
+ 'es6': false,
+ 'json': false,
+ 'compact': true,
+ 'lowercaseHex': false,
+ 'numbers': 'decimal',
+ 'indent': '\t',
+ 'indentLevel': 0,
+ '__inline1__': false,
+ '__inline2__': false
+ };
+ const json = options && options.json;
+ if (json) {
+ defaults.quotes = 'double';
+ defaults.wrap = true;
+ }
+ options = extend(defaults, options);
+ if (
+ options.quotes != 'single' &&
+ options.quotes != 'double' &&
+ options.quotes != 'backtick'
+ ) {
+ options.quotes = 'single';
+ }
+ const quote = options.quotes == 'double' ?
+ '"' :
+ (options.quotes == 'backtick' ?
+ '`' :
+ '\''
+ );
+ const compact = options.compact;
+ const lowercaseHex = options.lowercaseHex;
+ let indent = options.indent.repeat(options.indentLevel);
+ let oldIndent = '';
+ const inline1 = options.__inline1__;
+ const inline2 = options.__inline2__;
+ const newLine = compact ? '' : '\n';
+ let result;
+ let isEmpty = true;
+ const useBinNumbers = options.numbers == 'binary';
+ const useOctNumbers = options.numbers == 'octal';
+ const useDecNumbers = options.numbers == 'decimal';
+ const useHexNumbers = options.numbers == 'hexadecimal';
+
+ if (json && argument && isFunction$1(argument.toJSON)) {
+ argument = argument.toJSON();
+ }
+
+ if (!isString(argument)) {
+ if (isMap(argument)) {
+ if (argument.size == 0) {
+ return 'new Map()';
+ }
+ if (!compact) {
+ options.__inline1__ = true;
+ options.__inline2__ = false;
+ }
+ return 'new Map(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isSet(argument)) {
+ if (argument.size == 0) {
+ return 'new Set()';
+ }
+ return 'new Set(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isBuffer(argument)) {
+ if (argument.length == 0) {
+ return 'Buffer.from([])';
+ }
+ return 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isArray(argument)) {
+ result = [];
+ options.wrap = true;
+ if (inline1) {
+ options.__inline1__ = false;
+ options.__inline2__ = true;
+ }
+ if (!inline2) {
+ increaseIndentation();
+ }
+ forEach(argument, (value) => {
+ isEmpty = false;
+ if (inline2) {
+ options.__inline2__ = false;
+ }
+ result.push(
+ (compact || inline2 ? '' : indent) +
+ jsesc(value, options)
+ );
+ });
+ if (isEmpty) {
+ return '[]';
+ }
+ if (inline2) {
+ return '[' + result.join(', ') + ']';
+ }
+ return '[' + newLine + result.join(',' + newLine) + newLine +
+ (compact ? '' : oldIndent) + ']';
+ } else if (isNumber(argument)) {
+ if (json) {
+ // Some number values (e.g. `Infinity`) cannot be represented in JSON.
+ return JSON.stringify(argument);
+ }
+ if (useDecNumbers) {
+ return String(argument);
+ }
+ if (useHexNumbers) {
+ let hexadecimal = argument.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ return '0x' + hexadecimal;
+ }
+ if (useBinNumbers) {
+ return '0b' + argument.toString(2);
+ }
+ if (useOctNumbers) {
+ return '0o' + argument.toString(8);
+ }
+ } else if (!isObject(argument)) {
+ if (json) {
+ // For some values (e.g. `undefined`, `function` objects),
+ // `JSON.stringify(value)` returns `undefined` (which isn’t valid
+ // JSON) instead of `'null'`.
+ return JSON.stringify(argument) || 'null';
+ }
+ return String(argument);
+ } else { // it’s an object
+ result = [];
+ options.wrap = true;
+ increaseIndentation();
+ forOwn(argument, (key, value) => {
+ isEmpty = false;
+ result.push(
+ (compact ? '' : indent) +
+ jsesc(key, options) + ':' +
+ (compact ? '' : ' ') +
+ jsesc(value, options)
+ );
+ });
+ if (isEmpty) {
+ return '{}';
+ }
+ return '{' + newLine + result.join(',' + newLine) + newLine +
+ (compact ? '' : oldIndent) + '}';
+ }
+ }
+
+ const string = argument;
+ // Loop over each code unit in the string and escape it
+ let index = -1;
+ const length = string.length;
+ result = '';
+ while (++index < length) {
+ const character = string.charAt(index);
+ if (options.es6) {
+ const first = string.charCodeAt(index);
+ if ( // check if it’s the start of a surrogate pair
+ first >= 0xD800 && first <= 0xDBFF && // high surrogate
+ length > index + 1 // there is a next code unit
+ ) {
+ const second = string.charCodeAt(index + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ const codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ let hexadecimal = codePoint.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ result += '\\u{' + hexadecimal + '}';
+ ++index;
+ continue;
+ }
+ }
+ }
+ if (!options.escapeEverything) {
+ if (regexWhitelist.test(character)) {
+ // It’s a printable ASCII character that is not `"`, `'` or `\`,
+ // so don’t escape it.
+ result += character;
+ continue;
+ }
+ if (character == '"') {
+ result += quote == character ? '\\"' : character;
+ continue;
+ }
+ if (character == '`') {
+ result += quote == character ? '\\`' : character;
+ continue;
+ }
+ if (character == '\'') {
+ result += quote == character ? '\\\'' : character;
+ continue;
+ }
+ }
+ if (
+ character == '\0' &&
+ !json &&
+ !regexDigit.test(string.charAt(index + 1))
+ ) {
+ result += '\\0';
+ continue;
+ }
+ if (regexSingleEscape.test(character)) {
+ // no need for a `hasOwnProperty` check here
+ result += singleEscapes[character];
+ continue;
+ }
+ const charCode = character.charCodeAt(0);
+ if (options.minimal && charCode != 0x2028 && charCode != 0x2029) {
+ result += character;
+ continue;
+ }
+ let hexadecimal = charCode.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ const longhand = hexadecimal.length > 2 || json;
+ const escaped = '\\' + (longhand ? 'u' : 'x') +
+ ('0000' + hexadecimal).slice(longhand ? -4 : -2);
+ result += escaped;
+ continue;
+ }
+ if (options.wrap) {
+ result = quote + result + quote;
+ }
+ if (quote == '`') {
+ result = result.replace(/\$\{/g, '\\\$\{');
+ }
+ if (options.isScriptContext) {
+ // https://mathiasbynens.be/notes/etago
+ return result
+ .replace(/<\/(script|style)/gi, '<\\/$1')
+ .replace(/<!--/g, json ? '\\u003C!--' : '\\x3C!--');
+ }
+ return result;
+ };
+
+ jsesc.version = '2.5.2';
+
+ var jsesc_1 = jsesc;
+
+ Object.defineProperty(types, "__esModule", {
+ value: true
+ });
+ types.Identifier = Identifier;
+ types.ArgumentPlaceholder = ArgumentPlaceholder;
+ types.SpreadElement = types.RestElement = RestElement;
+ types.ObjectPattern = types.ObjectExpression = ObjectExpression;
+ types.ObjectMethod = ObjectMethod;
+ types.ObjectProperty = ObjectProperty;
+ types.ArrayPattern = types.ArrayExpression = ArrayExpression;
+ types.RecordExpression = RecordExpression;
+ types.TupleExpression = TupleExpression;
+ types.RegExpLiteral = RegExpLiteral;
+ types.BooleanLiteral = BooleanLiteral;
+ types.NullLiteral = NullLiteral;
+ types.NumericLiteral = NumericLiteral;
+ types.StringLiteral = StringLiteral;
+ types.BigIntLiteral = BigIntLiteral;
+ types.DecimalLiteral = DecimalLiteral;
+ types.TopicReference = TopicReference;
+ types.PipelineTopicExpression = PipelineTopicExpression;
+ types.PipelineBareFunction = PipelineBareFunction;
+ types.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
+
+ var _t$1 = lib$6;
+
+ var _jsesc = jsesc_1;
+
+ const {
+ isAssignmentPattern,
+ isIdentifier
+ } = _t$1;
+
+ function Identifier(node) {
+ this.exactSource(node.loc, () => {
+ this.word(node.name);
+ });
+ }
+
+ function ArgumentPlaceholder() {
+ this.token("?");
+ }
+
+ function RestElement(node) {
+ this.token("...");
+ this.print(node.argument, node);
+ }
+
+ function ObjectExpression(node) {
+ const props = node.properties;
+ this.token("{");
+ this.printInnerComments(node);
+
+ if (props.length) {
+ this.space();
+ this.printList(props, node, {
+ indent: true,
+ statement: true
+ });
+ this.space();
+ }
+
+ this.token("}");
+ }
+
+ function ObjectMethod(node) {
+ this.printJoin(node.decorators, node);
+
+ this._methodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function ObjectProperty(node) {
+ this.printJoin(node.decorators, node);
+
+ if (node.computed) {
+ this.token("[");
+ this.print(node.key, node);
+ this.token("]");
+ } else {
+ if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
+ this.print(node.value, node);
+ return;
+ }
+
+ this.print(node.key, node);
+
+ if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
+ return;
+ }
+ }
+
+ this.token(":");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ function ArrayExpression(node) {
+ const elems = node.elements;
+ const len = elems.length;
+ this.token("[");
+ this.printInnerComments(node);
+
+ for (let i = 0; i < elems.length; i++) {
+ const elem = elems[i];
+
+ if (elem) {
+ if (i > 0) this.space();
+ this.print(elem, node);
+ if (i < len - 1) this.token(",");
+ } else {
+ this.token(",");
+ }
+ }
+
+ this.token("]");
+ }
+
+ function RecordExpression(node) {
+ const props = node.properties;
+ let startToken;
+ let endToken;
+
+ if (this.format.recordAndTupleSyntaxType === "bar") {
+ startToken = "{|";
+ endToken = "|}";
+ } else if (this.format.recordAndTupleSyntaxType === "hash") {
+ startToken = "#{";
+ endToken = "}";
+ } else {
+ throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
+ }
+
+ this.token(startToken);
+ this.printInnerComments(node);
+
+ if (props.length) {
+ this.space();
+ this.printList(props, node, {
+ indent: true,
+ statement: true
+ });
+ this.space();
+ }
+
+ this.token(endToken);
+ }
+
+ function TupleExpression(node) {
+ const elems = node.elements;
+ const len = elems.length;
+ let startToken;
+ let endToken;
+
+ if (this.format.recordAndTupleSyntaxType === "bar") {
+ startToken = "[|";
+ endToken = "|]";
+ } else if (this.format.recordAndTupleSyntaxType === "hash") {
+ startToken = "#[";
+ endToken = "]";
+ } else {
+ throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
+ }
+
+ this.token(startToken);
+ this.printInnerComments(node);
+
+ for (let i = 0; i < elems.length; i++) {
+ const elem = elems[i];
+
+ if (elem) {
+ if (i > 0) this.space();
+ this.print(elem, node);
+ if (i < len - 1) this.token(",");
+ }
+ }
+
+ this.token(endToken);
+ }
+
+ function RegExpLiteral(node) {
+ this.word(`/${node.pattern}/${node.flags}`);
+ }
+
+ function BooleanLiteral(node) {
+ this.word(node.value ? "true" : "false");
+ }
+
+ function NullLiteral() {
+ this.word("null");
+ }
+
+ function NumericLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+ const opts = this.format.jsescOption;
+ const value = node.value + "";
+
+ if (opts.numbers) {
+ this.number(_jsesc(node.value, opts));
+ } else if (raw == null) {
+ this.number(value);
+ } else if (this.format.minified) {
+ this.number(raw.length < value.length ? raw : value);
+ } else {
+ this.number(raw);
+ }
+ }
+
+ function StringLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (!this.format.minified && raw != null) {
+ this.token(raw);
+ return;
+ }
+
+ const val = _jsesc(node.value, Object.assign(this.format.jsescOption, this.format.jsonCompatibleStrings && {
+ json: true
+ }));
+
+ return this.token(val);
+ }
+
+ function BigIntLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (!this.format.minified && raw != null) {
+ this.word(raw);
+ return;
+ }
+
+ this.word(node.value + "n");
+ }
+
+ function DecimalLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (!this.format.minified && raw != null) {
+ this.word(raw);
+ return;
+ }
+
+ this.word(node.value + "m");
+ }
+
+ function TopicReference() {
+ const {
+ topicToken
+ } = this.format;
+
+ switch (topicToken) {
+ case "#":
+ this.token("#");
+ break;
+
+ default:
+ {
+ const givenTopicTokenJSON = JSON.stringify(topicToken);
+ const message = `The "topicToken" generator option must be "#" (${givenTopicTokenJSON} received instead).`;
+ throw new Error(message);
+ }
+ }
+ }
+
+ function PipelineTopicExpression(node) {
+ this.print(node.expression, node);
+ }
+
+ function PipelineBareFunction(node) {
+ this.print(node.callee, node);
+ }
+
+ function PipelinePrimaryTopicReference() {
+ this.token("#");
+ }
+
+ var flow = {};
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.AnyTypeAnnotation = AnyTypeAnnotation;
+ exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
+ exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
+ exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
+ exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
+ exports.DeclareClass = DeclareClass;
+ exports.DeclareFunction = DeclareFunction;
+ exports.InferredPredicate = InferredPredicate;
+ exports.DeclaredPredicate = DeclaredPredicate;
+ exports.DeclareInterface = DeclareInterface;
+ exports.DeclareModule = DeclareModule;
+ exports.DeclareModuleExports = DeclareModuleExports;
+ exports.DeclareTypeAlias = DeclareTypeAlias;
+ exports.DeclareOpaqueType = DeclareOpaqueType;
+ exports.DeclareVariable = DeclareVariable;
+ exports.DeclareExportDeclaration = DeclareExportDeclaration;
+ exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
+ exports.EnumDeclaration = EnumDeclaration;
+ exports.EnumBooleanBody = EnumBooleanBody;
+ exports.EnumNumberBody = EnumNumberBody;
+ exports.EnumStringBody = EnumStringBody;
+ exports.EnumSymbolBody = EnumSymbolBody;
+ exports.EnumDefaultedMember = EnumDefaultedMember;
+ exports.EnumBooleanMember = EnumBooleanMember;
+ exports.EnumNumberMember = EnumNumberMember;
+ exports.EnumStringMember = EnumStringMember;
+ exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
+ exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
+ exports.FunctionTypeParam = FunctionTypeParam;
+ exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
+ exports._interfaceish = _interfaceish;
+ exports._variance = _variance;
+ exports.InterfaceDeclaration = InterfaceDeclaration;
+ exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
+ exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
+ exports.MixedTypeAnnotation = MixedTypeAnnotation;
+ exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
+ exports.NullableTypeAnnotation = NullableTypeAnnotation;
+ exports.NumberTypeAnnotation = NumberTypeAnnotation;
+ exports.StringTypeAnnotation = StringTypeAnnotation;
+ exports.ThisTypeAnnotation = ThisTypeAnnotation;
+ exports.TupleTypeAnnotation = TupleTypeAnnotation;
+ exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
+ exports.TypeAlias = TypeAlias;
+ exports.TypeAnnotation = TypeAnnotation;
+ exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
+ exports.TypeParameter = TypeParameter;
+ exports.OpaqueType = OpaqueType;
+ exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
+ exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
+ exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
+ exports.ObjectTypeIndexer = ObjectTypeIndexer;
+ exports.ObjectTypeProperty = ObjectTypeProperty;
+ exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
+ exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
+ exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
+ exports.UnionTypeAnnotation = UnionTypeAnnotation;
+ exports.TypeCastExpression = TypeCastExpression;
+ exports.Variance = Variance;
+ exports.VoidTypeAnnotation = VoidTypeAnnotation;
+ exports.IndexedAccessType = IndexedAccessType;
+ exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
+ Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _types2.NumericLiteral;
+ }
+ });
+ Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _types2.StringLiteral;
+ }
+ });
+
+ var _t = lib$6;
+
+ var _modules = modules;
+
+ var _types2 = types;
+
+ const {
+ isDeclareExportDeclaration,
+ isStatement
+ } = _t;
+
+ function AnyTypeAnnotation() {
+ this.word("any");
+ }
+
+ function ArrayTypeAnnotation(node) {
+ this.print(node.elementType, node);
+ this.token("[");
+ this.token("]");
+ }
+
+ function BooleanTypeAnnotation() {
+ this.word("boolean");
+ }
+
+ function BooleanLiteralTypeAnnotation(node) {
+ this.word(node.value ? "true" : "false");
+ }
+
+ function NullLiteralTypeAnnotation() {
+ this.word("null");
+ }
+
+ function DeclareClass(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("class");
+ this.space();
+
+ this._interfaceish(node);
+ }
+
+ function DeclareFunction(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("function");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.id.typeAnnotation.typeAnnotation, node);
+
+ if (node.predicate) {
+ this.space();
+ this.print(node.predicate, node);
+ }
+
+ this.semicolon();
+ }
+
+ function InferredPredicate() {
+ this.token("%");
+ this.word("checks");
+ }
+
+ function DeclaredPredicate(node) {
+ this.token("%");
+ this.word("checks");
+ this.token("(");
+ this.print(node.value, node);
+ this.token(")");
+ }
+
+ function DeclareInterface(node) {
+ this.word("declare");
+ this.space();
+ this.InterfaceDeclaration(node);
+ }
+
+ function DeclareModule(node) {
+ this.word("declare");
+ this.space();
+ this.word("module");
+ this.space();
+ this.print(node.id, node);
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function DeclareModuleExports(node) {
+ this.word("declare");
+ this.space();
+ this.word("module");
+ this.token(".");
+ this.word("exports");
+ this.print(node.typeAnnotation, node);
+ }
+
+ function DeclareTypeAlias(node) {
+ this.word("declare");
+ this.space();
+ this.TypeAlias(node);
+ }
+
+ function DeclareOpaqueType(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.OpaqueType(node);
+ }
+
+ function DeclareVariable(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("var");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.id.typeAnnotation, node);
+ this.semicolon();
+ }
+
+ function DeclareExportDeclaration(node) {
+ this.word("declare");
+ this.space();
+ this.word("export");
+ this.space();
+
+ if (node.default) {
+ this.word("default");
+ this.space();
+ }
+
+ FlowExportDeclaration.apply(this, arguments);
+ }
+
+ function DeclareExportAllDeclaration() {
+ this.word("declare");
+ this.space();
+
+ _modules.ExportAllDeclaration.apply(this, arguments);
+ }
+
+ function EnumDeclaration(node) {
+ const {
+ id,
+ body
+ } = node;
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.print(body, node);
+ }
+
+ function enumExplicitType(context, name, hasExplicitType) {
+ if (hasExplicitType) {
+ context.space();
+ context.word("of");
+ context.space();
+ context.word(name);
+ }
+
+ context.space();
+ }
+
+ function enumBody(context, node) {
+ const {
+ members
+ } = node;
+ context.token("{");
+ context.indent();
+ context.newline();
+
+ for (const member of members) {
+ context.print(member, node);
+ context.newline();
+ }
+
+ if (node.hasUnknownMembers) {
+ context.token("...");
+ context.newline();
+ }
+
+ context.dedent();
+ context.token("}");
+ }
+
+ function EnumBooleanBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "boolean", explicitType);
+ enumBody(this, node);
+ }
+
+ function EnumNumberBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "number", explicitType);
+ enumBody(this, node);
+ }
+
+ function EnumStringBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "string", explicitType);
+ enumBody(this, node);
+ }
+
+ function EnumSymbolBody(node) {
+ enumExplicitType(this, "symbol", true);
+ enumBody(this, node);
+ }
+
+ function EnumDefaultedMember(node) {
+ const {
+ id
+ } = node;
+ this.print(id, node);
+ this.token(",");
+ }
+
+ function enumInitializedMember(context, node) {
+ const {
+ id,
+ init
+ } = node;
+ context.print(id, node);
+ context.space();
+ context.token("=");
+ context.space();
+ context.print(init, node);
+ context.token(",");
+ }
+
+ function EnumBooleanMember(node) {
+ enumInitializedMember(this, node);
+ }
+
+ function EnumNumberMember(node) {
+ enumInitializedMember(this, node);
+ }
+
+ function EnumStringMember(node) {
+ enumInitializedMember(this, node);
+ }
+
+ function FlowExportDeclaration(node) {
+ if (node.declaration) {
+ const declar = node.declaration;
+ this.print(declar, node);
+ if (!isStatement(declar)) this.semicolon();
+ } else {
+ this.token("{");
+
+ if (node.specifiers.length) {
+ this.space();
+ this.printList(node.specifiers, node);
+ this.space();
+ }
+
+ this.token("}");
+
+ if (node.source) {
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ }
+
+ this.semicolon();
+ }
+ }
+
+ function ExistsTypeAnnotation() {
+ this.token("*");
+ }
+
+ function FunctionTypeAnnotation(node, parent) {
+ this.print(node.typeParameters, node);
+ this.token("(");
+
+ if (node.this) {
+ this.word("this");
+ this.token(":");
+ this.space();
+ this.print(node.this.typeAnnotation, node);
+
+ if (node.params.length || node.rest) {
+ this.token(",");
+ this.space();
+ }
+ }
+
+ this.printList(node.params, node);
+
+ if (node.rest) {
+ if (node.params.length) {
+ this.token(",");
+ this.space();
+ }
+
+ this.token("...");
+ this.print(node.rest, node);
+ }
+
+ this.token(")");
+
+ if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
+ this.token(":");
+ } else {
+ this.space();
+ this.token("=>");
+ }
+
+ this.space();
+ this.print(node.returnType, node);
+ }
+
+ function FunctionTypeParam(node) {
+ this.print(node.name, node);
+ if (node.optional) this.token("?");
+
+ if (node.name) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.typeAnnotation, node);
+ }
+
+ function InterfaceExtends(node) {
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+ }
+
+ function _interfaceish(node) {
+ var _node$extends;
+
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+
+ if ((_node$extends = node.extends) != null && _node$extends.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(node.extends, node);
+ }
+
+ if (node.mixins && node.mixins.length) {
+ this.space();
+ this.word("mixins");
+ this.space();
+ this.printList(node.mixins, node);
+ }
+
+ if (node.implements && node.implements.length) {
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function _variance(node) {
+ if (node.variance) {
+ if (node.variance.kind === "plus") {
+ this.token("+");
+ } else if (node.variance.kind === "minus") {
+ this.token("-");
+ }
+ }
+ }
+
+ function InterfaceDeclaration(node) {
+ this.word("interface");
+ this.space();
+
+ this._interfaceish(node);
+ }
+
+ function andSeparator() {
+ this.space();
+ this.token("&");
+ this.space();
+ }
+
+ function InterfaceTypeAnnotation(node) {
+ this.word("interface");
+
+ if (node.extends && node.extends.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(node.extends, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+ }
+
+ function IntersectionTypeAnnotation(node) {
+ this.printJoin(node.types, node, {
+ separator: andSeparator
+ });
+ }
+
+ function MixedTypeAnnotation() {
+ this.word("mixed");
+ }
+
+ function EmptyTypeAnnotation() {
+ this.word("empty");
+ }
+
+ function NullableTypeAnnotation(node) {
+ this.token("?");
+ this.print(node.typeAnnotation, node);
+ }
+
+ function NumberTypeAnnotation() {
+ this.word("number");
+ }
+
+ function StringTypeAnnotation() {
+ this.word("string");
+ }
+
+ function ThisTypeAnnotation() {
+ this.word("this");
+ }
+
+ function TupleTypeAnnotation(node) {
+ this.token("[");
+ this.printList(node.types, node);
+ this.token("]");
+ }
+
+ function TypeofTypeAnnotation(node) {
+ this.word("typeof");
+ this.space();
+ this.print(node.argument, node);
+ }
+
+ function TypeAlias(node) {
+ this.word("type");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.right, node);
+ this.semicolon();
+ }
+
+ function TypeAnnotation(node) {
+ this.token(":");
+ this.space();
+ if (node.optional) this.token("?");
+ this.print(node.typeAnnotation, node);
+ }
+
+ function TypeParameterInstantiation(node) {
+ this.token("<");
+ this.printList(node.params, node, {});
+ this.token(">");
+ }
+
+ function TypeParameter(node) {
+ this._variance(node);
+
+ this.word(node.name);
+
+ if (node.bound) {
+ this.print(node.bound, node);
+ }
+
+ if (node.default) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.default, node);
+ }
+ }
+
+ function OpaqueType(node) {
+ this.word("opaque");
+ this.space();
+ this.word("type");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+
+ if (node.supertype) {
+ this.token(":");
+ this.space();
+ this.print(node.supertype, node);
+ }
+
+ if (node.impltype) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.impltype, node);
+ }
+
+ this.semicolon();
+ }
+
+ function ObjectTypeAnnotation(node) {
+ if (node.exact) {
+ this.token("{|");
+ } else {
+ this.token("{");
+ }
+
+ const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])];
+
+ if (props.length) {
+ this.space();
+ this.printJoin(props, node, {
+ addNewlines(leading) {
+ if (leading && !props[0]) return 1;
+ },
+
+ indent: true,
+ statement: true,
+ iterator: () => {
+ if (props.length !== 1 || node.inexact) {
+ this.token(",");
+ this.space();
+ }
+ }
+ });
+ this.space();
+ }
+
+ if (node.inexact) {
+ this.indent();
+ this.token("...");
+
+ if (props.length) {
+ this.newline();
+ }
+
+ this.dedent();
+ }
+
+ if (node.exact) {
+ this.token("|}");
+ } else {
+ this.token("}");
+ }
+ }
+
+ function ObjectTypeInternalSlot(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.token("[");
+ this.token("[");
+ this.print(node.id, node);
+ this.token("]");
+ this.token("]");
+ if (node.optional) this.token("?");
+
+ if (!node.method) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.value, node);
+ }
+
+ function ObjectTypeCallProperty(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.print(node.value, node);
+ }
+
+ function ObjectTypeIndexer(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this._variance(node);
+
+ this.token("[");
+
+ if (node.id) {
+ this.print(node.id, node);
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.key, node);
+ this.token("]");
+ this.token(":");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ function ObjectTypeProperty(node) {
+ if (node.proto) {
+ this.word("proto");
+ this.space();
+ }
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ if (node.kind === "get" || node.kind === "set") {
+ this.word(node.kind);
+ this.space();
+ }
+
+ this._variance(node);
+
+ this.print(node.key, node);
+ if (node.optional) this.token("?");
+
+ if (!node.method) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.value, node);
+ }
+
+ function ObjectTypeSpreadProperty(node) {
+ this.token("...");
+ this.print(node.argument, node);
+ }
+
+ function QualifiedTypeIdentifier(node) {
+ this.print(node.qualification, node);
+ this.token(".");
+ this.print(node.id, node);
+ }
+
+ function SymbolTypeAnnotation() {
+ this.word("symbol");
+ }
+
+ function orSeparator() {
+ this.space();
+ this.token("|");
+ this.space();
+ }
+
+ function UnionTypeAnnotation(node) {
+ this.printJoin(node.types, node, {
+ separator: orSeparator
+ });
+ }
+
+ function TypeCastExpression(node) {
+ this.token("(");
+ this.print(node.expression, node);
+ this.print(node.typeAnnotation, node);
+ this.token(")");
+ }
+
+ function Variance(node) {
+ if (node.kind === "plus") {
+ this.token("+");
+ } else {
+ this.token("-");
+ }
+ }
+
+ function VoidTypeAnnotation() {
+ this.word("void");
+ }
+
+ function IndexedAccessType(node) {
+ this.print(node.objectType, node);
+ this.token("[");
+ this.print(node.indexType, node);
+ this.token("]");
+ }
+
+ function OptionalIndexedAccessType(node) {
+ this.print(node.objectType, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("[");
+ this.print(node.indexType, node);
+ this.token("]");
+ }
+ } (flow));
+
+ var base = {};
+
+ Object.defineProperty(base, "__esModule", {
+ value: true
+ });
+ base.File = File;
+ base.Program = Program;
+ base.BlockStatement = BlockStatement;
+ base.Directive = Directive;
+ base.DirectiveLiteral = DirectiveLiteral;
+ base.InterpreterDirective = InterpreterDirective;
+ base.Placeholder = Placeholder;
+
+ function File(node) {
+ if (node.program) {
+ this.print(node.program.interpreter, node);
+ }
+
+ this.print(node.program, node);
+ }
+
+ function Program(node) {
+ this.printInnerComments(node, false);
+ this.printSequence(node.directives, node);
+ if (node.directives && node.directives.length) this.newline();
+ this.printSequence(node.body, node);
+ }
+
+ function BlockStatement(node) {
+ var _node$directives;
+
+ this.token("{");
+ this.printInnerComments(node);
+ const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
+
+ if (node.body.length || hasDirectives) {
+ this.newline();
+ this.printSequence(node.directives, node, {
+ indent: true
+ });
+ if (hasDirectives) this.newline();
+ this.printSequence(node.body, node, {
+ indent: true
+ });
+ this.removeTrailingNewline();
+ this.source("end", node.loc);
+ if (!this.endsWith(10)) this.newline();
+ this.rightBrace();
+ } else {
+ this.source("end", node.loc);
+ this.token("}");
+ }
+ }
+
+ function Directive(node) {
+ this.print(node.value, node);
+ this.semicolon();
+ }
+
+ const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
+ const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
+
+ function DirectiveLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (raw != null) {
+ this.token(raw);
+ return;
+ }
+
+ const {
+ value
+ } = node;
+
+ if (!unescapedDoubleQuoteRE.test(value)) {
+ this.token(`"${value}"`);
+ } else if (!unescapedSingleQuoteRE.test(value)) {
+ this.token(`'${value}'`);
+ } else {
+ throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
+ }
+ }
+
+ function InterpreterDirective(node) {
+ this.token(`#!${node.value}\n`);
+ }
+
+ function Placeholder(node) {
+ this.token("%%");
+ this.print(node.name);
+ this.token("%%");
+
+ if (node.expectedNode === "Statement") {
+ this.semicolon();
+ }
+ }
+
+ var jsx = {};
+
+ Object.defineProperty(jsx, "__esModule", {
+ value: true
+ });
+ jsx.JSXAttribute = JSXAttribute;
+ jsx.JSXIdentifier = JSXIdentifier;
+ jsx.JSXNamespacedName = JSXNamespacedName;
+ jsx.JSXMemberExpression = JSXMemberExpression;
+ jsx.JSXSpreadAttribute = JSXSpreadAttribute;
+ jsx.JSXExpressionContainer = JSXExpressionContainer;
+ jsx.JSXSpreadChild = JSXSpreadChild;
+ jsx.JSXText = JSXText;
+ jsx.JSXElement = JSXElement;
+ jsx.JSXOpeningElement = JSXOpeningElement;
+ jsx.JSXClosingElement = JSXClosingElement;
+ jsx.JSXEmptyExpression = JSXEmptyExpression;
+ jsx.JSXFragment = JSXFragment;
+ jsx.JSXOpeningFragment = JSXOpeningFragment;
+ jsx.JSXClosingFragment = JSXClosingFragment;
+
+ function JSXAttribute(node) {
+ this.print(node.name, node);
+
+ if (node.value) {
+ this.token("=");
+ this.print(node.value, node);
+ }
+ }
+
+ function JSXIdentifier(node) {
+ this.word(node.name);
+ }
+
+ function JSXNamespacedName(node) {
+ this.print(node.namespace, node);
+ this.token(":");
+ this.print(node.name, node);
+ }
+
+ function JSXMemberExpression(node) {
+ this.print(node.object, node);
+ this.token(".");
+ this.print(node.property, node);
+ }
+
+ function JSXSpreadAttribute(node) {
+ this.token("{");
+ this.token("...");
+ this.print(node.argument, node);
+ this.token("}");
+ }
+
+ function JSXExpressionContainer(node) {
+ this.token("{");
+ this.print(node.expression, node);
+ this.token("}");
+ }
+
+ function JSXSpreadChild(node) {
+ this.token("{");
+ this.token("...");
+ this.print(node.expression, node);
+ this.token("}");
+ }
+
+ function JSXText(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (raw != null) {
+ this.token(raw);
+ } else {
+ this.token(node.value);
+ }
+ }
+
+ function JSXElement(node) {
+ const open = node.openingElement;
+ this.print(open, node);
+ if (open.selfClosing) return;
+ this.indent();
+
+ for (const child of node.children) {
+ this.print(child, node);
+ }
+
+ this.dedent();
+ this.print(node.closingElement, node);
+ }
+
+ function spaceSeparator() {
+ this.space();
+ }
+
+ function JSXOpeningElement(node) {
+ this.token("<");
+ this.print(node.name, node);
+ this.print(node.typeParameters, node);
+
+ if (node.attributes.length > 0) {
+ this.space();
+ this.printJoin(node.attributes, node, {
+ separator: spaceSeparator
+ });
+ }
+
+ if (node.selfClosing) {
+ this.space();
+ this.token("/>");
+ } else {
+ this.token(">");
+ }
+ }
+
+ function JSXClosingElement(node) {
+ this.token("</");
+ this.print(node.name, node);
+ this.token(">");
+ }
+
+ function JSXEmptyExpression(node) {
+ this.printInnerComments(node);
+ }
+
+ function JSXFragment(node) {
+ this.print(node.openingFragment, node);
+ this.indent();
+
+ for (const child of node.children) {
+ this.print(child, node);
+ }
+
+ this.dedent();
+ this.print(node.closingFragment, node);
+ }
+
+ function JSXOpeningFragment() {
+ this.token("<");
+ this.token(">");
+ }
+
+ function JSXClosingFragment() {
+ this.token("</");
+ this.token(">");
+ }
+
+ var typescript = {};
+
+ Object.defineProperty(typescript, "__esModule", {
+ value: true
+ });
+ typescript.TSTypeAnnotation = TSTypeAnnotation;
+ typescript.TSTypeParameterDeclaration = typescript.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
+ typescript.TSTypeParameter = TSTypeParameter;
+ typescript.TSParameterProperty = TSParameterProperty;
+ typescript.TSDeclareFunction = TSDeclareFunction;
+ typescript.TSDeclareMethod = TSDeclareMethod;
+ typescript.TSQualifiedName = TSQualifiedName;
+ typescript.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
+ typescript.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
+ typescript.TSPropertySignature = TSPropertySignature;
+ typescript.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
+ typescript.TSMethodSignature = TSMethodSignature;
+ typescript.TSIndexSignature = TSIndexSignature;
+ typescript.TSAnyKeyword = TSAnyKeyword;
+ typescript.TSBigIntKeyword = TSBigIntKeyword;
+ typescript.TSUnknownKeyword = TSUnknownKeyword;
+ typescript.TSNumberKeyword = TSNumberKeyword;
+ typescript.TSObjectKeyword = TSObjectKeyword;
+ typescript.TSBooleanKeyword = TSBooleanKeyword;
+ typescript.TSStringKeyword = TSStringKeyword;
+ typescript.TSSymbolKeyword = TSSymbolKeyword;
+ typescript.TSVoidKeyword = TSVoidKeyword;
+ typescript.TSUndefinedKeyword = TSUndefinedKeyword;
+ typescript.TSNullKeyword = TSNullKeyword;
+ typescript.TSNeverKeyword = TSNeverKeyword;
+ typescript.TSIntrinsicKeyword = TSIntrinsicKeyword;
+ typescript.TSThisType = TSThisType;
+ typescript.TSFunctionType = TSFunctionType;
+ typescript.TSConstructorType = TSConstructorType;
+ typescript.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
+ typescript.TSTypeReference = TSTypeReference;
+ typescript.TSTypePredicate = TSTypePredicate;
+ typescript.TSTypeQuery = TSTypeQuery;
+ typescript.TSTypeLiteral = TSTypeLiteral;
+ typescript.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
+ typescript.tsPrintBraced = tsPrintBraced;
+ typescript.TSArrayType = TSArrayType;
+ typescript.TSTupleType = TSTupleType;
+ typescript.TSOptionalType = TSOptionalType;
+ typescript.TSRestType = TSRestType;
+ typescript.TSNamedTupleMember = TSNamedTupleMember;
+ typescript.TSUnionType = TSUnionType;
+ typescript.TSIntersectionType = TSIntersectionType;
+ typescript.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
+ typescript.TSConditionalType = TSConditionalType;
+ typescript.TSInferType = TSInferType;
+ typescript.TSParenthesizedType = TSParenthesizedType;
+ typescript.TSTypeOperator = TSTypeOperator;
+ typescript.TSIndexedAccessType = TSIndexedAccessType;
+ typescript.TSMappedType = TSMappedType;
+ typescript.TSLiteralType = TSLiteralType;
+ typescript.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
+ typescript.TSInterfaceDeclaration = TSInterfaceDeclaration;
+ typescript.TSInterfaceBody = TSInterfaceBody;
+ typescript.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
+ typescript.TSAsExpression = TSAsExpression;
+ typescript.TSTypeAssertion = TSTypeAssertion;
+ typescript.TSEnumDeclaration = TSEnumDeclaration;
+ typescript.TSEnumMember = TSEnumMember;
+ typescript.TSModuleDeclaration = TSModuleDeclaration;
+ typescript.TSModuleBlock = TSModuleBlock;
+ typescript.TSImportType = TSImportType;
+ typescript.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
+ typescript.TSExternalModuleReference = TSExternalModuleReference;
+ typescript.TSNonNullExpression = TSNonNullExpression;
+ typescript.TSExportAssignment = TSExportAssignment;
+ typescript.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
+ typescript.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
+ typescript.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
+
+ function TSTypeAnnotation(node) {
+ this.token(":");
+ this.space();
+ if (node.optional) this.token("?");
+ this.print(node.typeAnnotation, node);
+ }
+
+ function TSTypeParameterInstantiation(node) {
+ this.token("<");
+ this.printList(node.params, node, {});
+ this.token(">");
+ }
+
+ function TSTypeParameter(node) {
+ this.word(node.name);
+
+ if (node.constraint) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.constraint, node);
+ }
+
+ if (node.default) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.default, node);
+ }
+ }
+
+ function TSParameterProperty(node) {
+ if (node.accessibility) {
+ this.word(node.accessibility);
+ this.space();
+ }
+
+ if (node.readonly) {
+ this.word("readonly");
+ this.space();
+ }
+
+ this._param(node.parameter);
+ }
+
+ function TSDeclareFunction(node) {
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this._functionHead(node);
+
+ this.token(";");
+ }
+
+ function TSDeclareMethod(node) {
+ this._classMethodHead(node);
+
+ this.token(";");
+ }
+
+ function TSQualifiedName(node) {
+ this.print(node.left, node);
+ this.token(".");
+ this.print(node.right, node);
+ }
+
+ function TSCallSignatureDeclaration(node) {
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+ }
+
+ function TSConstructSignatureDeclaration(node) {
+ this.word("new");
+ this.space();
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+ }
+
+ function TSPropertySignature(node) {
+ const {
+ readonly,
+ initializer
+ } = node;
+
+ if (readonly) {
+ this.word("readonly");
+ this.space();
+ }
+
+ this.tsPrintPropertyOrMethodName(node);
+ this.print(node.typeAnnotation, node);
+
+ if (initializer) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(initializer, node);
+ }
+
+ this.token(";");
+ }
+
+ function tsPrintPropertyOrMethodName(node) {
+ if (node.computed) {
+ this.token("[");
+ }
+
+ this.print(node.key, node);
+
+ if (node.computed) {
+ this.token("]");
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+ }
+
+ function TSMethodSignature(node) {
+ const {
+ kind
+ } = node;
+
+ if (kind === "set" || kind === "get") {
+ this.word(kind);
+ this.space();
+ }
+
+ this.tsPrintPropertyOrMethodName(node);
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+ }
+
+ function TSIndexSignature(node) {
+ const {
+ readonly,
+ static: isStatic
+ } = node;
+
+ if (isStatic) {
+ this.word("static");
+ this.space();
+ }
+
+ if (readonly) {
+ this.word("readonly");
+ this.space();
+ }
+
+ this.token("[");
+
+ this._parameters(node.parameters, node);
+
+ this.token("]");
+ this.print(node.typeAnnotation, node);
+ this.token(";");
+ }
+
+ function TSAnyKeyword() {
+ this.word("any");
+ }
+
+ function TSBigIntKeyword() {
+ this.word("bigint");
+ }
+
+ function TSUnknownKeyword() {
+ this.word("unknown");
+ }
+
+ function TSNumberKeyword() {
+ this.word("number");
+ }
+
+ function TSObjectKeyword() {
+ this.word("object");
+ }
+
+ function TSBooleanKeyword() {
+ this.word("boolean");
+ }
+
+ function TSStringKeyword() {
+ this.word("string");
+ }
+
+ function TSSymbolKeyword() {
+ this.word("symbol");
+ }
+
+ function TSVoidKeyword() {
+ this.word("void");
+ }
+
+ function TSUndefinedKeyword() {
+ this.word("undefined");
+ }
+
+ function TSNullKeyword() {
+ this.word("null");
+ }
+
+ function TSNeverKeyword() {
+ this.word("never");
+ }
+
+ function TSIntrinsicKeyword() {
+ this.word("intrinsic");
+ }
+
+ function TSThisType() {
+ this.word("this");
+ }
+
+ function TSFunctionType(node) {
+ this.tsPrintFunctionOrConstructorType(node);
+ }
+
+ function TSConstructorType(node) {
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ this.word("new");
+ this.space();
+ this.tsPrintFunctionOrConstructorType(node);
+ }
+
+ function tsPrintFunctionOrConstructorType(node) {
+ const {
+ typeParameters,
+ parameters
+ } = node;
+ this.print(typeParameters, node);
+ this.token("(");
+
+ this._parameters(parameters, node);
+
+ this.token(")");
+ this.space();
+ this.token("=>");
+ this.space();
+ this.print(node.typeAnnotation.typeAnnotation, node);
+ }
+
+ function TSTypeReference(node) {
+ this.print(node.typeName, node);
+ this.print(node.typeParameters, node);
+ }
+
+ function TSTypePredicate(node) {
+ if (node.asserts) {
+ this.word("asserts");
+ this.space();
+ }
+
+ this.print(node.parameterName);
+
+ if (node.typeAnnotation) {
+ this.space();
+ this.word("is");
+ this.space();
+ this.print(node.typeAnnotation.typeAnnotation);
+ }
+ }
+
+ function TSTypeQuery(node) {
+ this.word("typeof");
+ this.space();
+ this.print(node.exprName);
+ }
+
+ function TSTypeLiteral(node) {
+ this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);
+ }
+
+ function tsPrintTypeLiteralOrInterfaceBody(members, node) {
+ this.tsPrintBraced(members, node);
+ }
+
+ function tsPrintBraced(members, node) {
+ this.token("{");
+
+ if (members.length) {
+ this.indent();
+ this.newline();
+
+ for (const member of members) {
+ this.print(member, node);
+ this.newline();
+ }
+
+ this.dedent();
+ this.rightBrace();
+ } else {
+ this.token("}");
+ }
+ }
+
+ function TSArrayType(node) {
+ this.print(node.elementType, node);
+ this.token("[]");
+ }
+
+ function TSTupleType(node) {
+ this.token("[");
+ this.printList(node.elementTypes, node);
+ this.token("]");
+ }
+
+ function TSOptionalType(node) {
+ this.print(node.typeAnnotation, node);
+ this.token("?");
+ }
+
+ function TSRestType(node) {
+ this.token("...");
+ this.print(node.typeAnnotation, node);
+ }
+
+ function TSNamedTupleMember(node) {
+ this.print(node.label, node);
+ if (node.optional) this.token("?");
+ this.token(":");
+ this.space();
+ this.print(node.elementType, node);
+ }
+
+ function TSUnionType(node) {
+ this.tsPrintUnionOrIntersectionType(node, "|");
+ }
+
+ function TSIntersectionType(node) {
+ this.tsPrintUnionOrIntersectionType(node, "&");
+ }
+
+ function tsPrintUnionOrIntersectionType(node, sep) {
+ this.printJoin(node.types, node, {
+ separator() {
+ this.space();
+ this.token(sep);
+ this.space();
+ }
+
+ });
+ }
+
+ function TSConditionalType(node) {
+ this.print(node.checkType);
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.extendsType);
+ this.space();
+ this.token("?");
+ this.space();
+ this.print(node.trueType);
+ this.space();
+ this.token(":");
+ this.space();
+ this.print(node.falseType);
+ }
+
+ function TSInferType(node) {
+ this.token("infer");
+ this.space();
+ this.print(node.typeParameter);
+ }
+
+ function TSParenthesizedType(node) {
+ this.token("(");
+ this.print(node.typeAnnotation, node);
+ this.token(")");
+ }
+
+ function TSTypeOperator(node) {
+ this.word(node.operator);
+ this.space();
+ this.print(node.typeAnnotation, node);
+ }
+
+ function TSIndexedAccessType(node) {
+ this.print(node.objectType, node);
+ this.token("[");
+ this.print(node.indexType, node);
+ this.token("]");
+ }
+
+ function TSMappedType(node) {
+ const {
+ nameType,
+ optional,
+ readonly,
+ typeParameter
+ } = node;
+ this.token("{");
+ this.space();
+
+ if (readonly) {
+ tokenIfPlusMinus(this, readonly);
+ this.word("readonly");
+ this.space();
+ }
+
+ this.token("[");
+ this.word(typeParameter.name);
+ this.space();
+ this.word("in");
+ this.space();
+ this.print(typeParameter.constraint, typeParameter);
+
+ if (nameType) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(nameType, node);
+ }
+
+ this.token("]");
+
+ if (optional) {
+ tokenIfPlusMinus(this, optional);
+ this.token("?");
+ }
+
+ this.token(":");
+ this.space();
+ this.print(node.typeAnnotation, node);
+ this.space();
+ this.token("}");
+ }
+
+ function tokenIfPlusMinus(self, tok) {
+ if (tok !== true) {
+ self.token(tok);
+ }
+ }
+
+ function TSLiteralType(node) {
+ this.print(node.literal, node);
+ }
+
+ function TSExpressionWithTypeArguments(node) {
+ this.print(node.expression, node);
+ this.print(node.typeParameters, node);
+ }
+
+ function TSInterfaceDeclaration(node) {
+ const {
+ declare,
+ id,
+ typeParameters,
+ extends: extendz,
+ body
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("interface");
+ this.space();
+ this.print(id, node);
+ this.print(typeParameters, node);
+
+ if (extendz != null && extendz.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(extendz, node);
+ }
+
+ this.space();
+ this.print(body, node);
+ }
+
+ function TSInterfaceBody(node) {
+ this.tsPrintTypeLiteralOrInterfaceBody(node.body, node);
+ }
+
+ function TSTypeAliasDeclaration(node) {
+ const {
+ declare,
+ id,
+ typeParameters,
+ typeAnnotation
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("type");
+ this.space();
+ this.print(id, node);
+ this.print(typeParameters, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(typeAnnotation, node);
+ this.token(";");
+ }
+
+ function TSAsExpression(node) {
+ const {
+ expression,
+ typeAnnotation
+ } = node;
+ this.print(expression, node);
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(typeAnnotation, node);
+ }
+
+ function TSTypeAssertion(node) {
+ const {
+ typeAnnotation,
+ expression
+ } = node;
+ this.token("<");
+ this.print(typeAnnotation, node);
+ this.token(">");
+ this.space();
+ this.print(expression, node);
+ }
+
+ function TSEnumDeclaration(node) {
+ const {
+ declare,
+ const: isConst,
+ id,
+ members
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (isConst) {
+ this.word("const");
+ this.space();
+ }
+
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.space();
+ this.tsPrintBraced(members, node);
+ }
+
+ function TSEnumMember(node) {
+ const {
+ id,
+ initializer
+ } = node;
+ this.print(id, node);
+
+ if (initializer) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(initializer, node);
+ }
+
+ this.token(",");
+ }
+
+ function TSModuleDeclaration(node) {
+ const {
+ declare,
+ id
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (!node.global) {
+ this.word(id.type === "Identifier" ? "namespace" : "module");
+ this.space();
+ }
+
+ this.print(id, node);
+
+ if (!node.body) {
+ this.token(";");
+ return;
+ }
+
+ let body = node.body;
+
+ while (body.type === "TSModuleDeclaration") {
+ this.token(".");
+ this.print(body.id, body);
+ body = body.body;
+ }
+
+ this.space();
+ this.print(body, node);
+ }
+
+ function TSModuleBlock(node) {
+ this.tsPrintBraced(node.body, node);
+ }
+
+ function TSImportType(node) {
+ const {
+ argument,
+ qualifier,
+ typeParameters
+ } = node;
+ this.word("import");
+ this.token("(");
+ this.print(argument, node);
+ this.token(")");
+
+ if (qualifier) {
+ this.token(".");
+ this.print(qualifier, node);
+ }
+
+ if (typeParameters) {
+ this.print(typeParameters, node);
+ }
+ }
+
+ function TSImportEqualsDeclaration(node) {
+ const {
+ isExport,
+ id,
+ moduleReference
+ } = node;
+
+ if (isExport) {
+ this.word("export");
+ this.space();
+ }
+
+ this.word("import");
+ this.space();
+ this.print(id, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(moduleReference, node);
+ this.token(";");
+ }
+
+ function TSExternalModuleReference(node) {
+ this.token("require(");
+ this.print(node.expression, node);
+ this.token(")");
+ }
+
+ function TSNonNullExpression(node) {
+ this.print(node.expression, node);
+ this.token("!");
+ }
+
+ function TSExportAssignment(node) {
+ this.word("export");
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.expression, node);
+ this.token(";");
+ }
+
+ function TSNamespaceExportDeclaration(node) {
+ this.word("export");
+ this.space();
+ this.word("as");
+ this.space();
+ this.word("namespace");
+ this.space();
+ this.print(node.id, node);
+ }
+
+ function tsPrintSignatureDeclarationBase(node) {
+ const {
+ typeParameters,
+ parameters
+ } = node;
+ this.print(typeParameters, node);
+ this.token("(");
+
+ this._parameters(parameters, node);
+
+ this.token(")");
+ this.print(node.typeAnnotation, node);
+ }
+
+ function tsPrintClassMemberModifiers(node, isField) {
+ if (isField && node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (node.accessibility) {
+ this.word(node.accessibility);
+ this.space();
+ }
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ if (node.override) {
+ this.word("override");
+ this.space();
+ }
+
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ if (isField && node.readonly) {
+ this.word("readonly");
+ this.space();
+ }
+ }
+
+ (function (exports) {
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _templateLiterals = templateLiterals;
+
+ Object.keys(_templateLiterals).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _templateLiterals[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _templateLiterals[key];
+ }
+ });
+ });
+
+ var _expressions = expressions;
+
+ Object.keys(_expressions).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _expressions[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _expressions[key];
+ }
+ });
+ });
+
+ var _statements = statements;
+
+ Object.keys(_statements).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _statements[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _statements[key];
+ }
+ });
+ });
+
+ var _classes = classes;
+
+ Object.keys(_classes).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _classes[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _classes[key];
+ }
+ });
+ });
+
+ var _methods = methods;
+
+ Object.keys(_methods).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _methods[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _methods[key];
+ }
+ });
+ });
+
+ var _modules = modules;
+
+ Object.keys(_modules).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _modules[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _modules[key];
+ }
+ });
+ });
+
+ var _types = types;
+
+ Object.keys(_types).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _types[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _types[key];
+ }
+ });
+ });
+
+ var _flow = flow;
+
+ Object.keys(_flow).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _flow[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _flow[key];
+ }
+ });
+ });
+
+ var _base = base;
+
+ Object.keys(_base).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _base[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _base[key];
+ }
+ });
+ });
+
+ var _jsx = jsx;
+
+ Object.keys(_jsx).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _jsx[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _jsx[key];
+ }
+ });
+ });
+
+ var _typescript = typescript;
+
+ Object.keys(_typescript).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _typescript[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _typescript[key];
+ }
+ });
+ });
+ } (generators));
+
+ Object.defineProperty(printer, "__esModule", {
+ value: true
+ });
+ printer.default = void 0;
+
+ var _buffer = buffer;
+
+ var n = node;
+
+ var _t = lib$6;
+
+ var generatorFunctions = generators;
+
+ const {
+ isProgram,
+ isFile,
+ isEmptyStatement
+ } = _t;
+ const SCIENTIFIC_NOTATION = /e/i;
+ const ZERO_DECIMAL_INTEGER = /\.0+$/;
+ const NON_DECIMAL_LITERAL = /^0[box]/;
+ const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
+ const {
+ needsParens,
+ needsWhitespaceAfter,
+ needsWhitespaceBefore
+ } = n;
+
+ class Printer {
+ constructor(format, map) {
+ this.inForStatementInitCounter = 0;
+ this._printStack = [];
+ this._indent = 0;
+ this._insideAux = false;
+ this._parenPushNewlineState = null;
+ this._noLineTerminator = false;
+ this._printAuxAfterOnNextUserNode = false;
+ this._printedComments = new WeakSet();
+ this._endsWithInteger = false;
+ this._endsWithWord = false;
+ this.format = format;
+ this._buf = new _buffer.default(map);
+ }
+
+ generate(ast) {
+ this.print(ast);
+
+ this._maybeAddAuxComment();
+
+ return this._buf.get();
+ }
+
+ indent() {
+ if (this.format.compact || this.format.concise) return;
+ this._indent++;
+ }
+
+ dedent() {
+ if (this.format.compact || this.format.concise) return;
+ this._indent--;
+ }
+
+ semicolon(force = false) {
+ this._maybeAddAuxComment();
+
+ this._append(";", !force);
+ }
+
+ rightBrace() {
+ if (this.format.minified) {
+ this._buf.removeLastSemicolon();
+ }
+
+ this.token("}");
+ }
+
+ space(force = false) {
+ if (this.format.compact) return;
+
+ if (force) {
+ this._space();
+ } else if (this._buf.hasContent()) {
+ const lastCp = this.getLastChar();
+
+ if (lastCp !== 32 && lastCp !== 10) {
+ this._space();
+ }
+ }
+ }
+
+ word(str) {
+ if (this._endsWithWord || this.endsWith(47) && str.charCodeAt(0) === 47) {
+ this._space();
+ }
+
+ this._maybeAddAuxComment();
+
+ this._append(str);
+
+ this._endsWithWord = true;
+ }
+
+ number(str) {
+ this.word(str);
+ this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46;
+ }
+
+ token(str) {
+ const lastChar = this.getLastChar();
+ const strFirst = str.charCodeAt(0);
+
+ if (str === "--" && lastChar === 33 || strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 || strFirst === 46 && this._endsWithInteger) {
+ this._space();
+ }
+
+ this._maybeAddAuxComment();
+
+ this._append(str);
+ }
+
+ newline(i = 1) {
+ if (this.format.retainLines || this.format.compact) return;
+
+ if (this.format.concise) {
+ this.space();
+ return;
+ }
+
+ const charBeforeNewline = this.endsWithCharAndNewline();
+ if (charBeforeNewline === 10) return;
+
+ if (charBeforeNewline === 123 || charBeforeNewline === 58) {
+ i--;
+ }
+
+ if (i <= 0) return;
+
+ for (let j = 0; j < i; j++) {
+ this._newline();
+ }
+ }
+
+ endsWith(char) {
+ return this.getLastChar() === char;
+ }
+
+ getLastChar() {
+ return this._buf.getLastChar();
+ }
+
+ endsWithCharAndNewline() {
+ return this._buf.endsWithCharAndNewline();
+ }
+
+ removeTrailingNewline() {
+ this._buf.removeTrailingNewline();
+ }
+
+ exactSource(loc, cb) {
+ this._catchUp("start", loc);
+
+ this._buf.exactSource(loc, cb);
+ }
+
+ source(prop, loc) {
+ this._catchUp(prop, loc);
+
+ this._buf.source(prop, loc);
+ }
+
+ withSource(prop, loc, cb) {
+ this._catchUp(prop, loc);
+
+ this._buf.withSource(prop, loc, cb);
+ }
+
+ _space() {
+ this._append(" ", true);
+ }
+
+ _newline() {
+ this._append("\n", true);
+ }
+
+ _append(str, queue = false) {
+ this._maybeAddParen(str);
+
+ this._maybeIndent(str);
+
+ if (queue) this._buf.queue(str);else this._buf.append(str);
+ this._endsWithWord = false;
+ this._endsWithInteger = false;
+ }
+
+ _maybeIndent(str) {
+ if (this._indent && this.endsWith(10) && str.charCodeAt(0) !== 10) {
+ this._buf.queue(this._getIndent());
+ }
+ }
+
+ _maybeAddParen(str) {
+ const parenPushNewlineState = this._parenPushNewlineState;
+ if (!parenPushNewlineState) return;
+ let i;
+
+ for (i = 0; i < str.length && str[i] === " "; i++) continue;
+
+ if (i === str.length) {
+ return;
+ }
+
+ const cha = str[i];
+
+ if (cha !== "\n") {
+ if (cha !== "/" || i + 1 === str.length) {
+ this._parenPushNewlineState = null;
+ return;
+ }
+
+ const chaPost = str[i + 1];
+
+ if (chaPost === "*") {
+ if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) {
+ return;
+ }
+ } else if (chaPost !== "/") {
+ this._parenPushNewlineState = null;
+ return;
+ }
+ }
+
+ this.token("(");
+ this.indent();
+ parenPushNewlineState.printed = true;
+ }
+
+ _catchUp(prop, loc) {
+ if (!this.format.retainLines) return;
+ const pos = loc ? loc[prop] : null;
+
+ if ((pos == null ? void 0 : pos.line) != null) {
+ const count = pos.line - this._buf.getCurrentLine();
+
+ for (let i = 0; i < count; i++) {
+ this._newline();
+ }
+ }
+ }
+
+ _getIndent() {
+ return this.format.indent.style.repeat(this._indent);
+ }
+
+ startTerminatorless(isLabel = false) {
+ if (isLabel) {
+ this._noLineTerminator = true;
+ return null;
+ } else {
+ return this._parenPushNewlineState = {
+ printed: false
+ };
+ }
+ }
+
+ endTerminatorless(state) {
+ this._noLineTerminator = false;
+
+ if (state != null && state.printed) {
+ this.dedent();
+ this.newline();
+ this.token(")");
+ }
+ }
+
+ print(node, parent) {
+ if (!node) return;
+ const oldConcise = this.format.concise;
+
+ if (node._compact) {
+ this.format.concise = true;
+ }
+
+ const printMethod = this[node.type];
+
+ if (!printMethod) {
+ throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node == null ? void 0 : node.constructor.name)}`);
+ }
+
+ this._printStack.push(node);
+
+ const oldInAux = this._insideAux;
+ this._insideAux = !node.loc;
+
+ this._maybeAddAuxComment(this._insideAux && !oldInAux);
+
+ let shouldPrintParens = needsParens(node, parent, this._printStack);
+
+ if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
+ shouldPrintParens = true;
+ }
+
+ if (shouldPrintParens) this.token("(");
+
+ this._printLeadingComments(node);
+
+ const loc = isProgram(node) || isFile(node) ? null : node.loc;
+ this.withSource("start", loc, () => {
+ printMethod.call(this, node, parent);
+ });
+
+ this._printTrailingComments(node);
+
+ if (shouldPrintParens) this.token(")");
+
+ this._printStack.pop();
+
+ this.format.concise = oldConcise;
+ this._insideAux = oldInAux;
+ }
+
+ _maybeAddAuxComment(enteredPositionlessNode) {
+ if (enteredPositionlessNode) this._printAuxBeforeComment();
+ if (!this._insideAux) this._printAuxAfterComment();
+ }
+
+ _printAuxBeforeComment() {
+ if (this._printAuxAfterOnNextUserNode) return;
+ this._printAuxAfterOnNextUserNode = true;
+ const comment = this.format.auxiliaryCommentBefore;
+
+ if (comment) {
+ this._printComment({
+ type: "CommentBlock",
+ value: comment
+ });
+ }
+ }
+
+ _printAuxAfterComment() {
+ if (!this._printAuxAfterOnNextUserNode) return;
+ this._printAuxAfterOnNextUserNode = false;
+ const comment = this.format.auxiliaryCommentAfter;
+
+ if (comment) {
+ this._printComment({
+ type: "CommentBlock",
+ value: comment
+ });
+ }
+ }
+
+ getPossibleRaw(node) {
+ const extra = node.extra;
+
+ if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
+ return extra.raw;
+ }
+ }
+
+ printJoin(nodes, parent, opts = {}) {
+ if (!(nodes != null && nodes.length)) return;
+ if (opts.indent) this.indent();
+ const newlineOpts = {
+ addNewlines: opts.addNewlines
+ };
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+ if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
+ this.print(node, parent);
+
+ if (opts.iterator) {
+ opts.iterator(node, i);
+ }
+
+ if (opts.separator && i < nodes.length - 1) {
+ opts.separator.call(this);
+ }
+
+ if (opts.statement) this._printNewline(false, node, parent, newlineOpts);
+ }
+
+ if (opts.indent) this.dedent();
+ }
+
+ printAndIndentOnComments(node, parent) {
+ const indent = node.leadingComments && node.leadingComments.length > 0;
+ if (indent) this.indent();
+ this.print(node, parent);
+ if (indent) this.dedent();
+ }
+
+ printBlock(parent) {
+ const node = parent.body;
+
+ if (!isEmptyStatement(node)) {
+ this.space();
+ }
+
+ this.print(node, parent);
+ }
+
+ _printTrailingComments(node) {
+ this._printComments(this._getComments(false, node));
+ }
+
+ _printLeadingComments(node) {
+ this._printComments(this._getComments(true, node), true);
+ }
+
+ printInnerComments(node, indent = true) {
+ var _node$innerComments;
+
+ if (!((_node$innerComments = node.innerComments) != null && _node$innerComments.length)) return;
+ if (indent) this.indent();
+
+ this._printComments(node.innerComments);
+
+ if (indent) this.dedent();
+ }
+
+ printSequence(nodes, parent, opts = {}) {
+ opts.statement = true;
+ return this.printJoin(nodes, parent, opts);
+ }
+
+ printList(items, parent, opts = {}) {
+ if (opts.separator == null) {
+ opts.separator = commaSeparator;
+ }
+
+ return this.printJoin(items, parent, opts);
+ }
+
+ _printNewline(leading, node, parent, opts) {
+ if (this.format.retainLines || this.format.compact) return;
+
+ if (this.format.concise) {
+ this.space();
+ return;
+ }
+
+ let lines = 0;
+
+ if (this._buf.hasContent()) {
+ if (!leading) lines++;
+ if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
+ const needs = leading ? needsWhitespaceBefore : needsWhitespaceAfter;
+ if (needs(node, parent)) lines++;
+ }
+
+ this.newline(Math.min(2, lines));
+ }
+
+ _getComments(leading, node) {
+ return node && (leading ? node.leadingComments : node.trailingComments) || [];
+ }
+
+ _printComment(comment, skipNewLines) {
+ if (!this.format.shouldPrintComment(comment.value)) return;
+ if (comment.ignore) return;
+ if (this._printedComments.has(comment)) return;
+
+ this._printedComments.add(comment);
+
+ const isBlockComment = comment.type === "CommentBlock";
+ const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator;
+ if (printNewLines && this._buf.hasContent()) this.newline(1);
+ const lastCharCode = this.getLastChar();
+
+ if (lastCharCode !== 91 && lastCharCode !== 123) {
+ this.space();
+ }
+
+ let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`;
+
+ if (isBlockComment && this.format.indent.adjustMultilineComment) {
+ var _comment$loc;
+
+ const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
+
+ if (offset) {
+ const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
+ val = val.replace(newlineRegex, "\n");
+ }
+
+ const indentSize = Math.max(this._getIndent().length, this.format.retainLines ? 0 : this._buf.getCurrentColumn());
+ val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
+ }
+
+ if (this.endsWith(47)) this._space();
+ this.withSource("start", comment.loc, () => {
+ this._append(val);
+ });
+ if (printNewLines) this.newline(1);
+ }
+
+ _printComments(comments, inlinePureAnnotation) {
+ if (!(comments != null && comments.length)) return;
+
+ if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) {
+ this._printComment(comments[0], this._buf.hasContent() && !this.endsWith(10));
+ } else {
+ for (const comment of comments) {
+ this._printComment(comment);
+ }
+ }
+ }
+
+ printAssertions(node) {
+ var _node$assertions;
+
+ if ((_node$assertions = node.assertions) != null && _node$assertions.length) {
+ this.space();
+ this.word("assert");
+ this.space();
+ this.token("{");
+ this.space();
+ this.printList(node.assertions, node);
+ this.space();
+ this.token("}");
+ }
+ }
+
+ }
+
+ Object.assign(Printer.prototype, generatorFunctions);
+ {
+ Printer.prototype.Noop = function Noop() {};
+ }
+ var _default$1 = Printer;
+ printer.default = _default$1;
+
+ function commaSeparator() {
+ this.token(",");
+ this.space();
+ }
+
+ Object.defineProperty(lib, "__esModule", {
+ value: true
+ });
+ var _default = lib.default = generate;
+ lib.CodeGenerator = void 0;
+
+ var _sourceMap = sourceMap$1;
+
+ var _printer = printer;
+
+ class Generator extends _printer.default {
+ constructor(ast, opts = {}, code) {
+ const format = normalizeOptions(code, opts);
+ const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
+ super(format, map);
+ this.ast = void 0;
+ this.ast = ast;
+ }
+
+ generate() {
+ return super.generate(this.ast);
+ }
+
+ }
+
+ function normalizeOptions(code, opts) {
+ const format = {
+ auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
+ auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
+ shouldPrintComment: opts.shouldPrintComment,
+ retainLines: opts.retainLines,
+ retainFunctionParens: opts.retainFunctionParens,
+ comments: opts.comments == null || opts.comments,
+ compact: opts.compact,
+ minified: opts.minified,
+ concise: opts.concise,
+ indent: {
+ adjustMultilineComment: true,
+ style: " ",
+ base: 0
+ },
+ decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
+ jsescOption: Object.assign({
+ quotes: "double",
+ wrap: true,
+ minimal: false
+ }, opts.jsescOption),
+ recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType,
+ topicToken: opts.topicToken
+ };
+ {
+ format.jsonCompatibleStrings = opts.jsonCompatibleStrings;
+ }
+
+ if (format.minified) {
+ format.compact = true;
+
+ format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
+ } else {
+ format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0);
+ }
+
+ if (format.compact === "auto") {
+ format.compact = code.length > 500000;
+
+ if (format.compact) {
+ console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`);
+ }
+ }
+
+ if (format.compact) {
+ format.indent.adjustMultilineComment = false;
+ }
+
+ return format;
+ }
+
+ class CodeGenerator {
+ constructor(ast, opts, code) {
+ this._generator = void 0;
+ this._generator = new Generator(ast, opts, code);
+ }
+
+ generate() {
+ return this._generator.generate();
+ }
+
+ }
+
+ lib.CodeGenerator = CodeGenerator;
+
+ function generate(ast, opts, code) {
+ const gen = new Generator(ast, opts, code);
+ return gen.generate();
+ }
+
+ function isFunction(node) {
+ return (
+ lib$6.isFunction(node) ||
+ lib$6.isArrowFunctionExpression(node) ||
+ lib$6.isObjectMethod(node) ||
+ lib$6.isClassMethod(node)
+ );
+ }
+
+ function isObjectShorthand(parent) {
+ if (!lib$6.isObjectProperty(parent)) {
+ return false;
+ }
+
+ if (parent.value && parent.value.left) {
+ return (
+ parent.value.type === "AssignmentPattern" &&
+ parent.value.left.type === "Identifier"
+ );
+ }
+
+ return (
+ parent.value &&
+ parent.key.start == parent.value.start &&
+ parent.key.loc.identifierName === parent.value.loc.identifierName
+ );
+ }
+
+ function getObjectExpressionValue(node) {
+ const { value } = node;
+
+ if (lib$6.isIdentifier(value)) {
+ return value.name;
+ }
+
+ if (lib$6.isCallExpression(value) || lib$6.isFunctionExpression(value)) {
+ return "";
+ }
+ const code = _default(value).code;
+
+ const shouldWrap = lib$6.isObjectExpression(value);
+ return shouldWrap ? `(${code})` : code;
+ }
+
+ function getCode(node) {
+ return _default(node).code;
+ }
+
+ function getComments(ast) {
+ if (!ast || !ast.comments) {
+ return [];
+ }
+ return ast.comments.map(comment => ({
+ name: comment.location,
+ location: comment.loc,
+ }));
+ }
+
+ function getSpecifiers(specifiers) {
+ if (!specifiers) {
+ return [];
+ }
+
+ return specifiers.map(specifier => specifier.local?.name);
+ }
+
+ function isComputedExpression(expression) {
+ return /^\[/m.test(expression);
+ }
+
+ function getPatternIdentifiers(pattern) {
+ let items = [];
+ if (lib$6.isObjectPattern(pattern)) {
+ items = pattern.properties.map(({ value }) => value);
+ }
+
+ if (lib$6.isArrayPattern(pattern)) {
+ items = pattern.elements;
+ }
+
+ return getIdentifiers(items);
+ }
+
+ function getIdentifiers(items) {
+ let ids = [];
+ items.forEach(function (item) {
+ if (lib$6.isObjectPattern(item) || lib$6.isArrayPattern(item)) {
+ ids = ids.concat(getPatternIdentifiers(item));
+ } else if (lib$6.isIdentifier(item)) {
+ const { start, end } = item.loc;
+ ids.push({
+ name: item.name,
+ expression: item.name,
+ location: { start, end },
+ });
+ }
+ });
+ return ids;
+ }
+
+ // Top Level checks the number of "body" nodes in the ancestor chain
+ // if the node is top-level, then it shoul only have one body.
+ function isTopLevel(ancestors) {
+ return ancestors.filter(ancestor => ancestor.key == "body").length == 1;
+ }
+
+ function nodeLocationKey(a) {
+ const { start, end } = a.location;
+ return `${start.line}:${start.column}:${end.line}:${end.column}`;
+ }
+
+ function getFunctionParameterNames(path) {
+ if (path.node.params != null) {
+ return path.node.params.map(param => {
+ if (param.type !== "AssignmentPattern") {
+ return param.name;
+ }
+
+ // Parameter with default value
+ if (
+ param.left.type === "Identifier" &&
+ param.right.type === "Identifier"
+ ) {
+ return `${param.left.name} = ${param.right.name}`;
+ } else if (
+ param.left.type === "Identifier" &&
+ param.right.type === "StringLiteral"
+ ) {
+ return `${param.left.name} = ${param.right.value}`;
+ } else if (
+ param.left.type === "Identifier" &&
+ param.right.type === "ObjectExpression"
+ ) {
+ return `${param.left.name} = {}`;
+ } else if (
+ param.left.type === "Identifier" &&
+ param.right.type === "ArrayExpression"
+ ) {
+ return `${param.left.name} = []`;
+ } else if (
+ param.left.type === "Identifier" &&
+ param.right.type === "NullLiteral"
+ ) {
+ return `${param.left.name} = null`;
+ }
+
+ return null;
+ });
+ }
+ return [];
+ }
+
+ // the function class is inferred from a call like
+ // createClass or extend
+ function fromCallExpression(callExpression) {
+ const allowlist = ["extend", "createClass"];
+ const { callee } = callExpression.node;
+ if (!callee) {
+ return null;
+ }
+
+ const name = lib$6.isMemberExpression(callee)
+ ? callee.property.name
+ : callee.name;
+
+ if (!allowlist.includes(name)) {
+ return null;
+ }
+
+ const variable = callExpression.findParent(p =>
+ lib$6.isVariableDeclarator(p.node)
+ );
+ if (variable) {
+ return variable.node.id.name;
+ }
+
+ const assignment = callExpression.findParent(p =>
+ lib$6.isAssignmentExpression(p.node)
+ );
+
+ if (!assignment) {
+ return null;
+ }
+
+ const { left } = assignment.node;
+
+ if (left.name) {
+ return name;
+ }
+
+ if (lib$6.isMemberExpression(left)) {
+ return left.property.name;
+ }
+
+ return null;
+ }
+
+ // the function class is inferred from a prototype assignment
+ // e.g. TodoClass.prototype.render = function() {}
+ function fromPrototype(assignment) {
+ const { left } = assignment.node;
+ if (!left) {
+ return null;
+ }
+
+ if (
+ lib$6.isMemberExpression(left) &&
+ left.object &&
+ lib$6.isMemberExpression(left.object) &&
+ left.object.property.identifier === "prototype"
+ ) {
+ return left.object.object.name;
+ }
+
+ return null;
+ }
+
+ // infer class finds an appropriate class for functions
+ // that are defined inside of a class like thing.
+ // e.g. `class Foo`, `TodoClass.prototype.foo`,
+ // `Todo = createClass({ foo: () => {}})`
+ function inferClassName(path) {
+ const classDeclaration = path.findParent(p => lib$6.isClassDeclaration(p.node));
+ if (classDeclaration) {
+ return classDeclaration.node.id.name;
+ }
+
+ const callExpression = path.findParent(p => lib$6.isCallExpression(p.node));
+ if (callExpression) {
+ return fromCallExpression(callExpression);
+ }
+
+ const assignment = path.findParent(p => lib$6.isAssignmentExpression(p.node));
+ if (assignment) {
+ return fromPrototype(assignment);
+ }
+
+ return null;
+ }
+
+ // Perform ES6's anonymous function name inference for all
+ // locations where static analysis is possible.
+ // eslint-disable-next-line complexity
+ function getFunctionName(node, parent) {
+ if (lib$6.isIdentifier(node.id)) {
+ return node.id.name;
+ }
+
+ if (
+ lib$6.isObjectMethod(node, { computed: false }) ||
+ lib$6.isClassMethod(node, { computed: false }) ||
+ lib$6.isClassPrivateMethod(node)
+ ) {
+ const { key } = node;
+
+ if (lib$6.isIdentifier(key)) {
+ return key.name;
+ }
+ if (lib$6.isStringLiteral(key)) {
+ return key.value;
+ }
+ if (lib$6.isNumericLiteral(key)) {
+ return `${key.value}`;
+ }
+
+ if (lib$6.isPrivateName(key)) {
+ return `#${key.id.name}`;
+ }
+ }
+
+ if (
+ lib$6.isObjectProperty(parent, { computed: false, value: node }) ||
+ // TODO: Babylon 6 doesn't support computed class props. It is included
+ // here so that it is most flexible. Once Babylon 7 is used, this
+ // can change to use computed: false like ObjectProperty.
+ (lib$6.isClassProperty(parent, { value: node }) && !parent.computed) ||
+ (lib$6.isClassPrivateProperty(parent, { value: node }) && !parent.computed)
+ ) {
+ const { key } = parent;
+
+ if (lib$6.isIdentifier(key)) {
+ return key.name;
+ }
+ if (lib$6.isStringLiteral(key)) {
+ return key.value;
+ }
+ if (lib$6.isNumericLiteral(key)) {
+ return `${key.value}`;
+ }
+
+ if (lib$6.isPrivateName(key)) {
+ return `#${key.id.name}`;
+ }
+ }
+
+ if (lib$6.isAssignmentExpression(parent, { operator: "=", right: node })) {
+ if (lib$6.isIdentifier(parent.left)) {
+ return parent.left.name;
+ }
+
+ // This case is not supported in standard ES6 name inference, but it
+ // is included here since it is still a helpful case during debugging.
+ if (lib$6.isMemberExpression(parent.left, { computed: false })) {
+ return parent.left.property.name;
+ }
+ }
+
+ if (
+ lib$6.isAssignmentPattern(parent, { right: node }) &&
+ lib$6.isIdentifier(parent.left)
+ ) {
+ return parent.left.name;
+ }
+
+ if (
+ lib$6.isVariableDeclarator(parent, { init: node }) &&
+ lib$6.isIdentifier(parent.id)
+ ) {
+ return parent.id.name;
+ }
+
+ if (
+ lib$6.isExportDefaultDeclaration(parent, { declaration: node }) &&
+ lib$6.isFunctionDeclaration(node)
+ ) {
+ return "default";
+ }
+
+ return "anonymous";
+ }
+
+ function getFramework(symbols) {
+ if (isReactComponent(symbols)) {
+ return "React";
+ }
+ if (isAngularComponent(symbols)) {
+ return "Angular";
+ }
+ if (isVueComponent(symbols)) {
+ return "Vue";
+ }
+
+ return null;
+ }
+
+ function isReactComponent({ imports, classes, callExpressions, identifiers }) {
+ return (
+ importsReact(imports) ||
+ requiresReact(callExpressions) ||
+ extendsReactComponent(classes) ||
+ isReact(identifiers) ||
+ isRedux(identifiers)
+ );
+ }
+
+ function importsReact(imports) {
+ return imports.some(
+ importObj =>
+ importObj.source === "react" &&
+ importObj.specifiers.some(specifier => specifier === "React")
+ );
+ }
+
+ function requiresReact(callExpressions) {
+ return callExpressions.some(
+ callExpression =>
+ callExpression.name === "require" &&
+ callExpression.values.some(value => value === "react")
+ );
+ }
+
+ function extendsReactComponent(classes) {
+ return classes.some(
+ classObj =>
+ lib$6.isIdentifier(classObj.parent, { name: "Component" }) ||
+ lib$6.isIdentifier(classObj.parent, { name: "PureComponent" }) ||
+ (lib$6.isMemberExpression(classObj.parent, { computed: false }) &&
+ lib$6.isIdentifier(classObj.parent, { name: "Component" }))
+ );
+ }
+
+ function isAngularComponent({ memberExpressions }) {
+ return memberExpressions.some(
+ item =>
+ item.expression == "angular.controller" ||
+ item.expression == "angular.module"
+ );
+ }
+
+ function isVueComponent({ identifiers }) {
+ return identifiers.some(identifier => identifier.name == "Vue");
+ }
+
+ /* This identifies the react lib file */
+ function isReact(identifiers) {
+ return identifiers.some(identifier => identifier.name == "isReactComponent");
+ }
+
+ /* This identifies the redux lib file */
+ function isRedux(identifiers) {
+ return identifiers.some(identifier => identifier.name == "Redux");
+ }
+
+ let symbolDeclarations = new Map();
+
+ function extractFunctionSymbol(path, state, symbols) {
+ const name = getFunctionName(path.node, path.parent);
+
+ if (!state.fnCounts[name]) {
+ state.fnCounts[name] = 0;
+ }
+ const index = state.fnCounts[name]++;
+ symbols.functions.push({
+ name,
+ klass: inferClassName(path),
+ location: path.node.loc,
+ parameterNames: getFunctionParameterNames(path),
+ identifier: path.node.id,
+ // indicates the occurence of the function in a file
+ // e.g { name: foo, ... index: 4 } is the 4th foo function
+ // in the file
+ index,
+ });
+ }
+
+ function extractSymbol(path, symbols, state) {
+ if (isFunction(path)) {
+ extractFunctionSymbol(path, state, symbols);
+ }
+
+ if (lib$6.isJSXElement(path)) {
+ symbols.hasJsx = true;
+ }
+
+ if (lib$6.isGenericTypeAnnotation(path)) {
+ symbols.hasTypes = true;
+ }
+
+ if (lib$6.isClassDeclaration(path)) {
+ symbols.classes.push(getClassDeclarationSymbol(path.node));
+ }
+
+ if (lib$6.isImportDeclaration(path)) {
+ symbols.imports.push(getImportDeclarationSymbol(path.node));
+ }
+
+ if (lib$6.isObjectProperty(path)) {
+ symbols.objectProperties.push(getObjectPropertySymbol(path));
+ }
+
+ if (lib$6.isMemberExpression(path) || lib$6.isOptionalMemberExpression(path)) {
+ symbols.memberExpressions.push(getMemberExpressionSymbol(path));
+ }
+
+ if (
+ (lib$6.isStringLiteral(path) || lib$6.isNumericLiteral(path)) &&
+ lib$6.isMemberExpression(path.parentPath)
+ ) {
+ // We only need literals that are part of computed memeber expressions
+ const { start, end } = path.node.loc;
+ symbols.literals.push({
+ name: path.node.value,
+ location: { start, end },
+ expression: getSnippet(path.parentPath),
+ });
+ }
+
+ if (lib$6.isCallExpression(path)) {
+ symbols.callExpressions.push(getCallExpressionSymbol(path.node));
+ }
+
+ symbols.identifiers.push(...getIdentifierSymbols(path));
+ }
+
+ function extractSymbols(sourceId) {
+ const symbols = {
+ functions: [],
+ callExpressions: [],
+ memberExpressions: [],
+ objectProperties: [],
+ comments: [],
+ identifiers: [],
+ classes: [],
+ imports: [],
+ literals: [],
+ hasJsx: false,
+ hasTypes: false,
+ framework: undefined,
+ };
+
+ const state = {
+ fnCounts: Object.create(null),
+ };
+
+ const ast = traverseAst(sourceId, {
+ enter(node, ancestors) {
+ try {
+ const path = createSimplePath(ancestors);
+ if (path) {
+ extractSymbol(path, symbols, state);
+ }
+ } catch (e) {
+ console.error(e);
+ }
+ },
+ });
+
+ // comments are extracted separately from the AST
+ symbols.comments = getComments(ast);
+ symbols.identifiers = getUniqueIdentifiers(symbols.identifiers);
+ symbols.framework = getFramework(symbols);
+
+ return symbols;
+ }
+
+ function extendSnippet(name, expression, path, prevPath) {
+ const computed = path?.node.computed;
+ const optional = path?.node.optional;
+ const prevComputed = prevPath?.node.computed;
+ const prevArray = lib$6.isArrayExpression(prevPath);
+ const array = lib$6.isArrayExpression(path);
+ const value = path?.node.property?.extra?.raw || "";
+
+ if (expression === "") {
+ if (computed) {
+ return name === undefined ? `[${value}]` : `[${name}]`;
+ }
+ return name;
+ }
+
+ if (computed || array) {
+ if (prevComputed || prevArray) {
+ return `[${name}]${expression}`;
+ }
+ return `[${name === undefined ? value : name}].${expression}`;
+ }
+
+ if (prevComputed || prevArray) {
+ return `${name}${expression}`;
+ }
+
+ if (isComputedExpression(expression) && name !== undefined) {
+ return `${name}${expression}`;
+ }
+
+ if (optional) {
+ return `${name}?.${expression}`;
+ }
+
+ return `${name}.${expression}`;
+ }
+
+ function getMemberSnippet(node, expression = "", optional = false) {
+ if (lib$6.isMemberExpression(node) || lib$6.isOptionalMemberExpression(node)) {
+ const name = lib$6.isPrivateName(node.property)
+ ? `#${node.property.id.name}`
+ : node.property.name;
+ const snippet = getMemberSnippet(
+ node.object,
+ extendSnippet(name, expression, { node }),
+ node.optional
+ );
+ return snippet;
+ }
+
+ if (lib$6.isCallExpression(node)) {
+ return "";
+ }
+
+ if (lib$6.isThisExpression(node)) {
+ return `this.${expression}`;
+ }
+
+ if (lib$6.isIdentifier(node)) {
+ if (isComputedExpression(expression)) {
+ return `${node.name}${expression}`;
+ }
+ if (optional) {
+ return `${node.name}?.${expression}`;
+ }
+ return `${node.name}.${expression}`;
+ }
+
+ return expression;
+ }
+
+ function getObjectSnippet(path, prevPath, expression = "") {
+ if (!path) {
+ return expression;
+ }
+
+ const { name } = path.node.key;
+
+ const extendedExpression = extendSnippet(name, expression, path, prevPath);
+
+ const nextPrevPath = path;
+ const nextPath = path.parentPath && path.parentPath.parentPath;
+
+ return getSnippet(nextPath, nextPrevPath, extendedExpression);
+ }
+
+ function getArraySnippet(path, prevPath, expression) {
+ if (!prevPath.parentPath) {
+ throw new Error("Assertion failure - path should exist");
+ }
+
+ const index = `${prevPath.parentPath.containerIndex}`;
+ const extendedExpression = extendSnippet(index, expression, path, prevPath);
+
+ const nextPrevPath = path;
+ const nextPath = path.parentPath && path.parentPath.parentPath;
+
+ return getSnippet(nextPath, nextPrevPath, extendedExpression);
+ }
+
+ function getSnippet(path, prevPath, expression = "") {
+ if (!path) {
+ return expression;
+ }
+
+ if (lib$6.isVariableDeclaration(path)) {
+ const node = path.node.declarations[0];
+ const { name } = node.id;
+ return extendSnippet(name, expression, path, prevPath);
+ }
+
+ if (lib$6.isVariableDeclarator(path)) {
+ const node = path.node.id;
+ if (lib$6.isObjectPattern(node)) {
+ return expression;
+ }
+
+ const prop = extendSnippet(node.name, expression, path, prevPath);
+ return prop;
+ }
+
+ if (lib$6.isAssignmentExpression(path)) {
+ const node = path.node.left;
+ const name = lib$6.isMemberExpression(node)
+ ? getMemberSnippet(node)
+ : node.name;
+
+ const prop = extendSnippet(name, expression, path, prevPath);
+ return prop;
+ }
+
+ if (isFunction(path)) {
+ return expression;
+ }
+
+ if (lib$6.isIdentifier(path)) {
+ return `${path.node.name}.${expression}`;
+ }
+
+ if (lib$6.isObjectProperty(path)) {
+ return getObjectSnippet(path, prevPath, expression);
+ }
+
+ if (lib$6.isObjectExpression(path)) {
+ const parentPath = prevPath?.parentPath;
+ return getObjectSnippet(parentPath, prevPath, expression);
+ }
+
+ if (lib$6.isMemberExpression(path) || lib$6.isOptionalMemberExpression(path)) {
+ return getMemberSnippet(path.node, expression);
+ }
+
+ if (lib$6.isArrayExpression(path)) {
+ if (!prevPath) {
+ throw new Error("Assertion failure - path should exist");
+ }
+
+ return getArraySnippet(path, prevPath, expression);
+ }
+
+ return "";
+ }
+
+ function clearSymbols() {
+ symbolDeclarations = new Map();
+ }
+
+ function getSymbols(sourceId) {
+ if (symbolDeclarations.has(sourceId)) {
+ const symbols = symbolDeclarations.get(sourceId);
+ if (symbols) {
+ return symbols;
+ }
+ }
+
+ const symbols = extractSymbols(sourceId);
+
+ symbolDeclarations.set(sourceId, symbols);
+ return symbols;
+ }
+
+ function getUniqueIdentifiers(identifiers) {
+ const newIdentifiers = [];
+ const locationKeys = new Set();
+ for (const newId of identifiers) {
+ const key = nodeLocationKey(newId);
+ if (!locationKeys.has(key)) {
+ locationKeys.add(key);
+ newIdentifiers.push(newId);
+ }
+ }
+
+ return newIdentifiers;
+ }
+
+ function getMemberExpressionSymbol(path) {
+ const { start, end } = path.node.property.loc;
+ return {
+ name: lib$6.isPrivateName(path.node.property)
+ ? `#${path.node.property.id.name}`
+ : path.node.property.name,
+ location: { start, end },
+ expression: getSnippet(path),
+ computed: path.node.computed,
+ };
+ }
+
+ function getImportDeclarationSymbol(node) {
+ return {
+ source: node.source.value,
+ location: node.loc,
+ specifiers: getSpecifiers(node.specifiers),
+ };
+ }
+
+ function getObjectPropertySymbol(path) {
+ const { start, end, identifierName } = path.node.key.loc;
+ return {
+ name: identifierName,
+ location: { start, end },
+ expression: getSnippet(path),
+ };
+ }
+
+ function getCallExpressionSymbol(node) {
+ const { callee, arguments: args } = node;
+ const values = args.filter(arg => arg.value).map(arg => arg.value);
+ if (lib$6.isMemberExpression(callee)) {
+ const {
+ property: { name, loc },
+ } = callee;
+ return {
+ name,
+ values,
+ location: loc,
+ };
+ }
+ const { start, end, identifierName } = callee.loc;
+ return {
+ name: identifierName,
+ values,
+ location: { start, end },
+ };
+ }
+
+ function getClassParentName(superClass) {
+ return lib$6.isMemberExpression(superClass)
+ ? getCode(superClass)
+ : superClass.name;
+ }
+
+ function getClassParentSymbol(superClass) {
+ if (!superClass) {
+ return null;
+ }
+ return {
+ name: getClassParentName(superClass),
+ location: superClass.loc,
+ };
+ }
+
+ function getClassDeclarationSymbol(node) {
+ const { loc, superClass } = node;
+ return {
+ name: node.id.name,
+ parent: getClassParentSymbol(superClass),
+ location: loc,
+ };
+ }
+
+ /**
+ * Get a list of identifiers that are part of the given path.
+ *
+ * @param {Object} path
+ * @returns {Array.<Object>} a list of identifiers
+ */
+ function getIdentifierSymbols(path) {
+ if (lib$6.isStringLiteral(path) && lib$6.isProperty(path.parentPath)) {
+ const { start, end } = path.node.loc;
+ return [
+ {
+ name: path.node.value,
+ expression: getObjectExpressionValue(path.parent),
+ location: { start, end },
+ },
+ ];
+ }
+
+ const identifiers = [];
+ if (lib$6.isIdentifier(path) && !lib$6.isGenericTypeAnnotation(path.parent)) {
+ // We want to include function params, but exclude the function name
+ if (lib$6.isClassMethod(path.parent) && !path.inList) {
+ return [];
+ }
+
+ if (lib$6.isProperty(path.parentPath) && !isObjectShorthand(path.parent)) {
+ const { start, end } = path.node.loc;
+ return [
+ {
+ name: path.node.name,
+ expression: getObjectExpressionValue(path.parent),
+ location: { start, end },
+ },
+ ];
+ }
+
+ let { start, end } = path.node.loc;
+ if (path.node.typeAnnotation) {
+ const { column } = path.node.typeAnnotation.loc.start;
+ end = { ...end, column };
+ }
+
+ identifiers.push({
+ name: path.node.name,
+ expression: path.node.name,
+ location: { start, end },
+ });
+ }
+
+ if (lib$6.isThisExpression(path.node)) {
+ const { start, end } = path.node.loc;
+ identifiers.push({
+ name: "this",
+ location: { start, end },
+ expression: "this",
+ });
+ }
+
+ if (lib$6.isVariableDeclarator(path)) {
+ const nodeId = path.node.id;
+
+ identifiers.push(...getPatternIdentifiers(nodeId));
+ }
+
+ return identifiers;
+ }
+
+ /**
+ * "implicit"
+ * Variables added automaticly like "this" and "arguments"
+ *
+ * "var"
+ * Variables declared with "var" or non-block function declarations
+ *
+ * "let"
+ * Variables declared with "let".
+ *
+ * "const"
+ * Variables declared with "const", or added as const
+ * bindings like inner function expressions and inner class names.
+ *
+ * "import"
+ * Imported binding names exposed from other modules.
+ *
+ * "global"
+ * Variables that reference undeclared global values.
+ */
+
+ // Location information about the expression immediartely surrounding a
+ // given binding reference.
+
+ function isGeneratedId(id) {
+ return !/\/originalSource/.test(id);
+ }
+
+ function parseSourceScopes(sourceId) {
+ const ast = getAst(sourceId);
+ if (!ast || !Object.keys(ast).length) {
+ return null;
+ }
+
+ return buildScopeList(ast, sourceId);
+ }
+
+ function buildScopeList(ast, sourceId) {
+ const { global, lexical } = createGlobalScope(ast, sourceId);
+
+ const state = {
+ sourceId,
+ freeVariables: new Map(),
+ freeVariableStack: [],
+ inType: null,
+ scope: lexical,
+ scopeStack: [],
+ declarationBindingIds: new Set(),
+ };
+ lib$6.traverse(ast, scopeCollectionVisitor, state);
+
+ for (const [key, freeVariables] of state.freeVariables) {
+ let binding = global.bindings[key];
+ if (!binding) {
+ binding = {
+ type: "global",
+ refs: [],
+ };
+ global.bindings[key] = binding;
+ }
+
+ binding.refs = freeVariables.concat(binding.refs);
+ }
+
+ // TODO: This should probably check for ".mjs" extension on the
+ // original file, and should also be skipped if the the generated
+ // code is an ES6 module rather than a script.
+ if (
+ isGeneratedId(sourceId) ||
+ (ast.program.sourceType === "script" && !looksLikeCommonJS(global))
+ ) {
+ stripModuleScope(global);
+ }
+
+ return toParsedScopes([global]) || [];
+ }
+
+ function toParsedScopes(children, sourceId) {
+ if (!children || children.length === 0) {
+ return undefined;
+ }
+ return children.map(scope => ({
+ // Removing unneed information from TempScope such as parent reference.
+ // We also need to convert BabelLocation to the Location type.
+ start: scope.loc.start,
+ end: scope.loc.end,
+ type:
+ scope.type === "module" || scope.type === "function-body"
+ ? "block"
+ : scope.type,
+ scopeKind: "",
+ displayName: scope.displayName,
+ bindings: scope.bindings,
+ children: toParsedScopes(scope.children),
+ }));
+ }
+
+ function createTempScope(type, displayName, parent, loc) {
+ const result = {
+ type,
+ displayName,
+ parent,
+ children: [],
+ loc,
+ bindings: Object.create(null),
+ };
+ if (parent) {
+ parent.children.push(result);
+ }
+ return result;
+ }
+ function pushTempScope(state, type, displayName, loc) {
+ const scope = createTempScope(type, displayName, state.scope, loc);
+
+ state.scope = scope;
+
+ state.freeVariableStack.push(state.freeVariables);
+ state.freeVariables = new Map();
+ return scope;
+ }
+
+ function isNode(node, type) {
+ return node ? node.type === type : false;
+ }
+
+ function getVarScope(scope) {
+ let s = scope;
+ while (s.type !== "function" && s.type !== "module") {
+ if (!s.parent) {
+ return s;
+ }
+ s = s.parent;
+ }
+ return s;
+ }
+
+ function fromBabelLocation(location, sourceId) {
+ return {
+ sourceId,
+ line: location.line,
+ column: location.column,
+ };
+ }
+
+ function parseDeclarator(
+ declaratorId,
+ targetScope,
+ type,
+ locationType,
+ declaration,
+ state
+ ) {
+ if (isNode(declaratorId, "Identifier")) {
+ let existing = targetScope.bindings[declaratorId.name];
+ if (!existing) {
+ existing = {
+ type,
+ refs: [],
+ };
+ targetScope.bindings[declaratorId.name] = existing;
+ }
+ state.declarationBindingIds.add(declaratorId);
+ existing.refs.push({
+ type: locationType,
+ start: fromBabelLocation(declaratorId.loc.start, state.sourceId),
+ end: fromBabelLocation(declaratorId.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(declaration.loc.start, state.sourceId),
+ end: fromBabelLocation(declaration.loc.end, state.sourceId),
+ },
+ });
+ } else if (isNode(declaratorId, "ObjectPattern")) {
+ declaratorId.properties.forEach(prop => {
+ parseDeclarator(
+ prop.value,
+ targetScope,
+ type,
+ locationType,
+ declaration,
+ state
+ );
+ });
+ } else if (isNode(declaratorId, "ArrayPattern")) {
+ declaratorId.elements.forEach(item => {
+ parseDeclarator(
+ item,
+ targetScope,
+ type,
+ locationType,
+ declaration,
+ state
+ );
+ });
+ } else if (isNode(declaratorId, "AssignmentPattern")) {
+ parseDeclarator(
+ declaratorId.left,
+ targetScope,
+ type,
+ locationType,
+ declaration,
+ state
+ );
+ } else if (isNode(declaratorId, "RestElement")) {
+ parseDeclarator(
+ declaratorId.argument,
+ targetScope,
+ type,
+ locationType,
+ declaration,
+ state
+ );
+ } else if (lib$6.isTSParameterProperty(declaratorId)) {
+ parseDeclarator(
+ declaratorId.parameter,
+ targetScope,
+ type,
+ locationType,
+ declaration,
+ state
+ );
+ }
+ }
+
+ function isLetOrConst(node) {
+ return node.kind === "let" || node.kind === "const";
+ }
+
+ function hasLexicalDeclaration(node, parent) {
+ const nodes = [];
+ if (lib$6.isSwitchStatement(node)) {
+ for (const caseNode of node.cases) {
+ nodes.push(...caseNode.consequent);
+ }
+ } else {
+ nodes.push(...node.body);
+ }
+
+ const isFunctionBody = lib$6.isFunction(parent, { body: node });
+
+ return nodes.some(
+ child =>
+ isLexicalVariable(child) ||
+ lib$6.isClassDeclaration(child) ||
+ (!isFunctionBody && lib$6.isFunctionDeclaration(child))
+ );
+ }
+ function isLexicalVariable(node) {
+ return isNode(node, "VariableDeclaration") && isLetOrConst(node);
+ }
+
+ function createGlobalScope(ast, sourceId) {
+ const global = createTempScope("object", "Global", null, {
+ start: fromBabelLocation(ast.loc.start, sourceId),
+ end: fromBabelLocation(ast.loc.end, sourceId),
+ });
+
+ const lexical = createTempScope("block", "Lexical Global", global, {
+ start: fromBabelLocation(ast.loc.start, sourceId),
+ end: fromBabelLocation(ast.loc.end, sourceId),
+ });
+
+ return { global, lexical };
+ }
+
+ const scopeCollectionVisitor = {
+ // eslint-disable-next-line complexity
+ enter(node, ancestors, state) {
+ state.scopeStack.push(state.scope);
+
+ const parentNode =
+ ancestors.length === 0 ? null : ancestors[ancestors.length - 1].node;
+
+ if (state.inType) {
+ return;
+ }
+
+ if (lib$6.isProgram(node)) {
+ const scope = pushTempScope(state, "module", "Module", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ scope.bindings.this = {
+ type: "implicit",
+ refs: [],
+ };
+ } else if (lib$6.isFunction(node)) {
+ let { scope } = state;
+ if (lib$6.isFunctionExpression(node) && isNode(node.id, "Identifier")) {
+ scope = pushTempScope(state, "block", "Function Expression", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ state.declarationBindingIds.add(node.id);
+ scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [
+ {
+ type: "fn-expr",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ },
+ },
+ ],
+ };
+ }
+
+ if (lib$6.isFunctionDeclaration(node) && isNode(node.id, "Identifier")) {
+ // This ignores Annex B function declaration hoisting, which
+ // is probably a fine assumption.
+ state.declarationBindingIds.add(node.id);
+ const refs = [
+ {
+ type: "fn-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ },
+ },
+ ];
+
+ if (scope.type === "block") {
+ scope.bindings[node.id.name] = {
+ type: "let",
+ refs,
+ };
+ } else {
+ getVarScope(scope).bindings[node.id.name] = {
+ type: "var",
+ refs,
+ };
+ }
+ }
+
+ scope = pushTempScope(
+ state,
+ "function",
+ getFunctionName(node, parentNode),
+ {
+ // Being at the start of a function doesn't count as
+ // being inside of it.
+ start: fromBabelLocation(
+ node.params[0] ? node.params[0].loc.start : node.loc.start,
+ state.sourceId
+ ),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ }
+ );
+
+ node.params.forEach(param =>
+ parseDeclarator(param, scope, "var", "fn-param", node, state)
+ );
+
+ if (!lib$6.isArrowFunctionExpression(node)) {
+ scope.bindings.this = {
+ type: "implicit",
+ refs: [],
+ };
+ scope.bindings.arguments = {
+ type: "implicit",
+ refs: [],
+ };
+ }
+
+ if (
+ lib$6.isBlockStatement(node.body) &&
+ hasLexicalDeclaration(node.body, node)
+ ) {
+ scope = pushTempScope(state, "function-body", "Function Body", {
+ start: fromBabelLocation(node.body.loc.start, state.sourceId),
+ end: fromBabelLocation(node.body.loc.end, state.sourceId),
+ });
+ }
+ } else if (lib$6.isClass(node)) {
+ if (lib$6.isIdentifier(node.id)) {
+ // For decorated classes, the AST considers the first the decorator
+ // to be the start of the class. For the purposes of mapping class
+ // declarations however, we really want to look for the "class Foo"
+ // piece. To achieve that, we estimate the location of the declaration
+ // instead.
+ let declStart = node.loc.start;
+ if (node.decorators && node.decorators.length) {
+ // Estimate the location of the "class" keyword since it
+ // is unlikely to be a different line than the class name.
+ declStart = {
+ line: node.id.loc.start.line,
+ column: node.id.loc.start.column - "class ".length,
+ };
+ }
+
+ const declaration = {
+ start: fromBabelLocation(declStart, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ };
+
+ if (lib$6.isClassDeclaration(node)) {
+ state.declarationBindingIds.add(node.id);
+ state.scope.bindings[node.id.name] = {
+ type: "let",
+ refs: [
+ {
+ type: "class-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration,
+ },
+ ],
+ };
+ }
+
+ const scope = pushTempScope(state, "block", "Class", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+
+ state.declarationBindingIds.add(node.id);
+ scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [
+ {
+ type: "class-inner",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration,
+ },
+ ],
+ };
+ }
+ } else if (lib$6.isForXStatement(node) || lib$6.isForStatement(node)) {
+ const init = node.init || node.left;
+ if (isNode(init, "VariableDeclaration") && isLetOrConst(init)) {
+ // Debugger will create new lexical environment for the for.
+ pushTempScope(state, "block", "For", {
+ // Being at the start of a for loop doesn't count as
+ // being inside it.
+ start: fromBabelLocation(init.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ }
+ } else if (lib$6.isCatchClause(node)) {
+ const scope = pushTempScope(state, "block", "Catch", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ parseDeclarator(node.param, scope, "var", "catch", node, state);
+ } else if (
+ lib$6.isBlockStatement(node) &&
+ // Function body's are handled in the function logic above.
+ !lib$6.isFunction(parentNode) &&
+ hasLexicalDeclaration(node, parentNode)
+ ) {
+ // Debugger will create new lexical environment for the block.
+ pushTempScope(state, "block", "Block", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ } else if (
+ lib$6.isVariableDeclaration(node) &&
+ (node.kind === "var" ||
+ // Lexical declarations in for statements are handled above.
+ !lib$6.isForStatement(parentNode, { init: node }) ||
+ !lib$6.isForXStatement(parentNode, { left: node }))
+ ) {
+ // Finds right lexical environment
+ const hoistAt = !isLetOrConst(node)
+ ? getVarScope(state.scope)
+ : state.scope;
+ node.declarations.forEach(declarator => {
+ parseDeclarator(
+ declarator.id,
+ hoistAt,
+ node.kind,
+ node.kind,
+ node,
+ state
+ );
+ });
+ } else if (
+ lib$6.isImportDeclaration(node) &&
+ (!node.importKind || node.importKind === "value")
+ ) {
+ node.specifiers.forEach(spec => {
+ if (spec.importKind && spec.importKind !== "value") {
+ return;
+ }
+
+ if (lib$6.isImportNamespaceSpecifier(spec)) {
+ state.declarationBindingIds.add(spec.local);
+
+ state.scope.bindings[spec.local.name] = {
+ // Imported namespaces aren't live import bindings, they are
+ // just normal const bindings.
+ type: "const",
+ refs: [
+ {
+ type: "import-ns-decl",
+ start: fromBabelLocation(spec.local.loc.start, state.sourceId),
+ end: fromBabelLocation(spec.local.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ },
+ },
+ ],
+ };
+ } else {
+ state.declarationBindingIds.add(spec.local);
+
+ state.scope.bindings[spec.local.name] = {
+ type: "import",
+ refs: [
+ {
+ type: "import-decl",
+ start: fromBabelLocation(spec.local.loc.start, state.sourceId),
+ end: fromBabelLocation(spec.local.loc.end, state.sourceId),
+ importName: lib$6.isImportDefaultSpecifier(spec)
+ ? "default"
+ : spec.imported.name,
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ },
+ },
+ ],
+ };
+ }
+ });
+ } else if (lib$6.isTSEnumDeclaration(node)) {
+ state.declarationBindingIds.add(node.id);
+ state.scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [
+ {
+ type: "ts-enum-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ },
+ },
+ ],
+ };
+ } else if (lib$6.isTSModuleDeclaration(node)) {
+ state.declarationBindingIds.add(node.id);
+ state.scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [
+ {
+ type: "ts-namespace-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ },
+ },
+ ],
+ };
+ } else if (lib$6.isTSModuleBlock(node)) {
+ pushTempScope(state, "block", "TypeScript Namespace", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ } else if (
+ lib$6.isIdentifier(node) &&
+ lib$6.isReferenced(node, parentNode) &&
+ // Babel doesn't cover this in 'isReferenced' yet, but it should
+ // eventually.
+ !lib$6.isTSEnumMember(parentNode, { id: node }) &&
+ !lib$6.isTSModuleDeclaration(parentNode, { id: node }) &&
+ // isReferenced above fails to see `var { foo } = ...` as a non-reference
+ // because the direct parent is not enough to know that the pattern is
+ // used within a variable declaration.
+ !state.declarationBindingIds.has(node)
+ ) {
+ let freeVariables = state.freeVariables.get(node.name);
+ if (!freeVariables) {
+ freeVariables = [];
+ state.freeVariables.set(node.name, freeVariables);
+ }
+
+ freeVariables.push({
+ type: "ref",
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ meta: buildMetaBindings(state.sourceId, node, ancestors),
+ });
+ } else if (isOpeningJSXIdentifier(node, ancestors)) {
+ let freeVariables = state.freeVariables.get(node.name);
+ if (!freeVariables) {
+ freeVariables = [];
+ state.freeVariables.set(node.name, freeVariables);
+ }
+
+ freeVariables.push({
+ type: "ref",
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ meta: buildMetaBindings(state.sourceId, node, ancestors),
+ });
+ } else if (lib$6.isThisExpression(node)) {
+ let freeVariables = state.freeVariables.get("this");
+ if (!freeVariables) {
+ freeVariables = [];
+ state.freeVariables.set("this", freeVariables);
+ }
+
+ freeVariables.push({
+ type: "ref",
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ meta: buildMetaBindings(state.sourceId, node, ancestors),
+ });
+ } else if (lib$6.isClassProperty(parentNode, { value: node })) {
+ const scope = pushTempScope(state, "function", "Class Field", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ scope.bindings.this = {
+ type: "implicit",
+ refs: [],
+ };
+ scope.bindings.arguments = {
+ type: "implicit",
+ refs: [],
+ };
+ } else if (
+ lib$6.isSwitchStatement(node) &&
+ hasLexicalDeclaration(node, parentNode)
+ ) {
+ pushTempScope(state, "block", "Switch", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ });
+ }
+
+ if (
+ // In general Flow expressions are deleted, so they can't contain
+ // runtime bindings, but typecasts are the one exception there.
+ (lib$6.isFlow(node) && !lib$6.isTypeCastExpression(node)) ||
+ // In general TS items are deleted, but TS has a few wrapper node
+ // types that can contain general JS expressions.
+ (node.type.startsWith("TS") &&
+ !lib$6.isTSTypeAssertion(node) &&
+ !lib$6.isTSAsExpression(node) &&
+ !lib$6.isTSNonNullExpression(node) &&
+ !lib$6.isTSModuleDeclaration(node) &&
+ !lib$6.isTSModuleBlock(node) &&
+ !lib$6.isTSParameterProperty(node) &&
+ !lib$6.isTSExportAssignment(node))
+ ) {
+ // Flag this node as a root "type" node. All items inside of this
+ // will be skipped entirely.
+ state.inType = node;
+ }
+ },
+ exit(node, ancestors, state) {
+ const currentScope = state.scope;
+ const parentScope = state.scopeStack.pop();
+ if (!parentScope) {
+ throw new Error("Assertion failure - unsynchronized pop");
+ }
+ state.scope = parentScope;
+
+ // It is possible, as in the case of function expressions, that a single
+ // node has added multiple scopes, so we need to traverse upward here
+ // rather than jumping stright to 'parentScope'.
+ for (
+ let scope = currentScope;
+ scope && scope !== parentScope;
+ scope = scope.parent
+ ) {
+ const { freeVariables } = state;
+ state.freeVariables = state.freeVariableStack.pop();
+ const parentFreeVariables = state.freeVariables;
+
+ // Match up any free variables that match this scope's bindings and
+ // merge then into the refs.
+ for (const key of Object.keys(scope.bindings)) {
+ const binding = scope.bindings[key];
+
+ const freeVars = freeVariables.get(key);
+ if (freeVars) {
+ binding.refs.push(...freeVars);
+ freeVariables.delete(key);
+ }
+ }
+
+ // Move any undeclared references in this scope into the parent for
+ // processing in higher scopes.
+ for (const [key, value] of freeVariables) {
+ let refs = parentFreeVariables.get(key);
+ if (!refs) {
+ refs = [];
+ parentFreeVariables.set(key, refs);
+ }
+
+ refs.push(...value);
+ }
+ }
+
+ if (state.inType === node) {
+ state.inType = null;
+ }
+ },
+ };
+
+ function isOpeningJSXIdentifier(node, ancestors) {
+ if (!lib$6.isJSXIdentifier(node)) {
+ return false;
+ }
+
+ for (let i = ancestors.length - 1; i >= 0; i--) {
+ const { node: parent, key } = ancestors[i];
+
+ if (lib$6.isJSXOpeningElement(parent) && key === "name") {
+ return true;
+ } else if (!lib$6.isJSXMemberExpression(parent) || key !== "object") {
+ break;
+ }
+ }
+
+ return false;
+ }
+
+ function buildMetaBindings(
+ sourceId,
+ node,
+ ancestors,
+ parentIndex = ancestors.length - 1
+ ) {
+ if (parentIndex <= 1) {
+ return null;
+ }
+ const parent = ancestors[parentIndex].node;
+ const grandparent = ancestors[parentIndex - 1].node;
+
+ // Consider "0, foo" to be equivalent to "foo".
+ if (
+ lib$6.isSequenceExpression(parent) &&
+ parent.expressions.length === 2 &&
+ lib$6.isNumericLiteral(parent.expressions[0]) &&
+ parent.expressions[1] === node
+ ) {
+ let { start, end } = parent.loc;
+
+ if (lib$6.isCallExpression(grandparent, { callee: parent })) {
+ // Attempt to expand the range around parentheses, e.g.
+ // (0, foo.bar)()
+ start = grandparent.loc.start;
+ end = Object.assign({}, end);
+ end.column += 1;
+ }
+
+ return {
+ type: "inherit",
+ start: fromBabelLocation(start, sourceId),
+ end: fromBabelLocation(end, sourceId),
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1),
+ };
+ }
+
+ // Consider "Object(foo)", and "__webpack_require__.i(foo)" to be
+ // equivalent to "foo" since they are essentially identity functions.
+ if (
+ lib$6.isCallExpression(parent) &&
+ (lib$6.isIdentifier(parent.callee, { name: "Object" }) ||
+ (lib$6.isMemberExpression(parent.callee, { computed: false }) &&
+ lib$6.isIdentifier(parent.callee.object, { name: "__webpack_require__" }) &&
+ lib$6.isIdentifier(parent.callee.property, { name: "i" }))) &&
+ parent.arguments.length === 1 &&
+ parent.arguments[0] === node
+ ) {
+ return {
+ type: "inherit",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1),
+ };
+ }
+
+ if (lib$6.isMemberExpression(parent, { object: node })) {
+ if (parent.computed) {
+ if (lib$6.isStringLiteral(parent.property)) {
+ return {
+ type: "member",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ property: parent.property.value,
+ parent: buildMetaBindings(
+ sourceId,
+ parent,
+ ancestors,
+ parentIndex - 1
+ ),
+ };
+ }
+ } else {
+ return {
+ type: "member",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ property: parent.property.name,
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1),
+ };
+ }
+ }
+ if (
+ lib$6.isCallExpression(parent, { callee: node }) &&
+ !parent.arguments.length
+ ) {
+ return {
+ type: "call",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1),
+ };
+ }
+
+ return null;
+ }
+
+ function looksLikeCommonJS(rootScope) {
+ const hasRefs = name =>
+ rootScope.bindings[name] && !!rootScope.bindings[name].refs.length;
+
+ return (
+ hasRefs("__dirname") ||
+ hasRefs("__filename") ||
+ hasRefs("require") ||
+ hasRefs("exports") ||
+ hasRefs("module")
+ );
+ }
+
+ function stripModuleScope(rootScope) {
+ const rootLexicalScope = rootScope.children[0];
+ const moduleScope = rootLexicalScope.children[0];
+ if (moduleScope.type !== "module") {
+ throw new Error("Assertion failure - should be module");
+ }
+
+ Object.keys(moduleScope.bindings).forEach(name => {
+ const binding = moduleScope.bindings[name];
+ if (binding.type === "let" || binding.type === "const") {
+ rootLexicalScope.bindings[name] = binding;
+ } else {
+ rootScope.bindings[name] = binding;
+ }
+ });
+ rootLexicalScope.children = moduleScope.children;
+ rootLexicalScope.children.forEach(child => {
+ child.parent = rootLexicalScope;
+ });
+ }
+
+ let parsedScopesCache = new Map();
+
+ function getScopes(location) {
+ const { sourceId } = location;
+ let parsedScopes = parsedScopesCache.get(sourceId);
+ if (!parsedScopes) {
+ parsedScopes = parseSourceScopes(sourceId);
+ parsedScopesCache.set(sourceId, parsedScopes);
+ }
+ return parsedScopes ? findScopes(parsedScopes, location) : [];
+ }
+
+ function clearScopes() {
+ parsedScopesCache = new Map();
+ }
+
+ /**
+ * Searches all scopes and their bindings at the specific location.
+ */
+ function findScopes(scopes, location) {
+ // Find inner most in the tree structure.
+ let searchInScopes = scopes;
+ const found = [];
+ while (searchInScopes) {
+ const foundOne = searchInScopes.some(s => {
+ if (
+ compareLocations(s.start, location) <= 0 &&
+ compareLocations(location, s.end) < 0
+ ) {
+ // Found the next scope, trying to search recusevly in its children.
+ found.unshift(s);
+ searchInScopes = s.children;
+ return true;
+ }
+ return false;
+ });
+ if (!foundOne) {
+ break;
+ }
+ }
+ return found.map(i => ({
+ type: i.type,
+ scopeKind: i.scopeKind,
+ displayName: i.displayName,
+ start: i.start,
+ end: i.end,
+ bindings: i.bindings,
+ }));
+ }
+
+ function compareLocations(a, b) {
+ // According to type of Location.column can be undefined, if will not be the
+ // case here, ignoring flow error.
+ return a.line == b.line ? a.column - b.column : a.line - b.line;
+ }
+
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+ function startsBefore(a, b) {
+ let before = a.start.line < b.line;
+ if (a.start.line === b.line) {
+ before =
+ a.start.column >= 0 && b.column >= 0 ? a.start.column <= b.column : true;
+ }
+ return before;
+ }
+
+ function endsAfter(a, b) {
+ let after = a.end.line > b.line;
+ if (a.end.line === b.line) {
+ after =
+ a.end.column >= 0 && b.column >= 0 ? a.end.column >= b.column : true;
+ }
+ return after;
+ }
+
+ function containsPosition(a, b) {
+ return startsBefore(a, b) && endsAfter(a, b);
+ }
+
+ function containsLocation(a, b) {
+ return containsPosition(a, b.start) && containsPosition(a, b.end);
+ }
+
+ function findSymbols(source) {
+ const { functions, comments } = getSymbols(source);
+ return { functions, comments };
+ }
+
+ /**
+ * Returns the location for a given function path. If the path represents a
+ * function declaration, the location will begin after the function identifier
+ * but before the function parameters.
+ */
+
+ function getLocation(func) {
+ const location = { ...func.location };
+
+ // if the function has an identifier, start the block after it so the
+ // identifier is included in the "scope" of its parent
+ const identifierEnd = func?.identifier?.loc?.end;
+ if (identifierEnd) {
+ location.start = identifierEnd;
+ }
+
+ return location;
+ }
+
+ /**
+ * Find the nearest location containing the input position and
+ * return inner locations under that nearest location
+ *
+ * @param {Array<Object>} locations Notice! The locations MUST be sorted by `sortByStart`
+ * so that we can do linear time complexity operation.
+ * @returns {Array<Object>}
+ */
+ function getInnerLocations(locations, position) {
+ // First, let's find the nearest position-enclosing function location,
+ // which is to find the last location enclosing the position.
+ let parentIndex;
+ for (let i = locations.length - 1; i >= 0; i--) {
+ const loc = locations[i];
+ if (containsPosition(loc, position)) {
+ parentIndex = i;
+ break;
+ }
+ }
+
+ if (parentIndex == undefined) {
+ return [];
+ }
+ const parentLoc = locations[parentIndex];
+
+ // Then, from the nearest location, loop locations again and put locations into
+ // the innerLocations array until we get to a location not enclosed by the nearest location.
+ const innerLocations = [];
+ for (let i = parentIndex + 1; i < locations.length; i++) {
+ const loc = locations[i];
+ if (!containsLocation(parentLoc, loc)) {
+ break;
+ }
+
+ innerLocations.push(loc);
+ }
+
+ return innerLocations;
+ }
+
+ /**
+ * Return an new locations array which excludes
+ * items that are completely enclosed by another location in the input locations
+ *
+ * @param locations Notice! The locations MUST be sorted by `sortByStart`
+ * so that we can do linear time complexity operation.
+ */
+ function removeOverlaps(locations) {
+ if (!locations.length) {
+ return [];
+ }
+ const firstParent = locations[0];
+ return locations.reduce(deduplicateNode, [firstParent]);
+ }
+
+ function deduplicateNode(nodes, location) {
+ const parent = nodes[nodes.length - 1];
+ if (!containsLocation(parent, location)) {
+ nodes.push(location);
+ }
+ return nodes;
+ }
+
+ /**
+ * Sorts an array of locations by start position
+ */
+ function sortByStart(a, b) {
+ if (a.start.line < b.start.line) {
+ return -1;
+ } else if (a.start.line === b.start.line) {
+ return a.start.column - b.start.column;
+ }
+
+ return 1;
+ }
+
+ /**
+ * Returns an array of locations that are considered out of scope for the given
+ * location.
+ */
+ function findOutOfScopeLocations(location) {
+ const { functions, comments } = findSymbols(location.source.id);
+ const commentLocations = comments.map(c => c.location);
+ const locations = functions
+ .map(getLocation)
+ .concat(commentLocations)
+ .sort(sortByStart);
+
+ const innerLocations = getInnerLocations(locations, location);
+ const outerLocations = locations.filter(loc => {
+ if (innerLocations.includes(loc)) {
+ return false;
+ }
+
+ return !containsPosition(loc, location);
+ });
+ return removeOverlaps(outerLocations);
+ }
+
+ function hasSyntaxError(input) {
+ try {
+ parseScript(input);
+ return false;
+ } catch (e) {
+ return `${e.name} : ${e.message}`;
+ }
+ }
+
+ // NOTE: this will only work if we are replacing an original identifier
+ function replaceNode(ancestors, node) {
+ const ancestor = ancestors[ancestors.length - 1];
+
+ if (typeof ancestor.index === "number") {
+ ancestor.node[ancestor.key][ancestor.index] = node;
+ } else {
+ ancestor.node[ancestor.key] = node;
+ }
+ }
+
+ function getFirstExpression(ast) {
+ const statements = ast.program.body;
+ if (!statements.length) {
+ return null;
+ }
+
+ return statements[0].expression;
+ }
+
+ function locationKey(start) {
+ return `${start.line}:${start.column}`;
+ }
+
+ function mapOriginalExpression(expression, ast, mappings) {
+ const scopes = buildScopeList(ast, "");
+ let shouldUpdate = false;
+
+ const nodes = new Map();
+ const replacements = new Map();
+
+ // The ref-only global bindings are the ones that are accessed, but not
+ // declared anywhere in the parsed code, meaning they are either global,
+ // or declared somewhere in a scope outside the parsed code, so we
+ // rewrite all of those specifically to avoid rewritting declarations that
+ // shadow outer mappings.
+ for (const name of Object.keys(scopes[0].bindings)) {
+ const { refs } = scopes[0].bindings[name];
+ const mapping = mappings[name];
+
+ if (
+ !refs.every(ref => ref.type === "ref") ||
+ !mapping ||
+ mapping === name
+ ) {
+ continue;
+ }
+
+ let node = nodes.get(name);
+ if (!node) {
+ node = getFirstExpression(parseScript(mapping));
+ nodes.set(name, node);
+ }
+
+ for (const ref of refs) {
+ let { line, column } = ref.start;
+
+ // This shouldn't happen, just keeping Flow happy.
+ if (typeof column !== "number") {
+ column = 0;
+ }
+
+ replacements.set(locationKey({ line, column }), node);
+ }
+ }
+
+ if (replacements.size === 0) {
+ // Avoid the extra code generation work and also avoid potentially
+ // reformatting the user's code unnecessarily.
+ return expression;
+ }
+
+ lib$6.traverse(ast, (node, ancestors) => {
+ if (!lib$6.isIdentifier(node) && !lib$6.isThisExpression(node)) {
+ return;
+ }
+
+ const ancestor = ancestors[ancestors.length - 1];
+ // Shorthand properties can have a key and value with `node.loc.start` value
+ // and we only want to replace the value.
+ if (lib$6.isObjectProperty(ancestor.node) && ancestor.key !== "value") {
+ return;
+ }
+
+ const replacement = replacements.get(locationKey(node.loc.start));
+ if (replacement) {
+ replaceNode(ancestors, lib$6.cloneNode(replacement));
+ shouldUpdate = true;
+ }
+ });
+
+ if (shouldUpdate) {
+ return _default(ast).code;
+ }
+
+ return expression;
+ }
+
+ function getAssignmentTarget(node, bindings) {
+ if (lib$6.isObjectPattern(node)) {
+ for (const property of node.properties) {
+ if (lib$6.isRestElement(property)) {
+ property.argument = getAssignmentTarget(property.argument, bindings);
+ } else {
+ property.value = getAssignmentTarget(property.value, bindings);
+ }
+ }
+
+ return node;
+ }
+
+ if (lib$6.isArrayPattern(node)) {
+ for (const [i, element] of node.elements.entries()) {
+ node.elements[i] = getAssignmentTarget(element, bindings);
+ }
+
+ return node;
+ }
+
+ if (lib$6.isAssignmentPattern(node)) {
+ node.left = getAssignmentTarget(node.left, bindings);
+
+ return node;
+ }
+
+ if (lib$6.isRestElement(node)) {
+ node.argument = getAssignmentTarget(node.argument, bindings);
+
+ return node;
+ }
+
+ if (lib$6.isIdentifier(node)) {
+ return bindings.includes(node.name)
+ ? node
+ : lib$6.memberExpression(lib$6.identifier("self"), node);
+ }
+
+ return node;
+ }
+
+ // translates new bindings `var a = 3` into `self.a = 3`
+ // and existing bindings `var a = 3` into `a = 3` for re-assignments
+ function globalizeDeclaration(node, bindings) {
+ return node.declarations.map(declaration =>
+ lib$6.expressionStatement(
+ lib$6.assignmentExpression(
+ "=",
+ getAssignmentTarget(declaration.id, bindings),
+ declaration.init || lib$6.unaryExpression("void", lib$6.numericLiteral(0))
+ )
+ )
+ );
+ }
+
+ // translates new bindings `a = 3` into `self.a = 3`
+ // and keeps assignments the same for existing bindings.
+ function globalizeAssignment(node, bindings) {
+ return lib$6.assignmentExpression(
+ node.operator,
+ getAssignmentTarget(node.left, bindings),
+ node.right
+ );
+ }
+
+ function mapExpressionBindings(expression, ast, bindings = []) {
+ let isMapped = false;
+ let shouldUpdate = true;
+
+ lib$6.traverse(ast, (node, ancestors) => {
+ const parent = ancestors[ancestors.length - 1];
+
+ if (lib$6.isWithStatement(node)) {
+ shouldUpdate = false;
+ return;
+ }
+
+ if (!isTopLevel(ancestors)) {
+ return;
+ }
+
+ if (lib$6.isAssignmentExpression(node)) {
+ if (lib$6.isIdentifier(node.left) || lib$6.isPattern(node.left)) {
+ const newNode = globalizeAssignment(node, bindings);
+ isMapped = true;
+ replaceNode$1(ancestors, newNode);
+ return;
+ }
+
+ return;
+ }
+
+ if (!lib$6.isVariableDeclaration(node)) {
+ return;
+ }
+
+ if (!lib$6.isForStatement(parent.node)) {
+ const newNodes = globalizeDeclaration(node, bindings);
+ isMapped = true;
+ replaceNode$1(ancestors, newNodes);
+ }
+ });
+
+ if (!shouldUpdate || !isMapped) {
+ return expression;
+ }
+
+ return _default(ast).code;
+ }
+
+ function hasTopLevelAwait(ast) {
+ const hasAwait = hasNode(
+ ast,
+ (node, ancestors, b) => lib$6.isAwaitExpression(node) && isTopLevel(ancestors)
+ );
+
+ return hasAwait;
+ }
+
+ // translates new bindings `var a = 3` into `a = 3`.
+ function translateDeclarationIntoAssignment(node) {
+ return node.declarations.reduce((acc, declaration) => {
+ // Don't translate declaration without initial assignment (e.g. `var a;`)
+ if (!declaration.init) {
+ return acc;
+ }
+ acc.push(
+ lib$6.expressionStatement(
+ lib$6.assignmentExpression("=", declaration.id, declaration.init)
+ )
+ );
+ return acc;
+ }, []);
+ }
+
+ /**
+ * Given an AST, compute its last statement and replace it with a
+ * return statement.
+ */
+ function addReturnNode(ast) {
+ const statements = ast.program.body;
+ const lastStatement = statements.pop();
+
+ // if the last expression is an awaitExpression, strip the `await` part and directly
+ // return the argument to avoid calling the argument's `then` function twice when the
+ // mapped expression gets evaluated (See Bug 1771428)
+ if (lib$6.isAwaitExpression(lastStatement.expression)) {
+ lastStatement.expression = lastStatement.expression.argument;
+ }
+ statements.push(lib$6.returnStatement(lastStatement.expression));
+ return statements;
+ }
+
+ function getDeclarations(node) {
+ const { kind, declarations } = node;
+ const declaratorNodes = declarations.reduce((acc, d) => {
+ const declarators = getVariableDeclarators(d.id);
+ return acc.concat(declarators);
+ }, []);
+
+ // We can't declare const variables outside of the async iife because we
+ // wouldn't be able to re-assign them. As a workaround, we transform them
+ // to `let` which should be good enough for those case.
+ return lib$6.variableDeclaration(
+ kind === "const" ? "let" : kind,
+ declaratorNodes
+ );
+ }
+
+ function getVariableDeclarators(node) {
+ if (lib$6.isIdentifier(node)) {
+ return lib$6.variableDeclarator(lib$6.identifier(node.name));
+ }
+
+ if (lib$6.isObjectProperty(node)) {
+ return getVariableDeclarators(node.value);
+ }
+ if (lib$6.isRestElement(node)) {
+ return getVariableDeclarators(node.argument);
+ }
+
+ if (lib$6.isAssignmentPattern(node)) {
+ return getVariableDeclarators(node.left);
+ }
+
+ if (lib$6.isArrayPattern(node)) {
+ return node.elements.reduce(
+ (acc, element) => acc.concat(getVariableDeclarators(element)),
+ []
+ );
+ }
+ if (lib$6.isObjectPattern(node)) {
+ return node.properties.reduce(
+ (acc, property) => acc.concat(getVariableDeclarators(property)),
+ []
+ );
+ }
+ return [];
+ }
+
+ /**
+ * Given an AST and an array of variableDeclaration nodes, return a new AST with
+ * all the declarations at the top of the AST.
+ */
+ function addTopDeclarationNodes(ast, declarationNodes) {
+ const statements = [];
+ declarationNodes.forEach(declarationNode => {
+ statements.push(getDeclarations(declarationNode));
+ });
+ statements.push(ast);
+ return lib$6.program(statements);
+ }
+
+ /**
+ * Given an AST, return an object of the following shape:
+ * - newAst: {AST} the AST where variable declarations were transformed into
+ * variable assignments
+ * - declarations: {Array<Node>} An array of all the declaration nodes needed
+ * outside of the async iife.
+ */
+ function translateDeclarationsIntoAssignment(ast) {
+ const declarations = [];
+ lib$6.traverse(ast, (node, ancestors) => {
+ const parent = ancestors[ancestors.length - 1];
+
+ if (
+ lib$6.isWithStatement(node) ||
+ !isTopLevel(ancestors) ||
+ lib$6.isAssignmentExpression(node) ||
+ !lib$6.isVariableDeclaration(node) ||
+ lib$6.isForStatement(parent.node) ||
+ lib$6.isForXStatement(parent.node) ||
+ !Array.isArray(node.declarations) ||
+ node.declarations.length === 0
+ ) {
+ return;
+ }
+
+ const newNodes = translateDeclarationIntoAssignment(node);
+ replaceNode$1(ancestors, newNodes);
+ declarations.push(node);
+ });
+
+ return {
+ newAst: ast,
+ declarations,
+ };
+ }
+
+ /**
+ * Given an AST, wrap its body in an async iife, transform variable declarations
+ * in assignments and move the variable declarations outside of the async iife.
+ * Example: With the AST for the following expression: `let a = await 123`, the
+ * function will return:
+ * let a;
+ * (async => {
+ * return a = await 123;
+ * })();
+ */
+ function wrapExpressionFromAst(ast) {
+ // Transform let and var declarations into assignments, and get back an array
+ // of variable declarations.
+ let { newAst, declarations } = translateDeclarationsIntoAssignment(ast);
+ const body = addReturnNode(newAst);
+
+ // Create the async iife.
+ newAst = lib$6.expressionStatement(
+ lib$6.callExpression(
+ lib$6.arrowFunctionExpression([], lib$6.blockStatement(body), true),
+ []
+ )
+ );
+
+ // Now let's put all the variable declarations at the top of the async iife.
+ newAst = addTopDeclarationNodes(newAst, declarations);
+
+ return _default(newAst).code;
+ }
+
+ function mapTopLevelAwait(expression, ast) {
+ if (!ast) {
+ // If there's no ast this means the expression is malformed. And if the
+ // expression contains the await keyword, we still want to wrap it in an
+ // async iife in order to get a meaningful message (without this, the
+ // engine will throw an Error stating that await keywords are only valid
+ // in async functions and generators).
+ if (expression.includes("await ")) {
+ return `(async () => { ${expression} })();`;
+ }
+
+ return expression;
+ }
+
+ if (!hasTopLevelAwait(ast)) {
+ return expression;
+ }
+
+ return wrapExpressionFromAst(ast);
+ }
+
+ function mapExpression(
+ expression,
+ mappings,
+ bindings,
+ shouldMapBindings = true,
+ shouldMapAwait = true
+ ) {
+ const mapped = {
+ await: false,
+ bindings: false,
+ originalExpression: false,
+ };
+
+ const ast = parseConsoleScript(expression);
+ try {
+ if (mappings && ast) {
+ const beforeOriginalExpression = expression;
+ expression = mapOriginalExpression(expression, ast, mappings);
+ mapped.originalExpression = beforeOriginalExpression !== expression;
+ }
+
+ if (shouldMapBindings && ast) {
+ const beforeBindings = expression;
+ expression = mapExpressionBindings(expression, ast, bindings);
+ mapped.bindings = beforeBindings !== expression;
+ }
+
+ if (shouldMapAwait) {
+ const beforeAwait = expression;
+ expression = mapTopLevelAwait(expression, ast);
+ mapped.await = beforeAwait !== expression;
+ }
+ } catch (e) {
+ console.warn(`Error when mapping ${expression} expression:`, e);
+ }
+
+ return {
+ expression,
+ mapped,
+ };
+ }
+
+ var workerUtilsExports = {};
+ var workerUtils = {
+ get exports(){ return workerUtilsExports; },
+ set exports(v){ workerUtilsExports = v; },
+ };
+
+ (function (module) {
+
+ class WorkerDispatcher {
+ #msgId = 1;
+ #worker = null;
+ // Map of message ids -> promise resolution functions, for dispatching worker responses
+ #pendingCalls = new Map();
+ #url = "";
+
+ constructor(url) {
+ this.#url = url;
+ }
+
+ start() {
+ // When running in debugger jest test, we don't have access to ChromeWorker
+ if (typeof ChromeWorker == "function") {
+ this.#worker = new ChromeWorker(this.#url);
+ } else {
+ this.#worker = new Worker(this.#url);
+ }
+ this.#worker.onerror = err => {
+ console.error(`Error in worker ${this.#url}`, err.message);
+ };
+ this.#worker.addEventListener("message", this.#onMessage);
+ }
+
+ stop() {
+ if (!this.#worker) {
+ return;
+ }
+
+ this.#worker.removeEventListener("message", this.#onMessage);
+ this.#worker.terminate();
+ this.#worker = null;
+ this.#pendingCalls.clear();
+ }
+
+ task(method, { queue = false } = {}) {
+ const calls = [];
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push({ args, resolve, reject });
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.#worker) {
+ this.start();
+ }
+
+ const id = this.#msgId++;
+ this.#worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item.args),
+ });
+
+ this.#pendingCalls.set(id, items);
+ };
+
+ return (...args) => push(args);
+ }
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+ #onMessage = ({ data: result }) => {
+ const items = this.#pendingCalls.get(result.id);
+ this.#pendingCalls.delete(result.id);
+ if (!items) {
+ return;
+ }
+
+ if (!this.#worker) {
+ return;
+ }
+
+ result.results.forEach((resultData, i) => {
+ const { resolve, reject } = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+ }
+
+ function workerHandler(publicInterface) {
+ return function (msg) {
+ const { id, method, calls } = msg.data;
+
+ Promise.all(
+ calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+ if (response instanceof Promise) {
+ return response.then(
+ val => ({ response: val }),
+ err => asErrorMessage(err)
+ );
+ }
+ return { response };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })
+ ).then(results => {
+ globalThis.postMessage({ id, results });
+ });
+ };
+ }
+
+ function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata,
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined,
+ };
+ }
+
+ // Might be loaded within a worker thread where `module` isn't available.
+ {
+ module.exports = {
+ WorkerDispatcher,
+ workerHandler,
+ };
+ }
+ } (workerUtils));
+
+ function clearState() {
+ clearASTs();
+ clearScopes();
+ clearSources();
+ clearSymbols();
+ }
+
+ self.onmessage = workerUtilsExports.workerHandler({
+ findOutOfScopeLocations,
+ getSymbols,
+ getScopes,
+ clearState,
+ hasSyntaxError,
+ mapExpression,
+ setSource,
+ });
+
+}));
diff --git a/devtools/client/debugger/dist/pretty-print-worker.js b/devtools/client/debugger/dist/pretty-print-worker.js
new file mode 100644
index 0000000000..68b0b9f7e8
--- /dev/null
+++ b/devtools/client/debugger/dist/pretty-print-worker.js
@@ -0,0 +1,10534 @@
+(function (factory) {
+ typeof define === 'function' && define.amd ? define(factory) :
+ factory();
+})((function () { 'use strict';
+
+ (function() {
+ const env = {"NODE_ENV":"production"};
+ try {
+ if (process) {
+ process.env = Object.assign({}, process.env);
+ Object.assign(process.env, env);
+ return;
+ }
+ } catch (e) {} // avoid ReferenceError: process is not defined
+ globalThis.process = { env:env };
+ })();
+
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
+
+ function getAugmentedNamespace(n) {
+ if (n.__esModule) return n;
+ var f = n.default;
+ if (typeof f == "function") {
+ var a = function a () {
+ if (this instanceof a) {
+ var args = [null];
+ args.push.apply(args, arguments);
+ var Ctor = Function.bind.apply(f, args);
+ return new Ctor();
+ }
+ return f.apply(this, arguments);
+ };
+ a.prototype = f.prototype;
+ } else a = {};
+ Object.defineProperty(a, '__esModule', {value: true});
+ Object.keys(n).forEach(function (k) {
+ var d = Object.getOwnPropertyDescriptor(n, k);
+ Object.defineProperty(a, k, d.get ? d : {
+ enumerable: true,
+ get: function () {
+ return n[k];
+ }
+ });
+ });
+ return a;
+ }
+
+ var sourceMap$1 = {};
+
+ var sourceMapGenerator = {};
+
+ var base64Vlq = {};
+
+ var base64$1 = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ const intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
+
+ /**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+ base64$1.encode = function(number) {
+ if (0 <= number && number < intToCharMap.length) {
+ return intToCharMap[number];
+ }
+ throw new TypeError("Must be between 0 and 63: " + number);
+ };
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ const base64 = base64$1;
+
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
+ // length quantities we use in the source map spec, the first bit is the sign,
+ // the next four bits are the actual value, and the 6th bit is the
+ // continuation bit. The continuation bit tells us whether there are more
+ // digits in this value following this digit.
+ //
+ // Continuation
+ // | Sign
+ // | |
+ // V V
+ // 101011
+
+ const VLQ_BASE_SHIFT = 5;
+
+ // binary: 100000
+ const VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+ // binary: 011111
+ const VLQ_BASE_MASK = VLQ_BASE - 1;
+
+ // binary: 100000
+ const VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+ /**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+ function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+ }
+
+ /**
+ * Returns the base 64 VLQ encoded value.
+ */
+ base64Vlq.encode = function base64VLQ_encode(aValue) {
+ let encoded = "";
+ let digit;
+
+ let vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+ };
+
+ var util$4 = {};
+
+ (function (exports) {
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ /**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+ function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ }
+ throw new Error('"' + aName + '" is a required argument.');
+
+ }
+ exports.getArg = getArg;
+
+ const urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
+ const dataUrlRegexp = /^data:.+\,.+$/;
+
+ function urlParse(aUrl) {
+ const match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+ }
+ exports.urlParse = urlParse;
+
+ function urlGenerate(aParsedUrl) {
+ let url = "";
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ":";
+ }
+ url += "//";
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + "@";
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port;
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+ }
+ exports.urlGenerate = urlGenerate;
+
+ const MAX_CACHED_INPUTS = 32;
+
+ /**
+ * Takes some function `f(input) -> result` and returns a memoized version of
+ * `f`.
+ *
+ * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
+ * memoization is a dumb-simple, linear least-recently-used cache.
+ */
+ function lruMemoize(f) {
+ const cache = [];
+
+ return function(input) {
+ for (let i = 0; i < cache.length; i++) {
+ if (cache[i].input === input) {
+ const temp = cache[0];
+ cache[0] = cache[i];
+ cache[i] = temp;
+ return cache[0].result;
+ }
+ }
+
+ const result = f(input);
+
+ cache.unshift({
+ input,
+ result,
+ });
+
+ if (cache.length > MAX_CACHED_INPUTS) {
+ cache.pop();
+ }
+
+ return result;
+ };
+ }
+
+ /**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consecutive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '<dir>/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+ const normalize = lruMemoize(function normalize(aPath) {
+ let path = aPath;
+ const url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ const isAbsolute = exports.isAbsolute(path);
+
+ // Split the path into parts between `/` characters. This is much faster than
+ // using `.split(/\/+/g)`.
+ const parts = [];
+ let start = 0;
+ let i = 0;
+ while (true) {
+ start = i;
+ i = path.indexOf("/", start);
+ if (i === -1) {
+ parts.push(path.slice(start));
+ break;
+ } else {
+ parts.push(path.slice(start, i));
+ while (i < path.length && path[i] === "/") {
+ i++;
+ }
+ }
+ }
+
+ let up = 0;
+ for (i = parts.length - 1; i >= 0; i--) {
+ const part = parts[i];
+ if (part === ".") {
+ parts.splice(i, 1);
+ } else if (part === "..") {
+ up++;
+ } else if (up > 0) {
+ if (part === "") {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join("/");
+
+ if (path === "") {
+ path = isAbsolute ? "/" : ".";
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+ });
+ exports.normalize = normalize;
+
+ /**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+ function join(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+ if (aPath === "") {
+ aPath = ".";
+ }
+ const aPathUrl = urlParse(aPath);
+ const aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || "/";
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ const joined = aPath.charAt(0) === "/"
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+ }
+ exports.join = join;
+
+ exports.isAbsolute = function(aPath) {
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
+ };
+
+ /**
+ * Make a path relative to a URL or another path.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ */
+ function relative(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+
+ aRoot = aRoot.replace(/\/$/, "");
+
+ // It is possible for the path to be above the root. In this case, simply
+ // checking whether the root is a prefix of the path won't work. Instead, we
+ // need to remove components from the root one by one, until either we find
+ // a prefix that fits, or we run out of components to remove.
+ let level = 0;
+ while (aPath.indexOf(aRoot + "/") !== 0) {
+ const index = aRoot.lastIndexOf("/");
+ if (index < 0) {
+ return aPath;
+ }
+
+ // If the only part of the root that is left is the scheme (i.e. http://,
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
+ // have exhausted all components, so the path is not relative to the root.
+ aRoot = aRoot.slice(0, index);
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
+ return aPath;
+ }
+
+ ++level;
+ }
+
+ // Make sure we add a "../" for each component we removed from the root.
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
+ }
+ exports.relative = relative;
+
+ const supportsNullProto = (function() {
+ const obj = Object.create(null);
+ return !("__proto__" in obj);
+ }());
+
+ function identity(s) {
+ return s;
+ }
+
+ /**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+ function toSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return "$" + aStr;
+ }
+
+ return aStr;
+ }
+ exports.toSetString = supportsNullProto ? identity : toSetString;
+
+ function fromSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return aStr.slice(1);
+ }
+
+ return aStr;
+ }
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
+
+ function isProtoString(s) {
+ if (!s) {
+ return false;
+ }
+
+ const length = s.length;
+
+ if (length < 9 /* "__proto__".length */) {
+ return false;
+ }
+
+ /* eslint-disable no-multi-spaces */
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
+ return false;
+ }
+ /* eslint-enable no-multi-spaces */
+
+ for (let i = length - 10; i >= 0; i--) {
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ let cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0 || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ }
+ exports.compareByOriginalPositions = compareByOriginalPositions;
+
+ /**
+ * Comparator between two mappings with deflated source and name indices where
+ * the generated positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
+ let cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0 || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ }
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+ function strcmp(aStr1, aStr2) {
+ if (aStr1 === aStr2) {
+ return 0;
+ }
+
+ if (aStr1 === null) {
+ return 1; // aStr2 !== null
+ }
+
+ if (aStr2 === null) {
+ return -1; // aStr1 !== null
+ }
+
+ if (aStr1 > aStr2) {
+ return 1;
+ }
+
+ return -1;
+ }
+
+ /**
+ * Comparator between two mappings with inflated source and name strings where
+ * the generated positions are compared.
+ */
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+ let cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ }
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
+
+ /**
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
+ * in the source maps specification), and then parse the string as
+ * JSON.
+ */
+ function parseSourceMapInput(str) {
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
+ }
+ exports.parseSourceMapInput = parseSourceMapInput;
+
+ /**
+ * Compute the URL of a source given the the source root, the source's
+ * URL, and the source map's URL.
+ */
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
+ sourceURL = sourceURL || "";
+
+ if (sourceRoot) {
+ // This follows what Chrome does.
+ if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
+ sourceRoot += "/";
+ }
+ // The spec says:
+ // Line 4: An optional source root, useful for relocating source
+ // files on a server or removing repeated values in the
+ // “sources” entry. This value is prepended to the individual
+ // entries in the “source” field.
+ sourceURL = sourceRoot + sourceURL;
+ }
+
+ // Historically, SourceMapConsumer did not take the sourceMapURL as
+ // a parameter. This mode is still somewhat supported, which is why
+ // this code block is conditional. However, it's preferable to pass
+ // the source map URL to SourceMapConsumer, so that this function
+ // can implement the source URL resolution algorithm as outlined in
+ // the spec. This block is basically the equivalent of:
+ // new URL(sourceURL, sourceMapURL).toString()
+ // ... except it avoids using URL, which wasn't available in the
+ // older releases of node still supported by this library.
+ //
+ // The spec says:
+ // If the sources are not absolute URLs after prepending of the
+ // “sourceRoot”, the sources are resolved relative to the
+ // SourceMap (like resolving script src in a html document).
+ if (sourceMapURL) {
+ const parsed = urlParse(sourceMapURL);
+ if (!parsed) {
+ throw new Error("sourceMapURL could not be parsed");
+ }
+ if (parsed.path) {
+ // Strip the last path component, but keep the "/".
+ const index = parsed.path.lastIndexOf("/");
+ if (index >= 0) {
+ parsed.path = parsed.path.substring(0, index + 1);
+ }
+ }
+ sourceURL = join(urlGenerate(parsed), sourceURL);
+ }
+
+ return normalize(sourceURL);
+ }
+ exports.computeSourceURL = computeSourceURL;
+ } (util$4));
+
+ var arraySet = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ /**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+ let ArraySet$2 = class ArraySet {
+ constructor() {
+ this._array = [];
+ this._set = new Map();
+ }
+
+ /**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ static fromArray(aArray, aAllowDuplicates) {
+ const set = new ArraySet();
+ for (let i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+ }
+
+ /**
+ * Return how many unique items are in this ArraySet. If duplicates have been
+ * added, than those do not count towards the size.
+ *
+ * @returns Number
+ */
+ size() {
+ return this._set.size;
+ }
+
+ /**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ add(aStr, aAllowDuplicates) {
+ const isDuplicate = this.has(aStr);
+ const idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ this._set.set(aStr, idx);
+ }
+ }
+
+ /**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ has(aStr) {
+ return this._set.has(aStr);
+ }
+
+ /**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ indexOf(aStr) {
+ const idx = this._set.get(aStr);
+ if (idx >= 0) {
+ return idx;
+ }
+ throw new Error('"' + aStr + '" is not in the set.');
+ }
+
+ /**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error("No element indexed by " + aIdx);
+ }
+
+ /**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ toArray() {
+ return this._array.slice();
+ }
+ };
+ arraySet.ArraySet = ArraySet$2;
+
+ var mappingList = {};
+
+ /*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ const util$3 = util$4;
+
+ /**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+ function generatedPositionAfter(mappingA, mappingB) {
+ // Optimized for most common case
+ const lineA = mappingA.generatedLine;
+ const lineB = mappingB.generatedLine;
+ const columnA = mappingA.generatedColumn;
+ const columnB = mappingB.generatedColumn;
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
+ util$3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+ }
+
+ /**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a negligible overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+ let MappingList$1 = class MappingList {
+ constructor() {
+ this._array = [];
+ this._sorted = true;
+ // Serves as infimum
+ this._last = {generatedLine: -1, generatedColumn: 0};
+ }
+
+ /**
+ * Iterate through internal items. This method takes the same arguments that
+ * `Array.prototype.forEach` takes.
+ *
+ * NOTE: The order of the mappings is NOT guaranteed.
+ */
+ unsortedForEach(aCallback, aThisArg) {
+ this._array.forEach(aCallback, aThisArg);
+ }
+
+ /**
+ * Add the given source mapping.
+ *
+ * @param Object aMapping
+ */
+ add(aMapping) {
+ if (generatedPositionAfter(this._last, aMapping)) {
+ this._last = aMapping;
+ this._array.push(aMapping);
+ } else {
+ this._sorted = false;
+ this._array.push(aMapping);
+ }
+ }
+
+ /**
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
+ * generated position.
+ *
+ * WARNING: This method returns internal data without copying, for
+ * performance. The return value must NOT be mutated, and should be treated as
+ * an immutable borrow. If you want to take ownership, you must make your own
+ * copy.
+ */
+ toArray() {
+ if (!this._sorted) {
+ this._array.sort(util$3.compareByGeneratedPositionsInflated);
+ this._sorted = true;
+ }
+ return this._array;
+ }
+ };
+
+ mappingList.MappingList = MappingList$1;
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ const base64VLQ = base64Vlq;
+ const util$2 = util$4;
+ const ArraySet$1 = arraySet.ArraySet;
+ const MappingList = mappingList.MappingList;
+
+ /**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+ let SourceMapGenerator$2 = class SourceMapGenerator {
+ constructor(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util$2.getArg(aArgs, "file", null);
+ this._sourceRoot = util$2.getArg(aArgs, "sourceRoot", null);
+ this._skipValidation = util$2.getArg(aArgs, "skipValidation", false);
+ this._sources = new ArraySet$1();
+ this._names = new ArraySet$1();
+ this._mappings = new MappingList();
+ this._sourcesContents = null;
+ }
+
+ /**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+ static fromSourceMap(aSourceMapConsumer) {
+ const sourceRoot = aSourceMapConsumer.sourceRoot;
+ const generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function(mapping) {
+ const newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source != null) {
+ newMapping.source = mapping.source;
+ if (sourceRoot != null) {
+ newMapping.source = util$2.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name != null) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
+ let sourceRelative = sourceFile;
+ if (sourceRoot !== null) {
+ sourceRelative = util$2.relative(sourceRoot, sourceFile);
+ }
+
+ if (!generator._sources.has(sourceRelative)) {
+ generator._sources.add(sourceRelative);
+ }
+
+ const content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ }
+
+ /**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+ addMapping(aArgs) {
+ const generated = util$2.getArg(aArgs, "generated");
+ const original = util$2.getArg(aArgs, "original", null);
+ let source = util$2.getArg(aArgs, "source", null);
+ let name = util$2.getArg(aArgs, "name", null);
+
+ if (!this._skipValidation) {
+ this._validateMapping(generated, original, source, name);
+ }
+
+ if (source != null) {
+ source = String(source);
+ if (!this._sources.has(source)) {
+ this._sources.add(source);
+ }
+ }
+
+ if (name != null) {
+ name = String(name);
+ if (!this._names.has(name)) {
+ this._names.add(name);
+ }
+ }
+
+ this._mappings.add({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source,
+ name
+ });
+ }
+
+ /**
+ * Set the source content for a source file.
+ */
+ setSourceContent(aSourceFile, aSourceContent) {
+ let source = aSourceFile;
+ if (this._sourceRoot != null) {
+ source = util$2.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent != null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = Object.create(null);
+ }
+ this._sourcesContents[util$2.toSetString(source)] = aSourceContent;
+ } else if (this._sourcesContents) {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util$2.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ }
+
+ /**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+ applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ let sourceFile = aSourceFile;
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (aSourceFile == null) {
+ if (aSourceMapConsumer.file == null) {
+ throw new Error(
+ "SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ sourceFile = aSourceMapConsumer.file;
+ }
+ const sourceRoot = this._sourceRoot;
+ // Make "sourceFile" relative if an absolute Url is passed.
+ if (sourceRoot != null) {
+ sourceFile = util$2.relative(sourceRoot, sourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ const newSources = this._mappings.toArray().length > 0
+ ? new ArraySet$1()
+ : this._sources;
+ const newNames = new ArraySet$1();
+
+ // Find mappings for the "sourceFile"
+ this._mappings.unsortedForEach(function(mapping) {
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ const original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source != null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath != null) {
+ mapping.source = util$2.join(aSourceMapPath, mapping.source);
+ }
+ if (sourceRoot != null) {
+ mapping.source = util$2.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name != null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ const source = mapping.source;
+ if (source != null && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ const name = mapping.name;
+ if (name != null && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function(srcFile) {
+ const content = aSourceMapConsumer.sourceContentFor(srcFile);
+ if (content != null) {
+ if (aSourceMapPath != null) {
+ srcFile = util$2.join(aSourceMapPath, srcFile);
+ }
+ if (sourceRoot != null) {
+ srcFile = util$2.relative(sourceRoot, srcFile);
+ }
+ this.setSourceContent(srcFile, content);
+ }
+ }, this);
+ }
+
+ /**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+ _validateMapping(aGenerated, aOriginal, aSource, aName) {
+ // When aOriginal is truthy but has empty values for .line and .column,
+ // it is most likely a programmer error. In this case we throw a very
+ // specific error message to try to guide them the right way.
+ // For example: https://github.com/Polymer/polymer-bundler/pull/519
+ if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
+ throw new Error(
+ "original.line and original.column are not numbers -- you probably meant to omit " +
+ "the original mapping entirely and only map the generated position. If so, pass " +
+ "null for the original mapping instead of an object with empty or null values."
+ );
+ }
+
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) ; else if (aGenerated && "line" in aGenerated && "column" in aGenerated
+ && aOriginal && "line" in aOriginal && "column" in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) ; else {
+ throw new Error("Invalid mapping: " + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ }
+
+ /**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+ _serializeMappings() {
+ let previousGeneratedColumn = 0;
+ let previousGeneratedLine = 1;
+ let previousOriginalColumn = 0;
+ let previousOriginalLine = 0;
+ let previousName = 0;
+ let previousSource = 0;
+ let result = "";
+ let next;
+ let mapping;
+ let nameIdx;
+ let sourceIdx;
+
+ const mappings = this._mappings.toArray();
+ for (let i = 0, len = mappings.length; i < len; i++) {
+ mapping = mappings[i];
+ next = "";
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ next += ";";
+ previousGeneratedLine++;
+ }
+ } else if (i > 0) {
+ if (!util$2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
+ continue;
+ }
+ next += ",";
+ }
+
+ next += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source != null) {
+ sourceIdx = this._sources.indexOf(mapping.source);
+ next += base64VLQ.encode(sourceIdx - previousSource);
+ previousSource = sourceIdx;
+
+ // lines are stored 0-based in SourceMap spec version 3
+ next += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ next += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name != null) {
+ nameIdx = this._names.indexOf(mapping.name);
+ next += base64VLQ.encode(nameIdx - previousName);
+ previousName = nameIdx;
+ }
+ }
+
+ result += next;
+ }
+
+ return result;
+ }
+
+ _generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function(source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot != null) {
+ source = util$2.relative(aSourceRoot, source);
+ }
+ const key = util$2.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ }
+
+ /**
+ * Externalize the source map.
+ */
+ toJSON() {
+ const map = {
+ version: this._version,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._file != null) {
+ map.file = this._file;
+ }
+ if (this._sourceRoot != null) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ }
+
+ /**
+ * Render the source map being generated to a string.
+ */
+ toString() {
+ return JSON.stringify(this.toJSON());
+ }
+ };
+
+ SourceMapGenerator$2.prototype._version = 3;
+ sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$2;
+
+ var sourceMapConsumer = {};
+
+ var binarySearch$1 = {};
+
+ (function (exports) {
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ exports.GREATEST_LOWER_BOUND = 1;
+ exports.LEAST_UPPER_BOUND = 2;
+
+ /**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ */
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the index of
+ // the next-closest element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element than the one we are searching for, so we return -1.
+ const mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ const cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return mid;
+ } else if (cmp > 0) {
+ // Our needle is greater than aHaystack[mid].
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return aHigh < aHaystack.length ? aHigh : -1;
+ }
+ return mid;
+ }
+
+ // Our needle is less than aHaystack[mid].
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return mid;
+ }
+ return aLow < 0 ? -1 : aLow;
+ }
+
+ /**
+ * This is an implementation of binary search which will always try and return
+ * the index of the closest element if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
+ */
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
+ if (aHaystack.length === 0) {
+ return -1;
+ }
+
+ let index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
+ aCompare, aBias || exports.GREATEST_LOWER_BOUND);
+ if (index < 0) {
+ return -1;
+ }
+
+ // We have found either the exact element, or the next-closest element than
+ // the one we are searching for. However, there may be more than one such
+ // element. Make sure we always return the smallest of these.
+ while (index - 1 >= 0) {
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
+ break;
+ }
+ --index;
+ }
+
+ return index;
+ };
+ } (binarySearch$1));
+
+ var readWasmExports = {};
+ var readWasm$2 = {
+ get exports(){ return readWasmExports; },
+ set exports(v){ readWasmExports = v; },
+ };
+
+ var empty = {};
+
+ var empty$1 = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ default: empty
+ });
+
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(empty$1);
+
+ // Copyright Joyent, Inc. and other Node contributors.
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining a
+ // copy of this software and associated documentation files (the
+ // "Software"), to deal in the Software without restriction, including
+ // without limitation the rights to use, copy, modify, merge, publish,
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
+ // persons to whom the Software is furnished to do so, subject to the
+ // following conditions:
+ //
+ // The above copyright notice and this permission notice shall be included
+ // in all copies or substantial portions of the Software.
+ //
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ // resolves . and .. elements in a path array with directory names there
+ // must be no slashes, empty elements, or device names (c:\) in the array
+ // (so also no leading and trailing slashes - it does not distinguish
+ // relative and absolute paths)
+ function normalizeArray(parts, allowAboveRoot) {
+ // if the path tries to go above the root, `up` ends up > 0
+ var up = 0;
+ for (var i = parts.length - 1; i >= 0; i--) {
+ var last = parts[i];
+ if (last === '.') {
+ parts.splice(i, 1);
+ } else if (last === '..') {
+ parts.splice(i, 1);
+ up++;
+ } else if (up) {
+ parts.splice(i, 1);
+ up--;
+ }
+ }
+
+ // if the path is allowed to go above the root, restore leading ..s
+ if (allowAboveRoot) {
+ for (; up--; up) {
+ parts.unshift('..');
+ }
+ }
+
+ return parts;
+ }
+
+ // Split a filename into [root, dir, basename, ext], unix version
+ // 'root' is just a slash, or nothing.
+ var splitPathRe =
+ /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
+ var splitPath = function(filename) {
+ return splitPathRe.exec(filename).slice(1);
+ };
+
+ // path.resolve([from ...], to)
+ // posix version
+ function resolve() {
+ var resolvedPath = '',
+ resolvedAbsolute = false;
+
+ for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
+ var path = (i >= 0) ? arguments[i] : '/';
+
+ // Skip empty and invalid entries
+ if (typeof path !== 'string') {
+ throw new TypeError('Arguments to path.resolve must be strings');
+ } else if (!path) {
+ continue;
+ }
+
+ resolvedPath = path + '/' + resolvedPath;
+ resolvedAbsolute = path.charAt(0) === '/';
+ }
+
+ // At this point the path should be resolved to a full absolute path, but
+ // handle relative paths to be safe (might happen when process.cwd() fails)
+
+ // Normalize the path
+ resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
+ return !!p;
+ }), !resolvedAbsolute).join('/');
+
+ return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
+ }
+ // path.normalize(path)
+ // posix version
+ function normalize(path) {
+ var isPathAbsolute = isAbsolute(path),
+ trailingSlash = substr(path, -1) === '/';
+
+ // Normalize the path
+ path = normalizeArray(filter(path.split('/'), function(p) {
+ return !!p;
+ }), !isPathAbsolute).join('/');
+
+ if (!path && !isPathAbsolute) {
+ path = '.';
+ }
+ if (path && trailingSlash) {
+ path += '/';
+ }
+
+ return (isPathAbsolute ? '/' : '') + path;
+ }
+ // posix version
+ function isAbsolute(path) {
+ return path.charAt(0) === '/';
+ }
+
+ // posix version
+ function join() {
+ var paths = Array.prototype.slice.call(arguments, 0);
+ return normalize(filter(paths, function(p, index) {
+ if (typeof p !== 'string') {
+ throw new TypeError('Arguments to path.join must be strings');
+ }
+ return p;
+ }).join('/'));
+ }
+
+
+ // path.relative(from, to)
+ // posix version
+ function relative(from, to) {
+ from = resolve(from).substr(1);
+ to = resolve(to).substr(1);
+
+ function trim(arr) {
+ var start = 0;
+ for (; start < arr.length; start++) {
+ if (arr[start] !== '') break;
+ }
+
+ var end = arr.length - 1;
+ for (; end >= 0; end--) {
+ if (arr[end] !== '') break;
+ }
+
+ if (start > end) return [];
+ return arr.slice(start, end - start + 1);
+ }
+
+ var fromParts = trim(from.split('/'));
+ var toParts = trim(to.split('/'));
+
+ var length = Math.min(fromParts.length, toParts.length);
+ var samePartsLength = length;
+ for (var i = 0; i < length; i++) {
+ if (fromParts[i] !== toParts[i]) {
+ samePartsLength = i;
+ break;
+ }
+ }
+
+ var outputParts = [];
+ for (var i = samePartsLength; i < fromParts.length; i++) {
+ outputParts.push('..');
+ }
+
+ outputParts = outputParts.concat(toParts.slice(samePartsLength));
+
+ return outputParts.join('/');
+ }
+
+ var sep = '/';
+ var delimiter = ':';
+
+ function dirname(path) {
+ var result = splitPath(path),
+ root = result[0],
+ dir = result[1];
+
+ if (!root && !dir) {
+ // No dirname whatsoever
+ return '.';
+ }
+
+ if (dir) {
+ // It has a dirname, strip trailing slash
+ dir = dir.substr(0, dir.length - 1);
+ }
+
+ return root + dir;
+ }
+
+ function basename(path, ext) {
+ var f = splitPath(path)[2];
+ // TODO: make this comparison case-insensitive on windows?
+ if (ext && f.substr(-1 * ext.length) === ext) {
+ f = f.substr(0, f.length - ext.length);
+ }
+ return f;
+ }
+
+
+ function extname(path) {
+ return splitPath(path)[3];
+ }
+ var path = {
+ extname: extname,
+ basename: basename,
+ dirname: dirname,
+ sep: sep,
+ delimiter: delimiter,
+ relative: relative,
+ join: join,
+ isAbsolute: isAbsolute,
+ normalize: normalize,
+ resolve: resolve
+ };
+ function filter (xs, f) {
+ if (xs.filter) return xs.filter(f);
+ var res = [];
+ for (var i = 0; i < xs.length; i++) {
+ if (f(xs[i], i, xs)) res.push(xs[i]);
+ }
+ return res;
+ }
+
+ // String.prototype.substr - negative index don't work in IE8
+ var substr = 'ab'.substr(-1) === 'b' ?
+ function (str, start, len) { return str.substr(start, len) } :
+ function (str, start, len) {
+ if (start < 0) start = str.length + start;
+ return str.substr(start, len);
+ }
+ ;
+
+ var path$1 = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ basename: basename,
+ default: path,
+ delimiter: delimiter,
+ dirname: dirname,
+ extname: extname,
+ isAbsolute: isAbsolute,
+ join: join,
+ normalize: normalize,
+ relative: relative,
+ resolve: resolve,
+ sep: sep
+ });
+
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(path$1);
+
+ const isBrowserEnvironment = (function() {
+ // eslint-disable-next-line no-undef
+ return (typeof window !== "undefined") && (this === window);
+ }).call();
+
+ if (isBrowserEnvironment) {
+ // Web version of reading a wasm file into an array buffer.
+
+ let mappingsWasm = null;
+
+ readWasm$2.exports = function readWasm() {
+ if (typeof mappingsWasm === "string") {
+ return fetch(mappingsWasm)
+ .then(response => response.arrayBuffer());
+ }
+ if (mappingsWasm instanceof ArrayBuffer) {
+ return Promise.resolve(mappingsWasm);
+ }
+ throw new Error("You must provide the string URL or ArrayBuffer contents " +
+ "of lib/mappings.wasm by calling " +
+ "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " +
+ "before using SourceMapConsumer");
+ };
+
+ readWasmExports.initialize = input => mappingsWasm = input;
+ } else {
+ // Node version of reading a wasm file into an array buffer.
+ const fs = require$$0;
+ const path = require$$1;
+
+ readWasm$2.exports = function readWasm() {
+ return new Promise((resolve, reject) => {
+ const wasmPath = path.join(__dirname, "mappings.wasm");
+ fs.readFile(wasmPath, null, (error, data) => {
+ if (error) {
+ reject(error);
+ return;
+ }
+
+ resolve(data.buffer);
+ });
+ });
+ };
+
+ readWasmExports.initialize = _ => {
+ console.debug("SourceMapConsumer.initialize is a no-op when running in node.js");
+ };
+ }
+
+ const readWasm$1 = readWasmExports;
+
+ /**
+ * Provide the JIT with a nice shape / hidden class.
+ */
+ function Mapping() {
+ this.generatedLine = 0;
+ this.generatedColumn = 0;
+ this.lastGeneratedColumn = null;
+ this.source = null;
+ this.originalLine = null;
+ this.originalColumn = null;
+ this.name = null;
+ }
+
+ let cachedWasm = null;
+
+ var wasm$1 = function wasm() {
+ if (cachedWasm) {
+ return cachedWasm;
+ }
+
+ const callbackStack = [];
+
+ cachedWasm = readWasm$1().then(buffer => {
+ return WebAssembly.instantiate(buffer, {
+ env: {
+ mapping_callback(
+ generatedLine,
+ generatedColumn,
+
+ hasLastGeneratedColumn,
+ lastGeneratedColumn,
+
+ hasOriginal,
+ source,
+ originalLine,
+ originalColumn,
+
+ hasName,
+ name
+ ) {
+ const mapping = new Mapping();
+ // JS uses 1-based line numbers, wasm uses 0-based.
+ mapping.generatedLine = generatedLine + 1;
+ mapping.generatedColumn = generatedColumn;
+
+ if (hasLastGeneratedColumn) {
+ // JS uses inclusive last generated column, wasm uses exclusive.
+ mapping.lastGeneratedColumn = lastGeneratedColumn - 1;
+ }
+
+ if (hasOriginal) {
+ mapping.source = source;
+ // JS uses 1-based line numbers, wasm uses 0-based.
+ mapping.originalLine = originalLine + 1;
+ mapping.originalColumn = originalColumn;
+
+ if (hasName) {
+ mapping.name = name;
+ }
+ }
+
+ callbackStack[callbackStack.length - 1](mapping);
+ },
+
+ start_all_generated_locations_for() { console.time("all_generated_locations_for"); },
+ end_all_generated_locations_for() { console.timeEnd("all_generated_locations_for"); },
+
+ start_compute_column_spans() { console.time("compute_column_spans"); },
+ end_compute_column_spans() { console.timeEnd("compute_column_spans"); },
+
+ start_generated_location_for() { console.time("generated_location_for"); },
+ end_generated_location_for() { console.timeEnd("generated_location_for"); },
+
+ start_original_location_for() { console.time("original_location_for"); },
+ end_original_location_for() { console.timeEnd("original_location_for"); },
+
+ start_parse_mappings() { console.time("parse_mappings"); },
+ end_parse_mappings() { console.timeEnd("parse_mappings"); },
+
+ start_sort_by_generated_location() { console.time("sort_by_generated_location"); },
+ end_sort_by_generated_location() { console.timeEnd("sort_by_generated_location"); },
+
+ start_sort_by_original_location() { console.time("sort_by_original_location"); },
+ end_sort_by_original_location() { console.timeEnd("sort_by_original_location"); },
+ }
+ });
+ }).then(Wasm => {
+ return {
+ exports: Wasm.instance.exports,
+ withMappingCallback: (mappingCallback, f) => {
+ callbackStack.push(mappingCallback);
+ try {
+ f();
+ } finally {
+ callbackStack.pop();
+ }
+ }
+ };
+ }).then(null, e => {
+ cachedWasm = null;
+ throw e;
+ });
+
+ return cachedWasm;
+ };
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ const util$1 = util$4;
+ const binarySearch = binarySearch$1;
+ const ArraySet = arraySet.ArraySet;
+ const readWasm = readWasmExports;
+ const wasm = wasm$1;
+
+ const INTERNAL = Symbol("smcInternal");
+
+ class SourceMapConsumer {
+ constructor(aSourceMap, aSourceMapURL) {
+ // If the constructor was called by super(), just return Promise<this>.
+ // Yes, this is a hack to retain the pre-existing API of the base-class
+ // constructor also being an async factory function.
+ if (aSourceMap == INTERNAL) {
+ return Promise.resolve(this);
+ }
+
+ return _factory(aSourceMap, aSourceMapURL);
+ }
+
+ static initialize(opts) {
+ readWasm.initialize(opts["lib/mappings.wasm"]);
+ }
+
+ static fromSourceMap(aSourceMap, aSourceMapURL) {
+ return _factoryBSM(aSourceMap, aSourceMapURL);
+ }
+
+ /**
+ * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
+ * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
+ * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
+ * for `f` to complete, call `destroy` on the consumer, and return `f`'s return
+ * value.
+ *
+ * You must not use the consumer after `f` completes!
+ *
+ * By using `with`, you do not have to remember to manually call `destroy` on
+ * the consumer, since it will be called automatically once `f` completes.
+ *
+ * ```js
+ * const xSquared = await SourceMapConsumer.with(
+ * myRawSourceMap,
+ * null,
+ * async function (consumer) {
+ * // Use `consumer` inside here and don't worry about remembering
+ * // to call `destroy`.
+ *
+ * const x = await whatever(consumer);
+ * return x * x;
+ * }
+ * );
+ *
+ * // You may not use that `consumer` anymore out here; it has
+ * // been destroyed. But you can use `xSquared`.
+ * console.log(xSquared);
+ * ```
+ */
+ static async with(rawSourceMap, sourceMapUrl, f) {
+ const consumer = await new SourceMapConsumer(rawSourceMap, sourceMapUrl);
+ try {
+ return await f(consumer);
+ } finally {
+ consumer.destroy();
+ }
+ }
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ _parseMappings(aStr, aSourceRoot) {
+ throw new Error("Subclasses must implement _parseMappings");
+ }
+
+ /**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+ eachMapping(aCallback, aContext, aOrder) {
+ throw new Error("Subclasses must implement eachMapping");
+ }
+
+ /**
+ * Returns all generated line and column information for the original source,
+ * line, and column provided. If no column is provided, returns all mappings
+ * corresponding to a either the line we are searching for or the next
+ * closest line that has any mappings. Otherwise, returns all mappings
+ * corresponding to the given line and either the column we are searching for
+ * or the next closest column that has any offsets.
+ *
+ * The only argument is an object with the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source. The line number is 1-based.
+ * - column: Optional. the column number in the original source.
+ * The column number is 0-based.
+ *
+ * and an array of objects is returned, each with the following properties:
+ *
+ * - line: The line number in the generated source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the generated source, or null.
+ * The column number is 0-based.
+ */
+ allGeneratedPositionsFor(aArgs) {
+ throw new Error("Subclasses must implement allGeneratedPositionsFor");
+ }
+
+ destroy() {
+ throw new Error("Subclasses must implement destroy");
+ }
+ }
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ SourceMapConsumer.prototype._version = 3;
+ SourceMapConsumer.GENERATED_ORDER = 1;
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
+
+ sourceMapConsumer.SourceMapConsumer = SourceMapConsumer;
+
+ /**
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The first parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * The second parameter, if given, is a string whose value is the URL
+ * at which the source map was found. This URL is used to compute the
+ * sources array.
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+ class BasicSourceMapConsumer extends SourceMapConsumer {
+ constructor(aSourceMap, aSourceMapURL) {
+ return super(INTERNAL).then(that => {
+ let sourceMap = aSourceMap;
+ if (typeof aSourceMap === "string") {
+ sourceMap = util$1.parseSourceMapInput(aSourceMap);
+ }
+
+ const version = util$1.getArg(sourceMap, "version");
+ let sources = util$1.getArg(sourceMap, "sources");
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ const names = util$1.getArg(sourceMap, "names", []);
+ let sourceRoot = util$1.getArg(sourceMap, "sourceRoot", null);
+ const sourcesContent = util$1.getArg(sourceMap, "sourcesContent", null);
+ const mappings = util$1.getArg(sourceMap, "mappings");
+ const file = util$1.getArg(sourceMap, "file", null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != that._version) {
+ throw new Error("Unsupported version: " + version);
+ }
+
+ if (sourceRoot) {
+ sourceRoot = util$1.normalize(sourceRoot);
+ }
+
+ sources = sources
+ .map(String)
+ // Some source maps produce relative source paths like "./foo.js" instead of
+ // "foo.js". Normalize these first so that future comparisons will succeed.
+ // See bugzil.la/1090768.
+ .map(util$1.normalize)
+ // Always ensure that absolute sources are internally stored relative to
+ // the source root, if the source root is absolute. Not doing this would
+ // be particularly problematic when the source root is a prefix of the
+ // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
+ .map(function(source) {
+ return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source)
+ ? util$1.relative(sourceRoot, source)
+ : source;
+ });
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ that._names = ArraySet.fromArray(names.map(String), true);
+ that._sources = ArraySet.fromArray(sources, true);
+
+ that._absoluteSources = that._sources.toArray().map(function(s) {
+ return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL);
+ });
+
+ that.sourceRoot = sourceRoot;
+ that.sourcesContent = sourcesContent;
+ that._mappings = mappings;
+ that._sourceMapURL = aSourceMapURL;
+ that.file = file;
+
+ that._computedColumnSpans = false;
+ that._mappingsPtr = 0;
+ that._wasm = null;
+
+ return wasm().then(w => {
+ that._wasm = w;
+ return that;
+ });
+ });
+ }
+
+ /**
+ * Utility function to find the index of a source. Returns -1 if not
+ * found.
+ */
+ _findSourceIndex(aSource) {
+ let relativeSource = aSource;
+ if (this.sourceRoot != null) {
+ relativeSource = util$1.relative(this.sourceRoot, relativeSource);
+ }
+
+ if (this._sources.has(relativeSource)) {
+ return this._sources.indexOf(relativeSource);
+ }
+
+ // Maybe aSource is an absolute URL as returned by |sources|. In
+ // this case we can't simply undo the transform.
+ for (let i = 0; i < this._absoluteSources.length; ++i) {
+ if (this._absoluteSources[i] == aSource) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @param String aSourceMapURL
+ * The URL at which the source map can be found (optional)
+ * @returns BasicSourceMapConsumer
+ */
+ static fromSourceMap(aSourceMap, aSourceMapURL) {
+ return new BasicSourceMapConsumer(aSourceMap.toString());
+ }
+
+ get sources() {
+ return this._absoluteSources.slice();
+ }
+
+ _getMappingsPtr() {
+ if (this._mappingsPtr === 0) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this._mappingsPtr;
+ }
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ _parseMappings(aStr, aSourceRoot) {
+ const size = aStr.length;
+
+ const mappingsBufPtr = this._wasm.exports.allocate_mappings(size);
+ const mappingsBuf = new Uint8Array(this._wasm.exports.memory.buffer, mappingsBufPtr, size);
+ for (let i = 0; i < size; i++) {
+ mappingsBuf[i] = aStr.charCodeAt(i);
+ }
+
+ const mappingsPtr = this._wasm.exports.parse_mappings(mappingsBufPtr);
+
+ if (!mappingsPtr) {
+ const error = this._wasm.exports.get_last_error();
+ let msg = `Error parsing mappings (code ${error}): `;
+
+ // XXX: keep these error codes in sync with `fitzgen/source-map-mappings`.
+ switch (error) {
+ case 1:
+ msg += "the mappings contained a negative line, column, source index, or name index";
+ break;
+ case 2:
+ msg += "the mappings contained a number larger than 2**32";
+ break;
+ case 3:
+ msg += "reached EOF while in the middle of parsing a VLQ";
+ break;
+ case 4:
+ msg += "invalid base 64 character while parsing a VLQ";
+ break;
+ default:
+ msg += "unknown error code";
+ break;
+ }
+
+ throw new Error(msg);
+ }
+
+ this._mappingsPtr = mappingsPtr;
+ }
+
+ eachMapping(aCallback, aContext, aOrder) {
+ const context = aContext || null;
+ const order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+ const sourceRoot = this.sourceRoot;
+
+ this._wasm.withMappingCallback(
+ mapping => {
+ if (mapping.source !== null) {
+ mapping.source = this._sources.at(mapping.source);
+ mapping.source = util$1.computeSourceURL(sourceRoot, mapping.source, this._sourceMapURL);
+
+ if (mapping.name !== null) {
+ mapping.name = this._names.at(mapping.name);
+ }
+ }
+
+ aCallback.call(context, mapping);
+ },
+ () => {
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ this._wasm.exports.by_generated_location(this._getMappingsPtr());
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ this._wasm.exports.by_original_location(this._getMappingsPtr());
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+ }
+ );
+ }
+
+ allGeneratedPositionsFor(aArgs) {
+ let source = util$1.getArg(aArgs, "source");
+ const originalLine = util$1.getArg(aArgs, "line");
+ const originalColumn = aArgs.column || 0;
+
+ source = this._findSourceIndex(source);
+ if (source < 0) {
+ return [];
+ }
+
+ if (originalLine < 1) {
+ throw new Error("Line numbers must be >= 1");
+ }
+
+ if (originalColumn < 0) {
+ throw new Error("Column numbers must be >= 0");
+ }
+
+ const mappings = [];
+
+ this._wasm.withMappingCallback(
+ m => {
+ let lastColumn = m.lastGeneratedColumn;
+ if (this._computedColumnSpans && lastColumn === null) {
+ lastColumn = Infinity;
+ }
+ mappings.push({
+ line: m.generatedLine,
+ column: m.generatedColumn,
+ lastColumn,
+ });
+ }, () => {
+ this._wasm.exports.all_generated_locations_for(
+ this._getMappingsPtr(),
+ source,
+ originalLine - 1,
+ "column" in aArgs,
+ originalColumn
+ );
+ }
+ );
+
+ return mappings;
+ }
+
+ destroy() {
+ if (this._mappingsPtr !== 0) {
+ this._wasm.exports.free_mappings(this._mappingsPtr);
+ this._mappingsPtr = 0;
+ }
+ }
+
+ /**
+ * Compute the last column for each generated mapping. The last column is
+ * inclusive.
+ */
+ computeColumnSpans() {
+ if (this._computedColumnSpans) {
+ return;
+ }
+
+ this._wasm.exports.compute_column_spans(this._getMappingsPtr());
+ this._computedColumnSpans = true;
+ }
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source. The line number
+ * is 1-based.
+ * - column: The column number in the generated source. The column
+ * number is 0-based.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the original source, or null. The
+ * column number is 0-based.
+ * - name: The original identifier, or null.
+ */
+ originalPositionFor(aArgs) {
+ const needle = {
+ generatedLine: util$1.getArg(aArgs, "line"),
+ generatedColumn: util$1.getArg(aArgs, "column")
+ };
+
+ if (needle.generatedLine < 1) {
+ throw new Error("Line numbers must be >= 1");
+ }
+
+ if (needle.generatedColumn < 0) {
+ throw new Error("Column numbers must be >= 0");
+ }
+
+ let bias = util$1.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND);
+ if (bias == null) {
+ bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
+ }
+
+ let mapping;
+ this._wasm.withMappingCallback(m => mapping = m, () => {
+ this._wasm.exports.original_location_for(
+ this._getMappingsPtr(),
+ needle.generatedLine - 1,
+ needle.generatedColumn,
+ bias
+ );
+ });
+
+ if (mapping) {
+ if (mapping.generatedLine === needle.generatedLine) {
+ let source = util$1.getArg(mapping, "source", null);
+ if (source !== null) {
+ source = this._sources.at(source);
+ source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
+ }
+
+ let name = util$1.getArg(mapping, "name", null);
+ if (name !== null) {
+ name = this._names.at(name);
+ }
+
+ return {
+ source,
+ line: util$1.getArg(mapping, "originalLine", null),
+ column: util$1.getArg(mapping, "originalColumn", null),
+ name
+ };
+ }
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ }
+
+ /**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+ hasContentsOfAllSources() {
+ if (!this.sourcesContent) {
+ return false;
+ }
+ return this.sourcesContent.length >= this._sources.size() &&
+ !this.sourcesContent.some(function(sc) { return sc == null; });
+ }
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+ sourceContentFor(aSource, nullOnMissing) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ const index = this._findSourceIndex(aSource);
+ if (index >= 0) {
+ return this.sourcesContent[index];
+ }
+
+ let relativeSource = aSource;
+ if (this.sourceRoot != null) {
+ relativeSource = util$1.relative(this.sourceRoot, relativeSource);
+ }
+
+ let url;
+ if (this.sourceRoot != null
+ && (url = util$1.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ const fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + relativeSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
+ }
+ }
+
+ // This function is used recursively from
+ // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
+ // don't want to throw if we can't find the source - we just want to
+ // return null, so we provide a flag to exit gracefully.
+ if (nullOnMissing) {
+ return null;
+ }
+
+ throw new Error('"' + relativeSource + '" is not in the SourceMap.');
+ }
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source. The line number
+ * is 1-based.
+ * - column: The column number in the original source. The column
+ * number is 0-based.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the generated source, or null.
+ * The column number is 0-based.
+ */
+ generatedPositionFor(aArgs) {
+ let source = util$1.getArg(aArgs, "source");
+ source = this._findSourceIndex(source);
+ if (source < 0) {
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ }
+
+ const needle = {
+ source,
+ originalLine: util$1.getArg(aArgs, "line"),
+ originalColumn: util$1.getArg(aArgs, "column")
+ };
+
+ if (needle.originalLine < 1) {
+ throw new Error("Line numbers must be >= 1");
+ }
+
+ if (needle.originalColumn < 0) {
+ throw new Error("Column numbers must be >= 0");
+ }
+
+ let bias = util$1.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND);
+ if (bias == null) {
+ bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
+ }
+
+ let mapping;
+ this._wasm.withMappingCallback(m => mapping = m, () => {
+ this._wasm.exports.generated_location_for(
+ this._getMappingsPtr(),
+ needle.source,
+ needle.originalLine - 1,
+ needle.originalColumn,
+ bias
+ );
+ });
+
+ if (mapping) {
+ if (mapping.source === needle.source) {
+ let lastColumn = mapping.lastGeneratedColumn;
+ if (this._computedColumnSpans && lastColumn === null) {
+ lastColumn = Infinity;
+ }
+ return {
+ line: util$1.getArg(mapping, "generatedLine", null),
+ column: util$1.getArg(mapping, "generatedColumn", null),
+ lastColumn,
+ };
+ }
+ }
+
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ }
+ }
+
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
+ sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer;
+
+ /**
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
+ * we can query for information. It differs from BasicSourceMapConsumer in
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
+ * input.
+ *
+ * The first parameter is a raw source map (either as a JSON string, or already
+ * parsed to an object). According to the spec for indexed source maps, they
+ * have the following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - file: Optional. The generated file this source map is associated with.
+ * - sections: A list of section definitions.
+ *
+ * Each value under the "sections" field has two fields:
+ * - offset: The offset into the original specified at which this section
+ * begins to apply, defined as an object with a "line" and "column"
+ * field.
+ * - map: A source map definition. This source map could also be indexed,
+ * but doesn't have to be.
+ *
+ * Instead of the "map" field, it's also possible to have a "url" field
+ * specifying a URL to retrieve a source map from, but that's currently
+ * unsupported.
+ *
+ * Here's an example source map, taken from the source map spec[0], but
+ * modified to omit a section which uses the "url" field.
+ *
+ * {
+ * version : 3,
+ * file: "app.js",
+ * sections: [{
+ * offset: {line:100, column:10},
+ * map: {
+ * version : 3,
+ * file: "section.js",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AAAA,E;;ABCDE;"
+ * }
+ * }],
+ * }
+ *
+ * The second parameter, if given, is a string whose value is the URL
+ * at which the source map was found. This URL is used to compute the
+ * sources array.
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
+ */
+ class IndexedSourceMapConsumer extends SourceMapConsumer {
+ constructor(aSourceMap, aSourceMapURL) {
+ return super(INTERNAL).then(that => {
+ let sourceMap = aSourceMap;
+ if (typeof aSourceMap === "string") {
+ sourceMap = util$1.parseSourceMapInput(aSourceMap);
+ }
+
+ const version = util$1.getArg(sourceMap, "version");
+ const sections = util$1.getArg(sourceMap, "sections");
+
+ if (version != that._version) {
+ throw new Error("Unsupported version: " + version);
+ }
+
+ that._sources = new ArraySet();
+ that._names = new ArraySet();
+ that.__generatedMappings = null;
+ that.__originalMappings = null;
+ that.__generatedMappingsUnsorted = null;
+ that.__originalMappingsUnsorted = null;
+
+ let lastOffset = {
+ line: -1,
+ column: 0
+ };
+ return Promise.all(sections.map(s => {
+ if (s.url) {
+ // The url field will require support for asynchronicity.
+ // See https://github.com/mozilla/source-map/issues/16
+ throw new Error("Support for url field in sections not implemented.");
+ }
+ const offset = util$1.getArg(s, "offset");
+ const offsetLine = util$1.getArg(offset, "line");
+ const offsetColumn = util$1.getArg(offset, "column");
+
+ if (offsetLine < lastOffset.line ||
+ (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
+ throw new Error("Section offsets must be ordered and non-overlapping.");
+ }
+ lastOffset = offset;
+
+ const cons = new SourceMapConsumer(util$1.getArg(s, "map"), aSourceMapURL);
+ return cons.then(consumer => {
+ return {
+ generatedOffset: {
+ // The offset fields are 0-based, but we use 1-based indices when
+ // encoding/decoding from VLQ.
+ generatedLine: offsetLine + 1,
+ generatedColumn: offsetColumn + 1
+ },
+ consumer
+ };
+ });
+ })).then(s => {
+ that._sections = s;
+ return that;
+ });
+ });
+ }
+
+ // `__generatedMappings` and `__originalMappings` are arrays that hold the
+ // parsed mapping coordinates from the source map's "mappings" attribute. They
+ // are lazily instantiated, accessed via the `_generatedMappings` and
+ // `_originalMappings` getters respectively, and we only parse the mappings
+ // and create these arrays once queried for a source location. We jump through
+ // these hoops because there can be many thousands of mappings, and parsing
+ // them is expensive, so we only want to do it if we must.
+ //
+ // Each object in the arrays is of the form:
+ //
+ // {
+ // generatedLine: The line number in the generated code,
+ // generatedColumn: The column number in the generated code,
+ // source: The path to the original source file that generated this
+ // chunk of code,
+ // originalLine: The line number in the original source that
+ // corresponds to this chunk of generated code,
+ // originalColumn: The column number in the original source that
+ // corresponds to this chunk of generated code,
+ // name: The name of the original symbol which generated this chunk of
+ // code.
+ // }
+ //
+ // All properties except for `generatedLine` and `generatedColumn` can be
+ // `null`.
+ //
+ // `_generatedMappings` is ordered by the generated positions.
+ //
+ // `_originalMappings` is ordered by the original positions.
+ get _generatedMappings() {
+ if (!this.__generatedMappings) {
+ this._sortGeneratedMappings();
+ }
+
+ return this.__generatedMappings;
+ }
+
+ get _originalMappings() {
+ if (!this.__originalMappings) {
+ this._sortOriginalMappings();
+ }
+
+ return this.__originalMappings;
+ }
+
+ get _generatedMappingsUnsorted() {
+ if (!this.__generatedMappingsUnsorted) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappingsUnsorted;
+ }
+
+ get _originalMappingsUnsorted() {
+ if (!this.__originalMappingsUnsorted) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappingsUnsorted;
+ }
+
+ _sortGeneratedMappings() {
+ const mappings = this._generatedMappingsUnsorted;
+ mappings.sort(util$1.compareByGeneratedPositionsDeflated);
+ this.__generatedMappings = mappings;
+ }
+
+ _sortOriginalMappings() {
+ const mappings = this._originalMappingsUnsorted;
+ mappings.sort(util$1.compareByOriginalPositions);
+ this.__originalMappings = mappings;
+ }
+
+ /**
+ * The list of original sources.
+ */
+ get sources() {
+ const sources = [];
+ for (let i = 0; i < this._sections.length; i++) {
+ for (let j = 0; j < this._sections[i].consumer.sources.length; j++) {
+ sources.push(this._sections[i].consumer.sources[j]);
+ }
+ }
+ return sources;
+ }
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source. The line number
+ * is 1-based.
+ * - column: The column number in the generated source. The column
+ * number is 0-based.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the original source, or null. The
+ * column number is 0-based.
+ * - name: The original identifier, or null.
+ */
+ originalPositionFor(aArgs) {
+ const needle = {
+ generatedLine: util$1.getArg(aArgs, "line"),
+ generatedColumn: util$1.getArg(aArgs, "column")
+ };
+
+ // Find the section containing the generated position we're trying to map
+ // to an original position.
+ const sectionIndex = binarySearch.search(needle, this._sections,
+ function(aNeedle, section) {
+ const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return (aNeedle.generatedColumn -
+ section.generatedOffset.generatedColumn);
+ });
+ const section = this._sections[sectionIndex];
+
+ if (!section) {
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ }
+
+ return section.consumer.originalPositionFor({
+ line: needle.generatedLine -
+ (section.generatedOffset.generatedLine - 1),
+ column: needle.generatedColumn -
+ (section.generatedOffset.generatedLine === needle.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ bias: aArgs.bias
+ });
+ }
+
+ /**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+ hasContentsOfAllSources() {
+ return this._sections.every(function(s) {
+ return s.consumer.hasContentsOfAllSources();
+ });
+ }
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+ sourceContentFor(aSource, nullOnMissing) {
+ for (let i = 0; i < this._sections.length; i++) {
+ const section = this._sections[i];
+
+ const content = section.consumer.sourceContentFor(aSource, true);
+ if (content) {
+ return content;
+ }
+ }
+ if (nullOnMissing) {
+ return null;
+ }
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source. The line number
+ * is 1-based.
+ * - column: The column number in the original source. The column
+ * number is 0-based.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the generated source, or null.
+ * The column number is 0-based.
+ */
+ generatedPositionFor(aArgs) {
+ for (let i = 0; i < this._sections.length; i++) {
+ const section = this._sections[i];
+
+ // Only consider this section if the requested source is in the list of
+ // sources of the consumer.
+ if (section.consumer._findSourceIndex(util$1.getArg(aArgs, "source")) === -1) {
+ continue;
+ }
+ const generatedPosition = section.consumer.generatedPositionFor(aArgs);
+ if (generatedPosition) {
+ const ret = {
+ line: generatedPosition.line +
+ (section.generatedOffset.generatedLine - 1),
+ column: generatedPosition.column +
+ (section.generatedOffset.generatedLine === generatedPosition.line
+ ? section.generatedOffset.generatedColumn - 1
+ : 0)
+ };
+ return ret;
+ }
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ }
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ _parseMappings(aStr, aSourceRoot) {
+ const generatedMappings = this.__generatedMappingsUnsorted = [];
+ const originalMappings = this.__originalMappingsUnsorted = [];
+ for (let i = 0; i < this._sections.length; i++) {
+ const section = this._sections[i];
+
+ const sectionMappings = [];
+ section.consumer.eachMapping(m => sectionMappings.push(m));
+
+ for (let j = 0; j < sectionMappings.length; j++) {
+ const mapping = sectionMappings[j];
+
+ // TODO: test if null is correct here. The original code used
+ // `source`, which would actually have gotten used as null because
+ // var's get hoisted.
+ // See: https://github.com/mozilla/source-map/issues/333
+ let source = util$1.computeSourceURL(section.consumer.sourceRoot, null, this._sourceMapURL);
+ this._sources.add(source);
+ source = this._sources.indexOf(source);
+
+ let name = null;
+ if (mapping.name) {
+ this._names.add(mapping.name);
+ name = this._names.indexOf(mapping.name);
+ }
+
+ // The mappings coming from the consumer for the section have
+ // generated positions relative to the start of the section, so we
+ // need to offset them to be relative to the start of the concatenated
+ // generated file.
+ const adjustedMapping = {
+ source,
+ generatedLine: mapping.generatedLine +
+ (section.generatedOffset.generatedLine - 1),
+ generatedColumn: mapping.generatedColumn +
+ (section.generatedOffset.generatedLine === mapping.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name
+ };
+
+ generatedMappings.push(adjustedMapping);
+ if (typeof adjustedMapping.originalLine === "number") {
+ originalMappings.push(adjustedMapping);
+ }
+ }
+ }
+ }
+
+ eachMapping(aCallback, aContext, aOrder) {
+ const context = aContext || null;
+ const order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ let mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ const sourceRoot = this.sourceRoot;
+ mappings.map(function(mapping) {
+ let source = null;
+ if (mapping.source !== null) {
+ source = this._sources.at(mapping.source);
+ source = util$1.computeSourceURL(sourceRoot, source, this._sourceMapURL);
+ }
+ return {
+ source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name === null ? null : this._names.at(mapping.name)
+ };
+ }, this).forEach(aCallback, context);
+ }
+
+ /**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+ _findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator, aBias) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError("Line must be greater than or equal to 1, got "
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError("Column must be greater than or equal to 0, got "
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
+ }
+
+ allGeneratedPositionsFor(aArgs) {
+ const line = util$1.getArg(aArgs, "line");
+
+ // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
+ // returns the index of the closest mapping less than the needle. By
+ // setting needle.originalColumn to 0, we thus find the last mapping for
+ // the given line, provided such a mapping exists.
+ const needle = {
+ source: util$1.getArg(aArgs, "source"),
+ originalLine: line,
+ originalColumn: util$1.getArg(aArgs, "column", 0)
+ };
+
+ needle.source = this._findSourceIndex(needle.source);
+ if (needle.source < 0) {
+ return [];
+ }
+
+ if (needle.originalLine < 1) {
+ throw new Error("Line numbers must be >= 1");
+ }
+
+ if (needle.originalColumn < 0) {
+ throw new Error("Column numbers must be >= 0");
+ }
+
+ const mappings = [];
+
+ let index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util$1.compareByOriginalPositions,
+ binarySearch.LEAST_UPPER_BOUND);
+ if (index >= 0) {
+ let mapping = this._originalMappings[index];
+
+ if (aArgs.column === undefined) {
+ const originalLine = mapping.originalLine;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we found. Since
+ // mappings are sorted, this is guaranteed to find all mappings for
+ // the line we found.
+ while (mapping && mapping.originalLine === originalLine) {
+ let lastColumn = mapping.lastGeneratedColumn;
+ if (this._computedColumnSpans && lastColumn === null) {
+ lastColumn = Infinity;
+ }
+ mappings.push({
+ line: util$1.getArg(mapping, "generatedLine", null),
+ column: util$1.getArg(mapping, "generatedColumn", null),
+ lastColumn,
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ } else {
+ const originalColumn = mapping.originalColumn;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we were searching for.
+ // Since mappings are sorted, this is guaranteed to find all mappings for
+ // the line we are searching for.
+ while (mapping &&
+ mapping.originalLine === line &&
+ mapping.originalColumn == originalColumn) {
+ let lastColumn = mapping.lastGeneratedColumn;
+ if (this._computedColumnSpans && lastColumn === null) {
+ lastColumn = Infinity;
+ }
+ mappings.push({
+ line: util$1.getArg(mapping, "generatedLine", null),
+ column: util$1.getArg(mapping, "generatedColumn", null),
+ lastColumn,
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ }
+ }
+
+ return mappings;
+ }
+
+ destroy() {
+ for (let i = 0; i < this._sections.length; i++) {
+ this._sections[i].consumer.destroy();
+ }
+ }
+ }
+ sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
+
+ /*
+ * Cheat to get around inter-twingled classes. `factory()` can be at the end
+ * where it has access to non-hoisted classes, but it gets hoisted itself.
+ */
+ function _factory(aSourceMap, aSourceMapURL) {
+ let sourceMap = aSourceMap;
+ if (typeof aSourceMap === "string") {
+ sourceMap = util$1.parseSourceMapInput(aSourceMap);
+ }
+
+ const consumer = sourceMap.sections != null
+ ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
+ : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
+ return Promise.resolve(consumer);
+ }
+
+ function _factoryBSM(aSourceMap, aSourceMapURL) {
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
+ }
+
+ var sourceNode = {};
+
+ /*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+ const SourceMapGenerator$1 = sourceMapGenerator.SourceMapGenerator;
+ const util = util$4;
+
+ // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+ // operating systems these days (capturing the result).
+ const REGEX_NEWLINE = /(\r?\n)/;
+
+ // Newline character code for charCodeAt() comparisons
+ const NEWLINE_CODE$1 = 10;
+
+ // Private symbol for identifying `SourceNode`s when multiple versions of
+ // the source-map library are loaded. This MUST NOT CHANGE across
+ // versions!
+ const isSourceNode = "$$$isSourceNode$$$";
+
+ /**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+ class SourceNode {
+ constructor(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine == null ? null : aLine;
+ this.column = aColumn == null ? null : aColumn;
+ this.source = aSource == null ? null : aSource;
+ this.name = aName == null ? null : aName;
+ this[isSourceNode] = true;
+ if (aChunks != null) this.add(aChunks);
+ }
+
+ /**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ * @param aRelativePath Optional. The path that relative sources in the
+ * SourceMapConsumer should be relative to.
+ */
+ static fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ const node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are accessed by calling `shiftNextLine`.
+ const remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ let remainingLinesIndex = 0;
+ const shiftNextLine = function() {
+ const lineContents = getNextLine();
+ // The last line of a file might not have a newline.
+ const newLine = getNextLine() || "";
+ return lineContents + newLine;
+
+ function getNextLine() {
+ return remainingLinesIndex < remainingLines.length ?
+ remainingLines[remainingLinesIndex++] : undefined;
+ }
+ };
+
+ // We need to remember the position of "remainingLines"
+ let lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ let lastMapping = null;
+ let nextLine;
+
+ aSourceMapConsumer.eachMapping(function(mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ nextLine = remainingLines[remainingLinesIndex] || "";
+ const code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ nextLine = remainingLines[remainingLinesIndex] || "";
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLinesIndex < remainingLines.length) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
+ const content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aRelativePath != null) {
+ sourceFile = util.join(aRelativePath, sourceFile);
+ }
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ const source = aRelativePath
+ ? util.join(aRelativePath, mapping.source)
+ : mapping.source;
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ source,
+ code,
+ mapping.name));
+ }
+ }
+ }
+
+ /**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function(chunk) {
+ this.add(chunk);
+ }, this);
+ } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ } else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ }
+
+ /**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (let i = aChunk.length - 1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ } else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ }
+
+ /**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+ walk(aFn) {
+ let chunk;
+ for (let i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk[isSourceNode]) {
+ chunk.walk(aFn);
+ } else if (chunk !== "") {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+
+ /**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+ join(aSep) {
+ let newChildren;
+ let i;
+ const len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len - 1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+ }
+
+ /**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+ replaceRight(aPattern, aReplacement) {
+ const lastChild = this.children[this.children.length - 1];
+ if (lastChild[isSourceNode]) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ } else if (typeof lastChild === "string") {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ } else {
+ this.children.push("".replace(aPattern, aReplacement));
+ }
+ return this;
+ }
+
+ /**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+ setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ }
+
+ /**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+ walkSourceContents(aFn) {
+ for (let i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i][isSourceNode]) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ const sources = Object.keys(this.sourceContents);
+ for (let i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ }
+
+ /**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+ toString() {
+ let str = "";
+ this.walk(function(chunk) {
+ str += chunk;
+ });
+ return str;
+ }
+
+ /**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+ toStringWithSourceMap(aArgs) {
+ const generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ const map = new SourceMapGenerator$1(aArgs);
+ let sourceMappingActive = false;
+ let lastOriginalSource = null;
+ let lastOriginalLine = null;
+ let lastOriginalColumn = null;
+ let lastOriginalName = null;
+ this.walk(function(chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if (lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ for (let idx = 0, length = chunk.length; idx < length; idx++) {
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE$1) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column++;
+ }
+ }
+ });
+ this.walkSourceContents(function(sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map };
+ }
+ }
+
+ sourceNode.SourceNode = SourceNode;
+
+ sourceMap$1.SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
+ sourceMap$1.SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
+ sourceMap$1.SourceNode = sourceNode.SourceNode;
+
+ var workerUtilsExports = {};
+ var workerUtils = {
+ get exports(){ return workerUtilsExports; },
+ set exports(v){ workerUtilsExports = v; },
+ };
+
+ (function (module) {
+
+ class WorkerDispatcher {
+ #msgId = 1;
+ #worker = null;
+ // Map of message ids -> promise resolution functions, for dispatching worker responses
+ #pendingCalls = new Map();
+ #url = "";
+
+ constructor(url) {
+ this.#url = url;
+ }
+
+ start() {
+ // When running in debugger jest test, we don't have access to ChromeWorker
+ if (typeof ChromeWorker == "function") {
+ this.#worker = new ChromeWorker(this.#url);
+ } else {
+ this.#worker = new Worker(this.#url);
+ }
+ this.#worker.onerror = err => {
+ console.error(`Error in worker ${this.#url}`, err.message);
+ };
+ this.#worker.addEventListener("message", this.#onMessage);
+ }
+
+ stop() {
+ if (!this.#worker) {
+ return;
+ }
+
+ this.#worker.removeEventListener("message", this.#onMessage);
+ this.#worker.terminate();
+ this.#worker = null;
+ this.#pendingCalls.clear();
+ }
+
+ task(method, { queue = false } = {}) {
+ const calls = [];
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push({ args, resolve, reject });
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.#worker) {
+ this.start();
+ }
+
+ const id = this.#msgId++;
+ this.#worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item.args),
+ });
+
+ this.#pendingCalls.set(id, items);
+ };
+
+ return (...args) => push(args);
+ }
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+ #onMessage = ({ data: result }) => {
+ const items = this.#pendingCalls.get(result.id);
+ this.#pendingCalls.delete(result.id);
+ if (!items) {
+ return;
+ }
+
+ if (!this.#worker) {
+ return;
+ }
+
+ result.results.forEach((resultData, i) => {
+ const { resolve, reject } = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+ }
+
+ function workerHandler(publicInterface) {
+ return function (msg) {
+ const { id, method, calls } = msg.data;
+
+ Promise.all(
+ calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+ if (response instanceof Promise) {
+ return response.then(
+ val => ({ response: val }),
+ err => asErrorMessage(err)
+ );
+ }
+ return { response };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })
+ ).then(results => {
+ globalThis.postMessage({ id, results });
+ });
+ };
+ }
+
+ function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata,
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined,
+ };
+ }
+
+ // Might be loaded within a worker thread where `module` isn't available.
+ {
+ module.exports = {
+ WorkerDispatcher,
+ workerHandler,
+ };
+ }
+ } (workerUtils));
+
+ var acornExports = {};
+ var acorn$1 = {
+ get exports(){ return acornExports; },
+ set exports(v){ acornExports = v; },
+ };
+
+ (function (module, exports) {
+ (function (global, factory) {
+ factory(exports) ;
+ })(commonjsGlobal, (function (exports) {
+ // This file was generated. Do not modify manually!
+ var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+ // This file was generated. Do not modify manually!
+ var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];
+
+ // This file was generated. Do not modify manually!
+ var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+
+ // This file was generated. Do not modify manually!
+ var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+
+ // These are a run-length and offset encoded representation of the
+
+ // Reserved word lists for various dialects of the language
+
+ var reservedWords = {
+ 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
+ 5: "class enum extends super const export import",
+ 6: "enum",
+ strict: "implements interface let package private protected public static yield",
+ strictBind: "eval arguments"
+ };
+
+ // And the keywords
+
+ var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
+
+ var keywords$1 = {
+ 5: ecma5AndLessKeywords,
+ "5module": ecma5AndLessKeywords + " export import",
+ 6: ecma5AndLessKeywords + " const class extends export import super"
+ };
+
+ var keywordRelationalOperator = /^in(stanceof)?$/;
+
+ // ## Character categories
+
+ var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+ var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+
+ // This has a complexity linear to the value of the code. The
+ // assumption is that looking up astral identifier characters is
+ // rare.
+ function isInAstralSet(code, set) {
+ var pos = 0x10000;
+ for (var i = 0; i < set.length; i += 2) {
+ pos += set[i];
+ if (pos > code) { return false }
+ pos += set[i + 1];
+ if (pos >= code) { return true }
+ }
+ return false
+ }
+
+ // Test whether a given character code starts an identifier.
+
+ function isIdentifierStart(code, astral) {
+ if (code < 65) { return code === 36 }
+ if (code < 91) { return true }
+ if (code < 97) { return code === 95 }
+ if (code < 123) { return true }
+ if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
+ if (astral === false) { return false }
+ return isInAstralSet(code, astralIdentifierStartCodes)
+ }
+
+ // Test whether a given character is part of an identifier.
+
+ function isIdentifierChar(code, astral) {
+ if (code < 48) { return code === 36 }
+ if (code < 58) { return true }
+ if (code < 65) { return false }
+ if (code < 91) { return true }
+ if (code < 97) { return code === 95 }
+ if (code < 123) { return true }
+ if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
+ if (astral === false) { return false }
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
+ }
+
+ // ## Token types
+
+ // The assignment of fine-grained, information-carrying type objects
+ // allows the tokenizer to store the information it has about a
+ // token in a way that is very cheap for the parser to look up.
+
+ // All token type variables start with an underscore, to make them
+ // easy to recognize.
+
+ // The `beforeExpr` property is used to disambiguate between regular
+ // expressions and divisions. It is set on all token types that can
+ // be followed by an expression (thus, a slash after them would be a
+ // regular expression).
+ //
+ // The `startsExpr` property is used to check if the token ends a
+ // `yield` expression. It is set on all token types that either can
+ // directly start an expression (like a quotation mark) or can
+ // continue an expression (like the body of a string).
+ //
+ // `isLoop` marks a keyword as starting a loop, which is important
+ // to know when parsing a label, in order to allow or disallow
+ // continue jumps to that label.
+
+ var TokenType = function TokenType(label, conf) {
+ if ( conf === void 0 ) conf = {};
+
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop || null;
+ this.updateContext = null;
+ };
+
+ function binop(name, prec) {
+ return new TokenType(name, {beforeExpr: true, binop: prec})
+ }
+ var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};
+
+ // Map keyword names to token types.
+
+ var keywords = {};
+
+ // Succinct definitions of keyword token types
+ function kw(name, options) {
+ if ( options === void 0 ) options = {};
+
+ options.keyword = name;
+ return keywords[name] = new TokenType(name, options)
+ }
+
+ var types$1 = {
+ num: new TokenType("num", startsExpr),
+ regexp: new TokenType("regexp", startsExpr),
+ string: new TokenType("string", startsExpr),
+ name: new TokenType("name", startsExpr),
+ privateId: new TokenType("privateId", startsExpr),
+ eof: new TokenType("eof"),
+
+ // Punctuation token types.
+ bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
+ bracketR: new TokenType("]"),
+ braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
+ braceR: new TokenType("}"),
+ parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
+ parenR: new TokenType(")"),
+ comma: new TokenType(",", beforeExpr),
+ semi: new TokenType(";", beforeExpr),
+ colon: new TokenType(":", beforeExpr),
+ dot: new TokenType("."),
+ question: new TokenType("?", beforeExpr),
+ questionDot: new TokenType("?."),
+ arrow: new TokenType("=>", beforeExpr),
+ template: new TokenType("template"),
+ invalidTemplate: new TokenType("invalidTemplate"),
+ ellipsis: new TokenType("...", beforeExpr),
+ backQuote: new TokenType("`", startsExpr),
+ dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
+
+ // Operators. These carry several kinds of properties to help the
+ // parser use them properly (the presence of these properties is
+ // what categorizes them as operators).
+ //
+ // `binop`, when present, specifies that this operator is a binary
+ // operator, and will refer to its precedence.
+ //
+ // `prefix` and `postfix` mark the operator as a prefix or postfix
+ // unary operator.
+ //
+ // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
+ // binary operators with a very low precedence, that should result
+ // in AssignmentExpression nodes.
+
+ eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
+ assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
+ incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
+ prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
+ logicalOR: binop("||", 1),
+ logicalAND: binop("&&", 2),
+ bitwiseOR: binop("|", 3),
+ bitwiseXOR: binop("^", 4),
+ bitwiseAND: binop("&", 5),
+ equality: binop("==/!=/===/!==", 6),
+ relational: binop("</>/<=/>=", 7),
+ bitShift: binop("<</>>/>>>", 8),
+ plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
+ modulo: binop("%", 10),
+ star: binop("*", 10),
+ slash: binop("/", 10),
+ starstar: new TokenType("**", {beforeExpr: true}),
+ coalesce: binop("??", 1),
+
+ // Keyword token types.
+ _break: kw("break"),
+ _case: kw("case", beforeExpr),
+ _catch: kw("catch"),
+ _continue: kw("continue"),
+ _debugger: kw("debugger"),
+ _default: kw("default", beforeExpr),
+ _do: kw("do", {isLoop: true, beforeExpr: true}),
+ _else: kw("else", beforeExpr),
+ _finally: kw("finally"),
+ _for: kw("for", {isLoop: true}),
+ _function: kw("function", startsExpr),
+ _if: kw("if"),
+ _return: kw("return", beforeExpr),
+ _switch: kw("switch"),
+ _throw: kw("throw", beforeExpr),
+ _try: kw("try"),
+ _var: kw("var"),
+ _const: kw("const"),
+ _while: kw("while", {isLoop: true}),
+ _with: kw("with"),
+ _new: kw("new", {beforeExpr: true, startsExpr: true}),
+ _this: kw("this", startsExpr),
+ _super: kw("super", startsExpr),
+ _class: kw("class", startsExpr),
+ _extends: kw("extends", beforeExpr),
+ _export: kw("export"),
+ _import: kw("import", startsExpr),
+ _null: kw("null", startsExpr),
+ _true: kw("true", startsExpr),
+ _false: kw("false", startsExpr),
+ _in: kw("in", {beforeExpr: true, binop: 7}),
+ _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
+ _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
+ _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
+ _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
+ };
+
+ // Matches a whole line break (where CRLF is considered a single
+ // line break). Used to count lines.
+
+ var lineBreak = /\r\n?|\n|\u2028|\u2029/;
+ var lineBreakG = new RegExp(lineBreak.source, "g");
+
+ function isNewLine(code) {
+ return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
+ }
+
+ function nextLineBreak(code, from, end) {
+ if ( end === void 0 ) end = code.length;
+
+ for (var i = from; i < end; i++) {
+ var next = code.charCodeAt(i);
+ if (isNewLine(next))
+ { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
+ }
+ return -1
+ }
+
+ var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
+
+ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+
+ var ref = Object.prototype;
+ var hasOwnProperty = ref.hasOwnProperty;
+ var toString = ref.toString;
+
+ var hasOwn = Object.hasOwn || (function (obj, propName) { return (
+ hasOwnProperty.call(obj, propName)
+ ); });
+
+ var isArray = Array.isArray || (function (obj) { return (
+ toString.call(obj) === "[object Array]"
+ ); });
+
+ function wordsRegexp(words) {
+ return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
+ }
+
+ function codePointToString(code) {
+ // UTF-16 Decoding
+ if (code <= 0xFFFF) { return String.fromCharCode(code) }
+ code -= 0x10000;
+ return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
+ }
+
+ var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
+
+ // These are used when `options.locations` is on, for the
+ // `startLoc` and `endLoc` properties.
+
+ var Position = function Position(line, col) {
+ this.line = line;
+ this.column = col;
+ };
+
+ Position.prototype.offset = function offset (n) {
+ return new Position(this.line, this.column + n)
+ };
+
+ var SourceLocation = function SourceLocation(p, start, end) {
+ this.start = start;
+ this.end = end;
+ if (p.sourceFile !== null) { this.source = p.sourceFile; }
+ };
+
+ // The `getLineInfo` function is mostly useful when the
+ // `locations` option is off (for performance reasons) and you
+ // want to find the line/column position for a given character
+ // offset. `input` should be the code string that the offset refers
+ // into.
+
+ function getLineInfo(input, offset) {
+ for (var line = 1, cur = 0;;) {
+ var nextBreak = nextLineBreak(input, cur, offset);
+ if (nextBreak < 0) { return new Position(line, offset - cur) }
+ ++line;
+ cur = nextBreak;
+ }
+ }
+
+ // A second argument must be given to configure the parser process.
+ // These options are recognized (only `ecmaVersion` is required):
+
+ var defaultOptions = {
+ // `ecmaVersion` indicates the ECMAScript version to parse. Must be
+ // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
+ // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
+ // (the latest version the library supports). This influences
+ // support for strict mode, the set of reserved words, and support
+ // for new syntax features.
+ ecmaVersion: null,
+ // `sourceType` indicates the mode the code should be parsed in.
+ // Can be either `"script"` or `"module"`. This influences global
+ // strict mode and parsing of `import` and `export` declarations.
+ sourceType: "script",
+ // `onInsertedSemicolon` can be a callback that will be called
+ // when a semicolon is automatically inserted. It will be passed
+ // the position of the comma as an offset, and if `locations` is
+ // enabled, it is given the location as a `{line, column}` object
+ // as second argument.
+ onInsertedSemicolon: null,
+ // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
+ // trailing commas.
+ onTrailingComma: null,
+ // By default, reserved words are only enforced if ecmaVersion >= 5.
+ // Set `allowReserved` to a boolean value to explicitly turn this on
+ // an off. When this option has the value "never", reserved words
+ // and keywords can also not be used as property names.
+ allowReserved: null,
+ // When enabled, a return at the top level is not considered an
+ // error.
+ allowReturnOutsideFunction: false,
+ // When enabled, import/export statements are not constrained to
+ // appearing at the top of the program, and an import.meta expression
+ // in a script isn't considered an error.
+ allowImportExportEverywhere: false,
+ // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
+ // When enabled, await identifiers are allowed to appear at the top-level scope,
+ // but they are still not allowed in non-async functions.
+ allowAwaitOutsideFunction: null,
+ // When enabled, super identifiers are not constrained to
+ // appearing in methods and do not raise an error when they appear elsewhere.
+ allowSuperOutsideMethod: null,
+ // When enabled, hashbang directive in the beginning of file is
+ // allowed and treated as a line comment. Enabled by default when
+ // `ecmaVersion` >= 2023.
+ allowHashBang: false,
+ // When `locations` is on, `loc` properties holding objects with
+ // `start` and `end` properties in `{line, column}` form (with
+ // line being 1-based and column 0-based) will be attached to the
+ // nodes.
+ locations: false,
+ // A function can be passed as `onToken` option, which will
+ // cause Acorn to call that function with object in the same
+ // format as tokens returned from `tokenizer().getToken()`. Note
+ // that you are not allowed to call the parser from the
+ // callback—that will corrupt its internal state.
+ onToken: null,
+ // A function can be passed as `onComment` option, which will
+ // cause Acorn to call that function with `(block, text, start,
+ // end)` parameters whenever a comment is skipped. `block` is a
+ // boolean indicating whether this is a block (`/* */`) comment,
+ // `text` is the content of the comment, and `start` and `end` are
+ // character offsets that denote the start and end of the comment.
+ // When the `locations` option is on, two more parameters are
+ // passed, the full `{line, column}` locations of the start and
+ // end of the comments. Note that you are not allowed to call the
+ // parser from the callback—that will corrupt its internal state.
+ onComment: null,
+ // Nodes have their start and end characters offsets recorded in
+ // `start` and `end` properties (directly on the node, rather than
+ // the `loc` object, which holds line/column data. To also add a
+ // [semi-standardized][range] `range` property holding a `[start,
+ // end]` array with the same numbers, set the `ranges` option to
+ // `true`.
+ //
+ // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
+ ranges: false,
+ // It is possible to parse multiple files into a single AST by
+ // passing the tree produced by parsing the first file as
+ // `program` option in subsequent parses. This will add the
+ // toplevel forms of the parsed file to the `Program` (top) node
+ // of an existing parse tree.
+ program: null,
+ // When `locations` is on, you can pass this to record the source
+ // file in every node's `loc` object.
+ sourceFile: null,
+ // This value, if given, is stored in every node, whether
+ // `locations` is on or off.
+ directSourceFile: null,
+ // When enabled, parenthesized expressions are represented by
+ // (non-standard) ParenthesizedExpression nodes
+ preserveParens: false
+ };
+
+ // Interpret and default an options object
+
+ var warnedAboutEcmaVersion = false;
+
+ function getOptions(opts) {
+ var options = {};
+
+ for (var opt in defaultOptions)
+ { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }
+
+ if (options.ecmaVersion === "latest") {
+ options.ecmaVersion = 1e8;
+ } else if (options.ecmaVersion == null) {
+ if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
+ warnedAboutEcmaVersion = true;
+ console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
+ }
+ options.ecmaVersion = 11;
+ } else if (options.ecmaVersion >= 2015) {
+ options.ecmaVersion -= 2009;
+ }
+
+ if (options.allowReserved == null)
+ { options.allowReserved = options.ecmaVersion < 5; }
+
+ if (!opts || opts.allowHashBang == null)
+ { options.allowHashBang = options.ecmaVersion >= 14; }
+
+ if (isArray(options.onToken)) {
+ var tokens = options.onToken;
+ options.onToken = function (token) { return tokens.push(token); };
+ }
+ if (isArray(options.onComment))
+ { options.onComment = pushComment(options, options.onComment); }
+
+ return options
+ }
+
+ function pushComment(options, array) {
+ return function(block, text, start, end, startLoc, endLoc) {
+ var comment = {
+ type: block ? "Block" : "Line",
+ value: text,
+ start: start,
+ end: end
+ };
+ if (options.locations)
+ { comment.loc = new SourceLocation(this, startLoc, endLoc); }
+ if (options.ranges)
+ { comment.range = [start, end]; }
+ array.push(comment);
+ }
+ }
+
+ // Each scope gets a bitset that may contain these flags
+ var
+ SCOPE_TOP = 1,
+ SCOPE_FUNCTION = 2,
+ SCOPE_ASYNC = 4,
+ SCOPE_GENERATOR = 8,
+ SCOPE_ARROW = 16,
+ SCOPE_SIMPLE_CATCH = 32,
+ SCOPE_SUPER = 64,
+ SCOPE_DIRECT_SUPER = 128,
+ SCOPE_CLASS_STATIC_BLOCK = 256,
+ SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
+
+ function functionFlags(async, generator) {
+ return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
+ }
+
+ // Used in checkLVal* and declareName to determine the type of a binding
+ var
+ BIND_NONE = 0, // Not a binding
+ BIND_VAR = 1, // Var-style binding
+ BIND_LEXICAL = 2, // Let- or const-style binding
+ BIND_FUNCTION = 3, // Function declaration
+ BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
+ BIND_OUTSIDE = 5; // Special case for function names as bound inside the function
+
+ var Parser = function Parser(options, input, startPos) {
+ this.options = options = getOptions(options);
+ this.sourceFile = options.sourceFile;
+ this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
+ var reserved = "";
+ if (options.allowReserved !== true) {
+ reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
+ if (options.sourceType === "module") { reserved += " await"; }
+ }
+ this.reservedWords = wordsRegexp(reserved);
+ var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
+ this.reservedWordsStrict = wordsRegexp(reservedStrict);
+ this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
+ this.input = String(input);
+
+ // Used to signal to callers of `readWord1` whether the word
+ // contained any escape sequences. This is needed because words with
+ // escape sequences must not be interpreted as keywords.
+ this.containsEsc = false;
+
+ // Set up token state
+
+ // The current position of the tokenizer in the input.
+ if (startPos) {
+ this.pos = startPos;
+ this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
+ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
+ } else {
+ this.pos = this.lineStart = 0;
+ this.curLine = 1;
+ }
+
+ // Properties of the current token:
+ // Its type
+ this.type = types$1.eof;
+ // For tokens that include more information than their type, the value
+ this.value = null;
+ // Its start and end offset
+ this.start = this.end = this.pos;
+ // And, if locations are used, the {line, column} object
+ // corresponding to those offsets
+ this.startLoc = this.endLoc = this.curPosition();
+
+ // Position information for the previous token
+ this.lastTokEndLoc = this.lastTokStartLoc = null;
+ this.lastTokStart = this.lastTokEnd = this.pos;
+
+ // The context stack is used to superficially track syntactic
+ // context to predict whether a regular expression is allowed in a
+ // given position.
+ this.context = this.initialContext();
+ this.exprAllowed = true;
+
+ // Figure out if it's a module code.
+ this.inModule = options.sourceType === "module";
+ this.strict = this.inModule || this.strictDirective(this.pos);
+
+ // Used to signify the start of a potential arrow function
+ this.potentialArrowAt = -1;
+ this.potentialArrowInForAwait = false;
+
+ // Positions to delayed-check that yield/await does not exist in default parameters.
+ this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
+ // Labels in scope.
+ this.labels = [];
+ // Thus-far undefined exports.
+ this.undefinedExports = Object.create(null);
+
+ // If enabled, skip leading hashbang line.
+ if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
+ { this.skipLineComment(2); }
+
+ // Scope tracking for duplicate variable names (see scope.js)
+ this.scopeStack = [];
+ this.enterScope(SCOPE_TOP);
+
+ // For RegExp validation
+ this.regexpState = null;
+
+ // The stack of private names.
+ // Each element has two properties: 'declared' and 'used'.
+ // When it exited from the outermost class definition, all used private names must be declared.
+ this.privateNameStack = [];
+ };
+
+ var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };
+
+ Parser.prototype.parse = function parse () {
+ var node = this.options.program || this.startNode();
+ this.nextToken();
+ return this.parseTopLevel(node)
+ };
+
+ prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
+
+ prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit };
+
+ prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit };
+
+ prototypeAccessors.canAwait.get = function () {
+ for (var i = this.scopeStack.length - 1; i >= 0; i--) {
+ var scope = this.scopeStack[i];
+ if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false }
+ if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 }
+ }
+ return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
+ };
+
+ prototypeAccessors.allowSuper.get = function () {
+ var ref = this.currentThisScope();
+ var flags = ref.flags;
+ var inClassFieldInit = ref.inClassFieldInit;
+ return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod
+ };
+
+ prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
+
+ prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
+
+ prototypeAccessors.allowNewDotTarget.get = function () {
+ var ref = this.currentThisScope();
+ var flags = ref.flags;
+ var inClassFieldInit = ref.inClassFieldInit;
+ return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit
+ };
+
+ prototypeAccessors.inClassStaticBlock.get = function () {
+ return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0
+ };
+
+ Parser.extend = function extend () {
+ var plugins = [], len = arguments.length;
+ while ( len-- ) plugins[ len ] = arguments[ len ];
+
+ var cls = this;
+ for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
+ return cls
+ };
+
+ Parser.parse = function parse (input, options) {
+ return new this(options, input).parse()
+ };
+
+ Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
+ var parser = new this(options, input, pos);
+ parser.nextToken();
+ return parser.parseExpression()
+ };
+
+ Parser.tokenizer = function tokenizer (input, options) {
+ return new this(options, input)
+ };
+
+ Object.defineProperties( Parser.prototype, prototypeAccessors );
+
+ var pp$9 = Parser.prototype;
+
+ // ## Parser utilities
+
+ var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
+ pp$9.strictDirective = function(start) {
+ if (this.options.ecmaVersion < 5) { return false }
+ for (;;) {
+ // Try to find string literal.
+ skipWhiteSpace.lastIndex = start;
+ start += skipWhiteSpace.exec(this.input)[0].length;
+ var match = literal.exec(this.input.slice(start));
+ if (!match) { return false }
+ if ((match[1] || match[2]) === "use strict") {
+ skipWhiteSpace.lastIndex = start + match[0].length;
+ var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
+ var next = this.input.charAt(end);
+ return next === ";" || next === "}" ||
+ (lineBreak.test(spaceAfter[0]) &&
+ !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
+ }
+ start += match[0].length;
+
+ // Skip semicolon, if any.
+ skipWhiteSpace.lastIndex = start;
+ start += skipWhiteSpace.exec(this.input)[0].length;
+ if (this.input[start] === ";")
+ { start++; }
+ }
+ };
+
+ // Predicate that tests whether the next token is of the given
+ // type, and if yes, consumes it as a side effect.
+
+ pp$9.eat = function(type) {
+ if (this.type === type) {
+ this.next();
+ return true
+ } else {
+ return false
+ }
+ };
+
+ // Tests whether parsed token is a contextual keyword.
+
+ pp$9.isContextual = function(name) {
+ return this.type === types$1.name && this.value === name && !this.containsEsc
+ };
+
+ // Consumes contextual keyword if possible.
+
+ pp$9.eatContextual = function(name) {
+ if (!this.isContextual(name)) { return false }
+ this.next();
+ return true
+ };
+
+ // Asserts that following token is given contextual keyword.
+
+ pp$9.expectContextual = function(name) {
+ if (!this.eatContextual(name)) { this.unexpected(); }
+ };
+
+ // Test whether a semicolon can be inserted at the current position.
+
+ pp$9.canInsertSemicolon = function() {
+ return this.type === types$1.eof ||
+ this.type === types$1.braceR ||
+ lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
+ };
+
+ pp$9.insertSemicolon = function() {
+ if (this.canInsertSemicolon()) {
+ if (this.options.onInsertedSemicolon)
+ { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
+ return true
+ }
+ };
+
+ // Consume a semicolon, or, failing that, see if we are allowed to
+ // pretend that there is a semicolon at this position.
+
+ pp$9.semicolon = function() {
+ if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }
+ };
+
+ pp$9.afterTrailingComma = function(tokType, notNext) {
+ if (this.type === tokType) {
+ if (this.options.onTrailingComma)
+ { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
+ if (!notNext)
+ { this.next(); }
+ return true
+ }
+ };
+
+ // Expect a token of a given type. If found, consume it, otherwise,
+ // raise an unexpected token error.
+
+ pp$9.expect = function(type) {
+ this.eat(type) || this.unexpected();
+ };
+
+ // Raise an unexpected token error.
+
+ pp$9.unexpected = function(pos) {
+ this.raise(pos != null ? pos : this.start, "Unexpected token");
+ };
+
+ var DestructuringErrors = function DestructuringErrors() {
+ this.shorthandAssign =
+ this.trailingComma =
+ this.parenthesizedAssign =
+ this.parenthesizedBind =
+ this.doubleProto =
+ -1;
+ };
+
+ pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
+ if (!refDestructuringErrors) { return }
+ if (refDestructuringErrors.trailingComma > -1)
+ { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
+ var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
+ if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); }
+ };
+
+ pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
+ if (!refDestructuringErrors) { return false }
+ var shorthandAssign = refDestructuringErrors.shorthandAssign;
+ var doubleProto = refDestructuringErrors.doubleProto;
+ if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
+ if (shorthandAssign >= 0)
+ { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
+ if (doubleProto >= 0)
+ { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
+ };
+
+ pp$9.checkYieldAwaitInDefaultParams = function() {
+ if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
+ { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
+ if (this.awaitPos)
+ { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
+ };
+
+ pp$9.isSimpleAssignTarget = function(expr) {
+ if (expr.type === "ParenthesizedExpression")
+ { return this.isSimpleAssignTarget(expr.expression) }
+ return expr.type === "Identifier" || expr.type === "MemberExpression"
+ };
+
+ var pp$8 = Parser.prototype;
+
+ // ### Statement parsing
+
+ // Parse a program. Initializes the parser, reads any number of
+ // statements, and wraps them in a Program node. Optionally takes a
+ // `program` argument. If present, the statements will be appended
+ // to its body instead of creating a new node.
+
+ pp$8.parseTopLevel = function(node) {
+ var exports = Object.create(null);
+ if (!node.body) { node.body = []; }
+ while (this.type !== types$1.eof) {
+ var stmt = this.parseStatement(null, true, exports);
+ node.body.push(stmt);
+ }
+ if (this.inModule)
+ { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
+ {
+ var name = list[i];
+
+ this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
+ } }
+ this.adaptDirectivePrologue(node.body);
+ this.next();
+ node.sourceType = this.options.sourceType;
+ return this.finishNode(node, "Program")
+ };
+
+ var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
+
+ pp$8.isLet = function(context) {
+ if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
+ skipWhiteSpace.lastIndex = this.pos;
+ var skip = skipWhiteSpace.exec(this.input);
+ var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
+ // For ambiguous cases, determine if a LexicalDeclaration (or only a
+ // Statement) is allowed here. If context is not empty then only a Statement
+ // is allowed. However, `let [` is an explicit negative lookahead for
+ // ExpressionStatement, so special-case it first.
+ if (nextCh === 91 || nextCh === 92) { return true } // '[', '/'
+ if (context) { return false }
+
+ if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral
+ if (isIdentifierStart(nextCh, true)) {
+ var pos = next + 1;
+ while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; }
+ if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true }
+ var ident = this.input.slice(next, pos);
+ if (!keywordRelationalOperator.test(ident)) { return true }
+ }
+ return false
+ };
+
+ // check 'async [no LineTerminator here] function'
+ // - 'async /*foo*/ function' is OK.
+ // - 'async /*\n*/ function' is invalid.
+ pp$8.isAsyncFunction = function() {
+ if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
+ { return false }
+
+ skipWhiteSpace.lastIndex = this.pos;
+ var skip = skipWhiteSpace.exec(this.input);
+ var next = this.pos + skip[0].length, after;
+ return !lineBreak.test(this.input.slice(this.pos, next)) &&
+ this.input.slice(next, next + 8) === "function" &&
+ (next + 8 === this.input.length ||
+ !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))
+ };
+
+ // Parse a single statement.
+ //
+ // If expecting a statement and finding a slash operator, parse a
+ // regular expression literal. This is to handle cases like
+ // `if (foo) /blah/.exec(foo)`, where looking at the previous token
+ // does not help.
+
+ pp$8.parseStatement = function(context, topLevel, exports) {
+ var starttype = this.type, node = this.startNode(), kind;
+
+ if (this.isLet(context)) {
+ starttype = types$1._var;
+ kind = "let";
+ }
+
+ // Most types of statements are recognized by the keyword they
+ // start with. Many are trivial to parse, some require a bit of
+ // complexity.
+
+ switch (starttype) {
+ case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
+ case types$1._debugger: return this.parseDebuggerStatement(node)
+ case types$1._do: return this.parseDoStatement(node)
+ case types$1._for: return this.parseForStatement(node)
+ case types$1._function:
+ // Function as sole body of either an if statement or a labeled statement
+ // works, but not when it is part of a labeled statement that is the sole
+ // body of an if statement.
+ if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
+ return this.parseFunctionStatement(node, false, !context)
+ case types$1._class:
+ if (context) { this.unexpected(); }
+ return this.parseClass(node, true)
+ case types$1._if: return this.parseIfStatement(node)
+ case types$1._return: return this.parseReturnStatement(node)
+ case types$1._switch: return this.parseSwitchStatement(node)
+ case types$1._throw: return this.parseThrowStatement(node)
+ case types$1._try: return this.parseTryStatement(node)
+ case types$1._const: case types$1._var:
+ kind = kind || this.value;
+ if (context && kind !== "var") { this.unexpected(); }
+ return this.parseVarStatement(node, kind)
+ case types$1._while: return this.parseWhileStatement(node)
+ case types$1._with: return this.parseWithStatement(node)
+ case types$1.braceL: return this.parseBlock(true, node)
+ case types$1.semi: return this.parseEmptyStatement(node)
+ case types$1._export:
+ case types$1._import:
+ if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
+ skipWhiteSpace.lastIndex = this.pos;
+ var skip = skipWhiteSpace.exec(this.input);
+ var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
+ if (nextCh === 40 || nextCh === 46) // '(' or '.'
+ { return this.parseExpressionStatement(node, this.parseExpression()) }
+ }
+
+ if (!this.options.allowImportExportEverywhere) {
+ if (!topLevel)
+ { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
+ if (!this.inModule)
+ { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
+ }
+ return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)
+
+ // If the statement does not start with a statement keyword or a
+ // brace, it's an ExpressionStatement or LabeledStatement. We
+ // simply start parsing an expression, and afterwards, if the
+ // next token is a colon and the expression was a simple
+ // Identifier node, we switch to interpreting it as a label.
+ default:
+ if (this.isAsyncFunction()) {
+ if (context) { this.unexpected(); }
+ this.next();
+ return this.parseFunctionStatement(node, true, !context)
+ }
+
+ var maybeName = this.value, expr = this.parseExpression();
+ if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
+ { return this.parseLabeledStatement(node, maybeName, expr, context) }
+ else { return this.parseExpressionStatement(node, expr) }
+ }
+ };
+
+ pp$8.parseBreakContinueStatement = function(node, keyword) {
+ var isBreak = keyword === "break";
+ this.next();
+ if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }
+ else if (this.type !== types$1.name) { this.unexpected(); }
+ else {
+ node.label = this.parseIdent();
+ this.semicolon();
+ }
+
+ // Verify that there is an actual destination to break or
+ // continue to.
+ var i = 0;
+ for (; i < this.labels.length; ++i) {
+ var lab = this.labels[i];
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
+ if (node.label && isBreak) { break }
+ }
+ }
+ if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
+ };
+
+ pp$8.parseDebuggerStatement = function(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement")
+ };
+
+ pp$8.parseDoStatement = function(node) {
+ this.next();
+ this.labels.push(loopLabel);
+ node.body = this.parseStatement("do");
+ this.labels.pop();
+ this.expect(types$1._while);
+ node.test = this.parseParenExpression();
+ if (this.options.ecmaVersion >= 6)
+ { this.eat(types$1.semi); }
+ else
+ { this.semicolon(); }
+ return this.finishNode(node, "DoWhileStatement")
+ };
+
+ // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
+ // loop is non-trivial. Basically, we have to parse the init `var`
+ // statement or expression, disallowing the `in` operator (see
+ // the second parameter to `parseExpression`), and then check
+ // whether the next token is `in` or `of`. When there is no init
+ // part (semicolon immediately after the opening parenthesis), it
+ // is a regular `for` loop.
+
+ pp$8.parseForStatement = function(node) {
+ this.next();
+ var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1;
+ this.labels.push(loopLabel);
+ this.enterScope(0);
+ this.expect(types$1.parenL);
+ if (this.type === types$1.semi) {
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ return this.parseFor(node, null)
+ }
+ var isLet = this.isLet();
+ if (this.type === types$1._var || this.type === types$1._const || isLet) {
+ var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
+ this.next();
+ this.parseVar(init$1, true, kind);
+ this.finishNode(init$1, "VariableDeclaration");
+ if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
+ if (this.options.ecmaVersion >= 9) {
+ if (this.type === types$1._in) {
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ } else { node.await = awaitAt > -1; }
+ }
+ return this.parseForIn(node, init$1)
+ }
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ return this.parseFor(node, init$1)
+ }
+ var startsWithLet = this.isContextual("let"), isForOf = false;
+ var refDestructuringErrors = new DestructuringErrors;
+ var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors);
+ if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
+ if (this.options.ecmaVersion >= 9) {
+ if (this.type === types$1._in) {
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ } else { node.await = awaitAt > -1; }
+ }
+ if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
+ this.toAssignable(init, false, refDestructuringErrors);
+ this.checkLValPattern(init);
+ return this.parseForIn(node, init)
+ } else {
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ }
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ return this.parseFor(node, init)
+ };
+
+ pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
+ };
+
+ pp$8.parseIfStatement = function(node) {
+ this.next();
+ node.test = this.parseParenExpression();
+ // allow function declarations in branches, but only in non-strict mode
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement")
+ };
+
+ pp$8.parseReturnStatement = function(node) {
+ if (!this.inFunction && !this.options.allowReturnOutsideFunction)
+ { this.raise(this.start, "'return' outside of function"); }
+ this.next();
+
+ // In `return` (and `break`/`continue`), the keywords with
+ // optional arguments, we eagerly look for a semicolon or the
+ // possibility to insert one.
+
+ if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }
+ else { node.argument = this.parseExpression(); this.semicolon(); }
+ return this.finishNode(node, "ReturnStatement")
+ };
+
+ pp$8.parseSwitchStatement = function(node) {
+ this.next();
+ node.discriminant = this.parseParenExpression();
+ node.cases = [];
+ this.expect(types$1.braceL);
+ this.labels.push(switchLabel);
+ this.enterScope(0);
+
+ // Statements under must be grouped (by label) in SwitchCase
+ // nodes. `cur` is used to keep the node that we are currently
+ // adding statements to.
+
+ var cur;
+ for (var sawDefault = false; this.type !== types$1.braceR;) {
+ if (this.type === types$1._case || this.type === types$1._default) {
+ var isCase = this.type === types$1._case;
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
+ node.cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
+ sawDefault = true;
+ cur.test = null;
+ }
+ this.expect(types$1.colon);
+ } else {
+ if (!cur) { this.unexpected(); }
+ cur.consequent.push(this.parseStatement(null));
+ }
+ }
+ this.exitScope();
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
+ this.next(); // Closing brace
+ this.labels.pop();
+ return this.finishNode(node, "SwitchStatement")
+ };
+
+ pp$8.parseThrowStatement = function(node) {
+ this.next();
+ if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
+ { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement")
+ };
+
+ // Reused empty array added for node fields that are always empty.
+
+ var empty$1 = [];
+
+ pp$8.parseTryStatement = function(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+ if (this.type === types$1._catch) {
+ var clause = this.startNode();
+ this.next();
+ if (this.eat(types$1.parenL)) {
+ clause.param = this.parseBindingAtom();
+ var simple = clause.param.type === "Identifier";
+ this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
+ this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
+ this.expect(types$1.parenR);
+ } else {
+ if (this.options.ecmaVersion < 10) { this.unexpected(); }
+ clause.param = null;
+ this.enterScope(0);
+ }
+ clause.body = this.parseBlock(false);
+ this.exitScope();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+ node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
+ if (!node.handler && !node.finalizer)
+ { this.raise(node.start, "Missing catch or finally clause"); }
+ return this.finishNode(node, "TryStatement")
+ };
+
+ pp$8.parseVarStatement = function(node, kind) {
+ this.next();
+ this.parseVar(node, false, kind);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration")
+ };
+
+ pp$8.parseWhileStatement = function(node) {
+ this.next();
+ node.test = this.parseParenExpression();
+ this.labels.push(loopLabel);
+ node.body = this.parseStatement("while");
+ this.labels.pop();
+ return this.finishNode(node, "WhileStatement")
+ };
+
+ pp$8.parseWithStatement = function(node) {
+ if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
+ this.next();
+ node.object = this.parseParenExpression();
+ node.body = this.parseStatement("with");
+ return this.finishNode(node, "WithStatement")
+ };
+
+ pp$8.parseEmptyStatement = function(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement")
+ };
+
+ pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
+ for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
+ {
+ var label = list[i$1];
+
+ if (label.name === maybeName)
+ { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
+ } }
+ var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
+ for (var i = this.labels.length - 1; i >= 0; i--) {
+ var label$1 = this.labels[i];
+ if (label$1.statementStart === node.start) {
+ // Update information about previous labels on this node
+ label$1.statementStart = this.start;
+ label$1.kind = kind;
+ } else { break }
+ }
+ this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement")
+ };
+
+ pp$8.parseExpressionStatement = function(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement")
+ };
+
+ // Parse a semicolon-enclosed block of statements, handling `"use
+ // strict"` declarations when `allowStrict` is true (used for
+ // function bodies).
+
+ pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
+ if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
+ if ( node === void 0 ) node = this.startNode();
+
+ node.body = [];
+ this.expect(types$1.braceL);
+ if (createNewLexicalScope) { this.enterScope(0); }
+ while (this.type !== types$1.braceR) {
+ var stmt = this.parseStatement(null);
+ node.body.push(stmt);
+ }
+ if (exitStrict) { this.strict = false; }
+ this.next();
+ if (createNewLexicalScope) { this.exitScope(); }
+ return this.finishNode(node, "BlockStatement")
+ };
+
+ // Parse a regular `for` loop. The disambiguation code in
+ // `parseStatement` will already have parsed the init statement or
+ // expression.
+
+ pp$8.parseFor = function(node, init) {
+ node.init = init;
+ this.expect(types$1.semi);
+ node.test = this.type === types$1.semi ? null : this.parseExpression();
+ this.expect(types$1.semi);
+ node.update = this.type === types$1.parenR ? null : this.parseExpression();
+ this.expect(types$1.parenR);
+ node.body = this.parseStatement("for");
+ this.exitScope();
+ this.labels.pop();
+ return this.finishNode(node, "ForStatement")
+ };
+
+ // Parse a `for`/`in` and `for`/`of` loop, which are almost
+ // same from parser's perspective.
+
+ pp$8.parseForIn = function(node, init) {
+ var isForIn = this.type === types$1._in;
+ this.next();
+
+ if (
+ init.type === "VariableDeclaration" &&
+ init.declarations[0].init != null &&
+ (
+ !isForIn ||
+ this.options.ecmaVersion < 8 ||
+ this.strict ||
+ init.kind !== "var" ||
+ init.declarations[0].id.type !== "Identifier"
+ )
+ ) {
+ this.raise(
+ init.start,
+ ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
+ );
+ }
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
+ this.expect(types$1.parenR);
+ node.body = this.parseStatement("for");
+ this.exitScope();
+ this.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
+ };
+
+ // Parse a list of variable declarations.
+
+ pp$8.parseVar = function(node, isFor, kind) {
+ node.declarations = [];
+ node.kind = kind;
+ for (;;) {
+ var decl = this.startNode();
+ this.parseVarId(decl, kind);
+ if (this.eat(types$1.eq)) {
+ decl.init = this.parseMaybeAssign(isFor);
+ } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
+ this.unexpected();
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
+ this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
+ } else {
+ decl.init = null;
+ }
+ node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(types$1.comma)) { break }
+ }
+ return node
+ };
+
+ pp$8.parseVarId = function(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
+ };
+
+ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
+
+ // Parse a function declaration or literal (depending on the
+ // `statement & FUNC_STATEMENT`).
+
+ // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
+ pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
+ this.initFunction(node);
+ if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
+ if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))
+ { this.unexpected(); }
+ node.generator = this.eat(types$1.star);
+ }
+ if (this.options.ecmaVersion >= 8)
+ { node.async = !!isAsync; }
+
+ if (statement & FUNC_STATEMENT) {
+ node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();
+ if (node.id && !(statement & FUNC_HANGING_STATEMENT))
+ // If it is a regular function declaration in sloppy mode, then it is
+ // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
+ // mode depends on properties of the current scope (see
+ // treatFunctionsAsVar).
+ { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
+ }
+
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+ this.enterScope(functionFlags(node.async, node.generator));
+
+ if (!(statement & FUNC_STATEMENT))
+ { node.id = this.type === types$1.name ? this.parseIdent() : null; }
+
+ this.parseFunctionParams(node);
+ this.parseFunctionBody(node, allowExpressionBody, false, forInit);
+
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
+ };
+
+ pp$8.parseFunctionParams = function(node) {
+ this.expect(types$1.parenL);
+ node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
+ this.checkYieldAwaitInDefaultParams();
+ };
+
+ // Parse a class declaration or literal (depending on the
+ // `isStatement` parameter).
+
+ pp$8.parseClass = function(node, isStatement) {
+ this.next();
+
+ // ecma-262 14.6 Class Definitions
+ // A class definition is always strict mode code.
+ var oldStrict = this.strict;
+ this.strict = true;
+
+ this.parseClassId(node, isStatement);
+ this.parseClassSuper(node);
+ var privateNameMap = this.enterClassBody();
+ var classBody = this.startNode();
+ var hadConstructor = false;
+ classBody.body = [];
+ this.expect(types$1.braceL);
+ while (this.type !== types$1.braceR) {
+ var element = this.parseClassElement(node.superClass !== null);
+ if (element) {
+ classBody.body.push(element);
+ if (element.type === "MethodDefinition" && element.kind === "constructor") {
+ if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
+ hadConstructor = true;
+ } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
+ this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
+ }
+ }
+ }
+ this.strict = oldStrict;
+ this.next();
+ node.body = this.finishNode(classBody, "ClassBody");
+ this.exitClassBody();
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
+ };
+
+ pp$8.parseClassElement = function(constructorAllowsSuper) {
+ if (this.eat(types$1.semi)) { return null }
+
+ var ecmaVersion = this.options.ecmaVersion;
+ var node = this.startNode();
+ var keyName = "";
+ var isGenerator = false;
+ var isAsync = false;
+ var kind = "method";
+ var isStatic = false;
+
+ if (this.eatContextual("static")) {
+ // Parse static init block
+ if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
+ this.parseClassStaticBlock(node);
+ return node
+ }
+ if (this.isClassElementNameStart() || this.type === types$1.star) {
+ isStatic = true;
+ } else {
+ keyName = "static";
+ }
+ }
+ node.static = isStatic;
+ if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
+ if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
+ isAsync = true;
+ } else {
+ keyName = "async";
+ }
+ }
+ if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {
+ isGenerator = true;
+ }
+ if (!keyName && !isAsync && !isGenerator) {
+ var lastValue = this.value;
+ if (this.eatContextual("get") || this.eatContextual("set")) {
+ if (this.isClassElementNameStart()) {
+ kind = lastValue;
+ } else {
+ keyName = lastValue;
+ }
+ }
+ }
+
+ // Parse element name
+ if (keyName) {
+ // 'async', 'get', 'set', or 'static' were not a keyword contextually.
+ // The last token is any of those. Make it the element name.
+ node.computed = false;
+ node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
+ node.key.name = keyName;
+ this.finishNode(node.key, "Identifier");
+ } else {
+ this.parseClassElementName(node);
+ }
+
+ // Parse element value
+ if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
+ var isConstructor = !node.static && checkKeyName(node, "constructor");
+ var allowsDirectSuper = isConstructor && constructorAllowsSuper;
+ // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.
+ if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); }
+ node.kind = isConstructor ? "constructor" : kind;
+ this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
+ } else {
+ this.parseClassField(node);
+ }
+
+ return node
+ };
+
+ pp$8.isClassElementNameStart = function() {
+ return (
+ this.type === types$1.name ||
+ this.type === types$1.privateId ||
+ this.type === types$1.num ||
+ this.type === types$1.string ||
+ this.type === types$1.bracketL ||
+ this.type.keyword
+ )
+ };
+
+ pp$8.parseClassElementName = function(element) {
+ if (this.type === types$1.privateId) {
+ if (this.value === "constructor") {
+ this.raise(this.start, "Classes can't have an element named '#constructor'");
+ }
+ element.computed = false;
+ element.key = this.parsePrivateIdent();
+ } else {
+ this.parsePropertyName(element);
+ }
+ };
+
+ pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
+ // Check key and flags
+ var key = method.key;
+ if (method.kind === "constructor") {
+ if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
+ if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
+ } else if (method.static && checkKeyName(method, "prototype")) {
+ this.raise(key.start, "Classes may not have a static property named prototype");
+ }
+
+ // Parse value
+ var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+
+ // Check value
+ if (method.kind === "get" && value.params.length !== 0)
+ { this.raiseRecoverable(value.start, "getter should have no params"); }
+ if (method.kind === "set" && value.params.length !== 1)
+ { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
+ if (method.kind === "set" && value.params[0].type === "RestElement")
+ { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }
+
+ return this.finishNode(method, "MethodDefinition")
+ };
+
+ pp$8.parseClassField = function(field) {
+ if (checkKeyName(field, "constructor")) {
+ this.raise(field.key.start, "Classes can't have a field named 'constructor'");
+ } else if (field.static && checkKeyName(field, "prototype")) {
+ this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
+ }
+
+ if (this.eat(types$1.eq)) {
+ // To raise SyntaxError if 'arguments' exists in the initializer.
+ var scope = this.currentThisScope();
+ var inClassFieldInit = scope.inClassFieldInit;
+ scope.inClassFieldInit = true;
+ field.value = this.parseMaybeAssign();
+ scope.inClassFieldInit = inClassFieldInit;
+ } else {
+ field.value = null;
+ }
+ this.semicolon();
+
+ return this.finishNode(field, "PropertyDefinition")
+ };
+
+ pp$8.parseClassStaticBlock = function(node) {
+ node.body = [];
+
+ var oldLabels = this.labels;
+ this.labels = [];
+ this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
+ while (this.type !== types$1.braceR) {
+ var stmt = this.parseStatement(null);
+ node.body.push(stmt);
+ }
+ this.next();
+ this.exitScope();
+ this.labels = oldLabels;
+
+ return this.finishNode(node, "StaticBlock")
+ };
+
+ pp$8.parseClassId = function(node, isStatement) {
+ if (this.type === types$1.name) {
+ node.id = this.parseIdent();
+ if (isStatement)
+ { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
+ } else {
+ if (isStatement === true)
+ { this.unexpected(); }
+ node.id = null;
+ }
+ };
+
+ pp$8.parseClassSuper = function(node) {
+ node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
+ };
+
+ pp$8.enterClassBody = function() {
+ var element = {declared: Object.create(null), used: []};
+ this.privateNameStack.push(element);
+ return element.declared
+ };
+
+ pp$8.exitClassBody = function() {
+ var ref = this.privateNameStack.pop();
+ var declared = ref.declared;
+ var used = ref.used;
+ var len = this.privateNameStack.length;
+ var parent = len === 0 ? null : this.privateNameStack[len - 1];
+ for (var i = 0; i < used.length; ++i) {
+ var id = used[i];
+ if (!hasOwn(declared, id.name)) {
+ if (parent) {
+ parent.used.push(id);
+ } else {
+ this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class"));
+ }
+ }
+ }
+ };
+
+ function isPrivateNameConflicted(privateNameMap, element) {
+ var name = element.key.name;
+ var curr = privateNameMap[name];
+
+ var next = "true";
+ if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
+ next = (element.static ? "s" : "i") + element.kind;
+ }
+
+ // `class { get #a(){}; static set #a(_){} }` is also conflict.
+ if (
+ curr === "iget" && next === "iset" ||
+ curr === "iset" && next === "iget" ||
+ curr === "sget" && next === "sset" ||
+ curr === "sset" && next === "sget"
+ ) {
+ privateNameMap[name] = "true";
+ return false
+ } else if (!curr) {
+ privateNameMap[name] = next;
+ return false
+ } else {
+ return true
+ }
+ }
+
+ function checkKeyName(node, name) {
+ var computed = node.computed;
+ var key = node.key;
+ return !computed && (
+ key.type === "Identifier" && key.name === name ||
+ key.type === "Literal" && key.value === name
+ )
+ }
+
+ // Parses module export declaration.
+
+ pp$8.parseExport = function(node, exports) {
+ this.next();
+ // export * from '...'
+ if (this.eat(types$1.star)) {
+ if (this.options.ecmaVersion >= 11) {
+ if (this.eatContextual("as")) {
+ node.exported = this.parseModuleExportName();
+ this.checkExport(exports, node.exported, this.lastTokStart);
+ } else {
+ node.exported = null;
+ }
+ }
+ this.expectContextual("from");
+ if (this.type !== types$1.string) { this.unexpected(); }
+ node.source = this.parseExprAtom();
+ this.semicolon();
+ return this.finishNode(node, "ExportAllDeclaration")
+ }
+ if (this.eat(types$1._default)) { // export default ...
+ this.checkExport(exports, "default", this.lastTokStart);
+ var isAsync;
+ if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
+ var fNode = this.startNode();
+ this.next();
+ if (isAsync) { this.next(); }
+ node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
+ } else if (this.type === types$1._class) {
+ var cNode = this.startNode();
+ node.declaration = this.parseClass(cNode, "nullableID");
+ } else {
+ node.declaration = this.parseMaybeAssign();
+ this.semicolon();
+ }
+ return this.finishNode(node, "ExportDefaultDeclaration")
+ }
+ // export var|const|let|function|class ...
+ if (this.shouldParseExportStatement()) {
+ node.declaration = this.parseStatement(null);
+ if (node.declaration.type === "VariableDeclaration")
+ { this.checkVariableExport(exports, node.declaration.declarations); }
+ else
+ { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
+ node.specifiers = [];
+ node.source = null;
+ } else { // export { x, y as z } [from '...']
+ node.declaration = null;
+ node.specifiers = this.parseExportSpecifiers(exports);
+ if (this.eatContextual("from")) {
+ if (this.type !== types$1.string) { this.unexpected(); }
+ node.source = this.parseExprAtom();
+ } else {
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
+ // check for keywords used as local names
+ var spec = list[i];
+
+ this.checkUnreserved(spec.local);
+ // check if export is defined
+ this.checkLocalExport(spec.local);
+
+ if (spec.local.type === "Literal") {
+ this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
+ }
+ }
+
+ node.source = null;
+ }
+ this.semicolon();
+ }
+ return this.finishNode(node, "ExportNamedDeclaration")
+ };
+
+ pp$8.checkExport = function(exports, name, pos) {
+ if (!exports) { return }
+ if (typeof name !== "string")
+ { name = name.type === "Identifier" ? name.name : name.value; }
+ if (hasOwn(exports, name))
+ { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
+ exports[name] = true;
+ };
+
+ pp$8.checkPatternExport = function(exports, pat) {
+ var type = pat.type;
+ if (type === "Identifier")
+ { this.checkExport(exports, pat, pat.start); }
+ else if (type === "ObjectPattern")
+ { for (var i = 0, list = pat.properties; i < list.length; i += 1)
+ {
+ var prop = list[i];
+
+ this.checkPatternExport(exports, prop);
+ } }
+ else if (type === "ArrayPattern")
+ { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
+ var elt = list$1[i$1];
+
+ if (elt) { this.checkPatternExport(exports, elt); }
+ } }
+ else if (type === "Property")
+ { this.checkPatternExport(exports, pat.value); }
+ else if (type === "AssignmentPattern")
+ { this.checkPatternExport(exports, pat.left); }
+ else if (type === "RestElement")
+ { this.checkPatternExport(exports, pat.argument); }
+ else if (type === "ParenthesizedExpression")
+ { this.checkPatternExport(exports, pat.expression); }
+ };
+
+ pp$8.checkVariableExport = function(exports, decls) {
+ if (!exports) { return }
+ for (var i = 0, list = decls; i < list.length; i += 1)
+ {
+ var decl = list[i];
+
+ this.checkPatternExport(exports, decl.id);
+ }
+ };
+
+ pp$8.shouldParseExportStatement = function() {
+ return this.type.keyword === "var" ||
+ this.type.keyword === "const" ||
+ this.type.keyword === "class" ||
+ this.type.keyword === "function" ||
+ this.isLet() ||
+ this.isAsyncFunction()
+ };
+
+ // Parses a comma-separated list of module exports.
+
+ pp$8.parseExportSpecifiers = function(exports) {
+ var nodes = [], first = true;
+ // export { x, y as z } [from '...']
+ this.expect(types$1.braceL);
+ while (!this.eat(types$1.braceR)) {
+ if (!first) {
+ this.expect(types$1.comma);
+ if (this.afterTrailingComma(types$1.braceR)) { break }
+ } else { first = false; }
+
+ var node = this.startNode();
+ node.local = this.parseModuleExportName();
+ node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
+ this.checkExport(
+ exports,
+ node.exported,
+ node.exported.start
+ );
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
+ }
+ return nodes
+ };
+
+ // Parses import declaration.
+
+ pp$8.parseImport = function(node) {
+ this.next();
+ // import '...'
+ if (this.type === types$1.string) {
+ node.specifiers = empty$1;
+ node.source = this.parseExprAtom();
+ } else {
+ node.specifiers = this.parseImportSpecifiers();
+ this.expectContextual("from");
+ node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
+ }
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration")
+ };
+
+ // Parses a comma-separated list of module imports.
+
+ pp$8.parseImportSpecifiers = function() {
+ var nodes = [], first = true;
+ if (this.type === types$1.name) {
+ // import defaultObj, { x, y as z } from '...'
+ var node = this.startNode();
+ node.local = this.parseIdent();
+ this.checkLValSimple(node.local, BIND_LEXICAL);
+ nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
+ if (!this.eat(types$1.comma)) { return nodes }
+ }
+ if (this.type === types$1.star) {
+ var node$1 = this.startNode();
+ this.next();
+ this.expectContextual("as");
+ node$1.local = this.parseIdent();
+ this.checkLValSimple(node$1.local, BIND_LEXICAL);
+ nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
+ return nodes
+ }
+ this.expect(types$1.braceL);
+ while (!this.eat(types$1.braceR)) {
+ if (!first) {
+ this.expect(types$1.comma);
+ if (this.afterTrailingComma(types$1.braceR)) { break }
+ } else { first = false; }
+
+ var node$2 = this.startNode();
+ node$2.imported = this.parseModuleExportName();
+ if (this.eatContextual("as")) {
+ node$2.local = this.parseIdent();
+ } else {
+ this.checkUnreserved(node$2.imported);
+ node$2.local = node$2.imported;
+ }
+ this.checkLValSimple(node$2.local, BIND_LEXICAL);
+ nodes.push(this.finishNode(node$2, "ImportSpecifier"));
+ }
+ return nodes
+ };
+
+ pp$8.parseModuleExportName = function() {
+ if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
+ var stringLiteral = this.parseLiteral(this.value);
+ if (loneSurrogate.test(stringLiteral.value)) {
+ this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
+ }
+ return stringLiteral
+ }
+ return this.parseIdent(true)
+ };
+
+ // Set `ExpressionStatement#directive` property for directive prologues.
+ pp$8.adaptDirectivePrologue = function(statements) {
+ for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
+ statements[i].directive = statements[i].expression.raw.slice(1, -1);
+ }
+ };
+ pp$8.isDirectiveCandidate = function(statement) {
+ return (
+ this.options.ecmaVersion >= 5 &&
+ statement.type === "ExpressionStatement" &&
+ statement.expression.type === "Literal" &&
+ typeof statement.expression.value === "string" &&
+ // Reject parenthesized strings.
+ (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
+ )
+ };
+
+ var pp$7 = Parser.prototype;
+
+ // Convert existing expression atom to assignable pattern
+ // if possible.
+
+ pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
+ if (this.options.ecmaVersion >= 6 && node) {
+ switch (node.type) {
+ case "Identifier":
+ if (this.inAsync && node.name === "await")
+ { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
+ break
+
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ break
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+ if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
+ var prop = list[i];
+
+ this.toAssignable(prop, isBinding);
+ // Early error:
+ // AssignmentRestProperty[Yield, Await] :
+ // `...` DestructuringAssignmentTarget[Yield, Await]
+ //
+ // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
+ if (
+ prop.type === "RestElement" &&
+ (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
+ ) {
+ this.raise(prop.argument.start, "Unexpected token");
+ }
+ }
+ break
+
+ case "Property":
+ // AssignmentProperty has type === "Property"
+ if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
+ this.toAssignable(node.value, isBinding);
+ break
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+ this.toAssignableList(node.elements, isBinding);
+ break
+
+ case "SpreadElement":
+ node.type = "RestElement";
+ this.toAssignable(node.argument, isBinding);
+ if (node.argument.type === "AssignmentPattern")
+ { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
+ break
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isBinding);
+ break
+
+ case "ParenthesizedExpression":
+ this.toAssignable(node.expression, isBinding, refDestructuringErrors);
+ break
+
+ case "ChainExpression":
+ this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
+ break
+
+ case "MemberExpression":
+ if (!isBinding) { break }
+
+ default:
+ this.raise(node.start, "Assigning to rvalue");
+ }
+ } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+ return node
+ };
+
+ // Convert list of expression atoms to binding list.
+
+ pp$7.toAssignableList = function(exprList, isBinding) {
+ var end = exprList.length;
+ for (var i = 0; i < end; i++) {
+ var elt = exprList[i];
+ if (elt) { this.toAssignable(elt, isBinding); }
+ }
+ if (end) {
+ var last = exprList[end - 1];
+ if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
+ { this.unexpected(last.argument.start); }
+ }
+ return exprList
+ };
+
+ // Parses spread element.
+
+ pp$7.parseSpread = function(refDestructuringErrors) {
+ var node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
+ return this.finishNode(node, "SpreadElement")
+ };
+
+ pp$7.parseRestBinding = function() {
+ var node = this.startNode();
+ this.next();
+
+ // RestElement inside of a function parameter must be an identifier
+ if (this.options.ecmaVersion === 6 && this.type !== types$1.name)
+ { this.unexpected(); }
+
+ node.argument = this.parseBindingAtom();
+
+ return this.finishNode(node, "RestElement")
+ };
+
+ // Parses lvalue (assignable) atom.
+
+ pp$7.parseBindingAtom = function() {
+ if (this.options.ecmaVersion >= 6) {
+ switch (this.type) {
+ case types$1.bracketL:
+ var node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(types$1.bracketR, true, true);
+ return this.finishNode(node, "ArrayPattern")
+
+ case types$1.braceL:
+ return this.parseObj(true)
+ }
+ }
+ return this.parseIdent()
+ };
+
+ pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
+ var elts = [], first = true;
+ while (!this.eat(close)) {
+ if (first) { first = false; }
+ else { this.expect(types$1.comma); }
+ if (allowEmpty && this.type === types$1.comma) {
+ elts.push(null);
+ } else if (allowTrailingComma && this.afterTrailingComma(close)) {
+ break
+ } else if (this.type === types$1.ellipsis) {
+ var rest = this.parseRestBinding();
+ this.parseBindingListItem(rest);
+ elts.push(rest);
+ if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
+ this.expect(close);
+ break
+ } else {
+ var elem = this.parseMaybeDefault(this.start, this.startLoc);
+ this.parseBindingListItem(elem);
+ elts.push(elem);
+ }
+ }
+ return elts
+ };
+
+ pp$7.parseBindingListItem = function(param) {
+ return param
+ };
+
+ // Parses assignment pattern around given atom if possible.
+
+ pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
+ left = left || this.parseBindingAtom();
+ if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }
+ var node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssign();
+ return this.finishNode(node, "AssignmentPattern")
+ };
+
+ // The following three functions all verify that a node is an lvalue —
+ // something that can be bound, or assigned to. In order to do so, they perform
+ // a variety of checks:
+ //
+ // - Check that none of the bound/assigned-to identifiers are reserved words.
+ // - Record name declarations for bindings in the appropriate scope.
+ // - Check duplicate argument names, if checkClashes is set.
+ //
+ // If a complex binding pattern is encountered (e.g., object and array
+ // destructuring), the entire pattern is recursively checked.
+ //
+ // There are three versions of checkLVal*() appropriate for different
+ // circumstances:
+ //
+ // - checkLValSimple() shall be used if the syntactic construct supports
+ // nothing other than identifiers and member expressions. Parenthesized
+ // expressions are also correctly handled. This is generally appropriate for
+ // constructs for which the spec says
+ //
+ // > It is a Syntax Error if AssignmentTargetType of [the production] is not
+ // > simple.
+ //
+ // It is also appropriate for checking if an identifier is valid and not
+ // defined elsewhere, like import declarations or function/class identifiers.
+ //
+ // Examples where this is used include:
+ // a += …;
+ // import a from '…';
+ // where a is the node to be checked.
+ //
+ // - checkLValPattern() shall be used if the syntactic construct supports
+ // anything checkLValSimple() supports, as well as object and array
+ // destructuring patterns. This is generally appropriate for constructs for
+ // which the spec says
+ //
+ // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
+ // > an ArrayLiteral and AssignmentTargetType of [the production] is not
+ // > simple.
+ //
+ // Examples where this is used include:
+ // (a = …);
+ // const a = …;
+ // try { … } catch (a) { … }
+ // where a is the node to be checked.
+ //
+ // - checkLValInnerPattern() shall be used if the syntactic construct supports
+ // anything checkLValPattern() supports, as well as default assignment
+ // patterns, rest elements, and other constructs that may appear within an
+ // object or array destructuring pattern.
+ //
+ // As a special case, function parameters also use checkLValInnerPattern(),
+ // as they also support defaults and rest constructs.
+ //
+ // These functions deliberately support both assignment and binding constructs,
+ // as the logic for both is exceedingly similar. If the node is the target of
+ // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
+ // should be set to the appropriate BIND_* constant, like BIND_VAR or
+ // BIND_LEXICAL.
+ //
+ // If the function is called with a non-BIND_NONE bindingType, then
+ // additionally a checkClashes object may be specified to allow checking for
+ // duplicate argument names. checkClashes is ignored if the provided construct
+ // is an assignment (i.e., bindingType is BIND_NONE).
+
+ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ var isBind = bindingType !== BIND_NONE;
+
+ switch (expr.type) {
+ case "Identifier":
+ if (this.strict && this.reservedWordsStrictBind.test(expr.name))
+ { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
+ if (isBind) {
+ if (bindingType === BIND_LEXICAL && expr.name === "let")
+ { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
+ if (checkClashes) {
+ if (hasOwn(checkClashes, expr.name))
+ { this.raiseRecoverable(expr.start, "Argument name clash"); }
+ checkClashes[expr.name] = true;
+ }
+ if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
+ }
+ break
+
+ case "ChainExpression":
+ this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
+ break
+
+ case "MemberExpression":
+ if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
+ break
+
+ case "ParenthesizedExpression":
+ if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
+ return this.checkLValSimple(expr.expression, bindingType, checkClashes)
+
+ default:
+ this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
+ }
+ };
+
+ pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ switch (expr.type) {
+ case "ObjectPattern":
+ for (var i = 0, list = expr.properties; i < list.length; i += 1) {
+ var prop = list[i];
+
+ this.checkLValInnerPattern(prop, bindingType, checkClashes);
+ }
+ break
+
+ case "ArrayPattern":
+ for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
+ var elem = list$1[i$1];
+
+ if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
+ }
+ break
+
+ default:
+ this.checkLValSimple(expr, bindingType, checkClashes);
+ }
+ };
+
+ pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ switch (expr.type) {
+ case "Property":
+ // AssignmentProperty has type === "Property"
+ this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
+ break
+
+ case "AssignmentPattern":
+ this.checkLValPattern(expr.left, bindingType, checkClashes);
+ break
+
+ case "RestElement":
+ this.checkLValPattern(expr.argument, bindingType, checkClashes);
+ break
+
+ default:
+ this.checkLValPattern(expr, bindingType, checkClashes);
+ }
+ };
+
+ // The algorithm used to determine whether a regexp can appear at a
+
+ var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
+ this.token = token;
+ this.isExpr = !!isExpr;
+ this.preserveSpace = !!preserveSpace;
+ this.override = override;
+ this.generator = !!generator;
+ };
+
+ var types = {
+ b_stat: new TokContext("{", false),
+ b_expr: new TokContext("{", true),
+ b_tmpl: new TokContext("${", false),
+ p_stat: new TokContext("(", false),
+ p_expr: new TokContext("(", true),
+ q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
+ f_stat: new TokContext("function", false),
+ f_expr: new TokContext("function", true),
+ f_expr_gen: new TokContext("function", true, false, null, true),
+ f_gen: new TokContext("function", false, false, null, true)
+ };
+
+ var pp$6 = Parser.prototype;
+
+ pp$6.initialContext = function() {
+ return [types.b_stat]
+ };
+
+ pp$6.curContext = function() {
+ return this.context[this.context.length - 1]
+ };
+
+ pp$6.braceIsBlock = function(prevType) {
+ var parent = this.curContext();
+ if (parent === types.f_expr || parent === types.f_stat)
+ { return true }
+ if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))
+ { return !parent.isExpr }
+
+ // The check for `tt.name && exprAllowed` detects whether we are
+ // after a `yield` or `of` construct. See the `updateContext` for
+ // `tt.name`.
+ if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)
+ { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
+ if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)
+ { return true }
+ if (prevType === types$1.braceL)
+ { return parent === types.b_stat }
+ if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)
+ { return false }
+ return !this.exprAllowed
+ };
+
+ pp$6.inGeneratorContext = function() {
+ for (var i = this.context.length - 1; i >= 1; i--) {
+ var context = this.context[i];
+ if (context.token === "function")
+ { return context.generator }
+ }
+ return false
+ };
+
+ pp$6.updateContext = function(prevType) {
+ var update, type = this.type;
+ if (type.keyword && prevType === types$1.dot)
+ { this.exprAllowed = false; }
+ else if (update = type.updateContext)
+ { update.call(this, prevType); }
+ else
+ { this.exprAllowed = type.beforeExpr; }
+ };
+
+ // Used to handle egde cases when token context could not be inferred correctly during tokenization phase
+
+ pp$6.overrideContext = function(tokenCtx) {
+ if (this.curContext() !== tokenCtx) {
+ this.context[this.context.length - 1] = tokenCtx;
+ }
+ };
+
+ // Token-specific context update code
+
+ types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
+ if (this.context.length === 1) {
+ this.exprAllowed = true;
+ return
+ }
+ var out = this.context.pop();
+ if (out === types.b_stat && this.curContext().token === "function") {
+ out = this.context.pop();
+ }
+ this.exprAllowed = !out.isExpr;
+ };
+
+ types$1.braceL.updateContext = function(prevType) {
+ this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
+ this.exprAllowed = true;
+ };
+
+ types$1.dollarBraceL.updateContext = function() {
+ this.context.push(types.b_tmpl);
+ this.exprAllowed = true;
+ };
+
+ types$1.parenL.updateContext = function(prevType) {
+ var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
+ this.context.push(statementParens ? types.p_stat : types.p_expr);
+ this.exprAllowed = true;
+ };
+
+ types$1.incDec.updateContext = function() {
+ // tokExprAllowed stays unchanged
+ };
+
+ types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
+ if (prevType.beforeExpr && prevType !== types$1._else &&
+ !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&
+ !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
+ !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))
+ { this.context.push(types.f_expr); }
+ else
+ { this.context.push(types.f_stat); }
+ this.exprAllowed = false;
+ };
+
+ types$1.backQuote.updateContext = function() {
+ if (this.curContext() === types.q_tmpl)
+ { this.context.pop(); }
+ else
+ { this.context.push(types.q_tmpl); }
+ this.exprAllowed = false;
+ };
+
+ types$1.star.updateContext = function(prevType) {
+ if (prevType === types$1._function) {
+ var index = this.context.length - 1;
+ if (this.context[index] === types.f_expr)
+ { this.context[index] = types.f_expr_gen; }
+ else
+ { this.context[index] = types.f_gen; }
+ }
+ this.exprAllowed = true;
+ };
+
+ types$1.name.updateContext = function(prevType) {
+ var allowed = false;
+ if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {
+ if (this.value === "of" && !this.exprAllowed ||
+ this.value === "yield" && this.inGeneratorContext())
+ { allowed = true; }
+ }
+ this.exprAllowed = allowed;
+ };
+
+ // A recursive descent parser operates by defining functions for all
+
+ var pp$5 = Parser.prototype;
+
+ // Check if property name clashes with already added.
+ // Object/class getters and setters are not allowed to clash —
+ // either with each other or with an init property — and in
+ // strict mode, init properties are also not allowed to be repeated.
+
+ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
+ if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
+ { return }
+ if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
+ { return }
+ var key = prop.key;
+ var name;
+ switch (key.type) {
+ case "Identifier": name = key.name; break
+ case "Literal": name = String(key.value); break
+ default: return
+ }
+ var kind = prop.kind;
+ if (this.options.ecmaVersion >= 6) {
+ if (name === "__proto__" && kind === "init") {
+ if (propHash.proto) {
+ if (refDestructuringErrors) {
+ if (refDestructuringErrors.doubleProto < 0) {
+ refDestructuringErrors.doubleProto = key.start;
+ }
+ } else {
+ this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
+ }
+ }
+ propHash.proto = true;
+ }
+ return
+ }
+ name = "$" + name;
+ var other = propHash[name];
+ if (other) {
+ var redefinition;
+ if (kind === "init") {
+ redefinition = this.strict && other.init || other.get || other.set;
+ } else {
+ redefinition = other.init || other[kind];
+ }
+ if (redefinition)
+ { this.raiseRecoverable(key.start, "Redefinition of property"); }
+ } else {
+ other = propHash[name] = {
+ init: false,
+ get: false,
+ set: false
+ };
+ }
+ other[kind] = true;
+ };
+
+ // ### Expression parsing
+
+ // These nest, from the most general expression type at the top to
+ // 'atomic', nondivisible expression types at the bottom. Most of
+ // the functions will simply let the function(s) below them parse,
+ // and, *if* the syntactic construct they handle is present, wrap
+ // the AST node that the inner parser gave them in another node.
+
+ // Parse a full expression. The optional arguments are used to
+ // forbid the `in` operator (in for loops initalization expressions)
+ // and provide reference for storing '=' operator inside shorthand
+ // property assignment in contexts where both object expression
+ // and object pattern might appear (so it's possible to raise
+ // delayed syntax error at correct position).
+
+ pp$5.parseExpression = function(forInit, refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
+ if (this.type === types$1.comma) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+ while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }
+ return this.finishNode(node, "SequenceExpression")
+ }
+ return expr
+ };
+
+ // Parse an assignment expression. This includes applications of
+ // operators like `+=`.
+
+ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
+ if (this.isContextual("yield")) {
+ if (this.inGenerator) { return this.parseYield(forInit) }
+ // The tokenizer will assume an expression is allowed after
+ // `yield`, but this isn't that kind of yield
+ else { this.exprAllowed = false; }
+ }
+
+ var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
+ if (refDestructuringErrors) {
+ oldParenAssign = refDestructuringErrors.parenthesizedAssign;
+ oldTrailingComma = refDestructuringErrors.trailingComma;
+ oldDoubleProto = refDestructuringErrors.doubleProto;
+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
+ } else {
+ refDestructuringErrors = new DestructuringErrors;
+ ownDestructuringErrors = true;
+ }
+
+ var startPos = this.start, startLoc = this.startLoc;
+ if (this.type === types$1.parenL || this.type === types$1.name) {
+ this.potentialArrowAt = this.start;
+ this.potentialArrowInForAwait = forInit === "await";
+ }
+ var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
+ if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
+ if (this.type.isAssign) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.value;
+ if (this.type === types$1.eq)
+ { left = this.toAssignable(left, false, refDestructuringErrors); }
+ if (!ownDestructuringErrors) {
+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
+ }
+ if (refDestructuringErrors.shorthandAssign >= left.start)
+ { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
+ if (this.type === types$1.eq)
+ { this.checkLValPattern(left); }
+ else
+ { this.checkLValSimple(left); }
+ node.left = left;
+ this.next();
+ node.right = this.parseMaybeAssign(forInit);
+ if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }
+ return this.finishNode(node, "AssignmentExpression")
+ } else {
+ if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
+ }
+ if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
+ if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
+ return left
+ };
+
+ // Parse a ternary conditional (`?:`) operator.
+
+ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseExprOps(forInit, refDestructuringErrors);
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+ if (this.eat(types$1.question)) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssign();
+ this.expect(types$1.colon);
+ node.alternate = this.parseMaybeAssign(forInit);
+ return this.finishNode(node, "ConditionalExpression")
+ }
+ return expr
+ };
+
+ // Start the precedence parser.
+
+ pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+ return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)
+ };
+
+ // Parse binary operators with the operator precedence parsing
+ // algorithm. `left` is the left-hand side of the operator.
+ // `minPrec` provides context that allows the function to stop and
+ // defer further parser to one of its callers when it encounters an
+ // operator that has a lower precedence than the set it is parsing.
+
+ pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
+ var prec = this.type.binop;
+ if (prec != null && (!forInit || this.type !== types$1._in)) {
+ if (prec > minPrec) {
+ var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;
+ var coalesce = this.type === types$1.coalesce;
+ if (coalesce) {
+ // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
+ // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
+ prec = types$1.logicalAND.binop;
+ }
+ var op = this.value;
+ this.next();
+ var startPos = this.start, startLoc = this.startLoc;
+ var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
+ var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
+ if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {
+ this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
+ }
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)
+ }
+ }
+ return left
+ };
+
+ pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
+ if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); }
+ var node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.operator = op;
+ node.right = right;
+ return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
+ };
+
+ // Parse unary operators, both prefix and postfix.
+
+ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
+ var startPos = this.start, startLoc = this.startLoc, expr;
+ if (this.isContextual("await") && this.canAwait) {
+ expr = this.parseAwait(forInit);
+ sawUnary = true;
+ } else if (this.type.prefix) {
+ var node = this.startNode(), update = this.type === types$1.incDec;
+ node.operator = this.value;
+ node.prefix = true;
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true, update, forInit);
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ if (update) { this.checkLValSimple(node.argument); }
+ else if (this.strict && node.operator === "delete" &&
+ node.argument.type === "Identifier")
+ { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
+ else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
+ { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
+ else { sawUnary = true; }
+ expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+ } else if (!sawUnary && this.type === types$1.privateId) {
+ if (forInit || this.privateNameStack.length === 0) { this.unexpected(); }
+ expr = this.parsePrivateIdent();
+ // only could be private fields in 'in', such as #x in obj
+ if (this.type !== types$1._in) { this.unexpected(); }
+ } else {
+ expr = this.parseExprSubscripts(refDestructuringErrors, forInit);
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+ while (this.type.postfix && !this.canInsertSemicolon()) {
+ var node$1 = this.startNodeAt(startPos, startLoc);
+ node$1.operator = this.value;
+ node$1.prefix = false;
+ node$1.argument = expr;
+ this.checkLValSimple(expr);
+ this.next();
+ expr = this.finishNode(node$1, "UpdateExpression");
+ }
+ }
+
+ if (!incDec && this.eat(types$1.starstar)) {
+ if (sawUnary)
+ { this.unexpected(this.lastTokStart); }
+ else
+ { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
+ } else {
+ return expr
+ }
+ };
+
+ function isPrivateFieldAccess(node) {
+ return (
+ node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
+ node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
+ )
+ }
+
+ // Parse call, dot, and `[]`-subscript expressions.
+
+ pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseExprAtom(refDestructuringErrors, forInit);
+ if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
+ { return expr }
+ var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
+ if (refDestructuringErrors && result.type === "MemberExpression") {
+ if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
+ if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
+ if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }
+ }
+ return result
+ };
+
+ pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
+ var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
+ this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
+ this.potentialArrowAt === base.start;
+ var optionalChained = false;
+
+ while (true) {
+ var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);
+
+ if (element.optional) { optionalChained = true; }
+ if (element === base || element.type === "ArrowFunctionExpression") {
+ if (optionalChained) {
+ var chainNode = this.startNodeAt(startPos, startLoc);
+ chainNode.expression = element;
+ element = this.finishNode(chainNode, "ChainExpression");
+ }
+ return element
+ }
+
+ base = element;
+ }
+ };
+
+ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
+ var optionalSupported = this.options.ecmaVersion >= 11;
+ var optional = optionalSupported && this.eat(types$1.questionDot);
+ if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
+
+ var computed = this.eat(types$1.bracketL);
+ if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ if (computed) {
+ node.property = this.parseExpression();
+ this.expect(types$1.bracketR);
+ } else if (this.type === types$1.privateId && base.type !== "Super") {
+ node.property = this.parsePrivateIdent();
+ } else {
+ node.property = this.parseIdent(this.options.allowReserved !== "never");
+ }
+ node.computed = !!computed;
+ if (optionalSupported) {
+ node.optional = optional;
+ }
+ base = this.finishNode(node, "MemberExpression");
+ } else if (!noCalls && this.eat(types$1.parenL)) {
+ var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+ var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
+ if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {
+ this.checkPatternErrors(refDestructuringErrors, false);
+ this.checkYieldAwaitInDefaultParams();
+ if (this.awaitIdentPos > 0)
+ { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
+ }
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ this.yieldPos = oldYieldPos || this.yieldPos;
+ this.awaitPos = oldAwaitPos || this.awaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
+ var node$1 = this.startNodeAt(startPos, startLoc);
+ node$1.callee = base;
+ node$1.arguments = exprList;
+ if (optionalSupported) {
+ node$1.optional = optional;
+ }
+ base = this.finishNode(node$1, "CallExpression");
+ } else if (this.type === types$1.backQuote) {
+ if (optional || optionalChained) {
+ this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
+ }
+ var node$2 = this.startNodeAt(startPos, startLoc);
+ node$2.tag = base;
+ node$2.quasi = this.parseTemplate({isTagged: true});
+ base = this.finishNode(node$2, "TaggedTemplateExpression");
+ }
+ return base
+ };
+
+ // Parse an atomic expression — either a single token that is an
+ // expression, an expression started by a keyword like `function` or
+ // `new`, or an expression wrapped in punctuation like `()`, `[]`,
+ // or `{}`.
+
+ pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {
+ // If a division operator appears in an expression position, the
+ // tokenizer got confused, and we force it to read a regexp instead.
+ if (this.type === types$1.slash) { this.readRegexp(); }
+
+ var node, canBeArrow = this.potentialArrowAt === this.start;
+ switch (this.type) {
+ case types$1._super:
+ if (!this.allowSuper)
+ { this.raise(this.start, "'super' keyword outside a method"); }
+ node = this.startNode();
+ this.next();
+ if (this.type === types$1.parenL && !this.allowDirectSuper)
+ { this.raise(node.start, "super() call outside constructor of a subclass"); }
+ // The `super` keyword can appear at below:
+ // SuperProperty:
+ // super [ Expression ]
+ // super . IdentifierName
+ // SuperCall:
+ // super ( Arguments )
+ if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)
+ { this.unexpected(); }
+ return this.finishNode(node, "Super")
+
+ case types$1._this:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression")
+
+ case types$1.name:
+ var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
+ var id = this.parseIdent(false);
+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) {
+ this.overrideContext(types.f_expr);
+ return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)
+ }
+ if (canBeArrow && !this.canInsertSemicolon()) {
+ if (this.eat(types$1.arrow))
+ { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
+ if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc &&
+ (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
+ id = this.parseIdent(false);
+ if (this.canInsertSemicolon() || !this.eat(types$1.arrow))
+ { this.unexpected(); }
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
+ }
+ }
+ return id
+
+ case types$1.regexp:
+ var value = this.value;
+ node = this.parseLiteral(value.value);
+ node.regex = {pattern: value.pattern, flags: value.flags};
+ return node
+
+ case types$1.num: case types$1.string:
+ return this.parseLiteral(this.value)
+
+ case types$1._null: case types$1._true: case types$1._false:
+ node = this.startNode();
+ node.value = this.type === types$1._null ? null : this.type === types$1._true;
+ node.raw = this.type.keyword;
+ this.next();
+ return this.finishNode(node, "Literal")
+
+ case types$1.parenL:
+ var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
+ if (refDestructuringErrors) {
+ if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
+ { refDestructuringErrors.parenthesizedAssign = start; }
+ if (refDestructuringErrors.parenthesizedBind < 0)
+ { refDestructuringErrors.parenthesizedBind = start; }
+ }
+ return expr
+
+ case types$1.bracketL:
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
+ return this.finishNode(node, "ArrayExpression")
+
+ case types$1.braceL:
+ this.overrideContext(types.b_expr);
+ return this.parseObj(false, refDestructuringErrors)
+
+ case types$1._function:
+ node = this.startNode();
+ this.next();
+ return this.parseFunction(node, 0)
+
+ case types$1._class:
+ return this.parseClass(this.startNode(), false)
+
+ case types$1._new:
+ return this.parseNew()
+
+ case types$1.backQuote:
+ return this.parseTemplate()
+
+ case types$1._import:
+ if (this.options.ecmaVersion >= 11) {
+ return this.parseExprImport()
+ } else {
+ return this.unexpected()
+ }
+
+ default:
+ this.unexpected();
+ }
+ };
+
+ pp$5.parseExprImport = function() {
+ var node = this.startNode();
+
+ // Consume `import` as an identifier for `import.meta`.
+ // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
+ if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
+ var meta = this.parseIdent(true);
+
+ switch (this.type) {
+ case types$1.parenL:
+ return this.parseDynamicImport(node)
+ case types$1.dot:
+ node.meta = meta;
+ return this.parseImportMeta(node)
+ default:
+ this.unexpected();
+ }
+ };
+
+ pp$5.parseDynamicImport = function(node) {
+ this.next(); // skip `(`
+
+ // Parse node.source.
+ node.source = this.parseMaybeAssign();
+
+ // Verify ending.
+ if (!this.eat(types$1.parenR)) {
+ var errorPos = this.start;
+ if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
+ this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
+ } else {
+ this.unexpected(errorPos);
+ }
+ }
+
+ return this.finishNode(node, "ImportExpression")
+ };
+
+ pp$5.parseImportMeta = function(node) {
+ this.next(); // skip `.`
+
+ var containsEsc = this.containsEsc;
+ node.property = this.parseIdent(true);
+
+ if (node.property.name !== "meta")
+ { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
+ if (containsEsc)
+ { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
+ if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere)
+ { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
+
+ return this.finishNode(node, "MetaProperty")
+ };
+
+ pp$5.parseLiteral = function(value) {
+ var node = this.startNode();
+ node.value = value;
+ node.raw = this.input.slice(this.start, this.end);
+ if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
+ this.next();
+ return this.finishNode(node, "Literal")
+ };
+
+ pp$5.parseParenExpression = function() {
+ this.expect(types$1.parenL);
+ var val = this.parseExpression();
+ this.expect(types$1.parenR);
+ return val
+ };
+
+ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
+ var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
+ if (this.options.ecmaVersion >= 6) {
+ this.next();
+
+ var innerStartPos = this.start, innerStartLoc = this.startLoc;
+ var exprList = [], first = true, lastIsComma = false;
+ var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ // Do not save awaitIdentPos to allow checking awaits nested in parameters
+ while (this.type !== types$1.parenR) {
+ first ? first = false : this.expect(types$1.comma);
+ if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {
+ lastIsComma = true;
+ break
+ } else if (this.type === types$1.ellipsis) {
+ spreadStart = this.start;
+ exprList.push(this.parseParenItem(this.parseRestBinding()));
+ if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
+ break
+ } else {
+ exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
+ }
+ }
+ var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
+ this.expect(types$1.parenR);
+
+ if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {
+ this.checkPatternErrors(refDestructuringErrors, false);
+ this.checkYieldAwaitInDefaultParams();
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ return this.parseParenArrowList(startPos, startLoc, exprList, forInit)
+ }
+
+ if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
+ if (spreadStart) { this.unexpected(spreadStart); }
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ this.yieldPos = oldYieldPos || this.yieldPos;
+ this.awaitPos = oldAwaitPos || this.awaitPos;
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+ } else {
+ val = this.parseParenExpression();
+ }
+
+ if (this.options.preserveParens) {
+ var par = this.startNodeAt(startPos, startLoc);
+ par.expression = val;
+ return this.finishNode(par, "ParenthesizedExpression")
+ } else {
+ return val
+ }
+ };
+
+ pp$5.parseParenItem = function(item) {
+ return item
+ };
+
+ pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)
+ };
+
+ // New's precedence is slightly tricky. It must allow its argument to
+ // be a `[]` or dot subscript expression, but not a call — at least,
+ // not without wrapping it in parentheses. Thus, it uses the noCalls
+ // argument to parseSubscripts to prevent it from consuming the
+ // argument list.
+
+ var empty = [];
+
+ pp$5.parseNew = function() {
+ if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
+ var node = this.startNode();
+ var meta = this.parseIdent(true);
+ if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) {
+ node.meta = meta;
+ var containsEsc = this.containsEsc;
+ node.property = this.parseIdent(true);
+ if (node.property.name !== "target")
+ { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
+ if (containsEsc)
+ { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
+ if (!this.allowNewDotTarget)
+ { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); }
+ return this.finishNode(node, "MetaProperty")
+ }
+ var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import;
+ node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);
+ if (isImport && node.callee.type === "ImportExpression") {
+ this.raise(startPos, "Cannot use new with import()");
+ }
+ if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
+ else { node.arguments = empty; }
+ return this.finishNode(node, "NewExpression")
+ };
+
+ // Parse template expression.
+
+ pp$5.parseTemplateElement = function(ref) {
+ var isTagged = ref.isTagged;
+
+ var elem = this.startNode();
+ if (this.type === types$1.invalidTemplate) {
+ if (!isTagged) {
+ this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
+ }
+ elem.value = {
+ raw: this.value,
+ cooked: null
+ };
+ } else {
+ elem.value = {
+ raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
+ cooked: this.value
+ };
+ }
+ this.next();
+ elem.tail = this.type === types$1.backQuote;
+ return this.finishNode(elem, "TemplateElement")
+ };
+
+ pp$5.parseTemplate = function(ref) {
+ if ( ref === void 0 ) ref = {};
+ var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
+
+ var node = this.startNode();
+ this.next();
+ node.expressions = [];
+ var curElt = this.parseTemplateElement({isTagged: isTagged});
+ node.quasis = [curElt];
+ while (!curElt.tail) {
+ if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); }
+ this.expect(types$1.dollarBraceL);
+ node.expressions.push(this.parseExpression());
+ this.expect(types$1.braceR);
+ node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
+ }
+ this.next();
+ return this.finishNode(node, "TemplateLiteral")
+ };
+
+ pp$5.isAsyncProp = function(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
+ (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&
+ !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
+ };
+
+ // Parse an object literal or binding pattern.
+
+ pp$5.parseObj = function(isPattern, refDestructuringErrors) {
+ var node = this.startNode(), first = true, propHash = {};
+ node.properties = [];
+ this.next();
+ while (!this.eat(types$1.braceR)) {
+ if (!first) {
+ this.expect(types$1.comma);
+ if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }
+ } else { first = false; }
+
+ var prop = this.parseProperty(isPattern, refDestructuringErrors);
+ if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
+ node.properties.push(prop);
+ }
+ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
+ };
+
+ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
+ var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
+ if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {
+ if (isPattern) {
+ prop.argument = this.parseIdent(false);
+ if (this.type === types$1.comma) {
+ this.raise(this.start, "Comma is not permitted after the rest element");
+ }
+ return this.finishNode(prop, "RestElement")
+ }
+ // Parse argument.
+ prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
+ // To disallow trailing comma via `this.toAssignable()`.
+ if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
+ refDestructuringErrors.trailingComma = this.start;
+ }
+ // Finish
+ return this.finishNode(prop, "SpreadElement")
+ }
+ if (this.options.ecmaVersion >= 6) {
+ prop.method = false;
+ prop.shorthand = false;
+ if (isPattern || refDestructuringErrors) {
+ startPos = this.start;
+ startLoc = this.startLoc;
+ }
+ if (!isPattern)
+ { isGenerator = this.eat(types$1.star); }
+ }
+ var containsEsc = this.containsEsc;
+ this.parsePropertyName(prop);
+ if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
+ isAsync = true;
+ isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);
+ this.parsePropertyName(prop);
+ } else {
+ isAsync = false;
+ }
+ this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
+ return this.finishNode(prop, "Property")
+ };
+
+ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
+ if ((isGenerator || isAsync) && this.type === types$1.colon)
+ { this.unexpected(); }
+
+ if (this.eat(types$1.colon)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
+ prop.kind = "init";
+ } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
+ if (isPattern) { this.unexpected(); }
+ prop.kind = "init";
+ prop.method = true;
+ prop.value = this.parseMethod(isGenerator, isAsync);
+ } else if (!isPattern && !containsEsc &&
+ this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
+ (prop.key.name === "get" || prop.key.name === "set") &&
+ (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
+ if (isGenerator || isAsync) { this.unexpected(); }
+ prop.kind = prop.key.name;
+ this.parsePropertyName(prop);
+ prop.value = this.parseMethod(false);
+ var paramCount = prop.kind === "get" ? 0 : 1;
+ if (prop.value.params.length !== paramCount) {
+ var start = prop.value.start;
+ if (prop.kind === "get")
+ { this.raiseRecoverable(start, "getter should have no params"); }
+ else
+ { this.raiseRecoverable(start, "setter should have exactly one param"); }
+ } else {
+ if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
+ { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
+ }
+ } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
+ if (isGenerator || isAsync) { this.unexpected(); }
+ this.checkUnreserved(prop.key);
+ if (prop.key.name === "await" && !this.awaitIdentPos)
+ { this.awaitIdentPos = startPos; }
+ prop.kind = "init";
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
+ } else if (this.type === types$1.eq && refDestructuringErrors) {
+ if (refDestructuringErrors.shorthandAssign < 0)
+ { refDestructuringErrors.shorthandAssign = this.start; }
+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
+ } else {
+ prop.value = this.copyNode(prop.key);
+ }
+ prop.shorthand = true;
+ } else { this.unexpected(); }
+ };
+
+ pp$5.parsePropertyName = function(prop) {
+ if (this.options.ecmaVersion >= 6) {
+ if (this.eat(types$1.bracketL)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssign();
+ this.expect(types$1.bracketR);
+ return prop.key
+ } else {
+ prop.computed = false;
+ }
+ }
+ return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
+ };
+
+ // Initialize empty function node.
+
+ pp$5.initFunction = function(node) {
+ node.id = null;
+ if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
+ if (this.options.ecmaVersion >= 8) { node.async = false; }
+ };
+
+ // Parse object or class method.
+
+ pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
+ var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+
+ this.initFunction(node);
+ if (this.options.ecmaVersion >= 6)
+ { node.generator = isGenerator; }
+ if (this.options.ecmaVersion >= 8)
+ { node.async = !!isAsync; }
+
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+ this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+
+ this.expect(types$1.parenL);
+ node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
+ this.checkYieldAwaitInDefaultParams();
+ this.parseFunctionBody(node, false, true, false);
+
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.finishNode(node, "FunctionExpression")
+ };
+
+ // Parse arrow function expression with given parameters.
+
+ pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+
+ this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
+ this.initFunction(node);
+ if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }
+
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+
+ node.params = this.toAssignableList(params, true);
+ this.parseFunctionBody(node, true, false, forInit);
+
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.finishNode(node, "ArrowFunctionExpression")
+ };
+
+ // Parse function body and check parameters.
+
+ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
+ var isExpression = isArrowFunction && this.type !== types$1.braceL;
+ var oldStrict = this.strict, useStrict = false;
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign(forInit);
+ node.expression = true;
+ this.checkParams(node, false);
+ } else {
+ var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
+ if (!oldStrict || nonSimple) {
+ useStrict = this.strictDirective(this.end);
+ // If this is a strict mode function, verify that argument names
+ // are not repeated, and it does not try to bind the words `eval`
+ // or `arguments`.
+ if (useStrict && nonSimple)
+ { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
+ }
+ // Start a new scope with regard to labels and the `inFunction`
+ // flag (restore them to their old value afterwards).
+ var oldLabels = this.labels;
+ this.labels = [];
+ if (useStrict) { this.strict = true; }
+
+ // Add the params to varDeclaredNames to ensure that an error is thrown
+ // if a let/const declaration in the function clashes with one of the params.
+ this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
+ // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
+ if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
+ node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
+ node.expression = false;
+ this.adaptDirectivePrologue(node.body.body);
+ this.labels = oldLabels;
+ }
+ this.exitScope();
+ };
+
+ pp$5.isSimpleParamList = function(params) {
+ for (var i = 0, list = params; i < list.length; i += 1)
+ {
+ var param = list[i];
+
+ if (param.type !== "Identifier") { return false
+ } }
+ return true
+ };
+
+ // Checks function params for various disallowed patterns such as using "eval"
+ // or "arguments" and duplicate parameters.
+
+ pp$5.checkParams = function(node, allowDuplicates) {
+ var nameHash = Object.create(null);
+ for (var i = 0, list = node.params; i < list.length; i += 1)
+ {
+ var param = list[i];
+
+ this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
+ }
+ };
+
+ // Parses a comma-separated list of expressions, and returns them as
+ // an array. `close` is the token type that ends the list, and
+ // `allowEmpty` can be turned on to allow subsequent commas with
+ // nothing in between them to be parsed as `null` (which is needed
+ // for array literals).
+
+ pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
+ var elts = [], first = true;
+ while (!this.eat(close)) {
+ if (!first) {
+ this.expect(types$1.comma);
+ if (allowTrailingComma && this.afterTrailingComma(close)) { break }
+ } else { first = false; }
+
+ var elt = (void 0);
+ if (allowEmpty && this.type === types$1.comma)
+ { elt = null; }
+ else if (this.type === types$1.ellipsis) {
+ elt = this.parseSpread(refDestructuringErrors);
+ if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)
+ { refDestructuringErrors.trailingComma = this.start; }
+ } else {
+ elt = this.parseMaybeAssign(false, refDestructuringErrors);
+ }
+ elts.push(elt);
+ }
+ return elts
+ };
+
+ pp$5.checkUnreserved = function(ref) {
+ var start = ref.start;
+ var end = ref.end;
+ var name = ref.name;
+
+ if (this.inGenerator && name === "yield")
+ { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
+ if (this.inAsync && name === "await")
+ { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
+ if (this.currentThisScope().inClassFieldInit && name === "arguments")
+ { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
+ if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
+ { this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
+ if (this.keywords.test(name))
+ { this.raise(start, ("Unexpected keyword '" + name + "'")); }
+ if (this.options.ecmaVersion < 6 &&
+ this.input.slice(start, end).indexOf("\\") !== -1) { return }
+ var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
+ if (re.test(name)) {
+ if (!this.inAsync && name === "await")
+ { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
+ this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
+ }
+ };
+
+ // Parse the next token as an identifier. If `liberal` is true (used
+ // when parsing properties), it will also convert keywords into
+ // identifiers.
+
+ pp$5.parseIdent = function(liberal) {
+ var node = this.startNode();
+ if (this.type === types$1.name) {
+ node.name = this.value;
+ } else if (this.type.keyword) {
+ node.name = this.type.keyword;
+
+ // To fix https://github.com/acornjs/acorn/issues/575
+ // `class` and `function` keywords push new context into this.context.
+ // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
+ // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
+ if ((node.name === "class" || node.name === "function") &&
+ (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
+ this.context.pop();
+ }
+ } else {
+ this.unexpected();
+ }
+ this.next(!!liberal);
+ this.finishNode(node, "Identifier");
+ if (!liberal) {
+ this.checkUnreserved(node);
+ if (node.name === "await" && !this.awaitIdentPos)
+ { this.awaitIdentPos = node.start; }
+ }
+ return node
+ };
+
+ pp$5.parsePrivateIdent = function() {
+ var node = this.startNode();
+ if (this.type === types$1.privateId) {
+ node.name = this.value;
+ } else {
+ this.unexpected();
+ }
+ this.next();
+ this.finishNode(node, "PrivateIdentifier");
+
+ // For validating existence
+ if (this.privateNameStack.length === 0) {
+ this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
+ } else {
+ this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
+ }
+
+ return node
+ };
+
+ // Parses yield expression inside generator.
+
+ pp$5.parseYield = function(forInit) {
+ if (!this.yieldPos) { this.yieldPos = this.start; }
+
+ var node = this.startNode();
+ this.next();
+ if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {
+ node.delegate = false;
+ node.argument = null;
+ } else {
+ node.delegate = this.eat(types$1.star);
+ node.argument = this.parseMaybeAssign(forInit);
+ }
+ return this.finishNode(node, "YieldExpression")
+ };
+
+ pp$5.parseAwait = function(forInit) {
+ if (!this.awaitPos) { this.awaitPos = this.start; }
+
+ var node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true, false, forInit);
+ return this.finishNode(node, "AwaitExpression")
+ };
+
+ var pp$4 = Parser.prototype;
+
+ // This function is used to raise exceptions on parse errors. It
+ // takes an offset integer (into the current `input`) to indicate
+ // the location of the error, attaches the position to the end
+ // of the error message, and then raises a `SyntaxError` with that
+ // message.
+
+ pp$4.raise = function(pos, message) {
+ var loc = getLineInfo(this.input, pos);
+ message += " (" + loc.line + ":" + loc.column + ")";
+ var err = new SyntaxError(message);
+ err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
+ throw err
+ };
+
+ pp$4.raiseRecoverable = pp$4.raise;
+
+ pp$4.curPosition = function() {
+ if (this.options.locations) {
+ return new Position(this.curLine, this.pos - this.lineStart)
+ }
+ };
+
+ var pp$3 = Parser.prototype;
+
+ var Scope = function Scope(flags) {
+ this.flags = flags;
+ // A list of var-declared names in the current lexical scope
+ this.var = [];
+ // A list of lexically-declared names in the current lexical scope
+ this.lexical = [];
+ // A list of lexically-declared FunctionDeclaration names in the current lexical scope
+ this.functions = [];
+ // A switch to disallow the identifier reference 'arguments'
+ this.inClassFieldInit = false;
+ };
+
+ // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
+
+ pp$3.enterScope = function(flags) {
+ this.scopeStack.push(new Scope(flags));
+ };
+
+ pp$3.exitScope = function() {
+ this.scopeStack.pop();
+ };
+
+ // The spec says:
+ // > At the top level of a function, or script, function declarations are
+ // > treated like var declarations rather than like lexical declarations.
+ pp$3.treatFunctionsAsVarInScope = function(scope) {
+ return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
+ };
+
+ pp$3.declareName = function(name, bindingType, pos) {
+ var redeclared = false;
+ if (bindingType === BIND_LEXICAL) {
+ var scope = this.currentScope();
+ redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
+ scope.lexical.push(name);
+ if (this.inModule && (scope.flags & SCOPE_TOP))
+ { delete this.undefinedExports[name]; }
+ } else if (bindingType === BIND_SIMPLE_CATCH) {
+ var scope$1 = this.currentScope();
+ scope$1.lexical.push(name);
+ } else if (bindingType === BIND_FUNCTION) {
+ var scope$2 = this.currentScope();
+ if (this.treatFunctionsAsVar)
+ { redeclared = scope$2.lexical.indexOf(name) > -1; }
+ else
+ { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
+ scope$2.functions.push(name);
+ } else {
+ for (var i = this.scopeStack.length - 1; i >= 0; --i) {
+ var scope$3 = this.scopeStack[i];
+ if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
+ !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
+ redeclared = true;
+ break
+ }
+ scope$3.var.push(name);
+ if (this.inModule && (scope$3.flags & SCOPE_TOP))
+ { delete this.undefinedExports[name]; }
+ if (scope$3.flags & SCOPE_VAR) { break }
+ }
+ }
+ if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
+ };
+
+ pp$3.checkLocalExport = function(id) {
+ // scope.functions must be empty as Module code is always strict.
+ if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
+ this.scopeStack[0].var.indexOf(id.name) === -1) {
+ this.undefinedExports[id.name] = id;
+ }
+ };
+
+ pp$3.currentScope = function() {
+ return this.scopeStack[this.scopeStack.length - 1]
+ };
+
+ pp$3.currentVarScope = function() {
+ for (var i = this.scopeStack.length - 1;; i--) {
+ var scope = this.scopeStack[i];
+ if (scope.flags & SCOPE_VAR) { return scope }
+ }
+ };
+
+ // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
+ pp$3.currentThisScope = function() {
+ for (var i = this.scopeStack.length - 1;; i--) {
+ var scope = this.scopeStack[i];
+ if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
+ }
+ };
+
+ var Node = function Node(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ if (parser.options.locations)
+ { this.loc = new SourceLocation(parser, loc); }
+ if (parser.options.directSourceFile)
+ { this.sourceFile = parser.options.directSourceFile; }
+ if (parser.options.ranges)
+ { this.range = [pos, 0]; }
+ };
+
+ // Start an AST node, attaching a start offset.
+
+ var pp$2 = Parser.prototype;
+
+ pp$2.startNode = function() {
+ return new Node(this, this.start, this.startLoc)
+ };
+
+ pp$2.startNodeAt = function(pos, loc) {
+ return new Node(this, pos, loc)
+ };
+
+ // Finish an AST node, adding `type` and `end` properties.
+
+ function finishNodeAt(node, type, pos, loc) {
+ node.type = type;
+ node.end = pos;
+ if (this.options.locations)
+ { node.loc.end = loc; }
+ if (this.options.ranges)
+ { node.range[1] = pos; }
+ return node
+ }
+
+ pp$2.finishNode = function(node, type) {
+ return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
+ };
+
+ // Finish node at given position
+
+ pp$2.finishNodeAt = function(node, type, pos, loc) {
+ return finishNodeAt.call(this, node, type, pos, loc)
+ };
+
+ pp$2.copyNode = function(node) {
+ var newNode = new Node(this, node.start, this.startLoc);
+ for (var prop in node) { newNode[prop] = node[prop]; }
+ return newNode
+ };
+
+ // This file contains Unicode properties extracted from the ECMAScript specification.
+ // The lists are extracted like so:
+ // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
+
+ // #table-binary-unicode-properties
+ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
+ var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
+ var ecma11BinaryProperties = ecma10BinaryProperties;
+ var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
+ var ecma13BinaryProperties = ecma12BinaryProperties;
+ var ecma14BinaryProperties = ecma13BinaryProperties;
+
+ var unicodeBinaryProperties = {
+ 9: ecma9BinaryProperties,
+ 10: ecma10BinaryProperties,
+ 11: ecma11BinaryProperties,
+ 12: ecma12BinaryProperties,
+ 13: ecma13BinaryProperties,
+ 14: ecma14BinaryProperties
+ };
+
+ // #table-unicode-general-category-values
+ var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
+
+ // #table-unicode-script-values
+ var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
+ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
+ var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
+ var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
+ var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
+ var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm";
+
+ var unicodeScriptValues = {
+ 9: ecma9ScriptValues,
+ 10: ecma10ScriptValues,
+ 11: ecma11ScriptValues,
+ 12: ecma12ScriptValues,
+ 13: ecma13ScriptValues,
+ 14: ecma14ScriptValues
+ };
+
+ var data = {};
+ function buildUnicodeData(ecmaVersion) {
+ var d = data[ecmaVersion] = {
+ binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
+ nonBinary: {
+ General_Category: wordsRegexp(unicodeGeneralCategoryValues),
+ Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
+ }
+ };
+ d.nonBinary.Script_Extensions = d.nonBinary.Script;
+
+ d.nonBinary.gc = d.nonBinary.General_Category;
+ d.nonBinary.sc = d.nonBinary.Script;
+ d.nonBinary.scx = d.nonBinary.Script_Extensions;
+ }
+
+ for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
+ var ecmaVersion = list[i];
+
+ buildUnicodeData(ecmaVersion);
+ }
+
+ var pp$1 = Parser.prototype;
+
+ var RegExpValidationState = function RegExpValidationState(parser) {
+ this.parser = parser;
+ this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
+ this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
+ this.source = "";
+ this.flags = "";
+ this.start = 0;
+ this.switchU = false;
+ this.switchN = false;
+ this.pos = 0;
+ this.lastIntValue = 0;
+ this.lastStringValue = "";
+ this.lastAssertionIsQuantifiable = false;
+ this.numCapturingParens = 0;
+ this.maxBackReference = 0;
+ this.groupNames = [];
+ this.backReferenceNames = [];
+ };
+
+ RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
+ var unicode = flags.indexOf("u") !== -1;
+ this.start = start | 0;
+ this.source = pattern + "";
+ this.flags = flags;
+ this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
+ this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
+ };
+
+ RegExpValidationState.prototype.raise = function raise (message) {
+ this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
+ };
+
+ // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
+ // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
+ RegExpValidationState.prototype.at = function at (i, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ var s = this.source;
+ var l = s.length;
+ if (i >= l) {
+ return -1
+ }
+ var c = s.charCodeAt(i);
+ if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
+ return c
+ }
+ var next = s.charCodeAt(i + 1);
+ return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
+ };
+
+ RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ var s = this.source;
+ var l = s.length;
+ if (i >= l) {
+ return l
+ }
+ var c = s.charCodeAt(i), next;
+ if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
+ (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
+ return i + 1
+ }
+ return i + 2
+ };
+
+ RegExpValidationState.prototype.current = function current (forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ return this.at(this.pos, forceU)
+ };
+
+ RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ return this.at(this.nextIndex(this.pos, forceU), forceU)
+ };
+
+ RegExpValidationState.prototype.advance = function advance (forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ this.pos = this.nextIndex(this.pos, forceU);
+ };
+
+ RegExpValidationState.prototype.eat = function eat (ch, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ if (this.current(forceU) === ch) {
+ this.advance(forceU);
+ return true
+ }
+ return false
+ };
+
+ /**
+ * Validate the flags part of a given RegExpLiteral.
+ *
+ * @param {RegExpValidationState} state The state to validate RegExp.
+ * @returns {void}
+ */
+ pp$1.validateRegExpFlags = function(state) {
+ var validFlags = state.validFlags;
+ var flags = state.flags;
+
+ for (var i = 0; i < flags.length; i++) {
+ var flag = flags.charAt(i);
+ if (validFlags.indexOf(flag) === -1) {
+ this.raise(state.start, "Invalid regular expression flag");
+ }
+ if (flags.indexOf(flag, i + 1) > -1) {
+ this.raise(state.start, "Duplicate regular expression flag");
+ }
+ }
+ };
+
+ /**
+ * Validate the pattern part of a given RegExpLiteral.
+ *
+ * @param {RegExpValidationState} state The state to validate RegExp.
+ * @returns {void}
+ */
+ pp$1.validateRegExpPattern = function(state) {
+ this.regexp_pattern(state);
+
+ // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
+ // parsing contains a |GroupName|, reparse with the goal symbol
+ // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
+ // exception if _P_ did not conform to the grammar, if any elements of _P_
+ // were not matched by the parse, or if any Early Error conditions exist.
+ if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
+ state.switchN = true;
+ this.regexp_pattern(state);
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
+ pp$1.regexp_pattern = function(state) {
+ state.pos = 0;
+ state.lastIntValue = 0;
+ state.lastStringValue = "";
+ state.lastAssertionIsQuantifiable = false;
+ state.numCapturingParens = 0;
+ state.maxBackReference = 0;
+ state.groupNames.length = 0;
+ state.backReferenceNames.length = 0;
+
+ this.regexp_disjunction(state);
+
+ if (state.pos !== state.source.length) {
+ // Make the same messages as V8.
+ if (state.eat(0x29 /* ) */)) {
+ state.raise("Unmatched ')'");
+ }
+ if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
+ state.raise("Lone quantifier brackets");
+ }
+ }
+ if (state.maxBackReference > state.numCapturingParens) {
+ state.raise("Invalid escape");
+ }
+ for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
+ var name = list[i];
+
+ if (state.groupNames.indexOf(name) === -1) {
+ state.raise("Invalid named capture referenced");
+ }
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
+ pp$1.regexp_disjunction = function(state) {
+ this.regexp_alternative(state);
+ while (state.eat(0x7C /* | */)) {
+ this.regexp_alternative(state);
+ }
+
+ // Make the same message as V8.
+ if (this.regexp_eatQuantifier(state, true)) {
+ state.raise("Nothing to repeat");
+ }
+ if (state.eat(0x7B /* { */)) {
+ state.raise("Lone quantifier brackets");
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
+ pp$1.regexp_alternative = function(state) {
+ while (state.pos < state.source.length && this.regexp_eatTerm(state))
+ { }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
+ pp$1.regexp_eatTerm = function(state) {
+ if (this.regexp_eatAssertion(state)) {
+ // Handle `QuantifiableAssertion Quantifier` alternative.
+ // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
+ // is a QuantifiableAssertion.
+ if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
+ // Make the same message as V8.
+ if (state.switchU) {
+ state.raise("Invalid quantifier");
+ }
+ }
+ return true
+ }
+
+ if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
+ this.regexp_eatQuantifier(state);
+ return true
+ }
+
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
+ pp$1.regexp_eatAssertion = function(state) {
+ var start = state.pos;
+ state.lastAssertionIsQuantifiable = false;
+
+ // ^, $
+ if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
+ return true
+ }
+
+ // \b \B
+ if (state.eat(0x5C /* \ */)) {
+ if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
+ return true
+ }
+ state.pos = start;
+ }
+
+ // Lookahead / Lookbehind
+ if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
+ var lookbehind = false;
+ if (this.options.ecmaVersion >= 9) {
+ lookbehind = state.eat(0x3C /* < */);
+ }
+ if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
+ this.regexp_disjunction(state);
+ if (!state.eat(0x29 /* ) */)) {
+ state.raise("Unterminated group");
+ }
+ state.lastAssertionIsQuantifiable = !lookbehind;
+ return true
+ }
+ }
+
+ state.pos = start;
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
+ pp$1.regexp_eatQuantifier = function(state, noError) {
+ if ( noError === void 0 ) noError = false;
+
+ if (this.regexp_eatQuantifierPrefix(state, noError)) {
+ state.eat(0x3F /* ? */);
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
+ pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
+ return (
+ state.eat(0x2A /* * */) ||
+ state.eat(0x2B /* + */) ||
+ state.eat(0x3F /* ? */) ||
+ this.regexp_eatBracedQuantifier(state, noError)
+ )
+ };
+ pp$1.regexp_eatBracedQuantifier = function(state, noError) {
+ var start = state.pos;
+ if (state.eat(0x7B /* { */)) {
+ var min = 0, max = -1;
+ if (this.regexp_eatDecimalDigits(state)) {
+ min = state.lastIntValue;
+ if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
+ max = state.lastIntValue;
+ }
+ if (state.eat(0x7D /* } */)) {
+ // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
+ if (max !== -1 && max < min && !noError) {
+ state.raise("numbers out of order in {} quantifier");
+ }
+ return true
+ }
+ }
+ if (state.switchU && !noError) {
+ state.raise("Incomplete quantifier");
+ }
+ state.pos = start;
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
+ pp$1.regexp_eatAtom = function(state) {
+ return (
+ this.regexp_eatPatternCharacters(state) ||
+ state.eat(0x2E /* . */) ||
+ this.regexp_eatReverseSolidusAtomEscape(state) ||
+ this.regexp_eatCharacterClass(state) ||
+ this.regexp_eatUncapturingGroup(state) ||
+ this.regexp_eatCapturingGroup(state)
+ )
+ };
+ pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
+ var start = state.pos;
+ if (state.eat(0x5C /* \ */)) {
+ if (this.regexp_eatAtomEscape(state)) {
+ return true
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$1.regexp_eatUncapturingGroup = function(state) {
+ var start = state.pos;
+ if (state.eat(0x28 /* ( */)) {
+ if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
+ this.regexp_disjunction(state);
+ if (state.eat(0x29 /* ) */)) {
+ return true
+ }
+ state.raise("Unterminated group");
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$1.regexp_eatCapturingGroup = function(state) {
+ if (state.eat(0x28 /* ( */)) {
+ if (this.options.ecmaVersion >= 9) {
+ this.regexp_groupSpecifier(state);
+ } else if (state.current() === 0x3F /* ? */) {
+ state.raise("Invalid group");
+ }
+ this.regexp_disjunction(state);
+ if (state.eat(0x29 /* ) */)) {
+ state.numCapturingParens += 1;
+ return true
+ }
+ state.raise("Unterminated group");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
+ pp$1.regexp_eatExtendedAtom = function(state) {
+ return (
+ state.eat(0x2E /* . */) ||
+ this.regexp_eatReverseSolidusAtomEscape(state) ||
+ this.regexp_eatCharacterClass(state) ||
+ this.regexp_eatUncapturingGroup(state) ||
+ this.regexp_eatCapturingGroup(state) ||
+ this.regexp_eatInvalidBracedQuantifier(state) ||
+ this.regexp_eatExtendedPatternCharacter(state)
+ )
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
+ pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
+ if (this.regexp_eatBracedQuantifier(state, true)) {
+ state.raise("Nothing to repeat");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
+ pp$1.regexp_eatSyntaxCharacter = function(state) {
+ var ch = state.current();
+ if (isSyntaxCharacter(ch)) {
+ state.lastIntValue = ch;
+ state.advance();
+ return true
+ }
+ return false
+ };
+ function isSyntaxCharacter(ch) {
+ return (
+ ch === 0x24 /* $ */ ||
+ ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
+ ch === 0x2E /* . */ ||
+ ch === 0x3F /* ? */ ||
+ ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
+ ch >= 0x7B /* { */ && ch <= 0x7D /* } */
+ )
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
+ // But eat eager.
+ pp$1.regexp_eatPatternCharacters = function(state) {
+ var start = state.pos;
+ var ch = 0;
+ while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
+ state.advance();
+ }
+ return state.pos !== start
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
+ pp$1.regexp_eatExtendedPatternCharacter = function(state) {
+ var ch = state.current();
+ if (
+ ch !== -1 &&
+ ch !== 0x24 /* $ */ &&
+ !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
+ ch !== 0x2E /* . */ &&
+ ch !== 0x3F /* ? */ &&
+ ch !== 0x5B /* [ */ &&
+ ch !== 0x5E /* ^ */ &&
+ ch !== 0x7C /* | */
+ ) {
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // GroupSpecifier ::
+ // [empty]
+ // `?` GroupName
+ pp$1.regexp_groupSpecifier = function(state) {
+ if (state.eat(0x3F /* ? */)) {
+ if (this.regexp_eatGroupName(state)) {
+ if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
+ state.raise("Duplicate capture group name");
+ }
+ state.groupNames.push(state.lastStringValue);
+ return
+ }
+ state.raise("Invalid group");
+ }
+ };
+
+ // GroupName ::
+ // `<` RegExpIdentifierName `>`
+ // Note: this updates `state.lastStringValue` property with the eaten name.
+ pp$1.regexp_eatGroupName = function(state) {
+ state.lastStringValue = "";
+ if (state.eat(0x3C /* < */)) {
+ if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
+ return true
+ }
+ state.raise("Invalid capture group name");
+ }
+ return false
+ };
+
+ // RegExpIdentifierName ::
+ // RegExpIdentifierStart
+ // RegExpIdentifierName RegExpIdentifierPart
+ // Note: this updates `state.lastStringValue` property with the eaten name.
+ pp$1.regexp_eatRegExpIdentifierName = function(state) {
+ state.lastStringValue = "";
+ if (this.regexp_eatRegExpIdentifierStart(state)) {
+ state.lastStringValue += codePointToString(state.lastIntValue);
+ while (this.regexp_eatRegExpIdentifierPart(state)) {
+ state.lastStringValue += codePointToString(state.lastIntValue);
+ }
+ return true
+ }
+ return false
+ };
+
+ // RegExpIdentifierStart ::
+ // UnicodeIDStart
+ // `$`
+ // `_`
+ // `\` RegExpUnicodeEscapeSequence[+U]
+ pp$1.regexp_eatRegExpIdentifierStart = function(state) {
+ var start = state.pos;
+ var forceU = this.options.ecmaVersion >= 11;
+ var ch = state.current(forceU);
+ state.advance(forceU);
+
+ if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
+ ch = state.lastIntValue;
+ }
+ if (isRegExpIdentifierStart(ch)) {
+ state.lastIntValue = ch;
+ return true
+ }
+
+ state.pos = start;
+ return false
+ };
+ function isRegExpIdentifierStart(ch) {
+ return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
+ }
+
+ // RegExpIdentifierPart ::
+ // UnicodeIDContinue
+ // `$`
+ // `_`
+ // `\` RegExpUnicodeEscapeSequence[+U]
+ // <ZWNJ>
+ // <ZWJ>
+ pp$1.regexp_eatRegExpIdentifierPart = function(state) {
+ var start = state.pos;
+ var forceU = this.options.ecmaVersion >= 11;
+ var ch = state.current(forceU);
+ state.advance(forceU);
+
+ if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
+ ch = state.lastIntValue;
+ }
+ if (isRegExpIdentifierPart(ch)) {
+ state.lastIntValue = ch;
+ return true
+ }
+
+ state.pos = start;
+ return false
+ };
+ function isRegExpIdentifierPart(ch) {
+ return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
+ pp$1.regexp_eatAtomEscape = function(state) {
+ if (
+ this.regexp_eatBackReference(state) ||
+ this.regexp_eatCharacterClassEscape(state) ||
+ this.regexp_eatCharacterEscape(state) ||
+ (state.switchN && this.regexp_eatKGroupName(state))
+ ) {
+ return true
+ }
+ if (state.switchU) {
+ // Make the same message as V8.
+ if (state.current() === 0x63 /* c */) {
+ state.raise("Invalid unicode escape");
+ }
+ state.raise("Invalid escape");
+ }
+ return false
+ };
+ pp$1.regexp_eatBackReference = function(state) {
+ var start = state.pos;
+ if (this.regexp_eatDecimalEscape(state)) {
+ var n = state.lastIntValue;
+ if (state.switchU) {
+ // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
+ if (n > state.maxBackReference) {
+ state.maxBackReference = n;
+ }
+ return true
+ }
+ if (n <= state.numCapturingParens) {
+ return true
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$1.regexp_eatKGroupName = function(state) {
+ if (state.eat(0x6B /* k */)) {
+ if (this.regexp_eatGroupName(state)) {
+ state.backReferenceNames.push(state.lastStringValue);
+ return true
+ }
+ state.raise("Invalid named reference");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
+ pp$1.regexp_eatCharacterEscape = function(state) {
+ return (
+ this.regexp_eatControlEscape(state) ||
+ this.regexp_eatCControlLetter(state) ||
+ this.regexp_eatZero(state) ||
+ this.regexp_eatHexEscapeSequence(state) ||
+ this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
+ (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
+ this.regexp_eatIdentityEscape(state)
+ )
+ };
+ pp$1.regexp_eatCControlLetter = function(state) {
+ var start = state.pos;
+ if (state.eat(0x63 /* c */)) {
+ if (this.regexp_eatControlLetter(state)) {
+ return true
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$1.regexp_eatZero = function(state) {
+ if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
+ state.lastIntValue = 0;
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
+ pp$1.regexp_eatControlEscape = function(state) {
+ var ch = state.current();
+ if (ch === 0x74 /* t */) {
+ state.lastIntValue = 0x09; /* \t */
+ state.advance();
+ return true
+ }
+ if (ch === 0x6E /* n */) {
+ state.lastIntValue = 0x0A; /* \n */
+ state.advance();
+ return true
+ }
+ if (ch === 0x76 /* v */) {
+ state.lastIntValue = 0x0B; /* \v */
+ state.advance();
+ return true
+ }
+ if (ch === 0x66 /* f */) {
+ state.lastIntValue = 0x0C; /* \f */
+ state.advance();
+ return true
+ }
+ if (ch === 0x72 /* r */) {
+ state.lastIntValue = 0x0D; /* \r */
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
+ pp$1.regexp_eatControlLetter = function(state) {
+ var ch = state.current();
+ if (isControlLetter(ch)) {
+ state.lastIntValue = ch % 0x20;
+ state.advance();
+ return true
+ }
+ return false
+ };
+ function isControlLetter(ch) {
+ return (
+ (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
+ (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
+ )
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
+ pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ var start = state.pos;
+ var switchU = forceU || state.switchU;
+
+ if (state.eat(0x75 /* u */)) {
+ if (this.regexp_eatFixedHexDigits(state, 4)) {
+ var lead = state.lastIntValue;
+ if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
+ var leadSurrogateEnd = state.pos;
+ if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
+ var trail = state.lastIntValue;
+ if (trail >= 0xDC00 && trail <= 0xDFFF) {
+ state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
+ return true
+ }
+ }
+ state.pos = leadSurrogateEnd;
+ state.lastIntValue = lead;
+ }
+ return true
+ }
+ if (
+ switchU &&
+ state.eat(0x7B /* { */) &&
+ this.regexp_eatHexDigits(state) &&
+ state.eat(0x7D /* } */) &&
+ isValidUnicode(state.lastIntValue)
+ ) {
+ return true
+ }
+ if (switchU) {
+ state.raise("Invalid unicode escape");
+ }
+ state.pos = start;
+ }
+
+ return false
+ };
+ function isValidUnicode(ch) {
+ return ch >= 0 && ch <= 0x10FFFF
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
+ pp$1.regexp_eatIdentityEscape = function(state) {
+ if (state.switchU) {
+ if (this.regexp_eatSyntaxCharacter(state)) {
+ return true
+ }
+ if (state.eat(0x2F /* / */)) {
+ state.lastIntValue = 0x2F; /* / */
+ return true
+ }
+ return false
+ }
+
+ var ch = state.current();
+ if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
+ state.lastIntValue = ch;
+ state.advance();
+ return true
+ }
+
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
+ pp$1.regexp_eatDecimalEscape = function(state) {
+ state.lastIntValue = 0;
+ var ch = state.current();
+ if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
+ do {
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
+ state.advance();
+ } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
+ pp$1.regexp_eatCharacterClassEscape = function(state) {
+ var ch = state.current();
+
+ if (isCharacterClassEscape(ch)) {
+ state.lastIntValue = -1;
+ state.advance();
+ return true
+ }
+
+ if (
+ state.switchU &&
+ this.options.ecmaVersion >= 9 &&
+ (ch === 0x50 /* P */ || ch === 0x70 /* p */)
+ ) {
+ state.lastIntValue = -1;
+ state.advance();
+ if (
+ state.eat(0x7B /* { */) &&
+ this.regexp_eatUnicodePropertyValueExpression(state) &&
+ state.eat(0x7D /* } */)
+ ) {
+ return true
+ }
+ state.raise("Invalid property name");
+ }
+
+ return false
+ };
+ function isCharacterClassEscape(ch) {
+ return (
+ ch === 0x64 /* d */ ||
+ ch === 0x44 /* D */ ||
+ ch === 0x73 /* s */ ||
+ ch === 0x53 /* S */ ||
+ ch === 0x77 /* w */ ||
+ ch === 0x57 /* W */
+ )
+ }
+
+ // UnicodePropertyValueExpression ::
+ // UnicodePropertyName `=` UnicodePropertyValue
+ // LoneUnicodePropertyNameOrValue
+ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
+ var start = state.pos;
+
+ // UnicodePropertyName `=` UnicodePropertyValue
+ if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
+ var name = state.lastStringValue;
+ if (this.regexp_eatUnicodePropertyValue(state)) {
+ var value = state.lastStringValue;
+ this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
+ return true
+ }
+ }
+ state.pos = start;
+
+ // LoneUnicodePropertyNameOrValue
+ if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
+ var nameOrValue = state.lastStringValue;
+ this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
+ return true
+ }
+ return false
+ };
+ pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
+ if (!hasOwn(state.unicodeProperties.nonBinary, name))
+ { state.raise("Invalid property name"); }
+ if (!state.unicodeProperties.nonBinary[name].test(value))
+ { state.raise("Invalid property value"); }
+ };
+ pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
+ if (!state.unicodeProperties.binary.test(nameOrValue))
+ { state.raise("Invalid property name"); }
+ };
+
+ // UnicodePropertyName ::
+ // UnicodePropertyNameCharacters
+ pp$1.regexp_eatUnicodePropertyName = function(state) {
+ var ch = 0;
+ state.lastStringValue = "";
+ while (isUnicodePropertyNameCharacter(ch = state.current())) {
+ state.lastStringValue += codePointToString(ch);
+ state.advance();
+ }
+ return state.lastStringValue !== ""
+ };
+ function isUnicodePropertyNameCharacter(ch) {
+ return isControlLetter(ch) || ch === 0x5F /* _ */
+ }
+
+ // UnicodePropertyValue ::
+ // UnicodePropertyValueCharacters
+ pp$1.regexp_eatUnicodePropertyValue = function(state) {
+ var ch = 0;
+ state.lastStringValue = "";
+ while (isUnicodePropertyValueCharacter(ch = state.current())) {
+ state.lastStringValue += codePointToString(ch);
+ state.advance();
+ }
+ return state.lastStringValue !== ""
+ };
+ function isUnicodePropertyValueCharacter(ch) {
+ return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
+ }
+
+ // LoneUnicodePropertyNameOrValue ::
+ // UnicodePropertyValueCharacters
+ pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
+ return this.regexp_eatUnicodePropertyValue(state)
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
+ pp$1.regexp_eatCharacterClass = function(state) {
+ if (state.eat(0x5B /* [ */)) {
+ state.eat(0x5E /* ^ */);
+ this.regexp_classRanges(state);
+ if (state.eat(0x5D /* ] */)) {
+ return true
+ }
+ // Unreachable since it threw "unterminated regular expression" error before.
+ state.raise("Unterminated character class");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
+ pp$1.regexp_classRanges = function(state) {
+ while (this.regexp_eatClassAtom(state)) {
+ var left = state.lastIntValue;
+ if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
+ var right = state.lastIntValue;
+ if (state.switchU && (left === -1 || right === -1)) {
+ state.raise("Invalid character class");
+ }
+ if (left !== -1 && right !== -1 && left > right) {
+ state.raise("Range out of order in character class");
+ }
+ }
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
+ pp$1.regexp_eatClassAtom = function(state) {
+ var start = state.pos;
+
+ if (state.eat(0x5C /* \ */)) {
+ if (this.regexp_eatClassEscape(state)) {
+ return true
+ }
+ if (state.switchU) {
+ // Make the same message as V8.
+ var ch$1 = state.current();
+ if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
+ state.raise("Invalid class escape");
+ }
+ state.raise("Invalid escape");
+ }
+ state.pos = start;
+ }
+
+ var ch = state.current();
+ if (ch !== 0x5D /* ] */) {
+ state.lastIntValue = ch;
+ state.advance();
+ return true
+ }
+
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
+ pp$1.regexp_eatClassEscape = function(state) {
+ var start = state.pos;
+
+ if (state.eat(0x62 /* b */)) {
+ state.lastIntValue = 0x08; /* <BS> */
+ return true
+ }
+
+ if (state.switchU && state.eat(0x2D /* - */)) {
+ state.lastIntValue = 0x2D; /* - */
+ return true
+ }
+
+ if (!state.switchU && state.eat(0x63 /* c */)) {
+ if (this.regexp_eatClassControlLetter(state)) {
+ return true
+ }
+ state.pos = start;
+ }
+
+ return (
+ this.regexp_eatCharacterClassEscape(state) ||
+ this.regexp_eatCharacterEscape(state)
+ )
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
+ pp$1.regexp_eatClassControlLetter = function(state) {
+ var ch = state.current();
+ if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
+ state.lastIntValue = ch % 0x20;
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
+ pp$1.regexp_eatHexEscapeSequence = function(state) {
+ var start = state.pos;
+ if (state.eat(0x78 /* x */)) {
+ if (this.regexp_eatFixedHexDigits(state, 2)) {
+ return true
+ }
+ if (state.switchU) {
+ state.raise("Invalid escape");
+ }
+ state.pos = start;
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
+ pp$1.regexp_eatDecimalDigits = function(state) {
+ var start = state.pos;
+ var ch = 0;
+ state.lastIntValue = 0;
+ while (isDecimalDigit(ch = state.current())) {
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
+ state.advance();
+ }
+ return state.pos !== start
+ };
+ function isDecimalDigit(ch) {
+ return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
+ pp$1.regexp_eatHexDigits = function(state) {
+ var start = state.pos;
+ var ch = 0;
+ state.lastIntValue = 0;
+ while (isHexDigit(ch = state.current())) {
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
+ state.advance();
+ }
+ return state.pos !== start
+ };
+ function isHexDigit(ch) {
+ return (
+ (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
+ (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
+ (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
+ )
+ }
+ function hexToInt(ch) {
+ if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
+ return 10 + (ch - 0x41 /* A */)
+ }
+ if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
+ return 10 + (ch - 0x61 /* a */)
+ }
+ return ch - 0x30 /* 0 */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
+ // Allows only 0-377(octal) i.e. 0-255(decimal).
+ pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
+ if (this.regexp_eatOctalDigit(state)) {
+ var n1 = state.lastIntValue;
+ if (this.regexp_eatOctalDigit(state)) {
+ var n2 = state.lastIntValue;
+ if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
+ state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
+ } else {
+ state.lastIntValue = n1 * 8 + n2;
+ }
+ } else {
+ state.lastIntValue = n1;
+ }
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
+ pp$1.regexp_eatOctalDigit = function(state) {
+ var ch = state.current();
+ if (isOctalDigit(ch)) {
+ state.lastIntValue = ch - 0x30; /* 0 */
+ state.advance();
+ return true
+ }
+ state.lastIntValue = 0;
+ return false
+ };
+ function isOctalDigit(ch) {
+ return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
+ // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
+ pp$1.regexp_eatFixedHexDigits = function(state, length) {
+ var start = state.pos;
+ state.lastIntValue = 0;
+ for (var i = 0; i < length; ++i) {
+ var ch = state.current();
+ if (!isHexDigit(ch)) {
+ state.pos = start;
+ return false
+ }
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
+ state.advance();
+ }
+ return true
+ };
+
+ // Object type used to represent tokens. Note that normally, tokens
+ // simply exist as properties on the parser object. This is only
+ // used for the onToken callback and the external tokenizer.
+
+ var Token = function Token(p) {
+ this.type = p.type;
+ this.value = p.value;
+ this.start = p.start;
+ this.end = p.end;
+ if (p.options.locations)
+ { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
+ if (p.options.ranges)
+ { this.range = [p.start, p.end]; }
+ };
+
+ // ## Tokenizer
+
+ var pp = Parser.prototype;
+
+ // Move to the next token
+
+ pp.next = function(ignoreEscapeSequenceInKeyword) {
+ if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
+ { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
+ if (this.options.onToken)
+ { this.options.onToken(new Token(this)); }
+
+ this.lastTokEnd = this.end;
+ this.lastTokStart = this.start;
+ this.lastTokEndLoc = this.endLoc;
+ this.lastTokStartLoc = this.startLoc;
+ this.nextToken();
+ };
+
+ pp.getToken = function() {
+ this.next();
+ return new Token(this)
+ };
+
+ // If we're in an ES6 environment, make parsers iterable
+ if (typeof Symbol !== "undefined")
+ { pp[Symbol.iterator] = function() {
+ var this$1$1 = this;
+
+ return {
+ next: function () {
+ var token = this$1$1.getToken();
+ return {
+ done: token.type === types$1.eof,
+ value: token
+ }
+ }
+ }
+ }; }
+
+ // Toggle strict mode. Re-reads the next number or string to please
+ // pedantic tests (`"use strict"; 010;` should fail).
+
+ // Read a single token, updating the parser object's token-related
+ // properties.
+
+ pp.nextToken = function() {
+ var curContext = this.curContext();
+ if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }
+
+ this.start = this.pos;
+ if (this.options.locations) { this.startLoc = this.curPosition(); }
+ if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }
+
+ if (curContext.override) { return curContext.override(this) }
+ else { this.readToken(this.fullCharCodeAtPos()); }
+ };
+
+ pp.readToken = function(code) {
+ // Identifier or keyword. '\uXXXX' sequences are allowed in
+ // identifiers, so '\' also dispatches to that.
+ if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
+ { return this.readWord() }
+
+ return this.getTokenFromCode(code)
+ };
+
+ pp.fullCharCodeAtPos = function() {
+ var code = this.input.charCodeAt(this.pos);
+ if (code <= 0xd7ff || code >= 0xdc00) { return code }
+ var next = this.input.charCodeAt(this.pos + 1);
+ return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
+ };
+
+ pp.skipBlockComment = function() {
+ var startLoc = this.options.onComment && this.curPosition();
+ var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
+ if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
+ this.pos = end + 2;
+ if (this.options.locations) {
+ for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
+ ++this.curLine;
+ pos = this.lineStart = nextBreak;
+ }
+ }
+ if (this.options.onComment)
+ { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
+ startLoc, this.curPosition()); }
+ };
+
+ pp.skipLineComment = function(startSkip) {
+ var start = this.pos;
+ var startLoc = this.options.onComment && this.curPosition();
+ var ch = this.input.charCodeAt(this.pos += startSkip);
+ while (this.pos < this.input.length && !isNewLine(ch)) {
+ ch = this.input.charCodeAt(++this.pos);
+ }
+ if (this.options.onComment)
+ { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
+ startLoc, this.curPosition()); }
+ };
+
+ // Called at the start of the parse and after every token. Skips
+ // whitespace and comments, and.
+
+ pp.skipSpace = function() {
+ loop: while (this.pos < this.input.length) {
+ var ch = this.input.charCodeAt(this.pos);
+ switch (ch) {
+ case 32: case 160: // ' '
+ ++this.pos;
+ break
+ case 13:
+ if (this.input.charCodeAt(this.pos + 1) === 10) {
+ ++this.pos;
+ }
+ case 10: case 8232: case 8233:
+ ++this.pos;
+ if (this.options.locations) {
+ ++this.curLine;
+ this.lineStart = this.pos;
+ }
+ break
+ case 47: // '/'
+ switch (this.input.charCodeAt(this.pos + 1)) {
+ case 42: // '*'
+ this.skipBlockComment();
+ break
+ case 47:
+ this.skipLineComment(2);
+ break
+ default:
+ break loop
+ }
+ break
+ default:
+ if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
+ ++this.pos;
+ } else {
+ break loop
+ }
+ }
+ }
+ };
+
+ // Called at the end of every token. Sets `end`, `val`, and
+ // maintains `context` and `exprAllowed`, and skips the space after
+ // the token, so that the next one's `start` will point at the
+ // right position.
+
+ pp.finishToken = function(type, val) {
+ this.end = this.pos;
+ if (this.options.locations) { this.endLoc = this.curPosition(); }
+ var prevType = this.type;
+ this.type = type;
+ this.value = val;
+
+ this.updateContext(prevType);
+ };
+
+ // ### Token reading
+
+ // This is the function that is called to fetch the next token. It
+ // is somewhat obscure, because it works in character codes rather
+ // than characters, and because operator parsing has been inlined
+ // into it.
+ //
+ // All in the name of speed.
+ //
+ pp.readToken_dot = function() {
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next >= 48 && next <= 57) { return this.readNumber(true) }
+ var next2 = this.input.charCodeAt(this.pos + 2);
+ if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
+ this.pos += 3;
+ return this.finishToken(types$1.ellipsis)
+ } else {
+ ++this.pos;
+ return this.finishToken(types$1.dot)
+ }
+ };
+
+ pp.readToken_slash = function() { // '/'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
+ if (next === 61) { return this.finishOp(types$1.assign, 2) }
+ return this.finishOp(types$1.slash, 1)
+ };
+
+ pp.readToken_mult_modulo_exp = function(code) { // '%*'
+ var next = this.input.charCodeAt(this.pos + 1);
+ var size = 1;
+ var tokentype = code === 42 ? types$1.star : types$1.modulo;
+
+ // exponentiation operator ** and **=
+ if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
+ ++size;
+ tokentype = types$1.starstar;
+ next = this.input.charCodeAt(this.pos + 2);
+ }
+
+ if (next === 61) { return this.finishOp(types$1.assign, size + 1) }
+ return this.finishOp(tokentype, size)
+ };
+
+ pp.readToken_pipe_amp = function(code) { // '|&'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === code) {
+ if (this.options.ecmaVersion >= 12) {
+ var next2 = this.input.charCodeAt(this.pos + 2);
+ if (next2 === 61) { return this.finishOp(types$1.assign, 3) }
+ }
+ return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)
+ }
+ if (next === 61) { return this.finishOp(types$1.assign, 2) }
+ return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)
+ };
+
+ pp.readToken_caret = function() { // '^'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 61) { return this.finishOp(types$1.assign, 2) }
+ return this.finishOp(types$1.bitwiseXOR, 1)
+ };
+
+ pp.readToken_plus_min = function(code) { // '+-'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === code) {
+ if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
+ (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
+ // A `-->` line comment
+ this.skipLineComment(3);
+ this.skipSpace();
+ return this.nextToken()
+ }
+ return this.finishOp(types$1.incDec, 2)
+ }
+ if (next === 61) { return this.finishOp(types$1.assign, 2) }
+ return this.finishOp(types$1.plusMin, 1)
+ };
+
+ pp.readToken_lt_gt = function(code) { // '<>'
+ var next = this.input.charCodeAt(this.pos + 1);
+ var size = 1;
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
+ if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }
+ return this.finishOp(types$1.bitShift, size)
+ }
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
+ this.input.charCodeAt(this.pos + 3) === 45) {
+ // `<!--`, an XML-style comment that should be interpreted as a line comment
+ this.skipLineComment(4);
+ this.skipSpace();
+ return this.nextToken()
+ }
+ if (next === 61) { size = 2; }
+ return this.finishOp(types$1.relational, size)
+ };
+
+ pp.readToken_eq_excl = function(code) { // '=!'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
+ if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
+ this.pos += 2;
+ return this.finishToken(types$1.arrow)
+ }
+ return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1)
+ };
+
+ pp.readToken_question = function() { // '?'
+ var ecmaVersion = this.options.ecmaVersion;
+ if (ecmaVersion >= 11) {
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 46) {
+ var next2 = this.input.charCodeAt(this.pos + 2);
+ if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) }
+ }
+ if (next === 63) {
+ if (ecmaVersion >= 12) {
+ var next2$1 = this.input.charCodeAt(this.pos + 2);
+ if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) }
+ }
+ return this.finishOp(types$1.coalesce, 2)
+ }
+ }
+ return this.finishOp(types$1.question, 1)
+ };
+
+ pp.readToken_numberSign = function() { // '#'
+ var ecmaVersion = this.options.ecmaVersion;
+ var code = 35; // '#'
+ if (ecmaVersion >= 13) {
+ ++this.pos;
+ code = this.fullCharCodeAtPos();
+ if (isIdentifierStart(code, true) || code === 92 /* '\' */) {
+ return this.finishToken(types$1.privateId, this.readWord1())
+ }
+ }
+
+ this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
+ };
+
+ pp.getTokenFromCode = function(code) {
+ switch (code) {
+ // The interpretation of a dot depends on whether it is followed
+ // by a digit or another two dots.
+ case 46: // '.'
+ return this.readToken_dot()
+
+ // Punctuation tokens.
+ case 40: ++this.pos; return this.finishToken(types$1.parenL)
+ case 41: ++this.pos; return this.finishToken(types$1.parenR)
+ case 59: ++this.pos; return this.finishToken(types$1.semi)
+ case 44: ++this.pos; return this.finishToken(types$1.comma)
+ case 91: ++this.pos; return this.finishToken(types$1.bracketL)
+ case 93: ++this.pos; return this.finishToken(types$1.bracketR)
+ case 123: ++this.pos; return this.finishToken(types$1.braceL)
+ case 125: ++this.pos; return this.finishToken(types$1.braceR)
+ case 58: ++this.pos; return this.finishToken(types$1.colon)
+
+ case 96: // '`'
+ if (this.options.ecmaVersion < 6) { break }
+ ++this.pos;
+ return this.finishToken(types$1.backQuote)
+
+ case 48: // '0'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
+ if (this.options.ecmaVersion >= 6) {
+ if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
+ if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
+ }
+
+ // Anything else beginning with a digit is an integer, octal
+ // number, or float.
+ case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
+ return this.readNumber(false)
+
+ // Quotes produce strings.
+ case 34: case 39: // '"', "'"
+ return this.readString(code)
+
+ // Operators are parsed inline in tiny state machines. '=' (61) is
+ // often referred to. `finishOp` simply skips the amount of
+ // characters it is given as second argument, and returns a token
+ // of the type given by its first argument.
+ case 47: // '/'
+ return this.readToken_slash()
+
+ case 37: case 42: // '%*'
+ return this.readToken_mult_modulo_exp(code)
+
+ case 124: case 38: // '|&'
+ return this.readToken_pipe_amp(code)
+
+ case 94: // '^'
+ return this.readToken_caret()
+
+ case 43: case 45: // '+-'
+ return this.readToken_plus_min(code)
+
+ case 60: case 62: // '<>'
+ return this.readToken_lt_gt(code)
+
+ case 61: case 33: // '=!'
+ return this.readToken_eq_excl(code)
+
+ case 63: // '?'
+ return this.readToken_question()
+
+ case 126: // '~'
+ return this.finishOp(types$1.prefix, 1)
+
+ case 35: // '#'
+ return this.readToken_numberSign()
+ }
+
+ this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
+ };
+
+ pp.finishOp = function(type, size) {
+ var str = this.input.slice(this.pos, this.pos + size);
+ this.pos += size;
+ return this.finishToken(type, str)
+ };
+
+ pp.readRegexp = function() {
+ var escaped, inClass, start = this.pos;
+ for (;;) {
+ if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
+ var ch = this.input.charAt(this.pos);
+ if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
+ if (!escaped) {
+ if (ch === "[") { inClass = true; }
+ else if (ch === "]" && inClass) { inClass = false; }
+ else if (ch === "/" && !inClass) { break }
+ escaped = ch === "\\";
+ } else { escaped = false; }
+ ++this.pos;
+ }
+ var pattern = this.input.slice(start, this.pos);
+ ++this.pos;
+ var flagsStart = this.pos;
+ var flags = this.readWord1();
+ if (this.containsEsc) { this.unexpected(flagsStart); }
+
+ // Validate pattern
+ var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
+ state.reset(start, pattern, flags);
+ this.validateRegExpFlags(state);
+ this.validateRegExpPattern(state);
+
+ // Create Literal#value property value.
+ var value = null;
+ try {
+ value = new RegExp(pattern, flags);
+ } catch (e) {
+ // ESTree requires null if it failed to instantiate RegExp object.
+ // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
+ }
+
+ return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value})
+ };
+
+ // Read an integer in the given radix. Return null if zero digits
+ // were read, the integer value otherwise. When `len` is given, this
+ // will return `null` unless the integer has exactly `len` digits.
+
+ pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
+ // `len` is used for character escape sequences. In that case, disallow separators.
+ var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;
+
+ // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
+ // and isn't fraction part nor exponent part. In that case, if the first digit
+ // is zero then disallow separators.
+ var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
+
+ var start = this.pos, total = 0, lastCode = 0;
+ for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
+ var code = this.input.charCodeAt(this.pos), val = (void 0);
+
+ if (allowSeparators && code === 95) {
+ if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
+ if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
+ if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
+ lastCode = code;
+ continue
+ }
+
+ if (code >= 97) { val = code - 97 + 10; } // a
+ else if (code >= 65) { val = code - 65 + 10; } // A
+ else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
+ else { val = Infinity; }
+ if (val >= radix) { break }
+ lastCode = code;
+ total = total * radix + val;
+ }
+
+ if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
+ if (this.pos === start || len != null && this.pos - start !== len) { return null }
+
+ return total
+ };
+
+ function stringToNumber(str, isLegacyOctalNumericLiteral) {
+ if (isLegacyOctalNumericLiteral) {
+ return parseInt(str, 8)
+ }
+
+ // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
+ return parseFloat(str.replace(/_/g, ""))
+ }
+
+ function stringToBigInt(str) {
+ if (typeof BigInt !== "function") {
+ return null
+ }
+
+ // `BigInt(value)` throws syntax error if the string contains numeric separators.
+ return BigInt(str.replace(/_/g, ""))
+ }
+
+ pp.readRadixNumber = function(radix) {
+ var start = this.pos;
+ this.pos += 2; // 0x
+ var val = this.readInt(radix);
+ if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
+ if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
+ val = stringToBigInt(this.input.slice(start, this.pos));
+ ++this.pos;
+ } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
+ return this.finishToken(types$1.num, val)
+ };
+
+ // Read an integer, octal integer, or floating-point number.
+
+ pp.readNumber = function(startsWithDot) {
+ var start = this.pos;
+ if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
+ var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+ if (octal && this.strict) { this.raise(start, "Invalid number"); }
+ var next = this.input.charCodeAt(this.pos);
+ if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
+ var val$1 = stringToBigInt(this.input.slice(start, this.pos));
+ ++this.pos;
+ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
+ return this.finishToken(types$1.num, val$1)
+ }
+ if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
+ if (next === 46 && !octal) { // '.'
+ ++this.pos;
+ this.readInt(10);
+ next = this.input.charCodeAt(this.pos);
+ }
+ if ((next === 69 || next === 101) && !octal) { // 'eE'
+ next = this.input.charCodeAt(++this.pos);
+ if (next === 43 || next === 45) { ++this.pos; } // '+-'
+ if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
+ }
+ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
+
+ var val = stringToNumber(this.input.slice(start, this.pos), octal);
+ return this.finishToken(types$1.num, val)
+ };
+
+ // Read a string value, interpreting backslash-escapes.
+
+ pp.readCodePoint = function() {
+ var ch = this.input.charCodeAt(this.pos), code;
+
+ if (ch === 123) { // '{'
+ if (this.options.ecmaVersion < 6) { this.unexpected(); }
+ var codePos = ++this.pos;
+ code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
+ ++this.pos;
+ if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
+ } else {
+ code = this.readHexChar(4);
+ }
+ return code
+ };
+
+ pp.readString = function(quote) {
+ var out = "", chunkStart = ++this.pos;
+ for (;;) {
+ if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
+ var ch = this.input.charCodeAt(this.pos);
+ if (ch === quote) { break }
+ if (ch === 92) { // '\'
+ out += this.input.slice(chunkStart, this.pos);
+ out += this.readEscapedChar(false);
+ chunkStart = this.pos;
+ } else if (ch === 0x2028 || ch === 0x2029) {
+ if (this.options.ecmaVersion < 10) { this.raise(this.start, "Unterminated string constant"); }
+ ++this.pos;
+ if (this.options.locations) {
+ this.curLine++;
+ this.lineStart = this.pos;
+ }
+ } else {
+ if (isNewLine(ch)) { this.raise(this.start, "Unterminated string constant"); }
+ ++this.pos;
+ }
+ }
+ out += this.input.slice(chunkStart, this.pos++);
+ return this.finishToken(types$1.string, out)
+ };
+
+ // Reads template string tokens.
+
+ var INVALID_TEMPLATE_ESCAPE_ERROR = {};
+
+ pp.tryReadTemplateToken = function() {
+ this.inTemplateElement = true;
+ try {
+ this.readTmplToken();
+ } catch (err) {
+ if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
+ this.readInvalidTemplateToken();
+ } else {
+ throw err
+ }
+ }
+
+ this.inTemplateElement = false;
+ };
+
+ pp.invalidStringToken = function(position, message) {
+ if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
+ throw INVALID_TEMPLATE_ESCAPE_ERROR
+ } else {
+ this.raise(position, message);
+ }
+ };
+
+ pp.readTmplToken = function() {
+ var out = "", chunkStart = this.pos;
+ for (;;) {
+ if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
+ var ch = this.input.charCodeAt(this.pos);
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
+ if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {
+ if (ch === 36) {
+ this.pos += 2;
+ return this.finishToken(types$1.dollarBraceL)
+ } else {
+ ++this.pos;
+ return this.finishToken(types$1.backQuote)
+ }
+ }
+ out += this.input.slice(chunkStart, this.pos);
+ return this.finishToken(types$1.template, out)
+ }
+ if (ch === 92) { // '\'
+ out += this.input.slice(chunkStart, this.pos);
+ out += this.readEscapedChar(true);
+ chunkStart = this.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.pos);
+ ++this.pos;
+ switch (ch) {
+ case 13:
+ if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
+ case 10:
+ out += "\n";
+ break
+ default:
+ out += String.fromCharCode(ch);
+ break
+ }
+ if (this.options.locations) {
+ ++this.curLine;
+ this.lineStart = this.pos;
+ }
+ chunkStart = this.pos;
+ } else {
+ ++this.pos;
+ }
+ }
+ };
+
+ // Reads a template token to search for the end, without validating any escape sequences
+ pp.readInvalidTemplateToken = function() {
+ for (; this.pos < this.input.length; this.pos++) {
+ switch (this.input[this.pos]) {
+ case "\\":
+ ++this.pos;
+ break
+
+ case "$":
+ if (this.input[this.pos + 1] !== "{") {
+ break
+ }
+
+ // falls through
+ case "`":
+ return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))
+
+ // no default
+ }
+ }
+ this.raise(this.start, "Unterminated template");
+ };
+
+ // Used to read escaped characters
+
+ pp.readEscapedChar = function(inTemplate) {
+ var ch = this.input.charCodeAt(++this.pos);
+ ++this.pos;
+ switch (ch) {
+ case 110: return "\n" // 'n' -> '\n'
+ case 114: return "\r" // 'r' -> '\r'
+ case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
+ case 117: return codePointToString(this.readCodePoint()) // 'u'
+ case 116: return "\t" // 't' -> '\t'
+ case 98: return "\b" // 'b' -> '\b'
+ case 118: return "\u000b" // 'v' -> '\u000b'
+ case 102: return "\f" // 'f' -> '\f'
+ case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
+ case 10: // ' \n'
+ if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
+ return ""
+ case 56:
+ case 57:
+ if (this.strict) {
+ this.invalidStringToken(
+ this.pos - 1,
+ "Invalid escape sequence"
+ );
+ }
+ if (inTemplate) {
+ var codePos = this.pos - 1;
+
+ this.invalidStringToken(
+ codePos,
+ "Invalid escape sequence in template string"
+ );
+ }
+ default:
+ if (ch >= 48 && ch <= 55) {
+ var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
+ var octal = parseInt(octalStr, 8);
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+ this.pos += octalStr.length - 1;
+ ch = this.input.charCodeAt(this.pos);
+ if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
+ this.invalidStringToken(
+ this.pos - 1 - octalStr.length,
+ inTemplate
+ ? "Octal literal in template string"
+ : "Octal literal in strict mode"
+ );
+ }
+ return String.fromCharCode(octal)
+ }
+ if (isNewLine(ch)) {
+ // Unicode new line characters after \ get removed from output in both
+ // template literals and strings
+ return ""
+ }
+ return String.fromCharCode(ch)
+ }
+ };
+
+ // Used to read character escape sequences ('\x', '\u', '\U').
+
+ pp.readHexChar = function(len) {
+ var codePos = this.pos;
+ var n = this.readInt(16, len);
+ if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
+ return n
+ };
+
+ // Read an identifier, and return it as a string. Sets `this.containsEsc`
+ // to whether the word contained a '\u' escape.
+ //
+ // Incrementally adds only escaped chars, adding other chunks as-is
+ // as a micro-optimization.
+
+ pp.readWord1 = function() {
+ this.containsEsc = false;
+ var word = "", first = true, chunkStart = this.pos;
+ var astral = this.options.ecmaVersion >= 6;
+ while (this.pos < this.input.length) {
+ var ch = this.fullCharCodeAtPos();
+ if (isIdentifierChar(ch, astral)) {
+ this.pos += ch <= 0xffff ? 1 : 2;
+ } else if (ch === 92) { // "\"
+ this.containsEsc = true;
+ word += this.input.slice(chunkStart, this.pos);
+ var escStart = this.pos;
+ if (this.input.charCodeAt(++this.pos) !== 117) // "u"
+ { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
+ ++this.pos;
+ var esc = this.readCodePoint();
+ if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
+ { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
+ word += codePointToString(esc);
+ chunkStart = this.pos;
+ } else {
+ break
+ }
+ first = false;
+ }
+ return word + this.input.slice(chunkStart, this.pos)
+ };
+
+ // Read an identifier or keyword token. Will check for reserved
+ // words when necessary.
+
+ pp.readWord = function() {
+ var word = this.readWord1();
+ var type = types$1.name;
+ if (this.keywords.test(word)) {
+ type = keywords[word];
+ }
+ return this.finishToken(type, word)
+ };
+
+ // Acorn is a tiny, fast JavaScript parser written in JavaScript.
+
+ var version = "8.8.2";
+
+ Parser.acorn = {
+ Parser: Parser,
+ version: version,
+ defaultOptions: defaultOptions,
+ Position: Position,
+ SourceLocation: SourceLocation,
+ getLineInfo: getLineInfo,
+ Node: Node,
+ TokenType: TokenType,
+ tokTypes: types$1,
+ keywordTypes: keywords,
+ TokContext: TokContext,
+ tokContexts: types,
+ isIdentifierChar: isIdentifierChar,
+ isIdentifierStart: isIdentifierStart,
+ Token: Token,
+ isNewLine: isNewLine,
+ lineBreak: lineBreak,
+ lineBreakG: lineBreakG,
+ nonASCIIwhitespace: nonASCIIwhitespace
+ };
+
+ // The main exported interface (under `self.acorn` when in the
+ // browser) is a `parse` function that takes a code string and
+ // returns an abstract syntax tree as specified by [Mozilla parser
+ // API][api].
+ //
+ // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
+
+ function parse(input, options) {
+ return Parser.parse(input, options)
+ }
+
+ // This function tries to parse a single expression at a given
+ // offset in a string. Useful for parsing mixed-language formats
+ // that embed JavaScript expressions.
+
+ function parseExpressionAt(input, pos, options) {
+ return Parser.parseExpressionAt(input, pos, options)
+ }
+
+ // Acorn is organized as a tokenizer and a recursive-descent parser.
+ // The `tokenizer` export provides an interface to the tokenizer.
+
+ function tokenizer(input, options) {
+ return Parser.tokenizer(input, options)
+ }
+
+ exports.Node = Node;
+ exports.Parser = Parser;
+ exports.Position = Position;
+ exports.SourceLocation = SourceLocation;
+ exports.TokContext = TokContext;
+ exports.Token = Token;
+ exports.TokenType = TokenType;
+ exports.defaultOptions = defaultOptions;
+ exports.getLineInfo = getLineInfo;
+ exports.isIdentifierChar = isIdentifierChar;
+ exports.isIdentifierStart = isIdentifierStart;
+ exports.isNewLine = isNewLine;
+ exports.keywordTypes = keywords;
+ exports.lineBreak = lineBreak;
+ exports.lineBreakG = lineBreakG;
+ exports.nonASCIIwhitespace = nonASCIIwhitespace;
+ exports.parse = parse;
+ exports.parseExpressionAt = parseExpressionAt;
+ exports.tokContexts = types;
+ exports.tokTypes = types$1;
+ exports.tokenizer = tokenizer;
+ exports.version = version;
+
+ }));
+ } (acorn$1, acornExports));
+
+ /* eslint-disable complexity */
+
+ var acorn = acornExports;
+ var sourceMap = sourceMap$1;
+ const NEWLINE_CODE = 10;
+
+ function prettyFast(input, options) {
+ return new PrettyFast(options).getPrettifiedCodeAndSourceMap(input);
+ }
+
+ // If any of these tokens are seen before a "[" token, we know that "[" token
+ // is the start of an array literal, rather than a property access.
+ //
+ // The only exception is "}", which would need to be disambiguated by
+ // parsing. The majority of the time, an open bracket following a closing
+ // curly is going to be an array literal, so we brush the complication under
+ // the rug, and handle the ambiguity by always assuming that it will be an
+ // array literal.
+ const PRE_ARRAY_LITERAL_TOKENS = new Set([
+ "typeof",
+ "void",
+ "delete",
+ "case",
+ "do",
+ "=",
+ "in",
+ "of",
+ "...",
+ "{",
+ "*",
+ "/",
+ "%",
+ "else",
+ ";",
+ "++",
+ "--",
+ "+",
+ "-",
+ "~",
+ "!",
+ ":",
+ "?",
+ ">>",
+ ">>>",
+ "<<",
+ "||",
+ "&&",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "instanceof",
+ "&",
+ "^",
+ "|",
+ "==",
+ "!=",
+ "===",
+ "!==",
+ ",",
+ "}",
+ ]);
+
+ // If any of these tokens are seen before a "{" token, we know that "{" token
+ // is the start of an object literal, rather than the start of a block.
+ const PRE_OBJECT_LITERAL_TOKENS = new Set([
+ "typeof",
+ "void",
+ "delete",
+ "=",
+ "in",
+ "of",
+ "...",
+ "*",
+ "/",
+ "%",
+ "++",
+ "--",
+ "+",
+ "-",
+ "~",
+ "!",
+ ">>",
+ ">>>",
+ "<<",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "instanceof",
+ "&",
+ "^",
+ "|",
+ "==",
+ "!=",
+ "===",
+ "!==",
+ ]);
+
+ class PrettyFast {
+ /**
+ * @param {Object} options: Provides configurability of the pretty printing.
+ * @param {String} options.url: The URL string of the ugly JS code.
+ * @param {String} options.indent: The string to indent code by.
+ * @param {SourceMapGenerator} options.sourceMapGenerator: An optional sourceMapGenerator
+ * the mappings will be added to.
+ * @param {Boolean} options.prefixWithNewLine: When true, the pretty printed code will start
+ * with a line break
+ * @param {Integer} options.originalStartLine: The line the passed script starts at (1-based).
+ * This is used for inline scripts where we need to account for the lines
+ * before the script tag
+ * @param {Integer} options.originalStartColumn: The column the passed script starts at (1-based).
+ * This is used for inline scripts where we need to account for the position
+ * of the script tag within the line.
+ * @param {Integer} options.generatedStartLine: The line where the pretty printed script
+ * will start at (1-based). This is used for pretty printing HTML file,
+ * where we might have handle previous inline scripts that impact the
+ * position of this script.
+ */
+ constructor(options = {}) {
+ // The level of indents deep we are.
+ this.#indentLevel = 0;
+ this.#indentChar = options.indent;
+
+ // We will handle mappings between ugly and pretty printed code in this SourceMapGenerator.
+ this.#sourceMapGenerator =
+ options.sourceMapGenerator ||
+ new sourceMap.SourceMapGenerator({
+ file: options.url,
+ });
+
+ this.#file = options.url;
+ this.#hasOriginalStartLine = "originalStartLine" in options;
+ this.#hasOriginalStartColumn = "originalStartColumn" in options;
+ this.#hasGeneratedStartLine = "generatedStartLine" in options;
+ this.#originalStartLine = options.originalStartLine;
+ this.#originalStartColumn = options.originalStartColumn;
+ this.#generatedStartLine = options.generatedStartLine;
+ this.#prefixWithNewLine = options.prefixWithNewLine;
+ }
+
+ /* options */
+ #indentChar;
+ #indentLevel;
+ #file;
+ #hasOriginalStartLine;
+ #hasOriginalStartColumn;
+ #hasGeneratedStartLine;
+ #originalStartLine;
+ #originalStartColumn;
+ #prefixWithNewLine;
+ #generatedStartLine;
+ #sourceMapGenerator;
+
+ /* internals */
+
+ // Whether or not we added a newline on after we added the previous token.
+ #addedNewline = false;
+ // Whether or not we added a space after we added the previous token.
+ #addedSpace = false;
+ #currentCode = "";
+ #currentLine = 1;
+ #currentColumn = 0;
+ // The tokens parsed by acorn.
+ #tokenQueue;
+ // The index of the current token in this.#tokenQueue.
+ #currentTokenIndex;
+ // The previous token we added to the pretty printed code.
+ #previousToken;
+ // Stack of token types/keywords that can affect whether we want to add a
+ // newline or a space. We can make that decision based on what token type is
+ // on the top of the stack. For example, a comma in a parameter list should
+ // be followed by a space, while a comma in an object literal should be
+ // followed by a newline.
+ //
+ // Strings that go on the stack:
+ //
+ // - "{"
+ // - "{\n"
+ // - "("
+ // - "(\n"
+ // - "["
+ // - "[\n"
+ // - "do"
+ // - "?"
+ // - "switch"
+ // - "case"
+ // - "default"
+ //
+ // The difference between "[" and "[\n" (as well as "{" and "{\n", and "(" and "(\n")
+ // is that "\n" is used when we are treating (curly) brackets/parens as line delimiters
+ // and should increment and decrement the indent level when we find them.
+ // "[" can represent either a property access (e.g. `x["hi"]`), or an empty array literal
+ // "{" only represents an empty object literals
+ // "(" can represent lots of different things (wrapping expression, if/loop condition, function call, …)
+ #stack = [];
+
+ /**
+ * @param {String} input: The ugly JS code we want to pretty print.
+ * @returns {Object}
+ * An object with the following properties:
+ * - code: The pretty printed code string.
+ * - map: A SourceMapGenerator instance.
+ */
+ getPrettifiedCodeAndSourceMap(input) {
+ // Add the initial new line if needed
+ if (this.#prefixWithNewLine) {
+ this.#write("\n");
+ }
+
+ // Pass through acorn's tokenizer and append tokens and comments into a
+ // single queue to process. For example, the source file:
+ //
+ // foo
+ // // a
+ // // b
+ // bar
+ //
+ // After this process, tokenQueue has the following token stream:
+ //
+ // [ foo, '// a', '// b', bar]
+ this.#tokenQueue = this.#getTokens(input);
+
+ for (let i = 0, len = this.#tokenQueue.length; i < len; i++) {
+ this.#currentTokenIndex = i;
+ const token = this.#tokenQueue[i];
+ const nextToken = this.#tokenQueue[i + 1];
+ this.#handleToken(token, nextToken);
+
+ // Acorn's tokenizer re-uses tokens, so we have to copy the previous token on
+ // every iteration. We follow acorn's lead here, and reuse the previousToken
+ // object the same way that acorn reuses the token object. This allows us
+ // to avoid allocations and minimize GC pauses.
+ if (!this.#previousToken) {
+ this.#previousToken = { loc: { start: {}, end: {} } };
+ }
+ this.#previousToken.start = token.start;
+ this.#previousToken.end = token.end;
+ this.#previousToken.loc.start.line = token.loc.start.line;
+ this.#previousToken.loc.start.column = token.loc.start.column;
+ this.#previousToken.loc.end.line = token.loc.end.line;
+ this.#previousToken.loc.end.column = token.loc.end.column;
+ this.#previousToken.type = token.type;
+ this.#previousToken.value = token.value;
+ }
+
+ return { code: this.#currentCode, map: this.#sourceMapGenerator };
+ }
+
+ /**
+ * Write a pretty printed string to the prettified string and for tokens, add their
+ * mapping to the SourceMapGenerator.
+ *
+ * @param String str
+ * The string to be added to the result.
+ * @param Number line
+ * The line number the string came from in the ugly source.
+ * @param Number column
+ * The column number the string came from in the ugly source.
+ * @param Boolean isToken
+ * Set to true when writing tokens, so we can differentiate them from the
+ * whitespace we add.
+ */
+ #write(str, line, column, isToken) {
+ this.#currentCode += str;
+ if (isToken) {
+ this.#sourceMapGenerator.addMapping({
+ source: this.#file,
+ // We need to swap original and generated locations, as the prettified text should
+ // be seen by the sourcemap service as the "original" one.
+ generated: {
+ // originalStartLine is 1-based, and here we just want to offset by a number of
+ // lines, so we need to decrement it
+ line: this.#hasOriginalStartLine
+ ? line + (this.#originalStartLine - 1)
+ : line,
+ // We only need to adjust the column number if we're looking at the first line, to
+ // account for the html text before the opening <script> tag.
+ column:
+ line == 1 && this.#hasOriginalStartColumn
+ ? column + this.#originalStartColumn
+ : column,
+ },
+ original: {
+ // generatedStartLine is 1-based, and here we just want to offset by a number of
+ // lines, so we need to decrement it.
+ line: this.#hasGeneratedStartLine
+ ? this.#currentLine + (this.#generatedStartLine - 1)
+ : this.#currentLine,
+ column: this.#currentColumn,
+ },
+ name: null,
+ });
+ }
+
+ for (let idx = 0, length = str.length; idx < length; idx++) {
+ if (str.charCodeAt(idx) === NEWLINE_CODE) {
+ this.#currentLine++;
+ this.#currentColumn = 0;
+ } else {
+ this.#currentColumn++;
+ }
+ }
+ }
+
+ /**
+ * Add the given token to the pretty printed results.
+ *
+ * @param Object token
+ * The token to add.
+ */
+ #writeToken(token) {
+ if (token.type.label == "string") {
+ this.#write(
+ `'${sanitize(token.value)}'`,
+ token.loc.start.line,
+ token.loc.start.column,
+ true
+ );
+ } else if (token.type.label == "regexp") {
+ this.#write(
+ String(token.value.value),
+ token.loc.start.line,
+ token.loc.start.column,
+ true
+ );
+ } else {
+ let value;
+ if (token.value != null) {
+ value = token.value;
+ if (token.type.label === "privateId") {
+ value = `#${value}`;
+ }
+ } else {
+ value = token.type.label;
+ }
+ this.#write(
+ String(value),
+ token.loc.start.line,
+ token.loc.start.column,
+ true
+ );
+ }
+ }
+
+ /**
+ * Returns the tokens computed with acorn.
+ *
+ * @param String input
+ * The JS code we want the tokens of.
+ * @returns Array<Object>
+ */
+ #getTokens(input) {
+ const tokens = [];
+
+ const res = acorn.tokenizer(input, {
+ locations: true,
+ ecmaVersion: "latest",
+ onComment(block, text, start, end, startLoc, endLoc) {
+ tokens.push({
+ type: {},
+ comment: true,
+ block,
+ text,
+ loc: { start: startLoc, end: endLoc },
+ });
+ },
+ });
+
+ for (;;) {
+ const token = res.getToken();
+ tokens.push(token);
+ if (token.type.label == "eof") {
+ break;
+ }
+ }
+
+ return tokens;
+ }
+
+ /**
+ * Add the required whitespace before this token, whether that is a single
+ * space, newline, and/or the indent on fresh lines.
+ *
+ * @param Object token
+ * The token we are currently handling.
+ * @param {Object|undefined} nextToken
+ * The next token, might not exist if we're on the last token
+ */
+ #handleToken(token, nextToken) {
+ if (token.comment) {
+ let commentIndentLevel = this.#indentLevel;
+ if (this.#previousToken?.loc?.end?.line == token.loc.start.line) {
+ commentIndentLevel = 0;
+ this.#write(" ");
+ }
+ this.#addComment(
+ commentIndentLevel,
+ token.block,
+ token.text,
+ token.loc.start.line,
+ nextToken
+ );
+ return;
+ }
+
+ // Shorthand for token.type.keyword, so we don't have to repeatedly access
+ // properties.
+ const ttk = token.type.keyword;
+
+ if (ttk && this.#previousToken?.type?.label == ".") {
+ token.type = acorn.tokTypes.name;
+ }
+
+ // Shorthand for token.type.label, so we don't have to repeatedly access
+ // properties.
+ const ttl = token.type.label;
+
+ if (ttl == "eof") {
+ if (!this.#addedNewline) {
+ this.#write("\n");
+ }
+ return;
+ }
+
+ if (belongsOnStack(token)) {
+ let stackEntry;
+
+ if (isArrayLiteral(token, this.#previousToken)) {
+ // Don't add new lines for empty array literals
+ stackEntry = nextToken?.type?.label === "]" ? "[" : "[\n";
+ } else if (isObjectLiteral(token, this.#previousToken)) {
+ // Don't add new lines for empty object literals
+ stackEntry = nextToken?.type?.label === "}" ? "{" : "{\n";
+ } else if (
+ isRoundBracketStartingLongParenthesis(
+ token,
+ this.#tokenQueue,
+ this.#currentTokenIndex
+ )
+ ) {
+ stackEntry = "(\n";
+ } else if (ttl == "{") {
+ // We need to add a line break for "{" which are not empty object literals
+ stackEntry = "{\n";
+ } else {
+ stackEntry = ttl || ttk;
+ }
+
+ this.#stack.push(stackEntry);
+ }
+
+ this.#maybeDecrementIndent(token);
+ this.#prependWhiteSpace(token);
+ this.#writeToken(token);
+ this.#addedSpace = false;
+
+ // If the next token is going to be a comment starting on the same line,
+ // then no need to add a new line here
+ if (
+ !nextToken ||
+ !nextToken.comment ||
+ token.loc.end.line != nextToken.loc.start.line
+ ) {
+ this.#maybeAppendNewline(token);
+ }
+
+ this.#maybePopStack(token);
+ this.#maybeIncrementIndent(token);
+ }
+
+ /**
+ * Returns true if the given token should cause us to pop the stack.
+ */
+ #maybePopStack(token) {
+ const ttl = token.type.label;
+ const ttk = token.type.keyword;
+ const top = this.#stack.at(-1);
+
+ if (
+ ttl == "]" ||
+ ttl == ")" ||
+ ttl == "}" ||
+ (ttl == ":" && (top == "case" || top == "default" || top == "?")) ||
+ (ttk == "while" && top == "do")
+ ) {
+ this.#stack.pop();
+ if (ttl == "}" && this.#stack.at(-1) == "switch") {
+ this.#stack.pop();
+ }
+ }
+ }
+
+ #maybeIncrementIndent(token) {
+ if (
+ // Don't increment indent for empty object literals
+ (token.type.label == "{" && this.#stack.at(-1) === "{\n") ||
+ // Don't increment indent for empty array literals
+ (token.type.label == "[" && this.#stack.at(-1) === "[\n") ||
+ token.type.keyword == "switch" ||
+ (token.type.label == "(" && this.#stack.at(-1) === "(\n")
+ ) {
+ this.#indentLevel++;
+ }
+ }
+
+ #shouldDecrementIndent(token) {
+ const top = this.#stack.at(-1);
+ const ttl = token.type.label;
+ return (
+ (ttl == "}" && top == "{\n") ||
+ (ttl == "]" && top == "[\n") ||
+ (ttl == ")" && top == "(\n")
+ );
+ }
+
+ #maybeDecrementIndent(token) {
+ if (!this.#shouldDecrementIndent(token)) {
+ return;
+ }
+
+ const ttl = token.type.label;
+ this.#indentLevel--;
+ if (ttl == "}" && this.#stack.at(-2) == "switch") {
+ this.#indentLevel--;
+ }
+ }
+
+ /**
+ * Add a comment to the pretty printed code.
+ *
+ * @param Number indentLevel
+ * The number of indents deep we are (might be different from this.#indentLevel).
+ * @param Boolean block
+ * True if the comment is a multiline block style comment.
+ * @param String text
+ * The text of the comment.
+ * @param Number line
+ * The line number to comment appeared on.
+ * @param Object nextToken
+ * The next token if any.
+ */
+ #addComment(indentLevel, block, text, line, nextToken) {
+ const indentString = this.#indentChar.repeat(indentLevel);
+ const needNewLineAfter =
+ !block || !(nextToken && nextToken.loc.start.line == line);
+
+ if (block) {
+ const commentLinesText = text
+ .split(new RegExp(`/\n${indentString}/`, "g"))
+ .join(`\n${indentString}`);
+
+ this.#write(
+ `${indentString}/*${commentLinesText}*/${needNewLineAfter ? "\n" : " "}`
+ );
+ } else {
+ this.#write(`${indentString}//${text}\n`);
+ }
+
+ this.#addedNewline = needNewLineAfter;
+ this.#addedSpace = !needNewLineAfter;
+ }
+
+ /**
+ * Add the required whitespace before this token, whether that is a single
+ * space, newline, and/or the indent on fresh lines.
+ *
+ * @param Object token
+ * The token we are about to add to the pretty printed code.
+ */
+ #prependWhiteSpace(token) {
+ const ttk = token.type.keyword;
+ const ttl = token.type.label;
+ let newlineAdded = this.#addedNewline;
+ let spaceAdded = this.#addedSpace;
+ const ltt = this.#previousToken?.type?.label;
+
+ // Handle whitespace and newlines after "}" here instead of in
+ // `isLineDelimiter` because it is only a line delimiter some of the
+ // time. For example, we don't want to put "else if" on a new line after
+ // the first if's block.
+ if (this.#previousToken && ltt == "}") {
+ if (
+ (ttk == "while" && this.#stack.at(-1) == "do") ||
+ needsSpaceBeforeClosingCurlyBracket(ttk)
+ ) {
+ this.#write(" ");
+ spaceAdded = true;
+ } else if (needsLineBreakBeforeClosingCurlyBracket(ttl)) {
+ this.#write("\n");
+ newlineAdded = true;
+ }
+ }
+
+ if (
+ (ttl == ":" && this.#stack.at(-1) == "?") ||
+ (ttl == "}" && this.#stack.at(-1) == "${")
+ ) {
+ this.#write(" ");
+ spaceAdded = true;
+ }
+
+ if (this.#previousToken && ltt != "}" && ltt != "." && ttk == "else") {
+ this.#write(" ");
+ spaceAdded = true;
+ }
+
+ const ensureNewline = () => {
+ if (!newlineAdded) {
+ this.#write("\n");
+ newlineAdded = true;
+ }
+ };
+
+ if (isASI(token, this.#previousToken)) {
+ ensureNewline();
+ }
+
+ if (this.#shouldDecrementIndent(token)) {
+ ensureNewline();
+ }
+
+ if (newlineAdded) {
+ let indentLevel = this.#indentLevel;
+ if (ttk == "case" || ttk == "default") {
+ indentLevel--;
+ }
+ this.#write(this.#indentChar.repeat(indentLevel));
+ } else if (!spaceAdded && needsSpaceAfter(token, this.#previousToken)) {
+ this.#write(" ");
+ spaceAdded = true;
+ }
+ }
+
+ /**
+ * Append the necessary whitespace to the result after we have added the given
+ * token.
+ *
+ * @param Object token
+ * The token that was just added to the result.
+ */
+ #maybeAppendNewline(token) {
+ if (!isLineDelimiter(token, this.#stack)) {
+ this.#addedNewline = false;
+ return;
+ }
+
+ this.#write("\n");
+ this.#addedNewline = true;
+ }
+ }
+
+ /**
+ * Determines if we think that the given token starts an array literal.
+ *
+ * @param Object token
+ * The token we want to determine if it is an array literal.
+ * @param Object previousToken
+ * The previous token we added to the pretty printed results.
+ *
+ * @returns Boolean
+ * True if we believe it is an array literal, false otherwise.
+ */
+ function isArrayLiteral(token, previousToken) {
+ if (token.type.label != "[") {
+ return false;
+ }
+ if (!previousToken) {
+ return true;
+ }
+ if (previousToken.type.isAssign) {
+ return true;
+ }
+
+ return PRE_ARRAY_LITERAL_TOKENS.has(
+ previousToken.type.keyword ||
+ // Some tokens ('of', 'yield', …) have a `token.type.keyword` of 'name' and their
+ // actual value in `token.value`
+ (previousToken.type.label == "name"
+ ? previousToken.value
+ : previousToken.type.label)
+ );
+ }
+
+ /**
+ * Determines if we think that the given token starts an object literal.
+ *
+ * @param Object token
+ * The token we want to determine if it is an object literal.
+ * @param Object previousToken
+ * The previous token we added to the pretty printed results.
+ *
+ * @returns Boolean
+ * True if we believe it is an object literal, false otherwise.
+ */
+ function isObjectLiteral(token, previousToken) {
+ if (token.type.label != "{") {
+ return false;
+ }
+ if (!previousToken) {
+ return false;
+ }
+ if (previousToken.type.isAssign) {
+ return true;
+ }
+ return PRE_OBJECT_LITERAL_TOKENS.has(
+ previousToken.type.keyword || previousToken.type.label
+ );
+ }
+
+ /**
+ * Determines if we think that the given token starts a long parenthesis
+ *
+ * @param {Object} token
+ * The token we want to determine if it is the beginning of a long paren.
+ * @param {Array<Object>} tokenQueue
+ * The whole list of tokens parsed by acorn
+ * @param {Integer} currentTokenIndex
+ * The index of `token` in `tokenQueue`
+ * @returns
+ */
+ function isRoundBracketStartingLongParenthesis(
+ token,
+ tokenQueue,
+ currentTokenIndex
+ ) {
+ if (token.type.label !== "(") {
+ return false;
+ }
+
+ // If we're just wrapping an object, we'll have a new line right after
+ if (tokenQueue[currentTokenIndex + 1].type.label == "{") {
+ return false;
+ }
+
+ // We're going to iterate through the following tokens until :
+ // - we find the closing parent
+ // - or we reached the maximum character we think should be in parenthesis
+ const longParentContentLength = 60;
+
+ // Keep track of other parens so we know when we get the closing one for `token`
+ let parenCount = 0;
+ let parenContentLength = 0;
+ for (let i = currentTokenIndex + 1, len = tokenQueue.length; i < len; i++) {
+ const currToken = tokenQueue[i];
+ const ttl = currToken.type.label;
+
+ if (ttl == "(") {
+ parenCount++;
+ } else if (ttl == ")") {
+ if (parenCount == 0) {
+ // Matching closing paren, if we got here, we didn't reach the length limit,
+ // as we return when parenContentLength is greater than the limit.
+ return false;
+ }
+ parenCount--;
+ }
+
+ // Aside block comments, all tokens start and end location are on the same line, so
+ // we can use `start` and `end` to deduce the token length.
+ const tokenLength = currToken.comment
+ ? currToken.text.length
+ : currToken.end - currToken.start;
+ parenContentLength += tokenLength;
+
+ // If we didn't find the matching closing paren yet and the characters from the
+ // tokens we evaluated so far are longer than the limit, so consider the token
+ // a long paren.
+ if (parenContentLength > longParentContentLength) {
+ return true;
+ }
+ }
+
+ // if we get to here, we didn't found a closing paren, which shouldn't happen
+ // (scripts with syntax error are not displayed in the debugger), but just to
+ // be safe, return false.
+ return false;
+ }
+
+ // If any of these tokens are followed by a token on a new line, we know that
+ // ASI cannot happen.
+ const PREVENT_ASI_AFTER_TOKENS = new Set([
+ // Binary operators
+ "*",
+ "/",
+ "%",
+ "+",
+ "-",
+ "<<",
+ ">>",
+ ">>>",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "instanceof",
+ "in",
+ "==",
+ "!=",
+ "===",
+ "!==",
+ "&",
+ "^",
+ "|",
+ "&&",
+ "||",
+ ",",
+ ".",
+ "=",
+ "*=",
+ "/=",
+ "%=",
+ "+=",
+ "-=",
+ "<<=",
+ ">>=",
+ ">>>=",
+ "&=",
+ "^=",
+ "|=",
+ // Unary operators
+ "delete",
+ "void",
+ "typeof",
+ "~",
+ "!",
+ "new",
+ // Function calls and grouped expressions
+ "(",
+ ]);
+
+ // If any of these tokens are on a line after the token before it, we know
+ // that ASI cannot happen.
+ const PREVENT_ASI_BEFORE_TOKENS = new Set([
+ // Binary operators
+ "*",
+ "/",
+ "%",
+ "<<",
+ ">>",
+ ">>>",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "instanceof",
+ "in",
+ "==",
+ "!=",
+ "===",
+ "!==",
+ "&",
+ "^",
+ "|",
+ "&&",
+ "||",
+ ",",
+ ".",
+ "=",
+ "*=",
+ "/=",
+ "%=",
+ "+=",
+ "-=",
+ "<<=",
+ ">>=",
+ ">>>=",
+ "&=",
+ "^=",
+ "|=",
+ // Function calls
+ "(",
+ ]);
+
+ /**
+ * Determine if a token can look like an identifier. More precisely,
+ * this determines if the token may end or start with a character from
+ * [A-Za-z0-9_].
+ *
+ * @param Object token
+ * The token we are looking at.
+ *
+ * @returns Boolean
+ * True if identifier-like.
+ */
+ function isIdentifierLike(token) {
+ const ttl = token.type.label;
+ return (
+ ttl == "name" || ttl == "num" || ttl == "privateId" || !!token.type.keyword
+ );
+ }
+
+ /**
+ * Determines if Automatic Semicolon Insertion (ASI) occurs between these
+ * tokens.
+ *
+ * @param Object token
+ * The current token.
+ * @param Object previousToken
+ * The previous token we added to the pretty printed results.
+ *
+ * @returns Boolean
+ * True if we believe ASI occurs.
+ */
+ function isASI(token, previousToken) {
+ if (!previousToken) {
+ return false;
+ }
+ if (token.loc.start.line === previousToken.loc.start.line) {
+ return false;
+ }
+ if (
+ previousToken.type.keyword == "return" ||
+ previousToken.type.keyword == "yield" ||
+ (previousToken.type.label == "name" && previousToken.value == "yield")
+ ) {
+ return true;
+ }
+ if (
+ PREVENT_ASI_AFTER_TOKENS.has(
+ previousToken.type.label || previousToken.type.keyword
+ )
+ ) {
+ return false;
+ }
+ if (PREVENT_ASI_BEFORE_TOKENS.has(token.type.label || token.type.keyword)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Determine if we should add a newline after the given token.
+ *
+ * @param Object token
+ * The token we are looking at.
+ * @param Array stack
+ * The stack of open parens/curlies/brackets/etc.
+ *
+ * @returns Boolean
+ * True if we should add a newline.
+ */
+ function isLineDelimiter(token, stack) {
+ const ttl = token.type.label;
+ const top = stack.at(-1);
+ return (
+ (ttl == ";" && top != "(") ||
+ // Don't add a new line for empty object literals
+ (ttl == "{" && top == "{\n") ||
+ // Don't add a new line for empty array literals
+ (ttl == "[" && top == "[\n") ||
+ ((ttl == "," || ttl == "||" || ttl == "&&") && top != "(") ||
+ (ttl == ":" && (top == "case" || top == "default")) ||
+ (ttl == "(" && top == "(\n")
+ );
+ }
+
+ /**
+ * Determines if we need to add a space after the token we are about to add.
+ *
+ * @param Object token
+ * The token we are about to add to the pretty printed code.
+ * @param Object [previousToken]
+ * Optional previous token added to the pretty printed code.
+ */
+ function needsSpaceAfter(token, previousToken) {
+ if (previousToken && needsSpaceBetweenTokens(token, previousToken)) {
+ return true;
+ }
+
+ if (token.type.isAssign) {
+ return true;
+ }
+ if (token.type.binop != null && previousToken) {
+ return true;
+ }
+ if (token.type.label == "?") {
+ return true;
+ }
+ if (token.type.label == "=>") {
+ return true;
+ }
+
+ return false;
+ }
+
+ function needsSpaceBeforePreviousToken(previousToken) {
+ if (previousToken.type.isLoop) {
+ return true;
+ }
+ if (previousToken.type.isAssign) {
+ return true;
+ }
+ if (previousToken.type.binop != null) {
+ return true;
+ }
+ if (previousToken.value == "of") {
+ return true;
+ }
+
+ const previousTokenTypeLabel = previousToken.type.label;
+ if (previousTokenTypeLabel == "?") {
+ return true;
+ }
+ if (previousTokenTypeLabel == ":") {
+ return true;
+ }
+ if (previousTokenTypeLabel == ",") {
+ return true;
+ }
+ if (previousTokenTypeLabel == ";") {
+ return true;
+ }
+ if (previousTokenTypeLabel == "${") {
+ return true;
+ }
+ if (previousTokenTypeLabel == "=>") {
+ return true;
+ }
+ return false;
+ }
+
+ function isBreakContinueOrReturnStatement(previousTokenKeyword) {
+ return (
+ previousTokenKeyword == "break" ||
+ previousTokenKeyword == "continue" ||
+ previousTokenKeyword == "return"
+ );
+ }
+
+ function needsSpaceBeforePreviousTokenKeywordAfterNotDot(previousTokenKeyword) {
+ return (
+ previousTokenKeyword != "debugger" &&
+ previousTokenKeyword != "null" &&
+ previousTokenKeyword != "true" &&
+ previousTokenKeyword != "false" &&
+ previousTokenKeyword != "this" &&
+ previousTokenKeyword != "default"
+ );
+ }
+
+ function needsSpaceBeforeClosingParen(tokenTypeLabel) {
+ return (
+ tokenTypeLabel != ")" &&
+ tokenTypeLabel != "]" &&
+ tokenTypeLabel != ";" &&
+ tokenTypeLabel != "," &&
+ tokenTypeLabel != "."
+ );
+ }
+
+ /**
+ * Determines if we need to add a space between the previous token we added and
+ * the token we are about to add.
+ *
+ * @param Object token
+ * The token we are about to add to the pretty printed code.
+ * @param Object previousToken
+ * The previous token added to the pretty printed code.
+ */
+ function needsSpaceBetweenTokens(token, previousToken) {
+ if (needsSpaceBeforePreviousToken(previousToken)) {
+ return true;
+ }
+
+ const ltt = previousToken.type.label;
+ if (ltt == "num" && token.type.label == ".") {
+ return true;
+ }
+
+ const ltk = previousToken.type.keyword;
+ const ttl = token.type.label;
+ if (ltk != null && ttl != ".") {
+ if (isBreakContinueOrReturnStatement(ltk)) {
+ return ttl != ";";
+ }
+ if (needsSpaceBeforePreviousTokenKeywordAfterNotDot(ltk)) {
+ return true;
+ }
+ }
+
+ if (ltt == ")" && needsSpaceBeforeClosingParen(ttl)) {
+ return true;
+ }
+
+ if (isIdentifierLike(token) && isIdentifierLike(previousToken)) {
+ // We must emit a space to avoid merging the tokens.
+ return true;
+ }
+
+ if (token.type.label == "{" && previousToken.type.label == "name") {
+ return true;
+ }
+
+ return false;
+ }
+
+ function needsSpaceBeforeClosingCurlyBracket(tokenTypeKeyword) {
+ return (
+ tokenTypeKeyword == "else" ||
+ tokenTypeKeyword == "catch" ||
+ tokenTypeKeyword == "finally"
+ );
+ }
+
+ function needsLineBreakBeforeClosingCurlyBracket(tokenTypeLabel) {
+ return (
+ tokenTypeLabel != "(" &&
+ tokenTypeLabel != ";" &&
+ tokenTypeLabel != "," &&
+ tokenTypeLabel != ")" &&
+ tokenTypeLabel != "." &&
+ tokenTypeLabel != "template" &&
+ tokenTypeLabel != "`"
+ );
+ }
+
+ const escapeCharacters = {
+ // Backslash
+ "\\": "\\\\",
+ // Newlines
+ "\n": "\\n",
+ // Carriage return
+ "\r": "\\r",
+ // Tab
+ "\t": "\\t",
+ // Vertical tab
+ "\v": "\\v",
+ // Form feed
+ "\f": "\\f",
+ // Null character
+ "\0": "\\x00",
+ // Line separator
+ "\u2028": "\\u2028",
+ // Paragraph separator
+ "\u2029": "\\u2029",
+ // Single quotes
+ "'": "\\'",
+ };
+
+ // eslint-disable-next-line prefer-template
+ const regExpString = "(" + Object.values(escapeCharacters).join("|") + ")";
+ const escapeCharactersRegExp = new RegExp(regExpString, "g");
+
+ function sanitizerReplaceFunc(_, c) {
+ return escapeCharacters[c];
+ }
+
+ /**
+ * Make sure that we output the escaped character combination inside string
+ * literals instead of various problematic characters.
+ */
+ function sanitize(str) {
+ return str.replace(escapeCharactersRegExp, sanitizerReplaceFunc);
+ }
+
+ /**
+ * Returns true if the given token type belongs on the stack.
+ */
+ function belongsOnStack(token) {
+ const ttl = token.type.label;
+ const ttk = token.type.keyword;
+ return (
+ ttl == "{" ||
+ ttl == "(" ||
+ ttl == "[" ||
+ ttl == "?" ||
+ ttl == "${" ||
+ ttk == "do" ||
+ ttk == "switch" ||
+ ttk == "case" ||
+ ttk == "default"
+ );
+ }
+
+ var { SourceMapGenerator } = sourceMap$1;
+
+ const sourceMapGeneratorByTaskId = new Map();
+
+ function prettyPrint({ url, indent, sourceText }) {
+ const { code, map: sourceMapGenerator } = prettyFast(sourceText, {
+ url,
+ indent,
+ });
+
+ return {
+ code,
+ sourceMap: sourceMapGenerator.toJSON(),
+ };
+ }
+
+ function prettyPrintInlineScript({
+ taskId,
+ url,
+ indent,
+ sourceText,
+ originalStartLine,
+ originalStartColumn,
+ generatedStartLine,
+ }) {
+ let taskSourceMapGenerator;
+ if (!sourceMapGeneratorByTaskId.has(taskId)) {
+ taskSourceMapGenerator = new SourceMapGenerator({ file: url });
+ sourceMapGeneratorByTaskId.set(taskId, taskSourceMapGenerator);
+ } else {
+ taskSourceMapGenerator = sourceMapGeneratorByTaskId.get(taskId);
+ }
+
+ const { code } = prettyFast(sourceText, {
+ url,
+ indent,
+ sourceMapGenerator: taskSourceMapGenerator,
+ /*
+ * By default prettyPrint will trim the text, and we'd have the pretty text displayed
+ * just after the script tag, e.g.:
+ *
+ * ```
+ * <script>if (true) {
+ * something()
+ * }
+ * </script>
+ * ```
+ *
+ * We want the text to start on a new line, so prepend a line break, so we get
+ * something like:
+ *
+ * ```
+ * <script>
+ * if (true) {
+ * something()
+ * }
+ * </script>
+ * ```
+ */
+ prefixWithNewLine: true,
+ originalStartLine,
+ originalStartColumn,
+ generatedStartLine,
+ });
+
+ // When a taskId was passed, we only return the pretty printed text.
+ // The source map should be retrieved with getSourceMapForTask.
+ return code;
+ }
+
+ /**
+ * Get the source map for a pretty-print task
+ *
+ * @param {Integer} taskId: The taskId that was used to call prettyPrint
+ * @returns {Object} A source map object
+ */
+ function getSourceMapForTask(taskId) {
+ if (!sourceMapGeneratorByTaskId.has(taskId)) {
+ return null;
+ }
+
+ const taskSourceMapGenerator = sourceMapGeneratorByTaskId.get(taskId);
+ sourceMapGeneratorByTaskId.delete(taskId);
+ return taskSourceMapGenerator.toJSON();
+ }
+
+ self.onmessage = workerUtilsExports.workerHandler({
+ prettyPrint,
+ prettyPrintInlineScript,
+ getSourceMapForTask,
+ });
+
+}));
diff --git a/devtools/client/debugger/dist/search-worker.js b/devtools/client/debugger/dist/search-worker.js
new file mode 100644
index 0000000000..d37027fd6c
--- /dev/null
+++ b/devtools/client/debugger/dist/search-worker.js
@@ -0,0 +1,397 @@
+(function (factory) {
+ typeof define === 'function' && define.amd ? define(factory) :
+ factory();
+})((function () { 'use strict';
+
+ (function() {
+ const env = {"NODE_ENV":"production"};
+ try {
+ if (process) {
+ process.env = Object.assign({}, process.env);
+ Object.assign(process.env, env);
+ return;
+ }
+ } catch (e) {} // avoid ReferenceError: process is not defined
+ globalThis.process = { env:env };
+ })();
+
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+ function isNode() {
+ try {
+ return process.release.name == "node";
+ } catch (e) {
+ return false;
+ }
+ }
+
+ function isNodeTest() {
+ return isNode() && process.env.NODE_ENV != "production";
+ }
+
+ let assert;
+ // TODO: try to enable these assertions on mochitest by also enabling it on:
+ // import flags from "devtools/shared/flags";
+ // if (flags.testing)
+ // Unfortunately it throws a lot on mochitests...
+
+ if (isNodeTest()) {
+ assert = function (condition, message) {
+ if (!condition) {
+ throw new Error(`Assertion failure: ${message}`);
+ }
+ };
+ } else {
+ assert = function () {};
+ }
+ var assert$1 = assert;
+
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+ function escapeRegExp(str) {
+ const reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
+ return str.replace(reRegExpChar, "\\$&");
+ }
+
+ /**
+ * Ignore doing outline matches for less than 3 whitespaces
+ *
+ * @memberof utils/source-search
+ * @static
+ */
+ function ignoreWhiteSpace(str) {
+ return /^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str;
+ }
+
+ function wholeMatch(query, wholeWord) {
+ if (query === "" || !wholeWord) {
+ return query;
+ }
+
+ return `\\b${query}\\b`;
+ }
+
+ function buildFlags(caseSensitive, isGlobal) {
+ if (caseSensitive && isGlobal) {
+ return "g";
+ }
+
+ if (!caseSensitive && isGlobal) {
+ return "gi";
+ }
+
+ if (!caseSensitive && !isGlobal) {
+ return "i";
+ }
+
+ return null;
+ }
+
+ function buildQuery(
+ originalQuery,
+ modifiers,
+ { isGlobal = false, ignoreSpaces = false }
+ ) {
+ const { caseSensitive, regexMatch, wholeWord } = modifiers;
+
+ if (originalQuery === "") {
+ return new RegExp(originalQuery);
+ }
+
+ // Remove the backslashes at the end of the query as it
+ // breaks the RegExp
+ let query = originalQuery.replace(/\\$/, "");
+
+ // If we don't want to do a regexMatch, we need to escape all regex related characters
+ // so they would actually match.
+ if (!regexMatch) {
+ query = escapeRegExp(query);
+ }
+
+ // ignoreWhiteSpace might return a negative lookbehind, and in such case, we want it
+ // to be consumed as a RegExp part by the callsite, so this needs to be called after
+ // the regexp is escaped.
+ if (ignoreSpaces) {
+ query = ignoreWhiteSpace(query);
+ }
+
+ query = wholeMatch(query, wholeWord);
+ const flags = buildFlags(caseSensitive, isGlobal);
+
+ if (flags) {
+ return new RegExp(query, flags);
+ }
+
+ return new RegExp(query);
+ }
+
+ function getMatches(query, text, options) {
+ if (!query || !text || !options) {
+ return [];
+ }
+ const regexQuery = buildQuery(query, options, {
+ isGlobal: true,
+ });
+ const matchedLocations = [];
+ const lines = text.split("\n");
+ for (let i = 0; i < lines.length; i++) {
+ let singleMatch;
+ const line = lines[i];
+ while ((singleMatch = regexQuery.exec(line)) !== null) {
+ // Flow doesn't understand the test above.
+ if (!singleMatch) {
+ throw new Error("no singleMatch");
+ }
+
+ matchedLocations.push({
+ line: i,
+ ch: singleMatch.index,
+ match: singleMatch[0],
+ });
+
+ // When the match is an empty string the regexQuery.lastIndex will not
+ // change resulting in an infinite loop so we need to check for this and
+ // increment it manually in that case. See issue #7023
+ if (singleMatch[0] === "") {
+ assert$1(
+ !regexQuery.unicode,
+ "lastIndex++ can cause issues in unicode mode"
+ );
+ regexQuery.lastIndex++;
+ }
+ }
+ }
+ return matchedLocations;
+ }
+
+ function findSourceMatches(content, queryText, options) {
+ if (queryText == "") {
+ return [];
+ }
+
+ const text = content.value;
+ const lines = text.split("\n");
+
+ return getMatches(queryText, text, options).map(({ line, ch, match }) => {
+ const { value, matchIndex } = truncateLine(lines[line], ch);
+ return {
+ line: line + 1,
+ column: ch,
+
+ matchIndex,
+ match,
+ value,
+ };
+ });
+ }
+
+ // This is used to find start of a word, so that cropped string look nice
+ const startRegex = /([ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])/g;
+ // Similarly, find
+ const endRegex = new RegExp(
+ [
+ "([ !@#$%^&*()_+-=[]{};':\"\\|,.<>/?])",
+ '[^ !@#$%^&*()_+-=[]{};\':"\\|,.<>/?]*$"/',
+ ].join("")
+ );
+ // For texts over 100 characters this truncates the text (for display)
+ // around the context of the matched text.
+ function truncateLine(text, column) {
+ if (text.length < 100) {
+ return {
+ matchIndex: column,
+ value: text,
+ };
+ }
+
+ // Initially take 40 chars left to the match
+ const offset = Math.max(column - 40, 0);
+ // 400 characters should be enough to figure out the context of the match
+ const truncStr = text.slice(offset, column + 400);
+ let start = truncStr.search(startRegex);
+ let end = truncStr.search(endRegex);
+
+ if (start > column) {
+ // No word separator found before the match, so we take all characters
+ // before the match
+ start = -1;
+ }
+ if (end < column) {
+ end = truncStr.length;
+ }
+ const value = truncStr.slice(start + 1, end);
+
+ return {
+ matchIndex: column - start - offset - 1,
+ value,
+ };
+ }
+
+ var workerUtilsExports = {};
+ var workerUtils = {
+ get exports(){ return workerUtilsExports; },
+ set exports(v){ workerUtilsExports = v; },
+ };
+
+ (function (module) {
+
+ class WorkerDispatcher {
+ #msgId = 1;
+ #worker = null;
+ // Map of message ids -> promise resolution functions, for dispatching worker responses
+ #pendingCalls = new Map();
+ #url = "";
+
+ constructor(url) {
+ this.#url = url;
+ }
+
+ start() {
+ // When running in debugger jest test, we don't have access to ChromeWorker
+ if (typeof ChromeWorker == "function") {
+ this.#worker = new ChromeWorker(this.#url);
+ } else {
+ this.#worker = new Worker(this.#url);
+ }
+ this.#worker.onerror = err => {
+ console.error(`Error in worker ${this.#url}`, err.message);
+ };
+ this.#worker.addEventListener("message", this.#onMessage);
+ }
+
+ stop() {
+ if (!this.#worker) {
+ return;
+ }
+
+ this.#worker.removeEventListener("message", this.#onMessage);
+ this.#worker.terminate();
+ this.#worker = null;
+ this.#pendingCalls.clear();
+ }
+
+ task(method, { queue = false } = {}) {
+ const calls = [];
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push({ args, resolve, reject });
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.#worker) {
+ this.start();
+ }
+
+ const id = this.#msgId++;
+ this.#worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item.args),
+ });
+
+ this.#pendingCalls.set(id, items);
+ };
+
+ return (...args) => push(args);
+ }
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+ #onMessage = ({ data: result }) => {
+ const items = this.#pendingCalls.get(result.id);
+ this.#pendingCalls.delete(result.id);
+ if (!items) {
+ return;
+ }
+
+ if (!this.#worker) {
+ return;
+ }
+
+ result.results.forEach((resultData, i) => {
+ const { resolve, reject } = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+ }
+
+ function workerHandler(publicInterface) {
+ return function (msg) {
+ const { id, method, calls } = msg.data;
+
+ Promise.all(
+ calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+ if (response instanceof Promise) {
+ return response.then(
+ val => ({ response: val }),
+ err => asErrorMessage(err)
+ );
+ }
+ return { response };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })
+ ).then(results => {
+ globalThis.postMessage({ id, results });
+ });
+ };
+ }
+
+ function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata,
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined,
+ };
+ }
+
+ // Might be loaded within a worker thread where `module` isn't available.
+ {
+ module.exports = {
+ WorkerDispatcher,
+ workerHandler,
+ };
+ }
+ } (workerUtils));
+
+ self.onmessage = workerUtilsExports.workerHandler({ getMatches, findSourceMatches });
+
+}));
diff --git a/devtools/client/debugger/dist/vendors.css b/devtools/client/debugger/dist/vendors.css
new file mode 100644
index 0000000000..415c02afa6
--- /dev/null
+++ b/devtools/client/debugger/dist/vendors.css
@@ -0,0 +1,20 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.container {
+ background-color: lightgrey;
+ border: 1px solid darkgrey;
+ cursor: pointer;
+ padding: 0 3px;
+}
+
+.container[aria-selected=true] {
+ background-color: white;
+}
+.container {
+ display: flex;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
diff --git a/devtools/client/debugger/dist/vendors.js b/devtools/client/debugger/dist/vendors.js
new file mode 100644
index 0000000000..02bc0fca14
--- /dev/null
+++ b/devtools/client/debugger/dist/vendors.js
@@ -0,0 +1,2496 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory(require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/react-dom"));
+ else if(typeof define === 'function' && define.amd)
+ define(["devtools/client/shared/vendor/react-prop-types", "devtools/client/shared/vendor/react", "devtools/client/shared/vendor/react-dom"], factory);
+ else {
+ var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/react-dom")) : factory(root["devtools/client/shared/vendor/react-prop-types"], root["devtools/client/shared/vendor/react"], root["devtools/client/shared/vendor/react-dom"]);
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_112__) {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "/assets/build";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 929);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
+
+/***/ }),
+
+/***/ 112:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_112__;
+
+/***/ }),
+
+/***/ 6:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
+
+/***/ }),
+
+/***/ 607:
+/***/ (function(module, exports) {
+
+// shim for using process in browser
+var process = module.exports = {};
+
+// cached from whatever global is present so that test runners that stub it
+// don't break things. But we need to wrap it in a try catch in case it is
+// wrapped in strict mode code which doesn't define any globals. It's inside a
+// function because try/catches deoptimize in certain engines.
+
+var cachedSetTimeout;
+var cachedClearTimeout;
+
+function defaultSetTimout() {
+ throw new Error('setTimeout has not been defined');
+}
+function defaultClearTimeout () {
+ throw new Error('clearTimeout has not been defined');
+}
+(function () {
+ try {
+ if (typeof setTimeout === 'function') {
+ cachedSetTimeout = setTimeout;
+ } else {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ } catch (e) {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ try {
+ if (typeof clearTimeout === 'function') {
+ cachedClearTimeout = clearTimeout;
+ } else {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+ } catch (e) {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+} ())
+function runTimeout(fun) {
+ if (cachedSetTimeout === setTimeout) {
+ //normal enviroments in sane situations
+ return setTimeout(fun, 0);
+ }
+ // if setTimeout wasn't available but was latter defined
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+ cachedSetTimeout = setTimeout;
+ return setTimeout(fun, 0);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedSetTimeout(fun, 0);
+ } catch(e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedSetTimeout.call(null, fun, 0);
+ } catch(e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+ return cachedSetTimeout.call(this, fun, 0);
+ }
+ }
+
+
+}
+function runClearTimeout(marker) {
+ if (cachedClearTimeout === clearTimeout) {
+ //normal enviroments in sane situations
+ return clearTimeout(marker);
+ }
+ // if clearTimeout wasn't available but was latter defined
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+ cachedClearTimeout = clearTimeout;
+ return clearTimeout(marker);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedClearTimeout(marker);
+ } catch (e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedClearTimeout.call(null, marker);
+ } catch (e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+ return cachedClearTimeout.call(this, marker);
+ }
+ }
+
+
+
+}
+var queue = [];
+var draining = false;
+var currentQueue;
+var queueIndex = -1;
+
+function cleanUpNextTick() {
+ if (!draining || !currentQueue) {
+ return;
+ }
+ draining = false;
+ if (currentQueue.length) {
+ queue = currentQueue.concat(queue);
+ } else {
+ queueIndex = -1;
+ }
+ if (queue.length) {
+ drainQueue();
+ }
+}
+
+function drainQueue() {
+ if (draining) {
+ return;
+ }
+ var timeout = runTimeout(cleanUpNextTick);
+ draining = true;
+
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ while (++queueIndex < len) {
+ if (currentQueue) {
+ currentQueue[queueIndex].run();
+ }
+ }
+ queueIndex = -1;
+ len = queue.length;
+ }
+ currentQueue = null;
+ draining = false;
+ runClearTimeout(timeout);
+}
+
+process.nextTick = function (fun) {
+ var args = new Array(arguments.length - 1);
+ if (arguments.length > 1) {
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i];
+ }
+ }
+ queue.push(new Item(fun, args));
+ if (queue.length === 1 && !draining) {
+ runTimeout(drainQueue);
+ }
+};
+
+// v8 likes predictible objects
+function Item(fun, array) {
+ this.fun = fun;
+ this.array = array;
+}
+Item.prototype.run = function () {
+ this.fun.apply(null, this.array);
+};
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+process.prependListener = noop;
+process.prependOnceListener = noop;
+
+process.listeners = function (name) { return [] }
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+
+/***/ }),
+
+/***/ 611:
+/***/ (function(module, exports) {
+
+(function() {
+ var AcronymResult, computeScore, emptyAcronymResult, isAcronymFullWord, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_size, wm;
+
+ wm = 150;
+
+ pos_bonus = 20;
+
+ tau_size = 150;
+
+ miss_coeff = 0.75;
+
+ exports.score = function(string, query, options) {
+ var allowErrors, preparedQuery, score, string_lw;
+ preparedQuery = options.preparedQuery, allowErrors = options.allowErrors;
+ if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) {
+ return 0;
+ }
+ string_lw = string.toLowerCase();
+ score = computeScore(string, string_lw, preparedQuery);
+ return Math.ceil(score);
+ };
+
+ exports.isMatch = isMatch = function(subject, query_lw, query_up) {
+ var i, j, m, n, qj_lw, qj_up, si;
+ m = subject.length;
+ n = query_lw.length;
+ if (!m || n > m) {
+ return false;
+ }
+ i = -1;
+ j = -1;
+ while (++j < n) {
+ qj_lw = query_lw.charCodeAt(j);
+ qj_up = query_up.charCodeAt(j);
+ while (++i < m) {
+ si = subject.charCodeAt(i);
+ if (si === qj_lw || si === qj_up) {
+ break;
+ }
+ }
+ if (i === m) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ exports.computeScore = computeScore = function(subject, subject_lw, preparedQuery) {
+ var acro, acro_score, align, csc_diag, csc_row, csc_score, csc_should_rebuild, i, j, m, miss_budget, miss_left, n, pos, query, query_lw, record_miss, score, score_diag, score_row, score_up, si_lw, start, sz;
+ query = preparedQuery.query;
+ query_lw = preparedQuery.query_lw;
+ m = subject.length;
+ n = query.length;
+ acro = scoreAcronyms(subject, subject_lw, query, query_lw);
+ acro_score = acro.score;
+ if (acro.count === n) {
+ return scoreExact(n, m, acro_score, acro.pos);
+ }
+ pos = subject_lw.indexOf(query_lw);
+ if (pos > -1) {
+ return scoreExactMatch(subject, subject_lw, query, query_lw, pos, n, m);
+ }
+ score_row = new Array(n);
+ csc_row = new Array(n);
+ sz = scoreSize(n, m);
+ miss_budget = Math.ceil(miss_coeff * n) + 5;
+ miss_left = miss_budget;
+ csc_should_rebuild = true;
+ j = -1;
+ while (++j < n) {
+ score_row[j] = 0;
+ csc_row[j] = 0;
+ }
+ i = -1;
+ while (++i < m) {
+ si_lw = subject_lw[i];
+ if (!si_lw.charCodeAt(0) in preparedQuery.charCodes) {
+ if (csc_should_rebuild) {
+ j = -1;
+ while (++j < n) {
+ csc_row[j] = 0;
+ }
+ csc_should_rebuild = false;
+ }
+ continue;
+ }
+ score = 0;
+ score_diag = 0;
+ csc_diag = 0;
+ record_miss = true;
+ csc_should_rebuild = true;
+ j = -1;
+ while (++j < n) {
+ score_up = score_row[j];
+ if (score_up > score) {
+ score = score_up;
+ }
+ csc_score = 0;
+ if (query_lw[j] === si_lw) {
+ start = isWordStart(i, subject, subject_lw);
+ csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start);
+ align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score);
+ if (align > score) {
+ score = align;
+ miss_left = miss_budget;
+ } else {
+ if (record_miss && --miss_left <= 0) {
+ return Math.max(score, score_row[n - 1]) * sz;
+ }
+ record_miss = false;
+ }
+ }
+ score_diag = score_up;
+ csc_diag = csc_row[j];
+ csc_row[j] = csc_score;
+ score_row[j] = score;
+ }
+ }
+ score = score_row[n - 1];
+ return score * sz;
+ };
+
+ exports.isWordStart = isWordStart = function(pos, subject, subject_lw) {
+ var curr_s, prev_s;
+ if (pos === 0) {
+ return true;
+ }
+ curr_s = subject[pos];
+ prev_s = subject[pos - 1];
+ return isSeparator(prev_s) || (curr_s !== subject_lw[pos] && prev_s === subject_lw[pos - 1]);
+ };
+
+ exports.isWordEnd = isWordEnd = function(pos, subject, subject_lw, len) {
+ var curr_s, next_s;
+ if (pos === len - 1) {
+ return true;
+ }
+ curr_s = subject[pos];
+ next_s = subject[pos + 1];
+ return isSeparator(next_s) || (curr_s === subject_lw[pos] && next_s !== subject_lw[pos + 1]);
+ };
+
+ isSeparator = function(c) {
+ return c === ' ' || c === '.' || c === '-' || c === '_' || c === '/' || c === '\\';
+ };
+
+ scorePosition = function(pos) {
+ var sc;
+ if (pos < pos_bonus) {
+ sc = pos_bonus - pos;
+ return 100 + sc * sc;
+ } else {
+ return Math.max(100 + pos_bonus - pos, 0);
+ }
+ };
+
+ exports.scoreSize = scoreSize = function(n, m) {
+ return tau_size / (tau_size + Math.abs(m - n));
+ };
+
+ scoreExact = function(n, m, quality, pos) {
+ return 2 * n * (wm * quality + scorePosition(pos)) * scoreSize(n, m);
+ };
+
+ exports.scorePattern = scorePattern = function(count, len, sameCase, start, end) {
+ var bonus, sz;
+ sz = count;
+ bonus = 6;
+ if (sameCase === count) {
+ bonus += 2;
+ }
+ if (start) {
+ bonus += 3;
+ }
+ if (end) {
+ bonus += 1;
+ }
+ if (count === len) {
+ if (start) {
+ if (sameCase === len) {
+ sz += 2;
+ } else {
+ sz += 1;
+ }
+ }
+ if (end) {
+ bonus += 1;
+ }
+ }
+ return sameCase + sz * (sz + bonus);
+ };
+
+ exports.scoreCharacter = scoreCharacter = function(i, j, start, acro_score, csc_score) {
+ var posBonus;
+ posBonus = scorePosition(i);
+ if (start) {
+ return posBonus + wm * ((acro_score > csc_score ? acro_score : csc_score) + 10);
+ }
+ return posBonus + wm * csc_score;
+ };
+
+ exports.scoreConsecutives = scoreConsecutives = function(subject, subject_lw, query, query_lw, i, j, startOfWord) {
+ var k, m, mi, n, nj, sameCase, sz;
+ m = subject.length;
+ n = query.length;
+ mi = m - i;
+ nj = n - j;
+ k = mi < nj ? mi : nj;
+ sameCase = 0;
+ sz = 0;
+ if (query[j] === subject[i]) {
+ sameCase++;
+ }
+ while (++sz < k && query_lw[++j] === subject_lw[++i]) {
+ if (query[j] === subject[i]) {
+ sameCase++;
+ }
+ }
+ if (sz < k) {
+ i--;
+ }
+ if (sz === 1) {
+ return 1 + 2 * sameCase;
+ }
+ return scorePattern(sz, n, sameCase, startOfWord, isWordEnd(i, subject, subject_lw, m));
+ };
+
+ exports.scoreExactMatch = scoreExactMatch = function(subject, subject_lw, query, query_lw, pos, n, m) {
+ var end, i, pos2, sameCase, start;
+ start = isWordStart(pos, subject, subject_lw);
+ if (!start) {
+ pos2 = subject_lw.indexOf(query_lw, pos + 1);
+ if (pos2 > -1) {
+ start = isWordStart(pos2, subject, subject_lw);
+ if (start) {
+ pos = pos2;
+ }
+ }
+ }
+ i = -1;
+ sameCase = 0;
+ while (++i < n) {
+ if (query[pos + i] === subject[i]) {
+ sameCase++;
+ }
+ }
+ end = isWordEnd(pos + n - 1, subject, subject_lw, m);
+ return scoreExact(n, m, scorePattern(n, n, sameCase, start, end), pos);
+ };
+
+ AcronymResult = (function() {
+ function AcronymResult(score, pos, count) {
+ this.score = score;
+ this.pos = pos;
+ this.count = count;
+ }
+
+ return AcronymResult;
+
+ })();
+
+ emptyAcronymResult = new AcronymResult(0, 0.1, 0);
+
+ exports.scoreAcronyms = scoreAcronyms = function(subject, subject_lw, query, query_lw) {
+ var count, fullWord, i, j, m, n, qj_lw, sameCase, score, sepCount, sumPos;
+ m = subject.length;
+ n = query.length;
+ if (!(m > 1 && n > 1)) {
+ return emptyAcronymResult;
+ }
+ count = 0;
+ sepCount = 0;
+ sumPos = 0;
+ sameCase = 0;
+ i = -1;
+ j = -1;
+ while (++j < n) {
+ qj_lw = query_lw[j];
+ if (isSeparator(qj_lw)) {
+ i = subject_lw.indexOf(qj_lw, i + 1);
+ if (i > -1) {
+ sepCount++;
+ continue;
+ } else {
+ break;
+ }
+ }
+ while (++i < m) {
+ if (qj_lw === subject_lw[i] && isWordStart(i, subject, subject_lw)) {
+ if (query[j] === subject[i]) {
+ sameCase++;
+ }
+ sumPos += i;
+ count++;
+ break;
+ }
+ }
+ if (i === m) {
+ break;
+ }
+ }
+ if (count < 2) {
+ return emptyAcronymResult;
+ }
+ fullWord = count === n ? isAcronymFullWord(subject, subject_lw, query, count) : false;
+ score = scorePattern(count, n, sameCase, true, fullWord);
+ return new AcronymResult(score, sumPos / count, count + sepCount);
+ };
+
+ isAcronymFullWord = function(subject, subject_lw, query, nbAcronymInQuery) {
+ var count, i, m, n;
+ m = subject.length;
+ n = query.length;
+ count = 0;
+ if (m > 12 * n) {
+ return false;
+ }
+ i = -1;
+ while (++i < m) {
+ if (isWordStart(i, subject, subject_lw) && ++count > nbAcronymInQuery) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 647:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref;
+
+ _ref = __webpack_require__(611), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize;
+
+ tau_depth = 20;
+
+ file_coeff = 2.5;
+
+ exports.score = function(string, query, options) {
+ var allowErrors, preparedQuery, score, string_lw;
+ preparedQuery = options.preparedQuery, allowErrors = options.allowErrors;
+ if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) {
+ return 0;
+ }
+ string_lw = string.toLowerCase();
+ score = computeScore(string, string_lw, preparedQuery);
+ score = scorePath(string, string_lw, score, options);
+ return Math.ceil(score);
+ };
+
+ scorePath = function(subject, subject_lw, fullPathScore, options) {
+ var alpha, basePathScore, basePos, depth, end, extAdjust, fileLength, pathSeparator, preparedQuery, useExtensionBonus;
+ if (fullPathScore === 0) {
+ return 0;
+ }
+ preparedQuery = options.preparedQuery, useExtensionBonus = options.useExtensionBonus, pathSeparator = options.pathSeparator;
+ end = subject.length - 1;
+ while (subject[end] === pathSeparator) {
+ end--;
+ }
+ basePos = subject.lastIndexOf(pathSeparator, end);
+ fileLength = end - basePos;
+ extAdjust = 1.0;
+ if (useExtensionBonus) {
+ extAdjust += getExtensionScore(subject_lw, preparedQuery.ext, basePos, end, 2);
+ fullPathScore *= extAdjust;
+ }
+ if (basePos === -1) {
+ return fullPathScore;
+ }
+ depth = preparedQuery.depth;
+ while (basePos > -1 && depth-- > 0) {
+ basePos = subject.lastIndexOf(pathSeparator, basePos - 1);
+ }
+ basePathScore = basePos === -1 ? fullPathScore : extAdjust * computeScore(subject.slice(basePos + 1, end + 1), subject_lw.slice(basePos + 1, end + 1), preparedQuery);
+ alpha = 0.5 * tau_depth / (tau_depth + countDir(subject, end + 1, pathSeparator));
+ return alpha * basePathScore + (1 - alpha) * fullPathScore * scoreSize(0, file_coeff * fileLength);
+ };
+
+ exports.countDir = countDir = function(path, end, pathSeparator) {
+ var count, i;
+ if (end < 1) {
+ return 0;
+ }
+ count = 0;
+ i = -1;
+ while (++i < end && path[i] === pathSeparator) {
+ continue;
+ }
+ while (++i < end) {
+ if (path[i] === pathSeparator) {
+ count++;
+ while (++i < end && path[i] === pathSeparator) {
+ continue;
+ }
+ }
+ }
+ return count;
+ };
+
+ exports.getExtension = getExtension = function(str) {
+ var pos;
+ pos = str.lastIndexOf(".");
+ if (pos < 0) {
+ return "";
+ } else {
+ return str.substr(pos + 1);
+ }
+ };
+
+ getExtensionScore = function(candidate, ext, startPos, endPos, maxDepth) {
+ var m, matched, n, pos;
+ if (!ext.length) {
+ return 0;
+ }
+ pos = candidate.lastIndexOf(".", endPos);
+ if (!(pos > startPos)) {
+ return 0;
+ }
+ n = ext.length;
+ m = endPos - pos;
+ if (m < n) {
+ n = m;
+ m = ext.length;
+ }
+ pos++;
+ matched = -1;
+ while (++matched < n) {
+ if (candidate[pos + matched] !== ext[matched]) {
+ break;
+ }
+ }
+ if (matched === 0 && maxDepth > 0) {
+ return 0.9 * getExtensionScore(candidate, ext, startPos, pos - 2, maxDepth - 1);
+ }
+ return matched / m;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 709:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref;
+
+ _ref = __webpack_require__(647), countDir = _ref.countDir, getExtension = _ref.getExtension;
+
+ module.exports = Query = (function() {
+ function Query(query, _arg) {
+ var optCharRegEx, pathSeparator, _ref1;
+ _ref1 = _arg != null ? _arg : {}, optCharRegEx = _ref1.optCharRegEx, pathSeparator = _ref1.pathSeparator;
+ if (!(query && query.length)) {
+ return null;
+ }
+ this.query = query;
+ this.query_lw = query.toLowerCase();
+ this.core = coreChars(query, optCharRegEx);
+ this.core_lw = this.core.toLowerCase();
+ this.core_up = truncatedUpperCase(this.core);
+ this.depth = countDir(query, query.length, pathSeparator);
+ this.ext = getExtension(this.query_lw);
+ this.charCodes = getCharCodes(this.query_lw);
+ }
+
+ return Query;
+
+ })();
+
+ opt_char_re = /[ _\-:\/\\]/g;
+
+ coreChars = function(query, optCharRegEx) {
+ if (optCharRegEx == null) {
+ optCharRegEx = opt_char_re;
+ }
+ return query.replace(optCharRegEx, '');
+ };
+
+ truncatedUpperCase = function(str) {
+ var char, upper, _i, _len;
+ upper = "";
+ for (_i = 0, _len = str.length; _i < _len; _i++) {
+ char = str[_i];
+ upper += char.toUpperCase()[0];
+ }
+ return upper;
+ };
+
+ getCharCodes = function(str) {
+ var charCodes, i, len;
+ len = str.length;
+ i = -1;
+ charCodes = [];
+ while (++i < len) {
+ charCodes[str.charCodeAt(i)] = true;
+ }
+ return charCodes;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 710:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _tab = _interopRequireDefault(__webpack_require__(711));
+
+var _tabList = _interopRequireDefault(__webpack_require__(958));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+class TabList extends _react.default.Component {
+ constructor(props) {
+ super(props);
+
+ const childrenCount = _react.default.Children.count(props.children);
+
+ this.handleKeyPress = this.handleKeyPress.bind(this);
+ this.tabRefs = new Array(childrenCount).fill(0).map(() => /*#__PURE__*/_react.default.createRef());
+ this.handlers = this.getHandlers(props.vertical);
+ }
+
+ componentDidUpdate(prevProps) {
+ if (prevProps.activeIndex !== this.props.activeIndex) {
+ this.tabRefs[this.props.activeIndex].current.focus();
+ }
+ }
+
+ getHandlers(vertical) {
+ if (vertical) {
+ return {
+ ArrowDown: this.next.bind(this),
+ ArrowUp: this.previous.bind(this)
+ };
+ }
+
+ return {
+ ArrowLeft: this.previous.bind(this),
+ ArrowRight: this.next.bind(this)
+ };
+ }
+
+ wrapIndex(index) {
+ const count = _react.default.Children.count(this.props.children);
+
+ return (index + count) % count;
+ }
+
+ handleKeyPress(event) {
+ const handler = this.handlers[event.key];
+
+ if (handler) {
+ handler();
+ }
+ }
+
+ previous() {
+ const newIndex = this.wrapIndex(this.props.activeIndex - 1);
+ this.props.onActivateTab(newIndex);
+ }
+
+ next() {
+ const newIndex = this.wrapIndex(this.props.activeIndex + 1);
+ this.props.onActivateTab(newIndex);
+ }
+
+ render() {
+ const {
+ accessibleId,
+ activeIndex,
+ children,
+ className,
+ onActivateTab
+ } = this.props;
+ return /*#__PURE__*/_react.default.createElement("ul", {
+ className: className,
+ onKeyUp: this.handleKeyPress,
+ role: "tablist"
+ }, _react.default.Children.map(children, (child, index) => {
+ if (child.type !== _tab.default) {
+ throw new Error('Direct children of a <TabList> must be a <Tab>');
+ }
+
+ const active = index === activeIndex;
+ const tabRef = this.tabRefs[index];
+ return /*#__PURE__*/_react.default.cloneElement(child, {
+ accessibleId: active ? accessibleId : undefined,
+ active,
+ tabRef,
+ onActivate: () => onActivateTab(index)
+ });
+ }));
+ }
+
+}
+
+exports.default = TabList;
+TabList.propTypes = {
+ accessibleId: _propTypes.default.string,
+ activeIndex: _propTypes.default.number,
+ children: _propTypes.default.node,
+ className: _propTypes.default.string,
+ onActivateTab: _propTypes.default.func,
+ vertical: _propTypes.default.bool
+};
+TabList.defaultProps = {
+ accessibleId: undefined,
+ activeIndex: 0,
+ children: null,
+ className: _tabList.default.container,
+ onActivateTab: () => {},
+ vertical: false
+};
+
+/***/ }),
+
+/***/ 711:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = Tab;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _ref = _interopRequireDefault(__webpack_require__(938));
+
+var _tab = _interopRequireDefault(__webpack_require__(957));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function Tab({
+ accessibleId,
+ active,
+ children,
+ className,
+ onActivate,
+ tabRef
+}) {
+ return /*#__PURE__*/_react.default.createElement("li", {
+ "aria-selected": active,
+ className: className,
+ id: accessibleId,
+ onClick: onActivate,
+ onKeyDown: () => {},
+ ref: tabRef,
+ role: "tab",
+ tabIndex: active ? 0 : undefined
+ }, children);
+}
+
+Tab.propTypes = {
+ accessibleId: _propTypes.default.string,
+ active: _propTypes.default.bool,
+ children: _propTypes.default.node.isRequired,
+ className: _propTypes.default.string,
+ onActivate: _propTypes.default.func,
+ tabRef: _ref.default
+};
+Tab.defaultProps = {
+ accessibleId: undefined,
+ active: false,
+ className: _tab.default.container,
+ onActivate: undefined,
+ tabRef: undefined
+};
+
+/***/ }),
+
+/***/ 712:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = TabPanels;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function TabPanels({
+ accessibleId,
+ activeIndex,
+ children,
+ className,
+ hasFocusableContent
+}) {
+ return /*#__PURE__*/_react.default.createElement("div", {
+ "aria-labelledby": accessibleId,
+ role: "tabpanel",
+ className: className,
+ tabIndex: hasFocusableContent ? undefined : 0
+ }, _react.default.Children.toArray(children)[activeIndex]);
+}
+
+TabPanels.propTypes = {
+ accessibleId: _propTypes.default.string,
+ activeIndex: _propTypes.default.number,
+ children: _propTypes.default.node.isRequired,
+ className: _propTypes.default.string,
+ hasFocusableContent: _propTypes.default.bool.isRequired
+};
+TabPanels.defaultProps = {
+ accessibleId: undefined,
+ activeIndex: 0,
+ className: null
+};
+
+/***/ }),
+
+/***/ 929:
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(930);
+
+
+/***/ }),
+
+/***/ 930:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.vendored = void 0;
+
+var fuzzaldrinPlus = _interopRequireWildcard(__webpack_require__(931));
+
+var transition = _interopRequireWildcard(__webpack_require__(934));
+
+var reactAriaComponentsTabs = _interopRequireWildcard(__webpack_require__(937));
+
+function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
+
+function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Vendors.js is a file used to bundle and expose all dependencies needed to run
+ * the transpiled debugger modules when running in Firefox.
+ *
+ * To make transpilation easier, a vendored module should always be imported in
+ * same way:
+ * - always with destructuring (import { a } from "modA";)
+ * - always without destructuring (import modB from "modB")
+ *
+ * Both are fine, but cannot be mixed for the same module.
+ */
+// We cannot directly export literals containing special characters
+// (eg. "my-module/Test") which is why they are nested in "vendored".
+// The keys of the vendored object should match the module names
+// !!! Should remain synchronized with .babel/transform-mc.js !!!
+const vendored = {
+ "fuzzaldrin-plus": fuzzaldrinPlus,
+ "react-aria-components/src/tabs": reactAriaComponentsTabs,
+ "react-transition-group/Transition": transition
+};
+exports.vendored = vendored;
+
+/***/ }),
+
+/***/ 931:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(process) {(function() {
+ var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer;
+
+ filter = __webpack_require__(932);
+
+ matcher = __webpack_require__(933);
+
+ scorer = __webpack_require__(611);
+
+ pathScorer = __webpack_require__(647);
+
+ Query = __webpack_require__(709);
+
+ preparedQueryCache = null;
+
+ defaultPathSeparator = (typeof process !== "undefined" && process !== null ? process.platform : void 0) === "win32" ? '\\' : '/';
+
+ module.exports = {
+ filter: function(candidates, query, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (!((query != null ? query.length : void 0) && (candidates != null ? candidates.length : void 0))) {
+ return [];
+ }
+ options = parseOptions(options, query);
+ return filter(candidates, query, options);
+ },
+ score: function(string, query, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (!((string != null ? string.length : void 0) && (query != null ? query.length : void 0))) {
+ return 0;
+ }
+ options = parseOptions(options, query);
+ if (options.usePathScoring) {
+ return pathScorer.score(string, query, options);
+ } else {
+ return scorer.score(string, query, options);
+ }
+ },
+ match: function(string, query, options) {
+ var _i, _ref, _results;
+ if (options == null) {
+ options = {};
+ }
+ if (!string) {
+ return [];
+ }
+ if (!query) {
+ return [];
+ }
+ if (string === query) {
+ return (function() {
+ _results = [];
+ for (var _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); }
+ return _results;
+ }).apply(this);
+ }
+ options = parseOptions(options, query);
+ return matcher.match(string, query, options);
+ },
+ wrap: function(string, query, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (!string) {
+ return [];
+ }
+ if (!query) {
+ return [];
+ }
+ options = parseOptions(options, query);
+ return matcher.wrap(string, query, options);
+ },
+ prepareQuery: function(query, options) {
+ if (options == null) {
+ options = {};
+ }
+ options = parseOptions(options, query);
+ return options.preparedQuery;
+ }
+ };
+
+ parseOptions = function(options, query) {
+ if (options.allowErrors == null) {
+ options.allowErrors = false;
+ }
+ if (options.usePathScoring == null) {
+ options.usePathScoring = true;
+ }
+ if (options.useExtensionBonus == null) {
+ options.useExtensionBonus = false;
+ }
+ if (options.pathSeparator == null) {
+ options.pathSeparator = defaultPathSeparator;
+ }
+ if (options.optCharRegEx == null) {
+ options.optCharRegEx = null;
+ }
+ if (options.wrap == null) {
+ options.wrap = null;
+ }
+ if (options.preparedQuery == null) {
+ options.preparedQuery = preparedQueryCache && preparedQueryCache.query === query ? preparedQueryCache : (preparedQueryCache = new Query(query, options));
+ }
+ return options;
+ };
+
+}).call(this);
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(607)))
+
+/***/ }),
+
+/***/ 932:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var Query, pathScorer, pluckCandidates, scorer, sortCandidates;
+
+ scorer = __webpack_require__(611);
+
+ pathScorer = __webpack_require__(647);
+
+ Query = __webpack_require__(709);
+
+ pluckCandidates = function(a) {
+ return a.candidate;
+ };
+
+ sortCandidates = function(a, b) {
+ return b.score - a.score;
+ };
+
+ module.exports = function(candidates, query, options) {
+ var bKey, candidate, key, maxInners, maxResults, score, scoreProvider, scoredCandidates, spotLeft, string, usePathScoring, _i, _len;
+ scoredCandidates = [];
+ key = options.key, maxResults = options.maxResults, maxInners = options.maxInners, usePathScoring = options.usePathScoring;
+ spotLeft = (maxInners != null) && maxInners > 0 ? maxInners : candidates.length + 1;
+ bKey = key != null;
+ scoreProvider = usePathScoring ? pathScorer : scorer;
+ for (_i = 0, _len = candidates.length; _i < _len; _i++) {
+ candidate = candidates[_i];
+ string = bKey ? candidate[key] : candidate;
+ if (!string) {
+ continue;
+ }
+ score = scoreProvider.score(string, query, options);
+ if (score > 0) {
+ scoredCandidates.push({
+ candidate: candidate,
+ score: score
+ });
+ if (!--spotLeft) {
+ break;
+ }
+ }
+ }
+ scoredCandidates.sort(sortCandidates);
+ candidates = scoredCandidates.map(pluckCandidates);
+ if (maxResults != null) {
+ candidates = candidates.slice(0, maxResults);
+ }
+ return candidates;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 933:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref;
+
+ _ref = __webpack_require__(611), isMatch = _ref.isMatch, isWordStart = _ref.isWordStart, scoreConsecutives = _ref.scoreConsecutives, scoreCharacter = _ref.scoreCharacter, scoreAcronyms = _ref.scoreAcronyms;
+
+ exports.match = match = function(string, query, options) {
+ var allowErrors, baseMatches, matches, pathSeparator, preparedQuery, string_lw;
+ allowErrors = options.allowErrors, preparedQuery = options.preparedQuery, pathSeparator = options.pathSeparator;
+ if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) {
+ return [];
+ }
+ string_lw = string.toLowerCase();
+ matches = computeMatch(string, string_lw, preparedQuery);
+ if (matches.length === 0) {
+ return matches;
+ }
+ if (string.indexOf(pathSeparator) > -1) {
+ baseMatches = basenameMatch(string, string_lw, preparedQuery, pathSeparator);
+ matches = mergeMatches(matches, baseMatches);
+ }
+ return matches;
+ };
+
+ exports.wrap = function(string, query, options) {
+ var matchIndex, matchPos, matchPositions, output, strPos, tagClass, tagClose, tagOpen, _ref1;
+ if ((options.wrap != null)) {
+ _ref1 = options.wrap, tagClass = _ref1.tagClass, tagOpen = _ref1.tagOpen, tagClose = _ref1.tagClose;
+ }
+ if (tagClass == null) {
+ tagClass = 'highlight';
+ }
+ if (tagOpen == null) {
+ tagOpen = '<strong class="' + tagClass + '">';
+ }
+ if (tagClose == null) {
+ tagClose = '</strong>';
+ }
+ if (string === query) {
+ return tagOpen + string + tagClose;
+ }
+ matchPositions = match(string, query, options);
+ if (matchPositions.length === 0) {
+ return string;
+ }
+ output = '';
+ matchIndex = -1;
+ strPos = 0;
+ while (++matchIndex < matchPositions.length) {
+ matchPos = matchPositions[matchIndex];
+ if (matchPos > strPos) {
+ output += string.substring(strPos, matchPos);
+ strPos = matchPos;
+ }
+ while (++matchIndex < matchPositions.length) {
+ if (matchPositions[matchIndex] === matchPos + 1) {
+ matchPos++;
+ } else {
+ matchIndex--;
+ break;
+ }
+ }
+ matchPos++;
+ if (matchPos > strPos) {
+ output += tagOpen;
+ output += string.substring(strPos, matchPos);
+ output += tagClose;
+ strPos = matchPos;
+ }
+ }
+ if (strPos <= string.length - 1) {
+ output += string.substring(strPos);
+ }
+ return output;
+ };
+
+ basenameMatch = function(subject, subject_lw, preparedQuery, pathSeparator) {
+ var basePos, depth, end;
+ end = subject.length - 1;
+ while (subject[end] === pathSeparator) {
+ end--;
+ }
+ basePos = subject.lastIndexOf(pathSeparator, end);
+ if (basePos === -1) {
+ return [];
+ }
+ depth = preparedQuery.depth;
+ while (depth-- > 0) {
+ basePos = subject.lastIndexOf(pathSeparator, basePos - 1);
+ if (basePos === -1) {
+ return [];
+ }
+ }
+ basePos++;
+ end++;
+ return computeMatch(subject.slice(basePos, end), subject_lw.slice(basePos, end), preparedQuery, basePos);
+ };
+
+ mergeMatches = function(a, b) {
+ var ai, bj, i, j, m, n, out;
+ m = a.length;
+ n = b.length;
+ if (n === 0) {
+ return a.slice();
+ }
+ if (m === 0) {
+ return b.slice();
+ }
+ i = -1;
+ j = 0;
+ bj = b[j];
+ out = [];
+ while (++i < m) {
+ ai = a[i];
+ while (bj <= ai && ++j < n) {
+ if (bj < ai) {
+ out.push(bj);
+ }
+ bj = b[j];
+ }
+ out.push(ai);
+ }
+ while (j < n) {
+ out.push(b[j++]);
+ }
+ return out;
+ };
+
+ computeMatch = function(subject, subject_lw, preparedQuery, offset) {
+ var DIAGONAL, LEFT, STOP, UP, acro_score, align, backtrack, csc_diag, csc_row, csc_score, i, j, m, matches, move, n, pos, query, query_lw, score, score_diag, score_row, score_up, si_lw, start, trace;
+ if (offset == null) {
+ offset = 0;
+ }
+ query = preparedQuery.query;
+ query_lw = preparedQuery.query_lw;
+ m = subject.length;
+ n = query.length;
+ acro_score = scoreAcronyms(subject, subject_lw, query, query_lw).score;
+ score_row = new Array(n);
+ csc_row = new Array(n);
+ STOP = 0;
+ UP = 1;
+ LEFT = 2;
+ DIAGONAL = 3;
+ trace = new Array(m * n);
+ pos = -1;
+ j = -1;
+ while (++j < n) {
+ score_row[j] = 0;
+ csc_row[j] = 0;
+ }
+ i = -1;
+ while (++i < m) {
+ score = 0;
+ score_up = 0;
+ csc_diag = 0;
+ si_lw = subject_lw[i];
+ j = -1;
+ while (++j < n) {
+ csc_score = 0;
+ align = 0;
+ score_diag = score_up;
+ if (query_lw[j] === si_lw) {
+ start = isWordStart(i, subject, subject_lw);
+ csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start);
+ align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score);
+ }
+ score_up = score_row[j];
+ csc_diag = csc_row[j];
+ if (score > score_up) {
+ move = LEFT;
+ } else {
+ score = score_up;
+ move = UP;
+ }
+ if (align > score) {
+ score = align;
+ move = DIAGONAL;
+ } else {
+ csc_score = 0;
+ }
+ score_row[j] = score;
+ csc_row[j] = csc_score;
+ trace[++pos] = score > 0 ? move : STOP;
+ }
+ }
+ i = m - 1;
+ j = n - 1;
+ pos = i * n + j;
+ backtrack = true;
+ matches = [];
+ while (backtrack && i >= 0 && j >= 0) {
+ switch (trace[pos]) {
+ case UP:
+ i--;
+ pos -= n;
+ break;
+ case LEFT:
+ j--;
+ pos--;
+ break;
+ case DIAGONAL:
+ matches.push(i + offset);
+ j--;
+ i--;
+ pos -= n + 1;
+ break;
+ default:
+ backtrack = false;
+ }
+ }
+ matches.reverse();
+ return matches;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 934:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
+
+var PropTypes = _interopRequireWildcard(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _reactDom = _interopRequireDefault(__webpack_require__(112));
+
+var _reactLifecyclesCompat = __webpack_require__(935);
+
+var _PropTypes = __webpack_require__(936);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
+
+function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
+
+var UNMOUNTED = 'unmounted';
+exports.UNMOUNTED = UNMOUNTED;
+var EXITED = 'exited';
+exports.EXITED = EXITED;
+var ENTERING = 'entering';
+exports.ENTERING = ENTERING;
+var ENTERED = 'entered';
+exports.ENTERED = ENTERED;
+var EXITING = 'exiting';
+/**
+ * The Transition component lets you describe a transition from one component
+ * state to another _over time_ with a simple declarative API. Most commonly
+ * it's used to animate the mounting and unmounting of a component, but can also
+ * be used to describe in-place transition states as well.
+ *
+ * ---
+ *
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
+ * transitions in CSS, you'll probably want to use
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
+ * instead. It inherits all the features of `Transition`, but contains
+ * additional features necessary to play nice with CSS transitions (hence the
+ * name of the component).
+ *
+ * ---
+ *
+ * By default the `Transition` component does not alter the behavior of the
+ * component it renders, it only tracks "enter" and "exit" states for the
+ * components. It's up to you to give meaning and effect to those states. For
+ * example we can add styles to a component when it enters or exits:
+ *
+ * ```jsx
+ * import { Transition } from 'react-transition-group';
+ *
+ * const duration = 300;
+ *
+ * const defaultStyle = {
+ * transition: `opacity ${duration}ms ease-in-out`,
+ * opacity: 0,
+ * }
+ *
+ * const transitionStyles = {
+ * entering: { opacity: 0 },
+ * entered: { opacity: 1 },
+ * };
+ *
+ * const Fade = ({ in: inProp }) => (
+ * <Transition in={inProp} timeout={duration}>
+ * {state => (
+ * <div style={{
+ * ...defaultStyle,
+ * ...transitionStyles[state]
+ * }}>
+ * I'm a fade Transition!
+ * </div>
+ * )}
+ * </Transition>
+ * );
+ * ```
+ *
+ * There are 4 main states a Transition can be in:
+ * - `'entering'`
+ * - `'entered'`
+ * - `'exiting'`
+ * - `'exited'`
+ *
+ * Transition state is toggled via the `in` prop. When `true` the component
+ * begins the "Enter" stage. During this stage, the component will shift from
+ * its current transition state, to `'entering'` for the duration of the
+ * transition and then to the `'entered'` stage once it's complete. Let's take
+ * the following example (we'll use the
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
+ *
+ * ```jsx
+ * function App() {
+ * const [inProp, setInProp] = useState(false);
+ * return (
+ * <div>
+ * <Transition in={inProp} timeout={500}>
+ * {state => (
+ * // ...
+ * )}
+ * </Transition>
+ * <button onClick={() => setInProp(true)}>
+ * Click to Enter
+ * </button>
+ * </div>
+ * );
+ * }
+ * ```
+ *
+ * When the button is clicked the component will shift to the `'entering'` state
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
+ * to `'entered'`.
+ *
+ * When `in` is `false` the same thing happens except the state moves from
+ * `'exiting'` to `'exited'`.
+ */
+
+exports.EXITING = EXITING;
+
+var Transition =
+/*#__PURE__*/
+function (_React$Component) {
+ _inheritsLoose(Transition, _React$Component);
+
+ function Transition(props, context) {
+ var _this;
+
+ _this = _React$Component.call(this, props, context) || this;
+ var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears
+
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
+ var initialStatus;
+ _this.appearStatus = null;
+
+ if (props.in) {
+ if (appear) {
+ initialStatus = EXITED;
+ _this.appearStatus = ENTERING;
+ } else {
+ initialStatus = ENTERED;
+ }
+ } else {
+ if (props.unmountOnExit || props.mountOnEnter) {
+ initialStatus = UNMOUNTED;
+ } else {
+ initialStatus = EXITED;
+ }
+ }
+
+ _this.state = {
+ status: initialStatus
+ };
+ _this.nextCallback = null;
+ return _this;
+ }
+
+ var _proto = Transition.prototype;
+
+ _proto.getChildContext = function getChildContext() {
+ return {
+ transitionGroup: null // allows for nested Transitions
+
+ };
+ };
+
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
+ var nextIn = _ref.in;
+
+ if (nextIn && prevState.status === UNMOUNTED) {
+ return {
+ status: EXITED
+ };
+ }
+
+ return null;
+ }; // getSnapshotBeforeUpdate(prevProps) {
+ // let nextStatus = null
+ // if (prevProps !== this.props) {
+ // const { status } = this.state
+ // if (this.props.in) {
+ // if (status !== ENTERING && status !== ENTERED) {
+ // nextStatus = ENTERING
+ // }
+ // } else {
+ // if (status === ENTERING || status === ENTERED) {
+ // nextStatus = EXITING
+ // }
+ // }
+ // }
+ // return { nextStatus }
+ // }
+
+
+ _proto.componentDidMount = function componentDidMount() {
+ this.updateStatus(true, this.appearStatus);
+ };
+
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
+ var nextStatus = null;
+
+ if (prevProps !== this.props) {
+ var status = this.state.status;
+
+ if (this.props.in) {
+ if (status !== ENTERING && status !== ENTERED) {
+ nextStatus = ENTERING;
+ }
+ } else {
+ if (status === ENTERING || status === ENTERED) {
+ nextStatus = EXITING;
+ }
+ }
+ }
+
+ this.updateStatus(false, nextStatus);
+ };
+
+ _proto.componentWillUnmount = function componentWillUnmount() {
+ this.cancelNextCallback();
+ };
+
+ _proto.getTimeouts = function getTimeouts() {
+ var timeout = this.props.timeout;
+ var exit, enter, appear;
+ exit = enter = appear = timeout;
+
+ if (timeout != null && typeof timeout !== 'number') {
+ exit = timeout.exit;
+ enter = timeout.enter; // TODO: remove fallback for next major
+
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
+ }
+
+ return {
+ exit: exit,
+ enter: enter,
+ appear: appear
+ };
+ };
+
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
+ if (mounting === void 0) {
+ mounting = false;
+ }
+
+ if (nextStatus !== null) {
+ // nextStatus will always be ENTERING or EXITING.
+ this.cancelNextCallback();
+
+ var node = _reactDom.default.findDOMNode(this);
+
+ if (nextStatus === ENTERING) {
+ this.performEnter(node, mounting);
+ } else {
+ this.performExit(node);
+ }
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
+ this.setState({
+ status: UNMOUNTED
+ });
+ }
+ };
+
+ _proto.performEnter = function performEnter(node, mounting) {
+ var _this2 = this;
+
+ var enter = this.props.enter;
+ var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
+ var timeouts = this.getTimeouts();
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
+ // if we are mounting and running this it means appear _must_ be set
+
+ if (!mounting && !enter) {
+ this.safeSetState({
+ status: ENTERED
+ }, function () {
+ _this2.props.onEntered(node);
+ });
+ return;
+ }
+
+ this.props.onEnter(node, appearing);
+ this.safeSetState({
+ status: ENTERING
+ }, function () {
+ _this2.props.onEntering(node, appearing);
+
+ _this2.onTransitionEnd(node, enterTimeout, function () {
+ _this2.safeSetState({
+ status: ENTERED
+ }, function () {
+ _this2.props.onEntered(node, appearing);
+ });
+ });
+ });
+ };
+
+ _proto.performExit = function performExit(node) {
+ var _this3 = this;
+
+ var exit = this.props.exit;
+ var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
+
+ if (!exit) {
+ this.safeSetState({
+ status: EXITED
+ }, function () {
+ _this3.props.onExited(node);
+ });
+ return;
+ }
+
+ this.props.onExit(node);
+ this.safeSetState({
+ status: EXITING
+ }, function () {
+ _this3.props.onExiting(node);
+
+ _this3.onTransitionEnd(node, timeouts.exit, function () {
+ _this3.safeSetState({
+ status: EXITED
+ }, function () {
+ _this3.props.onExited(node);
+ });
+ });
+ });
+ };
+
+ _proto.cancelNextCallback = function cancelNextCallback() {
+ if (this.nextCallback !== null) {
+ this.nextCallback.cancel();
+ this.nextCallback = null;
+ }
+ };
+
+ _proto.safeSetState = function safeSetState(nextState, callback) {
+ // This shouldn't be necessary, but there are weird race conditions with
+ // setState callbacks and unmounting in testing, so always make sure that
+ // we can cancel any pending setState callbacks after we unmount.
+ callback = this.setNextCallback(callback);
+ this.setState(nextState, callback);
+ };
+
+ _proto.setNextCallback = function setNextCallback(callback) {
+ var _this4 = this;
+
+ var active = true;
+
+ this.nextCallback = function (event) {
+ if (active) {
+ active = false;
+ _this4.nextCallback = null;
+ callback(event);
+ }
+ };
+
+ this.nextCallback.cancel = function () {
+ active = false;
+ };
+
+ return this.nextCallback;
+ };
+
+ _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
+ this.setNextCallback(handler);
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
+
+ if (!node || doesNotHaveTimeoutOrListener) {
+ setTimeout(this.nextCallback, 0);
+ return;
+ }
+
+ if (this.props.addEndListener) {
+ this.props.addEndListener(node, this.nextCallback);
+ }
+
+ if (timeout != null) {
+ setTimeout(this.nextCallback, timeout);
+ }
+ };
+
+ _proto.render = function render() {
+ var status = this.state.status;
+
+ if (status === UNMOUNTED) {
+ return null;
+ }
+
+ var _this$props = this.props,
+ children = _this$props.children,
+ childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]); // filter props for Transtition
+
+
+ delete childProps.in;
+ delete childProps.mountOnEnter;
+ delete childProps.unmountOnExit;
+ delete childProps.appear;
+ delete childProps.enter;
+ delete childProps.exit;
+ delete childProps.timeout;
+ delete childProps.addEndListener;
+ delete childProps.onEnter;
+ delete childProps.onEntering;
+ delete childProps.onEntered;
+ delete childProps.onExit;
+ delete childProps.onExiting;
+ delete childProps.onExited;
+
+ if (typeof children === 'function') {
+ return children(status, childProps);
+ }
+
+ var child = _react.default.Children.only(children);
+
+ return _react.default.cloneElement(child, childProps);
+ };
+
+ return Transition;
+}(_react.default.Component);
+
+Transition.contextTypes = {
+ transitionGroup: PropTypes.object
+};
+Transition.childContextTypes = {
+ transitionGroup: function transitionGroup() {}
+};
+Transition.propTypes = false ? {
+ /**
+ * A `function` child can be used instead of a React element. This function is
+ * called with the current transition status (`'entering'`, `'entered'`,
+ * `'exiting'`, `'exited'`, `'unmounted'`), which can be used to apply context
+ * specific props to a component.
+ *
+ * ```jsx
+ * <Transition in={this.state.in} timeout={150}>
+ * {state => (
+ * <MyComponent className={`fade fade-${state}`} />
+ * )}
+ * </Transition>
+ * ```
+ */
+ children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
+
+ /**
+ * Show the component; triggers the enter or exit states
+ */
+ in: PropTypes.bool,
+
+ /**
+ * By default the child component is mounted immediately along with
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
+ */
+ mountOnEnter: PropTypes.bool,
+
+ /**
+ * By default the child component stays mounted after it reaches the `'exited'` state.
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
+ */
+ unmountOnExit: PropTypes.bool,
+
+ /**
+ * Normally a component is not transitioned if it is shown when the `<Transition>` component mounts.
+ * If you want to transition on the first mount set `appear` to `true`, and the
+ * component will transition in as soon as the `<Transition>` mounts.
+ *
+ * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition.
+ */
+ appear: PropTypes.bool,
+
+ /**
+ * Enable or disable enter transitions.
+ */
+ enter: PropTypes.bool,
+
+ /**
+ * Enable or disable exit transitions.
+ */
+ exit: PropTypes.bool,
+
+ /**
+ * The duration of the transition, in milliseconds.
+ * Required unless `addEndListener` is provided.
+ *
+ * You may specify a single timeout for all transitions:
+ *
+ * ```jsx
+ * timeout={500}
+ * ```
+ *
+ * or individually:
+ *
+ * ```jsx
+ * timeout={{
+ * appear: 500,
+ * enter: 300,
+ * exit: 500,
+ * }}
+ * ```
+ *
+ * - `appear` defaults to the value of `enter`
+ * - `enter` defaults to `0`
+ * - `exit` defaults to `0`
+ *
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
+ */
+ timeout: function timeout(props) {
+ var pt = _PropTypes.timeoutsShape;
+ if (!props.addEndListener) pt = pt.isRequired;
+
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ return pt.apply(void 0, [props].concat(args));
+ },
+
+ /**
+ * Add a custom transition end trigger. Called with the transitioning
+ * DOM node and a `done` callback. Allows for more fine grained transition end
+ * logic. **Note:** Timeouts are still used as a fallback if provided.
+ *
+ * ```jsx
+ * addEndListener={(node, done) => {
+ * // use the css transitionend event to mark the finish of a transition
+ * node.addEventListener('transitionend', done, false);
+ * }}
+ * ```
+ */
+ addEndListener: PropTypes.func,
+
+ /**
+ * Callback fired before the "entering" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
+ */
+ onEnter: PropTypes.func,
+
+ /**
+ * Callback fired after the "entering" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool)
+ */
+ onEntering: PropTypes.func,
+
+ /**
+ * Callback fired after the "entered" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
+ */
+ onEntered: PropTypes.func,
+
+ /**
+ * Callback fired before the "exiting" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExit: PropTypes.func,
+
+ /**
+ * Callback fired after the "exiting" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExiting: PropTypes.func,
+
+ /**
+ * Callback fired after the "exited" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExited: PropTypes.func // Name the function so it is clearer in the documentation
+
+} : {};
+
+function noop() {}
+
+Transition.defaultProps = {
+ in: false,
+ mountOnEnter: false,
+ unmountOnExit: false,
+ appear: false,
+ enter: true,
+ exit: true,
+ onEnter: noop,
+ onEntering: noop,
+ onEntered: noop,
+ onExit: noop,
+ onExiting: noop,
+ onExited: noop
+};
+Transition.UNMOUNTED = 0;
+Transition.EXITED = 1;
+Transition.ENTERING = 2;
+Transition.ENTERED = 3;
+Transition.EXITING = 4;
+
+var _default = (0, _reactLifecyclesCompat.polyfill)(Transition);
+
+exports.default = _default;
+
+/***/ }),
+
+/***/ 935:
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyfill", function() { return polyfill; });
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+function componentWillMount() {
+ // Call this.constructor.gDSFP to support sub-classes.
+ var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
+ if (state !== null && state !== undefined) {
+ this.setState(state);
+ }
+}
+
+function componentWillReceiveProps(nextProps) {
+ // Call this.constructor.gDSFP to support sub-classes.
+ // Use the setState() updater to ensure state isn't stale in certain edge cases.
+ function updater(prevState) {
+ var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
+ return state !== null && state !== undefined ? state : null;
+ }
+ // Binding "this" is important for shallow renderer support.
+ this.setState(updater.bind(this));
+}
+
+function componentWillUpdate(nextProps, nextState) {
+ try {
+ var prevProps = this.props;
+ var prevState = this.state;
+ this.props = nextProps;
+ this.state = nextState;
+ this.__reactInternalSnapshotFlag = true;
+ this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
+ prevProps,
+ prevState
+ );
+ } finally {
+ this.props = prevProps;
+ this.state = prevState;
+ }
+}
+
+// React may warn about cWM/cWRP/cWU methods being deprecated.
+// Add a flag to suppress these warnings for this special case.
+componentWillMount.__suppressDeprecationWarning = true;
+componentWillReceiveProps.__suppressDeprecationWarning = true;
+componentWillUpdate.__suppressDeprecationWarning = true;
+
+function polyfill(Component) {
+ var prototype = Component.prototype;
+
+ if (!prototype || !prototype.isReactComponent) {
+ throw new Error('Can only polyfill class components');
+ }
+
+ if (
+ typeof Component.getDerivedStateFromProps !== 'function' &&
+ typeof prototype.getSnapshotBeforeUpdate !== 'function'
+ ) {
+ return Component;
+ }
+
+ // If new component APIs are defined, "unsafe" lifecycles won't be called.
+ // Error if any of these lifecycles are present,
+ // Because they would work differently between older and newer (16.3+) versions of React.
+ var foundWillMountName = null;
+ var foundWillReceivePropsName = null;
+ var foundWillUpdateName = null;
+ if (typeof prototype.componentWillMount === 'function') {
+ foundWillMountName = 'componentWillMount';
+ } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
+ foundWillMountName = 'UNSAFE_componentWillMount';
+ }
+ if (typeof prototype.componentWillReceiveProps === 'function') {
+ foundWillReceivePropsName = 'componentWillReceiveProps';
+ } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
+ foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
+ }
+ if (typeof prototype.componentWillUpdate === 'function') {
+ foundWillUpdateName = 'componentWillUpdate';
+ } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
+ foundWillUpdateName = 'UNSAFE_componentWillUpdate';
+ }
+ if (
+ foundWillMountName !== null ||
+ foundWillReceivePropsName !== null ||
+ foundWillUpdateName !== null
+ ) {
+ var componentName = Component.displayName || Component.name;
+ var newApiName =
+ typeof Component.getDerivedStateFromProps === 'function'
+ ? 'getDerivedStateFromProps()'
+ : 'getSnapshotBeforeUpdate()';
+
+ throw Error(
+ 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
+ componentName +
+ ' uses ' +
+ newApiName +
+ ' but also contains the following legacy lifecycles:' +
+ (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
+ (foundWillReceivePropsName !== null
+ ? '\n ' + foundWillReceivePropsName
+ : '') +
+ (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
+ '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
+ 'https://fb.me/react-async-component-lifecycle-hooks'
+ );
+ }
+
+ // React <= 16.2 does not support static getDerivedStateFromProps.
+ // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
+ // Newer versions of React will ignore these lifecycles if gDSFP exists.
+ if (typeof Component.getDerivedStateFromProps === 'function') {
+ prototype.componentWillMount = componentWillMount;
+ prototype.componentWillReceiveProps = componentWillReceiveProps;
+ }
+
+ // React <= 16.2 does not support getSnapshotBeforeUpdate.
+ // As a workaround, use cWU to invoke the new lifecycle.
+ // Newer versions of React will ignore that lifecycle if gSBU exists.
+ if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
+ if (typeof prototype.componentDidUpdate !== 'function') {
+ throw new Error(
+ 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
+ );
+ }
+
+ prototype.componentWillUpdate = componentWillUpdate;
+
+ var componentDidUpdate = prototype.componentDidUpdate;
+
+ prototype.componentDidUpdate = function componentDidUpdatePolyfill(
+ prevProps,
+ prevState,
+ maybeSnapshot
+ ) {
+ // 16.3+ will not execute our will-update method;
+ // It will pass a snapshot value to did-update though.
+ // Older versions will require our polyfilled will-update value.
+ // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
+ // Because for <= 15.x versions this might be a "prevContext" object.
+ // We also can't just check "__reactInternalSnapshot",
+ // Because get-snapshot might return a falsy value.
+ // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
+ var snapshot = this.__reactInternalSnapshotFlag
+ ? this.__reactInternalSnapshot
+ : maybeSnapshot;
+
+ componentDidUpdate.call(this, prevProps, prevState, snapshot);
+ };
+ }
+
+ return Component;
+}
+
+
+
+
+/***/ }),
+
+/***/ 936:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.classNamesShape = exports.timeoutsShape = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var timeoutsShape = false ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
+ enter: _propTypes.default.number,
+ exit: _propTypes.default.number,
+ appear: _propTypes.default.number
+}).isRequired]) : null;
+exports.timeoutsShape = timeoutsShape;
+var classNamesShape = false ? _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
+ enter: _propTypes.default.string,
+ exit: _propTypes.default.string,
+ active: _propTypes.default.string
+}), _propTypes.default.shape({
+ enter: _propTypes.default.string,
+ enterDone: _propTypes.default.string,
+ enterActive: _propTypes.default.string,
+ exit: _propTypes.default.string,
+ exitDone: _propTypes.default.string,
+ exitActive: _propTypes.default.string
+})]) : null;
+exports.classNamesShape = classNamesShape;
+
+/***/ }),
+
+/***/ 937:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "TabList", {
+ enumerable: true,
+ get: function () {
+ return _tabList.default;
+ }
+});
+Object.defineProperty(exports, "TabPanels", {
+ enumerable: true,
+ get: function () {
+ return _tabPanels.default;
+ }
+});
+Object.defineProperty(exports, "Tab", {
+ enumerable: true,
+ get: function () {
+ return _tab.default;
+ }
+});
+Object.defineProperty(exports, "Tabs", {
+ enumerable: true,
+ get: function () {
+ return _tabs.default;
+ }
+});
+
+var _tabList = _interopRequireDefault(__webpack_require__(710));
+
+var _tabPanels = _interopRequireDefault(__webpack_require__(712));
+
+var _tab = _interopRequireDefault(__webpack_require__(711));
+
+var _tabs = _interopRequireDefault(__webpack_require__(941));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/***/ }),
+
+/***/ 938:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var _default = _propTypes.default.object;
+exports.default = _default;
+
+/***/ }),
+
+/***/ 941:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _uniqueId = _interopRequireDefault(__webpack_require__(942));
+
+var _tabList = _interopRequireDefault(__webpack_require__(710));
+
+var _tabPanels = _interopRequireDefault(__webpack_require__(712));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+class Tabs extends _react.default.Component {
+ constructor() {
+ super();
+ this.accessibleId = (0, _uniqueId.default)();
+ }
+
+ render() {
+ const {
+ activeIndex,
+ children,
+ className,
+ onActivateTab
+ } = this.props;
+ const accessibleId = this.accessibleId;
+ return /*#__PURE__*/_react.default.createElement("div", {
+ className: className
+ }, _react.default.Children.map(children, child => {
+ if (!child) {
+ return child;
+ }
+
+ switch (child.type) {
+ case _tabList.default:
+ return /*#__PURE__*/_react.default.cloneElement(child, {
+ accessibleId,
+ activeIndex,
+ onActivateTab
+ });
+
+ case _tabPanels.default:
+ return /*#__PURE__*/_react.default.cloneElement(child, {
+ accessibleId,
+ activeIndex
+ });
+
+ default:
+ return child;
+ }
+ }));
+ }
+
+}
+
+exports.default = Tabs;
+Tabs.propTypes = {
+ activeIndex: _propTypes.default.number.isRequired,
+ children: _propTypes.default.node,
+ className: _propTypes.default.string,
+ onActivateTab: _propTypes.default.func
+};
+Tabs.defaultProps = {
+ children: null,
+ className: undefined,
+ onActivateTab: () => {}
+};
+
+/***/ }),
+
+/***/ 942:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = uniqueId;
+let counter = 0;
+
+function uniqueId() {
+ counter += 1;
+ return `$rac$${counter}`;
+}
+
+/***/ }),
+
+/***/ 957:
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ }),
+
+/***/ 958:
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ })
+
+/******/ });
+}); \ No newline at end of file
diff --git a/devtools/client/debugger/images/arrow-down.svg b/devtools/client/debugger/images/arrow-down.svg
new file mode 100644
index 0000000000..3b180d1158
--- /dev/null
+++ b/devtools/client/debugger/images/arrow-down.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
+ <path d="M6.354 8.354a.5.5 0 0 1-.708 0l-4.5-4.5a.5.5 0 1 1 .708-.708L6 7.293l4.146-4.147a.5.5 0 0 1 .708.708l-4.5 4.5z"/>
+</svg>
diff --git a/devtools/client/debugger/images/arrow-up.svg b/devtools/client/debugger/images/arrow-up.svg
new file mode 100644
index 0000000000..7fa57c6616
--- /dev/null
+++ b/devtools/client/debugger/images/arrow-up.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
+ <path d="M5.646 2.647a.5.5 0 0 1 .708 0l4.5 4.5a.5.5 0 0 1-.708.708L6 3.708 1.854 7.855a.5.5 0 1 1-.708-.708l4.5-4.5z"/>
+</svg>
diff --git a/devtools/client/debugger/images/arrow.svg b/devtools/client/debugger/images/arrow.svg
new file mode 100644
index 0000000000..d1217f2dd2
--- /dev/null
+++ b/devtools/client/debugger/images/arrow.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10">
+ <path d="M5 8c-.25 0-.35-.1-.65-.4l-3.1-3.35C.75 3.7 1.1 3 1.75 3h6.5c.65 0 1 .7.5 1.25L5.65 7.6c-.3.3-.4.4-.65.4z"/>
+</svg>
diff --git a/devtools/client/debugger/images/blackBox.svg b/devtools/client/debugger/images/blackBox.svg
new file mode 100644
index 0000000000..ab4c0401ec
--- /dev/null
+++ b/devtools/client/debugger/images/blackBox.svg
@@ -0,0 +1,9 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.9806 2.31229C12.4406 1.52012 11.531 1 10.5 1H5.5C3.84315 1 1.5 3 1.5 5V12C1.5 12.518 1.63128 13.0053 1.86238 13.4305L1.14645 14.1464C0.951185 14.3417 0.951185 14.6583 1.14645 14.8536C1.34171 15.0488 1.65829 15.0488 1.85355 14.8536L14.8536 1.85355C15.0488 1.65829 15.0488 1.34171 14.8536 1.14645C14.6583 0.951184 14.3417 0.951184 14.1464 1.14645L12.9806 2.31229ZM2.61707 12.6758C2.54129 12.4647 2.5 12.2372 2.5 12V6H5C5.39782 6 5.77936 5.84196 6.06066 5.56066C6.34196 5.27936 6.5 4.89782 6.5 4.5V2H10.5C11.2561 2 11.9143 2.4196 12.2542 3.03866L8.29289 7H6C5.86739 7 5.74021 7.05268 5.64645 7.14645C5.55268 7.24021 5.5 7.36739 5.5 7.5C5.5 7.63261 5.55268 7.75979 5.64645 7.85355C5.74021 7.94732 5.86739 8 6 8H7.29289L6.29289 9H4C3.86739 9 3.74021 9.05268 3.64645 9.14645C3.55268 9.24021 3.5 9.36739 3.5 9.5C3.5 9.63261 3.55268 9.75979 3.64645 9.85355C3.74021 9.94732 3.86739 10 4 10H5.29289L2.61707 12.6758ZM5.5 2V4.5C5.5 4.78 5.28 5 5 5H2.5C2.5 3.89543 4.39543 2 5.5 2Z"/>
+ <path d="M3.56333 14.8509L4.41595 13.9983C4.44382 13.9994 4.47184 14 4.5 14H10.5C11.6046 14 12.5 13.1046 12.5 12V5.91421L13.5 4.91421V12C13.5 13.6569 12.1569 15 10.5 15H4.5C4.17291 15 3.85805 14.9477 3.56333 14.8509Z"/>
+ <path d="M9.41421 9H11C11.28 9 11.5 9.22 11.5 9.5C11.5 9.63261 11.4473 9.75979 11.3536 9.85355C11.2598 9.94732 11.1326 10 11 10H8.41421L9.41421 9Z"/>
+ <path d="M6.41421 12L7.41421 11H11C11.28 11 11.5 11.22 11.5 11.5C11.5 11.6326 11.4473 11.7598 11.3536 11.8536C11.2598 11.9473 11.1326 12 11 12H6.41421Z"/>
+</svg>
diff --git a/devtools/client/debugger/images/breadcrumbs-divider.svg b/devtools/client/debugger/images/breadcrumbs-divider.svg
new file mode 100644
index 0000000000..f41aa7fa0a
--- /dev/null
+++ b/devtools/client/debugger/images/breadcrumbs-divider.svg
@@ -0,0 +1,18 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="5" height="7">
+ <defs>
+ <linearGradient id="b">
+ <stop offset="0" stop-color="#9a9aba"/>
+ <stop offset="1" stop-color="#a6a6c2"/>
+ </linearGradient>
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#8e8eb2"/>
+ <stop offset="1" stop-color="#9a9aba"/>
+ </linearGradient>
+ <linearGradient x1="3.616" y1="3.893" x2="1.285" y2="-.757" id="d" href="#a" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1 0 0 .8684 0 1046.257)"/>
+ <linearGradient x1="2.232" y1="4.162" x2=".629" y2=".966" id="c" href="#b" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1 0 0 .8684 0 1046.257)"/>
+ </defs>
+ <path d="M.2 1045.562l4.6 3.3-4.6 3.3 2-3.3z" fill="url(#c)" stroke="url(#d)" stroke-width=".4" stroke-linejoin="round" transform="translate(0 -1045.362)"/>
+</svg> \ No newline at end of file
diff --git a/devtools/client/debugger/images/breakpoint.svg b/devtools/client/debugger/images/breakpoint.svg
new file mode 100644
index 0000000000..95a6ef519c
--- /dev/null
+++ b/devtools/client/debugger/images/breakpoint.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 15" width="60" height="15" stroke="currentColor">
+ <path d="M53.07.5H1.5c-.54 0-1 .46-1 1v12c0 .54.46 1 1 1h51.57c.58 0 1.15-.26 1.53-.7l4.7-6.3-4.7-6.3c-.38-.44-.95-.7-1.53-.7z"/>
+</svg>
diff --git a/devtools/client/debugger/images/case-match.svg b/devtools/client/debugger/images/case-match.svg
new file mode 100644
index 0000000000..5457bfb5dd
--- /dev/null
+++ b/devtools/client/debugger/images/case-match.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 16" stroke="none" fillrule="evenodd" fill="context-fill">
+ <path d="M10.919,13 L9.463,13 C9.29966585,13 9.16550052,12.9591671 9.0605,12.8775 C8.95549947,12.7958329 8.8796669,12.6943339 8.833,12.573 L8.077,10.508 L3.884,10.508 L3.128,12.573 C3.09066648,12.6803339 3.01716722,12.7783329 2.9075,12.867 C2.79783279,12.9556671 2.66366746,13 2.505,13 L1.042,13 L5.018,2.878 L6.943,2.878 L10.919,13 Z M4.367,9.178 L7.594,9.178 L6.362,5.811 C6.30599972,5.66166592 6.24416701,5.48550102 6.1765,5.2825 C6.108833,5.07949898 6.04233366,4.85900119 5.977,4.621 C5.91166634,4.85900119 5.84750032,5.08066564 5.7845,5.286 C5.72149969,5.49133436 5.65966697,5.67099923 5.599,5.825 L4.367,9.178 Z M18.892,13 L18.115,13 C17.9516658,13 17.8233338,12.9755002 17.73,12.9265 C17.6366662,12.8774998 17.5666669,12.7783341 17.52,12.629 L17.366,12.118 C17.1839991,12.2813341 17.0055009,12.4248327 16.8305,12.5485 C16.6554991,12.6721673 16.4746676,12.7759996 16.288,12.86 C16.1013324,12.9440004 15.903001,13.0069998 15.693,13.049 C15.4829989,13.0910002 15.2496679,13.112 14.993,13.112 C14.6896651,13.112 14.4096679,13.0711671 14.153,12.9895 C13.896332,12.9078329 13.6758342,12.7853342 13.4915,12.622 C13.3071657,12.4586658 13.1636672,12.2556679 13.061,12.013 C12.9583328,11.7703321 12.907,11.4880016 12.907,11.166 C12.907,10.895332 12.9781659,10.628168 13.1205,10.3645 C13.262834,10.100832 13.499665,9.8628344 13.831,9.6505 C14.162335,9.43816561 14.6033306,9.2620007 15.154,9.122 C15.7046694,8.9819993 16.3883292,8.90266676 17.205,8.884 L17.205,8.464 C17.205,7.98333093 17.103501,7.62750116 16.9005,7.3965 C16.697499,7.16549885 16.4023352,7.05 16.015,7.05 C15.7349986,7.05 15.5016676,7.08266634 15.315,7.148 C15.1283324,7.21333366 14.9661673,7.28683292 14.8285,7.3685 C14.6908326,7.45016707 14.5636672,7.52366634 14.447,7.589 C14.3303327,7.65433366 14.2020007,7.687 14.062,7.687 C13.9453327,7.687 13.8450004,7.65666697 13.761,7.596 C13.6769996,7.53533303 13.6093336,7.46066711 13.558,7.372 L13.243,6.819 C14.0690041,6.06299622 15.0653275,5.685 16.232,5.685 C16.6520021,5.685 17.0264983,5.75383264 17.3555,5.8915 C17.6845016,6.02916736 17.9633322,6.22049877 18.192,6.4655 C18.4206678,6.71050122 18.5944994,7.00333163 18.7135,7.344 C18.8325006,7.68466837 18.892,8.05799797 18.892,8.464 L18.892,13 Z M15.532,11.922 C15.7093342,11.922 15.8726659,11.9056668 16.022,11.873 C16.1713341,11.8403332 16.3124993,11.7913337 16.4455,11.726 C16.5785006,11.6606663 16.7068327,11.5801671 16.8305,11.4845 C16.9541673,11.3888329 17.0789993,11.2756673 17.205,11.145 L17.205,9.934 C16.7009975,9.95733345 16.279835,10.0004997 15.9415,10.0635 C15.603165,10.1265003 15.3313343,10.2069995 15.126,10.305 C14.9206656,10.4030005 14.7748337,10.5173327 14.6885,10.648 C14.6021662,10.7786673 14.559,10.9209992 14.559,11.075 C14.559,11.3783349 14.6488324,11.5953327 14.8285,11.726 C15.0081675,11.8566673 15.2426652,11.922 15.532,11.922 L15.532,11.922 Z"></path>
+</svg>
diff --git a/devtools/client/debugger/images/column-marker.svg b/devtools/client/debugger/images/column-marker.svg
new file mode 100644
index 0000000000..6b58715a59
--- /dev/null
+++ b/devtools/client/debugger/images/column-marker.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 13" width="11" height="13">
+ <path d="M5.07.5H1.5c-.54 0-1 .46-1 1v10c0 .54.46 1 1 1h3.57c.58 0 1.15-.26 1.53-.7l3.7-5.3-3.7-5.3C6.22.76 5.65.5 5.07.5z"/>
+</svg>
diff --git a/devtools/client/debugger/images/command-chevron.svg b/devtools/client/debugger/images/command-chevron.svg
new file mode 100644
index 0000000000..8ed0338bcf
--- /dev/null
+++ b/devtools/client/debugger/images/command-chevron.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M2.293 2.293a1 1 0 0 1 1.414 0l5 5a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414-1.414L6.586 8 2.293 3.707a1 1 0 0 1 0-1.414zM8.293 2.293a1 1 0 0 1 1.414 0l5 5a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414-1.414L12.586 8 8.293 3.707a1 1 0 0 1 0-1.414z"/>
+</svg>
diff --git a/devtools/client/debugger/images/disable-pausing.svg b/devtools/client/debugger/images/disable-pausing.svg
new file mode 100644
index 0000000000..b073ec5f44
--- /dev/null
+++ b/devtools/client/debugger/images/disable-pausing.svg
@@ -0,0 +1,15 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
+ xmlns="http://www.w3.org/2000/svg">
+ <g clip-path="url(#clip0)">
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.41753 2.35H2.5C1.83696 2.35 1.20107 2.61339 0.732233 3.08223C0.263392 3.55107 0 4.18696 0 4.85V9.85C0 10.513 0.263392 11.1489 0.732233 11.6178C0.807612 11.6931 0.88731 11.7632 0.970743 11.8277L2.2054 10.2563C2.08021 10.1663 2 10.0191 2 9.85V4.85C2 4.71739 2.05268 4.59021 2.14645 4.49644C2.24021 4.40268 2.36739 4.35 2.5 4.35H6.8461L8.41753 2.35ZM7.21882 10.35H10.05L13.65 7.35L11.188 5.29832L12.4207 3.72947L15.74 6.68C15.9058 6.86375 15.9976 7.10248 15.9976 7.35C15.9976 7.59752 15.9058 7.83625 15.74 8.02L11.24 12.02C11.1465 12.1236 11.0324 12.2065 10.9049 12.2633C10.7775 12.3201 10.6395 12.3497 10.5 12.35H5.64739L7.21882 10.35Z" fill="black"/>
+ <line x1="2.0815" y1="13.5959" x2="11.8459" y2="1.1685" stroke="black" stroke-width="2" stroke-linecap="round"/>
+ </g>
+ <defs>
+ <clipPath id="clip0">
+ <rect width="16" height="16" fill="white"/>
+ </clipPath>
+ </defs>
+</svg>
diff --git a/devtools/client/debugger/images/enable-pausing.svg b/devtools/client/debugger/images/enable-pausing.svg
new file mode 100644
index 0000000000..54d7c3676d
--- /dev/null
+++ b/devtools/client/debugger/images/enable-pausing.svg
@@ -0,0 +1,15 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
+ xmlns="http://www.w3.org/2000/svg">
+ <g clip-path="url(#clip0)">
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.41753 2.35H2.5C1.83696 2.35 1.20107 2.61339 0.732233 3.08223C0.263392 3.55107 0 4.18696 0 4.85V9.85C0 10.513 0.263392 11.1489 0.732233 11.6178C0.807612 11.6931 0.88731 11.7632 0.970743 11.8277L8.41753 2.35ZM5.64739 12.35H10.5C10.6395 12.3497 10.7775 12.3201 10.9049 12.2633C11.0324 12.2065 11.1465 12.1236 11.24 12.02L15.74 8.02C15.9058 7.83625 15.9976 7.59752 15.9976 7.35C15.9976 7.10248 15.9058 6.86375 15.74 6.68L12.4207 3.72947L5.64739 12.35Z" fill="black"/>
+ <line x1="2.0815" y1="13.5959" x2="11.8459" y2="1.1685" stroke="black" stroke-width="2" stroke-linecap="round"/>
+ </g>
+ <defs>
+ <clipPath id="clip0">
+ <rect width="16" height="16" fill="white"/>
+ </clipPath>
+ </defs>
+</svg>
diff --git a/devtools/client/debugger/images/file-small.svg b/devtools/client/debugger/images/file-small.svg
new file mode 100644
index 0000000000..ece2cc97de
--- /dev/null
+++ b/devtools/client/debugger/images/file-small.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
+ <path d="M1 1a1 1 0 0 1 1-1h5.74a1 1 0 0 1 .82.42l2.25 3.16a1 1 0 0 1 .19.58V11a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V1zm6.74 0H2v10h8V4.16L7.74 1zM7 4V1h1v3h2v1H8a1 1 0 0 1-1-1z"/>
+</svg>
diff --git a/devtools/client/debugger/images/folder.svg b/devtools/client/debugger/images/folder.svg
new file mode 100644
index 0000000000..a65b345bcc
--- /dev/null
+++ b/devtools/client/debugger/images/folder.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M1 3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h6a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3zm6 0H2v1h5V3zM2 5v8h12V5H2z"/>
+</svg>
diff --git a/devtools/client/debugger/images/globe-small.svg b/devtools/client/debugger/images/globe-small.svg
new file mode 100644
index 0000000000..2c66eaa3ba
--- /dev/null
+++ b/devtools/client/debugger/images/globe-small.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12" fill="context-fill">
+ <path d="M6 1a5 5 0 1 0 0 10A5 5 0 0 0 6 1zM0 6a6 6 0 1 1 12 0A6 6 0 0 1 0 6zM1 4h10v1H1V4zM1 7h10v1H1V7z"/>
+ <path fill-rule="evenodd" d="M7.23 9.8C7.69 8.88 8 7.54 8 6s-.31-2.88-.77-3.8C6.73 1.23 6.25 1 6 1s-.74.23-1.23 1.2A8.74 8.74 0 0 0 4 6c0 1.54.31 2.88.77 3.8.5.97.98 1.2 1.23 1.2s.74-.23 1.23-1.2zM6 12c1.66 0 3-2.69 3-6S7.66 0 6 0 3 2.69 3 6s1.34 6 3 6z"/>
+</svg>
diff --git a/devtools/client/debugger/images/globe.svg b/devtools/client/debugger/images/globe.svg
new file mode 100644
index 0000000000..6d03745a52
--- /dev/null
+++ b/devtools/client/debugger/images/globe.svg
@@ -0,0 +1,9 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M2 5h12v1H2V5zM2 10h12v1H2v-1zM11.02 12.69C10.42 13.89 9.42 15 8 15c-1.41 0-2.42-1.12-3.02-2.31A10.72 10.72 0 0 1 4 8c0-1.78.36-3.44.98-4.69C5.58 2.11 6.58 1 8 1c1.41 0 2.42 1.12 3.02 2.31.62 1.25.98 2.91.98 4.69 0 1.78-.36 3.44-.98 4.69zM8 14c1.66 0 3-2.69 3-6S9.66 2 8 2 5 4.69 5 8s1.34 6 3 6zM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-8 6A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"/>
+</svg>
diff --git a/devtools/client/debugger/images/help.svg b/devtools/client/debugger/images/help.svg
new file mode 100644
index 0000000000..58c2274df4
--- /dev/null
+++ b/devtools/client/debugger/images/help.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v="2">
+ <path fill="context-fill" d="M13.15 17a1.15 1.15 0 1 1-2.3 0 1.15 1.15 0 0 1 2.3 0zM10.5 9.5c0-.764.616-1.5 1.5-1.5s1.5.736 1.5 1.5c0 .311-.144.635-.408.974-.199.254-.386.43-.57.6-.077.072-.153.143-.23.219a1.676 1.676 0 0 1-.048.045c-.13.117-.466.42-.698.757C11.22 12.569 11 13.18 11 14a1 1 0 1 0 2 0c0-.431.106-.645.194-.772.051-.074.114-.144.197-.225.04-.039.08-.075.129-.12l.003-.002.009-.008c.05-.045.114-.104.175-.166l.086-.08a8.13 8.13 0 0 0 .876-.924c.4-.512.831-1.264.831-2.203C15.5 7.764 14.116 6 12 6S8.5 7.764 8.5 9.5a1 1 0 1 0 2 0z"></path>
+ <path fill="context-fill" fill-rule="evenodd" clip-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z"></path>
+</svg>
diff --git a/devtools/client/debugger/images/home.svg b/devtools/client/debugger/images/home.svg
new file mode 100644
index 0000000000..275108f218
--- /dev/null
+++ b/devtools/client/debugger/images/home.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+ <path d="M15.7 7.3l-7-7c-.4-.4-1-.4-1.4 0l-7 7c-.4.4-.4 1 0 1.4.4.4 1 .4 1.4 0l.3-.3V13c0 1.7 1.3 3 3 3h6c1.7 0 3-1.3 3-3V8.4l.3.3c.2.2.4.3.7.3.3 0 .5-.1.7-.3.4-.4.4-1 0-1.4zM8 11.5c0-.3.2-.5.5-.5s.5.2.5.5-.2.5-.5.5-.5-.2-.5-.5zm4 1.5c0 .6-.4 1-1 1h-1V9c0-.6-.4-1-1-1H7c-.6 0-1 .4-1 1v5H5c-.6 0-1-.4-1-1V6.4l4-4 4 4V13z"></path>
+</svg>
diff --git a/devtools/client/debugger/images/loader.svg b/devtools/client/debugger/images/loader.svg
new file mode 100644
index 0000000000..67589cb3d5
--- /dev/null
+++ b/devtools/client/debugger/images/loader.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill">
+ <path opacity=".2" d="M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2zm0 10.67a4.67 4.67 0 1 1 0-9.34 4.67 4.67 0 0 1 0 9.34z"/>
+ <path d="M10.33 3.96L11 2.8C10.1 2.3 9.1 2 8 2v1.33c.85 0 1.65.23 2.33.63z"/>
+</svg>
diff --git a/devtools/client/debugger/images/markup-breakpoint.svg b/devtools/client/debugger/images/markup-breakpoint.svg
new file mode 100644
index 0000000000..b736c4e78c
--- /dev/null
+++ b/devtools/client/debugger/images/markup-breakpoint.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
+ <path d="M6 1H0v10h6l4-5-4-5z" fill="context-fill" />
+ <path d="M0 .5h6.25L10.5 6l-4.25 5.5H0" fill="none" stroke="context-stroke" stroke-width="1" />
+</svg> \ No newline at end of file
diff --git a/devtools/client/debugger/images/next-circle.svg b/devtools/client/debugger/images/next-circle.svg
new file mode 100644
index 0000000000..91fb6ddb6b
--- /dev/null
+++ b/devtools/client/debugger/images/next-circle.svg
@@ -0,0 +1,9 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+
+<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#0274E8">
+ <path d="M8,0 C3.581722,-2.705415e-16 5.41083001e-16,3.581722 0,8 C-5.41083001e-16,12.418278 3.581722,16 8,16 C12.418278,16 16,12.418278 16,8 C16,5.87826808 15.1571453,3.84343678 13.6568542,2.34314575 C12.1565632,0.842854723 10.1217319,1.2991861e-16 8,0 Z M8,15 C4.13400675,15 1,11.8659932 1,8 C1,4.13400675 4.13400675,1 8,1 C11.8659932,1 15,4.13400675 15,8 C15,9.85651543 14.2625021,11.6369928 12.9497475,12.9497475 C11.6369928,14.2625021 9.85651543,15 8,15 Z" id="Shape"></path>
+ <path d="M11.5,4 C11.2238576,4 11,4.22385763 11,4.5 L11,7.5 C10.9257751,7.36047643 10.8195383,7.24053164 10.69,7.15 L5.57,3.63 C5.2714387,3.432438 4.89004177,3.40955419 4.57,3.57 C4.22912746,3.732229 4.00866545,4.0725914 4,4.45 L4,11.55 C4.00294215,11.9207587 4.21077995,12.2594573 4.54,12.43 C4.68034771,12.5091766 4.83885991,12.5505276 5,12.55 C5.20390805,12.5495172 5.4027955,12.4867107 5.57,12.37 L10.69,8.82 C10.8195383,8.72946836 10.9257751,8.60952357 11,8.47 L11,11.47 C11,11.7461424 11.2238576,11.97 11.5,11.97 C11.7761424,11.97 12,11.7461424 12,11.47 L12,4.47 C11.9841101,4.20563806 11.7648386,3.99952289 11.5,4 Z M5,11.55 L5,4.45 L10.12,8 L5,11.55 Z" id="Shape"></path>
+</svg>
diff --git a/devtools/client/debugger/images/next.svg b/devtools/client/debugger/images/next.svg
new file mode 100644
index 0000000000..c4c19bf4a1
--- /dev/null
+++ b/devtools/client/debugger/images/next.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg version="1.1" xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+<path d="M12.4,2.1c-0.3,0-0.5,0.2-0.5,0.5v4.8c0,0-0.1-0.1-0.1-0.1l-7.4-5C3.8,1.8,3,2.2,3,3v10c0,0.8,0.8,1.3,1.4,0.8l7.4-5
+ c0.1,0,0.1-0.1,0.1-0.1v4.8c0,0.3,0.2,0.5,0.5,0.5s0.5-0.2,0.5-0.5v-11C12.9,2.3,12.7,2.1,12.4,2.1z M3.9,13V3l7.4,5L3.9,13z"/>
+</svg>
diff --git a/devtools/client/debugger/images/pane-collapse.svg b/devtools/client/debugger/images/pane-collapse.svg
new file mode 100644
index 0000000000..6f6623346e
--- /dev/null
+++ b/devtools/client/debugger/images/pane-collapse.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M4 3H2v10h2V3zm7 7V6L8 8l3 2z" fill-opacity=".3"/>
+ <path d="M11.47 10.88A1 1 0 0 0 12 10V6a1 1 0 0 0-1.55-.83l-3 2a1 1 0 0 0 0 1.66l3 2c.3.2.7.23 1.02.05zM8 8l3-2v4L8 8zM2 2h12c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1H2c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1zm12 11V3H5v10h9zM2 13h2V3H2v10z"/>
+</svg>
diff --git a/devtools/client/debugger/images/pane-expand.svg b/devtools/client/debugger/images/pane-expand.svg
new file mode 100644
index 0000000000..6498f09b1b
--- /dev/null
+++ b/devtools/client/debugger/images/pane-expand.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M4 3H2v10h2V3zM8 6v4l3-2-3-2z" fill-opacity=".3"/>
+ <path d="M7.53 10.88A1 1 0 0 1 7 10V6a1 1 0 0 1 1.55-.83l3 2a1 1 0 0 1 0 1.66l-3 2a1 1 0 0 1-1.02.05zM11 8L8 6v4l3-2zM2 2h12c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1H2c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1zm12 11V3H5v10h9zM2 13h2V3H2v10z"/>
+</svg>
diff --git a/devtools/client/debugger/images/pause.svg b/devtools/client/debugger/images/pause.svg
new file mode 100644
index 0000000000..69ebe2d962
--- /dev/null
+++ b/devtools/client/debugger/images/pause.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg version="1.1" xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+ <path d="M5,13.5C5,13.8,4.7,14,4.5,14C4.2,14,4,13.8,4,13.5V2.6c0-0.3,0.2-0.5,0.5-0.5C4.7,2.1,5,2.3,5,2.6V13.5z"/>
+ <path d="M11.9,13.5c0,0.3-0.2,0.5-0.5,0.5s-0.5-0.2-0.5-0.5V2.6c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5V13.5z"/>
+</svg>
diff --git a/devtools/client/debugger/images/plus.svg b/devtools/client/debugger/images/plus.svg
new file mode 100644
index 0000000000..14ca4837e2
--- /dev/null
+++ b/devtools/client/debugger/images/plus.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M8.5 8.5V14a.5.5 0 1 1-1 0V8.5H2a.5.5 0 0 1 0-1h5.5V2a.5.5 0 0 1 1 0v5.5H14a.5.5 0 1 1 0 1H8.5z"/>
+</svg>
diff --git a/devtools/client/debugger/images/prettyPrint.svg b/devtools/client/debugger/images/prettyPrint.svg
new file mode 100644
index 0000000000..2c5a60f046
--- /dev/null
+++ b/devtools/client/debugger/images/prettyPrint.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="context-fill">
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.36968 15.003H3.89191C3.3109 15.003 2.89285 14.7972 2.63676 14.3844C2.38067 13.9703 2.25211 13.2061 2.25211 12.0879V11.3224C2.25211 10.3257 2.15393 9.63235 1.95655 9.24224C1.75815 8.8508 1.44032 8.65441 1 8.65441V7.35317C1.44032 7.35317 1.75916 7.15812 1.95655 6.76534C2.15393 6.37524 2.25313 5.68187 2.25313 4.68656V3.9117C2.25313 2.79883 2.38067 2.03599 2.63676 1.62451C2.89285 1.21036 3.3109 1.00462 3.89191 1.00462H4.36968V2.05068H4.18849C3.81397 2.05068 3.55282 2.15756 3.40503 2.37132C3.25826 2.58374 3.18437 3.09275 3.18437 3.89567V4.40735C3.18437 5.50819 3.0872 6.32046 2.89386 6.84283C2.70053 7.36386 2.37156 7.74996 1.90796 7.99978C2.37156 8.25496 2.70053 8.64372 2.89386 9.16609C3.0872 9.68712 3.18437 10.4994 3.18437 11.6016V12.1119C3.18437 12.9162 3.25826 13.4238 3.40503 13.6376C3.55282 13.8514 3.81397 13.9569 4.18849 13.9569H4.37069L4.36968 15.003ZM15 8.65441C14.5647 8.65441 14.2469 8.8508 14.0465 9.24224C13.8471 9.63235 13.7469 10.3257 13.7469 11.3224V12.0879C13.7469 13.2061 13.6203 13.9716 13.3663 14.3844C13.1122 14.7972 12.6942 15.003 12.1142 15.003H11.6303V13.9569H11.8176C12.1921 13.9569 12.4533 13.85 12.601 13.6363C12.7478 13.4238 12.8217 12.9162 12.8217 12.1133V11.6016C12.8217 10.4994 12.9189 9.68712 13.1122 9.16609C13.3055 8.64506 13.6345 8.25496 14.0981 7.99978C13.6345 7.74996 13.3055 7.36386 13.1122 6.84283C12.9189 6.32046 12.8217 5.50819 12.8217 4.40735V3.89567C12.8217 3.09141 12.7478 2.58374 12.601 2.36998C12.4533 2.15756 12.1921 2.05068 11.8176 2.05068H11.6303V1.00462H12.1142C12.6942 1.00462 13.1122 1.21169 13.3663 1.62451C13.6193 2.03599 13.7469 2.80017 13.7469 3.9117V4.68656C13.7469 5.58568 13.8359 6.255 14.0131 6.69454C14.1912 7.13407 14.5192 7.35317 15 7.35317V8.65441Z"/>
+</svg>
diff --git a/devtools/client/debugger/images/regex-match.svg b/devtools/client/debugger/images/regex-match.svg
new file mode 100644
index 0000000000..029a9e270e
--- /dev/null
+++ b/devtools/client/debugger/images/regex-match.svg
@@ -0,0 +1,9 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 16" stroke="none" fillrule="evenodd" fill="context-fill">
+ <rect x="3" y="10" width="3" height="3" rx="1"></rect>
+ <rect x="12" y="3" width="2" height="9" rx="1"></rect>
+ <rect transform="translate(13.000000, 7.500000) rotate(60.000000) translate(-13.000000, -7.500000) " x="12" y="3" width="2" height="9" rx="1"></rect>
+ <rect transform="translate(13.000000, 7.500000) rotate(-60.000000) translate(-13.000000, -7.500000) " x="12" y="3" width="2" height="9" rx="1"></rect>
+</svg>
diff --git a/devtools/client/debugger/images/reload.svg b/devtools/client/debugger/images/reload.svg
new file mode 100644
index 0000000000..7942ec30a3
--- /dev/null
+++ b/devtools/client/debugger/images/reload.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="context-fill">
+ <path d="M13.917 7C13.44 4.162 10.973 2 8 2 4.686 2 2 4.686 2 8s2.686 6 6 6c2.22 0 4.16-1.207 5.197-3H12c-.912 1.214-2.364 2-4 2-2.76 0-5-2.24-5-5s2.24-5 5-5c2.42 0 4.437 1.718 4.9 4h1.017z"/>
+ <path d="M14 1L8 7h6V1zm-1 1L9 6h4V2z" fill-rule="evenodd"/>
+</svg>
diff --git a/devtools/client/debugger/images/search.svg b/devtools/client/debugger/images/search.svg
new file mode 100644
index 0000000000..0d11ff1fe7
--- /dev/null
+++ b/devtools/client/debugger/images/search.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M14.293 15.707a1.01 1.01 0 0 0 1.402-.012 1.01 1.01 0 0 0 .012-1.402L10.89 9.476a6 6 0 1 0-1.414 1.414l4.817 4.817zM8.828 8.828a4 4 0 1 1-5.656-5.656 4 4 0 0 1 5.656 5.656z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/aframe.svg b/devtools/client/debugger/images/sources/aframe.svg
new file mode 100644
index 0000000000..b903d3eab9
--- /dev/null
+++ b/devtools/client/debugger/images/sources/aframe.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M5.01 2.36L1.5 14h2.86l.58-2.5h3.41l.6 2.5h2.92L10.5 9.5H5.4l1.23-5.14v-2H5.01zM5.74 2.88l1.7 2.65 2.65-1.7-1.7-2.66-2.65 1.7zM10 10.34l2.95-2.35-2.35-2.95-2.95 2.35L10 10.34zM14.5 1.4L10.82.56 10 4.25l3.68.82.82-3.68z" fill="#EF2D5E"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/angular.svg b/devtools/client/debugger/images/sources/angular.svg
new file mode 100644
index 0000000000..7e26c391d6
--- /dev/null
+++ b/devtools/client/debugger/images/sources/angular.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M.97 3.07L7.9.6l7.12 2.43-1.15 9.18-5.97 3.3-5.88-3.26L.97 3.07z" fill="#E23237"/>
+ <path d="M15.03 3.03L7.91.6v14.91l5.97-3.3 1.15-9.18z" fill="#B52E31"/>
+ <path d="M7.92 2.34l-4.33 9.62 1.62-.03.87-2.17h3.88l.95 2.2 1.54.03-4.53-9.65zm0 3.08L9.4 8.48H6.64l1.29-3.06z" fill="#fff"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/babel.svg b/devtools/client/debugger/images/sources/babel.svg
new file mode 100644
index 0000000000..7a64bfb93e
--- /dev/null
+++ b/devtools/client/debugger/images/sources/babel.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M8.71 2.45c-.68.17-1.36.37-2.02.65-.05.03-.15.02-.17.06-.18.19-.5.3-.69.46a1.5 1.5 0 0 1-.28.17c-.06.02-.33.16-.33.23 0 .06.37 0 .37.04l-.27.24c-.24.2-.51.46-.8.57-.06.02-.27.33-.55.33-.08 0-.08 0-.08.27v.26c.12 0 .35.16.43.13.19-.1.34-.3.5-.44.16-.12.2-.04.34 0 .04 0 .1-.01.2-.08.34-.22.83-.65 1.24-.76.07 0 .2-.1.24.03.02.08-.16.6-.34 1-.37.8-.67 1.64-1.03 2.44l-1.04 2.27c-.24.53-1.06 2.17-1.19 2.4-.16.28-.31.57-.48.85-.04.07 0 .5.04.57.13.16.4-.18.53-.05.12.1-.3.65-.33.82-.02.1.06.1.16-.03.2-.25.2-.25.12-.05-.13.28-.16.42-.11.42.1 0 .56-.61.8-1.04.1-.17.13-.2.3-.22.26-.1.55-.16.8-.27.6-.23 1.19-.51 1.81-.65 1.02-.46 1.71-.88 2.58-1.5.44-.32.87-.6 1.28-.95.77-.65 1.2-1.34 1.25-2.02a.58.58 0 0 0-.07-.35c-.1-.2-.22-.37-.36-.54-.1-.1-.38-.35-.38-.47 0-.28 1.24-1.03 1.36-1.14.15-.13.31-.3.36-.35.19-.28.33-.83.36-1.38.01-.35-.14-.6-.27-.88-.2-.34-.51-.6-.88-.76a3.5 3.5 0 0 0-1.21-.4c-.2-.03-.43 0-.63-.05-.44-.1-1.18.08-1.56.17zm1.3 1.38c.15 0 .93-.12.93-.03 0 .03.4.08.5.35.04.1.12.1.1 0-.03-.14.02-.17.15-.1.13.1.14.1.07.29-.07.2-.22.34-.22.2 0-.05-.1-.1-.1-.02-.04.28-.2.46-.37.68-.35.46-.9.9-1.4 1.2-.38.28-.82.38-1.26.56l-.92.39c-.07.02-.07 0-.04-.07.11-.3.21-.86.41-1.08.03-.03.15-.3.28-.57l.65-1.46c.05-.13.12-.24.14-.24.06 0 .23-.1.3-.1.22-.07.5.02.79 0h-.01zm.25 4.7a3.2 3.2 0 0 1-.32.76c-.24.35-.69.6-1.03.87-.52.4-1.08.82-1.68 1.1-.47.33-.99.53-1.5.78l-.39.18c-.05 0-.39.13-.38.1l.8-1.6c.44-.88.81-1.6.83-1.61.1-.08.33-.07.46-.1.82-.16 1.52-.61 2.18-.65.3-.01.79.08 1.03.17z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/backbone.svg b/devtools/client/debugger/images/sources/backbone.svg
new file mode 100644
index 0000000000..0dab163ecb
--- /dev/null
+++ b/devtools/client/debugger/images/sources/backbone.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M8 4.64L3 1.79V14.2l5-2.85 5 2.85V1.8L8 4.64zM5.5 8L8 6.58 10.5 8 8 9.42 5.5 8zm-.85-3.48l1.79 1.01-1.79 1.02V4.52zm0 4.93l1.65.94-1.65.94V9.45zm6.7 1.88l-1.65-.94 1.65-.94v1.88zm-1.79-5.8l1.78-1.01v2.03L9.56 5.53z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/choo.svg b/devtools/client/debugger/images/sources/choo.svg
new file mode 100644
index 0000000000..efeae2ed99
--- /dev/null
+++ b/devtools/client/debugger/images/sources/choo.svg
@@ -0,0 +1,14 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="16" height="16">
+ <path d="M190.47 376V203.3H81.27c-27.13 0-50.14 26-58.23 62.04-9.87 1.3-17.62 13.54-17.62 28.46 0 14.91 7.75 27.15 17.62 28.45 7.3 32.51 26.74 56.84 50.39 61.3v68.67h395.95V376h-278.9z" fill="#132028"/>
+ <path d="M490.71 427.98a56.02 56.02 0 0 1-110.04 14.83 56.04 56.04 0 0 1-110.05-14.83 56.02 56.02 0 0 1 110.05-14.84 56.04 56.04 0 0 1 110.04 14.84zM161.24 203.3l29.75-113.85H94.23l29.75 113.85h-13.67C76.45 203.3 49 243.82 49 293.8c0 49.97 27.46 90.49 61.32 90.49h183.96V203.3H161.24zm1.08 217.12a31.8 31.8 0 0 0-29.28 19.4 31.8 31.8 0 1 0 0 24.76 31.8 31.8 0 1 0 29.28-44.16z" fill="#575A5B"/>
+ <path d="M200.78 384.29h-16.03c-20.1 0-36.4-40.52-36.4-90.5 0-49.97 16.3-90.48 36.4-90.48h16.03c-20.1 0-36.4 40.51-36.4 90.49 0 49.97 16.3 90.49 36.4 90.49zm-78.54-90.5c0-49.97 16.3-90.48 36.4-90.48H142.6c-20.1 0-36.4 40.51-36.4 90.49 0 49.97 16.3 90.49 36.4 90.49h16.03c-20.1 0-36.4-40.52-36.4-90.5z" fill="#FFB636"/>
+ <path d="M489.35 384.29H294.27V85.76h195.08V384.3zm-415.14-.19h-7.99c-2.44 0-4.7 1.48-6.03 3.94l-43.64 80.6c-3.11 5.75.32 13.36 6.04 13.36H75.4c4.03 0 7.27-3.97 7.2-8.8l-1.2-80.6c-.07-4.72-3.27-8.5-7.2-8.5z" fill="#FF473E"/>
+ <path d="M497.28 66.4H286.34c-5.92 0-10.72 4.8-10.72 10.72v1.62c0 5.92 4.8 10.72 10.72 10.72h210.94c5.92 0 10.72-4.8 10.72-10.72v-1.62c0-5.92-4.8-10.72-10.72-10.72z" fill="#EF2020"/>
+ <path d="M371.47 257.52H330.5a7.2 7.2 0 0 1-7.2-7.2v-126.3a7.2 7.2 0 0 1 7.2-7.2h40.96a7.2 7.2 0 0 1 7.2 7.2v126.3a7.2 7.2 0 0 1-7.2 7.2zm89-7.2v-126.3a7.2 7.2 0 0 0-7.2-7.2h-40.95a7.2 7.2 0 0 0-7.2 7.2v126.3a7.2 7.2 0 0 0 7.2 7.2h40.95a7.2 7.2 0 0 0 7.2-7.2z" fill="#76DFFF"/>
+ <path d="M489.35 339.59H294.27V303h195.08v36.59zM111.17 52L94.21 89.46h96.75L174 52h-62.83zm215.47 362.95a13.02 13.02 0 1 0 0 26.05 13.02 13.02 0 0 0 0-26.05zm108.05 0a13.02 13.02 0 1 0 0 26.05 13.02 13.02 0 0 0 0-26.05zm-330.94 29.88a7.39 7.39 0 1 0 0 14.77 7.39 7.39 0 0 0 0-14.77zm58.57 0a7.39 7.39 0 1 0 0 14.77 7.39 7.39 0 0 0 0-14.77z" fill="#132028"/>
+ <path d="M196.7 444.2h-92.95a8.9 8.9 0 1 1 0-17.77h90.45l36.76-22.53c1.4-.86 3-1.31 4.65-1.31h223.93a8.9 8.9 0 1 1 0 17.78H238.11l-36.76 22.53c-1.4.86-3 1.3-4.64 1.3z" fill="#FFB636"/>
+ <path d="M69.85 393.08a10.5 10.5 0 0 1-.03-21l413.93-1h.02a10.5 10.5 0 0 1 .03 21l-413.93 1h-.02z" fill="#ADB7BC"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/coffeescript.svg b/devtools/client/debugger/images/sources/coffeescript.svg
new file mode 100644
index 0000000000..4db88c2d0d
--- /dev/null
+++ b/devtools/client/debugger/images/sources/coffeescript.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill">
+ <path d="M6.46 4.08c1.33-.12 1.7-.97 3.26-1.12.76-.07 1.25.1 1.3.35.04.25-.34.42-.8.46-.64.07-.91-.17-.96-.39-.46.05-.54.25-.52.4.05.27.63.53 1.6.44 1.12-.09 1.48-.52 1.39-.96-.12-.57-.97-1.05-2.5-.91-1.97.18-1.96 1.08-3.28 1.2-.55.04-.86-.09-.91-.3-.04-.22.22-.32.54-.34.3-.03.65.02.82.1.13-.06.17-.12.15-.2-.05-.2-.46-.3-.97-.25-.99.1-.99.54-.95.73.12.54.88.88 1.83.79zm6.65 2.24c-1.22.29-2.79.47-4.68.47-1.92 0-3.48-.2-4.71-.47-1.1-.28-1.68-.59-1.89-.9.1.71.29 1.4.53 2.06-.28.17-.54.4-.77.69A2.66 2.66 0 0 0 1 9.97c.04.63.34 1.14.83 1.54a2 2 0 0 0 1.68.4c.24-.04.52-.18.75-.25-.5 0-.94-.17-1.37-.5-.47-.35-.8-.84-.86-1.42-.12-.54 0-1.05.3-1.5.07-.09.14-.15.22-.22.17.43.37.84.59 1.24.47.71.94 1.34 1.4 2 .21.4.35.8.44 1.19.3.43.75.74 1.3.9a6.2 6.2 0 0 0 2.09.33h.07c.72 0 1.47-.12 2.16-.35.51-.17.95-.45 1.26-.9h.04c.08-.35.2-.78.4-1.17.46-.68.94-1.3 1.4-2.02A12.22 12.22 0 0 0 15 5.43c-.24.34-.83.66-1.89.9zm-9.4-.98c1.24.3 2.8.46 4.69.46 1.92 0 3.45-.17 4.68-.46 1.3-.31 1.92-.72 1.92-1.1 0-.28-.28-.54-.8-.74.12.08.2.2.2.34 0 .4-.58.71-1.76.97-1.1.24-2.5.41-4.2.41-1.65 0-3.12-.17-4.18-.4-1.13-.28-1.73-.59-1.73-.97 0-.17.08-.3.3-.47-.71.29-1.09.51-1.09.87.04.4.67.8 1.98 1.09z"></path>
+</svg>
diff --git a/devtools/client/debugger/images/sources/dojo.svg b/devtools/client/debugger/images/sources/dojo.svg
new file mode 100644
index 0000000000..277866813a
--- /dev/null
+++ b/devtools/client/debugger/images/sources/dojo.svg
@@ -0,0 +1,4 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><style>.cls-1{isolation:isolate;}.cls-17,.cls-2,.cls-25{fill:none;}.cls-17,.cls-2{stroke-miterlimit:10;}.cls-2{stroke-width:0.75px;stroke:url(#linear-gradient);}.cls-3{fill:url(#linear-gradient-2);}.cls-4{fill:#f15a24;}.cls-5{fill:#ed1c24;}.cls-6{fill:#c1272d;}.cls-7{fill:url(#linear-gradient-3);}.cls-8{fill:url(#linear-gradient-4);}.cls-9{fill:url(#linear-gradient-5);}.cls-10{fill:url(#linear-gradient-6);}.cls-11{opacity:0.49;fill:url(#linear-gradient-7);}.cls-12{fill:url(#linear-gradient-8);}.cls-13{fill:#2db5f9;}.cls-13,.cls-14{mix-blend-mode:screen;}.cls-14{fill:#5fd2ff;}.cls-15{fill:#219058;}.cls-16{fill:url(#linear-gradient-9);}.cls-17{stroke:#fff;stroke-width:1.87px;}.cls-18{fill:#f7b852;}.cls-19{fill:#ff8431;}.cls-20{fill:#fffb69;}.cls-21{fill:#44c688;}.cls-22{fill:#29b36e;}.cls-23{fill:#6fd191;}.cls-24{fill:#c83ad7;}.cls-26{fill:#fba9ff;}.cls-27{fill:#ff737d;}.cls-28{fill:#fdc666;}</style><linearGradient id="linear-gradient" x1="67.45" y1="154.72" x2="67.29" y2="155.43" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ff1d25" stop-opacity="0.5"/><stop offset="0.06" stop-color="#ff1d25" stop-opacity="0.54"/><stop offset="0.37" stop-color="#ff1d25" stop-opacity="0.74"/><stop offset="0.64" stop-color="#ff1d25" stop-opacity="0.88"/><stop offset="0.86" stop-color="#ff1d25" stop-opacity="0.97"/><stop offset="1" stop-color="#ff1d25"/></linearGradient><linearGradient id="linear-gradient-2" x1="73.09" y1="170.74" x2="73.09" y2="153.5" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdd42"/><stop offset="1" stop-color="#fb784b"/></linearGradient><linearGradient id="linear-gradient-3" x1="201.52" y1="95.13" x2="207.88" y2="89.89" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5bcb99"/><stop offset="1" stop-color="#85a8e8"/></linearGradient><linearGradient id="linear-gradient-4" x1="81.17" y1="158.3" x2="279.32" y2="55.49" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#34e28b"/><stop offset="1"/></linearGradient><linearGradient id="linear-gradient-5" x1="117.57" y1="178.22" x2="133.15" y2="178.22" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#c297ff"/><stop offset="1" stop-color="#ae31bb"/></linearGradient><linearGradient id="linear-gradient-6" x1="54.05" y1="253.29" x2="251.08" y2="99.63" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="1" stop-color="#d23de2"/></linearGradient><linearGradient id="linear-gradient-7" x1="199.8" y1="86.45" x2="191.83" y2="113.37" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="1" stop-opacity="0"/></linearGradient><linearGradient id="linear-gradient-8" x1="126.87" y1="190.63" x2="182.9" y2="204.2" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2db5f9"/><stop offset="1" stop-color="#092432"/></linearGradient><linearGradient id="linear-gradient-9" x1="83.08" y1="49.55" x2="46.06" y2="151.24" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="0.21" stop-color="#48080a"/><stop offset="0.42" stop-color="#891014"/><stop offset="0.61" stop-color="#bc151b"/><stop offset="0.78" stop-color="#e01a21"/><stop offset="0.91" stop-color="#f71c24"/><stop offset="1" stop-color="#ff1d25"/></linearGradient></defs><title>dojo_square</title><g class="cls-1"><g id="Layer_1" data-name="Layer 1"><line class="cls-2" x1="67.37" y1="155.08" x2="67.37" y2="155.08"/><path class="cls-3" d="M42.28,150.4l.52.82A58,58,0,0,0,52,161.49a45.23,45.23,0,0,0,28.74,10.25c.65,0,1.31,0,2,0a67.32,67.32,0,0,0,21.13-5.26,67.38,67.38,0,0,1-9.09.83,36.92,36.92,0,0,1-27.44-12.17A66.82,66.82,0,0,1,42.28,150.4Z"/><path class="cls-4" d="M80.79,80.88a45.4,45.4,0,0,1,38.89,21.94A37,37,0,0,0,84.43,94.7c8.29,4,19.66,7.08,35.28,8.15,0,0-.77-14.87-19.8-22.64-26.57-10.84-30.33-8.69-37.06-19.9a30.09,30.09,0,0,0,6,22.15A45.45,45.45,0,0,1,80.79,80.88Z"/><path class="cls-5" d="M99.92,80.21c-9.1-3.71-15.52-5.9-20.3-7.62A33.4,33.4,0,0,0,84.54,81a45.42,45.42,0,0,1,35.13,21.78,36.87,36.87,0,0,0-20.54-9.34,109,109,0,0,0,20,9.32l.59,0S118.94,88,99.92,80.21Z"/><path class="cls-6" d="M119.69,102.85h.1c.29-1.62,2.07-14.46-12.4-25.7C85.78,60.37,81.56,58.82,80.53,49.94a27.8,27.8,0,0,0-.91,22.65c4.78,1.72,11.21,3.91,20.3,7.62,19,7.77,19.8,22.64,19.8,22.64Z"/><path class="cls-7" d="M185.28,88.22a33.64,33.64,0,0,1,22.08,8.23,29.8,29.8,0,0,1,19,8S208.22,78,176.19,89a41.72,41.72,0,0,0-8.2,4A33.64,33.64,0,0,1,185.28,88.22Z"/><path class="cls-8" d="M185.28,88.22A33.62,33.62,0,0,0,168,93l.93-.56c-25.88,15.24-57.6,62.06-101.56,62.65h0a36.92,36.92,0,0,0,27.44,12.17,67.38,67.38,0,0,0,9.09-.83c28.6-11.79,56.09-40,68.55-53.64,11.56-12.67,24.22-17,34.91-16.34A33.64,33.64,0,0,0,185.28,88.22Z"/><path class="cls-9" d="M118.48,179a20.94,20.94,0,0,0-.92,5.86,22.25,22.25,0,0,0,1,6.74,16.56,16.56,0,0,1,5.5-14.74c0-.17.09-.34.14-.51a20.37,20.37,0,0,1,8.91-11.47l-.08,0a37.84,37.84,0,0,0-4,1.53A20.87,20.87,0,0,0,118.48,179Z"/><path class="cls-10" d="M234.26,129.11a42.41,42.41,0,0,0-7.94-24.76,29.82,29.82,0,0,0-19-7.9A33.69,33.69,0,0,1,219.06,122c0,11.34-4.12,24.3-17.45,31.28-19.42,10.16-49.21,5.33-68.54,11.6l.08,0a20.37,20.37,0,0,0-8.91,11.47c-.05.17-.09.34-.14.51h0c5.67-5,16.84-8.54,38.63-5.73,15.56,2,27.93,2.55,38.54-.5a41.2,41.2,0,0,0,25.23-17h0A42.41,42.41,0,0,0,234.26,129.11Z"/><path class="cls-11" d="M234.26,129.11a42.41,42.41,0,0,0-7.94-24.76,29.82,29.82,0,0,0-19-7.9A33.69,33.69,0,0,1,219.06,122c0,11.34-4.12,24.3-17.45,31.28-19.42,10.16-49.21,5.33-68.54,11.6l.08,0a20.37,20.37,0,0,0-8.91,11.47c-.05.17-.09.34-.14.51h0c5.67-5,16.84-8.54,38.63-5.73,15.56,2,27.93,2.55,38.54-.5a41.2,41.2,0,0,0,25.23-17h0A42.41,42.41,0,0,0,234.26,129.11Z"/><path class="cls-12" d="M137.8,201.88a20.44,20.44,0,0,1-13.68-25.12h0l0,.08a16.56,16.56,0,0,0-5.5,14.73,20.94,20.94,0,0,0,33.63,9.38A20.37,20.37,0,0,1,137.8,201.88Z"/><path class="cls-13" d="M144.91,200.4c2.12-6.17,9-15.7,16.33-11.34,0,0,6,3.36,7.23-6.11,0,0,4.49,22.28-17.1,21.53,0,0,4.86-3.55,4.81-7.2A24.73,24.73,0,0,1,144.91,200.4Z"/><path class="cls-14" d="M153.52,186.75c2.14-1.09,4.16-2.18,8.08-.44,3,1.35,6.88-3.94,3.56-8.66,0,0,.21,4.88-3.72,4.84A8.81,8.81,0,0,0,153.52,186.75Z"/><path class="cls-15" d="M175.21,115.88c-5.17,7-12.75,12.95-13.64,14.39s1.5,6.11,5,6.45.82-1.36.52-3,1.06,1,5.27.42-1.53-2.2-1.14-4.33,4.74-6.17,6.47-10.25,4.7,0,3.18,3.18c-.6,1.26,4.81-3.54,2.08-7.21S178.22,111.77,175.21,115.88Z"/><path class="cls-15" d="M160.47,131.28c-.76.73-3,2.37-3,2.37s2.19,3.05,5,3c0,0,.61-.29-.27-1.18S160.27,131.82,160.47,131.28Z"/><path class="cls-16" d="M84.43,94.7c-7.35-3.56-12.27-7.88-15.54-12.24A45.42,45.42,0,0,0,42.28,150.4a66.82,66.82,0,0,0,25.09,4.67h0A37,37,0,0,1,84.43,94.7Z"/><line class="cls-17" x1="67.37" y1="155.08" x2="67.37" y2="155.08"/><path class="cls-18" d="M84.52,81c2,2.91,7.81,7.94,14.63,12.44a36.87,36.87,0,0,1,20.52,9.33A45.42,45.42,0,0,0,84.52,81Z"/><path class="cls-19" d="M84.52,81c-1.23-.1-2.48-.16-3.74-.16a45.45,45.45,0,0,0-11.89,1.58c3.27,4.36,8.19,8.67,15.54,12.24a36.72,36.72,0,0,1,14.72-1.22C92.33,89,86.54,83.95,84.52,81Z"/><path class="cls-20" d="M109.73,91.38a33.29,33.29,0,0,0-12.21-7.29C100.46,89.66,103,91.38,109.73,91.38Z"/><path class="cls-6" d="M96.89,67.66a63.16,63.16,0,0,1,6.54,4.58c.52.39-.93-3.55-2.62-4.3A7.5,7.5,0,0,0,96.89,67.66Z"/><path class="cls-6" d="M105,73.37a70.75,70.75,0,0,1,6.5,4.64c.53.38-.9-3.56-2.57-4.33A7.5,7.5,0,0,0,105,73.37Z"/><path class="cls-6" d="M112.55,79a19.59,19.59,0,0,1,3.52,4.39c.26.38.07-2.58-.92-3.42A5.28,5.28,0,0,0,112.55,79Z"/><path class="cls-21" d="M77.55,151c-.2-.65,2.35-1.48,3-1.51a11.91,11.91,0,0,1,3.57,1.19,16.34,16.34,0,0,1-4.89,1A4.46,4.46,0,0,1,77.55,151Z"/><path class="cls-21" d="M86.73,148.78c-.22-.51,1.75-1.38,2.29-1.46a9.58,9.58,0,0,1,3,.65,13.15,13.15,0,0,1-3.83,1.23A3.59,3.59,0,0,1,86.73,148.78Z"/><path class="cls-21" d="M94.41,146c-.22-.4,1.32-1.29,1.76-1.41a7.92,7.92,0,0,1,2.48.27,10.87,10.87,0,0,1-3,1.35A3,3,0,0,1,94.41,146Z"/><path class="cls-21" d="M100.52,143.19c-.23-.35,1.11-1.27,1.5-1.41a7.25,7.25,0,0,1,2.29.07,10,10,0,0,1-2.67,1.45A2.72,2.72,0,0,1,100.52,143.19Z"/><path class="cls-21" d="M106.23,140.07c-.22-.29.9-1.16,1.24-1.3a6.31,6.31,0,0,1,2,0,8.66,8.66,0,0,1-2.25,1.39A2.36,2.36,0,0,1,106.23,140.07Z"/><path class="cls-21" d="M68.34,151.69c-.11-.73,2.73-1.16,3.46-1.09a12.76,12.76,0,0,1,3.57,1.86,17.51,17.51,0,0,1-5.35.26A4.78,4.78,0,0,1,68.34,151.69Z"/><path class="cls-6" d="M70.08,65.82c2,2.27,6.68,3.74,6.68,3.74A19,19,0,0,1,75.83,62c0-.18-5.75-.09-6.73-4.81C68.91,56.23,68.1,63.55,70.08,65.82Z"/><path class="cls-4" d="M50.54,174.68a5.49,5.49,0,0,1,2.24-3.88l.19-.11a14,14,0,0,0-1.43-.25c-6.85-1-8.59,3.06-8.95,7.64,0,.26,0,.53,0,.78a8.31,8.31,0,0,1,7.89-4.2Z"/><path class="cls-4" d="M58.88,173.19c-6.81-4.13-10.63-4.43-12.15,7.14,0,0,7.17-5.67,10.55-1.92,3.68,4.07,8.68.32,6.05-2.06A18.77,18.77,0,0,0,58.88,173.19Z"/><path class="cls-4" d="M56.06,174.53c-3.86,2.57-3.86,8.62-3.86,8.62s7-3.81,6.5-6.19A2.93,2.93,0,0,0,56.06,174.53Z"/><path class="cls-4" d="M24,127a5.49,5.49,0,0,1,4.43-.68l.2.08a14,14,0,0,0-.7-1.27c-3.49-6-7.76-4.79-11.56-2.21-.22.15-.43.31-.63.47a8.31,8.31,0,0,1,8.21,3.53Z"/><path class="cls-4" d="M31.29,134.08c-2.48-9.82-4.47-13.62-14-6.83,0,0,8.13-2.34,9.06,9.22.44,5.47,5.69,6.57,5.63,3A18.77,18.77,0,0,0,31.29,134.08Z"/><path class="cls-4" d="M27.83,128.82c-4.52-1.07-8.94,3.06-8.94,3.06s6.94-.24,7.78,4C27.14,138.23,27.83,128.82,27.83,128.82Z"/><path class="cls-22" d="M172.45,112.79a55.39,55.39,0,0,1,15.49-12.5c5.64-3,13.66-4.84,18.5-4.61l1.85,1.59-1-.08a37.75,37.75,0,0,0-19,3.76A55,55,0,0,0,172.45,112.79Z"/><path class="cls-23" d="M207.12,95.74a34.5,34.5,0,0,1,10.45,2.68,27.42,27.42,0,0,1,8.81,6,27.05,27.05,0,0,0-9.09-5.29,43.65,43.65,0,0,0-9-1.84l-1.84-1.59Z"/><path class="cls-24" d="M124.52,175.47a27.43,27.43,0,0,1,3.11-1.9,25.35,25.35,0,0,1,2.31-1c.78-.34,1.58-.58,2.38-.84a45.63,45.63,0,0,1,9.84-1.81,95.67,95.67,0,0,1,19.84.78,194.33,194.33,0,0,0,19.66,1.89,66.25,66.25,0,0,0,19.6-1.93,66.44,66.44,0,0,1-19.6,2.3,194.82,194.82,0,0,1-19.75-1.52,94.77,94.77,0,0,0-19.65-.41,44.43,44.43,0,0,0-9.55,1.94c-.76.27-1.53.52-2.27.85a24,24,0,0,0-2.18,1,21.38,21.38,0,0,0-3.93,2.7l-.53.47A18.42,18.42,0,0,1,124.52,175.47Z"/><line class="cls-25" x1="124.09" y1="176.84" x2="124.09" y2="176.84"/><path class="cls-6" d="M85.66,97.64c-6.36,1.4-5.37,6.45-5.37,6.45s2-2.43,13.09-3.74A52.36,52.36,0,0,1,85.66,97.64Z"/><path class="cls-26" d="M118.59,191.58a16.4,16.4,0,0,1-.08-4.24,18.64,18.64,0,0,1,.91-4.18,18.86,18.86,0,0,1,1.87-3.9,19.81,19.81,0,0,1,2.78-3.38l.46-.42s-.63,2-.7,2.51a19.27,19.27,0,0,0-1.61,1.93,17.84,17.84,0,0,0-3.33,7.5A16.22,16.22,0,0,0,118.59,191.58Z"/><path class="cls-27" d="M65.89,155.08c-3.61-4-6.65-10.29-7.95-16.2a36.79,36.79,0,0,1-.82-9.49l.14-2.38.33-2.36a23,23,0,0,1,.47-2.33,19.65,19.65,0,0,1,.6-2.3,35.6,35.6,0,0,1,3.83-8.64,39.45,39.45,0,0,1,2.68-3.89l1.53-1.8c.51-.6,1.1-1.13,1.64-1.69a37.2,37.2,0,0,1,7.47-5.68,39.82,39.82,0,0,1,8.62-3.62A39.67,39.67,0,0,0,76,98.56a36.78,36.78,0,0,0-7.22,5.83c-.52.57-1.08,1.11-1.56,1.71l-1.45,1.81a38.67,38.67,0,0,0-2.51,3.89,34.62,34.62,0,0,0-3.48,8.52,18.77,18.77,0,0,0-.52,2.24,21.9,21.9,0,0,0-.38,2.27l-.25,2.28-.06,2.3a35.25,35.25,0,0,0,1.06,9.07,36.17,36.17,0,0,0,8.62,15.83l.66.71S66.44,155.12,65.89,155.08Z"/><path class="cls-28" d="M103.89,166.42A47.14,47.14,0,0,1,94,167.55,37.09,37.09,0,0,1,84,165.91,46.7,46.7,0,0,1,74.71,162a34.57,34.57,0,0,1-8.12-6.17l-.69-.74s2.38,0,3-.06a33.57,33.57,0,0,0,6.72,5.5,45.26,45.26,0,0,0,8.82,4.27A36.2,36.2,0,0,0,94,166.91,47.78,47.78,0,0,0,103.89,166.42Z"/></g></g></svg>
diff --git a/devtools/client/debugger/images/sources/ember.svg b/devtools/client/debugger/images/sources/ember.svg
new file mode 100644
index 0000000000..3b9ba80edf
--- /dev/null
+++ b/devtools/client/debugger/images/sources/ember.svg
@@ -0,0 +1,4 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="2500" height="2393" viewBox="0.1 31.4 256 244.5" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet"><path fill="#FFF" d="M57.9 219.3l.6-1.5.1-.2c.5-1.2 1-2.5 1.5-3.7.6-1.6 1.2-3.3 1.8-4.9.4-.9.7-1.8 1-2.8.8-2.2 1.9-5.1 3.2-7.9.8-1.7 1.4-2.9 2.1-4 .8-1.3 1.6-2.5 2.5-3.7l.7-1 1.1-.7c.1-.1.3-.2.5-.3.5-.3 1.1-.5 1.5-.7.7-.3 1.6-.6 2.6-.9 1.4-.4 3-.8 4.9-1.2 2.8-.6 5.8-1.2 9.6-1.8 5.7-.9 11.8-1.7 19.1-2.5 12.9-1.4 25.8-2.4 38.2-3 6.6-.3 11.6-.4 16.3-.4h3c3.1.1 6.7.2 10 .7 1.2.2 2.3.4 3.1.7.3.1.6.2.7.3l1 .4.8.7.9.9c1.1 1.1 2.3 2.4 3.5 3.9 3.8 4.8 7.2 10.6 10.2 17.2 2.9 6.4 4.7 12.1 5.8 17.7l1.5 7.9h-18.4l-1.1-5.3c-1.2-5.6-16.3-20.4-23.8-23.3-.8-.3-4-1.2-13.9-1.2-20.4 0-49.2 3.6-53.3 4.5-4.9 2.3-12.4 11.9-16.7 21.5l-1.8 3.9"/><path fill="#BA8449" d="M182.9 190.1c-.9-1.2-1.9-2.3-3-3.3l-.7-.7s-.1 0-.2-.1c-.5-.2-1.2-.3-1.9-.4-2.9-.4-6-.5-9.1-.6-6.3-.1-12.6.1-18.9.4-12.6.6-25.3 1.6-37.8 3-6.3.7-12.6 1.5-18.8 2.5-3.1.5-6.2 1-9.2 1.7-1.5.3-3 .7-4.4 1.1-.7.2-1.4.4-2 .7-.3.1-.6.2-.7.4 0 0-.1 0-.1.1-.7 1-1.4 2-2.1 3.1-.7 1.1-1.2 2.3-1.8 3.5-1.1 2.4-2.1 4.9-3 7.4s-1.9 5.1-2.8 7.7c-.5 1.3-1 2.6-1.6 3.9-.2.6-.5 1.2-.8 1.8h8.5c4.6-10.3 13.3-22.1 20.5-25 2-.8 34.2-4.8 55.5-4.8 7.9 0 13.3.6 16.3 1.7 8.7 3.4 26.1 19.5 27.9 28.2h4.9c-1-5.5-3-10.9-5.3-16.1-2.6-6-5.7-11.5-9.4-16.2"/><path fill="#FFF" d="M179.1 185.9z"/><path fill="#BA8449" d="M179.1 185.9z"/><path fill="#FFF" d="M192.1 228.6l-1-5.4c-.9-4.5-2.4-9.3-4.8-14.6-2.6-5.6-5.4-10.5-8.6-14.4-.6-.8-1.2-1.5-1.8-2.1-2.5-.4-5.4-.4-8-.5h-2.8c-4.5 0-9.3.1-15.7.4-12.2.6-24.7 1.6-37.4 3-7.1.8-13 1.6-18.4 2.4-3.5.5-6.3 1.1-8.8 1.6-1.6.4-2.8.7-3.9 1-.2 0-.3.1-.4.1-.2.4-.5.7-.7 1.1-.5.8-.9 1.7-1.6 2.9-1.1 2.3-2 4.7-2.8 6.8-.4.9-.7 1.8-1 2.7-.6 1.7-1.2 3.4-1.9 5.1-.5 1.3-1.1 2.6-1.6 4l-.1.2c-.2.6-.5 1.2-.7 1.7l-1.8 4H56.6l-1.7-.8-.2-.1c-4-2.3-4-5.7-3.9-7.1v-.3l.2-.9.3-1.1c.2-.7.4-1.5.6-2.2.4-1.5.9-2.9 1.4-4.3.9-2.6 2-5.4 3.3-8.4 1.4-3.1 2.7-5.8 4.2-8.3.7-1.3 1.5-2.6 2.5-4.1.9-1.4 1.9-2.8 2.9-4.1.9-1.1 1.7-1.8 2.3-2.2h.1c.6-.5 1.2-.8 1.5-.9.9-.5 1.6-.8 2.1-1 1.2-.5 2.3-.8 3.2-1.1 2-.6 3.9-1 5.3-1.3 2.9-.6 6-1.2 9.9-1.8 5.8-.9 11.9-1.6 19.4-2.4 13-1.3 26-2.3 38.6-2.8 6-.2 10.7-.4 15-.4h4.6c3.2.1 6.8.2 10.7.8h.1c.9.2 2.3.4 3.9.9h.1c.4.2 1 .4 1.7.7.5.3.9.5 1.2.7l.5.4.4.3.4.4 1.1 1.1c1.3 1.3 2.5 2.7 3.8 4.4 4 5.2 7.5 11.2 10.7 18.3 1.5 3.3 2.8 6.6 3.8 9.8 1.1 3.5 1.9 6.8 2.5 10l1.2 7.7h-18.2v.1z"/><path fill="#FFF" d="M64.3 228.6l4.4-9.5c3.7-7.9 12.6-22.4 22.5-26.5l.2-.1c3.3-1.2 36.7-5.1 57.1-5.1 11.4 0 15.7 1.1 17.9 2 10.3 4 28.2 20.9 30.6 30.9l2 8.2H64.3z"/><path fill="#FFF" d="M185.4 228.6l-1.2-5.1c-1.1-4.7-15.2-18.8-22.5-21.7-.7-.3-3.6-1.1-13.2-1.1-19.6 0-48 3.5-52.6 4.4-3.8 1.9-10.7 10-15.2 19.6l-1.8 3.8H62.3l4.2-9.3c4.9-11 14.6-24.6 24.1-28.4 3.7-1.5 37.5-5.3 58-5.3 8.9 0 14.9.7 18.6 2.1 10.3 4 29.6 21.4 32 33l1.6 8h-15.4z"/><path fill="#FFF" d="M193.1 228.6l-1.9-1.8c-7.2-6.7-9.2-20.6-7-26.3 1.5-3.8 4.7-5.1 7.1-5.1.7 0 1.3.1 1.9.3 1.3-.1 4.3-2.6 5.2-4 1.4-2.6 4.1-4.2 7.4-4.2 4.9 0 12.9 3.9 15.5 7.6 1.5 2.1 1.9 4.6 1.1 6.8-.1.2-.2.6-.4 1.1-2.7 8.1-6.2 18-9 22.6l-1.9 3.1-18-.1z"/><path fill="#FFF" d="M192.5 228.6l6.2-10.1c3-4.9 5.1-8.9 6.5-12-3.5 2.5-8.4 4-15.7 4.4l-.2-.2-.1.7c-4.3 0-7.8-3.5-8-7.8-.1-2.1.7-4.2 2.1-5.8 1.4-1.6 3.4-2.5 5.5-2.6 7.2-.3 8.1-2 9.4-4.5 1.8-3.4 5.7-5.4 10.8-5.4 1.3 0 2.6.1 3.8.4 6.3 1.4 10.4 6.2 10.7 12.4.3 6.3-3.2 15.5-10.2 27.3l-1.9 3.2h-18.9z"/><path fill="#FFF" d="M218.8 208.9c-8.1 0-16.9-5.3-21.4-10.5-4.1-4.7-4.5-8.9-4.1-11.6.5-3.3 3.2-6.6 8.1-6.6.9 0 1.8.1 2.6.2.8-3.6 2.7-11.1 10.4-11.1h1.1c3.7.4 6.5 2.7 7.6 6.2 1.2-.6 2.6-1.1 4.2-1.1 2.4 0 4.7 1 6.4 2.8 2.7 2.9 3.3 6.9 1.6 10.7 1.8 1.1 3.2 2.8 3.8 5 .8 2.8.3 5.8-1.5 8.2-3.5 4.9-11.6 7.2-18 7.4-.4.4-.6.4-.8.4M210.8 44.2c-7.3 4.6-15.3 15.1-25.1 29.5-1.5 2.3-4 3.5-6.8 3.5-3.6 0-8.2-2.2-13.5-6.5-8.4-6.8-8.6-10.6-8.7-12.1-.2-4 2.8-7.4 7-7.8 8.1-.7 14.8-5.6 21.3-10.3 6.5-4.7 12.5-9 19.7-9 1.4 0 2.9.2 4.3.5"/><path fill="#FFF8EE" d="M164.3 57.5c19.6-1.8 31.1-22.1 43-19-8 5-15.9 15-27 31.4-2.7 3.9-21.4-11.9-16-12.4"/><path fill="#FFF" d="M37.3 48.2c4.9-4.5 11.5-6.8 19.6-6.8 7 0 15.3 1.7 24.6 5.1 2.5.9 5.8 1.1 8.3 1.1h3.7c2.3 0 7.2 0 9.3 4.5.7 1.7 1.6 5.2-1.1 9.3-3.3 5.1-12 10.5-20.4 10.5h-.4c-4.5-.1-8.7-2.5-13.6-5.2-6.1-3.4-13-7.3-21.2-7.3-1.1 0-2.3.1-3.4.2M188.1 96.7c-3.6 0-10.4-1.5-14.7-11.7-2.4-5.4-3.2-11.5-3.2-14.9 0-7 3.7-8.9 6-9.4 1.6-1.6 4.6-5.7 6.8-8.8 9.1-12.4 15.7-20.5 23.4-20.5 1.3 0 2.5.2 3.7.7 10.3 4.1 15.3 12.8 13.6 23.8-1.2 8.1-6.3 17.7-13.8 26.5-3.5 4.1-12.6 13.7-20.7 14.3h-1.1"/><path fill="#FFF" d="M69.9 100.5c-.9 0-1.8 0-2.6-.2-12.8-2.1-28.8-15-34.8-28.3-4.1-9.1-2.3-15.3 0-18.9 3.7-5.9 9.2-9 16-9 8.2 0 16.4 4.5 23.6 8.4 2.8 1.5 6.8 3.7 8.5 4.1.6-.2 1.2-.3 1.9-.3 2.6 0 5 1.4 6.4 3.8 3.3 5.8 1.3 21.4-3.9 30.4-3.6 6.6-9 10-15.1 10z"/><path fill="#FFF" d="M114.5 212.1c-30 0-59.7-14.7-69.6-25.4-10.3-11.1-14-23.7-11.2-37.5 2.4-11.3 8.7-21.4 14.2-30.4 3.8-6.2 7.4-12 8.4-16.2 12.2-53.9 42.8-60.8 68.1-60.8 1.6 0 3.3 0 5.2.1 53.9 1.6 59.3 27.6 62.5 43.2.6 2.9 1.2 5.6 1.9 7.4 18.1 44.4 21.1 71 10 89-10.9 17.7-34.8 26.4-82.4 30.3-2.3.2-4.7.3-7.1.3z"/><path fill="#FFF" d="M113.4 212.2c-30.6 0-58.9-15.2-68.4-25.5-10.3-11.1-14-23.7-11.2-37.5 2.4-11.3 8.7-21.4 14.2-30.4 3.8-6.2 7.4-12 8.4-16.2 12.2-53.9 42.8-60.8 68.1-60.8 1.6 0 3.3 0 5.2.1 53.9 1.6 59.3 27.6 62.5 43.2.6 2.9 1.2 5.6 1.9 7.4 17.8 43.7 20.7 70.1 9.8 88.1-12.5 20.7-41.9 27.4-82.1 31.2-2.8.3-5.6.4-8.4.4"/><path fill="#FFF" d="M191.3 174.6c.4-.9.8-1.9 1.2-2.8 4.1-9.8 7.2-18.4 2.3-23.9-5.8-6.4-30.3-18-52.1-28.2-41.7-19.7-67.5-32.4-71.2-45-.9-3.2-.5-6.5 1.2-9.3C79.9 54.1 100 42 127.5 42h.8c25.9.2 44.7 7.7 56 22.1 9.6 12.2 11.7 26.5 13.3 36.9.5 3.5 1.2 8 1.9 9.2 19.6 33.7 10.6 58.6 3.5 70.3l-11.7-5.9z"/><path fill="#FFF" d="M170.8 135.8c-10.1 0-27-2.5-32.8-8.1-4.6-4.4-6.3-11.7-8.1-18.8-.7-3-1.9-7.8-3-10h-.1c-.4 1.1-.9 2.5-1.3 3.6-2.7 7.6-6.5 18.1-14.4 23.8-3.4 2.5-15.7 4.7-25.2 4.7s-16.7-2-21.5-6.1c-6.9-5.8-12.1-16.5-15.6-31.8-.2-.1-.3-.2-.5-.3-1.6-1.1-3.7-2.4-4.8-4.7-1.8-3.6-1.1-10 .8-13.4 1.4-2.5 3.8-4.1 6.4-4.3h.9c1.4 0 2.8.2 4.4.5s3.5.6 5.1.6h.9c9.5-1.4 18.4-2 26.5-2 19.7 0 30.1 4 34 5.6.3.1.6.2.8.3 1.1.3 3.2.7 5.4.7.8 0 1.6 0 2.3-.2 8.9-1.4 17.4-2 25.2-2 20.8 0 31.8 4.7 36.6 6.8.4.2.8.4 1.1.4h.4c1.3 0 3.2-.4 4.8-.7 1.2-.3 2.4-.5 3.5-.7h.9c3.1 0 5.9 1.8 7.6 4.8 1.9 3.5 3.2 10.8.5 15-1.8 2.8-4.7 4.1-7.1 5.2-.3.1-.7.3-1 .5-.8 1.4-2.2 4.2-3.4 6.5-3.5 6.8-7.4 14.6-11 18.8-3.2 3.6-9.2 5.3-18.3 5.3"/><defs><path id="a" d="M42.5 75H212v59.2H42.5z"/></defs><clipPath id="b"><use href="#a" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#b)"><path fill="#FFF" d="M166.778 134.181c-8 0-19.3-1.2-27.4-6.9-4.6-3.3-6.7-9.9-9.6-20.5-.8-3-2-7.2-2.9-9.3-.5 1.2-1.1 2.8-1.6 4.1-3 8.1-7.1 19.1-14.6 23.7-3.9 2.4-16 4.6-25.4 4.6-10.1 0-17.4-2.3-21.6-6.7-10.7-11.2-12.8-21.9-14.1-28.2-.2-.9-.4-2.1-.6-2.8-6.3-3.3-6.7-8.2-6.6-10.3.3-3.9 3.3-6.8 7-6.8 2.5 0 4.1 1.2 5.3 2 .1.1.2.2.4.2.1 0 .4.1.5.2 1.6.5 6.3 1.8 7.3 7.9.2 1.1 1.8 7.5 4.4 14.2 4.1 10.7 7 12.5 7.3 12.6 3.4 1.2 7.4 1.8 11.9 1.8 7.4 0 13.6-1.6 16.1-2.4 1.5-2.3 4.5-8.3 6.6-12.4 6.3-12.5 7.4-14.4 10.1-15.8 1.5-.8 3.3-1.2 5.6-1.2 3 0 7.3.7 9.3 1.6 4.6 2 7 8 12.4 23.5 1 2.8 2.2 6.4 3 8.2 4 1.9 13.1 3.2 22.6 3.2 2.7 0 4.7-.1 6-.2.9-1.9 2.2-4.6 3.3-6.9 7.6-16.2 8.8-18.1 10.7-19.6 3.3-2.5 9.1-4.2 12.4-4.2 4.4 0 6.8 2.9 7.4 5.7 1.1 5.8-4.6 8-6.5 8.7-.5.2-1.2.5-1.7.7-.7 1.2-2 3.8-3 5.9-8.2 16-10.9 20.4-14 22.3-3.8 2.1-13 3.1-20 3.1"/></g><defs><path id="c" d="M45 70.7h33.4v16.2H45z"/></defs><clipPath id="d"><use href="#c" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#d)"><path fill="#FFF" d="M61.388 86.816c-1.2 0-3.5-.2-8.1-1.7-1.2-.4-2.3-.8-3-1.1-1.5-.6-5.4-2.1-5.4-6.7v-6.7h6.6c.9 0 1.5.2 2 .3 1.4.2 5.9.5 7.4.6l.9.1c1.2 0 4.9-.5 6.5-.7 2-.3 2.6-.4 3.4-.4h5.7l.9 5.6c.4 2.8-1.1 6.3-4.8 7.4-.2.1-.9.3-1.5.5-3.5 1.3-7 2.5-10 2.6-.2.2-.4.2-.6.2"/></g><defs><path id="e" d="M181 79.3h25.4v17.2H181z"/></defs><clipPath id="f"><use href="#e" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#f)"><path fill="#FFF" d="M193.488 96.41c-2.2 0-4.4-.9-7.4-3-2.9-2-5.1-4-5.1-7.5v-6.7h6.5c.9 0 1.8.2 2.7.6.7.3 3.4 1.2 4.6 1.5.4 0 1.2-.2 2.8-.5.8-.2 1.3-.2 2-.2h5.7l.9 5.6c.4 2.7-.8 6.1-4.5 7.4l-1.2.6c-1.8.9-3.9 1.9-6 2.3-.2-.1-.6-.1-1-.1"/></g><path fill="#FFF" d="M171.7 243.3h-24.6V222h24.6v21.3z"/><path fill="#BA8449" d="M182.9 190.1c-.9-1.2-1.9-2.3-3-3.3l-.7-.7s-.1 0-.2-.1c-.5-.2-1.2-.3-1.9-.4-2.9-.4-6-.5-9.1-.6-6.3-.1-12.6.1-18.9.4-12.6.6-25.3 1.6-37.8 3-6.3.7-12.6 1.5-18.8 2.5-3.1.5-6.2 1-9.2 1.7-1.5.3-3 .7-4.4 1.1-.7.2-1.4.4-2 .7-.3.1-.6.2-.7.4 0 0-.1 0-.1.1-.7 1-1.4 2-2.1 3.1-.7 1.1-1.2 2.3-1.8 3.5-1.1 2.4-2.1 4.9-3 7.4s-1.9 5.1-2.8 7.7c-.5 1.3-1 2.6-1.6 3.9-.2.6-.5 1.2-.8 1.8h8.5c4.6-10.3 13.3-22.1 20.5-25 2-.8 34.2-4.8 55.5-4.8 7.9 0 13.3.6 16.3 1.7 8.7 3.4 26.1 19.5 27.9 28.2h4.9c-1-5.5-3-10.9-5.3-16.1-2.6-6-5.7-11.5-9.4-16.2M179.1 185.9z"/><path fill="#895B2E" d="M179.1 185.9zm17.8 17.9c-2.7-6-5.8-11.7-9.9-16.9-1-1.3-2.1-2.6-3.3-3.8l-.9-.9-.2-.2-.1-.1-.2-.2c-.2-.1-.4-.2-.5-.3-.3-.2-.6-.3-.9-.4-1.1-.4-1.9-.5-2.8-.7-3.4-.5-6.6-.6-9.8-.7-6.5-.1-12.8 0-19.2.3-12.8.5-25.5 1.5-38.2 2.8-6.3.7-12.7 1.4-19.1 2.4-3.2.5-6.3 1-9.5 1.7-1.6.4-3.2.7-4.8 1.2-.8.2-1.6.5-2.5.9-.4.2-.9.4-1.4.7-.2.2-.5.3-.8.5-.3.2-.6.5-1 1-.9 1.1-1.8 2.4-2.6 3.6-.8 1.2-1.6 2.5-2.3 3.8-1.4 2.5-2.7 5.1-3.9 7.7-1.1 2.6-2.2 5.2-3.1 7.9-.5 1.3-.9 2.6-1.2 4-.2.7-.4 1.3-.6 2l-.3 1-.1.5c0 .1.2.2.6.5H64.2c.3-.6.5-1.2.8-1.8.5-1.3 1.1-2.6 1.6-3.8 1-2.6 1.9-5.1 2.8-7.7.9-2.5 1.9-5.1 3-7.4.6-1.2 1.2-2.3 1.8-3.5.7-1.1 1.3-2.1 2.1-3.1 0 0 .1 0 .1-.1.2-.1.5-.2.7-.4.6-.2 1.3-.5 2-.7 1.4-.4 2.9-.8 4.4-1.1 3-.7 6.1-1.2 9.2-1.7 6.2-1 12.5-1.8 18.8-2.5 12.6-1.4 25.2-2.4 37.8-3 6.3-.3 12.6-.5 18.9-.4 3.1.1 6.3.2 9.1.6.7.1 1.4.3 1.9.4.1 0 .2 0 .2.1l.7.7c1.1 1.1 2 2.2 3 3.3 3.7 4.7 6.8 10.2 9.4 15.8 2.3 5.2 4.3 10.6 5.3 16.1h5c-.5-3.1-1.3-6.1-2.2-9-1.2-3.1-2.4-6.1-3.7-9.1"/><path fill="#FFF8EE" d="M164.1 195.7c-2.6-1-7.9-1.6-15.5-1.6-21.4 0-53 4-54.7 4.7-6.5 2.6-14.6 13.6-19.1 23.2h115.9c-1.9-7.5-18-22.9-26.6-26.3"/><path fill="#E5D0AE" d="M164.8 193.8c-2.9-1.1-8.4-1.7-16.3-1.7-21.3 0-53.5 4-55.5 4.8-7.3 3-15.9 14.7-20.5 25h2.2c4.5-9.5 12.6-20.5 19.1-23.2 1.7-.7 33.3-4.7 54.7-4.7 7.6 0 12.9.5 15.5 1.6 8.6 3.3 24.7 18.8 26.6 26.3h2c-1.7-8.6-19.1-24.7-27.8-28.1"/><path fill="#BA8449" d="M204.4 194.7c-1.2 2.5-7.5 8.9-12.8 7.4-2.8-.8-2.3 14 4.1 19.9h11.6c3.2-5.1 8.2-20.7 8.8-22.3.7-1.9-10.5-7.5-11.7-5"/><path fill="#895B2E" d="M216.7 198.4c-.2-3.2-2.1-5.5-5.5-6.3-2.7-.6-6.3-.1-7.2 1.6-1.8 3.4-4 7.5-14.9 8.1-.7 0-1.3.7-1.3 1.4s.7 1.3 1.4 1.3c11.4-.5 14.7-4.9 17.1-9.4.5-.4 3.2-.9 5.4 0 1.6.7 2.3 1.8 2.4 3.5.3 6.2-6.2 17.7-9.7 23.5h3.1c3.9-6.8 9.5-17.3 9.2-23.7"/><defs><path id="g" d="M193.5 196.5H217v27.3h-23.5z"/></defs><clipPath id="h"><use href="#g" overflow="visible"/></clipPath><g opacity=".15" clip-path="url(#h)"><path fill="#E3AB5E" d="M194.235 222.3c7.1-1.7 13.4-8.8 13.9-18.9.1-1.9-3.8-5.5-3.8-6.5s11.9.2 12.5 3c.5 2.8-7.4 19.7-10.1 22.5-2.6 2.7-16.7.9-12.5-.1"/></g><path fill="#FCD4C3" d="M199.8 187.8c-.9 6.2 11.2 14.7 19.4 14.5 6.8-.2 14.5-3.4 13.4-7.2-1.1-3.9-7.7.7-8.3-2-.5-2.6 7.7-7.5 4.4-11.1-3.1-3.3-6.7 5.2-10.3 4-3.6-1.2.7-9.5-3.8-10-5.3-.5-3.3 11.3-7.3 11.5-2.8.3-7.2-1.7-7.5.3"/><path fill="none" stroke="#F8A38F" stroke-width="2" stroke-miterlimit="10" d="M199.8 187.8c-.9 6.2 11.2 14.7 19.4 14.5 6.8-.2 14.5-3.4 13.4-7.2-1.1-3.9-7.7.7-8.3-2-.5-2.6 7.7-7.5 4.4-11.1-3.1-3.3-6.7 5.2-10.3 4-3.6-1.2.7-9.5-3.8-10-5.3-.5-3.3 11.3-7.3 11.5-2.8.3-7.2-1.7-7.5.3z"/><defs><path id="i" d="M203.2 182.8h7.8v6.4h-7.8z"/></defs><clipPath id="j"><use href="#i" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#j)"><path fill="#FCD4C3" d="M203.238 187.742c1.3 1 6 2.3 6.7.6.8-1.7 1.4-5.1.9-5.6-.4 1.6-.9 4.6-2.6 5.3-1.3.5-4.1-.1-5-.3"/></g><defs><path id="k" d="M215.9 181.2h7.7v7.2h-7.7z"/></defs><clipPath id="l"><use href="#k" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#l)"><path fill="#FCD4C3" d="M216.159 181.142c-.2 1.1-1.1 6.3 1.6 7 2.3.6 4-.8 5.8-3.7-1 .9-3.5 3.1-5.4 2.3-1.9-.9-2.1-2.9-2-5.6"/></g><defs><path id="m" d="M204.5 193h15.8v8.6h-15.8z"/></defs><clipPath id="n"><use href="#m" overflow="visible"/></clipPath><g opacity=".25" clip-path="url(#n)"><path fill="#FCD4C3" d="M204.576 195.158c13.6-6.7 16.4 4.2 15.7 6.4-5.4.9-14.9-4.7-15.7-6.4"/></g><defs><path id="o" d="M223 190.9h5.7v5H223z"/></defs><clipPath id="p"><use href="#o" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#p)"><path fill="#FCD4C3" d="M224.351 190.896c-2.3 2.6-1.2 4.7.3 5 1.9.4 4.4-1.6 4-1.6-.5 0-4.2 1.2-4.9-.6-.5-1.4.3-2.2.6-2.8"/></g><defs><path id="q" d="M66.1 182.6H195v36.5H66.1z"/></defs><clipPath id="r"><use href="#q" overflow="visible"/></clipPath><g opacity=".15" clip-path="url(#r)"><path fill="#E3AB5E" d="M69.034 208.266c43.7 25.1 130.4-.4 125.8-8.6-6.1-10.9-8.5-17.7-21.9-17.1-13.3.7-98.9 7.5-102.4 10.1-3.4 2.7-7.2 12.3-1.5 15.6"/></g><path fill="#FFF8EE" d="M164.3 57.5c19.6-1.8 31.1-22.1 43-19-8 5-15.9 15-27 31.4-2.7 3.9-21.4-11.9-16-12.4"/><path fill="none" stroke="#E5D0AE" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M164.3 57.5c19.6-1.8 31.1-22.1 43-19-8 5-15.9 15-27 31.4-2.7 3.9-21.4-11.9-16-12.4z"/><path fill="#BA8449" d="M41.8 53.1c8.8-8.2 24.7-5 37.5-.4 7.3 2.6 16.8.5 17.4 2 1.6 3.5-7.9 10.7-15.7 10.5-7.7-.1-20.6-14.6-39.2-12.1"/><path fill="none" stroke="#895B2E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M41.8 53.1c8.8-8.2 24.7-5 37.5-.4 7.3 2.6 16.8.5 17.4 2 1.6 3.5-7.9 10.7-15.7 10.5-7.7-.1-20.6-14.6-39.2-12.1z"/><path fill="#FCD4C3" d="M177.7 67.2c4.5 1.3 21.6-32.2 29.9-28.9 26.4 10.5-8 50.9-18.9 51.8-11 .8-13.5-23.7-11-22.9"/><path fill="none" stroke="#F8A38F" stroke-width="2" stroke-miterlimit="10" d="M177.7 67.2c4.5 1.3 21.6-32.2 29.9-28.9 26.4 10.5-8 50.9-18.9 51.8-11 .8-13.5-23.7-11-22.9z"/><path fill="#FCD4C3" d="M82.3 63.2c-7.3 3.2-33.2-23.9-44.1-6.5C31 68.2 52.8 91.4 68.4 93.9s17.7-32.4 13.9-30.7"/><path fill="none" stroke="#F8A38F" stroke-width="2" stroke-miterlimit="10" d="M82.3 63.2c-7.3 3.2-33.2-23.9-44.1-6.5C31 68.2 52.8 91.4 68.4 93.9s17.7-32.4 13.9-30.7z"/><defs><path id="s" d="M180.5 44.8h18v44.6h-18z"/></defs><clipPath id="t"><use href="#s" overflow="visible"/></clipPath><g clip-path="url(#t)"><path fill="#FCD4C3" d="M198.067 44.8c-1.4 4.6-13.2 16.5-11.6 26.7.6 3.8 4.6 15 6.3 14.6s6-3.1 5.6-2.5c-.4.6-6 4.7-8.1 5.8-2.1-1.1-11-21.8-9.7-22.9 3.9-3.5 15.8-21.5 17.5-21.7"/></g><defs><path id="u" d="M38.6 51.5h44.2v31.6H38.6z"/></defs><clipPath id="v"><use href="#u" overflow="visible"/></clipPath><g clip-path="url(#v)"><path fill="#FCD4C3" d="M38.533 57.4c8-4.9 22.6-2.8 31.1 5.5 3 3 3.9 13-2.9 19.8-2.7 2.7 16-9.6 16.1-13.2 0-3.6-1.2-4.6-4-5.6-10.3-3.8-21.1-12.6-30.5-12.4-6.1.1-8.9 4.3-9.8 5.9"/></g><defs><path id="w" d="M181.1 42.2h26.2v44.2h-26.2z"/></defs><clipPath id="x"><use href="#w" overflow="visible"/></clipPath><g opacity=".25" clip-path="url(#x)"><path fill="#FCD4C3" d="M201.3 42.175c18.2 10-11.1 25.2-8.9 44.1-3.8-.4-13.2-18.7-10.9-20.3 3.2-2.2 16.7-24.6 19.8-23.8"/></g><path fill="#E5D0AE" d="M60.9 103.6c.3-1.3.5-2.7.5-4 .1-1.4.2-2.8.5-4.1.1-.7.3-1.4.6-2 .3-.6.5-1.3.7-1.9.5-1.3 1-2.6 1.6-3.8 2.3-5.1 4.9-9.9 8.1-14.4 3.2-4.5 6.7-8.7 10.7-12.3 4-3.7 8.7-6.7 13.7-8.7 5-2.1 10.4-3.4 15.8-4 5.4-.7 10.8-.8 16.2-.7 5.4.1 10.8.4 16.2 1.1 5.4.7 10.8 1.9 16 3.8 2.6 1 5.1 2.1 7.5 3.5 2.4 1.4 4.7 3.1 6.8 5.1 2.1 1.9 3.9 4.2 5.4 6.6 1.5 2.4 2.6 5 3.6 7.7.9 2.6 1.6 5.3 2.2 8s1 5.3 1.6 7.8c.3 1.2.7 2.4 1.1 3.6.5 1.2 1 2.5 1.4 3.8.9 2.5 1.9 5.1 2.8 7.6 3.5 10.2 6.6 20.6 8.5 31.2.9 5.3 1.6 10.7 1.7 16.1.1 5.4-.4 10.8-1.9 16-.4 1.3-.8 2.6-1.3 3.8-.5 1.2-1.2 2.4-1.6 3.7-.2.7-.4 1.3-.7 1.9-.3.6-.7 1.2-1.1 1.8-.7 1.1-1.6 2.3-2.5 3.3-3.5 4.2-8 7.6-12.8 10.2s-10 4.6-15.2 6.1c-5.3 1.5-10.5 2.7-15.9 3.7s-10.7 1.7-16 2.4l-8.1.9-4 .4c-1.3.1-2.7.2-4.1.3-11 .6-22-1-32.5-3.9-5.3-1.5-10.4-3.3-15.4-5.5s-9.9-4.7-14.5-7.7c-2.3-1.5-4.6-3.2-6.7-5.1-.5-.5-1.1-1-1.6-1.5s-.9-1.1-1.4-1.6c-.9-1.1-1.8-2.2-2.6-3.3-3.1-4.6-5.6-10-6.4-15.6-.9-5.7-.1-11.5 1.5-16.8 1.6-5.4 4.1-10.3 6.7-15.1 2.7-4.7 5.6-9.3 8.4-13.8 1.4-2.3 2.7-4.6 3.9-6.9 1.1-3 2.1-5.3 2.6-7.7zm4 .9c-.7 2.8-1.9 5.4-3.2 7.9s-2.7 4.8-4.1 7.1c-2.8 4.6-5.7 9.1-8.2 13.7s-4.8 9.4-6.2 14.3c-1.4 4.9-2 10-1.2 15 .8 4.9 2.9 9.6 5.9 13.7.7 1 1.6 2 2.4 3 .4.5.9 1 1.3 1.4.4.5.9.9 1.3 1.3 1.8 1.7 3.9 3.2 6.1 4.7 4.4 2.8 9 5.3 13.9 7.4 4.8 2.1 9.8 3.9 14.9 5.3s10.2 2.5 15.4 3.2c5.2.7 10.4.9 15.6.7l3.9-.3 4-.4c2.6-.2 5.3-.5 8-.8 5.3-.5 10.6-1.2 15.8-2.1 5.3-.9 10.4-1.9 15.5-3.3s10.1-3 14.9-5.1c4.7-2.2 9.3-4.9 13-8.6.9-.9 1.8-1.9 2.6-2.9.4-.5.8-1.1 1.2-1.6.4-.5.9-1 1.3-1.6.9-1.1 1.3-2.3 1.9-3.5.5-1.2.9-2.5 1.2-3.8 1.3-5.2 1.6-10.6 1.3-15.9-.4-5.3-1.3-10.6-2.6-15.8-2.5-10.4-6.2-20.4-10.1-30.3-1-2.5-2-5-3-7.4l-1.6-3.7c-.5-1.3-1-2.7-1.4-4-.7-2.7-1.2-5.3-1.8-7.9-.5-2.6-1.2-5.1-2-7.5-1.7-4.9-4.2-9.3-7.9-12.8-3.6-3.5-8.1-6.2-12.9-8.2-4.8-2-10-3.3-15.2-4.2-5.2-.9-10.5-1.4-15.8-1.7-5.3-.2-10.7-.3-16 .3-5.3.6-10.5 1.7-15.4 3.8-4.9 2-9.4 4.9-13.2 8.5-3.9 3.6-7 8-9.3 12.6-2.4 4.7-4.1 9.7-5.6 14.7-.4 1.2-.7 2.5-1 3.8-.2.6-.3 1.3-.5 1.9-.1.3-.1.7-.2 1-.1.3-.2.6-.4.9-.5 1.2-1.1 2.4-1.7 3.6-.2 1.1-.6 2.3-.9 3.6z"/><path fill="#FFF8EE" d="M62.9 104.1c-4.2 18.6-40.9 48-13 78.1 9.5 10.2 40.3 25.9 71.2 23 80.4-7.6 100.7-27 66.8-110.2-5.5-13.5.7-44.7-58.4-46.5-24.8-.7-54.6 2.7-66.6 55.6"/><path fill="#E5BFA1" d="M76.8 67.7c2.6-4 6-7.3 9.8-10C90.4 55 94.7 53 99 51.4c8.8-3.2 18-4.4 27.2-4.7 9.2-.2 18.5.5 27.5 2.8 4.5 1.2 8.9 2.8 13.1 5.1s8.1 5.1 11.4 8.6c3.3 3.5 6 7.4 8.1 11.7 2.1 4.3 3.6 8.8 4.7 13.3 1.1 4.6 1.8 9.1 2.4 13.6.3 2.3.6 4.5 1.1 6.6.2 1.1.5 2.1.8 2.9l.3.6.1.1.1.1.2.4.9 1.5c4.4 8.1 7.7 17 8.9 26.3.6 4.6.7 9.3.2 14-.5 4.6-1.7 9.2-3.5 13.5-.9 2.1-1.9 4.2-3.1 6.3l-.9 1.5c-.3.5-.6.9-1 1.5-.1.1-.1.2-.2.3-.3-.2.4.7-1.6 0-.5-.9-.2-.7-.3-.9 0-.3.1-.4.1-.6l.3-.9.5-1.6c1.4-4.3 2.6-8.6 3.1-13.1.2-2.2.3-4.4 0-6.7-.3-2.2-.9-4.3-2-6.1-.3-.5-.6-.9-1-1.3s-.7-.8-1.1-1.2c-.8-.8-1.6-1.5-2.5-2.2-1.8-1.4-3.7-2.5-5.7-3.5-4.1-1.8-8.6-2.5-13-2.3-4.5.2-8.9 1.1-13.2 2.3-2.2.6-4.3 1.3-6.5 2-1.1.4-2.2.7-3.3 1-.6.2-1.1.3-1.8.4-.6.1-1.1.2-1.7.2-4.6.5-9.1.8-13.8.7-4.6-.1-9.2-.6-13.8-1.6-4.5-1-9-2.5-13.2-4.4-4.2-2-8.2-4.4-11.8-7.4-3.6-3-6.8-6.4-9.6-10.1-5.6-7.5-9.3-16.2-11.1-25.3-.9-4.6-1.3-9.2-1.1-13.9.1-2.3.4-4.7.9-7 .6-1.8 1.4-4.1 2.7-6.2zm2 1.3c-1.1 1.8-1.8 3.8-2.3 6-.5 2.1-.7 4.3-.9 6.5-.2 4.4.3 8.9 1.2 13.2 1.9 8.7 5.6 17 11 24 2.7 3.5 5.8 6.7 9.2 9.5 3.4 2.8 7.2 5.2 11.2 7.1 4 1.9 8.2 3.3 12.6 4.3 4.3 1 8.8 1.6 13.2 1.7 4.5.2 8.9 0 13.4-.5l1.7-.2c.5-.1 1-.2 1.6-.3 1.1-.3 2.1-.6 3.2-.9 2.2-.6 4.4-1.3 6.6-1.8 4.4-1.1 9-1.9 13.7-1.9 4.6 0 9.3.8 13.5 2.8 2.1 1 4.1 2.2 5.9 3.6.9.7 1.8 1.5 2.6 2.3l1.2 1.2c.4.4.8.9 1.1 1.4 1.3 2 2 4.3 2.3 6.7s.3 4.7.1 7c-.4 4.6-1.4 9.1-2.7 13.5l-.5 1.6-.2.8c0 .1-.1.3 0 .3-.1-.1.2.2-.2-.7-1.9-.7-1.2.2-1.4-.1.2-.4.5-.9.8-1.4.3-.5.5-1 .8-1.5 1-2 1.9-4 2.7-6.1 3-8.3 3.6-17.4 2.1-26.1-.7-4.4-2-8.6-3.6-12.7s-3.5-8.1-5.7-12l-.8-1.4-.2-.4-.1-.2-.1-.2c-.2-.3-.3-.6-.4-.9-.5-1.2-.8-2.5-1.1-3.6-.5-2.3-.9-4.6-1.2-6.8-.7-4.5-1.3-8.9-2.4-13.2-1-4.3-2.4-8.5-4.3-12.4-1.9-3.9-4.2-7.5-7.2-10.7-5.8-6.3-13.8-10.5-22.3-13s-17.5-3.3-26.5-3.3c-8.9 0-17.9 1.1-26.3 3.9-4.2 1.4-8.2 3.3-11.9 5.8-3.8 2.4-7 5.4-9.4 9.1z"/><path fill="#895B2E" d="M75.6 67.2c1.5-2.4 3.3-4.3 5.1-6.1 1.9-1.8 3.9-3.3 6-4.7 4.2-2.8 8.7-5 13.4-6.7 9.4-3.3 19.3-4.6 29.1-4.4 9.7.3 19.5 1.5 28.9 4.9 4.7 1.7 9.2 3.9 13.3 6.9 4.1 2.9 7.7 6.5 10.7 10.6 2.9 4.1 5.1 8.6 6.8 13.3 1.6 4.7 2.7 9.5 3.5 14.2.4 2.4.7 4.7 1.1 7.1.4 2.3.7 4.7 1.1 6.8.2 1.1.5 2.1.9 2.9l.1.2.1.2.2.4.4.8.9 1.6c1.1 2.1 2.2 4.3 3.2 6.5 1.9 4.4 3.5 9.1 4.6 13.9 1.1 4.7 1.6 9.6 1.6 14.5-.1 9.8-2.8 19.5-7.9 27.8-.4.6-1.2.9-1.8.5-.6-.4-.8-1.1-.6-1.6 1.4-3.6 2.9-7 4-10.5 1.2-3.5 2-7.1 2-10.6s-.9-6.9-3-9.6c-.1-.2-.3-.4-.4-.5l-.2-.2-.2-.3-.9-.9c-.6-.6-1.3-1.2-2-1.7-1.4-1.1-3-2.1-4.5-3.1-6.3-3.9-13-7.3-19.8-10.7-6.8-3.3-13.7-6.5-20.5-9.6-13.8-6.3-27.6-12.6-41.2-19.4-6.8-3.5-13.5-7-20.1-11.2-3.5-2.5-6.7-4.7-9.8-7.5-1.5-1.4-3-3-4.2-5.2-.6-1.1-1.1-2.4-1.2-4 0-.8 0-1.6.2-2.4.1-.4.2-.8.4-1.2.1-.3.4-.9.5-1h.2zm5.6 3.4c-.2.3-.1.2-.2.3 0 .1 0 .1-.1.2v.4c0 .3.2.8.4 1.4.6 1.2 1.7 2.5 2.9 3.6 2.5 2.4 5.4 4.6 8.5 6.6 6.1 4.1 12.7 7.7 19.4 11.3 13.3 7 27 13.5 40.6 20.1 6.8 3.3 13.6 6.7 20.4 10.1 6.8 3.5 13.5 7 20 11.3 1.6 1.1 3.2 2.2 4.7 3.5.8.6 1.5 1.3 2.3 2 .4.4.7.7 1.1 1.2l.2.3.3.3c.2.2.3.4.5.6 1.2 1.7 2.1 3.6 2.7 5.6s.7 4.1.7 6.1c-.1 4-1.2 7.9-2.5 11.6-1.3 3.7-2.9 7.1-4.4 10.6l-2.4-1.2c4.7-8 6.9-17.2 6.8-26.4-.2-9.2-2.6-18.3-6.5-26.7-1-2.1-2-4.2-3.2-6.2l-1.8-3.2c-.7-1.3-1-2.6-1.3-3.8-.6-2.5-1-4.8-1.4-7.2s-.8-4.7-1.2-6.9c-.9-4.6-2-9-3.6-13.3-1.6-4.2-3.7-8.3-6.3-11.8-2.6-3.6-5.9-6.7-9.5-9.2-3.7-2.5-7.7-4.5-12-5.9-8.6-2.9-17.8-3.9-27-4-4.6 0-9.1.2-13.6 1-4.5.7-8.9 1.8-13.1 3.3s-8.3 3.4-12 5.8c-1.9 1.2-3.6 2.5-5.2 4s-3.1 3-4.2 4.6z"/><path fill="#BA8449" d="M77.8 68.3c-11 17 2.1 82.3 71.2 73.5 7.3-.9 31.6-13.9 48 4.3 8.9 10-3.1 35.3 0 30 3.5-5.8 16.9-28.2-3.2-62.7-6.4-11.1 4.2-64.4-65-65.1-26.5-.1-43.7 8.7-51 20"/><defs><path id="y" d="M61.7 64.6H179v111.9H61.7z"/></defs><clipPath id="z"><use href="#y" overflow="visible"/></clipPath><g opacity=".15" clip-path="url(#z)"><path fill="#E3AB5E" d="M75.968 72.433c19.9-12.8 80.1-11.9 99.3 18.8 12.8 20.4-10.6 70.8-19.3 77.2-8.6 6.4-20.6 12-52.2 4.4-26.8-6.4 13.5-31.3-17.9-34.9-28.7-3.3-31.6-51.5-9.9-65.5"/></g><defs><path id="A" d="M118.5 119.2h13.1v5.5h-13.1z"/></defs><clipPath id="B"><use href="#A" overflow="visible"/></clipPath><g opacity=".25" clip-path="url(#B)"><path fill="#E3AB5E" d="M131.6 121.966c0 1.5-2.9 2.8-6.5 2.8s-6.5-1.2-6.5-2.8c0-1.5 2.9-2.8 6.5-2.8 3.6.1 6.5 1.3 6.5 2.8"/></g><path fill="#F8A38F" d="M120.1 113.8c1.5-1 9.5-.7 10.5.4 1 1 3.2 5.2.7 7-.9.6-.9-1.9-2.9-1.5-2.4.5-1.1 3.6-3 3.6-2.9-.1-.1-3.4-2.6-3.8-1.9-.4-2.3 1.5-3.2 1.3-2.9-.6-1.6-5.6.5-7"/><defs><path id="C" d="M117.9 113.2h14.5v9.9h-14.5z"/></defs><clipPath id="D"><use href="#C" overflow="visible"/></clipPath><g clip-path="url(#D)"><path fill="#F8A38F" d="M124.42 113.205c-1.9 0-3.7.2-4.3.6-2.1 1.4-3.4 6.4-.6 6.9h.1c.7 0 1.1-1.4 2.6-1.4h.5c2.5.4-.2 3.8 2.6 3.8 1.8 0 .5-3 3-3.5h.4c1.4 0 1.6 1.6 2.2 1.6.1 0 .2 0 .3-.1 2.6-1.8.4-6-.7-7-.5-.5-3.4-.9-6.1-.9m0 .7c3 0 5.3.4 5.7.7.6.6 1.8 2.8 1.6 4.4-.1.6-.3 1.1-.7 1.4 0-.1-.1-.1-.2-.2-.4-.5-1-1.3-2.1-1.3-.2 0-.4 0-.5.1-1.7.4-2 1.7-2.3 2.6-.2.9-.3.9-.6.9-.8 0-.8-.2-.8-1.1 0-.9 0-2.3-1.8-2.6h-.6c-1.1 0-1.8.7-2.3 1.1-.1.1-.3.3-.4.3-.4-.1-.8-.3-1-1.1-.3-1.4.7-3.8 1.8-4.6.6-.4 2-.6 4.2-.6"/></g><defs><path id="E" d="M74.1 124.9H187V189H74.1z"/></defs><clipPath id="F"><use href="#E" overflow="visible"/></clipPath><g opacity=".25" clip-path="url(#F)"><path fill="#F7E8D0" d="M186.799 140.05c3 19.2-21 43.3-53.3 48.3-32.3 4.9-56.1-23.9-59.1-43.2-3-19.2 16.8-11.9 49.1-16.8s60.3-7.5 63.3 11.7"/></g><defs><path id="G" d="M80 125.9h93.6v47.5H80z"/></defs><clipPath id="H"><use href="#G" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#H)"><path fill="#D8CAB2" d="M102.515 169.277c-.9-1.4-1.4-3.1-1.9-4.7l-1.5-4.8c-1-3.2-2.1-6.4-3.6-9.4s-3.4-5.8-5.8-7.9c-2.4-2.1-5.3-3.5-8.4-4.1-1.1-.4-1.6-1.5-1.2-2.5.4-1 1.4-1.5 2.3-1.3 7.2 1.7 14.7 2.5 22.1 2.6s15-.3 22.5-1.2c7.5-.9 14.9-2.2 22.2-3.9 7.3-1.7 14.6-3.7 21.7-6.1 1.1-.4 2.2.2 2.5 1.2.3.8 0 1.6-.6 2.1-.2.2-.6.5-.9.8-.3.3-.6.7-.9 1-.6.7-1.2 1.5-1.8 2.3-1.2 1.6-2.3 3.2-3.3 4.9-2.2 3.3-4.2 6.7-6.1 10.2-1.9 3.5-3.8 7-5.5 10.5-.9 1.8-1.7 3.6-2.4 5.4-.4.9-.7 1.8-1.1 2.8-.2.5-.3.9-.4 1.4v.2c0 .1 0 .1-.1.2 0 .1-.1.2-.2.2-.1.1-.2.2-.4.3-.2.2-.5.3-.7.4-1.9.8-3.9 1.2-5.8 1.6-1.9.4-3.9.7-5.9.9-4 .5-7.9.9-11.9 1-4 .2-8 .2-11.9-.2-2-.2-4-.5-5.9-1-1-.3-1.9-.6-2.8-1.1-.9-.4-1.7-1-2.3-1.8m.1-.1c.5.8 1.4 1.4 2.3 1.8.9.4 1.8.7 2.8 1 1.9.5 3.9.8 5.9.9 4 .3 7.9.3 11.9.1 4-.2 7.9-.7 11.8-1.2 1.9-.3 3.9-.6 5.8-1.1s3.9-.9 5.6-1.7c.2-.1.4-.2.6-.4.2-.1.3-.2.3-.3.1-.5.2-1 .4-1.5.3-1 .6-1.9.9-2.9.7-1.9 1.4-3.7 2.2-5.6 1.6-3.7 3.2-7.3 4.9-10.9 1.7-3.6 3.5-7.2 5.4-10.7.9-1.8 1.9-3.5 3-5.3.5-.9 1.1-1.8 1.7-2.6.3-.4.6-.9.9-1.3.4-.4.7-.9 1.2-1.3l1.9 3.4c-7.3 2.5-14.6 4.5-22.1 6.2-7.5 1.7-15 3.1-22.6 4-7.6.9-15.3 1.4-23 1.2s-15.4-1.1-23-2.9l1.1-4c3.3 2 6.3 3.9 8.6 6.6 2.3 2.7 3.9 5.8 5.2 9 1.2 3.2 2.2 6.5 3 9.7.4 1.6.9 3.3 1.3 4.9.6 1.9 1.1 3.5 2 4.9"/></g><defs><path id="I" d="M81 126.9h91.6v46.5H81z"/></defs><clipPath id="J"><use href="#I" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#J)"><path fill="#D8CAB2" d="M102.532 169.288c-.9-1.4-1.4-3-1.9-4.6-.5-1.6-.9-3.2-1.4-4.8-1-3.2-2-6.4-3.5-9.5-1.4-3-3.3-5.8-5.6-8-2.4-2.3-5.3-3.9-8.4-4.6v-.1c-.5-.2-.8-.8-.6-1.3.2-.5.7-.8 1.2-.7 7.3 1.7 14.8 2.5 22.4 2.6s15.1-.3 22.6-1.2c7.5-.9 14.9-2.3 22.3-3.9 7.4-1.7 14.7-3.7 21.8-6.1.5-.2 1.1.1 1.3.6.1.4 0 .8-.3 1.1-.6.5-1.3 1.3-1.9 2-.6.7-1.2 1.6-1.8 2.3-1.1 1.6-2.2 3.3-3.2 5-2.1 3.3-4.1 6.8-6 10.3-1.9 3.5-3.7 7-5.3 10.6l-2.4 5.4c-.4.9-.7 1.8-1 2.8-.2.5-.3.9-.4 1.4-.1.4-.4.5-.6.7-.2.2-.5.3-.7.4-1.9.8-3.9 1.2-5.8 1.6-1.9.4-3.9.7-5.9 1-3.9.5-7.9.9-11.9 1.1-4 .2-8 .2-11.9-.2-2-.2-4-.5-5.9-1-1-.3-1.9-.6-2.8-1-1-.5-1.9-1.1-2.4-1.9m0-.1c.5.8 1.4 1.4 2.3 1.9.9.4 1.8.7 2.8 1 1.9.5 3.9.8 5.9.9 4 .4 7.9.3 11.9.1 4-.2 7.9-.6 11.9-1.2 1.9-.3 3.9-.6 5.9-1.1 1.9-.4 3.9-.9 5.6-1.7.2-.1.4-.2.6-.4.2-.1.4-.3.4-.4.1-.5.2-1 .4-1.5.3-1 .6-1.9 1-2.8.7-1.9 1.5-3.7 2.3-5.5 1.6-3.7 3.3-7.2 5.1-10.8 1.8-3.6 3.6-7.1 5.6-10.6 1-1.8 2-3.5 3.1-5.1.5-.9 1.1-1.7 1.7-2.5.6-.8 1.2-1.6 2.1-2.4l1 1.8c-7.2 2.5-14.6 4.5-22 6.2s-14.9 3-22.5 4c-7.6.9-15.2 1.4-22.9 1.2-7.6-.2-15.3-1-22.8-2.7l.5-1.9c3.3 1.3 6.3 3.3 8.6 5.9 2.3 2.6 4 5.6 5.3 8.7 1.3 3.1 2.3 6.3 3.2 9.6.4 1.6.9 3.2 1.4 4.9.2 1.4.7 3 1.6 4.4"/></g><path fill="#333" d="M102.6 169.2c5.1 8 46.8 2.5 47.5-.7 1.8-8.1 16.8-36.7 21.6-40.7-8.6 3-53.3 17.3-89.6 8.6 16.3 5.5 16.5 26.6 20.5 32.8"/><g><defs><path id="K" d="M82 127.9h89.6v45.4H82z"/></defs><clipPath id="L"><use href="#K" overflow="visible"/></clipPath><g clip-path="url(#L)"><path fill="#333" d="M171.55 127.95c-6.7 2.3-34.9 11.4-64.1 11.4-8.6 0-17.2-.8-25.5-2.7 16.4 5.3 16.6 26.5 20.6 32.7 1.9 3 9.2 4.1 17.5 4.1 13.4 0 29.5-2.8 30-4.8 1.8-8.2 16.7-36.8 21.5-40.7m-5.6 3.9c-6.5 9.8-15.9 28.7-17.8 35.8-2.5 1.4-15.4 3.8-28.1 3.8-10.2 0-14.8-1.7-15.8-3.2-1-1.5-1.8-4.3-2.6-7.5-1.7-6.1-4.1-14.5-9.8-20.3 5 .6 10.2.9 15.7.9 23.8-.1 47.1-6.1 58.4-9.5"/></g></g><path fill="#FCD4C3" d="M119.7 173.4c-8.6 0-14.2-1.2-16.4-3.6-.2-.2-.2-1.4.8-3.7 2.4-5.5 9.8-14.9 22.6-15.7.9 0 1.7-.1 2.5-.1 15 0 24 7.6 24 8.9-.2.4-.4 1-.7 1.8-.8 1.9-2 4.9-3.1 8.1-1.3 1.3-16.3 4.3-29.7 4.3"/><path fill="#F8A38F" d="M129.2 149.8c-.9 0-1.7 0-2.6.1-17.5 1.1-25.6 18.4-23.8 20.5 2.6 2.8 9.3 3.8 16.9 3.8 13.5 0 29.8-3.1 30.3-4.6 1.5-4.5 3.2-8.2 3.9-10 .6-1.8-9.5-9.9-24.7-9.8m0 1.3c13.4 0 22.4 6.4 23.3 8.3-.2.4-.4.9-.6 1.5-.8 1.9-2 4.7-3.1 7.9-2.1 1.2-16.1 3.9-29.1 3.9-8.1 0-13.7-1.2-15.8-3.3-.1-.7.6-3.5 3.1-7 2.2-3.2 8.6-10.7 19.7-11.3h2.5"/><g><defs><path id="M" d="M103.1 149.4h50.2v20.7h-50.2z"/></defs><clipPath id="N"><use href="#M" overflow="visible"/></clipPath><g clip-path="url(#N)"><path fill="#FCD4C3" d="M103.084 169.317c-1.2 5.4 31.9-21.1 49.7-8.4 3.7-4.9-16-13.2-27.5-11.3-9.7 1.7-19.7 7.9-22.2 19.7"/></g></g><path fill="#FFF7E3" d="M109.8 140.8c1.7 3 4.8 17.6 6.1 17.9s9.5 2.6 10.6 2.1c1.2-.5 1.1-3.3 2.3-2.5 1 .7 1.5 2 2.5 1.5 1.8-.9 7.1-4.2 8-5.6.8-1.5.7-9.8 0-16.4-3.4 1.6-23.5 3.7-29.5 3"/><g><defs><path id="O" d="M109.8 137.9h30.1v23.2h-30.1z"/></defs><clipPath id="P"><use href="#O" overflow="visible"/></clipPath><g clip-path="url(#P)"><path fill="#FFDC99" d="M139.35 137.85c-3 1.3-18.7 3.1-26.6 3.1-1.2 0-2.1 0-2.9-.1 1.7 3 4.8 17.6 6.1 17.9 1.2.3 8 2.2 10.1 2.2.2 0 .4 0 .5-.1 1-.4 1.1-2.6 1.9-2.6.1 0 .3 0 .4.2.9.5 1.3 1.6 2.1 1.6.1 0 .3 0 .4-.1 1.8-.9 7.1-4.2 8-5.6.9-1.5.7-9.8 0-16.5m-.5.9c.6 6.8.6 14 0 15.2-.7 1.2-5.5 4.3-7.7 5.4h-.1c-.2 0-.5-.3-.7-.6-.3-.3-.6-.6-1-.9-.3-.2-.5-.3-.8-.3-.9 0-1.2.9-1.5 1.6-.2.4-.4 1-.7 1.1h-.3c-1.7 0-6.8-1.4-8.9-1.9-.4-.1-.7-.2-.9-.2-.6-.7-1.9-5.4-2.9-8.8-.9-3.1-1.7-6-2.4-7.7h1.9c7.5 0 21.5-1.6 26-2.9"/></g></g><g><defs><path id="Q" d="M109.9 137.5h29.7v10.3h-29.7z"/></defs><clipPath id="R"><use href="#Q" overflow="visible"/></clipPath><g clip-path="url(#R)"><path fill="#EADCBE" d="M112.151 147.85c-.5-5.4 24.4-7.2 27.5-6.7 0-1.3-.2-2.1-.2-3.6-4.1 2.1-26.5 4.3-29.5 3.4.3.6 1.4 3.6 2.2 6.9"/></g></g><g><defs><path id="S" d="M124 143.8h5.5v14.7H124z"/></defs><clipPath id="T"><use href="#S" overflow="visible"/></clipPath><g clip-path="url(#T)"><path fill="#FFDC99" d="M124.558 143.768c.5 1.2 1 2.3 1.4 3.5l1.2 3.6 1.1 3.6 1.1 3.6-1.7.5-.8-3.7-.9-3.7-.9-3.6c-.4-1.2-.7-2.4-1.1-3.5l.6-.3z"/></g></g><g><defs><path id="U" d="M39.1 51.5h39.4v35.7H39.1z"/></defs><clipPath id="V"><use href="#U" overflow="visible"/></clipPath><g opacity=".4" clip-path="url(#V)"><path fill="#FCD4C3" d="M40.384 59.116c13.2 3.4 11.1 26.2 18.9 28 7.9 1.8 18.2-18.8 19.2-23.3-15.2-6.5-22.3-14.1-33.2-11.9-3.6.7-8.6 6.2-4.9 7.2"/></g></g><g><defs><path id="W" d="M59.9 88.7h133.7v42.5H59.9z"/></defs><clipPath id="X"><use href="#W" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#X)"><path fill="#E3AB5E" d="M76.967 125.833c16.6 1.3 30.3 2 35.2-3.1s6.7-27.7 14.7-27.1c6.8.5 9.1 29.9 13.5 30.7 4.4.9 35.5 9.4 43.3 1.4 7.7-8 11.3-13 9.5-17.8-1.8-4.8-47.3-20.3-56.6-21.2-9.3-.9-72.1 7-73.7 10.9-1.6 4-3.3 3.4-3 7.6.6 8.1.5 17.3 17.1 18.6"/></g></g><path fill="#333" d="M123.5 92.4c1.2 0 5.9-.4 7 .5 6 4.7 5.8 24 12.1 30 5.6 5.4 36.2 9.3 41.5 3.2 5.3-6.1 13.1-24.7 14.9-26.1 1.8-1.3 5.8-2.3 7-4.2 1.2-1.8.2-10-2.6-9.6-2.8.4-8.1 2.1-11.4 1.2-3.3-1-19.4-11.1-59.9-5-3.9.6-7.8 0-10.5-.7S103.7 72.2 63 78c-4 .6-9.6-1.2-11.6-1-2 .2-2.6 6.5-1.8 8.1s5 3 5.5 5 4.2 21.6 13.8 29.7c10.2 8.6 36.2 2.6 38.5 1 10.3-7.3 12.6-28.4 16.1-28.4"/><g><defs><path id="Y" d="M49.1 76.1h157.3v53.1H49.1z"/></defs><clipPath id="Z"><use href="#Y" overflow="visible"/></clipPath><g clip-path="url(#Z)"><path fill="#1A1A1A" d="M88.438 76.123c-7.1 0-15.6.5-25.6 2-.6.1-1.2.1-1.8.1-3.5 0-7.6-1.1-9.5-1.1h-.3c-2 .2-2.6 6.5-1.8 8.1.8 1.7 5 3 5.5 5s4.2 21.6 13.8 29.7c4 3.4 10.6 4.5 17.2 4.5 10 0 19.9-2.5 21.3-3.5 10.4-7.4 12.8-28.5 16.3-28.5.5 0 1.8-.1 3-.1 1.6 0 3.3.1 3.9.5 6 4.7 5.8 24 12.1 30 3.6 3.4 17.4 6.3 28.2 6.3 6.1 0 11.3-.9 13.2-3.1 5.3-6.1 13.1-24.7 14.9-26.1 1.8-1.4 5.8-2.3 7-4.2 1.1-1.8.2-9.6-2.5-9.6h-.2c-2.2.3-6 1.4-9.1 1.4-.8 0-1.6-.1-2.3-.3-2.6-.8-12.7-6.9-35.7-6.9-6.9 0-14.9.5-24.2 1.9-1.1.2-2.3.2-3.3.2-2.7 0-5.2-.4-7.1-.9-2-.2-11.2-5.4-33-5.4m0 2c18.1 0 27.4 3.6 30.8 5 .7.3 1.2.5 1.7.6 1.8.4 4.5 1 7.6 1 1.2 0 2.5-.1 3.6-.3 8.5-1.3 16.5-1.9 23.9-1.9 19 0 28.9 4.2 33.2 6.1.9.4 1.5.6 2 .8.9.3 1.8.4 2.9.4 2.2 0 4.6-.5 6.6-.9.9-.2 1.8-.4 2.5-.5.9 1 1.5 5.4 1 6.6-.4.6-2.1 1.4-3.3 1.9-1.2.5-2.3 1-3.1 1.6-1.1.8-2.2 2.9-5.4 9.3-3.1 6.1-6.9 13.7-9.8 17-1 1.2-4.6 2.4-11.8 2.4-10.5 0-23.9-2.8-26.9-5.7-2.8-2.6-4.2-8.7-5.6-14.6-1.6-6.6-3.1-12.8-6.6-15.6-.9-.7-2.3-1-5.1-1h-3.1c-2.8 0-4 3.3-6.1 9.3-2.3 6.6-5.6 15.5-11.3 19.6-1.3.8-10.7 3.2-20.2 3.2-7.3 0-12.8-1.4-15.9-4-3.8-3.2-9.1-10.7-12.9-27.8-.1-.4-.2-.7-.2-.9-.5-1.9-2.3-3-3.8-4-.6-.4-1.6-1.1-1.8-1.4-.4-.9 0-4.2.6-5.3.7 0 1.7.2 2.8.4 1.9.3 4.3.7 6.5.7.7 0 1.5 0 2.1-.2 8.9-1.1 17.4-1.8 25.1-1.8"/></g></g><g><defs><path id="aa" d="M64.4 83.4h50.5v34.2H64.4z"/></defs><clipPath id="ab"><use href="#aa" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#ab)"><path fill="none" stroke="#333" stroke-width="4" stroke-miterlimit="10" d="M66.2 90.45c-.9 1.2-1.5 18.9 6 23.7 4.9 3.2 25.7 2.5 29.9.2 6.5-3.7 12.9-20.5 11.1-22.9-3-4-24.6-9.3-40.8-5.1-2 .4-5.1 2.6-6.2 4.1z"/></g></g><path fill="#FFF" d="M66.2 90.4c-.9 1.2-1.5 18.9 6 23.7 4.9 3.2 25.7 2.5 29.9.2 6.5-3.7 12.9-20.5 11.1-22.9-3-4-24.6-9.3-40.8-5.1-2 .5-5.1 2.6-6.2 4.1"/><g><defs><path id="ac" d="M139.8 88.1h50.1v35h-50.1z"/></defs><clipPath id="ad"><use href="#ac" overflow="visible"/></clipPath><g opacity=".5" clip-path="url(#ad)"><path fill="none" stroke="#333" stroke-width="4" stroke-miterlimit="10" d="M188.394 98.163c.8 1.3-1 18.9-9 22.8-5.3 2.5-25.8-.9-29.6-3.7-6-4.5-10.2-22-8.1-24.2 3.5-3.6 25.6-6 41.1.2 1.9.7 4.7 3.3 5.6 4.9z"/></g></g><path fill="#FFF" d="M188.4 98.2c.8 1.3-1 18.9-9 22.8-5.3 2.5-25.8-.9-29.6-3.7-6-4.5-10.2-22-8.1-24.2 3.5-3.6 25.6-6 41.1.2 1.9.7 4.6 3.2 5.6 4.9"/><path d="M89.9 101.2c-.5 3.9-2.5 6.8-4.4 6.5-1.9-.3-2.9-3.6-2.4-7.5s2.5-6.8 4.4-6.5c1.9.3 2.9 3.6 2.4 7.5M169.6 105.6c.4 3.9-.8 7.2-2.6 7.4-1.9.2-3.7-2.8-4.1-6.7-.4-3.9.8-7.2 2.6-7.4 1.8-.1 3.6 2.9 4.1 6.7"/><g><defs><path id="ae" d="M49.1 81.6h156.3v46H49.1z"/></defs><clipPath id="af"><use href="#ae" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#af)"><path fill="#333" d="M51.475 82.75c2.3 1.5 4.4.6 4.9 3.6s7.4 29 16 32c14.1 4.9 31.9.1 34.3-1.4 2.4-1.5 13.7-26.8 15.6-27.8 1.9-1 7.9.1 9.2.7 3.9 1.7 11.1 29.1 13 30.5 8.7 6.1 36.6 5.6 37.9 4 1.4-1.7 11.8-25.6 13.7-27 2.7-2.1 9-3.5 9.2-2.6.2.9-5.1 1.8-6.7 3.7-1.6 2-12.1 24.9-15.4 26.9-3.3 2-27.7 5.3-40.1-3.4-5.9-4.2-8.2-29.1-12.9-30.5-3-.9-5.3-.8-7.5-.2-2.9 1.9-7 23.1-15.7 28.4-3.5 2.1-30.6 7.4-38.7-1.1-15.1-15.8-10.5-29.9-15.4-31.9-3.3-1.4-4-3.2-4-4.4.3-1.3 1.4-.3 2.6.5"/></g></g><g><defs><path id="ag" d="M51.6 77.2h20.2v3H51.6z"/></defs><clipPath id="ah"><use href="#ag" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#ah)"><path fill="#333" d="M51.75 77.45c-1.6-.6 6.8 2.9 9.9 2.7 3.1-.2 8.3-2.4 10-2.9 1.5-.5-7.8 1.2-10.1 1.1s-8.9-.6-9.8-.9"/></g></g><g><defs><path id="ai" d="M116.6 82.1h21.7v5.3h-21.7z"/></defs><clipPath id="aj"><use href="#ai" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#aj)"><path fill="#333" d="M116.6 82.15c2.9 1.3 4.2 4.6 7 4.9s6.2.8 7.8-.1c1.6-.9 5.6-3 6.7-3.2 1.2-.2-8.7 1.3-12.4 1-3.7-.4-8-2.5-9.1-2.6"/></g></g><g><defs><path id="ak" d="M187.4 86h12.3v3.9h-12.3z"/></defs><clipPath id="al"><use href="#ak" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#al)"><path fill="#333" d="M187.575 85.975c-1.2-.5 4.4 4 6.1 3.8 1.7-.2 4.7-2.1 6-2.6 1-.4-4 1-5.5.7-1.5-.1-5.4-1.4-6.6-1.9"/></g></g><g><defs><path id="am" d="M62.3 82.8h28.9v28.6H62.3z"/></defs><clipPath id="an"><use href="#am" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#an)"><path fill="#333" d="M63.05 87.825c7.4-7.3 25-4.8 28.2-4.2-21.1 1.5-21.5 3.1-25.2 6.8-.5 2.9-1.2 12.5 2.1 20.9-3.7-2-7.6-21-5.1-23.5"/></g></g><g><defs><path id="ao" d="M165.1 87.8h27.8v30.5h-27.8z"/></defs><clipPath id="ap"><use href="#ao" overflow="visible"/></clipPath><g opacity=".3" clip-path="url(#ap)"><path fill="#333" d="M192.46 95.698c-6.4-8.2-24.1-8.1-27.4-7.8 20.7 4.3 20.9 5.9 24.1 10.1.2 2.9-.4 12.5-4.7 20.4 3.8-1.6 10.1-20 8-22.7"/></g></g><g><defs><path id="aq" d="M65.8 84.8h47.8v27.5H65.8z"/></defs><clipPath id="ar"><use href="#aq" overflow="visible"/></clipPath><g clip-path="url(#ar)"><path fill="#D0DDDC" d="M66.412 102.575c.7-8.6 1.5-15.6 18.6-16.1 13.7-.4 24.6 2.8 26.1 6.1 1 2.1.2 11.3-6.6 19.7 4.4-3.9 11.4-19.4 8.4-21.3-11.1-7.1-33.2-7.3-41.4-4.4-1.5.5-3.9 2.2-5.5 4-.3 2.2-.3 10.8.4 12"/></g></g><g><defs><path id="as" d="M66.8 103H102v13.9H66.8z"/></defs><clipPath id="at"><use href="#as" overflow="visible"/></clipPath><g clip-path="url(#at)"><path fill="#D0DDDC" d="M66.884 103.2c2.6 16.8 33.3 11.7 35.1 11-.1.9-16.1 5.4-29.5.2-5.4-2-5.8-13.1-5.6-11.2"/></g></g><g><defs><path id="au" d="M141.2 89.5h47.7V115h-47.7z"/></defs><clipPath id="av"><use href="#au" overflow="visible"/></clipPath><g clip-path="url(#av)"><path fill="#D0DDDC" d="M186.957 110.087c.4-8.7.4-15.6-16.4-18.2-13.5-2.1-24.7-.3-26.7 2.8-1.2 1.9-1.6 11.2 4.2 20.4-3.9-4.5-9-20.6-5.7-22.2 11.9-5.7 33.9-3.2 41.6.7 1.4.7 3.7 2.6 5 4.7-.1 2.1-1.1 10.7-2 11.8"/></g></g><g><defs><path id="aw" d="M150.2 110.4h36.3v11.7h-36.3z"/></defs><clipPath id="ax"><use href="#aw" overflow="visible"/></clipPath><g clip-path="url(#ax)"><path fill="#D0DDDC" d="M186.383 110.613c-4.6 16.3-34.5 7.5-36.2 6.6 0 .9 15.3 7.3 29.3 3.9 5.6-1.4 7.5-12.4 6.9-10.5"/></g></g><g><defs><path id="ay" d="M87.3 95.2h2v2h-2z"/></defs><clipPath id="az"><use href="#ay" overflow="visible"/></clipPath><g opacity=".25" clip-path="url(#az)"><path fill="#FFF" d="M89.375 96.2c0-.5-.4-1-1-1s-1 .4-1 1 .4 1 1 1 1-.4 1-1"/></g></g><g><defs><path id="aA" d="M166.3 99.9h2v2h-2z"/></defs><clipPath id="aB"><use href="#aA" overflow="visible"/></clipPath><g opacity=".25" clip-path="url(#aB)"><path fill="#FFF" d="M168.375 100.9c0-.5-.4-1-1-1-.5 0-1 .4-1 1s.4 1 1 1c.5 0 1-.5 1-1"/></g></g><g><defs><path id="aC" d="M52 79.1h64.8v9.5H52z"/></defs><clipPath id="aD"><use href="#aC" overflow="visible"/></clipPath><g opacity=".1" clip-path="url(#aD)"><path fill="#D0DDDC" d="M52.025 81.675c2.4 2.7 3.9 3 7.1 2.6 31.1-4 48.3-3.9 56.8 4 1.8 1.7.8-5.1-2.6-6-26.2-6.9-45.2-.7-49.2-.2-4.1.6-7-.3-12.1-.4"/></g></g><g><defs><path id="aE" d="M137.7 82.3h47.9v9.2h-47.9z"/></defs><clipPath id="aF"><use href="#aE" overflow="visible"/></clipPath><g opacity=".1" clip-path="url(#aF)"><path fill="#D0DDDC" d="M138.025 85.675c-.7.7-.4 7.9 3 5.2 9.8-7.8 30.3-6 44.6-1.2-2.3-4.5-19-7.6-28.4-7.5-4.5.2-17.3 1.5-19.2 3.5"/></g></g><path fill="#D0DDDC" d="M197.2 91.4c0 .3-1.6.5-3.5.5s-3.5-.2-3.5-.5 1.6-.5 3.5-.5c2 0 3.5.3 3.5.5M62.4 82.8c0 .3-1.6.3-3.5 0s-3.4-.8-3.3-1.1 1.6-.3 3.5 0c1.9.2 3.4.7 3.3 1.1"/><g><path fill="#FFF" d="M256.04 243.036c-.6-6.1-5.1-8.8-9.2-8.8-1.9 0-3.4.5-4 .8l-.8.4-.7.5c-1 .7-2.7 1.8-4.2 2.3-.1-1.2 0-2.8.2-4.2v-.2c1.1-10.7-1.1-17-6.7-18.6-.9-.3-1.9-.4-2.9-.4-3.4 0-6.4 1.6-8.3 3-1.6-2.1-4.4-3.2-7.8-3.2-5.1 0-9.2 2.4-10.7 6.2-.2.4-.4 1-.6 1.8-3-6.6-9.1-9.1-14.8-9.1-5.4 0-10.6 2.1-12.5 3.6-.1.1-.2.1-.3.2-5.1 3.6-9.1 8.2-11.9 13.7-1.4-4.7-4.4-9.2-9.7-12.5l-.1-.1c-.2-.1-.3-.2-.4-.2 5.3-9.3 9.9-21.7 7.1-33.5-3-12.6-10.4-14.4-14.5-14.4-1.7 0-3.5.3-5.3.9h-.2c-7.8 3.1-11.2 7.7-12 8.8-.8 1.2-9.3 14.2-11.4 33.2-.2 2.1-.5 4.3-.7 6.5-1.2-1.7-3.2-3.3-6.3-4.2-1-.3-2-.4-3-.4-4.3 0-7.8 2.6-9.7 4.4-1.6-2.4-4.2-3.9-7.1-4h-.7c-4.6 0-8.2 2-10.9 4.3-1.7-3-4.9-4.9-8.6-4.9h-1.5c-5.1 0-9.1 2.4-10.7 6.4-.1.3-.3.7-.4 1.2-4-5-9.1-7.3-16-7.3h-.7c-4.3.1-14.9 1.9-21.5 16.6-1 2.3-1.8 4.6-2.4 6.8-1.4-.7-2.8-.8-3.7-.8-3.4 0-6 1.9-7.2 3.8-1 1.5-4.2 6.7-2.6 11.9.9 2.8 2.8 4.9 5.6 6 2.5 1 5.6 1.9 7.9 2.6 1.4 3.3 4 7 8.6 10.5 3.2 2.5 7.4 3.7 12.2 3.7 8.2 0 16.1-3.5 16.9-3.9l.3-.2.1-.1c1.6 1.6 3.6 2.8 6.2 3.3.8.2 1.8.3 3 .3 4.4 0 7.5-2.3 10.4-6.5 2.3 3.7 6.6 5.7 11.6 5.7.3 0 .5.2.9.2 2.6 0 6-.9 8.7-5.4 2.3 4.1 6.5 6.5 11.5 6.5 4.4 0 8.3-1.8 9-2.2l.2-.1c1.5-.8 2.7-1.5 3.7-2 3.3 1.8 8.3 3.7 14.5 3.7 1.1 0 2.1 0 3.2-.2h.6c13-2.6 21.5-5.7 26.6-8.1 3.5 4 9.2 7.8 17.2 8.4.9.1 1.8.1 2.7.1 6.6 0 11.9-1.9 15.8-3.9 1.2 1.3 2.8 2.5 4.8 3.3 1.2.5 2.5.7 3.7.7 8.1 0 11.9-9.6 12.9-12.9l1.9-5.2c1.7 1.8 3.9 3.3 6.7 4.1 1.5.4 3.2.7 4.8.7 8.9 0 17.5-6.3 18.8-7.4 2.3-2.3 4.9-6.5 4.4-12.2"/></g><g><path fill="#E24B31" d="M174.35 245.713s-1.1-4 3.1-11.6 7.4-3.5 7.4-3.5 3.6 3.9-.5 9.7c-4.1 5.8-10 5.4-10 5.4m-32.1 5.5c-4.8 12.5-16.4 7.4-16.4 7.4s-1.3-4.5 2.5-17 12.6-7.6 12.6-7.6 6.1 4.7 1.3 17.2m-8.7-52.5s7.2-18.9 9-9.7c1.8 9.2-15.2 36.5-15.2 36.5.2-6.1 6.2-26.8 6.2-26.8m-103.5 47c.3-12.1 8.2-17.4 11-14.8 2.8 2.6 1.8 8.4-3.5 11.9-5.1 3.6-7.5 2.9-7.5 2.9m219.3-2c-.4-4.1-4.1-2.6-4.1-2.6s-5.9 4.6-11.1 4.1c-5.2-.5-3.5-12.1-3.5-12.1s1.1-10.7-1.9-11.6c-3.1-.9-6.8 2.8-6.8 2.8s-4.7 5.2-6.9 11.8l-.6.2s.7-11.6-.1-14.3c-.6-1.3-6.2-1.2-7.1 1.1-.9 2.3-5.4 18.6-5.7 25.5 0 0-8.8 7.4-16.4 8.7-7.7 1.2-9.5-3.6-9.5-3.6s20.8-5.8 20.1-22.4c-.7-16.6-16.8-10.5-18.6-9.1-1.8 1.3-11.1 7-13.9 22.6-.1.5-.3 2.9-.3 2.9s-8.1 5.4-12.5 6.8c0 0 12.5-21.1-2.8-30.7-6.9-4.2-12.5 4.6-12.5 4.6s20.7-23 16.1-42.5c-2.2-9.3-6.8-10.3-11.1-8.8-6.5 2.6-8.9 6.3-8.9 6.3s-8.4 12.1-10.3 30.2-4.8 39.8-4.8 39.8-4 3.9-7.6 4.1c-3.7.2-2-10.9-2-10.9s2.8-16.9 2.6-19.8-.4-4.4-3.8-5.4c-3.3-1-7 3.3-7 3.3s-9.7 14.7-10.5 16.9l-.5.9-.5-.6s6.8-20 .3-20.3c-6.5-.3-10.8 7.1-10.8 7.1s-7.4 12.5-7.7 13.9l-.5-.6s3.1-14.5 2.5-18.1c-.6-3.6-4-2.8-4-2.8s-4.3-.5-5.4 2.3c-1.1 2.8-5.2 21-5.7 26.8 0 0-10.7 7.7-17.7 7.7-7 .1-6.3-4.5-6.3-4.5s25.8-8.8 18.8-26.3c-3.2-4.5-6.8-5.9-12-5.8-5.2.1-11.3 3.3-15.5 12.6-2 4.5-2.8 8.7-2.8 11.9 0 0-4.8.9-7.3-1.1s-3.9 0-3.9 0-4.3 6.1-.1 7.7c4.2 1.6 10.6 3.2 10.6 3.2.6 2.6 2.3 7 7.4 10.8 7.6 5.8 22.3-.9 22.3-.9l6-3.6s.2 5.4 4.6 6.2c4.4.8 6.2-.1 13.9-18.6 4.5-9.5 4.8-9 4.8-9l.5-.1s-3.5 18.1-2.1 23 7.1 4.4 7.1 4.4 3.2 1.1 5.7-7.9c2.6-9 7.4-18.4 7.4-18.4h.6s-2.1 18.1 1.1 24c3.3 5.9 11.7 1.8 11.7 1.8s5.9-3.1 6.8-4c0 0 7 5.9 16.9 4.8 22.1-4.4 30-10.3 30-10.3s3.8 9.6 15.6 10.5c13.5 1 20.8-7.5 20.8-7.5s-.1 5.5 4.6 7.4c4.7 1.9 7.9-8.3 7.9-8.3l7.9-21.1h.7s.4 13.5 8.2 15.7c7.8 2.2 17.9-5.6 17.9-5.6s2.2-1.1 1.7-5.2"/></g></svg>
diff --git a/devtools/client/debugger/images/sources/express.svg b/devtools/client/debugger/images/sources/express.svg
new file mode 100644
index 0000000000..e49ceb275f
--- /dev/null
+++ b/devtools/client/debugger/images/sources/express.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path fill-rule="evenodd" d="M2.33 8.67H7.9v-.11c.02-.47-.03-.92-.14-1.36a3.4 3.4 0 0 0-.53-1.16A2.76 2.76 0 0 0 4.87 4.9a2.8 2.8 0 0 0-2.1.95c-.29.31-.51.7-.68 1.13a5.53 5.53 0 0 0-.08 2.93c.12.44.3.83.54 1.16.24.33.56.58.94.77.39.18.85.26 1.38.25.78 0 1.45-.22 2-.67.54-.45.86-1.08.95-1.88l.02-.13h-.5v.1c-.12.71-.4 1.23-.83 1.58-.43.35-.99.52-1.67.52-.46 0-.84-.08-1.15-.23a2.07 2.07 0 0 1-.76-.64c-.2-.27-.35-.6-.44-.96a5.2 5.2 0 0 1-.16-1.1zm5.08-.5a3.8 3.8 0 0 0-.16-1c-.11-.35-.27-.66-.48-.93-.21-.26-.47-.47-.78-.62a2.46 2.46 0 0 0-1.1-.23 2.3 2.3 0 0 0-1.76.77 3 3 0 0 0-.55.92c-.13.33-.2.7-.24 1.1H7.4z"/>
+ <path d="M13.32 5.06h.6L11.4 8.39l2.76 3.56h-.62L11.1 8.77l-2.45 3.18h-.6l2.74-3.56-2.5-3.33h.62L11.1 8l2.23-2.94z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/extension.svg b/devtools/client/debugger/images/sources/extension.svg
new file mode 100644
index 0000000000..90ceb53835
--- /dev/null
+++ b/devtools/client/debugger/images/sources/extension.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
+ <path d="M14.1 7.32c-.81 0-.84.84-1.46.84a.64.64 0 0 1-.63-.63v-2.7a.83.83 0 0 0-.83-.84H8.47a.64.64 0 0 1-.63-.63c0-.62.84-.65.84-1.46C8.68 1.18 7.92.65 7 .65c-.92 0-1.67.53-1.67 1.25 0 .81.83.84.83 1.46a.64.64 0 0 1-.62.63H2.83a.83.83 0 0 0-.83.83V6.7a.64.64 0 0 0 .63.62c.62 0 .65-.83 1.46-.83.72 0 1.25.75 1.25 1.67 0 .92-.53 1.67-1.25 1.67-.81 0-.84-.84-1.46-.84a.64.64 0 0 0-.63.63v3.55a.83.83 0 0 0 .83.83h2.72a.64.64 0 0 0 .62-.63c0-.62-.83-.65-.83-1.46 0-.72.75-1.25 1.67-1.25.91 0 1.67.53 1.67 1.25 0 .81-.84.84-.84 1.46a.64.64 0 0 0 .63.63h2.7a.83.83 0 0 0 .84-.83v-2.72a.64.64 0 0 1 .63-.62c.62 0 .65.83 1.46.83.72 0 1.25-.75 1.25-1.67 0-.91-.53-1.67-1.25-1.67z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/immutable.svg b/devtools/client/debugger/images/sources/immutable.svg
new file mode 100644
index 0000000000..6dd7c5047a
--- /dev/null
+++ b/devtools/client/debugger/images/sources/immutable.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M1.06 3.32C1.03 3.35 1 5.5 1 8.06v4.68h3.22V3.26H2.68c-.86 0-1.59.02-1.62.06zM2.75 8c0 3.1-.02 3.55-.14 3.55-.12 0-.14-.46-.14-3.55 0-3.1.02-3.55.14-3.55.12 0 .14.46.14 3.55zM5.2 3.31c-.03.04-.06 2.18-.06 4.75v4.68h3.04l.02-1.66.03-1.67.91 1.34c.5.74.94 1.35.98 1.35.03 0 .47-.6.97-1.36l.92-1.36.02 1.68.02 1.68H15V3.26h-2.44l-1.2 1.8c-.65.98-1.21 1.78-1.24 1.78-.03 0-.6-.8-1.24-1.77L7.67 3.3l-1.2-.02c-.65-.01-1.22 0-1.26.03zM8.5 6.76c.85 1.27 1.58 2.3 1.62 2.3a34 34 0 0 0 1.63-2.3c1.03-1.53 1.61-2.3 1.72-2.3.15 0 .16.22.16 3.54 0 3.1-.02 3.55-.14 3.55-.12 0-.14-.43-.14-3.23 0-1.78-.03-3.22-.07-3.22-.04 0-.76 1-1.59 2.2a34.1 34.1 0 0 1-1.57 2.22c-.04 0-.75-1-1.58-2.21-.82-1.2-1.52-2.2-1.56-2.21-.05 0-.08 1.44-.08 3.22 0 2.8-.01 3.23-.13 3.23-.12 0-.14-.46-.14-3.55 0-3.32 0-3.55.16-3.55.1.01.69.8 1.7 2.3z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/javascript.svg b/devtools/client/debugger/images/sources/javascript.svg
new file mode 100644
index 0000000000..7afb624598
--- /dev/null
+++ b/devtools/client/debugger/images/sources/javascript.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill">
+ <path d="M5 3.55h1.98v5.66c0 2.51-1.2 3.39-3.12 3.39-.47 0-1.07-.08-1.46-.21l.22-1.61c.28.1.64.16 1.02.16.84 0 1.36-.38 1.36-1.74V3.55zm3.7 6.87c.54.28 1.36.54 2.22.54.9 0 1.4-.37 1.4-.95 0-.54-.43-.87-1.49-1.24C9.37 8.24 8.4 7.44 8.4 6.15c0-1.5 1.27-2.65 3.33-2.65 1 0 1.73.21 2.26.46l-.45 1.58a4.13 4.13 0 0 0-1.83-.42c-.87 0-1.28.42-1.28.86 0 .56.49.81 1.63 1.26 1.56.57 2.28 1.37 2.28 2.63 0 1.48-1.13 2.73-3.55 2.73-1 0-1.99-.28-2.49-.55l.4-1.63z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/jquery.svg b/devtools/client/debugger/images/sources/jquery.svg
new file mode 100644
index 0000000000..57d81efa1e
--- /dev/null
+++ b/devtools/client/debugger/images/sources/jquery.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M8.15 11.8a5.64 5.64 0 0 1-1.5-.58 7.27 7.27 0 0 1-2.52-2.17C2.92 7.39 2.48 5.1 3.45 3.23L2.6 4.32c-1.1 1.58-.96 3.65-.12 5.33a6.92 6.92 0 0 0 3 3.08 7.07 7.07 0 0 0 1.36.55c.08.03.16.06.24.07 5.33.98 6.88-3.2 6.88-3.2-1.3 1.7-3.6 2.14-5.8 1.64zM6.23 7.46a5.15 5.15 0 0 0 2.95 2.05c4.12.68 5.07-2.49 5.07-2.49-.86 1.24-2.52 1.83-4.29 1.37a5.4 5.4 0 0 1-1.9-.96 4.97 4.97 0 0 1-1.69-2.4c-.3-.98-.24-2.08.3-2.98L6 2.98a3.83 3.83 0 0 0-.13 3.9c.1.2.22.4.35.59zm4.34-1.42l.3.1c2.27.43 2.89-1.18 3.05-1.41-.54.78-1.45.96-2.56.7a3.1 3.1 0 0 1-1.15-.57c-1-.75-1.62-2.2-.97-3.37l-.35.48A2.4 2.4 0 0 0 8.7 4.3a3.26 3.26 0 0 0 1.87 1.75z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/lodash.svg b/devtools/client/debugger/images/sources/lodash.svg
new file mode 100644
index 0000000000..bf8022cd6d
--- /dev/null
+++ b/devtools/client/debugger/images/sources/lodash.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M2 2.65h1.12v7.42h4.42V11H2V2.65zm9.03 2.01a2.76 2.76 0 0 0-2.64 1.82 3.6 3.6 0 0 0 .72 3.84c.96.8 2.42.86 3.5.3a2.63 2.63 0 0 0 1.33-2.02c.13-.87.06-1.81-.36-2.6a2.8 2.8 0 0 0-2.44-1.33l-.11-.02v.01zm.1.89c.84 0 1.6.64 1.73 1.46.26.93.1 2.07-.66 2.73-.71.58-1.86.5-2.44-.22-.71-.76-.71-1.93-.35-2.85.26-.66.93-1.13 1.65-1.12h.09-.02z"/>
+ <path opacity=".6" d="M2 12.17h12v1.27H2v-1.27z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/marko.svg b/devtools/client/debugger/images/sources/marko.svg
new file mode 100644
index 0000000000..79defc2f5c
--- /dev/null
+++ b/devtools/client/debugger/images/sources/marko.svg
@@ -0,0 +1,64 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="256px" height="140px" viewBox="0 0 256 140" version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid">
+ <defs>
+ <linearGradient x1="49.9109718%" y1="99.9084071%" x2="49.9109718%" y2="-0.0902654867%" id="linearGradient-1">
+ <stop stop-color="#8AC23E" offset="0%"></stop>
+ <stop stop-color="#8AC23E" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="49.9835165%" y1="0.0637125664%" x2="49.9835165%" y2="100.062389%" id="linearGradient-2">
+ <stop stop-color="#698932" offset="0%"></stop>
+ <stop stop-color="#698932" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="50.0595611%" y1="0.0637125664%" x2="50.0595611%" y2="100.062389%" id="linearGradient-3">
+ <stop stop-color="#FFED01" offset="0%"></stop>
+ <stop stop-color="#FFED01" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="50.0170846%" y1="0.0637125664%" x2="50.0170846%" y2="100.092699%" id="linearGradient-4">
+ <stop stop-color="#E02A89" offset="0%"></stop>
+ <stop stop-color="#E02A89" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="49.9631661%" y1="-0.0915929204%" x2="49.9631661%" y2="99.9070796%" id="linearGradient-5">
+ <stop stop-color="#7F1E4F" offset="0%"></stop>
+ <stop stop-color="#7F1E4F" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="49.9652038%" y1="-0.0915929204%" x2="49.9652038%" y2="99.9070796%" id="linearGradient-6">
+ <stop stop-color="#E95506" offset="0%"></stop>
+ <stop stop-color="#E95506" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="49.9766458%" y1="99.9084071%" x2="49.9766458%" y2="-0.0265486726%" id="linearGradient-7">
+ <stop stop-color="#88D0F1" offset="0%"></stop>
+ <stop stop-color="#88D0F1" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="50.0205329%" y1="0.0637125664%" x2="50.0205329%" y2="99.9986726%" id="linearGradient-8">
+ <stop stop-color="#00828B" offset="0%"></stop>
+ <stop stop-color="#00828B" stop-opacity="0" offset="83.25%"></stop>
+ </linearGradient>
+ <linearGradient x1="50.078022%" y1="99.9752212%" x2="50.078022%" y2="0.0705752212%" id="linearGradient-9">
+ <stop stop-color="#2073BA" offset="0%"></stop>
+ <stop stop-color="#2073BA" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ <linearGradient x1="50.0177116%" y1="0.0637125664%" x2="50.0177116%" y2="99.9986726%" id="linearGradient-10">
+ <stop stop-color="#8ED0E1" offset="0%"></stop>
+ <stop stop-color="#88D0F1" stop-opacity="0" offset="100%"></stop>
+ </linearGradient>
+ </defs>
+ <g>
+ <path d="M128.1,0 L164.2,0 C150.9,21.8 136.2,45.8 121.5,69.7 L85.4,69.7 C100.1,45.8 114.8,21.8 128.1,0 Z" fill="#8DC220"></path>
+ <path d="M42.7,0 L78.8,0 C71.7,11.6 64.5,23.3 57.4,34.9 C50.3,46.5 43.2,58.1 36.1,69.7 C43.2,81.3 50.3,93 57.4,104.6 C64.5,116.2 71.6,127.8 78.8,139.4 L42.7,139.4 C35.6,127.8 28.4,116.2 21.3,104.6 C14.2,93.1 7.1,81.4 0,69.8 C7.1,58.2 14.2,46.6 21.3,35 C28.4,23.3 35.6,11.7 42.7,0 Z" fill="#44BFEF"></path>
+ <path d="M42.7,0 L42.7,0 C57.4,24 72.1,48 85.4,69.7 L121.5,69.7 C108.2,48 93.5,24 78.8,0 L78.8,0 L42.7,0 Z" fill="#00AC71"></path>
+ <path d="M164.2,0 L128.1,0 C135.2,11.6 142.3,23.3 149.5,34.9 C156.6,46.5 163.7,58.1 170.9,69.7 C163.8,81.3 156.6,93 149.5,104.6 C142.4,116.2 135.3,127.8 128.1,139.4 L164.2,139.4 C171.3,127.8 178.4,116.2 185.6,104.6 C192.7,93 199.8,81.4 207,69.7 C199.8,58.1 192.7,46.5 185.6,34.9 C178.5,23.3 171.3,11.7 164.2,0 Z" fill="#F9BC00"></path>
+ <path d="M149.3,24.6 L113.2,24.6 C108.6,32.1 104,39.7 99.4,47.2 C94.8,54.7 90.2,62.3 85.5,69.8 L121.6,69.8 C126.2,62.3 130.9,54.7 135.5,47.2 C140,39.6 144.6,32.1 149.3,24.6 Z" fill="url(#linearGradient-1)"></path>
+ <path d="M100.5,45.2 L136.6,45.2 C141.2,37.7 145.8,30.1 150.4,22.6 C155,15.1 159.6,7.5 164.2,0 L128.1,0 C123.5,7.5 118.9,15.1 114.3,22.6 C109.7,30.2 105.1,37.7 100.5,45.2 Z" fill="url(#linearGradient-2)"></path>
+ <path d="M191.9,45.2 L155.8,45.2 C151.2,37.7 146.5,30.1 141.9,22.6 C137.3,15.1 132.7,7.5 128.1,0 L164.2,0 C168.8,7.5 173.4,15.1 178,22.6 C182.7,30.2 187.3,37.7 191.9,45.2 Z" fill="url(#linearGradient-3)"></path>
+ <path d="M213.2,0 L177.1,0 C184.2,11.7 191.3,23.3 198.4,34.9 C205.5,46.5 212.7,58.1 219.8,69.7 C212.7,81.3 205.5,93 198.4,104.6 C191.3,116.2 184.2,127.8 177,139.4 L213.1,139.4 C220.2,127.8 227.3,116.2 234.5,104.6 C241.6,93 248.7,81.4 255.9,69.7 C248.8,58.1 241.7,46.5 234.5,34.9 C227.5,23.3 220.3,11.7 213.2,0 Z" fill="#DF1B1C"></path>
+ <path d="M240.9,45.2 L204.8,45.2 C200.1,37.7 195.5,30.1 190.9,22.6 C186.3,15.1 181.7,7.5 177.1,0 L213.2,0 C217.8,7.5 222.4,15.1 227,22.6 C231.6,30.2 236.3,37.7 240.9,45.2 Z" fill="url(#linearGradient-4)"></path>
+ <path d="M192.2,115 L228.3,115 C232.9,107.5 237.5,100 242.1,92.4 C246.7,84.9 251.3,77.3 256,69.8 L219.8,69.8 C215.2,77.3 210.6,84.9 206,92.4 C201.4,99.9 196.8,107.4 192.2,115 Z" fill="url(#linearGradient-5)"></path>
+ <path d="M143.2,115 L179.3,115 C183.9,107.5 188.5,99.9 193.1,92.4 C197.7,84.9 202.3,77.3 207,69.8 L170.9,69.8 C166.3,77.3 161.7,84.9 157.1,92.4 C152.4,99.9 147.8,107.4 143.2,115 Z" fill="url(#linearGradient-6)"></path>
+ <path d="M63.8,24.6 L27.7,24.6 C23.1,32.1 18.5,39.7 13.9,47.2 C9.2,54.7 4.6,62.3 0,69.8 L36.1,69.8 C40.7,62.3 45.3,54.8 49.9,47.2 C54.5,39.7 59.1,32.1 63.8,24.6 Z" fill="url(#linearGradient-7)"></path>
+ <path d="M15,45.2 L51.1,45.2 C55.7,37.7 60.3,30.1 64.9,22.6 C69.6,15.1 74.2,7.5 78.8,0 L42.7,0 C38.1,7.5 33.5,15 28.9,22.6 C24.3,30.1 19.7,37.7 15,45.2 Z" fill="url(#linearGradient-8)"></path>
+ <path d="M15,94.3 L51.1,94.3 C55.7,101.8 60.3,109.4 64.9,116.9 C69.5,124.4 74.1,132 78.7,139.5 L42.6,139.5 C38,132 33.3,124.5 28.7,116.9 C24.2,109.4 19.6,101.9 15,94.3 Z" fill="url(#linearGradient-9)"></path>
+ <path d="M106.5,45.2 L70.4,45.2 C65.8,37.7 61.2,30.1 56.6,22.6 C51.9,15.1 47.3,7.5 42.7,0 L78.8,0 C83.4,7.5 88,15 92.6,22.6 C97.3,30.1 101.9,37.7 106.5,45.2 Z" fill="url(#linearGradient-10)"></path>
+ </g>
+</svg>
diff --git a/devtools/client/debugger/images/sources/mobx.svg b/devtools/client/debugger/images/sources/mobx.svg
new file mode 100644
index 0000000000..dacdf0cdc0
--- /dev/null
+++ b/devtools/client/debugger/images/sources/mobx.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path fill="#E05D17" d="M1 1h14v14H1z"/>
+ <path d="M4.9 12h-2v-.64h1.23V4.18H2.9v-.64h2V12zM10.1 5.84c-.24.85-.5 1.66-.82 2.44-.31.79-.61 1.49-.9 2.1h-.75c-.3-.61-.6-1.31-.9-2.1a22.5 22.5 0 0 1-.82-2.44h.89a18.18 18.18 0 0 0 .56 1.87 34.01 34.01 0 0 0 .66 1.72 17.98 17.98 0 0 0 .65-1.72 26.87 26.87 0 0 0 .57-1.87h.86zM11.1 3.54h2v.64h-1.23v7.18h1.23V12h-2V3.54z" fill="#fff"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/nextjs.svg b/devtools/client/debugger/images/sources/nextjs.svg
new file mode 100644
index 0000000000..19d3a5ec3c
--- /dev/null
+++ b/devtools/client/debugger/images/sources/nextjs.svg
@@ -0,0 +1,17 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" style="background: #FFFFFF;">
+ <title>Zeit - Black on white logo</title>
+ <defs>
+ <linearGradient x1="114.720775%" y1="181.283245%" x2="39.5399306%" y2="100%" id="linearGradient-1">
+ <stop stop-color="#FFFFFF" offset="0%"></stop>
+ <stop stop-color="#000000" offset="100%"></stop>
+ </linearGradient>
+ </defs>
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Black-on-white" fill="url(#linearGradient-1)">
+ <polygon id="Triangle-3-Copy" points="254 156 367 356 141 356"></polygon>
+ </g>
+ </g>
+</svg>
diff --git a/devtools/client/debugger/images/sources/node.svg b/devtools/client/debugger/images/sources/node.svg
new file mode 100644
index 0000000000..3ecdca040f
--- /dev/null
+++ b/devtools/client/debugger/images/sources/node.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path fill="#83CD29" d="M14.42 3.6L8.65.27c-.36-.2-.85-.2-1.2 0L1.62 3.6c-.37.22-.63.62-.63 1.06v6.69c0 .43.26.84.64 1.06l1.53.87c.75.35.94.35 1.28.35 1.09 0 1.65-.66 1.65-1.8v-6.6c0-.1.07-.24-.04-.24h-.73c-.09 0-.28.14-.28.23v6.6c0 .51-.47 1-1.33.59l-1.58-.92a.18.18 0 0 1-.1-.16V4.66c0-.07.07-.13.12-.16l5.8-3.33a.22.22 0 0 1 .19 0l5.74 3.33c.05.04.05.1.05.16v6.68c0 .07.01.13-.04.16l-5.77 3.33a.19.19 0 0 1-.16 0l-1.49-.88c-.03-.02-.1-.04-.14-.01-.4.23-.48.27-.87.4-.08.03-.23.08.06.25l1.93 1.14c.18.1.4.16.61.16.22 0 .42-.05.61-.16l5.76-3.34c.37-.22.56-.62.56-1.06V4.66c-.01-.44-.2-.83-.58-1.05zm-4.57 6.68c-1.54 0-1.87-.42-1.98-1.19-.02-.07-.08-.18-.17-.18h-.75c-.1 0-.17.12-.17.2 0 .98.54 2.17 3.07 2.17 1.83 0 2.89-.72 2.89-1.97s-.85-1.58-2.62-1.82c-1.8-.24-1.99-.35-1.99-.77 0-.35.16-.81 1.49-.81 1.19 0 1.62.26 1.8 1.06.01.08.09.13.17.13h.75c.05 0 .09-.01.13-.05.02-.04.05-.08.04-.13-.12-1.38-1.04-2.02-2.9-2.02-1.64 0-2.63.7-2.63 1.87 0 1.26.99 1.62 2.57 1.77 1.9.2 2.05.46 2.05.83-.01.64-.53.91-1.75.91z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/nuxtjs.svg b/devtools/client/debugger/images/sources/nuxtjs.svg
new file mode 100644
index 0000000000..bf9172a87d
--- /dev/null
+++ b/devtools/client/debugger/images/sources/nuxtjs.svg
@@ -0,0 +1,4 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><style>.st0{display:none}.st1{display:inline}.st2{fill:#222}.st3{fill:#41b883}.st4{fill:#328170}.st5{fill:#35495e}</style><g id="express" class="st0"><g class="st1"><path class="st2" d="M24.5 870.5v-376H494v-22H24.5v-343h499.1v-22H2.5v785H528v-22H24.5z"/><path class="st2" d="M951.3 327.4L756.7 583.6 566.5 327.4h-28.6l205.6 272.7-225.4 292.4h26.4l212.2-276 213.3 276h27.5L771 600l206.7-272.6h-26.4z"/></g></g><g id="nuxt"><path class="st3" d="M317.9 852H3.7l408.1-704 408.1 704H507.7"/><path class="st4" d="M779.8 852h216.5l-354-608.5-351 608.5h216.5"/><path class="st5" d="M651.2 852h159.5L549.9 403.8 291.3 852h159.5"/></g></svg>
diff --git a/devtools/client/debugger/images/sources/preact.svg b/devtools/client/debugger/images/sources/preact.svg
new file mode 100644
index 0000000000..d860af54b6
--- /dev/null
+++ b/devtools/client/debugger/images/sources/preact.svg
@@ -0,0 +1,11 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="256px" height="296px" viewBox="0 0 256 296" version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid">
+ <g>
+ <polygon fill="#673AB8" points="128 0 256 73.8999491 256 221.699847 128 295.599796 0 221.699847 0 73.8999491"></polygon>
+ <path d="M34.8647584,220.478469 C51.8814262,242.25881 105.959701,225.662965 157.014868,185.774297 C208.070035,145.885628 237.255632,97.428608 220.238964,75.6482664 C203.222296,53.8679249 149.144022,70.4637701 98.0888543,110.352439 C47.0336869,150.241107 17.8480906,198.698127 34.8647584,220.478469 Z M42.1343351,214.798853 C36.4908625,207.575537 38.9565723,193.395881 49.7081913,175.544904 C61.0297348,156.747677 80.2490923,135.997367 103.76847,117.622015 C127.287848,99.2466634 152.071368,85.6181573 173.049166,79.1803727 C192.970945,73.066665 207.325915,74.1045667 212.969387,81.3278822 C218.61286,88.5511977 216.14715,102.730854 205.395531,120.581832 C194.073987,139.379058 174.85463,160.129368 151.335252,178.50472 C127.815874,196.880072 103.032354,210.508578 82.054556,216.946362 C62.1327769,223.06007 47.7778077,222.022168 42.1343351,214.798853 Z" fill="#FFFFFF"></path>
+ <path d="M220.238964,220.478469 C237.255632,198.698127 208.070035,150.241107 157.014868,110.352439 C105.959701,70.4637701 51.8814262,53.8679249 34.8647584,75.6482664 C17.8480906,97.428608 47.0336869,145.885628 98.0888543,185.774297 C149.144022,225.662965 203.222296,242.25881 220.238964,220.478469 Z M212.969387,214.798853 C207.325915,222.022168 192.970945,223.06007 173.049166,216.946362 C152.071368,210.508578 127.287848,196.880072 103.76847,178.50472 C80.2490923,160.129368 61.0297348,139.379058 49.7081913,120.581832 C38.9565723,102.730854 36.4908625,88.5511977 42.1343351,81.3278822 C47.7778077,74.1045667 62.1327769,73.066665 82.054556,79.1803727 C103.032354,85.6181573 127.815874,99.2466634 151.335252,117.622015 C174.85463,135.997367 194.073987,156.747677 205.395531,175.544904 C216.14715,193.395881 218.61286,207.575537 212.969387,214.798853 Z" fill="#FFFFFF"></path>
+ <path d="M127.551861,167.666971 C138.378632,167.666971 147.155465,158.890139 147.155465,148.063368 C147.155465,137.236596 138.378632,128.459764 127.551861,128.459764 C116.72509,128.459764 107.948257,137.236596 107.948257,148.063368 C107.948257,158.890139 116.72509,167.666971 127.551861,167.666971 L127.551861,167.666971 Z" fill="#FFFFFF"></path>
+ </g>
+</svg>
diff --git a/devtools/client/debugger/images/sources/pug.svg b/devtools/client/debugger/images/sources/pug.svg
new file mode 100644
index 0000000000..0f8eb42b64
--- /dev/null
+++ b/devtools/client/debugger/images/sources/pug.svg
@@ -0,0 +1,118 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
+ viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
+<style type="text/css">
+ .st0{fill:#C1272D;}
+ .st1{fill:#EFCCA3;}
+ .st2{fill:#ED1C24;}
+ .st3{fill:#CCAC8D;}
+ .st4{fill:#FFFFFF;}
+ .st5{fill:#FF931E;}
+ .st6{fill:#FFB81E;}
+ .st7{fill:#56332B;}
+ .st8{fill:#442823;}
+ .st9{fill:#7F4A41;}
+ .st10{fill:#331712;}
+ .st11{fill:#FFCC66;}
+ .st12{fill:#CCCCCC;}
+ .st13{fill:#B3B3B3;}
+ .st14{fill:#989898;}
+ .st15{fill:#323232;}
+ .st16{fill:#1E1E1E;}
+ .st17{fill:#4C4C4C;}
+ .st18{fill:#E6E6E6;}
+ .st19{fill:#606060;}
+</style>
+<g>
+ <path class="st1" d="M107.4,50.9c-0.2-4.4,0.4-8.3-1.6-11.6c-4.8-8.2-16.8-13-40.8-13V27c0,0-0.5,0-0.5,0c0,0,0.5,0,0.5,0v-0.7
+ c-24,0-36.6,4.8-41.4,13.1c-1.9,3.4-1.7,7.2-2,11.6c-0.2,3.5-1.8,7.2-1.1,11.2c0.8,5.2,1.1,10.4,1.9,15.2c0.6,3.9,6,7.2,6.5,10.9
+ c1.4,10.2,12,14.9,36,14.9v0.8h-0.6h0.1H65v-0.8c24,0,34.2-4.7,35.5-14.9c0.5-3.8,5.5-7,6.1-10.9c0.8-4.8,1.1-10,1.9-15.2
+ C109.2,58.2,107.6,54.4,107.4,50.9z"/>
+ <path class="st3" d="M64.6,54.5c4.3,0.1,7.3,2.8,10.1,5.3c3.3,2.9,8.9,4.9,11.2,7.4c2.3,2.5,5.3,5,6.4,8.9
+ c1.1,3.9,1.4,8.9,1.4,10.2c0,1.3,0.7,1,2.7,0c4.7-2.3,9.9-8.5,9.9-8.5c-0.6,3.9-5.7,7.4-6.2,11.1C98.9,99.1,89,104,64.5,104h-0.1h0
+ H65"/>
+ <path class="st3" d="M80.4,46.7c0.9,3.1,4.1,13.6-2.1,10.1c0,0,2.6,1.5,4.2,7.2c1.7,5.7,5.8,6.4,5.8,6.4s6.7,1.3,11.7-3
+ c4.2-3.6,4.9-10,3.1-14.9c-1.8-4.8-5-6.3-9.7-7.3C88.7,44.1,79.3,43.2,80.4,46.7z"/>
+ <g>
+ <circle cx="92.3" cy="58.1" r="8.8"/>
+ <circle class="st4" cx="90" cy="54.2" r="2.3"/>
+ </g>
+ <path class="st1" d="M78.9,57.7c0,0,7.9,5.4,12.2,10.7c4.3,5.3,4.2,6.3,4.2,6.3l-3.1,1.4c0,0-4.4-8.3-9.8-11.4
+ c-5.5-3.1-6.1-5.7-6.1-5.7L78.9,57.7z"/>
+ <path class="st3" d="M64.9,54.5c-4.3,0.1-7.5,2.8-10.4,5.3c-3.3,2.9-9.1,4.9-11.4,7.4c-2.3,2.5-5.4,5-6.5,8.9
+ c-1.1,3.9-1.5,8.9-1.5,10.2c0,1.3,0.2,1.4-2.7,0c-4.7-2.2-9.9-8.5-9.9-8.5c0.6,3.9,5.7,7.4,6.2,11.1C30.1,99.1,40,104,64.5,104h0.1
+ h0H65"/>
+ <path class="st7" d="M88.1,71.4C83.3,65.5,75.6,60,64.9,60h-0.1h0c-10.7,0-18.4,5.5-23.2,11.4c-5,6.1-4.6,8.5-4.6,14.3
+ c0,21,7.4,15,12.3,17.6c5,2.5,10.2,1.7,15.5,1.7h0h0.1c5.4,0,10.5,0.7,15.5-1.8c4.9-2.5,12.3,3.7,12.3-17.3
+ C92.8,80.1,93.1,77.5,88.1,71.4z"/>
+ <path class="st8" d="M64.4,65.2c0,0-0.7,9.7-2.1,11.6l2.6-0.6L64.4,65.2z"/>
+ <path class="st8" d="M65.1,65.2c0,0,0.7,9.7,2.1,11.6l-2.6-0.6L65.1,65.2z"/>
+ <path class="st7" d="M56.7,62.9c-1-2.3,2.6-6,8.3-6.1c5.7,0,9.3,3.7,8.3,6.1c-1,2.4-4.6,3.1-8.3,3.2C61.4,66,57.7,65.3,56.7,62.9z"
+ />
+ <path d="M65,65.2c0-0.4,3.4-0.5,5.2-1.7c0,0-3.7,1.2-4.5,0.7c-0.8-0.4-1-1.6-1-1.6s-0.3,1.2-0.9,1.6c-0.7,0.4-4.9-0.7-4.9-0.7
+ s5.6,1.4,5.6,1.7c0,0.3-0.1,1.3-0.1,2c0,2.5,0,8.7,0.4,9.2c0.6,0.9,0.4-6.7,0.4-9.2C65.1,66.4,65.1,65.6,65,65.2z"/>
+ <path class="st9" d="M65.2,78.6c1.7,0,4.7,1.2,7.4,3.1c-2.6-2.9-5.7-4.9-7.4-4.9c-1.8,0-5.6,2.2-8.3,5.4
+ C59.7,80,63.3,78.6,65.2,78.6z"/>
+ <path class="st8" d="M64.5,96.3c-3.8,0-7.5-1.2-10.9-2.1c-0.7-0.2-1.4,0.3-2.1,0.1c-6.3-2-11.4-5.4-14.5-9.7c0,0.3,0,0.7,0,1
+ c0,21,7.4,15.1,12.3,17.6c5,2.5,10.2,1.7,15.5,1.7h0h0.1c5.4,0,10.5,0.7,15.5-1.8c4.9-2.5,12.3,3.6,12.3-17.4c0-0.8,0-1.6,0.1-2.3
+ c-2.9,4.7-8.2,8.4-14.8,10.6c-0.6,0.2-2-0.3-2.6-0.2C71.8,95,68.6,96.3,64.5,96.3z"/>
+ <path class="st8" d="M55,85c0,0-2.5,7.5-0.8,10.8l-2.3-1C51.9,94.8,53.6,87.2,55,85z"/>
+ <path class="st8" d="M74.8,85c0,0,2.5,7.5,0.8,10.8l2.3-1C77.9,94.8,76.1,87.2,74.8,85z"/>
+ <path class="st3" d="M48.6,46.7c-0.9,3.1-4.1,13.6,2.1,10.1c0,0-2.6,1.5-4.2,7.2s-5.8,6.4-5.8,6.4s-6.7,1.3-11.7-3
+ c-4.2-3.6-4.9-10-3.1-14.9s5-6.3,9.7-7.3C40.3,44.1,49.6,43.2,48.6,46.7z"/>
+ <path d="M64.9,76.8c2.7,0,11.1,5.8,11.2,12.9c0-0.1,0-0.2,0-0.4c0-7.4-6.8-13.3-11.2-13.3c-4.4,0-11.2,6-11.2,13.3
+ c0,0.1,0,0.2,0,0.4C53.8,82.6,62.2,76.8,64.9,76.8z"/>
+ <g>
+
+ <ellipse transform="matrix(0.9683 -0.2497 0.2497 0.9683 -13.2339 18.6065)" class="st10" cx="66.7" cy="61.5" rx="0.8" ry="1.5"/>
+
+ <ellipse transform="matrix(0.9551 0.2963 -0.2963 0.9551 21.0115 -15.7209)" class="st10" cx="62.4" cy="61.5" rx="0.8" ry="1.5"/>
+ </g>
+ <g>
+ <circle cx="37.2" cy="58.1" r="8.8"/>
+ <circle class="st4" cx="39.5" cy="54.2" r="2.3"/>
+ </g>
+ <g>
+ <path class="st9" d="M67.5,58.2c0-0.1-2.3,1-2.9,1.1c-0.6-0.1-2.9-1.2-2.9-1.1c0,0,1.9,0,2.9,0C65.6,58.2,67.5,58.2,67.5,58.2z"/>
+ </g>
+ <path class="st1" d="M50,57.7c0,0-7.9,5.4-12.2,10.7c-4.3,5.3-4.2,6.3-4.2,6.3l3.1,1.4c0,0,4.4-8.3,9.8-11.4s6.1-5.7,6.1-5.7
+ L50,57.7z"/>
+ <path class="st3" d="M32.7,41.7c0,0-2.7,7.4-8.7,10.5C24,52.2,33.4,51.1,32.7,41.7z"/>
+ <path class="st3" d="M95.8,41.7c0,0,2.7,7.4,8.7,10.5C104.5,52.2,95.1,51.1,95.8,41.7z"/>
+ <path class="st3" d="M78.7,55.5c0,0-5.9-6.2-13.8-6.4l0,0c-0.1,0,0.2,0,0.1,0c-0.1,0,0.1,0,0.1,0v0c-8,0.2-13.8,6.4-13.8,6.4
+ c6.9-4.8,12.8-4.7,13.8-4.7v0c0,0,0,0,0,0c0,0,0,0,0,0v0C65,50.8,71.8,50.7,78.7,55.5z"/>
+ <path class="st3" d="M71.8,42.5c0,0-3-4.2-7-4.3l0,0c0,0,0.1,0,0.1,0c0,0,0.1,0,0.1,0v0c-3,0.1-6.9,4.3-6.9,4.3
+ c3.4-3.3,6.9-3.2,6.9-3.2v0c0,0,0,0,0,0c0,0,0,0,0,0v0C65,39.3,68.3,39.2,71.8,42.5z"/>
+ <path class="st3" d="M37.2,73.2c0,0-4.7,2.3-8.1,0.9l0,0c0,0-0.1,0-0.1,0c0,0,0,0,0,0v0c-3-1.7-4.5-6.8-4.5-6.8
+ S27.5,76.3,37.2,73.2z"/>
+ <path class="st3" d="M92,73.2c0,0,4.7,2.3,8.1,0.9l0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c4-1.7,4.6-6.8,4.6-6.8S101.7,76.3,92,73.2z"/>
+ <g>
+ <path class="st3" d="M42.6,41.2c2.6-0.5,6.9-0.6,10.3,0.5c4.3,1.5,0.8,7,1.7,7.3c0.9,0.3,2.1-3.8,10.1-3.4c8.1,0.4,9,4,10.1,3.4
+ s-1.1-10,11-7.8c0,0-12.7-3.4-12.1,5.8c0,0-7.3-5.6-17.5-0.6C56.3,46.4,58.9,37.8,42.6,41.2z"/>
+ </g>
+ <path class="st3" d="M86.9,41.2c0.2,0,0.3,0.1,0.4,0.1C87.4,41.3,87.2,41.2,86.9,41.2z"/>
+ <path class="st3" d="M86.9,41.2C86.9,41.2,86.9,41.2,86.9,41.2C86.9,41.2,86.9,41.2,86.9,41.2z"/>
+ <path class="st3" d="M39.1,28.9c0,0-10.8,13.6-12.4,18.8c-1.6,5.3-2.8,27-4.2,30.1l-5-21.4l9.2-22.3L39.1,28.9z"/>
+ <path class="st3" d="M89.9,28.9c0,0,10.8,13.6,12.4,18.8c1.6,5.3,2.8,27,4.2,30.1l5-21.4l-9.2-22.3L89.9,28.9z"/>
+ <path class="st7" d="M89.4,28.9c0,0,11.6,9.7,15,20.9c3.4,11.2,2,24.8,4.6,26.5c3.7,2.4,7.9-11.9,9.3-13.4c2.2-2.4,9.5-8.5,10-9.6
+ c0.5-1.1-14.8-17.8-21.5-21.1C98.7,28.4,88.7,28.1,89.4,28.9z"/>
+ <path class="st8" d="M99.3,34.9c0,0,13.7,17.5,13.5,39.3l5.5-11.2C118.2,63,113.4,48.7,99.3,34.9z"/>
+ <path class="st7" d="M39.1,28.9c0,0-11.6,9.7-15,20.9s-2,24.8-4.6,26.5c-3.7,2.4-7.9-11.9-9.3-13.4c-2.2-2.4-9.5-8.5-10-9.6
+ c-0.5-1.1,14.8-17.8,21.5-21.1C29.8,28.4,39.8,28.1,39.1,28.9z"/>
+ <path class="st8" d="M29.2,34.9c0,0-13.7,17.5-13.5,39.3L10.3,63C10.3,63,15.1,48.7,29.2,34.9z"/>
+ <path class="st3" d="M21.8,74.6c0,0,1,5.4,2.6,7.1s0.5-1.3,0.5-1.3s-1.7-0.9-1.4-7.8S21.8,74.6,21.8,74.6z"/>
+ <path class="st3" d="M107.1,74.6c0,0-1,5.4-2.6,7.1s-0.5-1.3-0.5-1.3s1.7-0.9,1.4-7.8S107.1,74.6,107.1,74.6z"/>
+ <g>
+ <circle class="st8" cx="54.5" cy="70.5" r="0.8"/>
+ <circle class="st8" cx="49.9" cy="75.3" r="0.8"/>
+ <circle class="st8" cx="48.4" cy="70.5" r="0.8"/>
+ </g>
+ <g>
+ <circle class="st8" cx="74" cy="70.5" r="0.8"/>
+ <circle class="st8" cx="78.6" cy="75.3" r="0.8"/>
+ <circle class="st8" cx="80.1" cy="70.5" r="0.8"/>
+ </g>
+</g>
+</svg>
diff --git a/devtools/client/debugger/images/sources/react.svg b/devtools/client/debugger/images/sources/react.svg
new file mode 100644
index 0000000000..5dc19e92e1
--- /dev/null
+++ b/devtools/client/debugger/images/sources/react.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill">
+ <path d="M8 9.2a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zM.68 8C.68 8.93 2 9.49 2.7 9.76c1.34.5 3.2.83 5.29.83 2.08 0 3.95-.32 5.3-.83.7-.27 2.02-.83 2.02-1.76S14 6.51 13.3 6.24A15.4 15.4 0 0 0 8 5.41c-2.08 0-3.95.32-5.3.83C2 6.51.69 7.07.69 8zm1.8-2.37C3.9 5.08 5.85 4.75 8 4.75c2.14 0 4.1.33 5.53.88 1 .38 2.45 1.1 2.45 2.37 0 1.26-1.45 2-2.45 2.37-1.43.55-3.39.88-5.53.88s-4.1-.33-5.53-.88C1.47 10 .02 9.27.02 8c0-1.26 1.45-2 2.45-2.37zM4.34 1.66c-.81.47-.63 1.9-.5 2.63.22 1.42.87 3.2 1.92 5a15.4 15.4 0 0 0 3.36 4.17c.59.48 1.73 1.35 2.54.88.81-.47.63-1.89.5-2.63a15.4 15.4 0 0 0-1.92-5 15.4 15.4 0 0 0-3.36-4.17c-.59-.48-1.73-1.35-2.54-.88zm2.95.36c1.2.97 2.45 2.5 3.53 4.35a16.05 16.05 0 0 1 2 5.23c.17 1.06.26 2.68-.83 3.31-1.1.63-2.45-.26-3.28-.93a16.05 16.05 0 0 1-3.53-4.35 16.05 16.05 0 0 1-2-5.23c-.17-1.06-.26-2.68.83-3.31 1.1-.63 2.45.26 3.28.93zM11.66 1.66c-.8-.47-1.95.4-2.54.88A15.4 15.4 0 0 0 5.76 6.7a15.4 15.4 0 0 0-1.93 5c-.12.75-.3 2.17.5 2.64.82.47 1.96-.4 2.55-.88a15.4 15.4 0 0 0 3.36-4.16 15.4 15.4 0 0 0 1.93-5c.12-.75.3-2.17-.5-2.64zm1.16 2.74a16.05 16.05 0 0 1-2 5.23 16.05 16.05 0 0 1-3.53 4.35c-.83.67-2.19 1.56-3.28.93-1.1-.63-1-2.25-.83-3.3.24-1.52.93-3.38 2-5.24a16.05 16.05 0 0 1 3.53-4.35c.83-.67 2.19-1.56 3.28-.93 1.1.63 1 2.25.83 3.3z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/redux.svg b/devtools/client/debugger/images/sources/redux.svg
new file mode 100644
index 0000000000..0ae6f5f888
--- /dev/null
+++ b/devtools/client/debugger/images/sources/redux.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M10.7 10.28a1 1 0 0 0-.1-2h-.04a1 1 0 0 0-.68 1.7 6.37 6.37 0 0 1-2.92 2.8c-.94.5-1.92.67-2.9.55-.8-.1-1.43-.46-1.82-1.05a2.62 2.62 0 0 1-.14-2.76 4.2 4.2 0 0 1 1.2-1.43 9.61 9.61 0 0 1-.22-.9C.49 9.04.76 11.58 1.54 12.77c.6.89 1.78 1.44 3.1 1.44.36 0 .72-.04 1.07-.13 2.28-.44 4.01-1.8 4.99-3.8zM13.84 8.07A7.23 7.23 0 0 0 8.2 5.61h-.29a.98.98 0 0 0-.87-.53H7a1 1 0 0 0 .04 2h.03a1 1 0 0 0 .88-.61h.32c1.35 0 2.63.4 3.8 1.16.88.59 1.52 1.35 1.88 2.28.3.75.29 1.48-.03 2.1a2.62 2.62 0 0 1-2.45 1.46c-.7 0-1.39-.21-1.74-.37-.2.17-.55.46-.8.64a5.5 5.5 0 0 0 2.3.55c1.7 0 2.97-.94 3.45-1.89.52-1.03.48-2.81-.85-4.33zM4.79 10.58a1 1 0 0 0 1 .97h.03a1 1 0 0 0-.04-2h-.03c-.04 0-.1 0-.13.02A6.53 6.53 0 0 1 4.7 5.6c.07-1.06.42-2 1.05-2.76a3.09 3.09 0 0 1 2.19-1c1.89-.03 2.69 2.32 2.74 3.27.23.05.63.17.9.26C11.35 2.5 9.57 1 7.86 1 6.27 1 4.79 2.16 4.2 3.87a7.29 7.29 0 0 0 .71 6.2.8.8 0 0 0-.12.51z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/rxjs.svg b/devtools/client/debugger/images/sources/rxjs.svg
new file mode 100644
index 0000000000..944abc43eb
--- /dev/null
+++ b/devtools/client/debugger/images/sources/rxjs.svg
@@ -0,0 +1,33 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M1.73 9.9C1 6.05 2.93 2.3 7.33 1.82a2.01 2.01 0 0 0-1.82-.58c-.67.22-.65.66-1.42 1.22-.76.44-1.14.1-1.7.56-.55.44-.16 1.47-.4 1.67-.23.4-.94.76-1.07 1.26-.11.65.29 1.1.27 1.66.05.46-.46.72-.38 1.1.21.6.63.98.83 1.14.05.04.1.12.09.07z" fill="#FF0090"/>
+ <path d="M9.58 4.55a.3.3 0 1 1 0-.58.3.3 0 0 1 0 .58zM1.9 10.33c-.7-3.36 1.46-6.17 5.65-4.79 2.46 1.44 5.56 1.35 5.7.42.34-1.12-1.57-3.42-4.43-4.02C3.15.84.09 6.97 1.9 10.34z" fill="url(#paint0_radial)"/>
+ <path d="M11.2 10.7a3.1 3.1 0 0 0 2.38-.7 6.2 6.2 0 0 1-4.12 2.04c.77.65 1.5.94 2.21.82-1.96.54-3.61-.06-5.61-2.05-.1.54.46 1.37 1.04 1.9-3.39-1.46-3.69-6.04.45-7.17C3.26 3.48.84 7.48 2.03 10.76a7.53 7.53 0 0 0 7.67 4.05 6.4 6.4 0 0 0 5.14-4.05A5.69 5.69 0 0 1 12.29 12c1.92-.96 2.95-2.6 2.66-4.82-.4.95-.92 1.67-1.58 2.17 1.4-2.17 1.16-3.3.13-4.53.73 2.03-.22 4.29-2.3 5.89z" fill="url(#paint1_radial)"/>
+ <path d="M10.22 13.04c-.15-.02.33.2-.6-.05-.91-.24-1.85-.47-3.56-2.18-.1.54.46 1.37 1.04 1.9 1.58 1.1.5.6 2.91 1.42.2-.38.2-.72.2-1.09z" fill="url(#paint2_linear)"/>
+ <path d="M7.16 4.4l.29-.45c.1-.17.25-.48.25-.48s-1.6-.52-2-.59c-1.23.32-1.23.84-.55 1.62.08.1 2-.1 2-.1z" fill="url(#paint3_linear)"/>
+ <defs>
+ <radialGradient id="paint0_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(10.7025 0 0 7.65602 10.76 5.04)">
+ <stop stop-color="#F80090"/>
+ <stop offset="1" stop-color="#4D008E"/>
+ </radialGradient>
+ <radialGradient id="paint1_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(10.8482 0 0 8.20619 10.85 5.27)">
+ <stop stop-color="#57008E"/>
+ <stop offset=".29" stop-color="#5C008E"/>
+ <stop offset="1" stop-color="#F80090"/>
+ </radialGradient>
+ <linearGradient id="paint2_linear" x1="6.8" y1="10.81" x2="8.72" y2="14.03" gradientUnits="userSpaceOnUse">
+ <stop stop-color="#F70090"/>
+ <stop offset=".67" stop-color="#E50090"/>
+ <stop offset=".83" stop-color="#D6008F" stop-opacity=".2"/>
+ <stop offset="1" stop-color="#C10090" stop-opacity="0"/>
+ </linearGradient>
+ <linearGradient id="paint3_linear" x1="6.65" y1="4.06" x2="6.37" y2="3.53" gradientUnits="userSpaceOnUse">
+ <stop stop-color="#B2008F" stop-opacity=".15"/>
+ <stop offset=".4" stop-color="#F70090" stop-opacity=".4"/>
+ <stop offset=".65" stop-color="#F60090" stop-opacity=".89"/>
+ <stop offset="1" stop-color="#FF0090"/>
+ </linearGradient>
+ </defs>
+</svg>
diff --git a/devtools/client/debugger/images/sources/sencha-extjs.svg b/devtools/client/debugger/images/sources/sencha-extjs.svg
new file mode 100644
index 0000000000..2742ec9744
--- /dev/null
+++ b/devtools/client/debugger/images/sources/sencha-extjs.svg
@@ -0,0 +1,13 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <defs>
+ <linearGradient id="paint0_linear" x1="10.92" y1="12.45" x2="5.34" y2="4.65" gradientUnits="userSpaceOnUse">
+ <stop stop-color="#006E00"/>
+ <stop offset=".55" stop-color="#0C0"/>
+ <stop offset="1" stop-color="#EEFF2A"/>
+ </linearGradient>
+ </defs>
+ <path d="M6.55.9c-4.2.53-4.49 5.76-1.85 7.92 2.63 2.16 6.07 4.05 4.67 6.27 4.07-.44 4.42-4.58 2.52-6.67-1.9-2.08-7.6-4.54-5.34-7.51z" fill="url(#paint0_linear)" stroke="navy" stroke-width=".3" stroke-linecap="round"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/typescript.svg b/devtools/client/debugger/images/sources/typescript.svg
new file mode 100644
index 0000000000..31548fa2dc
--- /dev/null
+++ b/devtools/client/debugger/images/sources/typescript.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill">
+ <path fill-rule="evenodd" d="M15 1H1v14h14V1zm-2.14 5.6a1.89 1.89 0 0 0-.95-.54 3.84 3.84 0 0 0-1.15-.03c-.83.16-1.4.68-1.56 1.44-.04.32-.03.65.03.97a2 2 0 0 0 .41.76c.31.33.65.54 1.43.88.68.3.92.44 1.05.6.17.26.13.63-.09.85-.33.3-.99.33-1.47.07a2.31 2.31 0 0 1-.67-.68l-.4.21c-.25.13-.51.27-.74.44-.02.03.26.43.4.58.41.43.95.71 1.54.8.38.06.77.06 1.16.02.84-.14 1.43-.57 1.68-1.2a2.2 2.2 0 0 0-.18-1.85c-.29-.44-.75-.75-1.84-1.22-.6-.25-.78-.38-.88-.59a.56.56 0 0 1-.07-.28c0-.4.3-.64.76-.6a.86.86 0 0 1 .71.42c.07.1.12.16.14.15.4-.25 1.05-.69 1.05-.71a2.5 2.5 0 0 0-.36-.49zm-6.48.72h1.97l-.01-1.25H5.69l-2.67.01A10.66 10.66 0 0 0 3 7.31h1.98v5.62h1.4V7.32z"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/underscore.svg b/devtools/client/debugger/images/sources/underscore.svg
new file mode 100644
index 0000000000..a7b9d06e06
--- /dev/null
+++ b/devtools/client/debugger/images/sources/underscore.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <rect fill="#002f42" width="16" x="0" y="28" height="4" />
+ <rect fill="#0072b1" width="16" x="16" y="28" height="4" />
+</svg>
diff --git a/devtools/client/debugger/images/sources/vuejs.svg b/devtools/client/debugger/images/sources/vuejs.svg
new file mode 100644
index 0000000000..717ce87bb9
--- /dev/null
+++ b/devtools/client/debugger/images/sources/vuejs.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M9.73 2L8 5 6.27 2H.5L8 14.99 15.5 2H9.73z" fill="#41B883"/>
+ <path d="M9.73 2L8 5 6.27 2H3.5L8 9.8 12.5 2H9.73z" fill="#34495E"/>
+</svg>
diff --git a/devtools/client/debugger/images/sources/webpack.svg b/devtools/client/debugger/images/sources/webpack.svg
new file mode 100644
index 0000000000..2461a6f118
--- /dev/null
+++ b/devtools/client/debugger/images/sources/webpack.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M8 .08l7 3.96v7.92l-7 3.96-7-3.96V4.04L8 .08z" fill="#fff"/>
+ <path d="M13.75 11.69L8.23 14.8v-2.43l3.44-1.9 2.08 1.2zm.38-.35V4.82L12.1 5.98v4.2l2.02 1.16zm-11.9.35l5.52 3.12v-2.43l-3.44-1.9-2.08 1.2zm-.38-.35V4.82l2.02 1.16v4.2l-2.02 1.16zm.24-6.95l5.66-3.2v2.35l-3.63 2-.03.01-2-1.16zm11.8 0L8.23 1.2v2.35l3.63 2 .02.01L13.9 4.4z" fill="#8ED6FB"/>
+ <path d="M7.75 11.82l-3.4-1.86v-3.7l3.4 1.96v3.6zm.48 0l3.4-1.86v-3.7l-3.4 1.96v3.6zM4.58 5.84l3.4-1.88 3.42 1.88L7.99 7.8l-3.4-1.96z" fill="#1C78C0"/>
+</svg>
diff --git a/devtools/client/debugger/images/stepIn.svg b/devtools/client/debugger/images/stepIn.svg
new file mode 100644
index 0000000000..eff11c0c91
--- /dev/null
+++ b/devtools/client/debugger/images/stepIn.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+ <g fill-rule="evenodd">
+ <path d="M1.5 14.042h4.095a.5.5 0 0 0 0-1H1.5a.5.5 0 1 0 0 1zM7.983 2a.5.5 0 0 1 .517.5v7.483l3.136-3.326a.5.5 0 1 1 .728.686l-4 4.243a.499.499 0 0 1-.73-.004L3.635 7.343a.5.5 0 0 1 .728-.686L7.5 9.983V3H1.536C1.24 3 1 2.776 1 2.5s.24-.5.536-.5h6.447zM10.5 14.042h4.095a.5.5 0 0 0 0-1H10.5a.5.5 0 1 0 0 1z"/>
+ </g>
+</svg>
diff --git a/devtools/client/debugger/images/stepOut.svg b/devtools/client/debugger/images/stepOut.svg
new file mode 100644
index 0000000000..4e54571412
--- /dev/null
+++ b/devtools/client/debugger/images/stepOut.svg
@@ -0,0 +1,8 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+ <g fill-rule="evenodd">
+ <path d="M5 13.5H1a.5.5 0 1 0 0 1h4a.5.5 0 1 0 0-1zM12 13.5H8a.5.5 0 1 0 0 1h4a.5.5 0 1 0 0-1zM6.11 5.012A.427.427 0 0 1 6.21 5h7.083L9.646 1.354a.5.5 0 1 1 .708-.708l4.5 4.5a.498.498 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708-.708L13.293 6H6.5v5.5a.5.5 0 1 1-1 0v-6a.5.5 0 0 1 .61-.488z"/>
+ </g>
+</svg>
diff --git a/devtools/client/debugger/images/tab.svg b/devtools/client/debugger/images/tab.svg
new file mode 100644
index 0000000000..8362ca71d1
--- /dev/null
+++ b/devtools/client/debugger/images/tab.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
+ <path d="M15 11h-1V5c0-1.09-.91-2-2-2H4c-1.09 0-2 .91-2 2v6H1c-.54 0-1 .46-1 1s.46 1 1 1h14c.54 0 1-.46 1-1s-.46-1-1-1z"/>
+</svg>
diff --git a/devtools/client/debugger/images/trace.svg b/devtools/client/debugger/images/trace.svg
new file mode 100644
index 0000000000..172f7b6c30
--- /dev/null
+++ b/devtools/client/debugger/images/trace.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path fill="context-fill" fill-rule="evenodd" clip-rule="evenodd" d="M7.99873 15C11.8647 15 14.9987 11.866 14.9987 8C14.9987 4.13401 11.8647 1 7.99873 1C4.13273 1 0.998726 4.13401 0.998726 8C0.998726 11.866 4.13273 15 7.99873 15ZM7.99872 1.75C8.41294 1.75 8.74872 2.08579 8.74872 2.5V8.5C8.74872 8.72784 8.64516 8.94332 8.46725 9.08565L5.96725 11.0857C5.6438 11.3444 5.17183 11.292 4.91307 10.9685C4.65432 10.6451 4.70676 10.1731 5.0302 9.91435L7.24872 8.13953V2.5C7.24872 2.08579 7.58451 1.75 7.99872 1.75ZM5.49873 2.75C5.91294 2.75 6.24873 3.08579 6.24873 3.5V7C6.24873 7.22784 6.14516 7.44332 5.96725 7.58565L3.46725 9.58565C3.1438 9.84441 2.67183 9.79197 2.41307 9.46852C2.15432 9.14507 2.20676 8.67311 2.5302 8.41435L4.74873 6.63953V3.5C4.74873 3.08579 5.08451 2.75 5.49873 2.75ZM11.25 9C11.25 8.58579 10.9142 8.25 10.5 8.25C10.0858 8.25 9.75 8.58579 9.75 9V12C9.75 12.4142 10.0858 12.75 10.5 12.75C10.9142 12.75 11.25 12.4142 11.25 12V9ZM8.74872 11.5C8.74873 11.0858 8.41294 10.75 7.99873 10.75C7.58451 10.75 7.24873 11.0858 7.24872 11.5V13C7.24872 13.4142 7.58451 13.75 7.99872 13.75C8.41294 13.75 8.74872 13.4142 8.74872 13V11.5ZM11.2487 3.5C11.2487 3.08579 10.9129 2.75 10.4987 2.75C10.0845 2.75 9.74873 3.08579 9.74873 3.5V6C9.74873 6.22784 9.8523 6.44332 10.0302 6.58565L12.2487 8.36047V10C12.2487 10.4142 12.5845 10.75 12.9987 10.75C13.4129 10.75 13.7487 10.4142 13.7487 10V8C13.7487 7.77216 13.6452 7.55668 13.4672 7.41435L11.2487 5.63953V3.5Z"/>
+</svg>
diff --git a/devtools/client/debugger/images/webconsole-logpoint.svg b/devtools/client/debugger/images/webconsole-logpoint.svg
new file mode 100644
index 0000000000..8ea068cc99
--- /dev/null
+++ b/devtools/client/debugger/images/webconsole-logpoint.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
+ <path fill="context-fill" fill-opacity=".2" stroke="context-stroke" stroke-linejoin="round" d="M.5 9V3c0-.83.67-1.5 1.5-1.5h5.05a.5.5 0 0 1 .38.17L11.33 6l-3.9 4.33a.5.5 0 0 1-.38.17H2A1.5 1.5 0 0 1 .5 9z"/>
+</svg>
diff --git a/devtools/client/debugger/images/whole-word-match.svg b/devtools/client/debugger/images/whole-word-match.svg
new file mode 100644
index 0000000000..ca636f13fc
--- /dev/null
+++ b/devtools/client/debugger/images/whole-word-match.svg
@@ -0,0 +1,13 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" stroke="none" fillrule="evenodd" fill="context-fill">
+ <rect opacity="0.6" x="1" y="3" width="2" height="6"></rect>
+ <rect opacity="0.6" x="17" y="3" width="2" height="6"></rect>
+ <rect x="6" y="3" width="2" height="6"></rect>
+ <rect x="12" y="3" width="2" height="6"></rect>
+ <rect x="9" y="3" width="2" height="6"></rect>
+ <path d="M4.5,13 L15.5,13 L16,13 L16,12 L15.5,12 L4.5,12 L4,12 L4,13 L4.5,13 L4.5,13 Z"></path>
+ <path d="M4,10.5 L4,12.5 L4,13 L5,13 L5,12.5 L5,10.5 L5,10 L4,10 L4,10.5 L4,10.5 Z"></path>
+ <path d="M15,10.5 L15,12.5 L15,13 L16,13 L16,12.5 L16,10.5 L16,10 L15,10 L15,10.5 L15,10.5 Z"></path>
+</svg>
diff --git a/devtools/client/debugger/images/window.svg b/devtools/client/debugger/images/window.svg
new file mode 100644
index 0000000000..d24efd1ca8
--- /dev/null
+++ b/devtools/client/debugger/images/window.svg
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="context-fill">
+ <path d="M1 3a1 1 0 011-1h12a1 1 0 011 1v10a1 1 0 01-1 1H2a1 1 0 01-1-1V3zm13 0H2v2h12V3zm0 3H2v7h12V6z"/>
+</svg>
diff --git a/devtools/client/debugger/images/worker.svg b/devtools/client/debugger/images/worker.svg
new file mode 100644
index 0000000000..652fbc9c10
--- /dev/null
+++ b/devtools/client/debugger/images/worker.svg
@@ -0,0 +1,7 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill">
+ <path d="M1.293 6.078a1 1 0 000 1.415L2 8.2a1 1 0 001.414 0l1.414-1.414 6.364 6.364a.5.5 0 10.707-.708L5.536 6.078 6.95 4.664a1 1 0 000-1.414l-.707-.707a1 1 0 00-1.415 0L1.293 6.078z"/>
+ <path d="M13.208 3.497a.6.6 0 00-.849 0l-.106.107-1.06-1.061a1 1 0 00-1.415 0l-.707.707a1 1 0 000 1.414l1.414 1.414-6.364 6.364a.5.5 0 10.707.707l6.364-6.363L12.607 8.2c.282.283 2.192.636 2.475.353.282-.283-.071-2.192-.354-2.475l-1.06-1.06.105-.106a.6.6 0 000-.849l-.565-.566z"/>
+</svg>
diff --git a/devtools/client/debugger/index.html b/devtools/client/debugger/index.html
new file mode 100644
index 0000000000..0030a671f8
--- /dev/null
+++ b/devtools/client/debugger/index.html
@@ -0,0 +1,73 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE html>
+<html dir="">
+ <head>
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/shared/sourceeditor/codemirror/lib/codemirror.css"
+ />
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/shared/sourceeditor/codemirror/addon/dialog/dialog.css"
+ />
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/shared/sourceeditor/codemirror/mozilla.css"
+ />
+ <!-- Needed for the ObjectInspector -->
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/shared/components/reps/reps.css"
+ />
+ <!-- Needed for the ObjectInspector and the Source Tree -->
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/shared/components/Tree.css"
+ />
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/shared/components/object-inspector/components/ObjectInspector.css"
+ />
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/debugger/dist/vendors.css"
+ />
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="chrome://devtools/content/debugger/src/debugger.css"
+ />
+ </head>
+
+ <body>
+ <main id="mount" class="theme-body"></main>
+ <script
+ src="chrome://devtools/content/shared/theme-switching.js"
+ ></script>
+ <script>
+ try {
+ const { BrowserLoader } = ChromeUtils.import(
+ "resource://devtools/shared/loader/browser-loader.js"
+ );
+ const { require } = BrowserLoader({
+ baseURI: "resource://devtools/client/debugger",
+ window
+ });
+ Debugger = require("devtools/client/debugger/src/main");
+ } catch (e) {
+ dump("Exception happened while loading the debugger:\n");
+ dump(e + "\n");
+ dump(e.stack + "\n");
+ }
+ </script>
+ </body>
+</html>
diff --git a/devtools/client/debugger/jest-test.config.js b/devtools/client/debugger/jest-test.config.js
new file mode 100644
index 0000000000..e80d4b37a4
--- /dev/null
+++ b/devtools/client/debugger/jest-test.config.js
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+/* global __dirname */
+
+const sharedJestConfig = require(`${__dirname}/../shared/test-helpers/shared-jest.config`);
+
+const { resolve } = require("path");
+const rootDir = resolve(__dirname);
+module.exports = {
+ rootDir,
+ displayName: "test",
+ testURL: "http://localhost/",
+ testEnvironment: "jsdom",
+ testPathIgnorePatterns: [
+ "/node_modules/",
+ "/helpers/",
+ "/fixtures/",
+ "src/test/mochitest/examples/",
+ "<rootDir>/firefox",
+ "package.json",
+ ],
+ modulePathIgnorePatterns: ["test/mochitest"],
+ collectCoverageFrom: [
+ "src/**/*.js",
+ "!src/**/fixtures/*.js",
+ "!src/test/**/*.js",
+ "!src/components/stories/**/*.js",
+ "!**/*.mock.js",
+ "!**/*.spec.js",
+ ],
+ transform: {
+ "\\.[jt]sx?$": "babel-jest",
+ },
+ transformIgnorePatterns: ["node_modules/(?!(devtools-|react-aria-))"],
+ setupFilesAfterEnv: ["<rootDir>/src/test/tests-setup.js"],
+ setupFiles: ["<rootDir>/src/test/shim.js", "jest-localstorage-mock"],
+ snapshotSerializers: [
+ "jest-serializer-babel-ast",
+ "enzyme-to-json/serializer",
+ ],
+ moduleNameMapper: {
+ ...sharedJestConfig.moduleNameMapper,
+ "\\.css$": "<rootDir>/../shared/test-helpers/jest-fixtures/empty-module",
+ "\\.svg$": "<rootDir>/../shared/test-helpers/jest-fixtures/svgMock.js",
+ },
+};
diff --git a/devtools/client/debugger/jest.config.js b/devtools/client/debugger/jest.config.js
new file mode 100644
index 0000000000..cb5d2af2f9
--- /dev/null
+++ b/devtools/client/debugger/jest.config.js
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+/* global __dirname */
+
+const { resolve } = require("path");
+const rootDir = resolve(__dirname);
+module.exports = {
+ rootDir,
+ reporters: ["default"],
+ projects: ["<rootDir>/jest-test.config.js"],
+};
diff --git a/devtools/client/debugger/moz.build b/devtools/client/debugger/moz.build
new file mode 100644
index 0000000000..371fe5c238
--- /dev/null
+++ b/devtools/client/debugger/moz.build
@@ -0,0 +1,24 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "dist",
+ "src",
+]
+
+include("../shared/build/node-templates.mozbuild")
+
+XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.ini"]
+
+BROWSER_CHROME_MANIFESTS += [
+ "test/mochitest/browser.ini",
+]
+
+DevToolsModules(
+ "panel.js",
+)
+
+with Files("**"):
+ BUG_COMPONENT = ("DevTools", "Debugger")
diff --git a/devtools/client/debugger/package.json b/devtools/client/debugger/package.json
new file mode 100644
index 0000000000..5906254b0e
--- /dev/null
+++ b/devtools/client/debugger/package.json
@@ -0,0 +1,101 @@
+{
+ "name": "debugger",
+ "version": "0.6.0",
+ "license": "MPL-2.0",
+ "repository": {
+ "url": "git://github.com/firefox-devtools/debugger.git",
+ "type": "git"
+ },
+ "bugs": {
+ "url": "https://github.com/firefox-devtools/debugger/issues"
+ },
+ "homepage": "https://github.com/firefox-devtools/debugger#readme",
+ "engineStrict": true,
+ "scripts": {
+ "license-check": "devtools-license-check",
+ "links": "ls -l node_modules/ | grep ^l || echo 'no linked packages'",
+ "test": "TZ=Africa/Nairobi jest",
+ "test-ci": "TZ=Africa/Nairobi jest --json",
+ "test:watch": "jest --watch",
+ "test:coverage": "yarn test --coverage",
+ "test:all": "yarn test",
+ "watch": "node bin/watch"
+ },
+ "dependencies": {
+ "acorn": "~8.8.2",
+ "codemirror": "^5.28.0",
+ "fuzzaldrin-plus": "^0.6.0",
+ "parse-script-tags": "github:loganfsmyth/parse-script-tags#d771732ca47e1b3554fe67d609fd18cc785c5f26",
+ "react": "16.8.6",
+ "react-aria-components": "^0.0.4",
+ "react-dom": "16.8.6",
+ "react-redux": "^5.0.7",
+ "react-transition-group": "^2.2.1",
+ "reselect": "4.1.5",
+ "source-map": "0.7.4",
+ "wasmparser": "^3.1.1"
+ },
+ "private": true,
+ "workspaces": [
+ "packages/*"
+ ],
+ "files": [
+ "src",
+ "assets"
+ ],
+ "greenkeeper": {
+ "ignore": [
+ "react",
+ "react-dom",
+ "react-redux",
+ "redux",
+ "codemirror"
+ ]
+ },
+ "main": "src/main.js",
+ "author": "Jason Laster <jlaster@mozilla.com>",
+ "devDependencies": {
+ "@babel/core": "^7.15.5",
+ "@babel/plugin-proposal-class-properties": "^7.5.5",
+ "@babel/plugin-proposal-class-static-block": "^7.15.4",
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
+ "@babel/plugin-proposal-optional-chaining": "^7.8.3",
+ "@babel/plugin-proposal-private-property-in-object": "^7.14.0",
+ "@babel/plugin-transform-modules-commonjs": "^7.5.0",
+ "@babel/preset-env": "^7.15.6",
+ "@babel/preset-react": "7.14.5",
+ "@babel/register": "^7.15.3",
+ "@rollup/plugin-commonjs": "^24.0.1",
+ "@rollup/plugin-node-resolve": "^15.0.1",
+ "@sucrase/webpack-object-rest-spread-plugin": "^1.0.0",
+ "babel-jest": "^23.0.0",
+ "babel-loader": "^8.2.2",
+ "babel-plugin-module-resolver": "^4.1.0",
+ "babel-plugin-transform-amd-to-commonjs": "1.4.0",
+ "buffer": "^6.0.3",
+ "copy-webpack-plugin": "^4.5.2",
+ "css-loader": "^0.26.1",
+ "enzyme": "^3.10.0",
+ "enzyme-adapter-react-16": "^1.14.0",
+ "enzyme-to-json": "3.3.5",
+ "extract-text-webpack-plugin": "^3.0.2",
+ "jest": "^27.2.1",
+ "jest-environment-jsdom": "^27.2.0",
+ "jest-in-case": "^1.0.2",
+ "jest-junit": "^6.0.0",
+ "jest-localstorage-mock": "^2.4.17",
+ "jest-serializer-babel-ast": "^0.0.5",
+ "redux": "^4.0.5",
+ "redux-mock-store": "^1.5.4",
+ "rollup": "3.20.2",
+ "rollup-plugin-inject-process-env": "^1.3.1",
+ "rollup-plugin-node-polyfills": "^0.2.1",
+ "webpack": "^3.5.5",
+ "workerjs": "github:jasonLaster/workerjs#1944c8b753cc9e84b6ed0cb2fbcaa25600706446"
+ },
+ "resolutions": {
+ "//": "Fix workerjs babel core dependency until we figure out a good solution",
+ "workerjs/@babel/core": "^7.15.5",
+ "workerjs/@babel/register": "^7.15.3"
+ }
+}
diff --git a/devtools/client/debugger/panel.js b/devtools/client/debugger/panel.js
new file mode 100644
index 0000000000..db2cdfb6a3
--- /dev/null
+++ b/devtools/client/debugger/panel.js
@@ -0,0 +1,348 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+const { MultiLocalizationHelper } = require("devtools/shared/l10n");
+const {
+ FluentL10n,
+} = require("devtools/client/shared/fluent-l10n/fluent-l10n");
+
+loader.lazyRequireGetter(
+ this,
+ "openContentLink",
+ "resource://devtools/client/shared/link.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "features",
+ "resource://devtools/client/debugger/src/utils/prefs.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "getOriginalLocation",
+ "resource://devtools/client/debugger/src/utils/source-maps.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "createLocation",
+ "resource://devtools/client/debugger/src/utils/location.js",
+ true
+);
+loader.lazyRequireGetter(
+ this,
+ "registerStoreObserver",
+ "resource://devtools/client/shared/redux/subscriber.js",
+ true
+);
+
+const DBG_STRINGS_URI = [
+ "devtools/client/locales/debugger.properties",
+ // These are used in the AppErrorBoundary component
+ "devtools/client/locales/startup.properties",
+ "devtools/client/locales/components.properties",
+];
+const L10N = new MultiLocalizationHelper(...DBG_STRINGS_URI);
+
+async function getNodeFront(gripOrFront, toolbox) {
+ // Given a NodeFront
+ if ("actorID" in gripOrFront) {
+ return new Promise(resolve => resolve(gripOrFront));
+ }
+
+ const inspectorFront = await toolbox.target.getFront("inspector");
+ return inspectorFront.getNodeFrontFromNodeGrip(gripOrFront);
+}
+
+class DebuggerPanel {
+ constructor(iframeWindow, toolbox, commands) {
+ this.panelWin = iframeWindow;
+ this.panelWin.L10N = L10N;
+
+ this.toolbox = toolbox;
+ this.commands = commands;
+ }
+
+ async open() {
+ // whypaused-* strings are in devtools/shared as they're used in the PausedDebuggerOverlay as well
+ const fluentL10n = new FluentL10n();
+ await fluentL10n.init(["devtools/shared/debugger-paused-reasons.ftl"]);
+
+ const { actions, store, selectors, client } =
+ await this.panelWin.Debugger.bootstrap({
+ commands: this.commands,
+ fluentBundles: fluentL10n.getBundles(),
+ resourceCommand: this.toolbox.resourceCommand,
+ workers: {
+ sourceMapLoader: this.toolbox.sourceMapLoader,
+ parserWorker: this.toolbox.parserWorker,
+ },
+ panel: this,
+ });
+
+ this._actions = actions;
+ this._store = store;
+ this._selectors = selectors;
+ this._client = client;
+
+ registerStoreObserver(this._store, this._onDebuggerStateChange.bind(this));
+
+ return this;
+ }
+
+ _onDebuggerStateChange(state, oldState) {
+ const { getCurrentThread } = this._selectors;
+
+ const currentThreadActorID = getCurrentThread(state);
+ if (
+ currentThreadActorID &&
+ currentThreadActorID !== getCurrentThread(oldState)
+ ) {
+ const threadFront =
+ this.commands.client.getFrontByID(currentThreadActorID);
+ this.toolbox.selectTarget(threadFront?.targetFront.actorID);
+ }
+ }
+
+ getVarsForTests() {
+ return {
+ store: this._store,
+ selectors: this._selectors,
+ actions: this._actions,
+ client: this._client,
+ };
+ }
+
+ _getState() {
+ return this._store.getState();
+ }
+
+ getToolboxStore() {
+ return this.toolbox.store;
+ }
+
+ openLink(url) {
+ openContentLink(url);
+ }
+
+ async openConsoleAndEvaluate(input) {
+ const { hud } = await this.toolbox.selectTool("webconsole");
+ hud.ui.wrapper.dispatchEvaluateExpression(input);
+ }
+
+ async openInspector() {
+ this.toolbox.selectTool("inspector");
+ }
+
+ async openElementInInspector(gripOrFront) {
+ const onSelectInspector = this.toolbox.selectTool("inspector");
+ const onGripNodeToFront = getNodeFront(gripOrFront, this.toolbox);
+
+ const [front, inspector] = await Promise.all([
+ onGripNodeToFront,
+ onSelectInspector,
+ ]);
+
+ const onInspectorUpdated = inspector.once("inspector-updated");
+ const onNodeFrontSet = this.toolbox.selection.setNodeFront(front, {
+ reason: "debugger",
+ });
+
+ return Promise.all([onNodeFrontSet, onInspectorUpdated]);
+ }
+
+ highlightDomElement(gripOrFront) {
+ if (!this._highlight) {
+ const { highlight, unhighlight } = this.toolbox.getHighlighter();
+ this._highlight = highlight;
+ this._unhighlight = unhighlight;
+ }
+
+ return this._highlight(gripOrFront);
+ }
+
+ unHighlightDomElement() {
+ if (!this._unhighlight) {
+ return Promise.resolve();
+ }
+
+ return this._unhighlight();
+ }
+
+ /**
+ * Return the Frame Actor ID of the currently selected frame,
+ * or null if the debugger isn't paused.
+ */
+ getSelectedFrameActorID() {
+ const thread = this._selectors.getCurrentThread(this._getState());
+ const selectedFrame = this._selectors.getSelectedFrame(
+ this._getState(),
+ thread
+ );
+ if (selectedFrame) {
+ return selectedFrame.id;
+ }
+ return null;
+ }
+
+ getMappedExpression(expression) {
+ return this._actions.getMappedExpression(expression);
+ }
+
+ /**
+ * Return the source-mapped variables for the current scope.
+ * @returns {{[String]: String} | null} A dictionary mapping original variable names to generated
+ * variable names if map scopes is enabled, otherwise null.
+ */
+ getMappedVariables() {
+ if (!this._selectors.isMapScopesEnabled(this._getState())) {
+ return null;
+ }
+ const thread = this._selectors.getCurrentThread(this._getState());
+ return this._selectors.getSelectedScopeMappings(this._getState(), thread);
+ }
+
+ isPaused() {
+ const thread = this._selectors.getCurrentThread(this._getState());
+ return this._selectors.getIsPaused(this._getState(), thread);
+ }
+
+ selectSourceURL(url, line, column) {
+ const cx = this._selectors.getContext(this._getState());
+ return this._actions.selectSourceURL(cx, url, { line, column });
+ }
+
+ /**
+ * This is called when some other panels wants to open a given source
+ * in the debugger at a precise line/column.
+ *
+ * @param {String} generatedURL
+ * @param {Number} generatedLine
+ * @param {Number} generatedColumn
+ * @param {String} sourceActorId (optional)
+ * If the callsite knows about a particular sourceActorId,
+ * or if the source doesn't have a URL, you have to pass a sourceActorId.
+ * @param {String} reason
+ * A telemetry identifier to record when opening the debugger.
+ * This help differentiate why we opened the debugger.
+ *
+ * @return {Boolean}
+ * Returns true if the location is known by the debugger
+ * and the debugger opens it.
+ */
+ async openSourceInDebugger({
+ generatedURL,
+ generatedLine,
+ generatedColumn,
+ sourceActorId,
+ reason,
+ }) {
+ const generatedSource = sourceActorId
+ ? this._selectors.getSourceByActorId(this._getState(), sourceActorId)
+ : this._selectors.getSourceByURL(this._getState(), generatedURL);
+ // We won't try opening source in the debugger when we can't find the related source actor in the reducer,
+ // or, when it doesn't have any related source actor registered.
+ if (
+ !generatedSource ||
+ // Note: We're not entirely sure when this can happen,
+ // so we may want to revisit that at some point.
+ !this._selectors.getSourceActorsForSource(
+ this._getState(),
+ generatedSource.id
+ ).length
+ ) {
+ return false;
+ }
+
+ const generatedLocation = createLocation({
+ source: generatedSource,
+ line: generatedLine,
+ column: generatedColumn,
+ });
+
+ // Note that getOriginalLocation can easily return generatedLocation
+ // if the location can't be mapped to any original source.
+ // So that we may open either regular source or original sources here.
+ const originalLocation = await getOriginalLocation(generatedLocation, {
+ // Reproduce a minimal thunkArgs for getOriginalLocation.
+ sourceMapLoader: this.toolbox.sourceMapLoader,
+ getState: this._store.getState,
+ });
+
+ // view-source module only forced the load of debugger in the background.
+ // Now that we know we want to show a source, force displaying it in foreground.
+ //
+ // Note that browser_markup_view-source.js doesn't wait for the debugger
+ // to be fully loaded with the source and requires the debugger to be loaded late.
+ // But we might try to load display it early to improve user perception.
+ await this.toolbox.selectTool("jsdebugger", reason);
+
+ const cx = this._selectors.getContext(this._getState());
+ await this._actions.selectSpecificLocation(cx, originalLocation);
+
+ // XXX: should this be moved to selectSpecificLocation??
+ if (this._selectors.hasLogpoint(this._getState(), originalLocation)) {
+ this._actions.openConditionalPanel(originalLocation, true);
+ }
+
+ return true;
+ }
+
+ async selectWorker(workerDescriptorFront) {
+ const threadActorID = workerDescriptorFront.threadFront?.actorID;
+
+ const isThreadAvailable = this._selectors
+ .getThreads(this._getState())
+ .find(x => x.actor === threadActorID);
+
+ if (!features.windowlessServiceWorkers) {
+ console.error(
+ "Selecting a worker needs the pref debugger.features.windowless-service-workers set to true"
+ );
+ return;
+ }
+
+ if (!isThreadAvailable) {
+ console.error(`Worker ${threadActorID} is not available for debugging`);
+ return;
+ }
+
+ // select worker's thread
+ this.selectThread(threadActorID);
+
+ // select worker's source
+ const source = this._selectors.getSourceByURL(
+ this._getState(),
+ workerDescriptorFront._url
+ );
+ const sourceActor = this._selectors.getFirstSourceActorForGeneratedSource(
+ this._getState(),
+ source.id,
+ threadActorID
+ );
+ const cx = this._selectors.getContext(this._getState());
+ await this._actions.selectSource(cx, source, sourceActor);
+ }
+
+ selectThread(threadActorID) {
+ const cx = this._selectors.getContext(this._getState());
+ this._actions.selectThread(cx, threadActorID);
+ }
+
+ toggleJavascriptTracing() {
+ this._actions.toggleTracing(
+ this._selectors.getJavascriptTracingLogMethod(this._getState())
+ );
+ }
+
+ destroy() {
+ this.panelWin.Debugger.destroy();
+ this.emit("destroyed");
+ }
+}
+
+exports.DebuggerPanel = DebuggerPanel;
diff --git a/devtools/client/debugger/src/.eslintignore b/devtools/client/debugger/src/.eslintignore
new file mode 100644
index 0000000000..32aadf77f5
--- /dev/null
+++ b/devtools/client/debugger/src/.eslintignore
@@ -0,0 +1,5 @@
+test/examples/**
+test/integration/**
+test/unit-sources/**
+**/fixtures/**
+test/mochitest/**
diff --git a/devtools/client/debugger/src/.eslintrc.js b/devtools/client/debugger/src/.eslintrc.js
new file mode 100644
index 0000000000..c6ffc17a5c
--- /dev/null
+++ b/devtools/client/debugger/src/.eslintrc.js
@@ -0,0 +1,372 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+module.exports = {
+ plugins: ["react", "mozilla", "@babel", "import", "file-header"],
+ globals: {
+ atob: true,
+ btoa: true,
+ Cc: true,
+ Ci: true,
+ Components: true,
+ console: true,
+ Cr: true,
+ Cu: true,
+ devtools: true,
+ dump: true,
+ EventEmitter: true,
+ isWorker: true,
+ loader: true,
+ Services: true,
+ Task: true,
+ XPCOMUtils: true,
+ _Iterator: true,
+ __dirname: true,
+ process: true,
+ global: true,
+ L10N: true,
+ },
+ extends: ["prettier", "plugin:jest/recommended"],
+ parserOptions: {
+ ecmaVersion: 2016,
+ sourceType: "module",
+ ecmaFeatures: { jsx: true },
+
+ // When the linter runs from the MC root, it won't pick up this project's
+ // babel.config.js, so we explicitly set Babel's root location so that
+ // it knows where to look.
+ babelOptions: {
+ root: __dirname,
+ },
+ },
+ env: {
+ es6: true,
+ browser: true,
+ commonjs: true,
+ jest: true,
+ },
+ rules: {
+ // These are the rules that have been configured so far to match the
+ // devtools coding style.
+
+ // Rules from the mozilla plugin
+ "mozilla/mark-test-function-used": 1,
+ "mozilla/no-aArgs": 1,
+ // See bug 1224289.
+ "mozilla/reject-importGlobalProperties": 1,
+ "mozilla/var-only-at-top-level": 1,
+
+ // Rules from the React plugin
+ "react/jsx-uses-react": [2],
+ "react/jsx-uses-vars": [2],
+ "react/no-danger": 1,
+ "react/no-did-mount-set-state": 1,
+ "react/no-did-update-set-state": 1,
+ "react/no-direct-mutation-state": 1,
+ "react/no-unknown-property": 1,
+ "react/prop-types": 1,
+ "react/sort-comp": [
+ 1,
+ {
+ order: ["propTypes", "everything-else", "render"],
+ },
+ ],
+
+ // Check for import errors.
+ "import/no-duplicates": "error",
+ "import/named": "error",
+ "import/export": "error",
+
+ // Incompatible with jest-in-case cases. See related GitHub issue
+ // https://github.com/jest-community/eslint-plugin-jest/issues/534
+ "jest/no-standalone-expect": "off",
+
+ // Disallow flow control that escapes from "finally".
+ "no-unsafe-finally": "error",
+
+ // Disallow using variables outside the blocks they are defined (especially
+ // since only let and const are used, see "no-var").
+ "block-scoped-var": 2,
+ // Require camel case names
+ camelcase: ["error", { properties: "never" }],
+ // Warn about cyclomatic complexity in functions.
+ complexity: ["error", { max: 22 }],
+ // Don't warn for inconsistent naming when capturing this (not so important
+ // with auto-binding fat arrow functions).
+ "consistent-this": 0,
+ // Don't require a default case in switch statements. Avoid being forced to
+ // add a bogus default when you know all possible cases are handled.
+ "default-case": 0,
+ // Encourage the use of dot notation whenever possible.
+ "dot-notation": 2,
+ // Allow using == instead of ===, in the interest of landing something since
+ // the devtools codebase is split on convention here.
+ eqeqeq: 0,
+ // Don't require function expressions to have a name.
+ // This makes the code more verbose and hard to read. Our engine already
+ // does a fantastic job assigning a name to the function, which includes
+ // the enclosing function name, and worst case you have a line number that
+ // you can just look up.
+ "func-names": 0,
+ // Allow use of function declarations and expressions.
+ "func-style": 0,
+ // Deprecated, will be removed in 1.0.
+ "global-strict": 0,
+ // Only useful in a node environment.
+ "handle-callback-err": 0,
+ // Don't enforce the maximum depth that blocks can be nested. The complexity
+ // rule is a better rule to check this.
+ "max-depth": 0,
+ // Maximum depth callbacks can be nested.
+ "max-nested-callbacks": [2, 4],
+ // Don't limit the number of parameters that can be used in a function.
+ "max-params": 0,
+ // Don't limit the maximum number of statement allowed in a function. We
+ // already have the complexity rule that's a better measurement.
+ "max-statements": 0,
+ // Require a capital letter for constructors, only check if all new
+ // operators are followed by a capital letter. Don't warn when capitalized
+ // functions are used without the new operator.
+ "new-cap": [2, { capIsNew: false }],
+ // Disallow use of the Array constructor.
+ "no-array-constructor": 2,
+ // Allow use of bitwise operators.
+ "no-bitwise": 0,
+ // Disallow use of arguments.caller or arguments.callee.
+ "no-caller": 2,
+ // Disallow the catch clause parameter name being the same as a variable in
+ // the outer scope, to avoid confusion.
+ "no-catch-shadow": 2,
+ // Disallow assignment in conditional expressions.
+ "no-cond-assign": 2,
+ // Allow using the console API.
+ "no-console": 0,
+ // Allow using constant expressions in conditions like while (true)
+ "no-constant-condition": 0,
+ // Allow use of the continue statement.
+ "no-continue": 0,
+ // Disallow control characters in regular expressions.
+ "no-control-regex": 2,
+ // Disallow use of debugger.
+ "no-debugger": 2,
+ // Disallow deletion of variables (deleting properties is fine).
+ "no-delete-var": 2,
+ // Allow division operators explicitly at beginning of regular expression.
+ "no-div-regex": 0,
+ // Disallow duplicate arguments in functions.
+ "no-dupe-args": 2,
+ // Disallow duplicate keys when creating object literals.
+ "no-dupe-keys": 2,
+ // Disallow a duplicate case label.
+ "no-duplicate-case": 2,
+ // Disallow else after a return in an if. The else around the second return
+ // here is useless:
+ // if (something) { return false; } else { return true; }
+ "no-else-return": 2,
+ // Disallow empty statements. This will report an error for:
+ // try { something(); } catch (e) {}
+ // but will not report it for:
+ // try { something(); } catch (e) { /* Silencing the error because ...*/ }
+ // which is a valid use case.
+ "no-empty": 2,
+ // Disallow the use of empty character classes in regular expressions.
+ "no-empty-character-class": 2,
+ // Disallow use of labels for anything other then loops and switches.
+ "no-labels": 2,
+ // Disallow use of eval(). We have other APIs to evaluate code in content.
+ "no-eval": 2,
+ // Disallow assigning to the exception in a catch block.
+ "no-ex-assign": 2,
+ // Disallow adding to native types
+ "no-extend-native": 2,
+ // Disallow unnecessary function binding.
+ "no-extra-bind": 2,
+ // Disallow double-negation boolean casts in a boolean context.
+ "no-extra-boolean-cast": 2,
+ // Deprecated, will be removed in 1.0.
+ "no-extra-strict": 0,
+ // Disallow fallthrough of case statements, except if there is a comment.
+ "no-fallthrough": 2,
+ // Disallow comments inline after code.
+ "no-inline-comments": 2,
+ // Disallow if as the only statement in an else block.
+ "no-lonely-if": 2,
+ // Allow mixing regular variable and require declarations (not a node env).
+ "no-mixed-requires": 0,
+ // Disallow use of multiline strings (use template strings instead).
+ "no-multi-str": 2,
+ "prefer-template": "error",
+ "prefer-const": [
+ "error",
+ {
+ destructuring: "all",
+ ignoreReadBeforeAssign: false,
+ },
+ ],
+ // Disallow reassignments of native objects.
+ "no-native-reassign": 2,
+ // Disallow nested ternary expressions, they make the code hard to read.
+ "no-nested-ternary": 2,
+ // Allow use of new operator with the require function.
+ "no-new-require": 0,
+ // Disallow use of octal literals.
+ "no-octal": 2,
+ // Allow reassignment of function parameters.
+ "no-param-reassign": 0,
+ // Allow string concatenation with __dirname and __filename (not a node env).
+ "no-path-concat": 0,
+ // Allow use of unary operators, ++ and --.
+ "no-plusplus": 0,
+ // Allow using process.env (not a node environment).
+ "no-process-env": 0,
+ // Allow using process.exit (not a node environment).
+ "no-process-exit": 0,
+ // Disallow usage of __proto__ property.
+ "no-proto": 2,
+ // Disallow declaring the same variable more than once (we use let anyway).
+ "no-redeclare": 2,
+ // Disallow multiple spaces in a regular expression literal.
+ "no-regex-spaces": 2,
+ // Don't restrict usage of specified node modules (not a node environment).
+ "no-restricted-modules": 0,
+ // Disallow use of assignment in return statement. It is preferable for a
+ // single line of code to have only one easily predictable effect.
+ "no-return-assign": 2,
+ // Allow use of javascript: urls.
+ "no-script-url": 0,
+ // Disallow comparisons where both sides are exactly the same.
+ "no-self-compare": 2,
+ // Disallow use of comma operator.
+ "no-sequences": 2,
+ // Warn about declaration of variables already declared in the outer scope.
+ // This isn't an error because it sometimes is useful to use the same name
+ // in a small helper function rather than having to come up with another
+ // random name.
+ // Still, making this a warning can help people avoid being confused.
+ "no-shadow": 2,
+ // Disallow shadowing of names such as arguments.
+ "no-shadow-restricted-names": 2,
+ // Disallow sparse arrays, eg. let arr = [,,2].
+ // Array destructuring is fine though:
+ // for (let [, breakpointPromise] of aPromises)
+ "no-sparse-arrays": 2,
+ // Allow use of synchronous methods (not a node environment).
+ "no-sync": 0,
+ // Allow the use of ternary operators.
+ "no-ternary": 0,
+ // Disallow throwing literals (eg. throw "error" instead of
+ // throw new Error("error")).
+ "no-throw-literal": 2,
+ // Disallow use of undeclared variables unless mentioned in a /*global */
+ // block. Note that globals from head.js are automatically imported in tests
+ // by the import-headjs-globals rule form the mozilla eslint plugin.
+ "no-undef": 2,
+ // Allow dangling underscores in identifiers (for privates).
+ "no-underscore-dangle": 0,
+ // Allow use of undefined variable.
+ "no-undefined": 0,
+ // Disallow the use of Boolean literals in conditional expressions.
+ "no-unneeded-ternary": 2,
+ // Disallow unreachable statements after a return, throw, continue, or break
+ // statement.
+ "no-unreachable": 2,
+ // Disallow global and local variables that arent used, but allow unused function arguments.
+ "no-unused-vars": [2, { vars: "all", args: "none" }],
+ // Allow using variables before they are defined.
+ "no-use-before-define": 0,
+ // We use var-only-at-top-level instead of no-var as we allow top level
+ // vars.
+ "no-var": 0,
+ // Allow using TODO/FIXME comments.
+ "no-warning-comments": 0,
+ // Disallow use of the with statement.
+ "no-with": 2,
+ // Dont require method and property shorthand syntax for object literals.
+ // We use this in the code a lot, but not consistently, and this seems more
+ // like something to check at code review time.
+ "object-shorthand": 0,
+ // Allow more than one variable declaration per function.
+ "one-var": 0,
+ // Require use of the second argument for parseInt().
+ radix: 2,
+ // Dont require to sort variables within the same declaration block.
+ // Anyway, one-var is disabled.
+ "sort-vars": 0,
+ // Require "use strict" to be defined globally in the script.
+ strict: [2, "global"],
+ // Disallow comparisons with the value NaN.
+ "use-isnan": 2,
+ // Ensure that the results of typeof are compared against a valid string.
+ "valid-typeof": 2,
+ // Allow vars to be declared anywhere in the scope.
+ "vars-on-top": 0,
+ // Disallow Yoda conditions (where literal value comes first).
+ yoda: 2,
+
+ // And these are the rules that haven't been discussed so far, and that are
+ // disabled for now until we introduce them, one at a time.
+
+ // Require for-in loops to have an if statement.
+ "guard-for-in": 0,
+ // allow/disallow an empty newline after var statement
+ "newline-after-var": 0,
+ // disallow the use of alert, confirm, and prompt
+ "no-alert": 0,
+ // disallow comparisons to null without a type-checking operator
+ "no-eq-null": 0,
+ // disallow overwriting functions written as function declarations
+ "no-func-assign": 0,
+ // disallow use of eval()-like methods
+ "no-implied-eval": 0,
+ // disallow function or variable declarations in nested blocks
+ "no-inner-declarations": 0,
+ // disallow invalid regular expression strings in the RegExp constructor
+ "no-invalid-regexp": 0,
+ // disallow irregular whitespace outside of strings and comments
+ "no-irregular-whitespace": 0,
+ // disallow labels that share a name with a variable
+ "no-label-var": 0,
+ // disallow unnecessary nested blocks
+ "no-lone-blocks": 0,
+ // disallow creation of functions within loops
+ "no-loop-func": 0,
+ // disallow negation of the left operand of an in expression
+ "no-negated-in-lhs": 0,
+ // disallow use of new operator when not part of the assignment or
+ // comparison
+ "no-new": 0,
+ // disallow use of new operator for Function object
+ "no-new-func": 0,
+ // disallow use of the Object constructor
+ "no-new-object": 0,
+ // disallows creating new instances of String,Number, and Boolean
+ "no-new-wrappers": 0,
+ // disallow the use of object properties of the global object (Math and
+ // JSON) as functions
+ "no-obj-calls": 0,
+ // disallow use of octal escape sequences in string literals, such as
+ // var foo = "Copyright \251";
+ "no-octal-escape": 0,
+ // disallow use of undefined when initializing variables
+ "no-undef-init": 0,
+ // disallow usage of expressions in statement position
+ "no-unused-expressions": 0,
+ // disallow use of void operator
+ "no-void": 0,
+ // require assignment operator shorthand where possible or prohibit it
+ // entirely
+ "operator-assignment": 0,
+
+ "file-header/file-header": [
+ "error",
+ [
+ "This Source Code Form is subject to the terms of the Mozilla Public",
+ "License, v. 2.0. If a copy of the MPL was not distributed with this",
+ "file, You can obtain one at <http://mozilla.org/MPL/2.0/>.",
+ ],
+ "block",
+ ["-\\*-(.*)-\\*-", "eslint(.*)", "vim(.*)"],
+ ],
+ },
+};
diff --git a/devtools/client/debugger/src/actions/README.md b/devtools/client/debugger/src/actions/README.md
new file mode 100644
index 0000000000..d919247838
--- /dev/null
+++ b/devtools/client/debugger/src/actions/README.md
@@ -0,0 +1,26 @@
+## Actions
+
+### Best Practices
+
+#### Scheduling Async Actions
+
+There are several use-cases with async actions that involve scheduling:
+
+* we do one action and cancel subsequent actions
+* we do one action and subsequent calls wait on the initial call
+* we start an action and show a loading state
+
+If you want to wait on subsequent calls you need to store action promises.
+[ex][req]
+
+If you just want to cancel subsequent calls, you can keep track of a pending
+state in the store. [ex][state]
+
+The advantage of adding the pending state to the store is that we can use that
+in the UI:
+
+* disable/hide the pretty print button
+* show a progress ui
+
+[req]: https://github.com/firefox-devtools/debugger/blob/master/src/actions/sources/loadSourceText.js
+[state]: https://github.com/firefox-devtools/debugger/blob/master/src/reducers/sources.js
diff --git a/devtools/client/debugger/src/actions/ast/index.js b/devtools/client/debugger/src/actions/ast/index.js
new file mode 100644
index 0000000000..ec2c1ae84c
--- /dev/null
+++ b/devtools/client/debugger/src/actions/ast/index.js
@@ -0,0 +1,5 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export { setInScopeLines } from "./setInScopeLines";
diff --git a/devtools/client/debugger/src/actions/ast/moz.build b/devtools/client/debugger/src/actions/ast/moz.build
new file mode 100644
index 0000000000..5b0152d2ad
--- /dev/null
+++ b/devtools/client/debugger/src/actions/ast/moz.build
@@ -0,0 +1,11 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "index.js",
+ "setInScopeLines.js",
+)
diff --git a/devtools/client/debugger/src/actions/ast/setInScopeLines.js b/devtools/client/debugger/src/actions/ast/setInScopeLines.js
new file mode 100644
index 0000000000..a17510a507
--- /dev/null
+++ b/devtools/client/debugger/src/actions/ast/setInScopeLines.js
@@ -0,0 +1,94 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ hasInScopeLines,
+ getSourceTextContent,
+ getVisibleSelectedFrame,
+} from "../../selectors";
+
+import { getSourceLineCount } from "../../utils/source";
+
+import { isFulfilled } from "../../utils/async-value";
+
+function getOutOfScopeLines(outOfScopeLocations) {
+ if (!outOfScopeLocations) {
+ return null;
+ }
+
+ const uniqueLines = new Set();
+ for (const location of outOfScopeLocations) {
+ for (let i = location.start.line; i < location.end.line; i++) {
+ uniqueLines.add(i);
+ }
+ }
+
+ return uniqueLines;
+}
+
+async function getInScopeLines(
+ cx,
+ location,
+ { dispatch, getState, parserWorker }
+) {
+ const sourceTextContent = getSourceTextContent(getState(), location);
+
+ let locations = null;
+ if (location.line && parserWorker.isLocationSupported(location)) {
+ locations = await parserWorker.findOutOfScopeLocations(location);
+ }
+
+ const linesOutOfScope = getOutOfScopeLines(locations);
+ const sourceNumLines =
+ !sourceTextContent || !isFulfilled(sourceTextContent)
+ ? 0
+ : getSourceLineCount(sourceTextContent.value);
+
+ const noLinesOutOfScope =
+ linesOutOfScope == null || linesOutOfScope.size == 0;
+
+ // This operation can be very costly for large files so we sacrifice a bit of readability
+ // for performance sake.
+ // We initialize an array with a fixed size and we'll directly assign value for lines
+ // that are not out of scope. This is much faster than having an empty array and pushing
+ // into it.
+ const sourceLines = new Array(sourceNumLines);
+ for (let i = 0; i < sourceNumLines; i++) {
+ const line = i + 1;
+ if (noLinesOutOfScope || !linesOutOfScope.has(line)) {
+ sourceLines[i] = line;
+ }
+ }
+
+ // Finally we need to remove any undefined values, i.e. the ones that were matching
+ // out of scope lines.
+ return sourceLines.filter(i => i != undefined);
+}
+
+export function setInScopeLines(cx) {
+ return async thunkArgs => {
+ const { getState, dispatch } = thunkArgs;
+ const visibleFrame = getVisibleSelectedFrame(getState());
+
+ if (!visibleFrame) {
+ return;
+ }
+
+ const { location } = visibleFrame;
+ const sourceTextContent = getSourceTextContent(getState(), location);
+
+ if (hasInScopeLines(getState(), location) || !sourceTextContent) {
+ return;
+ }
+
+ const lines = await getInScopeLines(cx, location, thunkArgs);
+
+ dispatch({
+ type: "IN_SCOPE_LINES",
+ cx,
+ location,
+ lines,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/ast/tests/__snapshots__/setInScopeLines.spec.js.snap b/devtools/client/debugger/src/actions/ast/tests/__snapshots__/setInScopeLines.spec.js.snap
new file mode 100644
index 0000000000..1b9befc31b
--- /dev/null
+++ b/devtools/client/debugger/src/actions/ast/tests/__snapshots__/setInScopeLines.spec.js.snap
@@ -0,0 +1,16 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`getInScopeLine with selected line 1`] = `
+Array [
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 10,
+ 11,
+ 12,
+]
+`;
diff --git a/devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js b/devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js
new file mode 100644
index 0000000000..571dd84d6d
--- /dev/null
+++ b/devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js
@@ -0,0 +1,79 @@
+/* eslint max-nested-callbacks: ["error", 6] */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import readFixture from "../../tests/helpers/readFixture";
+
+import { makeMockFrame, makeMockSource } from "../../../utils/test-mockup";
+import {
+ createStore,
+ selectors,
+ actions,
+ makeSource,
+ waitForState,
+} from "../../../utils/test-head";
+import { createLocation } from "../../../utils/location";
+
+const { getInScopeLines } = selectors;
+
+const sourceTexts = {
+ "scopes.js": readFixture("scopes.js"),
+};
+
+const mockCommandClient = {
+ sourceContents: async ({ source }) => ({
+ source: sourceTexts[source],
+ contentType: "text/javascript",
+ }),
+ evaluateExpressions: async () => {},
+ getFrameScopes: async () => {},
+ getFrames: async () => [],
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+};
+
+describe("getInScopeLine", () => {
+ it("with selected line", async () => {
+ const client = { ...mockCommandClient };
+ const store = createStore(client);
+ const { dispatch, getState } = store;
+ const source = makeMockSource("scopes.js", "scopes.js");
+ const frame = makeMockFrame("scopes-4", source);
+ client.getFrames = async () => [frame];
+
+ const baseSource = await dispatch(
+ actions.newGeneratedSource(makeSource("scopes.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ baseSource.id
+ );
+
+ await dispatch(
+ actions.selectLocation(
+ selectors.getContext(getState()),
+ createLocation({
+ source: baseSource,
+ sourceActor,
+ line: 5,
+ })
+ )
+ );
+
+ await dispatch(
+ actions.paused({
+ thread: "FakeThread",
+ why: { type: "debuggerStatement" },
+ frame,
+ })
+ );
+ await dispatch(actions.setInScopeLines(selectors.getContext(getState())));
+
+ await waitForState(store, state => getInScopeLines(state, frame.location));
+
+ const lines = getInScopeLines(getState(), frame.location);
+
+ expect(lines).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js b/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js
new file mode 100644
index 0000000000..263b476364
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js
@@ -0,0 +1,273 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ isOriginalId,
+ isGeneratedId,
+ originalToGeneratedId,
+} from "devtools/client/shared/source-map-loader/index";
+
+import {
+ getSource,
+ getSourceFromId,
+ getBreakpointPositionsForSource,
+ getSourceActorsForSource,
+} from "../../selectors";
+
+import { makeBreakpointId } from "../../utils/breakpoint";
+import { memoizeableAction } from "../../utils/memoizableAction";
+import { fulfilled } from "../../utils/async-value";
+import {
+ debuggerToSourceMapLocation,
+ sourceMapToDebuggerLocation,
+ createLocation,
+} from "../../utils/location";
+
+async function mapLocations(generatedLocations, { getState, sourceMapLoader }) {
+ if (!generatedLocations.length) {
+ return [];
+ }
+
+ const originalLocations = await sourceMapLoader.getOriginalLocations(
+ generatedLocations.map(debuggerToSourceMapLocation)
+ );
+ return originalLocations.map((location, index) => ({
+ // If location is null, this particular location doesn't map to any original source.
+ location: location
+ ? sourceMapToDebuggerLocation(getState(), location)
+ : generatedLocations[index],
+ generatedLocation: generatedLocations[index],
+ }));
+}
+
+// Filter out positions, that are not in the original source Id
+function filterBySource(positions, sourceId) {
+ if (!isOriginalId(sourceId)) {
+ return positions;
+ }
+ return positions.filter(position => position.location.sourceId == sourceId);
+}
+
+/**
+ * Merge positions that refer to duplicated positions.
+ * Some sourcemaped positions might refer to the exact same source/line/column triple.
+ *
+ * @param {Array<{location, generatedLocation}>} positions: List of possible breakable positions
+ * @returns {Array<{location, generatedLocation}>} A new, filtered array.
+ */
+function filterByUniqLocation(positions) {
+ const handledBreakpointIds = new Set();
+ return positions.filter(({ location }) => {
+ const breakpointId = makeBreakpointId(location);
+ if (handledBreakpointIds.has(breakpointId)) {
+ return false;
+ }
+
+ handledBreakpointIds.add(breakpointId);
+ return true;
+ });
+}
+
+function convertToList(results, source) {
+ const positions = [];
+
+ for (const line in results) {
+ for (const column of results[line]) {
+ positions.push(
+ createLocation({
+ line: Number(line),
+ column,
+ source,
+ sourceUrl: source.url,
+ })
+ );
+ }
+ }
+
+ return positions;
+}
+
+function groupByLine(results, sourceId, line) {
+ const isOriginal = isOriginalId(sourceId);
+ const positions = {};
+
+ // Ensure that we have an entry for the line fetched
+ if (typeof line === "number") {
+ positions[line] = [];
+ }
+
+ for (const result of results) {
+ const location = isOriginal ? result.location : result.generatedLocation;
+
+ if (!positions[location.line]) {
+ positions[location.line] = [];
+ }
+
+ positions[location.line].push(result);
+ }
+
+ return positions;
+}
+
+async function _setBreakpointPositions(cx, location, thunkArgs) {
+ const { client, dispatch, getState, sourceMapLoader } = thunkArgs;
+ const results = {};
+ let generatedSource = location.source;
+ if (isOriginalId(location.sourceId)) {
+ const ranges = await sourceMapLoader.getGeneratedRangesForOriginal(
+ location.sourceId,
+ true
+ );
+ const generatedSourceId = originalToGeneratedId(location.sourceId);
+ generatedSource = getSourceFromId(getState(), generatedSourceId);
+
+ // Note: While looping here may not look ideal, in the vast majority of
+ // cases, the number of ranges here should be very small, and is quite
+ // likely to only be a single range.
+ for (const range of ranges) {
+ // Wrap infinite end positions to the next line to keep things simple
+ // and because we know we don't care about the end-line whitespace
+ // in this case.
+ if (range.end.column === Infinity) {
+ range.end = {
+ line: range.end.line + 1,
+ column: 0,
+ };
+ }
+
+ const actorBps = await Promise.all(
+ getSourceActorsForSource(getState(), generatedSourceId).map(actor =>
+ client.getSourceActorBreakpointPositions(actor, range)
+ )
+ );
+
+ for (const actorPositions of actorBps) {
+ for (const rangeLine of Object.keys(actorPositions)) {
+ let columns = actorPositions[parseInt(rangeLine, 10)];
+ const existing = results[rangeLine];
+ if (existing) {
+ columns = [...new Set([...existing, ...columns])];
+ }
+
+ results[rangeLine] = columns;
+ }
+ }
+ }
+ } else {
+ const { line } = location;
+ if (typeof line !== "number") {
+ throw new Error("Line is required for generated sources");
+ }
+
+ const actorColumns = await Promise.all(
+ getSourceActorsForSource(getState(), location.sourceId).map(
+ async actor => {
+ const positions = await client.getSourceActorBreakpointPositions(
+ actor,
+ {
+ start: { line: line, column: 0 },
+ end: { line: line + 1, column: 0 },
+ }
+ );
+ return positions[line] || [];
+ }
+ )
+ );
+
+ for (const columns of actorColumns) {
+ results[line] = (results[line] || []).concat(columns);
+ }
+ }
+
+ let positions = convertToList(results, generatedSource);
+ positions = await mapLocations(positions, thunkArgs);
+
+ positions = filterBySource(positions, location.sourceId);
+ positions = filterByUniqLocation(positions);
+ positions = groupByLine(positions, location.sourceId, location.line);
+
+ const source = getSource(getState(), location.sourceId);
+ // NOTE: it's possible that the source was removed during a navigation
+ if (!source) {
+ return;
+ }
+
+ dispatch({
+ type: "ADD_BREAKPOINT_POSITIONS",
+ cx,
+ source,
+ positions,
+ });
+}
+
+function generatedSourceActorKey(state, sourceId) {
+ const generatedSource = getSource(
+ state,
+ isOriginalId(sourceId) ? originalToGeneratedId(sourceId) : sourceId
+ );
+ const actors = generatedSource
+ ? getSourceActorsForSource(state, generatedSource.id).map(
+ ({ actor }) => actor
+ )
+ : [];
+ return [sourceId, ...actors].join(":");
+}
+
+/**
+ * This method will force retrieving the breakable positions for a given source, on a given line.
+ * If this data has already been computed, it will returned the cached data.
+ *
+ * For original sources, this will query the SourceMap worker.
+ * For generated sources, this will query the DevTools server and the related source actors.
+ *
+ * @param Object options
+ * Dictionary object with many arguments:
+ * @param String options.sourceId
+ * The source we want to fetch breakable positions
+ * @param Number options.line
+ * The line we want to know which columns are breakable.
+ * (note that this seems to be optional for original sources)
+ * @return Array<Object>
+ * The list of all breakable positions, each object of this array will be like this:
+ * {
+ * line: Number
+ * column: Number
+ * sourceId: String
+ * sourceUrl: String
+ * }
+ */
+export const setBreakpointPositions = memoizeableAction(
+ "setBreakpointPositions",
+ {
+ getValue: ({ location }, { getState }) => {
+ const positions = getBreakpointPositionsForSource(
+ getState(),
+ location.sourceId
+ );
+ if (!positions) {
+ return null;
+ }
+
+ if (
+ isGeneratedId(location.sourceId) &&
+ location.line &&
+ !positions[location.line]
+ ) {
+ // We always return the full position dataset, but if a given line is
+ // not available, we treat the whole set as loading.
+ return null;
+ }
+
+ return fulfilled(positions);
+ },
+ createKey({ location }, { getState }) {
+ const key = generatedSourceActorKey(getState(), location.sourceId);
+ return isGeneratedId(location.sourceId) && location.line
+ ? `${key}-${location.line}`
+ : key;
+ },
+ action: async ({ cx, location }, thunkArgs) =>
+ _setBreakpointPositions(cx, location, thunkArgs),
+ }
+);
diff --git a/devtools/client/debugger/src/actions/breakpoints/index.js b/devtools/client/debugger/src/actions/breakpoints/index.js
new file mode 100644
index 0000000000..d188af05dc
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/index.js
@@ -0,0 +1,426 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for breakpoints
+ * @module actions/breakpoints
+ */
+
+import { PROMISE } from "../utils/middleware/promise";
+import { asyncStore } from "../../utils/prefs";
+import { createLocation } from "../../utils/location";
+import {
+ getBreakpointsList,
+ getXHRBreakpoints,
+ getSelectedSource,
+ getBreakpointAtLocation,
+ getBreakpointsForSource,
+ getBreakpointsAtLine,
+} from "../../selectors";
+import { createXHRBreakpoint } from "../../utils/breakpoint";
+import {
+ addBreakpoint,
+ removeBreakpoint,
+ enableBreakpoint,
+ disableBreakpoint,
+} from "./modify";
+import { getOriginalLocation } from "../../utils/source-maps";
+
+import { isOriginalId } from "devtools/client/shared/source-map-loader/index";
+// this will need to be changed so that addCLientBreakpoint is removed
+
+export * from "./breakpointPositions";
+export * from "./modify";
+export * from "./syncBreakpoint";
+
+export function addHiddenBreakpoint(cx, location) {
+ return ({ dispatch }) => {
+ return dispatch(addBreakpoint(cx, location, { hidden: true }));
+ };
+}
+
+/**
+ * Disable all breakpoints in a source
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function disableBreakpointsInSource(cx, source) {
+ return async ({ dispatch, getState, client }) => {
+ const breakpoints = getBreakpointsForSource(getState(), source.id);
+ for (const breakpoint of breakpoints) {
+ if (!breakpoint.disabled) {
+ dispatch(disableBreakpoint(cx, breakpoint));
+ }
+ }
+ };
+}
+
+/**
+ * Enable all breakpoints in a source
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function enableBreakpointsInSource(cx, source) {
+ return async ({ dispatch, getState, client }) => {
+ const breakpoints = getBreakpointsForSource(getState(), source.id);
+ for (const breakpoint of breakpoints) {
+ if (breakpoint.disabled) {
+ dispatch(enableBreakpoint(cx, breakpoint));
+ }
+ }
+ };
+}
+
+/**
+ * Toggle All Breakpoints
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function toggleAllBreakpoints(cx, shouldDisableBreakpoints) {
+ return async ({ dispatch, getState, client }) => {
+ const breakpoints = getBreakpointsList(getState());
+
+ for (const breakpoint of breakpoints) {
+ if (shouldDisableBreakpoints) {
+ dispatch(disableBreakpoint(cx, breakpoint));
+ } else {
+ dispatch(enableBreakpoint(cx, breakpoint));
+ }
+ }
+ };
+}
+
+/**
+ * Toggle Breakpoints
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function toggleBreakpoints(cx, shouldDisableBreakpoints, breakpoints) {
+ return async ({ dispatch }) => {
+ const promises = breakpoints.map(breakpoint =>
+ shouldDisableBreakpoints
+ ? dispatch(disableBreakpoint(cx, breakpoint))
+ : dispatch(enableBreakpoint(cx, breakpoint))
+ );
+
+ await Promise.all(promises);
+ };
+}
+
+export function toggleBreakpointsAtLine(cx, shouldDisableBreakpoints, line) {
+ return async ({ dispatch, getState }) => {
+ const breakpoints = getBreakpointsAtLine(getState(), line);
+ return dispatch(
+ toggleBreakpoints(cx, shouldDisableBreakpoints, breakpoints)
+ );
+ };
+}
+
+/**
+ * Removes all breakpoints
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function removeAllBreakpoints(cx) {
+ return async ({ dispatch, getState }) => {
+ const breakpointList = getBreakpointsList(getState());
+
+ await Promise.all(
+ breakpointList.map(bp => dispatch(removeBreakpoint(cx, bp)))
+ );
+ dispatch({ type: "CLEAR_BREAKPOINTS" });
+ };
+}
+
+/**
+ * Removes breakpoints
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function removeBreakpoints(cx, breakpoints) {
+ return async ({ dispatch }) => {
+ return Promise.all(
+ breakpoints.map(bp => dispatch(removeBreakpoint(cx, bp)))
+ );
+ };
+}
+
+/**
+ * Removes all breakpoints in a source
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function removeBreakpointsInSource(cx, source) {
+ return async ({ dispatch, getState, client }) => {
+ const breakpoints = getBreakpointsForSource(getState(), source.id);
+ for (const breakpoint of breakpoints) {
+ dispatch(removeBreakpoint(cx, breakpoint));
+ }
+ };
+}
+
+/**
+ * Update the original location information of breakpoints.
+
+/*
+ * Update breakpoints for a source that just got pretty printed.
+ * This method maps the breakpoints currently set only against the
+ * non-pretty-printed (generated) source to the related pretty-printed
+ * (original) source by querying the SourceMap service.
+ *
+ * @param {Objeect} cx
+ * @param {String} sourceId - the generated source id
+ */
+export function updateBreakpointsForNewPrettyPrintedSource(cx, sourceId) {
+ return async thunkArgs => {
+ const { dispatch, getState } = thunkArgs;
+ if (isOriginalId(sourceId)) {
+ console.error("Can't update breakpoints on original sources");
+ return;
+ }
+ const breakpoints = getBreakpointsForSource(getState(), sourceId);
+ // Remap the breakpoints with the original location information from
+ // the pretty-printed source.
+ const newBreakpoints = await Promise.all(
+ breakpoints.map(async breakpoint => {
+ const location = await getOriginalLocation(
+ breakpoint.generatedLocation,
+ thunkArgs
+ );
+ return { ...breakpoint, location };
+ })
+ );
+
+ // Normally old breakpoints will be clobbered if we re-add them, but when
+ // remapping we have changed the source maps and the old breakpoints will
+ // have different locations than the new ones. Manually remove the
+ // old breakpoints before adding the new ones.
+ for (const bp of breakpoints) {
+ dispatch(removeBreakpoint(cx, bp));
+ }
+
+ for (const bp of newBreakpoints) {
+ await dispatch(addBreakpoint(cx, bp.location, bp.options, bp.disabled));
+ }
+ };
+}
+
+export function toggleBreakpointAtLine(cx, line) {
+ return ({ dispatch, getState }) => {
+ const state = getState();
+ const selectedSource = getSelectedSource(state);
+
+ if (!selectedSource) {
+ return null;
+ }
+
+ const bp = getBreakpointAtLocation(state, { line, column: undefined });
+ if (bp) {
+ return dispatch(removeBreakpoint(cx, bp));
+ }
+ return dispatch(
+ addBreakpoint(
+ cx,
+ createLocation({
+ source: selectedSource,
+ sourceUrl: selectedSource.url,
+ line,
+ })
+ )
+ );
+ };
+}
+
+export function addBreakpointAtLine(
+ cx,
+ line,
+ shouldLog = false,
+ disabled = false
+) {
+ return ({ dispatch, getState }) => {
+ const state = getState();
+ const source = getSelectedSource(state);
+
+ if (!source) {
+ return null;
+ }
+ const breakpointLocation = createLocation({
+ source,
+ sourceUrl: source.url,
+ column: undefined,
+ line,
+ });
+
+ const options = {};
+ if (shouldLog) {
+ options.logValue = "displayName";
+ }
+
+ return dispatch(addBreakpoint(cx, breakpointLocation, options, disabled));
+ };
+}
+
+export function removeBreakpointsAtLine(cx, sourceId, line) {
+ return ({ dispatch, getState }) => {
+ const breakpointsAtLine = getBreakpointsForSource(
+ getState(),
+ sourceId,
+ line
+ );
+ return dispatch(removeBreakpoints(cx, breakpointsAtLine));
+ };
+}
+
+export function disableBreakpointsAtLine(cx, sourceId, line) {
+ return ({ dispatch, getState }) => {
+ const breakpointsAtLine = getBreakpointsForSource(
+ getState(),
+ sourceId,
+ line
+ );
+ return dispatch(toggleBreakpoints(cx, true, breakpointsAtLine));
+ };
+}
+
+export function enableBreakpointsAtLine(cx, sourceId, line) {
+ return ({ dispatch, getState }) => {
+ const breakpointsAtLine = getBreakpointsForSource(
+ getState(),
+ sourceId,
+ line
+ );
+ return dispatch(toggleBreakpoints(cx, false, breakpointsAtLine));
+ };
+}
+
+export function toggleDisabledBreakpoint(cx, breakpoint) {
+ return ({ dispatch, getState }) => {
+ if (!breakpoint.disabled) {
+ return dispatch(disableBreakpoint(cx, breakpoint));
+ }
+ return dispatch(enableBreakpoint(cx, breakpoint));
+ };
+}
+
+export function enableXHRBreakpoint(index, bp) {
+ return ({ dispatch, getState, client }) => {
+ const xhrBreakpoints = getXHRBreakpoints(getState());
+ const breakpoint = bp || xhrBreakpoints[index];
+ const enabledBreakpoint = {
+ ...breakpoint,
+ disabled: false,
+ };
+
+ return dispatch({
+ type: "ENABLE_XHR_BREAKPOINT",
+ breakpoint: enabledBreakpoint,
+ index,
+ [PROMISE]: client.setXHRBreakpoint(breakpoint.path, breakpoint.method),
+ });
+ };
+}
+
+export function disableXHRBreakpoint(index, bp) {
+ return ({ dispatch, getState, client }) => {
+ const xhrBreakpoints = getXHRBreakpoints(getState());
+ const breakpoint = bp || xhrBreakpoints[index];
+ const disabledBreakpoint = {
+ ...breakpoint,
+ disabled: true,
+ };
+
+ return dispatch({
+ type: "DISABLE_XHR_BREAKPOINT",
+ breakpoint: disabledBreakpoint,
+ index,
+ [PROMISE]: client.removeXHRBreakpoint(breakpoint.path, breakpoint.method),
+ });
+ };
+}
+
+export function updateXHRBreakpoint(index, path, method) {
+ return ({ dispatch, getState, client }) => {
+ const xhrBreakpoints = getXHRBreakpoints(getState());
+ const breakpoint = xhrBreakpoints[index];
+
+ const updatedBreakpoint = {
+ ...breakpoint,
+ path,
+ method,
+ text: L10N.getFormatStr("xhrBreakpoints.item.label", path),
+ };
+
+ return dispatch({
+ type: "UPDATE_XHR_BREAKPOINT",
+ breakpoint: updatedBreakpoint,
+ index,
+ [PROMISE]: Promise.all([
+ client.removeXHRBreakpoint(breakpoint.path, breakpoint.method),
+ client.setXHRBreakpoint(path, method),
+ ]),
+ });
+ };
+}
+export function togglePauseOnAny() {
+ return ({ dispatch, getState }) => {
+ const xhrBreakpoints = getXHRBreakpoints(getState());
+ const index = xhrBreakpoints.findIndex(({ path }) => path.length === 0);
+ if (index < 0) {
+ return dispatch(setXHRBreakpoint("", "ANY"));
+ }
+
+ const bp = xhrBreakpoints[index];
+ if (bp.disabled) {
+ return dispatch(enableXHRBreakpoint(index, bp));
+ }
+
+ return dispatch(disableXHRBreakpoint(index, bp));
+ };
+}
+
+export function setXHRBreakpoint(path, method) {
+ return ({ dispatch, getState, client }) => {
+ const breakpoint = createXHRBreakpoint(path, method);
+
+ return dispatch({
+ type: "SET_XHR_BREAKPOINT",
+ breakpoint,
+ [PROMISE]: client.setXHRBreakpoint(path, method),
+ });
+ };
+}
+
+export function removeAllXHRBreakpoints() {
+ return async ({ dispatch, getState, client }) => {
+ const xhrBreakpoints = getXHRBreakpoints(getState());
+ const promises = xhrBreakpoints.map(breakpoint =>
+ client.removeXHRBreakpoint(breakpoint.path, breakpoint.method)
+ );
+ await dispatch({
+ type: "CLEAR_XHR_BREAKPOINTS",
+ [PROMISE]: Promise.all(promises),
+ });
+ asyncStore.xhrBreakpoints = [];
+ };
+}
+
+export function removeXHRBreakpoint(index) {
+ return ({ dispatch, getState, client }) => {
+ const xhrBreakpoints = getXHRBreakpoints(getState());
+ const breakpoint = xhrBreakpoints[index];
+ return dispatch({
+ type: "REMOVE_XHR_BREAKPOINT",
+ breakpoint,
+ index,
+ [PROMISE]: client.removeXHRBreakpoint(breakpoint.path, breakpoint.method),
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/breakpoints/modify.js b/devtools/client/debugger/src/actions/breakpoints/modify.js
new file mode 100644
index 0000000000..4576a61e27
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/modify.js
@@ -0,0 +1,382 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { createBreakpoint } from "../../client/firefox/create";
+import {
+ makeBreakpointServerLocation,
+ makeBreakpointId,
+} from "../../utils/breakpoint";
+import {
+ getBreakpoint,
+ getBreakpointPositionsForLocation,
+ getFirstBreakpointPosition,
+ getSettledSourceTextContent,
+ getBreakpointsList,
+ getPendingBreakpointList,
+ isMapScopesEnabled,
+ getBlackBoxRanges,
+ isSourceMapIgnoreListEnabled,
+ isSourceOnSourceMapIgnoreList,
+} from "../../selectors";
+
+import { setBreakpointPositions } from "./breakpointPositions";
+import { setSkipPausing } from "../pause/skipPausing";
+
+import { PROMISE } from "../utils/middleware/promise";
+import { recordEvent } from "../../utils/telemetry";
+import { comparePosition } from "../../utils/location";
+import { getTextAtPosition, isLineBlackboxed } from "../../utils/source";
+import { getMappedScopesForLocation } from "../pause/mapScopes";
+import { validateNavigateContext } from "../../utils/context";
+
+// This file has the primitive operations used to modify individual breakpoints
+// and keep them in sync with the breakpoints installed on server threads. These
+// are collected here to make it easier to preserve the following invariant:
+//
+// Breakpoints are included in reducer state if they are disabled or requests
+// have been dispatched to set them in all server threads.
+//
+// To maintain this property, updates to the reducer and installed breakpoints
+// must happen with no intervening await. Using await allows other operations to
+// modify the breakpoint state in the interim and potentially cause breakpoint
+// state to go out of sync.
+//
+// The reducer is optimistically updated when users set or remove a breakpoint,
+// but it might take a little while before the breakpoints have been set or
+// removed in each thread. Once all outstanding requests sent to a thread have
+// been processed, the reducer and server threads will be in sync.
+//
+// There is another exception to the above invariant when first connecting to
+// the server: breakpoints have been installed on all generated locations in the
+// pending breakpoints, but no breakpoints have been added to the reducer. When
+// a matching source appears, either the server breakpoint will be removed or a
+// breakpoint will be added to the reducer, to restore the above invariant.
+// See syncBreakpoint.js for more.
+
+async function clientSetBreakpoint(
+ client,
+ cx,
+ { getState, dispatch },
+ breakpoint
+) {
+ const breakpointServerLocation = makeBreakpointServerLocation(
+ getState(),
+ breakpoint.generatedLocation
+ );
+ const shouldMapBreakpointExpressions =
+ isMapScopesEnabled(getState()) &&
+ breakpoint.location.source.isOriginal &&
+ (breakpoint.options.logValue || breakpoint.options.condition);
+
+ if (shouldMapBreakpointExpressions) {
+ breakpoint = await dispatch(updateBreakpointSourceMapping(cx, breakpoint));
+ }
+ return client.setBreakpoint(breakpointServerLocation, breakpoint.options);
+}
+
+function clientRemoveBreakpoint(client, state, generatedLocation) {
+ const breakpointServerLocation = makeBreakpointServerLocation(
+ state,
+ generatedLocation
+ );
+ return client.removeBreakpoint(breakpointServerLocation);
+}
+
+export function enableBreakpoint(cx, initialBreakpoint) {
+ return thunkArgs => {
+ const { dispatch, getState, client } = thunkArgs;
+ const state = getState();
+ const breakpoint = getBreakpoint(state, initialBreakpoint.location);
+ const blackboxedRanges = getBlackBoxRanges(state);
+ const isSourceOnIgnoreList =
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, breakpoint.location.source);
+ if (
+ !breakpoint ||
+ !breakpoint.disabled ||
+ isLineBlackboxed(
+ blackboxedRanges[breakpoint.location.source.url],
+ breakpoint.location.line,
+ isSourceOnIgnoreList
+ )
+ ) {
+ return null;
+ }
+
+ dispatch(setSkipPausing(false));
+ return dispatch({
+ type: "SET_BREAKPOINT",
+ cx,
+ breakpoint: createBreakpoint({ ...breakpoint, disabled: false }),
+ [PROMISE]: clientSetBreakpoint(client, cx, thunkArgs, breakpoint),
+ });
+ };
+}
+
+export function addBreakpoint(
+ cx,
+ initialLocation,
+ options = {},
+ disabled,
+ shouldCancel = () => false
+) {
+ return async thunkArgs => {
+ const { dispatch, getState, client } = thunkArgs;
+ recordEvent("add_breakpoint");
+
+ await dispatch(
+ setBreakpointPositions({
+ cx,
+ location: initialLocation,
+ })
+ );
+
+ const position = initialLocation.column
+ ? getBreakpointPositionsForLocation(getState(), initialLocation)
+ : getFirstBreakpointPosition(getState(), initialLocation);
+
+ // No position is found if the `initialLocation` is on a non-breakable line or
+ // the line no longer exists.
+ if (!position) {
+ return null;
+ }
+
+ const { location, generatedLocation } = position;
+
+ if (!location.source || !generatedLocation.source) {
+ return null;
+ }
+
+ const originalContent = getSettledSourceTextContent(getState(), location);
+ const originalText = getTextAtPosition(
+ location.source.id,
+ originalContent,
+ location
+ );
+
+ const content = getSettledSourceTextContent(getState(), generatedLocation);
+ const text = getTextAtPosition(
+ generatedLocation.source.id,
+ content,
+ generatedLocation
+ );
+
+ const id = makeBreakpointId(location);
+ const breakpoint = createBreakpoint({
+ id,
+ disabled,
+ options,
+ location,
+ generatedLocation,
+ text,
+ originalText,
+ });
+
+ if (shouldCancel()) {
+ return null;
+ }
+
+ dispatch(setSkipPausing(false));
+ return dispatch({
+ type: "SET_BREAKPOINT",
+ cx,
+ breakpoint,
+ // If we just clobbered an enabled breakpoint with a disabled one, we need
+ // to remove any installed breakpoint in the server.
+ [PROMISE]: disabled
+ ? clientRemoveBreakpoint(client, getState(), generatedLocation)
+ : clientSetBreakpoint(client, cx, thunkArgs, breakpoint),
+ });
+ };
+}
+
+/**
+ * Remove a single breakpoint
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function removeBreakpoint(cx, initialBreakpoint) {
+ return ({ dispatch, getState, client }) => {
+ recordEvent("remove_breakpoint");
+
+ const breakpoint = getBreakpoint(getState(), initialBreakpoint.location);
+ if (!breakpoint) {
+ return null;
+ }
+
+ dispatch(setSkipPausing(false));
+ return dispatch({
+ type: "REMOVE_BREAKPOINT",
+ cx,
+ breakpoint,
+ // If the breakpoint is disabled then it is not installed in the server.
+ [PROMISE]: breakpoint.disabled
+ ? Promise.resolve()
+ : clientRemoveBreakpoint(
+ client,
+ getState(),
+ breakpoint.generatedLocation
+ ),
+ });
+ };
+}
+
+/**
+ * Remove all installed, pending, and client breakpoints associated with a
+ * target generated location.
+ *
+ * @param {Object} target
+ * Location object where to remove breakpoints.
+ */
+export function removeBreakpointAtGeneratedLocation(cx, target) {
+ return ({ dispatch, getState, client }) => {
+ // remove breakpoint from the server
+ const onBreakpointRemoved = clientRemoveBreakpoint(
+ client,
+ getState(),
+ target
+ );
+ // Remove any breakpoints matching the generated location.
+ const breakpoints = getBreakpointsList(getState());
+ for (const breakpoint of breakpoints) {
+ const { generatedLocation } = breakpoint;
+ if (
+ generatedLocation.sourceId == target.sourceId &&
+ comparePosition(generatedLocation, target)
+ ) {
+ dispatch({
+ type: "REMOVE_BREAKPOINT",
+ cx,
+ breakpoint,
+ [PROMISE]: onBreakpointRemoved,
+ });
+ }
+ }
+
+ // Remove any remaining pending breakpoints matching the generated location.
+ const pending = getPendingBreakpointList(getState());
+ for (const pendingBreakpoint of pending) {
+ const { generatedLocation } = pendingBreakpoint;
+ if (
+ generatedLocation.sourceUrl == target.sourceUrl &&
+ comparePosition(generatedLocation, target)
+ ) {
+ dispatch({
+ type: "REMOVE_PENDING_BREAKPOINT",
+ cx,
+ pendingBreakpoint,
+ });
+ }
+ }
+ return onBreakpointRemoved;
+ };
+}
+
+/**
+ * Disable a single breakpoint
+ *
+ * @memberof actions/breakpoints
+ * @static
+ */
+export function disableBreakpoint(cx, initialBreakpoint) {
+ return ({ dispatch, getState, client }) => {
+ const breakpoint = getBreakpoint(getState(), initialBreakpoint.location);
+ if (!breakpoint || breakpoint.disabled) {
+ return null;
+ }
+
+ dispatch(setSkipPausing(false));
+ return dispatch({
+ type: "SET_BREAKPOINT",
+ cx,
+ breakpoint: createBreakpoint({ ...breakpoint, disabled: true }),
+ [PROMISE]: clientRemoveBreakpoint(
+ client,
+ getState(),
+ breakpoint.generatedLocation
+ ),
+ });
+ };
+}
+
+/**
+ * Update the options of a breakpoint.
+ *
+ * @throws {Error} "not implemented"
+ * @memberof actions/breakpoints
+ * @static
+ * @param {SourceLocation} location
+ * @see DebuggerController.Breakpoints.addBreakpoint
+ * @param {Object} options
+ * Any options to set on the breakpoint
+ */
+export function setBreakpointOptions(cx, location, options = {}) {
+ return thunkArgs => {
+ const { dispatch, getState, client } = thunkArgs;
+ let breakpoint = getBreakpoint(getState(), location);
+ if (!breakpoint) {
+ return dispatch(addBreakpoint(cx, location, options));
+ }
+
+ // Note: setting a breakpoint's options implicitly enables it.
+ breakpoint = createBreakpoint({ ...breakpoint, disabled: false, options });
+
+ return dispatch({
+ type: "SET_BREAKPOINT",
+ cx,
+ breakpoint,
+ [PROMISE]: clientSetBreakpoint(client, cx, thunkArgs, breakpoint),
+ });
+ };
+}
+
+async function updateExpression(parserWorker, mappings, originalExpression) {
+ const mapped = await parserWorker.mapExpression(
+ originalExpression,
+ mappings,
+ [],
+ false,
+ false
+ );
+ if (!mapped) {
+ return originalExpression;
+ }
+ if (!originalExpression.trimEnd().endsWith(";")) {
+ return mapped.expression.replace(/;$/, "");
+ }
+ return mapped.expression;
+}
+
+function updateBreakpointSourceMapping(cx, breakpoint) {
+ return async ({ getState, dispatch, parserWorker }) => {
+ const options = { ...breakpoint.options };
+
+ const mappedScopes = await dispatch(
+ getMappedScopesForLocation(breakpoint.location)
+ );
+ if (!mappedScopes) {
+ return breakpoint;
+ }
+ const { mappings } = mappedScopes;
+
+ if (options.condition) {
+ options.condition = await updateExpression(
+ parserWorker,
+ mappings,
+ options.condition
+ );
+ }
+ if (options.logValue) {
+ options.logValue = await updateExpression(
+ parserWorker,
+ mappings,
+ options.logValue
+ );
+ }
+
+ validateNavigateContext(getState(), cx);
+ return { ...breakpoint, options };
+ };
+}
diff --git a/devtools/client/debugger/src/actions/breakpoints/moz.build b/devtools/client/debugger/src/actions/breakpoints/moz.build
new file mode 100644
index 0000000000..65910c4ef2
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/moz.build
@@ -0,0 +1,13 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "breakpointPositions.js",
+ "index.js",
+ "modify.js",
+ "syncBreakpoint.js",
+)
diff --git a/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js b/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js
new file mode 100644
index 0000000000..b52c0ddfb1
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js
@@ -0,0 +1,138 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { setBreakpointPositions } from "./breakpointPositions";
+import {
+ findPosition,
+ makeBreakpointServerLocation,
+} from "../../utils/breakpoint";
+
+import { comparePosition, createLocation } from "../../utils/location";
+
+import {
+ originalToGeneratedId,
+ isOriginalId,
+} from "devtools/client/shared/source-map-loader/index";
+import { getSource } from "../../selectors";
+import { addBreakpoint, removeBreakpointAtGeneratedLocation } from ".";
+
+async function findBreakpointPosition(cx, { getState, dispatch }, location) {
+ const positions = await dispatch(setBreakpointPositions({ cx, location }));
+
+ const position = findPosition(positions, location);
+ return position;
+}
+
+// Breakpoint syncing occurs when a source is found that matches either the
+// original or generated URL of a pending breakpoint. A new breakpoint is
+// constructed that might have a different original and/or generated location,
+// if the original source has changed since the pending breakpoint was created.
+// There are a couple subtle aspects to syncing:
+//
+// - We handle both the original and generated source because there is no
+// guarantee that seeing the generated source means we will also see the
+// original source. When connecting, a breakpoint will be installed in the
+// client for the generated location in the pending breakpoint, and we need
+// to make sure that either a breakpoint is added to the reducer or that this
+// client breakpoint is deleted.
+//
+// - If we see both the original and generated sources and the source mapping
+// has changed, we need to make sure that only a single breakpoint is added
+// to the reducer for the new location corresponding to the original location
+// in the pending breakpoint.
+export function syncPendingBreakpoint(cx, sourceId, pendingBreakpoint) {
+ return async thunkArgs => {
+ const { getState, client, dispatch } = thunkArgs;
+
+ const source = getSource(getState(), sourceId);
+
+ const generatedSourceId = isOriginalId(sourceId)
+ ? originalToGeneratedId(sourceId)
+ : sourceId;
+
+ const generatedSource = getSource(getState(), generatedSourceId);
+
+ if (!source || !generatedSource) {
+ return null;
+ }
+
+ // /!\ Pending breakpoint locations come only with sourceUrl, line and column attributes.
+ // We have to map it to a specific source object and avoid trying to query its non-existent 'source' attribute.
+ const { location, generatedLocation } = pendingBreakpoint;
+ const isPendingBreakpointWithSourceMap =
+ location.sourceUrl != generatedLocation.sourceUrl;
+ const sourceGeneratedLocation = createLocation({
+ ...generatedLocation,
+ source: generatedSource,
+ });
+
+ if (source == generatedSource && isPendingBreakpointWithSourceMap) {
+ // We are handling the generated source and the pending breakpoint has a
+ // source mapping. Supply a cancellation callback that will abort the
+ // breakpoint if the original source was synced to a different location,
+ // in which case the client breakpoint has been removed.
+ const breakpointServerLocation = makeBreakpointServerLocation(
+ getState(),
+ sourceGeneratedLocation
+ );
+ return dispatch(
+ addBreakpoint(
+ cx,
+ sourceGeneratedLocation,
+ pendingBreakpoint.options,
+ pendingBreakpoint.disabled,
+ () => !client.hasBreakpoint(breakpointServerLocation)
+ )
+ );
+ }
+
+ const originalLocation = createLocation({
+ ...location,
+ source,
+ });
+
+ const newPosition = await findBreakpointPosition(
+ cx,
+ thunkArgs,
+ originalLocation
+ );
+
+ const newGeneratedLocation = newPosition?.generatedLocation;
+ if (!newGeneratedLocation) {
+ // We couldn't find a new mapping for the breakpoint. If there is a source
+ // mapping, remove any breakpoints for the generated location, as if the
+ // breakpoint moved. If the old generated location still maps to an
+ // original location then we don't want to add a breakpoint for it.
+ if (isPendingBreakpointWithSourceMap) {
+ dispatch(
+ removeBreakpointAtGeneratedLocation(cx, sourceGeneratedLocation)
+ );
+ }
+ return null;
+ }
+
+ const isSameLocation = comparePosition(
+ generatedLocation,
+ newGeneratedLocation
+ );
+
+ // If the new generated location has changed from that in the pending
+ // breakpoint, remove any breakpoint associated with the old generated
+ // location.
+ if (!isSameLocation) {
+ dispatch(
+ removeBreakpointAtGeneratedLocation(cx, sourceGeneratedLocation)
+ );
+ }
+
+ return dispatch(
+ addBreakpoint(
+ cx,
+ newGeneratedLocation,
+ pendingBreakpoint.options,
+ pendingBreakpoint.disabled
+ )
+ );
+ };
+}
diff --git a/devtools/client/debugger/src/actions/breakpoints/tests/__snapshots__/breakpoints.spec.js.snap b/devtools/client/debugger/src/actions/breakpoints/tests/__snapshots__/breakpoints.spec.js.snap
new file mode 100644
index 0000000000..c18c3593d9
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/tests/__snapshots__/breakpoints.spec.js.snap
@@ -0,0 +1,173 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`breakpoints should add a breakpoint 1`] = `
+Array [
+ Object {
+ "breakpoints": Array [
+ Object {
+ "disabled": false,
+ "generatedLocation": Object {
+ "column": 1,
+ "line": 2,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "a",
+ "group": "localhost:8000",
+ "path": "/examples/a",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "a",
+ "isExtension": false,
+ "isHTML": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "url": "http://localhost:8000/examples/a",
+ },
+ "sourceActor": null,
+ "sourceActorId": undefined,
+ "sourceId": "a",
+ "sourceUrl": "http://localhost:8000/examples/a",
+ },
+ "id": "a:2:1",
+ "location": Object {
+ "column": 1,
+ "line": 2,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "a",
+ "group": "localhost:8000",
+ "path": "/examples/a",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "a",
+ "isExtension": false,
+ "isHTML": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "url": "http://localhost:8000/examples/a",
+ },
+ "sourceActor": null,
+ "sourceActorId": undefined,
+ "sourceId": "a",
+ "sourceUrl": "http://localhost:8000/examples/a",
+ },
+ "options": Object {},
+ "originalText": "return a",
+ "text": "return a",
+ "thread": undefined,
+ },
+ ],
+ "filename": "a",
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "a",
+ "group": "localhost:8000",
+ "path": "/examples/a",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "a",
+ "isExtension": false,
+ "isHTML": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "url": "http://localhost:8000/examples/a",
+ },
+ },
+]
+`;
+
+exports[`breakpoints should not show a breakpoint that does not have text 1`] = `Array []`;
+
+exports[`breakpoints should show a disabled breakpoint that does not have text 1`] = `
+Array [
+ Object {
+ "breakpoints": Array [
+ Object {
+ "disabled": true,
+ "generatedLocation": Object {
+ "column": 1,
+ "line": 5,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "a",
+ "group": "localhost:8000",
+ "path": "/examples/a",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "a",
+ "isExtension": false,
+ "isHTML": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "url": "http://localhost:8000/examples/a",
+ },
+ "sourceActor": null,
+ "sourceActorId": undefined,
+ "sourceId": "a",
+ "sourceUrl": "http://localhost:8000/examples/a",
+ },
+ "id": "a:5:1",
+ "location": Object {
+ "column": 1,
+ "line": 5,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "a",
+ "group": "localhost:8000",
+ "path": "/examples/a",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "a",
+ "isExtension": false,
+ "isHTML": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "url": "http://localhost:8000/examples/a",
+ },
+ "sourceActor": null,
+ "sourceActorId": undefined,
+ "sourceId": "a",
+ "sourceUrl": "http://localhost:8000/examples/a",
+ },
+ "options": Object {},
+ "originalText": "",
+ "text": "",
+ "thread": undefined,
+ },
+ ],
+ "filename": "a",
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "a",
+ "group": "localhost:8000",
+ "path": "/examples/a",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "a",
+ "isExtension": false,
+ "isHTML": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "url": "http://localhost:8000/examples/a",
+ },
+ },
+]
+`;
diff --git a/devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js b/devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js
new file mode 100644
index 0000000000..558d2400a8
--- /dev/null
+++ b/devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js
@@ -0,0 +1,521 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ createStore,
+ selectors,
+ actions,
+ makeSource,
+ getTelemetryEvents,
+} from "../../../utils/test-head";
+
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
+import { createLocation } from "../../../utils/location";
+
+jest.mock("../../../utils/prefs", () => ({
+ prefs: {
+ expressions: [],
+ },
+ asyncStore: {
+ pendingBreakpoints: {},
+ },
+ features: {
+ inlinePreview: true,
+ },
+}));
+
+function mockClient(positionsResponse = {}) {
+ return {
+ ...mockCommandClient,
+ setSkipPausing: jest.fn(),
+ getSourceActorBreakpointPositions: async () => positionsResponse,
+ getSourceActorBreakableLines: async () => [],
+ };
+}
+
+describe("breakpoints", () => {
+ it("should add a breakpoint", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 2: [1] }));
+ const source = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc1 = createLocation({
+ source,
+ line: 2,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({
+ source,
+ line: 1,
+ column: 1,
+ })
+ )
+ );
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ const bp = selectors.getBreakpoint(getState(), loc1);
+ expect(bp && bp.location).toEqual(loc1);
+ expect(getTelemetryEvents("add_breakpoint")).toHaveLength(1);
+
+ const bpSources = selectors.getBreakpointSources(getState());
+ expect(bpSources).toMatchSnapshot();
+ });
+
+ it("should not show a breakpoint that does not have text", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+ const source = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc1 = createLocation({
+ source,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({
+ source,
+ line: 1,
+ column: 1,
+ })
+ )
+ );
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ const bp = selectors.getBreakpoint(getState(), loc1);
+ expect(bp && bp.location).toEqual(loc1);
+ expect(selectors.getBreakpointSources(getState())).toMatchSnapshot();
+ });
+
+ it("should show a disabled breakpoint that does not have text", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+ const source = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc1 = createLocation({
+ source,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({
+ source,
+ line: 1,
+ column: 1,
+ })
+ )
+ );
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+ const breakpoint = selectors.getBreakpoint(getState(), loc1);
+ if (!breakpoint) {
+ throw new Error("no breakpoint");
+ }
+
+ await dispatch(actions.disableBreakpoint(cx, breakpoint));
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ const bp = selectors.getBreakpoint(getState(), loc1);
+ expect(bp && bp.location).toEqual(loc1);
+ expect(selectors.getBreakpointSources(getState())).toMatchSnapshot();
+ });
+
+ it("should not re-add a breakpoint", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+ const source = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc1 = createLocation({
+ source,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({
+ source,
+ line: 1,
+ column: 1,
+ })
+ )
+ );
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ const bp = selectors.getBreakpoint(getState(), loc1);
+ expect(bp && bp.location).toEqual(loc1);
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ });
+
+ it("should remove a breakpoint", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [1], 6: [2] })
+ );
+
+ const aSource = await dispatch(actions.newGeneratedSource(makeSource("a")));
+
+ const bSource = await dispatch(actions.newGeneratedSource(makeSource("b")));
+
+ const loc1 = createLocation({
+ source: aSource,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+
+ const loc2 = createLocation({
+ source: bSource,
+ line: 6,
+ column: 2,
+ sourceUrl: "http://localhost:8000/examples/b",
+ });
+ const bSourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ bSource.id
+ );
+
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: bSourceActor,
+ })
+ );
+
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({
+ source: aSource,
+ line: 1,
+ column: 1,
+ })
+ )
+ );
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+ await dispatch(actions.addBreakpoint(cx, loc2));
+
+ const bp = selectors.getBreakpoint(getState(), loc1);
+ if (!bp) {
+ throw new Error("no bp");
+ }
+ await dispatch(actions.removeBreakpoint(cx, bp));
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ });
+
+ it("should disable a breakpoint", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [1], 6: [2] })
+ );
+
+ const aSource = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const aSourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ aSource.id
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: aSourceActor,
+ })
+ );
+
+ const bSource = await dispatch(actions.newGeneratedSource(makeSource("b")));
+ const bSourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ bSource.id
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: bSourceActor,
+ })
+ );
+
+ const loc1 = createLocation({
+ source: aSource,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+
+ const loc2 = createLocation({
+ source: bSource,
+ line: 6,
+ column: 2,
+ sourceUrl: "http://localhost:8000/examples/b",
+ });
+ await dispatch(actions.addBreakpoint(cx, loc1));
+ await dispatch(actions.addBreakpoint(cx, loc2));
+
+ const breakpoint = selectors.getBreakpoint(getState(), loc1);
+ if (!breakpoint) {
+ throw new Error("no breakpoint");
+ }
+
+ await dispatch(actions.disableBreakpoint(cx, breakpoint));
+
+ const bp = selectors.getBreakpoint(getState(), loc1);
+ expect(bp && bp.disabled).toBe(true);
+ });
+
+ it("should enable breakpoint", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [1], 6: [2] })
+ );
+
+ const aSource = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc = createLocation({
+ source: aSource,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ const aSourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ aSource.id
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: aSourceActor,
+ })
+ );
+
+ await dispatch(actions.addBreakpoint(cx, loc));
+ let bp = selectors.getBreakpoint(getState(), loc);
+ if (!bp) {
+ throw new Error("no breakpoint");
+ }
+
+ await dispatch(actions.disableBreakpoint(cx, bp));
+
+ bp = selectors.getBreakpoint(getState(), loc);
+ if (!bp) {
+ throw new Error("no breakpoint");
+ }
+
+ expect(bp && bp.disabled).toBe(true);
+
+ await dispatch(actions.enableBreakpoint(cx, bp));
+
+ bp = selectors.getBreakpoint(getState(), loc);
+ expect(bp && !bp.disabled).toBe(true);
+ });
+
+ it("should toggle all the breakpoints", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [1], 6: [2] })
+ );
+
+ const aSource = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const aSourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ aSource.id
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: aSourceActor,
+ })
+ );
+
+ const bSource = await dispatch(actions.newGeneratedSource(makeSource("b")));
+ const bSourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ bSource.id
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: bSourceActor,
+ })
+ );
+
+ const loc1 = createLocation({
+ source: aSource,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+
+ const loc2 = createLocation({
+ source: bSource,
+ line: 6,
+ column: 2,
+ sourceUrl: "http://localhost:8000/examples/b",
+ });
+
+ await dispatch(actions.addBreakpoint(cx, loc1));
+ await dispatch(actions.addBreakpoint(cx, loc2));
+
+ await dispatch(actions.toggleAllBreakpoints(cx, true));
+
+ let bp1 = selectors.getBreakpoint(getState(), loc1);
+ let bp2 = selectors.getBreakpoint(getState(), loc2);
+
+ expect(bp1 && bp1.disabled).toBe(true);
+ expect(bp2 && bp2.disabled).toBe(true);
+
+ await dispatch(actions.toggleAllBreakpoints(cx, false));
+
+ bp1 = selectors.getBreakpoint(getState(), loc1);
+ bp2 = selectors.getBreakpoint(getState(), loc2);
+ expect(bp1 && bp1.disabled).toBe(false);
+ expect(bp2 && bp2.disabled).toBe(false);
+ });
+
+ it("should toggle a breakpoint at a location", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo1"))
+ );
+ const loc = createLocation({ source, line: 5, column: 1 });
+ const getBp = () => selectors.getBreakpoint(getState(), loc);
+ await dispatch(actions.selectLocation(cx, loc));
+
+ await dispatch(actions.toggleBreakpointAtLine(cx, 5));
+ const bp = getBp();
+ expect(bp && !bp.disabled).toBe(true);
+
+ await dispatch(actions.toggleBreakpointAtLine(cx, 5));
+ expect(getBp()).toBe(undefined);
+ });
+
+ it("should disable/enable a breakpoint at a location", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo1"))
+ );
+ const location = createLocation({ source, line: 5, column: 1 });
+ const getBp = () => selectors.getBreakpoint(getState(), location);
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source, line: 1 }))
+ );
+
+ await dispatch(actions.toggleBreakpointAtLine(cx, 5));
+ let bp = getBp();
+ expect(bp && !bp.disabled).toBe(true);
+ bp = getBp();
+ if (!bp) {
+ throw new Error("no bp");
+ }
+ await dispatch(actions.toggleDisabledBreakpoint(cx, bp));
+ bp = getBp();
+ expect(bp && bp.disabled).toBe(true);
+ });
+
+ it("should set the breakpoint condition", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+
+ const source = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc = createLocation({
+ source,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ await dispatch(actions.addBreakpoint(cx, loc));
+
+ let bp = selectors.getBreakpoint(getState(), loc);
+ expect(bp && bp.options.condition).toBe(undefined);
+
+ await dispatch(
+ actions.setBreakpointOptions(cx, loc, {
+ condition: "const foo = 0",
+ getTextForLine: () => {},
+ })
+ );
+
+ bp = selectors.getBreakpoint(getState(), loc);
+ expect(bp && bp.options.condition).toBe("const foo = 0");
+ });
+
+ it("should set the condition and enable a breakpoint", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 5: [1] }));
+
+ const source = await dispatch(actions.newGeneratedSource(makeSource("a")));
+ const loc = createLocation({
+ source,
+ line: 5,
+ column: 1,
+ sourceUrl: "http://localhost:8000/examples/a",
+ });
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ await dispatch(actions.addBreakpoint(cx, loc));
+ let bp = selectors.getBreakpoint(getState(), loc);
+ if (!bp) {
+ throw new Error("no breakpoint");
+ }
+
+ await dispatch(actions.disableBreakpoint(cx, bp));
+
+ bp = selectors.getBreakpoint(getState(), loc);
+ expect(bp && bp.options.condition).toBe(undefined);
+
+ await dispatch(
+ actions.setBreakpointOptions(cx, loc, {
+ condition: "const foo = 0",
+ getTextForLine: () => {},
+ })
+ );
+ const newBreakpoint = selectors.getBreakpoint(getState(), loc);
+ expect(newBreakpoint && !newBreakpoint.disabled).toBe(true);
+ expect(newBreakpoint && newBreakpoint.options.condition).toBe(
+ "const foo = 0"
+ );
+ });
+
+ it("should remove the pretty-printed breakpoint that was added", async () => {
+ const { dispatch, getState, cx } = createStore(mockClient({ 1: [0] }));
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("a.js"))
+ );
+ const loc = createLocation({
+ source,
+ line: 1,
+ column: 0,
+ sourceUrl: "http://localhost:8000/examples/a.js",
+ });
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ await dispatch(actions.addBreakpoint(cx, loc));
+ await dispatch(actions.togglePrettyPrint(cx, "a.js"));
+
+ const breakpoint = selectors.getBreakpointsList(getState())[0];
+
+ await dispatch(actions.removeBreakpoint(cx, breakpoint));
+
+ const breakpointList = selectors.getPendingBreakpointList(getState());
+ expect(breakpointList.length).toBe(0);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/event-listeners.js b/devtools/client/debugger/src/actions/event-listeners.js
new file mode 100644
index 0000000000..9c59e930a7
--- /dev/null
+++ b/devtools/client/debugger/src/actions/event-listeners.js
@@ -0,0 +1,77 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getActiveEventListeners,
+ getEventListenerExpanded,
+ shouldLogEventBreakpoints,
+} from "../selectors";
+
+async function updateBreakpoints(dispatch, client, newEvents) {
+ await client.setEventListenerBreakpoints(newEvents);
+ dispatch({ type: "UPDATE_EVENT_LISTENERS", active: newEvents });
+}
+
+async function updateExpanded(dispatch, newExpanded) {
+ dispatch({
+ type: "UPDATE_EVENT_LISTENER_EXPANDED",
+ expanded: newExpanded,
+ });
+}
+
+export function addEventListenerBreakpoints(eventsToAdd) {
+ return async ({ dispatch, client, getState }) => {
+ const activeListenerBreakpoints = await getActiveEventListeners(getState());
+
+ const newEvents = [
+ ...new Set([...eventsToAdd, ...activeListenerBreakpoints]),
+ ];
+ await updateBreakpoints(dispatch, client, newEvents);
+ };
+}
+
+export function removeEventListenerBreakpoints(eventsToRemove) {
+ return async ({ dispatch, client, getState }) => {
+ const activeListenerBreakpoints = await getActiveEventListeners(getState());
+
+ const newEvents = activeListenerBreakpoints.filter(
+ event => !eventsToRemove.includes(event)
+ );
+
+ await updateBreakpoints(dispatch, client, newEvents);
+ };
+}
+
+export function toggleEventLogging() {
+ return async ({ dispatch, getState, client }) => {
+ const logEventBreakpoints = !shouldLogEventBreakpoints(getState());
+ await client.toggleEventLogging(logEventBreakpoints);
+ dispatch({ type: "TOGGLE_EVENT_LISTENERS", logEventBreakpoints });
+ };
+}
+
+export function addEventListenerExpanded(category) {
+ return async ({ dispatch, getState }) => {
+ const expanded = await getEventListenerExpanded(getState());
+ const newExpanded = [...new Set([...expanded, category])];
+ await updateExpanded(dispatch, newExpanded);
+ };
+}
+
+export function removeEventListenerExpanded(category) {
+ return async ({ dispatch, getState }) => {
+ const expanded = await getEventListenerExpanded(getState());
+
+ const newExpanded = expanded.filter(expand => expand != category);
+
+ updateExpanded(dispatch, newExpanded);
+ };
+}
+
+export function getEventListenerBreakpointTypes() {
+ return async ({ dispatch, client }) => {
+ const categories = await client.getEventListenerBreakpointTypes();
+ dispatch({ type: "RECEIVE_EVENT_LISTENER_TYPES", categories });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/exceptions.js b/devtools/client/debugger/src/actions/exceptions.js
new file mode 100644
index 0000000000..f1746ec2bb
--- /dev/null
+++ b/devtools/client/debugger/src/actions/exceptions.js
@@ -0,0 +1,30 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export function addExceptionFromResources(resources) {
+ return async function ({ dispatch }) {
+ for (const resource of resources) {
+ const { pageError } = resource;
+ if (!pageError.error) {
+ continue;
+ }
+ const { columnNumber, lineNumber, sourceId, errorMessage } = pageError;
+ const stacktrace = pageError.stacktrace || [];
+
+ const exception = {
+ columnNumber,
+ lineNumber,
+ sourceActorId: sourceId,
+ errorMessage,
+ stacktrace,
+ threadActorId: resource.targetFront.targetForm.threadActor,
+ };
+
+ dispatch({
+ type: "ADD_EXCEPTION",
+ exception,
+ });
+ }
+ };
+}
diff --git a/devtools/client/debugger/src/actions/expressions.js b/devtools/client/debugger/src/actions/expressions.js
new file mode 100644
index 0000000000..e324038bfb
--- /dev/null
+++ b/devtools/client/debugger/src/actions/expressions.js
@@ -0,0 +1,195 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getExpression,
+ getExpressions,
+ getSelectedFrame,
+ getSelectedFrameId,
+ getSelectedSource,
+ getSelectedScopeMappings,
+ getSelectedFrameBindings,
+ getCurrentThread,
+ getIsPaused,
+ isMapScopesEnabled,
+} from "../selectors";
+import { PROMISE } from "./utils/middleware/promise";
+import { wrapExpression } from "../utils/expressions";
+import { features } from "../utils/prefs";
+
+/**
+ * Add expression for debugger to watch
+ *
+ * @param {object} expression
+ * @param {number} expression.id
+ * @memberof actions/pause
+ * @static
+ */
+export function addExpression(cx, input) {
+ return async ({ dispatch, getState, parserWorker }) => {
+ if (!input) {
+ return null;
+ }
+
+ const expressionError = await parserWorker.hasSyntaxError(input);
+
+ const expression = getExpression(getState(), input);
+ if (expression) {
+ return dispatch(evaluateExpression(cx, expression));
+ }
+
+ dispatch({ type: "ADD_EXPRESSION", cx, input, expressionError });
+
+ const newExpression = getExpression(getState(), input);
+ if (newExpression) {
+ return dispatch(evaluateExpression(cx, newExpression));
+ }
+
+ return null;
+ };
+}
+
+export function autocomplete(cx, input, cursor) {
+ return async ({ dispatch, getState, client }) => {
+ if (!input) {
+ return;
+ }
+ const frameId = getSelectedFrameId(getState(), cx.thread);
+ const result = await client.autocomplete(input, cursor, frameId);
+ dispatch({ type: "AUTOCOMPLETE", cx, input, result });
+ };
+}
+
+export function clearAutocomplete() {
+ return { type: "CLEAR_AUTOCOMPLETE" };
+}
+
+export function clearExpressionError() {
+ return { type: "CLEAR_EXPRESSION_ERROR" };
+}
+
+export function updateExpression(cx, input, expression) {
+ return async ({ dispatch, getState, parserWorker }) => {
+ if (!input) {
+ return;
+ }
+
+ const expressionError = await parserWorker.hasSyntaxError(input);
+ dispatch({
+ type: "UPDATE_EXPRESSION",
+ cx,
+ expression,
+ input: expressionError ? expression.input : input,
+ expressionError,
+ });
+
+ dispatch(evaluateExpressions(cx));
+ };
+}
+
+/**
+ *
+ * @param {object} expression
+ * @param {number} expression.id
+ * @memberof actions/pause
+ * @static
+ */
+export function deleteExpression(expression) {
+ return ({ dispatch }) => {
+ dispatch({
+ type: "DELETE_EXPRESSION",
+ input: expression.input,
+ });
+ };
+}
+
+/**
+ *
+ * @memberof actions/pause
+ * @param {number} selectedFrameId
+ * @static
+ */
+export function evaluateExpressions(cx) {
+ return async function ({ dispatch, getState, client }) {
+ const expressions = getExpressions(getState());
+ const inputs = expressions.map(({ input }) => input);
+ const frameId = getSelectedFrameId(getState(), cx.thread);
+ const results = await client.evaluateExpressions(inputs, {
+ frameId,
+ threadId: cx.thread,
+ });
+ dispatch({ type: "EVALUATE_EXPRESSIONS", cx, inputs, results });
+ };
+}
+
+function evaluateExpression(cx, expression) {
+ return async function ({ dispatch, getState, client }) {
+ if (!expression.input) {
+ console.warn("Expressions should not be empty");
+ return null;
+ }
+
+ let { input } = expression;
+ const frame = getSelectedFrame(getState(), cx.thread);
+
+ if (frame) {
+ const selectedSource = getSelectedSource(getState());
+
+ if (
+ selectedSource &&
+ frame.location.source.isOriginal &&
+ selectedSource.isOriginal
+ ) {
+ const mapResult = await dispatch(getMappedExpression(input));
+ if (mapResult) {
+ input = mapResult.expression;
+ }
+ }
+ }
+
+ const frameId = getSelectedFrameId(getState(), cx.thread);
+
+ return dispatch({
+ type: "EVALUATE_EXPRESSION",
+ cx,
+ thread: cx.thread,
+ input: expression.input,
+ [PROMISE]: client.evaluate(wrapExpression(input), {
+ frameId,
+ }),
+ });
+ };
+}
+
+/**
+ * Gets information about original variable names from the source map
+ * and replaces all posible generated names.
+ */
+export function getMappedExpression(expression) {
+ return async function ({ dispatch, getState, parserWorker }) {
+ const thread = getCurrentThread(getState());
+ const mappings = getSelectedScopeMappings(getState(), thread);
+ const bindings = getSelectedFrameBindings(getState(), thread);
+
+ // We bail early if we do not need to map the expression. This is important
+ // because mapping an expression can be slow if the parserWorker
+ // worker is busy doing other work.
+ //
+ // 1. there are no mappings - we do not need to map original expressions
+ // 2. does not contain `await` - we do not need to map top level awaits
+ // 3. does not contain `=` - we do not need to map assignments
+ const shouldMapScopes = isMapScopesEnabled(getState()) && mappings;
+ if (!shouldMapScopes && !expression.match(/(await|=)/)) {
+ return null;
+ }
+
+ return parserWorker.mapExpression(
+ expression,
+ mappings,
+ bindings || [],
+ features.mapExpressionBindings && getIsPaused(getState(), thread),
+ features.mapAwaitExpression
+ );
+ };
+}
diff --git a/devtools/client/debugger/src/actions/file-search.js b/devtools/client/debugger/src/actions/file-search.js
new file mode 100644
index 0000000000..4ea2ea01bb
--- /dev/null
+++ b/devtools/client/debugger/src/actions/file-search.js
@@ -0,0 +1,48 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { searchSourceForHighlight } from "../utils/editor";
+
+import { getSelectedSourceTextContent, getSearchOptions } from "../selectors";
+
+import { closeActiveSearch, clearHighlightLineRange } from "./ui";
+
+export function doSearchForHighlight(query, editor, line, ch) {
+ return async ({ getState, dispatch }) => {
+ const sourceTextContent = getSelectedSourceTextContent(getState());
+ if (!sourceTextContent) {
+ return;
+ }
+
+ dispatch(searchContentsForHighlight(query, editor, line, ch));
+ };
+}
+
+// Expose an action to the React component, so that it can call the searchWorker.
+export function querySearchWorker(query, text, modifiers) {
+ return ({ searchWorker }) => {
+ return searchWorker.getMatches(query, text, modifiers);
+ };
+}
+
+export function searchContentsForHighlight(query, editor, line, ch) {
+ return async ({ getState, dispatch }) => {
+ const modifiers = getSearchOptions(getState(), "file-search");
+ const sourceTextContent = getSelectedSourceTextContent(getState());
+
+ if (!query || !editor || !sourceTextContent || !modifiers) {
+ return;
+ }
+
+ const ctx = { ed: editor, cm: editor.codeMirror };
+ searchSourceForHighlight(ctx, false, query, true, modifiers, line, ch);
+ };
+}
+
+export function closeFileSearch(cx, editor) {
+ return ({ getState, dispatch }) => {
+ dispatch(closeActiveSearch());
+ dispatch(clearHighlightLineRange());
+ };
+}
diff --git a/devtools/client/debugger/src/actions/index.js b/devtools/client/debugger/src/actions/index.js
new file mode 100644
index 0000000000..ab6eec75f1
--- /dev/null
+++ b/devtools/client/debugger/src/actions/index.js
@@ -0,0 +1,48 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import * as ast from "./ast";
+import * as breakpoints from "./breakpoints";
+import * as exceptions from "./exceptions";
+import * as expressions from "./expressions";
+import * as eventListeners from "./event-listeners";
+import * as pause from "./pause";
+import * as navigation from "./navigation";
+import * as ui from "./ui";
+import * as fileSearch from "./file-search";
+import * as projectTextSearch from "./project-text-search";
+import * as quickOpen from "./quick-open";
+import * as sourcesTree from "./sources-tree";
+import * as sources from "./sources";
+import * as sourcesActors from "./source-actors";
+import * as tabs from "./tabs";
+import * as threads from "./threads";
+import * as toolbox from "./toolbox";
+import * as preview from "./preview";
+import * as tracing from "./tracing";
+
+import { objectInspector } from "devtools/client/shared/components/reps/index";
+
+export default {
+ ...ast,
+ ...navigation,
+ ...breakpoints,
+ ...exceptions,
+ ...expressions,
+ ...eventListeners,
+ ...sources,
+ ...sourcesActors,
+ ...tabs,
+ ...pause,
+ ...ui,
+ ...fileSearch,
+ ...objectInspector.actions,
+ ...projectTextSearch,
+ ...quickOpen,
+ ...sourcesTree,
+ ...threads,
+ ...toolbox,
+ ...preview,
+ ...tracing,
+};
diff --git a/devtools/client/debugger/src/actions/moz.build b/devtools/client/debugger/src/actions/moz.build
new file mode 100644
index 0000000000..770fc61139
--- /dev/null
+++ b/devtools/client/debugger/src/actions/moz.build
@@ -0,0 +1,31 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "ast",
+ "breakpoints",
+ "pause",
+ "sources",
+ "utils",
+]
+
+CompiledModules(
+ "event-listeners.js",
+ "exceptions.js",
+ "expressions.js",
+ "file-search.js",
+ "index.js",
+ "navigation.js",
+ "preview.js",
+ "project-text-search.js",
+ "quick-open.js",
+ "source-actors.js",
+ "sources-tree.js",
+ "tabs.js",
+ "toolbox.js",
+ "tracing.js",
+ "threads.js",
+ "ui.js",
+)
diff --git a/devtools/client/debugger/src/actions/navigation.js b/devtools/client/debugger/src/actions/navigation.js
new file mode 100644
index 0000000000..03d06a2baa
--- /dev/null
+++ b/devtools/client/debugger/src/actions/navigation.js
@@ -0,0 +1,61 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { clearDocuments } from "../utils/editor";
+import sourceQueue from "../utils/source-queue";
+
+import { clearWasmStates } from "../utils/wasm";
+import { getMainThread, getThreadContext } from "../selectors";
+import { evaluateExpressions } from "../actions/expressions";
+
+/**
+ * Redux actions for the navigation state
+ * @module actions/navigation
+ */
+
+/**
+ * @memberof actions/navigation
+ * @static
+ */
+export function willNavigate(event) {
+ return async function ({
+ dispatch,
+ getState,
+ client,
+ sourceMapLoader,
+ parserWorker,
+ }) {
+ sourceQueue.clear();
+ sourceMapLoader.clearSourceMaps();
+ clearWasmStates();
+ clearDocuments();
+ parserWorker.clear();
+ const thread = getMainThread(getState());
+
+ dispatch({
+ type: "NAVIGATE",
+ mainThread: { ...thread, url: event.url },
+ });
+ };
+}
+
+/**
+ * @memberof actions/navigation
+ * @static
+ */
+export function navigated() {
+ return async function ({ getState, dispatch, panel }) {
+ try {
+ // Update the watched expressions once the page is fully loaded
+ const threadcx = getThreadContext(getState());
+ await dispatch(evaluateExpressions(threadcx));
+ } catch (e) {
+ // This may throw if we resume during the page load.
+ // browser_dbg-debugger-buttons.js highlights this, especially on MacOS or when ran many times
+ console.error("Failed to update expression on navigation", e);
+ }
+
+ panel.emit("reloaded");
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/breakOnNext.js b/devtools/client/debugger/src/actions/pause/breakOnNext.js
new file mode 100644
index 0000000000..02df827cb1
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/breakOnNext.js
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Debugger breakOnNext command.
+ * It's different from the comand action because we also want to
+ * highlight the pause icon.
+ *
+ * @memberof actions/pause
+ * @static
+ */
+export function breakOnNext(cx) {
+ return async ({ dispatch, getState, client }) => {
+ await client.breakOnNext(cx.thread);
+ return dispatch({ type: "BREAK_ON_NEXT", thread: cx.thread });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/commands.js b/devtools/client/debugger/src/actions/pause/commands.js
new file mode 100644
index 0000000000..27478d6ad2
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/commands.js
@@ -0,0 +1,157 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getSelectedFrame,
+ getThreadContext,
+ getCurrentThread,
+ getIsCurrentThreadPaused,
+} from "../../selectors";
+import { PROMISE } from "../utils/middleware/promise";
+import { evaluateExpressions } from "../expressions";
+import { selectLocation } from "../sources";
+import { fetchScopes } from "./fetchScopes";
+import { fetchFrames } from "./fetchFrames";
+import { recordEvent } from "../../utils/telemetry";
+import assert from "../../utils/assert";
+
+export function selectThread(cx, thread) {
+ return async ({ dispatch, getState, client }) => {
+ if (getCurrentThread(getState()) === thread) {
+ return;
+ }
+
+ dispatch({ cx, type: "SELECT_THREAD", thread });
+
+ // Get a new context now that the current thread has changed.
+ const threadcx = getThreadContext(getState());
+ // Note that this is a rethorical assertion as threadcx.thread is updated by SELECT_THREAD action
+ assert(threadcx.thread == thread, "Thread mismatch");
+
+ const serverRequests = [];
+ // Update the watched expressions as we may never have evaluated them against this thread
+ serverRequests.push(dispatch(evaluateExpressions(threadcx)));
+
+ // If we were paused on the newly selected thread, ensure:
+ // - select the source where we are paused,
+ // - fetching the paused stackframes,
+ // - fetching the paused scope, so that variable preview are working on the selected source.
+ // (frames and scopes is supposed to be fetched on pause,
+ // but if two threads pause concurrently, it might be cancelled)
+ const frame = getSelectedFrame(getState(), thread);
+ if (frame) {
+ serverRequests.push(dispatch(selectLocation(threadcx, frame.location)));
+ serverRequests.push(dispatch(fetchFrames(threadcx)));
+ serverRequests.push(dispatch(fetchScopes(threadcx)));
+ }
+
+ await Promise.all(serverRequests);
+ };
+}
+
+/**
+ * Debugger commands like stepOver, stepIn, stepUp
+ *
+ * @param string $0.type
+ * @memberof actions/pause
+ * @static
+ */
+export function command(type) {
+ return async ({ dispatch, getState, client }) => {
+ if (!type) {
+ return null;
+ }
+ // For now, all commands are by default against the currently selected thread
+ const thread = getCurrentThread(getState());
+
+ const frame = getSelectedFrame(getState(), thread);
+
+ return dispatch({
+ type: "COMMAND",
+ command: type,
+ thread,
+ [PROMISE]: client[type](thread, frame?.id),
+ });
+ };
+}
+
+/**
+ * StepIn
+ * @memberof actions/pause
+ * @static
+ * @returns {Function} {@link command}
+ */
+export function stepIn() {
+ return ({ dispatch, getState }) => {
+ if (!getIsCurrentThreadPaused(getState())) {
+ return null;
+ }
+ return dispatch(command("stepIn"));
+ };
+}
+
+/**
+ * stepOver
+ * @memberof actions/pause
+ * @static
+ * @returns {Function} {@link command}
+ */
+export function stepOver() {
+ return ({ dispatch, getState }) => {
+ if (!getIsCurrentThreadPaused(getState())) {
+ return null;
+ }
+ return dispatch(command("stepOver"));
+ };
+}
+
+/**
+ * stepOut
+ * @memberof actions/pause
+ * @static
+ * @returns {Function} {@link command}
+ */
+export function stepOut() {
+ return ({ dispatch, getState }) => {
+ if (!getIsCurrentThreadPaused(getState())) {
+ return null;
+ }
+ return dispatch(command("stepOut"));
+ };
+}
+
+/**
+ * resume
+ * @memberof actions/pause
+ * @static
+ * @returns {Function} {@link command}
+ */
+export function resume() {
+ return ({ dispatch, getState }) => {
+ if (!getIsCurrentThreadPaused(getState())) {
+ return null;
+ }
+ recordEvent("continue");
+ return dispatch(command("resume"));
+ };
+}
+
+/**
+ * restart frame
+ * @memberof actions/pause
+ * @static
+ */
+export function restart(cx, frame) {
+ return async ({ dispatch, getState, client }) => {
+ if (!getIsCurrentThreadPaused(getState())) {
+ return null;
+ }
+ return dispatch({
+ type: "COMMAND",
+ command: "restart",
+ thread: cx.thread,
+ [PROMISE]: client.restart(cx.thread, frame.id),
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/continueToHere.js b/devtools/client/debugger/src/actions/pause/continueToHere.js
new file mode 100644
index 0000000000..56aa117eab
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/continueToHere.js
@@ -0,0 +1,62 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getSelectedSource,
+ getSelectedFrame,
+ getClosestBreakpointPosition,
+ getBreakpoint,
+} from "../../selectors";
+import { createLocation } from "../../utils/location";
+import { addHiddenBreakpoint } from "../breakpoints";
+import { setBreakpointPositions } from "../breakpoints/breakpointPositions";
+
+import { resume } from "./commands";
+
+export function continueToHere(cx, location) {
+ return async function ({ dispatch, getState }) {
+ const { line, column } = location;
+ const selectedSource = getSelectedSource(getState());
+ const selectedFrame = getSelectedFrame(getState(), cx.thread);
+
+ if (!selectedFrame || !selectedSource) {
+ return;
+ }
+
+ const debugLine = selectedFrame.location.line;
+ // If the user selects a line to continue to,
+ // it must be different than the currently paused line.
+ if (!column && debugLine == line) {
+ return;
+ }
+
+ await dispatch(setBreakpointPositions({ cx, location }));
+ const position = getClosestBreakpointPosition(getState(), location);
+
+ // If the user selects a location in the editor,
+ // there must be a place we can pause on that line.
+ if (column && !position) {
+ return;
+ }
+
+ const pauseLocation = column && position ? position.location : location;
+
+ // Set a hidden breakpoint if we do not already have a breakpoint
+ // at the closest position
+ if (!getBreakpoint(getState(), pauseLocation)) {
+ await dispatch(
+ addHiddenBreakpoint(
+ cx,
+ createLocation({
+ source: selectedSource,
+ line: pauseLocation.line,
+ column: pauseLocation.column,
+ })
+ )
+ );
+ }
+
+ dispatch(resume(cx));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/expandScopes.js b/devtools/client/debugger/src/actions/pause/expandScopes.js
new file mode 100644
index 0000000000..fa431ee0b9
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/expandScopes.js
@@ -0,0 +1,17 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { getScopeItemPath } from "../../utils/pause/scopes/utils";
+
+export function setExpandedScope(cx, item, expanded) {
+ return function ({ dispatch, getState }) {
+ return dispatch({
+ type: "SET_EXPANDED_SCOPE",
+ cx,
+ thread: cx.thread,
+ path: getScopeItemPath(item),
+ expanded,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/fetchFrames.js b/devtools/client/debugger/src/actions/pause/fetchFrames.js
new file mode 100644
index 0000000000..42295ae026
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/fetchFrames.js
@@ -0,0 +1,23 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { isValidThreadContext } from "../../utils/context";
+
+export function fetchFrames(cx) {
+ return async function ({ dispatch, client, getState }) {
+ const { thread } = cx;
+ let frames;
+ try {
+ frames = await client.getFrames(thread);
+ } catch (e) {
+ // getFrames will fail if the thread has resumed. In this case the thread
+ // should no longer be valid and the frames we would have fetched would be
+ // discarded anyways.
+ if (isValidThreadContext(getState(), cx)) {
+ throw e;
+ }
+ }
+ dispatch({ type: "FETCHED_FRAMES", thread, frames, cx });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/fetchScopes.js b/devtools/client/debugger/src/actions/pause/fetchScopes.js
new file mode 100644
index 0000000000..691b3ce006
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/fetchScopes.js
@@ -0,0 +1,30 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { getSelectedFrame, getGeneratedFrameScope } from "../../selectors";
+import { mapScopes } from "./mapScopes";
+import { generateInlinePreview } from "./inlinePreview";
+import { PROMISE } from "../utils/middleware/promise";
+
+export function fetchScopes(cx) {
+ return async function ({ dispatch, getState, client }) {
+ const frame = getSelectedFrame(getState(), cx.thread);
+ if (!frame || getGeneratedFrameScope(getState(), frame.id)) {
+ return;
+ }
+
+ const scopes = dispatch({
+ type: "ADD_SCOPES",
+ cx,
+ thread: cx.thread,
+ frame,
+ [PROMISE]: client.getFrameScopes(frame),
+ });
+
+ scopes.then(() => {
+ dispatch(generateInlinePreview(cx, frame));
+ });
+ await dispatch(mapScopes(cx, scopes, frame));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/highlightCalls.js b/devtools/client/debugger/src/actions/pause/highlightCalls.js
new file mode 100644
index 0000000000..aec82fe35b
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/highlightCalls.js
@@ -0,0 +1,89 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getSymbols,
+ getSelectedFrame,
+ getCurrentThread,
+} from "../../selectors";
+
+// a is an ast location with start and end positions (line and column).
+// b is a single position (line and column).
+// This function tests to see if the b position
+// falls within the range given in a.
+function inHouseContainsPosition(a, b) {
+ const bColumn = b.column || 0;
+ const startsBefore =
+ a.start.line < b.line ||
+ (a.start.line === b.line && a.start.column <= bColumn);
+ const endsAfter =
+ a.end.line > b.line || (a.end.line === b.line && a.end.column >= bColumn);
+
+ return startsBefore && endsAfter;
+}
+
+export function highlightCalls(cx) {
+ return async function ({ dispatch, getState, parserWorker }) {
+ if (!cx) {
+ return null;
+ }
+
+ const frame = await getSelectedFrame(
+ getState(),
+ getCurrentThread(getState())
+ );
+
+ if (!frame || !parserWorker.isLocationSupported(frame.location)) {
+ return null;
+ }
+
+ const { thread } = cx;
+
+ const originalAstScopes = await parserWorker.getScopes(frame.location);
+ if (!originalAstScopes) {
+ return null;
+ }
+
+ const symbols = getSymbols(getState(), frame.location);
+
+ if (!symbols) {
+ return null;
+ }
+
+ if (!symbols.callExpressions) {
+ return null;
+ }
+
+ const localAstScope = originalAstScopes[0];
+ const allFunctionCalls = symbols.callExpressions;
+
+ const highlightedCalls = allFunctionCalls.filter(function (call) {
+ const containsStart = inHouseContainsPosition(
+ localAstScope,
+ call.location.start
+ );
+ const containsEnd = inHouseContainsPosition(
+ localAstScope,
+ call.location.end
+ );
+ return containsStart && containsEnd;
+ });
+
+ return dispatch({
+ type: "HIGHLIGHT_CALLS",
+ thread,
+ highlightedCalls,
+ });
+ };
+}
+
+export function unhighlightCalls(cx) {
+ return async function ({ dispatch, getState }) {
+ const { thread } = cx;
+ return dispatch({
+ type: "UNHIGHLIGHT_CALLS",
+ thread,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/index.js b/devtools/client/debugger/src/actions/pause/index.js
new file mode 100644
index 0000000000..be31894019
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/index.js
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for the pause state
+ * @module actions/pause
+ */
+
+export {
+ selectThread,
+ stepIn,
+ stepOver,
+ stepOut,
+ resume,
+ restart,
+} from "./commands";
+export { fetchFrames } from "./fetchFrames";
+export { fetchScopes } from "./fetchScopes";
+export { paused } from "./paused";
+export { resumed } from "./resumed";
+export { continueToHere } from "./continueToHere";
+export { breakOnNext } from "./breakOnNext";
+export { resetBreakpointsPaneState } from "./resetBreakpointsPaneState";
+export { mapFrames } from "./mapFrames";
+export { mapDisplayNames } from "./mapDisplayNames";
+export { pauseOnExceptions } from "./pauseOnExceptions";
+export { selectFrame } from "./selectFrame";
+export { toggleSkipPausing, setSkipPausing } from "./skipPausing";
+export { toggleMapScopes } from "./mapScopes";
+export { setExpandedScope } from "./expandScopes";
+export { generateInlinePreview } from "./inlinePreview";
+export { highlightCalls, unhighlightCalls } from "./highlightCalls";
diff --git a/devtools/client/debugger/src/actions/pause/inlinePreview.js b/devtools/client/debugger/src/actions/pause/inlinePreview.js
new file mode 100644
index 0000000000..e3a4e614c0
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/inlinePreview.js
@@ -0,0 +1,244 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getOriginalFrameScope,
+ getGeneratedFrameScope,
+ getInlinePreviews,
+ getSelectedLocation,
+} from "../../selectors";
+import { features } from "../../utils/prefs";
+import { validateThreadContext } from "../../utils/context";
+
+// We need to display all variables in the current functional scope so
+// include all data for block scopes until the first functional scope
+function getLocalScopeLevels(originalAstScopes) {
+ let levels = 0;
+ while (
+ originalAstScopes[levels] &&
+ originalAstScopes[levels].type === "block"
+ ) {
+ levels++;
+ }
+ return levels;
+}
+
+export function generateInlinePreview(cx, frame) {
+ return async function ({ dispatch, getState, parserWorker, client }) {
+ if (!frame || !features.inlinePreview) {
+ return null;
+ }
+
+ const { thread } = cx;
+
+ // Avoid regenerating inline previews when we already have preview data
+ if (getInlinePreviews(getState(), thread, frame.id)) {
+ return null;
+ }
+
+ const originalFrameScopes = getOriginalFrameScope(
+ getState(),
+ thread,
+ frame.location.sourceId,
+ frame.id
+ );
+
+ const generatedFrameScopes = getGeneratedFrameScope(
+ getState(),
+ thread,
+ frame.id
+ );
+
+ let scopes = originalFrameScopes?.scope || generatedFrameScopes?.scope;
+
+ if (!scopes || !scopes.bindings) {
+ return null;
+ }
+
+ // It's important to use selectedLocation, because we don't know
+ // if we'll be viewing the original or generated frame location
+ const selectedLocation = getSelectedLocation(getState());
+ if (!selectedLocation) {
+ return null;
+ }
+
+ if (!parserWorker.isLocationSupported(selectedLocation)) {
+ return null;
+ }
+
+ const originalAstScopes = await parserWorker.getScopes(selectedLocation);
+ validateThreadContext(getState(), cx);
+ if (!originalAstScopes) {
+ return null;
+ }
+
+ const allPreviews = [];
+ const pausedOnLine = selectedLocation.line;
+ const levels = getLocalScopeLevels(originalAstScopes);
+
+ for (
+ let curLevel = 0;
+ curLevel <= levels && scopes && scopes.bindings;
+ curLevel++
+ ) {
+ const bindings = { ...scopes.bindings.variables };
+ scopes.bindings.arguments.forEach(argument => {
+ Object.keys(argument).forEach(key => {
+ bindings[key] = argument[key];
+ });
+ });
+
+ const previewBindings = Object.keys(bindings).map(async name => {
+ // We want to show values of properties of objects only and not
+ // function calls on other data types like someArr.forEach etc..
+ let properties = null;
+ const objectGrip = bindings[name].value;
+ if (objectGrip.actor && objectGrip.class === "Object") {
+ properties = await client.loadObjectProperties(
+ {
+ name,
+ path: name,
+ contents: { value: objectGrip },
+ },
+ cx.thread
+ );
+ }
+
+ const previewsFromBindings = getBindingValues(
+ originalAstScopes,
+ pausedOnLine,
+ name,
+ bindings[name].value,
+ curLevel,
+ properties
+ );
+
+ allPreviews.push(...previewsFromBindings);
+ });
+ await Promise.all(previewBindings);
+
+ scopes = scopes.parent;
+ }
+
+ // Sort previews by line and column so they're displayed in the right order in the editor
+ allPreviews.sort((previewA, previewB) => {
+ if (previewA.line < previewB.line) {
+ return -1;
+ }
+ if (previewA.line > previewB.line) {
+ return 1;
+ }
+ // If we have the same line number
+ return previewA.column < previewB.column ? -1 : 1;
+ });
+
+ const previews = {};
+ for (const preview of allPreviews) {
+ const { line } = preview;
+ if (!previews[line]) {
+ previews[line] = [];
+ }
+ previews[line].push(preview);
+ }
+
+ return dispatch({
+ type: "ADD_INLINE_PREVIEW",
+ thread,
+ frame,
+ previews,
+ });
+ };
+}
+
+function getBindingValues(
+ originalAstScopes,
+ pausedOnLine,
+ name,
+ value,
+ curLevel,
+ properties
+) {
+ const previews = [];
+
+ const binding = originalAstScopes[curLevel]?.bindings[name];
+ if (!binding) {
+ return previews;
+ }
+
+ // Show a variable only once ( an object and it's child property are
+ // counted as different )
+ const identifiers = new Set();
+
+ // We start from end as we want to show values besides variable
+ // located nearest to the breakpoint
+ for (let i = binding.refs.length - 1; i >= 0; i--) {
+ const ref = binding.refs[i];
+ // Subtracting 1 from line as codemirror lines are 0 indexed
+ const line = ref.start.line - 1;
+ const column = ref.start.column;
+ // We don't want to render inline preview below the paused line
+ if (line >= pausedOnLine - 1) {
+ continue;
+ }
+
+ const { displayName, displayValue } = getExpressionNameAndValue(
+ name,
+ value,
+ ref,
+ properties
+ );
+
+ // Variable with same name exists, display value of current or
+ // closest to the current scope's variable
+ if (identifiers.has(displayName)) {
+ continue;
+ }
+ identifiers.add(displayName);
+
+ previews.push({
+ line,
+ column,
+ name: displayName,
+ value: displayValue,
+ });
+ }
+ return previews;
+}
+
+function getExpressionNameAndValue(
+ name,
+ value,
+ // TODO: Add data type to ref
+ ref,
+ properties
+) {
+ let displayName = name;
+ let displayValue = value;
+
+ // Only variables of type Object will have properties
+ if (properties) {
+ let { meta } = ref;
+ // Presence of meta property means expression contains child property
+ // reference eg: objName.propName
+ while (meta) {
+ // Initially properties will be an array, after that it will be an object
+ if (displayValue === value) {
+ const property = properties.find(prop => prop.name === meta.property);
+ displayValue = property?.contents.value;
+ displayName += `.${meta.property}`;
+ } else if (displayValue?.preview?.ownProperties) {
+ const { ownProperties } = displayValue.preview;
+ Object.keys(ownProperties).forEach(prop => {
+ if (prop === meta.property) {
+ displayValue = ownProperties[prop].value;
+ displayName += `.${meta.property}`;
+ }
+ });
+ }
+ meta = meta.parent;
+ }
+ }
+
+ return { displayName, displayValue };
+}
diff --git a/devtools/client/debugger/src/actions/pause/mapDisplayNames.js b/devtools/client/debugger/src/actions/pause/mapDisplayNames.js
new file mode 100644
index 0000000000..a7abbc36bd
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/mapDisplayNames.js
@@ -0,0 +1,49 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { getFrames, getSymbols } from "../../selectors";
+
+import { findClosestFunction } from "../../utils/ast";
+
+function mapDisplayName(frame, { getState }) {
+ if (frame.isOriginal) {
+ return frame;
+ }
+
+ const symbols = getSymbols(getState(), frame.location);
+
+ if (!symbols || !symbols.functions) {
+ return frame;
+ }
+
+ const originalFunction = findClosestFunction(symbols, frame.location);
+
+ if (!originalFunction) {
+ return frame;
+ }
+
+ const originalDisplayName = originalFunction.name;
+ return { ...frame, originalDisplayName };
+}
+
+export function mapDisplayNames(cx) {
+ return function ({ dispatch, getState }) {
+ const frames = getFrames(getState(), cx.thread);
+
+ if (!frames) {
+ return;
+ }
+
+ const mappedFrames = frames.map(frame =>
+ mapDisplayName(frame, { getState })
+ );
+
+ dispatch({
+ type: "MAP_FRAME_DISPLAY_NAMES",
+ cx,
+ thread: cx.thread,
+ frames: mappedFrames,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/mapFrames.js b/devtools/client/debugger/src/actions/pause/mapFrames.js
new file mode 100644
index 0000000000..d677677505
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/mapFrames.js
@@ -0,0 +1,157 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getFrames,
+ getBlackBoxRanges,
+ getSelectedFrame,
+} from "../../selectors";
+
+import { isFrameBlackBoxed } from "../../utils/source";
+
+import assert from "../../utils/assert";
+import { getOriginalLocation } from "../../utils/source-maps";
+import {
+ debuggerToSourceMapLocation,
+ sourceMapToDebuggerLocation,
+} from "../../utils/location";
+import { isGeneratedId } from "devtools/client/shared/source-map-loader/index";
+
+function getSelectedFrameId(state, thread, frames) {
+ let selectedFrame = getSelectedFrame(state, thread);
+ const blackboxedRanges = getBlackBoxRanges(state);
+
+ if (selectedFrame && !isFrameBlackBoxed(selectedFrame, blackboxedRanges)) {
+ return selectedFrame.id;
+ }
+
+ selectedFrame = frames.find(frame => {
+ return !isFrameBlackBoxed(frame, blackboxedRanges);
+ });
+ return selectedFrame?.id;
+}
+
+async function updateFrameLocation(frame, thunkArgs) {
+ if (frame.isOriginal) {
+ return Promise.resolve(frame);
+ }
+ const location = await getOriginalLocation(frame.location, thunkArgs, true);
+ return {
+ ...frame,
+ location,
+ generatedLocation: frame.generatedLocation || frame.location,
+ };
+}
+
+function updateFrameLocations(frames, thunkArgs) {
+ if (!frames || !frames.length) {
+ return Promise.resolve(frames);
+ }
+
+ return Promise.all(
+ frames.map(frame => updateFrameLocation(frame, thunkArgs))
+ );
+}
+
+function isWasmOriginalSourceFrame(frame, getState) {
+ if (isGeneratedId(frame.location.sourceId)) {
+ return false;
+ }
+
+ return Boolean(frame.generatedLocation?.source.isWasm);
+}
+
+async function expandFrames(frames, { getState, sourceMapLoader }) {
+ const result = [];
+ for (let i = 0; i < frames.length; ++i) {
+ const frame = frames[i];
+ if (frame.isOriginal || !isWasmOriginalSourceFrame(frame, getState)) {
+ result.push(frame);
+ continue;
+ }
+ const originalFrames = await sourceMapLoader.getOriginalStackFrames(
+ debuggerToSourceMapLocation(frame.generatedLocation)
+ );
+ if (!originalFrames) {
+ result.push(frame);
+ continue;
+ }
+
+ assert(!!originalFrames.length, "Expected at least one original frame");
+ // First entry has not specific location -- use one from original frame.
+ originalFrames[0] = {
+ ...originalFrames[0],
+ location: frame.location,
+ };
+
+ originalFrames.forEach((originalFrame, j) => {
+ if (!originalFrame.location) {
+ return;
+ }
+
+ // Keep outer most frame with true actor ID, and generate uniquie
+ // one for the nested frames.
+ const id = j == 0 ? frame.id : `${frame.id}-originalFrame${j}`;
+ result.push({
+ id,
+ displayName: originalFrame.displayName,
+ location: sourceMapToDebuggerLocation(
+ getState(),
+ originalFrame.location
+ ),
+ index: frame.index,
+ source: null,
+ thread: frame.thread,
+ scope: frame.scope,
+ this: frame.this,
+ isOriginal: true,
+ // More fields that will be added by the mapDisplayNames and
+ // updateFrameLocation.
+ generatedLocation: frame.generatedLocation,
+ originalDisplayName: originalFrame.displayName,
+ originalVariables: originalFrame.variables,
+ asyncCause: frame.asyncCause,
+ state: frame.state,
+ });
+ });
+ }
+ return result;
+}
+
+/**
+ * Map call stack frame locations and display names to originals.
+ * e.g.
+ * 1. When the debuggee pauses
+ * 2. When a source is pretty printed
+ * 3. When symbols are loaded
+ * @memberof actions/pause
+ * @static
+ */
+export function mapFrames(cx) {
+ return async function (thunkArgs) {
+ const { dispatch, getState } = thunkArgs;
+ const frames = getFrames(getState(), cx.thread);
+ if (!frames) {
+ return;
+ }
+
+ let mappedFrames = await updateFrameLocations(frames, thunkArgs);
+
+ mappedFrames = await expandFrames(mappedFrames, thunkArgs);
+
+ const selectedFrameId = getSelectedFrameId(
+ getState(),
+ cx.thread,
+ mappedFrames
+ );
+
+ dispatch({
+ type: "MAP_FRAMES",
+ cx,
+ thread: cx.thread,
+ frames: mappedFrames,
+ selectedFrameId,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/mapScopes.js b/devtools/client/debugger/src/actions/pause/mapScopes.js
new file mode 100644
index 0000000000..2a352dc578
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/mapScopes.js
@@ -0,0 +1,194 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getSelectedFrameId,
+ getSettledSourceTextContent,
+ isMapScopesEnabled,
+ getSelectedFrame,
+ getSelectedGeneratedScope,
+ getSelectedOriginalScope,
+ getThreadContext,
+ getFirstSourceActorForGeneratedSource,
+} from "../../selectors";
+import {
+ loadOriginalSourceText,
+ loadGeneratedSourceText,
+} from "../sources/loadSourceText";
+import { PROMISE } from "../utils/middleware/promise";
+import assert from "../../utils/assert";
+
+import { log } from "../../utils/log";
+import { isGenerated } from "../../utils/source";
+
+import { buildMappedScopes } from "../../utils/pause/mapScopes";
+import { isFulfilled } from "../../utils/async-value";
+
+import { getMappedLocation } from "../../utils/source-maps";
+
+const expressionRegex = /\bfp\(\)/g;
+
+export async function buildOriginalScopes(
+ frame,
+ client,
+ cx,
+ frameId,
+ generatedScopes
+) {
+ if (!frame.originalVariables) {
+ throw new TypeError("(frame.originalVariables: XScopeVariables)");
+ }
+ const originalVariables = frame.originalVariables;
+ const frameBase = originalVariables.frameBase || "";
+
+ const inputs = [];
+ for (let i = 0; i < originalVariables.vars.length; i++) {
+ const { expr } = originalVariables.vars[i];
+ const expression = expr
+ ? expr.replace(expressionRegex, frameBase)
+ : "void 0";
+
+ inputs[i] = expression;
+ }
+
+ const results = await client.evaluateExpressions(inputs, {
+ frameId,
+ });
+
+ const variables = {};
+ for (let i = 0; i < originalVariables.vars.length; i++) {
+ const { name } = originalVariables.vars[i];
+ variables[name] = { value: results[i].result };
+ }
+
+ const bindings = {
+ arguments: [],
+ variables,
+ };
+
+ const { actor } = await generatedScopes;
+ const scope = {
+ type: "function",
+ scopeKind: "",
+ actor,
+ bindings,
+ parent: null,
+ function: null,
+ block: null,
+ };
+ return {
+ mappings: {},
+ scope,
+ };
+}
+
+export function toggleMapScopes() {
+ return async function ({ dispatch, getState }) {
+ if (isMapScopesEnabled(getState())) {
+ dispatch({ type: "TOGGLE_MAP_SCOPES", mapScopes: false });
+ return;
+ }
+
+ dispatch({ type: "TOGGLE_MAP_SCOPES", mapScopes: true });
+
+ const cx = getThreadContext(getState());
+
+ if (getSelectedOriginalScope(getState(), cx.thread)) {
+ return;
+ }
+
+ const scopes = getSelectedGeneratedScope(getState(), cx.thread);
+ const frame = getSelectedFrame(getState(), cx.thread);
+ if (!scopes || !frame) {
+ return;
+ }
+
+ dispatch(mapScopes(cx, Promise.resolve(scopes.scope), frame));
+ };
+}
+
+export function mapScopes(cx, scopes, frame) {
+ return async function (thunkArgs) {
+ const { dispatch, client, getState } = thunkArgs;
+ assert(cx.thread == frame.thread, "Thread mismatch");
+
+ await dispatch({
+ type: "MAP_SCOPES",
+ cx,
+ thread: cx.thread,
+ frame,
+ [PROMISE]: (async function () {
+ if (frame.isOriginal && frame.originalVariables) {
+ const frameId = getSelectedFrameId(getState(), cx.thread);
+ return buildOriginalScopes(frame, client, cx, frameId, scopes);
+ }
+
+ return dispatch(getMappedScopes(cx, scopes, frame));
+ })(),
+ });
+ };
+}
+
+export function getMappedScopes(cx, scopes, frame) {
+ return async function (thunkArgs) {
+ const { getState, dispatch } = thunkArgs;
+ const generatedSource = frame.generatedLocation.source;
+
+ const source = frame.location.source;
+
+ if (
+ !isMapScopesEnabled(getState()) ||
+ !source ||
+ !generatedSource ||
+ generatedSource.isWasm ||
+ source.isPrettyPrinted ||
+ isGenerated(source)
+ ) {
+ return null;
+ }
+
+ // Load source text for the original source
+ await dispatch(loadOriginalSourceText({ cx, source }));
+
+ const generatedSourceActor = getFirstSourceActorForGeneratedSource(
+ getState(),
+ generatedSource.id
+ );
+
+ // Also load source text for its corresponding generated source
+ await dispatch(
+ loadGeneratedSourceText({
+ cx,
+ sourceActor: generatedSourceActor,
+ })
+ );
+
+ try {
+ // load original source text content
+ const content = getSettledSourceTextContent(getState(), frame.location);
+
+ return await buildMappedScopes(
+ source,
+ content && isFulfilled(content)
+ ? content.value
+ : { type: "text", value: "", contentType: undefined },
+ frame,
+ await scopes,
+ thunkArgs
+ );
+ } catch (e) {
+ log(e);
+ return null;
+ }
+ };
+}
+
+export function getMappedScopesForLocation(location) {
+ return async function (thunkArgs) {
+ const { dispatch, getState } = thunkArgs;
+ const cx = getThreadContext(getState());
+ const mappedLocation = await getMappedLocation(location, thunkArgs);
+ return dispatch(getMappedScopes(cx, null, mappedLocation));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/moz.build b/devtools/client/debugger/src/actions/pause/moz.build
new file mode 100644
index 0000000000..54cf792166
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/moz.build
@@ -0,0 +1,27 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "breakOnNext.js",
+ "commands.js",
+ "continueToHere.js",
+ "expandScopes.js",
+ "fetchFrames.js",
+ "fetchScopes.js",
+ "highlightCalls.js",
+ "index.js",
+ "inlinePreview.js",
+ "mapDisplayNames.js",
+ "mapFrames.js",
+ "mapScopes.js",
+ "paused.js",
+ "pauseOnExceptions.js",
+ "resetBreakpointsPaneState.js",
+ "resumed.js",
+ "selectFrame.js",
+ "skipPausing.js",
+)
diff --git a/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js b/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js
new file mode 100644
index 0000000000..e7c04ded61
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js
@@ -0,0 +1,34 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { PROMISE } from "../utils/middleware/promise";
+import { recordEvent } from "../../utils/telemetry";
+
+/**
+ *
+ * @memberof actions/pause
+ * @static
+ */
+export function pauseOnExceptions(
+ shouldPauseOnExceptions,
+ shouldPauseOnCaughtExceptions
+) {
+ return ({ dispatch, getState, client }) => {
+ recordEvent("pause_on_exceptions", {
+ exceptions: shouldPauseOnExceptions,
+ // There's no "n" in the key below (#1463117)
+ ["caught_exceptio"]: shouldPauseOnCaughtExceptions,
+ });
+
+ return dispatch({
+ type: "PAUSE_ON_EXCEPTIONS",
+ shouldPauseOnExceptions,
+ shouldPauseOnCaughtExceptions,
+ [PROMISE]: client.pauseOnExceptions(
+ shouldPauseOnExceptions,
+ shouldPauseOnCaughtExceptions
+ ),
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/paused.js b/devtools/client/debugger/src/actions/pause/paused.js
new file mode 100644
index 0000000000..0e797035a5
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/paused.js
@@ -0,0 +1,73 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getHiddenBreakpoint,
+ isEvaluatingExpression,
+ getSelectedFrame,
+ getThreadContext,
+} from "../../selectors";
+
+import { mapFrames, fetchFrames } from ".";
+import { removeBreakpoint } from "../breakpoints";
+import { evaluateExpressions } from "../expressions";
+import { selectLocation } from "../sources";
+import assert from "../../utils/assert";
+
+import { fetchScopes } from "./fetchScopes";
+
+/**
+ * Debugger has just paused
+ *
+ * @param {object} pauseInfo
+ * @memberof actions/pause
+ * @static
+ */
+export function paused(pauseInfo) {
+ return async function ({ dispatch, getState }) {
+ const { thread, frame, why } = pauseInfo;
+
+ dispatch({ type: "PAUSED", thread, why, frame });
+
+ // Get a context capturing the newly paused and selected thread.
+ const cx = getThreadContext(getState());
+ // Note that this is a rethorical assertion as threadcx.thread is updated by PAUSED action
+ assert(cx.thread == thread, "Thread mismatch");
+
+ // When we use "continue to here" feature we register an "hidden" breakpoint
+ // that should be removed on the next paused, even if we didn't hit it and
+ // paused for any other reason.
+ const hiddenBreakpoint = getHiddenBreakpoint(getState());
+ if (hiddenBreakpoint) {
+ dispatch(removeBreakpoint(cx, hiddenBreakpoint));
+ }
+
+ // The THREAD_STATE's "paused" resource only passes the top level stack frame,
+ // we dispatch the PAUSED action with it so that we can right away
+ // display it and update the UI to be paused.
+ // But we then fetch all the other frames:
+ await dispatch(fetchFrames(cx));
+ // And map them to original source locations.
+ // Note that this will wait for all related original sources to be loaded in the reducers.
+ // So this step may pause for a little while.
+ await dispatch(mapFrames(cx));
+
+ // If we paused on a particular frame, automatically select the related source
+ // and highlight the paused line
+ const selectedFrame = getSelectedFrame(getState(), thread);
+ if (selectedFrame) {
+ await dispatch(selectLocation(cx, selectedFrame.location));
+ }
+
+ // Fetch the previews for variables visible in the currently selected paused stackframe
+ await dispatch(fetchScopes(cx));
+
+ // Run after fetching scoping data so that it may make use of the sourcemap
+ // expression mappings for local variables.
+ const atException = why.type == "exception";
+ if (!atException || !isEvaluatingExpression(getState(), thread)) {
+ await dispatch(evaluateExpressions(cx));
+ }
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/resetBreakpointsPaneState.js b/devtools/client/debugger/src/actions/pause/resetBreakpointsPaneState.js
new file mode 100644
index 0000000000..a602c58896
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/resetBreakpointsPaneState.js
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Action for the breakpoints panel while paused.
+ *
+ * @memberof actions/pause
+ * @static
+ */
+export function resetBreakpointsPaneState(thread) {
+ return async ({ dispatch }) => {
+ dispatch({
+ type: "RESET_BREAKPOINTS_PANE_STATE",
+ thread,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/resumed.js b/devtools/client/debugger/src/actions/pause/resumed.js
new file mode 100644
index 0000000000..323e9f0ff8
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/resumed.js
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { isStepping, getPauseReason, getThreadContext } from "../../selectors";
+import { evaluateExpressions } from "../expressions";
+import { inDebuggerEval } from "../../utils/pause";
+
+/**
+ * Debugger has just resumed
+ *
+ * @memberof actions/pause
+ * @static
+ */
+export function resumed(thread) {
+ return async ({ dispatch, client, getState }) => {
+ const why = getPauseReason(getState(), thread);
+ const wasPausedInEval = inDebuggerEval(why);
+ const wasStepping = isStepping(getState(), thread);
+
+ dispatch({ type: "RESUME", thread, wasStepping });
+
+ const cx = getThreadContext(getState());
+ if (!wasStepping && !wasPausedInEval && cx.thread == thread) {
+ await dispatch(evaluateExpressions(cx));
+ }
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/selectFrame.js b/devtools/client/debugger/src/actions/pause/selectFrame.js
new file mode 100644
index 0000000000..f97be42787
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/selectFrame.js
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { selectLocation } from "../sources";
+import { evaluateExpressions } from "../expressions";
+import { fetchScopes } from "./fetchScopes";
+import assert from "../../utils/assert";
+
+/**
+ * @memberof actions/pause
+ * @static
+ */
+export function selectFrame(cx, frame) {
+ return async ({ dispatch, getState }) => {
+ assert(cx.thread == frame.thread, "Thread mismatch");
+
+ // Frames that aren't on-stack do not support evalling and may not
+ // have live inspectable scopes, so we do not allow selecting them.
+ if (frame.state !== "on-stack") {
+ dispatch(selectLocation(cx, frame.location));
+ return;
+ }
+
+ dispatch({
+ type: "SELECT_FRAME",
+ cx,
+ thread: cx.thread,
+ frame,
+ });
+
+ // It's important that we wait for selectLocation to finish because
+ // we rely on the source being loaded and symbols fetched below.
+ await dispatch(selectLocation(cx, frame.location));
+
+ dispatch(evaluateExpressions(cx));
+ dispatch(fetchScopes(cx));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/skipPausing.js b/devtools/client/debugger/src/actions/pause/skipPausing.js
new file mode 100644
index 0000000000..1ecdf33b76
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/skipPausing.js
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { getSkipPausing } from "../../selectors";
+
+/**
+ * @memberof actions/pause
+ * @static
+ */
+export function toggleSkipPausing() {
+ return async ({ dispatch, client, getState }) => {
+ const skipPausing = !getSkipPausing(getState());
+ await client.setSkipPausing(skipPausing);
+ dispatch({ type: "TOGGLE_SKIP_PAUSING", skipPausing });
+ };
+}
+
+/**
+ * @memberof actions/pause
+ * @static
+ */
+export function setSkipPausing(skipPausing) {
+ return async ({ dispatch, client, getState }) => {
+ const currentlySkipping = getSkipPausing(getState());
+ if (currentlySkipping === skipPausing) {
+ return;
+ }
+
+ await client.setSkipPausing(skipPausing);
+ dispatch({ type: "TOGGLE_SKIP_PAUSING", skipPausing });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/pause/tests/__snapshots__/pauseOnExceptions.spec.js.snap b/devtools/client/debugger/src/actions/pause/tests/__snapshots__/pauseOnExceptions.spec.js.snap
new file mode 100644
index 0000000000..55b8d3e724
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/tests/__snapshots__/pauseOnExceptions.spec.js.snap
@@ -0,0 +1,10 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`pauseOnExceptions should track telemetry for pauseOnException changes 1`] = `
+Array [
+ Object {
+ "caught_exceptio": false,
+ "exceptions": true,
+ },
+]
+`;
diff --git a/devtools/client/debugger/src/actions/pause/tests/pause.spec.js b/devtools/client/debugger/src/actions/pause/tests/pause.spec.js
new file mode 100644
index 0000000000..3a562ccfdd
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/tests/pause.spec.js
@@ -0,0 +1,413 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ createStore,
+ createSourceObject,
+ waitForState,
+ makeSource,
+ makeOriginalSource,
+ makeFrame,
+} from "../../../utils/test-head";
+
+import { makeWhyNormal } from "../../../utils/test-mockup";
+import { createLocation } from "../../../utils/location";
+
+const { isStepping } = selectors;
+
+let stepInResolve = null;
+const mockCommandClient = {
+ stepIn: () =>
+ new Promise(_resolve => {
+ stepInResolve = _resolve;
+ }),
+ stepOver: () => new Promise(_resolve => _resolve),
+ evaluate: async () => {},
+ evaluateExpressions: async () => [],
+ resume: async () => {},
+ getFrameScopes: async frame => frame.scope,
+ getFrames: async () => [],
+ setBreakpoint: () => new Promise(_resolve => {}),
+ sourceContents: ({ source }) => {
+ return new Promise((resolve, reject) => {
+ switch (source) {
+ case "foo1":
+ return resolve({
+ source: "function foo1() {\n return 5;\n}",
+ contentType: "text/javascript",
+ });
+ case "await":
+ return resolve({
+ source: "async function aWait() {\n await foo(); return 5;\n}",
+ contentType: "text/javascript",
+ });
+
+ case "foo":
+ return resolve({
+ source: "function foo() {\n return -5;\n}",
+ contentType: "text/javascript",
+ });
+ case "foo-original":
+ return resolve({
+ source: "\n\nfunction fooOriginal() {\n return -5;\n}",
+ contentType: "text/javascript",
+ });
+ case "foo-wasm":
+ return resolve({
+ source: { binary: new ArrayBuffer(0) },
+ contentType: "application/wasm",
+ });
+ case "foo-wasm/originalSource":
+ return resolve({
+ source: "fn fooBar() {}\nfn barZoo() { fooBar() }",
+ contentType: "text/rust",
+ });
+ }
+
+ return resolve();
+ });
+ },
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+ actorID: "threadActorID",
+};
+
+const mockFrameId = "1";
+
+function createPauseInfo(
+ frameLocation = createLocation({
+ source: createSourceObject("foo1"),
+ line: 2,
+ }),
+ frameOpts = {}
+) {
+ const frames = [
+ makeFrame(
+ { id: mockFrameId, sourceId: frameLocation.sourceId },
+ {
+ location: frameLocation,
+ generatedLocation: frameLocation,
+ ...frameOpts,
+ }
+ ),
+ ];
+ return {
+ thread: "FakeThread",
+ frame: frames[0],
+ frames,
+ loadedObjects: [],
+ why: makeWhyNormal(),
+ };
+}
+
+describe("pause", () => {
+ describe("stepping", () => {
+ it("should set and clear the command", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+ const mockPauseInfo = createPauseInfo();
+
+ await dispatch(actions.newGeneratedSource(makeSource("foo1")));
+ await dispatch(actions.paused(mockPauseInfo));
+ const cx = selectors.getThreadContext(getState());
+ const stepped = dispatch(actions.stepIn(cx));
+ expect(isStepping(getState(), "FakeThread")).toBeTruthy();
+ if (!stepInResolve) {
+ throw new Error("no stepInResolve");
+ }
+ await stepInResolve();
+ await stepped;
+ expect(isStepping(getState(), "FakeThread")).toBeFalsy();
+ });
+
+ it("should only step when paused", async () => {
+ const client = { stepIn: jest.fn() };
+ const { dispatch, cx } = createStore(client);
+
+ dispatch(actions.stepIn(cx));
+ expect(client.stepIn.mock.calls).toHaveLength(0);
+ });
+
+ it("should step when paused", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+ const mockPauseInfo = createPauseInfo();
+
+ await dispatch(actions.newGeneratedSource(makeSource("foo1")));
+ await dispatch(actions.paused(mockPauseInfo));
+ const cx = selectors.getThreadContext(getState());
+ dispatch(actions.stepIn(cx));
+ expect(isStepping(getState(), "FakeThread")).toBeTruthy();
+ });
+
+ it("getting frame scopes with bindings", async () => {
+ const client = { ...mockCommandClient };
+ const store = createStore(client, {});
+ const { dispatch, getState } = store;
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+ const generatedLocation = createLocation({
+ source,
+ line: 1,
+ column: 0,
+ sourceActor: selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ ),
+ });
+ const mockPauseInfo = createPauseInfo(generatedLocation, {
+ scope: {
+ bindings: {
+ variables: { b: { value: {} } },
+ arguments: [{ a: { value: {} } }],
+ },
+ },
+ });
+
+ const { frames } = mockPauseInfo;
+ client.getFrames = async () => frames;
+ await dispatch(actions.newOriginalSources([makeOriginalSource(source)]));
+
+ await dispatch(actions.paused(mockPauseInfo));
+ expect(selectors.getFrames(getState(), "FakeThread")).toEqual([
+ {
+ id: mockFrameId,
+ generatedLocation,
+ location: generatedLocation,
+ originalDisplayName: "foo",
+ scope: {
+ bindings: {
+ arguments: [{ a: { value: {} } }],
+ variables: { b: { value: {} } },
+ },
+ },
+ thread: "FakeThread",
+ },
+ ]);
+
+ expect(selectors.getFrameScopes(getState(), "FakeThread")).toEqual({
+ generated: {
+ 1: {
+ pending: false,
+ scope: {
+ bindings: {
+ arguments: [{ a: { value: {} } }],
+ variables: { b: { value: {} } },
+ },
+ },
+ },
+ },
+ mappings: { 1: undefined },
+ original: { 1: { pending: false, scope: undefined } },
+ });
+
+ expect(
+ selectors.getSelectedFrameBindings(getState(), "FakeThread")
+ ).toEqual(["b", "a"]);
+ });
+
+ it("maps frame locations and names to original source", async () => {
+ const sourceMapLoaderMock = {
+ getOriginalLocation: () => Promise.resolve(originalLocation),
+ getOriginalLocations: async items => items,
+ getOriginalSourceText: async () => ({
+ text: "\n\nfunction fooOriginal() {\n return -5;\n}",
+ contentType: "text/javascript",
+ }),
+ getGeneratedLocation: async location => location,
+ };
+
+ const client = { ...mockCommandClient };
+ const store = createStore(client, {}, sourceMapLoaderMock);
+ const { dispatch, getState } = store;
+
+ const originalSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo-original"))
+ );
+
+ const originalLocation = createLocation({
+ source: originalSource,
+ line: 3,
+ column: 0,
+ sourceActor: selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ originalSource.id
+ ),
+ });
+
+ const generatedSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+ const generatedLocation = createLocation({
+ source: generatedSource,
+ line: 1,
+ column: 0,
+ sourceActor: selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ generatedSource.id
+ ),
+ });
+ const mockPauseInfo = createPauseInfo(generatedLocation);
+
+ const { frames } = mockPauseInfo;
+ client.getFrames = async () => frames;
+
+ await dispatch(actions.paused(mockPauseInfo));
+ expect(selectors.getFrames(getState(), "FakeThread")).toEqual([
+ {
+ id: mockFrameId,
+ generatedLocation,
+ location: originalLocation,
+ originalDisplayName: "fooOriginal",
+ scope: { bindings: { arguments: [], variables: {} } },
+ thread: "FakeThread",
+ },
+ ]);
+ });
+
+ it("maps frame to original frames", async () => {
+ const sourceMapLoaderMock = {
+ getOriginalStackFrames: loc => Promise.resolve(originStackFrames),
+ getOriginalLocation: () => Promise.resolve(originalLocation),
+ getOriginalLocations: async items => items,
+ getOriginalSourceText: async () => ({
+ text: "fn fooBar() {}\nfn barZoo() { fooBar() }",
+ contentType: "text/rust",
+ }),
+ getGeneratedRangesForOriginal: async () => [],
+ };
+
+ const client = { ...mockCommandClient };
+ const store = createStore(client, {}, sourceMapLoaderMock);
+ const { dispatch, getState } = store;
+
+ const generatedSource = await dispatch(
+ actions.newGeneratedSource(
+ makeSource("foo-wasm", { introductionType: "wasm" })
+ )
+ );
+
+ const generatedLocation = createLocation({
+ source: generatedSource,
+ line: 1,
+ column: 0,
+ sourceActor: selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ generatedSource.id
+ ),
+ });
+ const mockPauseInfo = createPauseInfo(generatedLocation);
+ const { frames } = mockPauseInfo;
+ client.getFrames = async () => frames;
+
+ const [originalSource] = await dispatch(
+ actions.newOriginalSources([makeOriginalSource(generatedSource)])
+ );
+
+ const originalLocation = createLocation({
+ source: originalSource,
+ line: 1,
+ column: 1,
+ sourceActor: selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ originalSource.id
+ ),
+ });
+ const originalLocation2 = createLocation({
+ source: originalSource,
+ line: 2,
+ column: 14,
+ sourceActor: selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ originalSource.id
+ ),
+ });
+
+ const originStackFrames = [
+ {
+ displayName: "fooBar",
+ thread: "FakeThread",
+ },
+ {
+ displayName: "barZoo",
+ location: originalLocation2,
+ thread: "FakeThread",
+ },
+ ];
+
+ await dispatch(actions.paused(mockPauseInfo));
+ expect(selectors.getFrames(getState(), "FakeThread")).toEqual([
+ {
+ asyncCause: undefined,
+ displayName: "fooBar",
+ generatedLocation,
+ id: "1",
+ index: undefined,
+ isOriginal: true,
+ location: originalLocation,
+ originalDisplayName: "fooBar",
+ originalVariables: undefined,
+ scope: { bindings: { arguments: [], variables: {} } },
+ source: null,
+ state: undefined,
+ this: undefined,
+ thread: "FakeThread",
+ },
+ {
+ asyncCause: undefined,
+ displayName: "barZoo",
+ generatedLocation,
+ id: "1-originalFrame1",
+ index: undefined,
+ isOriginal: true,
+ location: originalLocation2,
+ originalDisplayName: "barZoo",
+ originalVariables: undefined,
+ scope: { bindings: { arguments: [], variables: {} } },
+ source: null,
+ state: undefined,
+ this: undefined,
+ thread: "FakeThread",
+ },
+ ]);
+ });
+ });
+
+ describe("resumed", () => {
+ it("should not evaluate expression while stepping", async () => {
+ const client = { ...mockCommandClient, evaluateExpressions: jest.fn() };
+ const { dispatch, getState } = createStore(client);
+ const mockPauseInfo = createPauseInfo();
+
+ await dispatch(actions.newGeneratedSource(makeSource("foo1")));
+ await dispatch(actions.paused(mockPauseInfo));
+
+ const cx = selectors.getThreadContext(getState());
+ dispatch(actions.stepIn(cx));
+ await dispatch(actions.resumed(mockCommandClient.actorID));
+ expect(client.evaluateExpressions.mock.calls).toHaveLength(1);
+ });
+
+ it("resuming - will re-evaluate watch expressions", async () => {
+ const client = { ...mockCommandClient, evaluateExpressions: jest.fn() };
+ const store = createStore(client);
+ const { dispatch, getState, cx } = store;
+ const mockPauseInfo = createPauseInfo();
+
+ await dispatch(actions.newGeneratedSource(makeSource("foo1")));
+ await dispatch(actions.newGeneratedSource(makeSource("foo")));
+ await dispatch(actions.addExpression(cx, "foo"));
+ await waitForState(store, state => selectors.getExpression(state, "foo"));
+
+ client.evaluateExpressions.mockReturnValue(Promise.resolve(["YAY"]));
+ await dispatch(actions.paused(mockPauseInfo));
+
+ await dispatch(actions.resumed(mockCommandClient.actorID));
+ const expression = selectors.getExpression(getState(), "foo");
+ expect(expression && expression.value).toEqual("YAY");
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/actions/pause/tests/pauseOnExceptions.spec.js b/devtools/client/debugger/src/actions/pause/tests/pauseOnExceptions.spec.js
new file mode 100644
index 0000000000..bc8d000697
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/tests/pauseOnExceptions.spec.js
@@ -0,0 +1,24 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ createStore,
+ getTelemetryEvents,
+} from "../../../utils/test-head";
+
+import {
+ getShouldPauseOnExceptions,
+ getShouldPauseOnCaughtExceptions,
+} from "../../../selectors/pause";
+
+describe("pauseOnExceptions", () => {
+ it("should track telemetry for pauseOnException changes", async () => {
+ const { dispatch, getState } = createStore({ pauseOnExceptions: () => {} });
+ dispatch(actions.pauseOnExceptions(true, false));
+ expect(getTelemetryEvents("pause_on_exceptions")).toMatchSnapshot();
+ expect(getShouldPauseOnExceptions(getState())).toBe(true);
+ expect(getShouldPauseOnCaughtExceptions(getState())).toBe(false);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/pause/tests/skipPausing.spec.js b/devtools/client/debugger/src/actions/pause/tests/skipPausing.spec.js
new file mode 100644
index 0000000000..83006c3089
--- /dev/null
+++ b/devtools/client/debugger/src/actions/pause/tests/skipPausing.spec.js
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { actions, selectors, createStore } from "../../../utils/test-head";
+
+describe("sources - pretty print", () => {
+ it("returns a pretty source for a minified file", async () => {
+ const client = { setSkipPausing: jest.fn() };
+ const { dispatch, getState } = createStore(client);
+
+ await dispatch(actions.toggleSkipPausing());
+ expect(selectors.getSkipPausing(getState())).toBe(true);
+
+ await dispatch(actions.toggleSkipPausing());
+ expect(selectors.getSkipPausing(getState())).toBe(false);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/preview.js b/devtools/client/debugger/src/actions/preview.js
new file mode 100644
index 0000000000..992737e2d1
--- /dev/null
+++ b/devtools/client/debugger/src/actions/preview.js
@@ -0,0 +1,211 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { isConsole } from "../utils/preview";
+import { findBestMatchExpression } from "../utils/ast";
+import { getGrip, getFront } from "../utils/evaluation-result";
+import { getExpressionFromCoords } from "../utils/editor/get-expression";
+import { isNodeTest } from "../utils/environment";
+
+import {
+ getPreview,
+ isLineInScope,
+ isSelectedFrameVisible,
+ getSelectedSource,
+ getSelectedLocation,
+ getSelectedFrame,
+ getSymbols,
+ getCurrentThread,
+ getPreviewCount,
+ getSelectedException,
+} from "../selectors";
+
+import { getMappedExpression } from "./expressions";
+
+function findExpressionMatch(state, codeMirror, tokenPos) {
+ const location = getSelectedLocation(state);
+ if (!location) {
+ return null;
+ }
+
+ const symbols = getSymbols(state, location);
+
+ let match;
+ if (!symbols) {
+ match = getExpressionFromCoords(codeMirror, tokenPos);
+ } else {
+ match = findBestMatchExpression(symbols, tokenPos);
+ }
+ return match;
+}
+
+export function updatePreview(cx, target, tokenPos, codeMirror) {
+ return ({ dispatch, getState }) => {
+ const cursorPos = target.getBoundingClientRect();
+
+ if (
+ !isSelectedFrameVisible(getState()) ||
+ !isLineInScope(getState(), tokenPos.line)
+ ) {
+ return;
+ }
+
+ const match = findExpressionMatch(getState(), codeMirror, tokenPos);
+ if (!match) {
+ return;
+ }
+
+ const { expression, location } = match;
+
+ if (isConsole(expression)) {
+ return;
+ }
+
+ dispatch(setPreview(cx, expression, location, tokenPos, cursorPos, target));
+ };
+}
+
+export function setPreview(
+ cx,
+ expression,
+ location,
+ tokenPos,
+ cursorPos,
+ target
+) {
+ return async ({ dispatch, getState, client }) => {
+ dispatch({ type: "START_PREVIEW" });
+ const previewCount = getPreviewCount(getState());
+ if (getPreview(getState())) {
+ dispatch(clearPreview(cx));
+ }
+
+ const source = getSelectedSource(getState());
+ if (!source) {
+ return;
+ }
+
+ const thread = getCurrentThread(getState());
+ const selectedFrame = getSelectedFrame(getState(), thread);
+
+ if (location && source.isOriginal) {
+ const mapResult = await dispatch(getMappedExpression(expression));
+ if (mapResult) {
+ expression = mapResult.expression;
+ }
+ }
+
+ if (!selectedFrame) {
+ return;
+ }
+
+ const { result } = await client.evaluate(expression, {
+ frameId: selectedFrame.id,
+ });
+
+ const resultGrip = getGrip(result);
+
+ // Error case occurs for a token that follows an errored evaluation
+ // https://github.com/firefox-devtools/debugger/pull/8056
+ // Accommodating for null allows us to show preview for falsy values
+ // line "", false, null, Nan, and more
+ if (resultGrip === null) {
+ return;
+ }
+
+ // Handle cases where the result is invisible to the debugger
+ // and not possible to preview. Bug 1548256
+ if (
+ resultGrip &&
+ resultGrip.class &&
+ typeof resultGrip.class === "string" &&
+ resultGrip.class.includes("InvisibleToDebugger")
+ ) {
+ return;
+ }
+
+ const root = {
+ path: expression,
+ contents: {
+ value: resultGrip,
+ front: getFront(result),
+ },
+ };
+ const properties = await client.loadObjectProperties(root, thread);
+
+ // The first time a popup is rendered, the mouse should be hovered
+ // on the token. If it happens to be hovered on whitespace, it should
+ // not render anything
+ if (!target.matches(":hover") && !isNodeTest()) {
+ return;
+ }
+
+ // Don't finish dispatching if another setPreview was started
+ if (previewCount != getPreviewCount(getState())) {
+ return;
+ }
+
+ dispatch({
+ type: "SET_PREVIEW",
+ cx,
+ value: {
+ expression,
+ resultGrip,
+ properties,
+ root,
+ location,
+ tokenPos,
+ cursorPos,
+ target,
+ },
+ });
+ };
+}
+
+export function clearPreview(cx) {
+ return ({ dispatch, getState, client }) => {
+ const currentSelection = getPreview(getState());
+ if (!currentSelection) {
+ return null;
+ }
+
+ return dispatch({
+ type: "CLEAR_PREVIEW",
+ cx,
+ });
+ };
+}
+
+export function setExceptionPreview(cx, target, tokenPos, codeMirror) {
+ return async ({ dispatch, getState }) => {
+ const cursorPos = target.getBoundingClientRect();
+
+ const match = findExpressionMatch(getState(), codeMirror, tokenPos);
+ if (!match) {
+ return;
+ }
+
+ const tokenColumnStart = match.location.start.column + 1;
+ const exception = getSelectedException(
+ getState(),
+ tokenPos.line,
+ tokenColumnStart
+ );
+ if (!exception) {
+ return;
+ }
+
+ dispatch({
+ type: "SET_PREVIEW",
+ cx,
+ value: {
+ exception,
+ location: match.location,
+ tokenPos,
+ cursorPos,
+ target,
+ },
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/project-text-search.js b/devtools/client/debugger/src/actions/project-text-search.js
new file mode 100644
index 0000000000..26ea0df107
--- /dev/null
+++ b/devtools/client/debugger/src/actions/project-text-search.js
@@ -0,0 +1,171 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for the search state
+ * @module actions/search
+ */
+
+import { isFulfilled } from "../utils/async-value";
+import {
+ getFirstSourceActorForGeneratedSource,
+ getSourceList,
+ getSettledSourceTextContent,
+ isSourceBlackBoxed,
+ getSearchOptions,
+} from "../selectors";
+import { createLocation } from "../utils/location";
+import { matchesGlobPatterns } from "../utils/source";
+import { loadSourceText } from "./sources/loadSourceText";
+import {
+ getProjectSearchOperation,
+ getProjectSearchStatus,
+} from "../selectors/project-text-search";
+import { statusType } from "../reducers/project-text-search";
+import { searchKeys } from "../constants";
+
+export function addSearchQuery(cx, query) {
+ return { type: "ADD_QUERY", cx, query };
+}
+
+export function addOngoingSearch(cx, ongoingSearch) {
+ return { type: "ADD_ONGOING_SEARCH", cx, ongoingSearch };
+}
+
+export function addSearchResult(cx, location, matches) {
+ return {
+ type: "ADD_SEARCH_RESULT",
+ cx,
+ location,
+ matches,
+ };
+}
+
+export function clearSearchResults(cx) {
+ return { type: "CLEAR_SEARCH_RESULTS", cx };
+}
+
+export function clearSearch(cx) {
+ return { type: "CLEAR_SEARCH", cx };
+}
+
+export function updateSearchStatus(cx, status) {
+ return { type: "UPDATE_STATUS", cx, status };
+}
+
+export function closeProjectSearch(cx) {
+ return ({ dispatch, getState }) => {
+ dispatch(stopOngoingSearch(cx));
+ dispatch({ type: "CLOSE_PROJECT_SEARCH" });
+ };
+}
+
+export function stopOngoingSearch(cx) {
+ return ({ dispatch, getState }) => {
+ const state = getState();
+ const ongoingSearch = getProjectSearchOperation(state);
+ const status = getProjectSearchStatus(state);
+ if (ongoingSearch && status !== statusType.done) {
+ ongoingSearch.cancel();
+ dispatch(updateSearchStatus(cx, statusType.cancelled));
+ }
+ };
+}
+
+export function searchSources(cx, query) {
+ let cancelled = false;
+
+ const search = async ({ dispatch, getState }) => {
+ dispatch(stopOngoingSearch(cx));
+ await dispatch(addOngoingSearch(cx, search));
+ await dispatch(clearSearchResults(cx));
+ await dispatch(addSearchQuery(cx, query));
+ dispatch(updateSearchStatus(cx, statusType.fetching));
+ const searchOptions = getSearchOptions(
+ getState(),
+ searchKeys.PROJECT_SEARCH
+ );
+ const validSources = getSourceList(getState()).filter(
+ source =>
+ !isSourceBlackBoxed(getState(), source) &&
+ !matchesGlobPatterns(source, searchOptions.excludePatterns)
+ );
+ // Sort original entries first so that search results are more useful.
+ // Deprioritize third-party scripts, so their results show last.
+ validSources.sort((a, b) => {
+ function isThirdParty(source) {
+ return (
+ source?.url &&
+ (source.url.includes("node_modules") ||
+ source.url.includes("bower_components"))
+ );
+ }
+
+ if (a.isOriginal && !isThirdParty(a)) {
+ return -1;
+ }
+
+ if (b.isOriginal && !isThirdParty(b)) {
+ return 1;
+ }
+
+ if (!isThirdParty(a) && isThirdParty(b)) {
+ return -1;
+ }
+ if (isThirdParty(a) && !isThirdParty(b)) {
+ return 1;
+ }
+ return 0;
+ });
+
+ for (const source of validSources) {
+ if (cancelled) {
+ return;
+ }
+
+ const sourceActor = getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ await dispatch(loadSourceText(cx, source, sourceActor));
+ await dispatch(searchSource(cx, source, sourceActor, query));
+ }
+ dispatch(updateSearchStatus(cx, statusType.done));
+ };
+
+ search.cancel = () => {
+ cancelled = true;
+ };
+
+ return search;
+}
+
+export function searchSource(cx, source, sourceActor, query) {
+ return async ({ dispatch, getState, searchWorker }) => {
+ if (!source) {
+ return;
+ }
+ const state = getState();
+ const location = createLocation({
+ source,
+ sourceActor,
+ });
+
+ const options = getSearchOptions(state, searchKeys.PROJECT_SEARCH);
+ const content = getSettledSourceTextContent(state, location);
+ let matches = [];
+
+ if (content && isFulfilled(content) && content.value.type === "text") {
+ matches = await searchWorker.findSourceMatches(
+ content.value,
+ query,
+ options
+ );
+ }
+ if (!matches.length) {
+ return;
+ }
+ dispatch(addSearchResult(cx, location, matches));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/quick-open.js b/devtools/client/debugger/src/actions/quick-open.js
new file mode 100644
index 0000000000..e5f5352292
--- /dev/null
+++ b/devtools/client/debugger/src/actions/quick-open.js
@@ -0,0 +1,21 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export function setQuickOpenQuery(query) {
+ return {
+ type: "SET_QUICK_OPEN_QUERY",
+ query,
+ };
+}
+
+export function openQuickOpen(query) {
+ if (query != null) {
+ return { type: "OPEN_QUICK_OPEN", query };
+ }
+ return { type: "OPEN_QUICK_OPEN" };
+}
+
+export function closeQuickOpen() {
+ return { type: "CLOSE_QUICK_OPEN" };
+}
diff --git a/devtools/client/debugger/src/actions/source-actors.js b/devtools/client/debugger/src/actions/source-actors.js
new file mode 100644
index 0000000000..9782e493b3
--- /dev/null
+++ b/devtools/client/debugger/src/actions/source-actors.js
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export function insertSourceActors(sourceActors) {
+ return function ({ dispatch }) {
+ dispatch({
+ type: "INSERT_SOURCE_ACTORS",
+ sourceActors,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources-tree.js b/devtools/client/debugger/src/actions/sources-tree.js
new file mode 100644
index 0000000000..ae750a3df7
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources-tree.js
@@ -0,0 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export function setExpandedState(expanded) {
+ return { type: "SET_EXPANDED_STATE", expanded };
+}
+
+export function focusItem(item) {
+ return { type: "SET_FOCUSED_SOURCE_ITEM", item };
+}
diff --git a/devtools/client/debugger/src/actions/sources/blackbox.js b/devtools/client/debugger/src/actions/sources/blackbox.js
new file mode 100644
index 0000000000..6821a0e140
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/blackbox.js
@@ -0,0 +1,223 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for the sources state
+ * @module actions/sources
+ */
+
+import {
+ isOriginalId,
+ originalToGeneratedId,
+} from "devtools/client/shared/source-map-loader/index";
+import { recordEvent } from "../../utils/telemetry";
+import { toggleBreakpoints } from "../breakpoints";
+import {
+ getSourceActorsForSource,
+ isSourceBlackBoxed,
+ getBlackBoxRanges,
+ getBreakpointsForSource,
+} from "../../selectors";
+
+export async function blackboxSourceActorsForSource(
+ thunkArgs,
+ source,
+ shouldBlackBox,
+ ranges = []
+) {
+ const { getState, client, sourceMapLoader } = thunkArgs;
+ let sourceId = source.id;
+ // If the source is the original, then get the source id of its generated file
+ // and the range for where the original is represented in the generated file
+ // (which might be a bundle including other files).
+ if (isOriginalId(source.id)) {
+ sourceId = originalToGeneratedId(source.id);
+ const range = await sourceMapLoader.getFileGeneratedRange(source.id);
+ ranges = [];
+ if (range) {
+ ranges.push(range);
+ // TODO bug 1752108: Investigate blackboxing lines in original files,
+ // there is likely to be issues as the whole genrated file
+ // representing the original file will always be blackboxed.
+ console.warn(
+ "The might be unxpected issues when ignoring lines in an original file. " +
+ "The whole original source is being blackboxed."
+ );
+ } else {
+ throw new Error(
+ `Unable to retrieve generated ranges for original source ${source.url}`
+ );
+ }
+ }
+
+ for (const actor of getSourceActorsForSource(getState(), sourceId)) {
+ await client.blackBox(actor, shouldBlackBox, ranges);
+ }
+}
+
+/**
+ * Toggle blackboxing for the whole source or for specific lines in a source
+ *
+ * @param {Object} cx
+ * @param {Object} source - The source to be blackboxed/unblackboxed.
+ * @param {Boolean} [shouldBlackBox] - Specifies if the source should be blackboxed (true
+ * or unblackboxed (false). When this is not provided
+ * option is decided based on the blackboxed state
+ * of the source.
+ * @param {Array} [ranges] - List of line/column offsets to blackbox, these
+ * are provided only when blackboxing lines.
+ * The range structure:
+ * const range = {
+ * start: { line: 1, column: 5 },
+ * end: { line: 3, column: 4 },
+ * }
+ */
+export function toggleBlackBox(cx, source, shouldBlackBox, ranges = []) {
+ return async thunkArgs => {
+ const { dispatch, getState } = thunkArgs;
+
+ shouldBlackBox =
+ typeof shouldBlackBox == "boolean"
+ ? shouldBlackBox
+ : !isSourceBlackBoxed(getState(), source);
+
+ await blackboxSourceActorsForSource(
+ thunkArgs,
+ source,
+ shouldBlackBox,
+ ranges
+ );
+
+ if (shouldBlackBox) {
+ recordEvent("blackbox");
+ // If ranges is an empty array, it would mean we are blackboxing the whole
+ // source. To do that lets reset the content to an empty array.
+ if (!ranges.length) {
+ dispatch({ type: "BLACKBOX_WHOLE_SOURCES", sources: [source] });
+ await toggleBreakpointsInBlackboxedSources({
+ thunkArgs,
+ cx,
+ shouldDisable: true,
+ sources: [source],
+ });
+ } else {
+ const currentRanges = getBlackBoxRanges(getState())[source.url] || [];
+ ranges = ranges.filter(newRange => {
+ // To avoid adding duplicate ranges make sure
+ // no range already exists with same start and end lines.
+ const duplicate = currentRanges.findIndex(
+ r =>
+ r.start.line == newRange.start.line &&
+ r.end.line == newRange.end.line
+ );
+ return duplicate == -1;
+ });
+ dispatch({ type: "BLACKBOX_SOURCE_RANGES", source, ranges });
+ await toggleBreakpointsInRangesForBlackboxedSource({
+ thunkArgs,
+ cx,
+ shouldDisable: true,
+ source,
+ ranges,
+ });
+ }
+ } else {
+ // if there are no ranges to blackbox, then we are unblackboxing
+ // the whole source
+ // eslint-disable-next-line no-lonely-if
+ if (!ranges.length) {
+ dispatch({ type: "UNBLACKBOX_WHOLE_SOURCES", sources: [source] });
+ toggleBreakpointsInBlackboxedSources({
+ thunkArgs,
+ cx,
+ shouldDisable: false,
+ sources: [source],
+ });
+ } else {
+ dispatch({ type: "UNBLACKBOX_SOURCE_RANGES", source, ranges });
+ const blackboxRanges = getBlackBoxRanges(getState());
+ if (!blackboxRanges[source.url].length) {
+ dispatch({ type: "UNBLACKBOX_WHOLE_SOURCES", sources: [source] });
+ }
+ await toggleBreakpointsInRangesForBlackboxedSource({
+ thunkArgs,
+ cx,
+ shouldDisable: false,
+ source,
+ ranges,
+ });
+ }
+ }
+ };
+}
+
+async function toggleBreakpointsInRangesForBlackboxedSource({
+ thunkArgs,
+ cx,
+ shouldDisable,
+ source,
+ ranges,
+}) {
+ const { dispatch, getState } = thunkArgs;
+ for (const range of ranges) {
+ const breakpoints = getBreakpointsForSource(getState(), source.id, range);
+ await dispatch(toggleBreakpoints(cx, shouldDisable, breakpoints));
+ }
+}
+
+async function toggleBreakpointsInBlackboxedSources({
+ thunkArgs,
+ cx,
+ shouldDisable,
+ sources,
+}) {
+ const { dispatch, getState } = thunkArgs;
+ for (const source of sources) {
+ const breakpoints = getBreakpointsForSource(getState(), source.id);
+ await dispatch(toggleBreakpoints(cx, shouldDisable, breakpoints));
+ }
+}
+
+/*
+ * Blackboxes a group of sources together
+ *
+ * @param {Object} cx
+ * @param {Array} sourcesToBlackBox - The list of sources to blackbox
+ * @param {Boolean} shouldBlackbox - Specifies if the sources should blackboxed (true)
+ * or unblackboxed (false).
+ */
+export function blackBoxSources(cx, sourcesToBlackBox, shouldBlackBox) {
+ return async thunkArgs => {
+ const { dispatch, getState } = thunkArgs;
+
+ const sources = sourcesToBlackBox.filter(
+ source => isSourceBlackBoxed(getState(), source) !== shouldBlackBox
+ );
+
+ if (!sources.length) {
+ return;
+ }
+
+ for (const source of sources) {
+ await blackboxSourceActorsForSource(thunkArgs, source, shouldBlackBox);
+ }
+
+ if (shouldBlackBox) {
+ recordEvent("blackbox");
+ }
+
+ dispatch({
+ type: shouldBlackBox
+ ? "BLACKBOX_WHOLE_SOURCES"
+ : "UNBLACKBOX_WHOLE_SOURCES",
+ sources,
+ });
+ await toggleBreakpointsInBlackboxedSources({
+ thunkArgs,
+ cx,
+ shouldDisable: shouldBlackBox,
+ sources,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/breakableLines.js b/devtools/client/debugger/src/actions/sources/breakableLines.js
new file mode 100644
index 0000000000..d028d480c0
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/breakableLines.js
@@ -0,0 +1,73 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { isOriginalId } from "devtools/client/shared/source-map-loader/index";
+import {
+ getBreakableLines,
+ getSourceActorBreakableLines,
+} from "../../selectors";
+import { setBreakpointPositions } from "../breakpoints/breakpointPositions";
+
+function calculateBreakableLines(positions) {
+ const lines = [];
+ for (const line in positions) {
+ if (positions[line].length) {
+ lines.push(Number(line));
+ }
+ }
+
+ return lines;
+}
+
+/**
+ * Ensure that breakable lines for a given source are fetched.
+ *
+ * @param Object cx
+ * @param Object location
+ */
+export function setBreakableLines(cx, location) {
+ return async ({ getState, dispatch, client }) => {
+ let breakableLines;
+ if (isOriginalId(location.source.id)) {
+ const positions = await dispatch(
+ setBreakpointPositions({ cx, location })
+ );
+ breakableLines = calculateBreakableLines(positions);
+
+ const existingBreakableLines = getBreakableLines(
+ getState(),
+ location.source.id
+ );
+ if (existingBreakableLines) {
+ breakableLines = [
+ ...new Set([...existingBreakableLines, ...breakableLines]),
+ ];
+ }
+
+ dispatch({
+ type: "SET_ORIGINAL_BREAKABLE_LINES",
+ cx,
+ sourceId: location.source.id,
+ breakableLines,
+ });
+ } else {
+ // Ignore re-fetching the breakable lines for source actor we already fetched
+ breakableLines = getSourceActorBreakableLines(
+ getState(),
+ location.sourceActor.id
+ );
+ if (breakableLines) {
+ return;
+ }
+ breakableLines = await client.getSourceActorBreakableLines(
+ location.sourceActor
+ );
+ dispatch({
+ type: "SET_SOURCE_ACTOR_BREAKABLE_LINES",
+ sourceActorId: location.sourceActor.id,
+ breakableLines,
+ });
+ }
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/index.js b/devtools/client/debugger/src/actions/sources/index.js
new file mode 100644
index 0000000000..813f50262b
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/index.js
@@ -0,0 +1,42 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export * from "./blackbox";
+export * from "./breakableLines";
+export * from "./loadSourceText";
+export * from "./newSources";
+export * from "./prettyPrint";
+export * from "./select";
+export { setSymbols } from "./symbols";
+
+export function setOverrideSource(cx, source, path) {
+ return ({ client, dispatch }) => {
+ if (!source || !source.url) {
+ return;
+ }
+ const { url } = source;
+ client.setOverride(url, path);
+ dispatch({
+ type: "SET_OVERRIDE",
+ cx,
+ url,
+ path,
+ });
+ };
+}
+
+export function removeOverrideSource(cx, source) {
+ return ({ client, dispatch }) => {
+ if (!source || !source.url) {
+ return;
+ }
+ const { url } = source;
+ client.removeOverride(url);
+ dispatch({
+ type: "REMOVE_OVERRIDE",
+ cx,
+ url,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/loadSourceText.js b/devtools/client/debugger/src/actions/sources/loadSourceText.js
new file mode 100644
index 0000000000..8210b07a97
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/loadSourceText.js
@@ -0,0 +1,256 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { PROMISE } from "../utils/middleware/promise";
+import {
+ getSourceTextContent,
+ getSettledSourceTextContent,
+ getGeneratedSource,
+ getSourcesEpoch,
+ getBreakpointsForSource,
+ getSourceActorsForSource,
+ getFirstSourceActorForGeneratedSource,
+} from "../../selectors";
+import { addBreakpoint } from "../breakpoints";
+
+import { prettyPrintSource } from "./prettyPrint";
+import { isFulfilled, fulfilled } from "../../utils/async-value";
+
+import { isPretty } from "../../utils/source";
+import { createLocation } from "../../utils/location";
+import { memoizeableAction } from "../../utils/memoizableAction";
+
+async function loadGeneratedSource(sourceActor, { client }) {
+ // If no source actor can be found then the text for the
+ // source cannot be loaded.
+ if (!sourceActor) {
+ throw new Error("Source actor is null or not defined");
+ }
+
+ let response;
+ try {
+ response = await client.sourceContents(sourceActor);
+ } catch (e) {
+ throw new Error(`sourceContents failed: ${e}`);
+ }
+
+ return {
+ text: response.source,
+ contentType: response.contentType || "text/javascript",
+ };
+}
+
+async function loadOriginalSource(
+ source,
+ { getState, client, sourceMapLoader, prettyPrintWorker }
+) {
+ if (isPretty(source)) {
+ const generatedSource = getGeneratedSource(getState(), source);
+ if (!generatedSource) {
+ throw new Error("Unable to find minified original.");
+ }
+
+ const content = getSettledSourceTextContent(
+ getState(),
+ createLocation({
+ source: generatedSource,
+ })
+ );
+
+ return prettyPrintSource(
+ sourceMapLoader,
+ prettyPrintWorker,
+ generatedSource,
+ content,
+ getSourceActorsForSource(getState(), generatedSource.id)
+ );
+ }
+
+ const result = await sourceMapLoader.getOriginalSourceText(source.id);
+ if (!result) {
+ // The way we currently try to load and select a pending
+ // selected location, it is possible that we will try to fetch the
+ // original source text right after the source map has been cleared
+ // after a navigation event.
+ throw new Error("Original source text unavailable");
+ }
+ return result;
+}
+
+async function loadGeneratedSourceTextPromise(cx, sourceActor, thunkArgs) {
+ const { dispatch, getState } = thunkArgs;
+ const epoch = getSourcesEpoch(getState());
+
+ await dispatch({
+ type: "LOAD_GENERATED_SOURCE_TEXT",
+ sourceActorId: sourceActor.actor,
+ epoch,
+ [PROMISE]: loadGeneratedSource(sourceActor, thunkArgs),
+ });
+
+ await onSourceTextContentAvailable(
+ cx,
+ sourceActor.sourceObject,
+ sourceActor,
+ thunkArgs
+ );
+}
+
+async function loadOriginalSourceTextPromise(cx, source, thunkArgs) {
+ const { dispatch, getState } = thunkArgs;
+ const epoch = getSourcesEpoch(getState());
+ await dispatch({
+ type: "LOAD_ORIGINAL_SOURCE_TEXT",
+ sourceId: source.id,
+ epoch,
+ [PROMISE]: loadOriginalSource(source, thunkArgs),
+ });
+
+ await onSourceTextContentAvailable(cx, source, null, thunkArgs);
+}
+
+/**
+ * Function called everytime a new original or generated source gets its text content
+ * fetched from the server and registered in the reducer.
+ *
+ * @param {Object} cx
+ * @param {Object} source
+ * @param {Object} sourceActor (optional)
+ * If this is a generated source, we expect a precise source actor.
+ * @param {Object} thunkArgs
+ */
+async function onSourceTextContentAvailable(
+ cx,
+ source,
+ sourceActor,
+ { dispatch, getState, parserWorker }
+) {
+ const location = createLocation({
+ source,
+ sourceActor,
+ });
+ const content = getSettledSourceTextContent(getState(), location);
+ if (!content) {
+ return;
+ }
+
+ if (parserWorker.isLocationSupported(location)) {
+ parserWorker.setSource(
+ source.id,
+ isFulfilled(content)
+ ? content.value
+ : { type: "text", value: "", contentType: undefined }
+ );
+ }
+
+ // Update the text in any breakpoints for this source by re-adding them.
+ const breakpoints = getBreakpointsForSource(getState(), source.id);
+ for (const breakpoint of breakpoints) {
+ await dispatch(
+ addBreakpoint(
+ cx,
+ breakpoint.location,
+ breakpoint.options,
+ breakpoint.disabled
+ )
+ );
+ }
+}
+
+/**
+ * Loads the source text for the generated source based of the source actor
+ * @param {Object} sourceActor
+ * There can be more than one source actor per source
+ * so the source actor needs to be specified. This is
+ * required for generated sources but will be null for
+ * original/pretty printed sources.
+ */
+export const loadGeneratedSourceText = memoizeableAction(
+ "loadGeneratedSourceText",
+ {
+ getValue: ({ sourceActor }, { getState }) => {
+ if (!sourceActor) {
+ return null;
+ }
+
+ const sourceTextContent = getSourceTextContent(
+ getState(),
+ createLocation({
+ source: sourceActor.sourceObject,
+ sourceActor,
+ })
+ );
+
+ if (!sourceTextContent || sourceTextContent.state === "pending") {
+ return sourceTextContent;
+ }
+
+ // This currently swallows source-load-failure since we return fulfilled
+ // here when content.state === "rejected". In an ideal world we should
+ // propagate that error upward.
+ return fulfilled(sourceTextContent);
+ },
+ createKey: ({ sourceActor }, { getState }) => {
+ const epoch = getSourcesEpoch(getState());
+ return `${epoch}:${sourceActor.actor}`;
+ },
+ action: ({ cx, sourceActor }, thunkArgs) =>
+ loadGeneratedSourceTextPromise(cx, sourceActor, thunkArgs),
+ }
+);
+
+/**
+ * Loads the source text for an original source and source actor
+ * @param {Object} source
+ * The original source to load the source text
+ */
+export const loadOriginalSourceText = memoizeableAction(
+ "loadOriginalSourceText",
+ {
+ getValue: ({ source }, { getState }) => {
+ if (!source) {
+ return null;
+ }
+
+ const sourceTextContent = getSourceTextContent(
+ getState(),
+ createLocation({
+ source,
+ })
+ );
+ if (!sourceTextContent || sourceTextContent.state === "pending") {
+ return sourceTextContent;
+ }
+
+ // This currently swallows source-load-failure since we return fulfilled
+ // here when content.state === "rejected". In an ideal world we should
+ // propagate that error upward.
+ return fulfilled(sourceTextContent);
+ },
+ createKey: ({ source }, { getState }) => {
+ const epoch = getSourcesEpoch(getState());
+ return `${epoch}:${source.id}`;
+ },
+ action: ({ cx, source }, thunkArgs) =>
+ loadOriginalSourceTextPromise(cx, source, thunkArgs),
+ }
+);
+
+export function loadSourceText(cx, source, sourceActor) {
+ return async ({ dispatch, getState }) => {
+ if (!source) {
+ return null;
+ }
+ if (source.isOriginal) {
+ return dispatch(loadOriginalSourceText({ cx, source }));
+ }
+ if (!sourceActor) {
+ sourceActor = getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ }
+ return dispatch(loadGeneratedSourceText({ cx, sourceActor }));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/moz.build b/devtools/client/debugger/src/actions/sources/moz.build
new file mode 100644
index 0000000000..9972e9f09b
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/moz.build
@@ -0,0 +1,17 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "blackbox.js",
+ "breakableLines.js",
+ "index.js",
+ "loadSourceText.js",
+ "newSources.js",
+ "prettyPrint.js",
+ "select.js",
+ "symbols.js",
+)
diff --git a/devtools/client/debugger/src/actions/sources/newSources.js b/devtools/client/debugger/src/actions/sources/newSources.js
new file mode 100644
index 0000000000..1e95c6d79d
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/newSources.js
@@ -0,0 +1,367 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for the sources state
+ * @module actions/sources
+ */
+import { PROMISE } from "../utils/middleware/promise";
+import { insertSourceActors } from "../../actions/source-actors";
+import {
+ makeSourceId,
+ createGeneratedSource,
+ createSourceMapOriginalSource,
+ createSourceActor,
+} from "../../client/firefox/create";
+import { toggleBlackBox } from "./blackbox";
+import { syncPendingBreakpoint } from "../breakpoints";
+import { loadSourceText } from "./loadSourceText";
+import { togglePrettyPrint } from "./prettyPrint";
+import { toggleSourceMapIgnoreList } from "../ui";
+import { selectLocation, setBreakableLines } from "../sources";
+
+import { getRawSourceURL, isPrettyURL } from "../../utils/source";
+import { createLocation } from "../../utils/location";
+import {
+ getBlackBoxRanges,
+ getSource,
+ getSourceFromId,
+ hasSourceActor,
+ getSourceByActorId,
+ getPendingSelectedLocation,
+ getPendingBreakpointsForSource,
+ getContext,
+} from "../../selectors";
+
+import { prefs } from "../../utils/prefs";
+import sourceQueue from "../../utils/source-queue";
+import { validateNavigateContext, ContextError } from "../../utils/context";
+
+function loadSourceMaps(cx, sources) {
+ return async function ({ dispatch }) {
+ try {
+ const sourceList = await Promise.all(
+ sources.map(async sourceActor => {
+ const originalSourcesInfo = await dispatch(
+ loadSourceMap(cx, sourceActor)
+ );
+ originalSourcesInfo.forEach(
+ sourcesInfo => (sourcesInfo.sourceActor = sourceActor)
+ );
+ sourceQueue.queueOriginalSources(originalSourcesInfo);
+ return originalSourcesInfo;
+ })
+ );
+
+ await sourceQueue.flush();
+ return sourceList.flat();
+ } catch (error) {
+ if (!(error instanceof ContextError)) {
+ throw error;
+ }
+ }
+ return [];
+ };
+}
+
+/**
+ * @memberof actions/sources
+ * @static
+ */
+function loadSourceMap(cx, sourceActor) {
+ return async function ({ dispatch, getState, sourceMapLoader }) {
+ if (!prefs.clientSourceMapsEnabled || !sourceActor.sourceMapURL) {
+ return [];
+ }
+
+ let data = null;
+ try {
+ // Ignore sourceMapURL on scripts that are part of HTML files, since
+ // we currently treat sourcemaps as Source-wide, not SourceActor-specific.
+ const source = getSourceByActorId(getState(), sourceActor.id);
+ if (source) {
+ data = await sourceMapLoader.getOriginalURLs({
+ // Using source ID here is historical and eventually we'll want to
+ // switch to all of this being per-source-actor.
+ id: source.id,
+ url: sourceActor.url || "",
+ sourceMapBaseURL: sourceActor.sourceMapBaseURL || "",
+ sourceMapURL: sourceActor.sourceMapURL || "",
+ isWasm: sourceActor.introductionType === "wasm",
+ });
+ dispatch({
+ type: "ADD_SOURCEMAP_IGNORE_LIST_SOURCES",
+ [PROMISE]: sourceMapLoader.getSourceMapIgnoreList(source.id),
+ });
+ }
+ } catch (e) {
+ console.error(e);
+ }
+
+ if (!data || !data.length) {
+ // If this source doesn't have a sourcemap or there are no original files
+ // existing, enable it for pretty printing
+ dispatch({
+ type: "CLEAR_SOURCE_ACTOR_MAP_URL",
+ cx,
+ sourceActorId: sourceActor.id,
+ });
+ return [];
+ }
+
+ validateNavigateContext(getState(), cx);
+ return data;
+ };
+}
+
+// If a request has been made to show this source, go ahead and
+// select it.
+function checkSelectedSource(cx, sourceId) {
+ return async ({ dispatch, getState }) => {
+ const state = getState();
+ const pendingLocation = getPendingSelectedLocation(state);
+
+ if (!pendingLocation || !pendingLocation.url) {
+ return;
+ }
+
+ const source = getSource(state, sourceId);
+
+ if (!source || !source.url) {
+ return;
+ }
+
+ const pendingUrl = pendingLocation.url;
+ const rawPendingUrl = getRawSourceURL(pendingUrl);
+
+ if (rawPendingUrl === source.url) {
+ if (isPrettyURL(pendingUrl)) {
+ const prettySource = await dispatch(togglePrettyPrint(cx, source.id));
+ dispatch(checkPendingBreakpoints(cx, prettySource, null));
+ return;
+ }
+
+ await dispatch(
+ selectLocation(
+ cx,
+ createLocation({
+ source,
+ line:
+ typeof pendingLocation.line === "number"
+ ? pendingLocation.line
+ : 0,
+ column: pendingLocation.column,
+ })
+ )
+ );
+ }
+ };
+}
+
+function checkPendingBreakpoints(cx, source, sourceActor) {
+ return async ({ dispatch, getState }) => {
+ const pendingBreakpoints = getPendingBreakpointsForSource(
+ getState(),
+ source
+ );
+
+ if (pendingBreakpoints.length === 0) {
+ return;
+ }
+
+ // load the source text if there is a pending breakpoint for it
+ await dispatch(loadSourceText(cx, source, sourceActor));
+ await dispatch(
+ setBreakableLines(cx, createLocation({ source, sourceActor }))
+ );
+
+ await Promise.all(
+ pendingBreakpoints.map(pendingBp => {
+ return dispatch(syncPendingBreakpoint(cx, source.id, pendingBp));
+ })
+ );
+ };
+}
+
+function restoreBlackBoxedSources(cx, sources) {
+ return async ({ dispatch, getState }) => {
+ const currentRanges = getBlackBoxRanges(getState());
+
+ if (!Object.keys(currentRanges).length) {
+ return;
+ }
+
+ for (const source of sources) {
+ const ranges = currentRanges[source.url];
+ if (ranges) {
+ // If the ranges is an empty then the whole source was blackboxed.
+ await dispatch(toggleBlackBox(cx, source, true, ranges));
+ }
+ }
+
+ if (prefs.sourceMapIgnoreListEnabled) {
+ await dispatch(toggleSourceMapIgnoreList(cx, true));
+ }
+ };
+}
+
+export function newOriginalSources(originalSourcesInfo) {
+ return async ({ dispatch, getState }) => {
+ const state = getState();
+ const seen = new Set();
+
+ const actors = [];
+ const actorsSources = {};
+
+ for (const { id, url, sourceActor } of originalSourcesInfo) {
+ if (seen.has(id) || getSource(state, id)) {
+ continue;
+ }
+ seen.add(id);
+
+ if (!actorsSources[sourceActor.actor]) {
+ actors.push(sourceActor);
+ actorsSources[sourceActor.actor] = [];
+ }
+
+ actorsSources[sourceActor.actor].push(
+ createSourceMapOriginalSource(id, url)
+ );
+ }
+
+ const cx = getContext(state);
+
+ // Add the original sources per the generated source actors that
+ // they are primarily from.
+ actors.forEach(sourceActor => {
+ dispatch({
+ type: "ADD_ORIGINAL_SOURCES",
+ cx,
+ originalSources: actorsSources[sourceActor.actor],
+ generatedSourceActor: sourceActor,
+ });
+ });
+
+ // Accumulate the sources back into one list
+ const actorsSourcesValues = Object.values(actorsSources);
+ let sources = [];
+ if (actorsSourcesValues.length) {
+ sources = actorsSourcesValues.reduce((acc, sourceList) =>
+ acc.concat(sourceList)
+ );
+ }
+
+ await dispatch(checkNewSources(cx, sources));
+
+ for (const source of sources) {
+ dispatch(checkPendingBreakpoints(cx, source, null));
+ }
+
+ return sources;
+ };
+}
+
+// Wrapper around newGeneratedSources, only used by tests
+export function newGeneratedSource(sourceInfo) {
+ return async ({ dispatch }) => {
+ const sources = await dispatch(newGeneratedSources([sourceInfo]));
+ return sources[0];
+ };
+}
+
+export function newGeneratedSources(sourceResources) {
+ return async ({ dispatch, getState, client }) => {
+ if (!sourceResources.length) {
+ return [];
+ }
+
+ const resultIds = [];
+ const newSourcesObj = {};
+ const newSourceActors = [];
+
+ for (const sourceResource of sourceResources) {
+ // By the time we process the sources, the related target
+ // might already have been destroyed. It means that the sources
+ // are also about to be destroyed, so ignore them.
+ // (This is covered by browser_toolbox_backward_forward_navigation.js)
+ if (sourceResource.targetFront.isDestroyed()) {
+ continue;
+ }
+ const id = makeSourceId(sourceResource);
+
+ if (!getSource(getState(), id) && !newSourcesObj[id]) {
+ newSourcesObj[id] = createGeneratedSource(sourceResource);
+ }
+
+ const actorId = sourceResource.actor;
+
+ // We are sometimes notified about a new source multiple times if we
+ // request a new source list and also get a source event from the server.
+ if (!hasSourceActor(getState(), actorId)) {
+ newSourceActors.push(
+ createSourceActor(
+ sourceResource,
+ getSource(getState(), id) || newSourcesObj[id]
+ )
+ );
+ }
+
+ resultIds.push(id);
+ }
+
+ const newSources = Object.values(newSourcesObj);
+
+ const cx = getContext(getState());
+ dispatch(addSources(cx, newSources));
+ dispatch(insertSourceActors(newSourceActors));
+
+ await dispatch(checkNewSources(cx, newSources));
+
+ (async () => {
+ await dispatch(loadSourceMaps(cx, newSourceActors));
+
+ // We would like to sync breakpoints after we are done
+ // loading source maps as sometimes generated and original
+ // files share the same paths.
+ for (const sourceActor of newSourceActors) {
+ // For HTML pages, we fetch all new incoming inline script,
+ // which will be related to one dedicated source actor.
+ // Whereas, for regular sources, if we have many source actors,
+ // this is for the same URL. And code expecting to have breakable lines
+ // will request breakable lines for that particular source actor.
+ if (sourceActor.sourceObject.isHTML) {
+ await dispatch(
+ setBreakableLines(
+ cx,
+ createLocation({ source: sourceActor.sourceObject, sourceActor })
+ )
+ );
+ }
+ dispatch(
+ checkPendingBreakpoints(cx, sourceActor.sourceObject, sourceActor)
+ );
+ }
+ })();
+
+ return resultIds.map(id => getSourceFromId(getState(), id));
+ };
+}
+
+function addSources(cx, sources) {
+ return ({ dispatch, getState }) => {
+ dispatch({ type: "ADD_SOURCES", cx, sources });
+ };
+}
+
+function checkNewSources(cx, sources) {
+ return async ({ dispatch, getState }) => {
+ for (const source of sources) {
+ dispatch(checkSelectedSource(cx, source.id));
+ }
+
+ await dispatch(restoreBlackBoxedSources(cx, sources));
+
+ return sources;
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/prettyPrint.js b/devtools/client/debugger/src/actions/sources/prettyPrint.js
new file mode 100644
index 0000000000..66e3f4129b
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/prettyPrint.js
@@ -0,0 +1,339 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ generatedToOriginalId,
+ originalToGeneratedId,
+} from "devtools/client/shared/source-map-loader/index";
+
+import assert from "../../utils/assert";
+import { recordEvent } from "../../utils/telemetry";
+import { updateBreakpointsForNewPrettyPrintedSource } from "../breakpoints";
+import { createLocation } from "../../utils/location";
+
+import {
+ getPrettySourceURL,
+ isGenerated,
+ isJavaScript,
+} from "../../utils/source";
+import { isFulfilled } from "../../utils/async-value";
+import { getOriginalLocation } from "../../utils/source-maps";
+import { prefs } from "../../utils/prefs";
+import {
+ loadGeneratedSourceText,
+ loadOriginalSourceText,
+} from "./loadSourceText";
+import { mapFrames } from "../pause";
+import { selectSpecificLocation } from "../sources";
+import { createPrettyPrintOriginalSource } from "../../client/firefox/create";
+
+import {
+ getSource,
+ getFirstSourceActorForGeneratedSource,
+ getSourceByURL,
+ getSelectedLocation,
+ getThreadContext,
+} from "../../selectors";
+
+import { selectSource } from "./select";
+
+import DevToolsUtils from "devtools/shared/DevToolsUtils";
+
+const LINE_BREAK_REGEX = /\r\n?|\n|\u2028|\u2029/g;
+function matchAllLineBreaks(str) {
+ return Array.from(str.matchAll(LINE_BREAK_REGEX));
+}
+
+function getPrettyOriginalSourceURL(generatedSource) {
+ return getPrettySourceURL(generatedSource.url || generatedSource.id);
+}
+
+export async function prettyPrintSource(
+ sourceMapLoader,
+ prettyPrintWorker,
+ generatedSource,
+ content,
+ actors
+) {
+ if (!content || !isFulfilled(content)) {
+ throw new Error("Cannot pretty-print a file that has not loaded");
+ }
+
+ const contentValue = content.value;
+ if (
+ (!isJavaScript(generatedSource, contentValue) && !generatedSource.isHTML) ||
+ contentValue.type !== "text"
+ ) {
+ throw new Error(
+ `Can't prettify ${contentValue.contentType} files, only HTML and Javascript.`
+ );
+ }
+
+ const url = getPrettyOriginalSourceURL(generatedSource);
+
+ let prettyPrintWorkerResult;
+ if (generatedSource.isHTML) {
+ prettyPrintWorkerResult = await prettyPrintHtmlFile({
+ prettyPrintWorker,
+ generatedSource,
+ content,
+ actors,
+ });
+ } else {
+ prettyPrintWorkerResult = await prettyPrintWorker.prettyPrint({
+ sourceText: contentValue.value,
+ indent: " ".repeat(prefs.indentSize),
+ url,
+ });
+ }
+
+ // The source map URL service used by other devtools listens to changes to
+ // sources based on their actor IDs, so apply the sourceMap there too.
+ const generatedSourceIds = [
+ generatedSource.id,
+ ...actors.map(item => item.actor),
+ ];
+ await sourceMapLoader.setSourceMapForGeneratedSources(
+ generatedSourceIds,
+ prettyPrintWorkerResult.sourceMap
+ );
+
+ return {
+ text: prettyPrintWorkerResult.code,
+ contentType: contentValue.contentType,
+ };
+}
+
+/**
+ * Pretty print inline script inside an HTML file
+ *
+ * @param {Object} options
+ * @param {PrettyPrintDispatcher} options.prettyPrintWorker: The prettyPrint worker
+ * @param {Object} options.generatedSource: The HTML source we want to pretty print
+ * @param {Object} options.content
+ * @param {Array} options.actors: An array of the HTML file inline script sources data
+ *
+ * @returns Promise<Object> A promise that resolves with an object of the following shape:
+ * - {String} code: The prettified HTML text
+ * - {Object} sourceMap: The sourceMap object
+ */
+async function prettyPrintHtmlFile({
+ prettyPrintWorker,
+ generatedSource,
+ content,
+ actors,
+}) {
+ const url = getPrettyOriginalSourceURL(generatedSource);
+ const contentValue = content.value;
+ const htmlFileText = contentValue.value;
+ const prettyPrintWorkerResult = { code: htmlFileText };
+
+ const allLineBreaks = matchAllLineBreaks(htmlFileText);
+ let lineCountDelta = 0;
+
+ // Sort inline script actors so they are in the same order as in the html document.
+ actors.sort((a, b) => {
+ if (a.sourceStartLine === b.sourceStartLine) {
+ return a.sourceStartColumn > b.sourceStartColumn;
+ }
+ return a.sourceStartLine > b.sourceStartLine;
+ });
+
+ const prettyPrintTaskId = generatedSource.id;
+
+ // We don't want to replace part of the HTML document in the loop since it would require
+ // to account for modified lines for each iteration.
+ // Instead, we'll put each sections to replace in this array, where elements will be
+ // objects of the following shape:
+ // {Integer} startIndex: The start index in htmlFileText of the section we want to replace
+ // {Integer} endIndex: The end index in htmlFileText of the section we want to replace
+ // {String} prettyText: The pretty text we'll replace the original section with
+ // Once we iterated over all the inline scripts, we'll do the replacements (on the html
+ // file text) in reverse order, so we don't need have to care about the modified lines
+ // for each iteration.
+ const replacements = [];
+
+ const seenLocations = new Set();
+
+ for (const sourceInfo of actors) {
+ // We can get duplicate source actors representing the same inline script which will
+ // cause trouble in the pretty printing here. This should be fixed on the server (see
+ // Bug 1824979), but in the meantime let's not handle the same location twice so the
+ // pretty printing is not impacted.
+ const location = `${sourceInfo.sourceStartLine}:${sourceInfo.sourceStartColumn}`;
+ if (!sourceInfo.sourceLength || seenLocations.has(location)) {
+ continue;
+ }
+ seenLocations.add(location);
+ // Here we want to get the index of the last line break before the script tag.
+ // In allLineBreaks, this would be the item at (script tag line - 1)
+ // Since sourceInfo.sourceStartLine is 1-based, we need to get the item at (sourceStartLine - 2)
+ const indexAfterPreviousLineBreakInHtml =
+ sourceInfo.sourceStartLine > 1
+ ? allLineBreaks[sourceInfo.sourceStartLine - 2].index + 1
+ : 0;
+ const startIndex =
+ indexAfterPreviousLineBreakInHtml + sourceInfo.sourceStartColumn;
+ const endIndex = startIndex + sourceInfo.sourceLength;
+ const scriptText = htmlFileText.substring(startIndex, endIndex);
+ DevToolsUtils.assert(
+ scriptText.length == sourceInfo.sourceLength,
+ "script text has expected length"
+ );
+
+ // Here we're going to pretty print each inline script content.
+ // Since we want to have a sourceMap that we'll apply to the whole HTML file,
+ // we'll only collect the sourceMap once we handled all inline scripts.
+ // `taskId` allows us to signal to the worker that all those calls are part of the
+ // same bigger file, and we'll use it later to get the sourceMap.
+ const prettyText = await prettyPrintWorker.prettyPrintInlineScript({
+ taskId: prettyPrintTaskId,
+ sourceText: scriptText,
+ indent: " ".repeat(prefs.indentSize),
+ url,
+ originalStartLine: sourceInfo.sourceStartLine,
+ originalStartColumn: sourceInfo.sourceStartColumn,
+ // The generated line will be impacted by the previous inline scripts that were
+ // pretty printed, which is why we offset with lineCountDelta
+ generatedStartLine: sourceInfo.sourceStartLine + lineCountDelta,
+ generatedStartColumn: sourceInfo.sourceStartColumn,
+ lineCountDelta,
+ });
+
+ // We need to keep track of the line added/removed in order to properly offset
+ // the mapping of the pretty-print text
+ lineCountDelta +=
+ matchAllLineBreaks(prettyText).length -
+ matchAllLineBreaks(scriptText).length;
+
+ replacements.push({
+ startIndex,
+ endIndex,
+ prettyText,
+ });
+ }
+
+ // `getSourceMap` allow us to collect the computed source map resulting of the calls
+ // to `prettyPrint` with the same taskId.
+ prettyPrintWorkerResult.sourceMap = await prettyPrintWorker.getSourceMap(
+ prettyPrintTaskId
+ );
+
+ // Sort replacement in reverse order so we can replace code in the HTML file more easily
+ replacements.sort((a, b) => a.startIndex < b.startIndex);
+ for (const { startIndex, endIndex, prettyText } of replacements) {
+ prettyPrintWorkerResult.code =
+ prettyPrintWorkerResult.code.substring(0, startIndex) +
+ prettyText +
+ prettyPrintWorkerResult.code.substring(endIndex);
+ }
+
+ return prettyPrintWorkerResult;
+}
+
+function createPrettySource(cx, source) {
+ return async ({ dispatch, sourceMapLoader, getState }) => {
+ const url = getPrettyOriginalSourceURL(source);
+ const id = generatedToOriginalId(source.id, url);
+ const prettySource = createPrettyPrintOriginalSource(id, url);
+
+ dispatch({
+ type: "ADD_ORIGINAL_SOURCES",
+ cx,
+ originalSources: [prettySource],
+ });
+ return prettySource;
+ };
+}
+
+function selectPrettyLocation(cx, prettySource) {
+ return async thunkArgs => {
+ const { dispatch, getState } = thunkArgs;
+ let location = getSelectedLocation(getState());
+
+ // If we were selecting a particular line in the minified/generated source,
+ // try to select the matching line in the prettified/original source.
+ if (
+ location &&
+ location.line >= 1 &&
+ location.sourceId == originalToGeneratedId(prettySource.id)
+ ) {
+ location = await getOriginalLocation(location, thunkArgs);
+
+ return dispatch(
+ selectSpecificLocation(
+ cx,
+ createLocation({ ...location, source: prettySource })
+ )
+ );
+ }
+
+ return dispatch(selectSource(cx, prettySource));
+ };
+}
+
+/**
+ * Toggle the pretty printing of a source's text.
+ * Nothing will happen for non-javascript files.
+ *
+ * @param Object cx
+ * @param String sourceId
+ * The source ID for the minified/generated source object.
+ * @returns Promise
+ * A promise that resolves to the Pretty print/original source object.
+ */
+export function togglePrettyPrint(cx, sourceId) {
+ return async ({ dispatch, getState }) => {
+ const source = getSource(getState(), sourceId);
+ if (!source) {
+ return {};
+ }
+
+ if (!source.isPrettyPrinted) {
+ recordEvent("pretty_print");
+ }
+
+ assert(
+ isGenerated(source),
+ "Pretty-printing only allowed on generated sources"
+ );
+
+ const sourceActor = getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ await dispatch(loadGeneratedSourceText({ cx, sourceActor }));
+
+ const url = getPrettySourceURL(source.url);
+ const prettySource = getSourceByURL(getState(), url);
+
+ if (prettySource) {
+ return dispatch(selectPrettyLocation(cx, prettySource));
+ }
+
+ const newPrettySource = await dispatch(createPrettySource(cx, source));
+
+ // Force loading the pretty source/original text.
+ // This will end up calling prettyPrintSource() of this module, and
+ // more importantly, will populate the sourceMapLoader, which is used by selectPrettyLocation.
+ await dispatch(loadOriginalSourceText({ cx, source: newPrettySource }));
+ // Select the pretty/original source based on the location we may
+ // have had against the minified/generated source.
+ // This uses source map to map locations.
+ // Also note that selecting a location force many things:
+ // * opening tabs
+ // * fetching symbols/inline scope
+ // * fetching breakable lines
+ await dispatch(selectPrettyLocation(cx, newPrettySource));
+
+ const threadcx = getThreadContext(getState());
+ // Update frames to the new pretty/original source (in case we were paused)
+ await dispatch(mapFrames(threadcx));
+ // Update breakpoints locations to the new pretty/original source
+ await dispatch(updateBreakpointsForNewPrettyPrintedSource(cx, sourceId));
+
+ return newPrettySource;
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/select.js b/devtools/client/debugger/src/actions/sources/select.js
new file mode 100644
index 0000000000..c4443432a0
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/select.js
@@ -0,0 +1,264 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for the sources state
+ * @module actions/sources
+ */
+
+import { isOriginalId } from "devtools/client/shared/source-map-loader/index";
+
+import { setSymbols } from "./symbols";
+import { setInScopeLines } from "../ast";
+import { togglePrettyPrint } from "./prettyPrint";
+import { addTab, closeTab } from "../tabs";
+import { loadSourceText } from "./loadSourceText";
+import { mapDisplayNames } from "../pause";
+import { setBreakableLines } from ".";
+
+import { prefs } from "../../utils/prefs";
+import { isMinified } from "../../utils/source";
+import { createLocation } from "../../utils/location";
+import { getRelatedMapLocation } from "../../utils/source-maps";
+
+import {
+ getSource,
+ getFirstSourceActorForGeneratedSource,
+ getSourceByURL,
+ getPrettySource,
+ getSelectedLocation,
+ getShouldSelectOriginalLocation,
+ canPrettyPrintSource,
+ getIsCurrentThreadPaused,
+ getSourceTextContent,
+ tabExists,
+} from "../../selectors";
+
+// This is only used by jest tests (and within this module)
+export const setSelectedLocation = (
+ cx,
+ location,
+ shouldSelectOriginalLocation
+) => ({
+ type: "SET_SELECTED_LOCATION",
+ cx,
+ location,
+ shouldSelectOriginalLocation,
+});
+
+// This is only used by jest tests (and within this module)
+export const setPendingSelectedLocation = (cx, url, options) => ({
+ type: "SET_PENDING_SELECTED_LOCATION",
+ cx,
+ url,
+ line: options?.line,
+ column: options?.column,
+});
+
+// This is only used by jest tests (and within this module)
+export const clearSelectedLocation = cx => ({
+ type: "CLEAR_SELECTED_LOCATION",
+ cx,
+});
+
+/**
+ * Deterministically select a source that has a given URL. This will
+ * work regardless of the connection status or if the source exists
+ * yet.
+ *
+ * This exists mostly for external things to interact with the
+ * debugger.
+ */
+export function selectSourceURL(cx, url, options) {
+ return async ({ dispatch, getState }) => {
+ const source = getSourceByURL(getState(), url);
+ if (!source) {
+ return dispatch(setPendingSelectedLocation(cx, url, options));
+ }
+
+ const location = createLocation({ ...options, source });
+ return dispatch(selectLocation(cx, location));
+ };
+}
+
+/**
+ * Wrapper around selectLocation, which creates the location object for us.
+ * Note that it ignores the currently selected source and will select
+ * the precise generated/original source passed as argument.
+ *
+ * @param {Object} cx
+ * @param {String} source
+ * The precise source to select.
+ * @param {String} sourceActor
+ * The specific source actor of the source to
+ * select the source text. This is optional.
+ */
+export function selectSource(cx, source, sourceActor) {
+ return async ({ dispatch }) => {
+ // `createLocation` requires a source object, but we may use selectSource to close the last tab,
+ // where source will be null and the location will be an empty object.
+ const location = source ? createLocation({ source, sourceActor }) : {};
+
+ return dispatch(selectSpecificLocation(cx, location));
+ };
+}
+
+/**
+ * Select a new location.
+ * This will automatically select the source in the source tree (if visible)
+ * and open the source (a new tab and the source editor)
+ * as well as highlight a precise line in the editor.
+ *
+ * Note that by default, this may map your passed location to the original
+ * or generated location based on the selected source state. (see keepContext)
+ *
+ * @param {Object} cx
+ * @param {Object} location
+ * @param {Object} options
+ * @param {boolean} options.keepContext
+ * If false, this will ignore the currently selected source
+ * and select the generated or original location, even if we
+ * were currently selecting the other source type.
+ */
+export function selectLocation(cx, location, { keepContext = true } = {}) {
+ return async thunkArgs => {
+ const { dispatch, getState, client } = thunkArgs;
+
+ if (!client) {
+ // No connection, do nothing. This happens when the debugger is
+ // shut down too fast and it tries to display a default source.
+ return;
+ }
+
+ let source = location.source;
+
+ if (!source) {
+ // If there is no source we deselect the current selected source
+ dispatch(clearSelectedLocation(cx));
+ return;
+ }
+
+ // Preserve the current source map context (original / generated)
+ // when navigating to a new location.
+ // i.e. if keepContext isn't manually overriden to false,
+ // we will convert the source we want to select to either
+ // original/generated in order to match the currently selected one.
+ // If the currently selected source is original, we will
+ // automatically map `location` to refer to the original source,
+ // even if that used to refer only to the generated source.
+ let shouldSelectOriginalLocation = getShouldSelectOriginalLocation(
+ getState()
+ );
+ if (keepContext) {
+ if (shouldSelectOriginalLocation != isOriginalId(location.sourceId)) {
+ // getRelatedMapLocation will convert to the related generated/original location.
+ // i.e if the original location is passed, the related generated location will be returned and vice versa.
+ location = await getRelatedMapLocation(location, thunkArgs);
+ // Note that getRelatedMapLocation may return the exact same location.
+ // For example, if the source-map is half broken, it may return a generated location
+ // while we were selecting original locations. So we may be seeing bundles intermittently
+ // when stepping through broken source maps. And we will see original sources when stepping
+ // through functional original sources.
+
+ source = location.source;
+ }
+ } else {
+ shouldSelectOriginalLocation = isOriginalId(location.sourceId);
+ }
+
+ let sourceActor = location.sourceActor;
+ if (!sourceActor) {
+ sourceActor = getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ location = createLocation({ ...location, sourceActor });
+ }
+
+ if (!tabExists(getState(), source.id)) {
+ dispatch(addTab(source, sourceActor));
+ }
+
+ dispatch(setSelectedLocation(cx, location, shouldSelectOriginalLocation));
+
+ await dispatch(loadSourceText(cx, source, sourceActor));
+
+ await dispatch(setBreakableLines(cx, location));
+
+ const loadedSource = getSource(getState(), source.id);
+
+ if (!loadedSource) {
+ // If there was a navigation while we were loading the loadedSource
+ return;
+ }
+
+ const sourceTextContent = getSourceTextContent(getState(), location);
+
+ if (
+ keepContext &&
+ prefs.autoPrettyPrint &&
+ !getPrettySource(getState(), loadedSource.id) &&
+ canPrettyPrintSource(getState(), location) &&
+ isMinified(source, sourceTextContent)
+ ) {
+ await dispatch(togglePrettyPrint(cx, loadedSource.id));
+ dispatch(closeTab(cx, loadedSource));
+ }
+
+ await dispatch(setSymbols({ cx, location }));
+ dispatch(setInScopeLines(cx));
+
+ if (getIsCurrentThreadPaused(getState())) {
+ await dispatch(mapDisplayNames(cx));
+ }
+ };
+}
+
+/**
+ * Select a location while ignoring the currently selected source.
+ * This will select the generated location even if the currently
+ * select source is an original source. And the other way around.
+ *
+ * @param {Object} cx
+ * @param {Object} location
+ * The location to select, object which includes enough
+ * information to specify a precise source, line and column.
+ */
+export function selectSpecificLocation(cx, location) {
+ return selectLocation(cx, location, { keepContext: false });
+}
+
+/**
+ * Select the "mapped location".
+ *
+ * If the passed location is on a generated source, select the
+ * related location in the original source.
+ * If the passed location is on an original source, select the
+ * related location in the generated source.
+ */
+export function jumpToMappedLocation(cx, location) {
+ return async function (thunkArgs) {
+ const { client, dispatch } = thunkArgs;
+ if (!client) {
+ return null;
+ }
+
+ // Map to either an original or a generated source location
+ const pairedLocation = await getRelatedMapLocation(location, thunkArgs);
+
+ return dispatch(selectSpecificLocation(cx, pairedLocation));
+ };
+}
+
+// This is only used by tests
+export function jumpToMappedSelectedLocation(cx) {
+ return async function ({ dispatch, getState }) {
+ const location = getSelectedLocation(getState());
+ if (!location) {
+ return;
+ }
+
+ await dispatch(jumpToMappedLocation(cx, location));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/sources/symbols.js b/devtools/client/debugger/src/actions/sources/symbols.js
new file mode 100644
index 0000000000..5a1fb1f967
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/symbols.js
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { getSymbols } from "../../selectors";
+
+import { PROMISE } from "../utils/middleware/promise";
+import { loadSourceText } from "./loadSourceText";
+
+import { memoizeableAction } from "../../utils/memoizableAction";
+import { fulfilled } from "../../utils/async-value";
+
+async function doSetSymbols(
+ cx,
+ location,
+ { dispatch, getState, parserWorker }
+) {
+ await dispatch(loadSourceText(cx, location.source, location.sourceActor));
+
+ await dispatch({
+ type: "SET_SYMBOLS",
+ cx,
+ location,
+ [PROMISE]: parserWorker.getSymbols(location.sourceId),
+ });
+}
+
+export const setSymbols = memoizeableAction("setSymbols", {
+ getValue: ({ location }, { getState, parserWorker }) => {
+ if (!parserWorker.isLocationSupported(location)) {
+ return fulfilled(null);
+ }
+
+ const symbols = getSymbols(getState(), location);
+ if (!symbols) {
+ return null;
+ }
+
+ return fulfilled(symbols);
+ },
+ createKey: ({ location }) => location.sourceId,
+ action: ({ cx, location }, thunkArgs) =>
+ doSetSymbols(cx, location, thunkArgs),
+});
diff --git a/devtools/client/debugger/src/actions/sources/tests/blackbox.spec.js b/devtools/client/debugger/src/actions/sources/tests/blackbox.spec.js
new file mode 100644
index 0000000000..2ff8420b23
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/tests/blackbox.spec.js
@@ -0,0 +1,249 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ createStore,
+ makeSource,
+} from "../../../utils/test-head";
+
+import { initialSourceBlackBoxState } from "../../../reducers/source-blackbox";
+
+describe("blackbox", () => {
+ it("should blackbox and unblackbox a source based on the current state of the source ", async () => {
+ const store = createStore({
+ blackBox: async () => true,
+ getSourceActorBreakableLines: async () => [],
+ });
+ const { dispatch, getState, cx } = store;
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+ await dispatch(actions.toggleBlackBox(cx, fooSource));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ let blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual([]);
+
+ await dispatch(actions.toggleBlackBox(cx, fooSource));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(false);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual(undefined);
+ });
+
+ it("should blackbox and unblackbox a source when explicilty specified", async () => {
+ const store = createStore({
+ blackBox: async () => true,
+ getSourceActorBreakableLines: async () => [],
+ });
+ const { dispatch, getState, cx } = store;
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+
+ // check the state before trying to blackbox
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(false);
+
+ let blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual(undefined);
+
+ // should blackbox the whole source
+ await dispatch(actions.toggleBlackBox(cx, fooSource, true, []));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual([]);
+
+ // should unblackbox the whole source
+ await dispatch(actions.toggleBlackBox(cx, fooSource, false, []));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(false);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual(undefined);
+ });
+
+ it("should blackbox and unblackbox lines in a source", async () => {
+ const store = createStore({
+ blackBox: async () => true,
+ getSourceActorBreakableLines: async () => [],
+ });
+ const { dispatch, getState, cx } = store;
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+
+ const range1 = {
+ start: { line: 10, column: 3 },
+ end: { line: 15, column: 4 },
+ };
+
+ const range2 = {
+ start: { line: 5, column: 3 },
+ end: { line: 7, column: 6 },
+ };
+
+ await dispatch(actions.toggleBlackBox(cx, fooSource, true, [range1]));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ let blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual([range1]);
+
+ // add new blackbox lines in the second range
+ await dispatch(actions.toggleBlackBox(cx, fooSource, true, [range2]));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ // ranges are stored asc order
+ expect(blackboxRanges[fooSource.url]).toEqual([range2, range1]);
+
+ // un-blackbox lines in the first range
+ await dispatch(actions.toggleBlackBox(cx, fooSource, false, [range1]));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual([range2]);
+
+ // un-blackbox lines in the second range
+ await dispatch(actions.toggleBlackBox(cx, fooSource, false, [range2]));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(false);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual(undefined);
+ });
+
+ it("should undo blackboxed lines when whole source unblackboxed", async () => {
+ const store = createStore({
+ blackBox: async () => true,
+ getSourceActorBreakableLines: async () => [],
+ });
+ const { dispatch, getState, cx } = store;
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+
+ const range1 = {
+ start: { line: 1, column: 5 },
+ end: { line: 3, column: 4 },
+ };
+
+ const range2 = {
+ start: { line: 5, column: 3 },
+ end: { line: 7, column: 6 },
+ };
+
+ await dispatch(
+ actions.toggleBlackBox(cx, fooSource, true, [range1, range2])
+ );
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ let blackboxRanges = selectors.getBlackBoxRanges(getState());
+ // The ranges are ordered in based on the lines & cols in ascending
+ expect(blackboxRanges[fooSource.url]).toEqual([range2, range1]);
+
+ // un-blackbox the whole source
+ await dispatch(actions.toggleBlackBox(cx, fooSource));
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(false);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual(undefined);
+ });
+
+ it("should restore the blackboxed state correctly debugger load", async () => {
+ const mockAsyncStoreBlackBoxedRanges = {
+ "http://localhost:8000/examples/foo": [
+ {
+ start: { line: 1, column: 5 },
+ end: { line: 3, column: 4 },
+ },
+ ],
+ };
+
+ function loadInitialState() {
+ const blackboxedRanges = mockAsyncStoreBlackBoxedRanges;
+ return {
+ sourceBlackBox: initialSourceBlackBoxState({ blackboxedRanges }),
+ };
+ }
+ const store = createStore(
+ {
+ blackBox: async () => true,
+ getSourceActorBreakableLines: async () => [],
+ },
+ loadInitialState()
+ );
+ const { dispatch, getState } = store;
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ const blackboxRanges = selectors.getBlackBoxRanges(getState());
+ const mockFooSourceRange = mockAsyncStoreBlackBoxedRanges[fooSource.url];
+ expect(blackboxRanges[fooSource.url]).toEqual(mockFooSourceRange);
+ });
+
+ it("should unblackbox lines after blackboxed state has been restored", async () => {
+ const mockAsyncStoreBlackBoxedRanges = {
+ "http://localhost:8000/examples/foo": [
+ {
+ start: { line: 1, column: 5 },
+ end: { line: 3, column: 4 },
+ },
+ ],
+ };
+
+ function loadInitialState() {
+ const blackboxedRanges = mockAsyncStoreBlackBoxedRanges;
+ return {
+ sourceBlackBox: initialSourceBlackBoxState({ blackboxedRanges }),
+ };
+ }
+ const store = createStore(
+ {
+ blackBox: async () => true,
+ getSourceActorBreakableLines: async () => [],
+ },
+ loadInitialState()
+ );
+ const { dispatch, getState, cx } = store;
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo"))
+ );
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(true);
+
+ let blackboxRanges = selectors.getBlackBoxRanges(getState());
+ const mockFooSourceRange = mockAsyncStoreBlackBoxedRanges[fooSource.url];
+ expect(blackboxRanges[fooSource.url]).toEqual(mockFooSourceRange);
+
+ //unblackbox the blackboxed line
+ await dispatch(
+ actions.toggleBlackBox(cx, fooSource, false, mockFooSourceRange)
+ );
+
+ expect(selectors.isSourceBlackBoxed(getState(), fooSource)).toEqual(false);
+
+ blackboxRanges = selectors.getBlackBoxRanges(getState());
+ expect(blackboxRanges[fooSource.url]).toEqual(undefined);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js b/devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js
new file mode 100644
index 0000000000..f81fc856dd
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js
@@ -0,0 +1,363 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ watchForState,
+ createStore,
+ makeOriginalSource,
+ makeSource,
+} from "../../../utils/test-head";
+import {
+ createSource,
+ mockCommandClient,
+} from "../../tests/helpers/mockCommandClient";
+import { getBreakpointsList } from "../../../selectors";
+import { isFulfilled, isRejected } from "../../../utils/async-value";
+import { createLocation } from "../../../utils/location";
+
+describe("loadGeneratedSourceText", () => {
+ it("should load source text", async () => {
+ const store = createStore(mockCommandClient);
+ const { dispatch, getState, cx } = store;
+
+ const foo1Source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo1"))
+ );
+ const foo1SourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ foo1Source.id
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: foo1SourceActor,
+ })
+ );
+
+ const foo1Content = selectors.getSettledSourceTextContent(
+ getState(),
+ createLocation({
+ source: foo1Source,
+ sourceActor: foo1SourceActor,
+ })
+ );
+
+ expect(
+ foo1Content &&
+ isFulfilled(foo1Content) &&
+ foo1Content.value.type === "text"
+ ? foo1Content.value.value.indexOf("return foo1")
+ : -1
+ ).not.toBe(-1);
+
+ const foo2Source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo2"))
+ );
+ const foo2SourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ foo2Source.id
+ );
+
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: foo2SourceActor,
+ })
+ );
+
+ const foo2Content = selectors.getSettledSourceTextContent(
+ getState(),
+ createLocation({
+ source: foo2Source,
+ sourceActor: foo2SourceActor,
+ })
+ );
+
+ expect(
+ foo2Content &&
+ isFulfilled(foo2Content) &&
+ foo2Content.value.type === "text"
+ ? foo2Content.value.value.indexOf("return foo2")
+ : -1
+ ).not.toBe(-1);
+ });
+
+ it("should update breakpoint text when a source loads", async () => {
+ const fooOrigContent = createSource("fooOrig", "var fooOrig = 42;");
+ const fooGenContent = createSource("fooGen", "var fooGen = 42;");
+
+ const store = createStore(
+ {
+ ...mockCommandClient,
+ sourceContents: async () => fooGenContent,
+ getSourceActorBreakpointPositions: async () => ({ 1: [0] }),
+ getSourceActorBreakableLines: async () => [],
+ },
+ {},
+ {
+ getGeneratedRangesForOriginal: async () => [
+ { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } },
+ ],
+ getOriginalLocations: async items =>
+ items.map(item => ({
+ ...item,
+ sourceId:
+ item.sourceId === fooGenSource1.id
+ ? fooOrigSources1[0].id
+ : fooOrigSources2[0].id,
+ })),
+ getOriginalSourceText: async s => ({
+ text: fooOrigContent.source,
+ contentType: fooOrigContent.contentType,
+ }),
+ }
+ );
+ const { cx, dispatch, getState } = store;
+
+ const fooGenSource1 = await dispatch(
+ actions.newGeneratedSource(makeSource("fooGen1"))
+ );
+
+ const fooOrigSources1 = await dispatch(
+ actions.newOriginalSources([makeOriginalSource(fooGenSource1)])
+ );
+ const fooGenSource2 = await dispatch(
+ actions.newGeneratedSource(makeSource("fooGen2"))
+ );
+
+ const fooOrigSources2 = await dispatch(
+ actions.newOriginalSources([makeOriginalSource(fooGenSource2)])
+ );
+
+ await dispatch(
+ actions.loadOriginalSourceText({
+ cx,
+ source: fooOrigSources1[0],
+ })
+ );
+
+ await dispatch(
+ actions.addBreakpoint(
+ cx,
+ createLocation({
+ source: fooOrigSources1[0],
+ line: 1,
+ column: 0,
+ }),
+ {}
+ )
+ );
+
+ const breakpoint1 = getBreakpointsList(getState())[0];
+ expect(breakpoint1.text).toBe("");
+ expect(breakpoint1.originalText).toBe("var fooOrig = 42;");
+
+ const fooGenSource1SourceActor =
+ selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ fooGenSource1.id
+ );
+
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: fooGenSource1SourceActor,
+ })
+ );
+
+ const breakpoint2 = getBreakpointsList(getState())[0];
+ expect(breakpoint2.text).toBe("var fooGen = 42;");
+ expect(breakpoint2.originalText).toBe("var fooOrig = 42;");
+
+ const fooGenSource2SourceActor =
+ selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ fooGenSource2.id
+ );
+
+ await dispatch(
+ actions.loadGeneratedSourceText({
+ cx,
+ sourceActor: fooGenSource2SourceActor,
+ })
+ );
+
+ await dispatch(
+ actions.addBreakpoint(
+ cx,
+ createLocation({
+ source: fooGenSource2,
+ line: 1,
+ column: 0,
+ }),
+ {}
+ )
+ );
+
+ const breakpoint3 = getBreakpointsList(getState())[1];
+ expect(breakpoint3.text).toBe("var fooGen = 42;");
+ expect(breakpoint3.originalText).toBe("");
+
+ await dispatch(
+ actions.loadOriginalSourceText({
+ cx,
+ source: fooOrigSources2[0],
+ })
+ );
+
+ const breakpoint4 = getBreakpointsList(getState())[1];
+ expect(breakpoint4.text).toBe("var fooGen = 42;");
+ expect(breakpoint4.originalText).toBe("var fooOrig = 42;");
+ });
+
+ it("loads two sources w/ one request", async () => {
+ let resolve;
+ let count = 0;
+ const { dispatch, getState, cx } = createStore({
+ sourceContents: () =>
+ new Promise(r => {
+ count++;
+ resolve = r;
+ }),
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+ });
+ const id = "foo";
+
+ const source = await dispatch(actions.newGeneratedSource(makeSource(id)));
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ const loading = dispatch(
+ actions.loadGeneratedSourceText({ cx, sourceActor })
+ );
+
+ if (!resolve) {
+ throw new Error("no resolve");
+ }
+ resolve({ source: "yay", contentType: "text/javascript" });
+ await loading;
+ expect(count).toEqual(1);
+
+ const content = selectors.getSettledSourceTextContent(
+ getState(),
+ createLocation({
+ source,
+ sourceActor,
+ })
+ );
+ expect(
+ content &&
+ isFulfilled(content) &&
+ content.value.type === "text" &&
+ content.value.value
+ ).toEqual("yay");
+ });
+
+ it("doesn't re-load loaded sources", async () => {
+ let resolve;
+ let count = 0;
+ const { dispatch, getState, cx } = createStore({
+ sourceContents: () =>
+ new Promise(r => {
+ count++;
+ resolve = r;
+ }),
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+ });
+ const id = "foo";
+
+ const source = await dispatch(actions.newGeneratedSource(makeSource(id)));
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ const loading = dispatch(
+ actions.loadGeneratedSourceText({ cx, sourceActor })
+ );
+
+ if (!resolve) {
+ throw new Error("no resolve");
+ }
+ resolve({ source: "yay", contentType: "text/javascript" });
+ await loading;
+
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+ expect(count).toEqual(1);
+
+ const content = selectors.getSettledSourceTextContent(
+ getState(),
+ createLocation({
+ source,
+ sourceActor,
+ })
+ );
+ expect(
+ content &&
+ isFulfilled(content) &&
+ content.value.type === "text" &&
+ content.value.value
+ ).toEqual("yay");
+ });
+
+ it("should indicate a loading source", async () => {
+ const store = createStore(mockCommandClient);
+ const { dispatch, cx, getState } = store;
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo2"))
+ );
+
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ const wasLoading = watchForState(store, state => {
+ return !selectors.getSettledSourceTextContent(
+ state,
+ createLocation({
+ source,
+ sourceActor,
+ })
+ );
+ });
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ expect(wasLoading()).toBe(true);
+ });
+
+ it("should indicate an errored source text", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("bad-id"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ const content = selectors.getSettledSourceTextContent(
+ getState(),
+ createLocation({
+ source,
+ sourceActor,
+ })
+ );
+ expect(
+ content && isRejected(content) && typeof content.value === "string"
+ ? content.value.indexOf("sourceContents failed")
+ : -1
+ ).not.toBe(-1);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/sources/tests/newSources.spec.js b/devtools/client/debugger/src/actions/sources/tests/newSources.spec.js
new file mode 100644
index 0000000000..730c5b32eb
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/tests/newSources.spec.js
@@ -0,0 +1,172 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ createStore,
+ makeSource,
+ makeSourceURL,
+ makeOriginalSource,
+ waitForState,
+} from "../../../utils/test-head";
+const { getSource, getSourceCount, getSelectedSource, getSourceByURL } =
+ selectors;
+import sourceQueue from "../../../utils/source-queue";
+import { generatedToOriginalId } from "devtools/client/shared/source-map-loader/index";
+
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
+
+describe("sources - new sources", () => {
+ it("should add sources to state", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+ await dispatch(actions.newGeneratedSource(makeSource("base.js")));
+ await dispatch(actions.newGeneratedSource(makeSource("jquery.js")));
+
+ expect(getSourceCount(getState())).toEqual(2);
+ const base = getSource(getState(), "base.js");
+ const jquery = getSource(getState(), "jquery.js");
+ expect(base && base.id).toEqual("base.js");
+ expect(jquery && jquery.id).toEqual("jquery.js");
+ });
+
+ it("should not add multiple identical generated sources", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+
+ const generated = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+
+ await dispatch(actions.newOriginalSources([makeOriginalSource(generated)]));
+ await dispatch(actions.newOriginalSources([makeOriginalSource(generated)]));
+
+ expect(getSourceCount(getState())).toEqual(2);
+ });
+
+ it("should not add multiple identical original sources", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+
+ await dispatch(actions.newGeneratedSource(makeSource("base.js")));
+ await dispatch(actions.newGeneratedSource(makeSource("base.js")));
+
+ expect(getSourceCount(getState())).toEqual(1);
+ });
+
+ it("should automatically select a pending source", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+ const baseSourceURL = makeSourceURL("base.js");
+ await dispatch(actions.selectSourceURL(cx, baseSourceURL));
+
+ expect(getSelectedSource(getState())).toBe(undefined);
+ const baseSource = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.url).toBe(baseSource.url);
+ });
+
+ it("should add original sources", async () => {
+ const { dispatch, getState } = createStore(
+ mockCommandClient,
+ {},
+ {
+ getOriginalURLs: async source => [
+ {
+ id: generatedToOriginalId(source.id, "magic.js"),
+ url: "magic.js",
+ },
+ ],
+ getOriginalLocations: async items => items,
+ getOriginalLocation: location => location,
+ }
+ );
+
+ await dispatch(
+ actions.newGeneratedSource(
+ makeSource("base.js", { sourceMapURL: "base.js.map" })
+ )
+ );
+ const magic = getSourceByURL(getState(), "magic.js");
+ expect(magic && magic.url).toEqual("magic.js");
+ });
+
+ // eslint-disable-next-line
+ it("should not attempt to fetch original sources if it's missing a source map url", async () => {
+ const getOriginalURLs = jest.fn();
+ const { dispatch } = createStore(
+ mockCommandClient,
+ {},
+ {
+ getOriginalURLs,
+ getOriginalLocations: async items => items,
+ getOriginalLocation: location => location,
+ }
+ );
+
+ await dispatch(actions.newGeneratedSource(makeSource("base.js")));
+ expect(getOriginalURLs).not.toHaveBeenCalled();
+ });
+
+ // eslint-disable-next-line
+ it("should process new sources immediately, without waiting for source maps to be fetched first", async () => {
+ const { dispatch, getState } = createStore(
+ mockCommandClient,
+ {},
+ {
+ getOriginalURLs: async () => new Promise(_ => {}),
+ getOriginalLocations: async items => items,
+ getOriginalLocation: location => location,
+ }
+ );
+ await dispatch(
+ actions.newGeneratedSource(
+ makeSource("base.js", { sourceMapURL: "base.js.map" })
+ )
+ );
+ expect(getSourceCount(getState())).toEqual(1);
+ const base = getSource(getState(), "base.js");
+ expect(base && base.id).toEqual("base.js");
+ });
+
+ // eslint-disable-next-line
+ it("shouldn't let one slow loading source map delay all the other source maps", async () => {
+ const dbg = createStore(
+ mockCommandClient,
+ {},
+ {
+ getOriginalURLs: async source => {
+ if (source.id == "foo.js") {
+ // simulate a hang loading foo.js.map
+ return new Promise(_ => {});
+ }
+ const url = source.id.replace(".js", ".cljs");
+ return [
+ {
+ id: generatedToOriginalId(source.id, url),
+ url,
+ },
+ ];
+ },
+ getOriginalLocations: async items => items,
+ getGeneratedLocation: location => location,
+ }
+ );
+ const { dispatch, getState } = dbg;
+ await dispatch(
+ actions.newGeneratedSources([
+ makeSource("foo.js", { sourceMapURL: "foo.js.map" }),
+ makeSource("bar.js", { sourceMapURL: "bar.js.map" }),
+ makeSource("bazz.js", { sourceMapURL: "bazz.js.map" }),
+ ])
+ );
+ await sourceQueue.flush();
+ await waitForState(dbg, state => getSourceCount(state) == 5);
+ expect(getSourceCount(getState())).toEqual(5);
+ const barCljs = getSourceByURL(getState(), "bar.cljs");
+ expect(barCljs && barCljs.url).toEqual("bar.cljs");
+ const bazzCljs = getSourceByURL(getState(), "bazz.cljs");
+ expect(bazzCljs && bazzCljs.url).toEqual("bazz.cljs");
+ });
+});
diff --git a/devtools/client/debugger/src/actions/sources/tests/select.spec.js b/devtools/client/debugger/src/actions/sources/tests/select.spec.js
new file mode 100644
index 0000000000..3fcf24f2b7
--- /dev/null
+++ b/devtools/client/debugger/src/actions/sources/tests/select.spec.js
@@ -0,0 +1,288 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ createStore,
+ createSourceObject,
+ makeFrame,
+ makeSource,
+ makeSourceURL,
+ waitForState,
+ makeOriginalSource,
+} from "../../../utils/test-head";
+import {
+ getSource,
+ getSourceCount,
+ getSelectedSource,
+ getSourceTabs,
+ getSelectedLocation,
+ getSymbols,
+} from "../../../selectors/";
+import { createLocation } from "../../../utils/location";
+
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
+
+process.on("unhandledRejection", (reason, p) => {});
+
+function initialLocation(sourceId) {
+ return createLocation({ source: createSourceObject(sourceId), line: 1 });
+}
+
+describe("sources", () => {
+ it("should select a source", async () => {
+ // Note that we pass an empty client in because the action checks
+ // if it exists.
+ const store = createStore(mockCommandClient);
+ const { dispatch, getState } = store;
+
+ const frame = makeFrame({ id: "1", sourceId: "foo1" });
+
+ const baseSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo1"))
+ );
+ await dispatch(
+ actions.paused({
+ thread: "FakeThread",
+ why: { type: "debuggerStatement" },
+ frame,
+ frames: [frame],
+ })
+ );
+
+ const cx = selectors.getThreadContext(getState());
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({ source: baseSource, line: 1, column: 5 })
+ )
+ );
+
+ const selectedSource = getSelectedSource(getState());
+ if (!selectedSource) {
+ throw new Error("bad selectedSource");
+ }
+ expect(selectedSource.id).toEqual("foo1");
+
+ const source = getSource(getState(), selectedSource.id);
+ if (!source) {
+ throw new Error("bad source");
+ }
+ expect(source.id).toEqual("foo1");
+ });
+
+ it("should select next tab on tab closed if no previous tab", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
+ await dispatch(actions.newGeneratedSource(makeSource("baz.js")));
+
+ // 3rd tab
+ await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
+
+ // 2nd tab
+ await dispatch(actions.selectLocation(cx, initialLocation("bar.js")));
+
+ // 1st tab
+ await dispatch(actions.selectLocation(cx, initialLocation("baz.js")));
+
+ // 3rd tab is reselected
+ await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
+
+ // closes the 1st tab, which should have no previous tab
+ await dispatch(actions.closeTab(cx, fooSource));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("bar.js");
+ expect(getSourceTabs(getState())).toHaveLength(2);
+ });
+
+ it("should open a tab for the source", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+ await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
+ await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
+
+ const tabs = getSourceTabs(getState());
+ expect(tabs).toHaveLength(1);
+ expect(tabs[0].url).toEqual("http://localhost:8000/examples/foo.js");
+ });
+
+ it("should select previous tab on tab closed", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+ await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
+ await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
+
+ const bazSource = await dispatch(
+ actions.newGeneratedSource(makeSource("baz.js"))
+ );
+
+ await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
+ await dispatch(actions.selectLocation(cx, initialLocation("bar.js")));
+ await dispatch(actions.selectLocation(cx, initialLocation("baz.js")));
+ await dispatch(actions.closeTab(cx, bazSource));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("bar.js");
+ expect(getSourceTabs(getState())).toHaveLength(2);
+ });
+
+ it("should keep the selected source when other tab closed", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
+ await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
+ const bazSource = await dispatch(
+ actions.newGeneratedSource(makeSource("baz.js"))
+ );
+
+ // 3rd tab
+ await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
+
+ // 2nd tab
+ await dispatch(actions.selectLocation(cx, initialLocation("bar.js")));
+
+ // 1st tab
+ await dispatch(actions.selectLocation(cx, initialLocation("baz.js")));
+
+ // 3rd tab is reselected
+ await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
+ await dispatch(actions.closeTab(cx, bazSource));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("foo.js");
+ expect(getSourceTabs(getState())).toHaveLength(2);
+ });
+
+ it("should not select new sources that lack a URL", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+
+ await dispatch(
+ actions.newGeneratedSource({
+ ...makeSource("foo"),
+ url: "",
+ })
+ );
+
+ expect(getSourceCount(getState())).toEqual(1);
+ const selectedLocation = getSelectedLocation(getState());
+ expect(selectedLocation).toEqual(undefined);
+ });
+
+ it("sets and clears selected location correctly", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("testSource"))
+ );
+ const location = createLocation({ source });
+
+ // set value
+ dispatch(actions.setSelectedLocation(cx, location));
+ expect(getSelectedLocation(getState())).toEqual({
+ sourceId: source.id,
+ ...location,
+ });
+
+ // clear value
+ dispatch(actions.clearSelectedLocation(cx));
+ expect(getSelectedLocation(getState())).toEqual(null);
+ });
+
+ it("sets and clears pending selected location correctly", () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+ const url = "testURL";
+ const options = { line: "testLine", column: "testColumn" };
+
+ // set value
+ dispatch(actions.setPendingSelectedLocation(cx, url, options));
+ const setResult = getState().sources.pendingSelectedLocation;
+ expect(setResult).toEqual({
+ url,
+ line: options.line,
+ column: options.column,
+ });
+
+ // clear value
+ dispatch(actions.clearSelectedLocation(cx));
+ const clearResult = getState().sources.pendingSelectedLocation;
+ expect(clearResult).toEqual({ url: "" });
+ });
+
+ it("should keep the generated the viewing context", async () => {
+ const store = createStore(mockCommandClient);
+ const { dispatch, getState, cx } = store;
+ const baseSource = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ baseSource.id
+ );
+
+ const location = createLocation({
+ source: baseSource,
+ line: 1,
+ sourceActor,
+ });
+ await dispatch(actions.selectLocation(cx, location));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe(baseSource.id);
+ await waitForState(store, state => getSymbols(state, location));
+ });
+
+ it("should change the original the viewing context", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockCommandClient,
+ {},
+ {
+ getOriginalLocation: async location => ({ ...location, line: 12 }),
+ getOriginalLocations: async items => items,
+ getGeneratedRangesForOriginal: async () => [],
+ getOriginalSourceText: async () => ({ text: "" }),
+ }
+ );
+
+ const baseGenSource = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+
+ const baseSources = await dispatch(
+ actions.newOriginalSources([makeOriginalSource(baseGenSource)])
+ );
+ await dispatch(actions.selectSource(cx, baseSources[0]));
+
+ await dispatch(
+ actions.selectSpecificLocation(
+ cx,
+ createLocation({
+ source: baseSources[0],
+ line: 1,
+ })
+ )
+ );
+
+ const selected = getSelectedLocation(getState());
+ expect(selected && selected.line).toBe(1);
+ });
+
+ describe("selectSourceURL", () => {
+ it("should automatically select a pending source", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+ const baseSourceURL = makeSourceURL("base.js");
+ await dispatch(actions.selectSourceURL(cx, baseSourceURL));
+
+ expect(getSelectedSource(getState())).toBe(undefined);
+ const baseSource = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.url).toBe(baseSource.url);
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/actions/tabs.js b/devtools/client/debugger/src/actions/tabs.js
new file mode 100644
index 0000000000..1b3c0d3f43
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tabs.js
@@ -0,0 +1,76 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux actions for the editor tabs
+ * @module actions/tabs
+ */
+
+import { removeDocument } from "../utils/editor";
+import { selectSource } from "./sources";
+
+import {
+ getSourceByURL,
+ getSourceTabs,
+ getNewSelectedSource,
+} from "../selectors";
+
+export function addTab(source, sourceActor) {
+ return {
+ type: "ADD_TAB",
+ source,
+ sourceActor,
+ };
+}
+
+export function moveTab(url, tabIndex) {
+ return {
+ type: "MOVE_TAB",
+ url,
+ tabIndex,
+ };
+}
+
+export function moveTabBySourceId(sourceId, tabIndex) {
+ return {
+ type: "MOVE_TAB_BY_SOURCE_ID",
+ sourceId,
+ tabIndex,
+ };
+}
+
+/**
+ * @memberof actions/tabs
+ * @static
+ */
+export function closeTab(cx, source, reason = "click") {
+ return ({ dispatch, getState, client }) => {
+ removeDocument(source.id);
+
+ const tabs = getSourceTabs(getState());
+ dispatch({ type: "CLOSE_TAB", source });
+
+ const newSource = getNewSelectedSource(getState(), tabs);
+ dispatch(selectSource(cx, newSource));
+ };
+}
+
+/**
+ * @memberof actions/tabs
+ * @static
+ */
+export function closeTabs(cx, urls) {
+ return ({ dispatch, getState, client }) => {
+ const sources = urls
+ .map(url => getSourceByURL(getState(), url))
+ .filter(Boolean);
+
+ const tabs = getSourceTabs(getState());
+ sources.map(source => removeDocument(source.id));
+ dispatch({ type: "CLOSE_TABS", sources });
+
+ const source = getNewSelectedSource(getState(), tabs);
+ dispatch(selectSource(cx, source));
+ };
+}
diff --git a/devtools/client/debugger/src/actions/tests/__snapshots__/expressions.spec.js.snap b/devtools/client/debugger/src/actions/tests/__snapshots__/expressions.spec.js.snap
new file mode 100644
index 0000000000..f27eb26f50
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/__snapshots__/expressions.spec.js.snap
@@ -0,0 +1,11 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`expressions should get the autocomplete matches for the input 1`] = `
+Array [
+ "toLocaleString",
+ "toSource",
+ "toString",
+ "toolbar",
+ "top",
+]
+`;
diff --git a/devtools/client/debugger/src/actions/tests/__snapshots__/pending-breakpoints.spec.js.snap b/devtools/client/debugger/src/actions/tests/__snapshots__/pending-breakpoints.spec.js.snap
new file mode 100644
index 0000000000..741e45d6d8
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/__snapshots__/pending-breakpoints.spec.js.snap
@@ -0,0 +1,44 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`initializing when pending breakpoints exist in prefs syncs pending breakpoints 1`] = `
+Object {
+ "http://localhost:8000/examples/bar.js:5:2": Object {
+ "astLocation": Object {
+ "index": 0,
+ "name": undefined,
+ "offset": Object {
+ "line": 5,
+ },
+ },
+ "disabled": false,
+ "generatedLocation": Object {
+ "column": 2,
+ "line": 5,
+ "source": Object {
+ "id": "",
+ "url": "http://localhost:8000/examples/bar.js",
+ },
+ "sourceActor": null,
+ "sourceActorId": undefined,
+ "sourceId": "",
+ "sourceUrl": "http://localhost:8000/examples/bar.js",
+ },
+ "location": Object {
+ "column": 2,
+ "line": 5,
+ "source": Object {
+ "id": "",
+ "url": "http://localhost:8000/examples/bar.js",
+ },
+ "sourceActor": null,
+ "sourceActorId": undefined,
+ "sourceId": "",
+ "sourceUrl": "http://localhost:8000/examples/bar.js",
+ },
+ "options": Object {
+ "condition": null,
+ "hidden": false,
+ },
+ },
+}
+`;
diff --git a/devtools/client/debugger/src/actions/tests/__snapshots__/preview.spec.js.snap b/devtools/client/debugger/src/actions/tests/__snapshots__/preview.spec.js.snap
new file mode 100644
index 0000000000..026bfe4a89
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/__snapshots__/preview.spec.js.snap
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`preview should generate previews 1`] = `null`;
diff --git a/devtools/client/debugger/src/actions/tests/expressions.spec.js b/devtools/client/debugger/src/actions/tests/expressions.spec.js
new file mode 100644
index 0000000000..48b06ebd1a
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/expressions.spec.js
@@ -0,0 +1,184 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ createStore,
+ makeSource,
+} from "../../utils/test-head";
+
+import { makeMockFrame } from "../../utils/test-mockup";
+
+const mockThreadFront = {
+ evaluate: (script, { frameId }) =>
+ new Promise((resolve, reject) => {
+ if (!frameId) {
+ resolve("bla");
+ } else {
+ resolve("boo");
+ }
+ }),
+ evaluateExpressions: (inputs, { frameId }) =>
+ Promise.all(
+ inputs.map(
+ input =>
+ new Promise((resolve, reject) => {
+ if (!frameId) {
+ resolve("bla");
+ } else {
+ resolve("boo");
+ }
+ })
+ )
+ ),
+ getFrameScopes: async () => {},
+ getFrames: async () => [],
+ sourceContents: () => ({ source: "", contentType: "text/javascript" }),
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+ autocomplete: () => {
+ return new Promise(resolve => {
+ resolve({
+ from: "foo",
+ matches: ["toLocaleString", "toSource", "toString", "toolbar", "top"],
+ matchProp: "to",
+ });
+ });
+ },
+};
+
+describe("expressions", () => {
+ it("should add an expression", async () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+
+ await dispatch(actions.addExpression(cx, "foo"));
+ expect(selectors.getExpressions(getState())).toHaveLength(1);
+ });
+
+ it("should not add empty expressions", () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+
+ dispatch(actions.addExpression(cx, undefined));
+ dispatch(actions.addExpression(cx, ""));
+ expect(selectors.getExpressions(getState())).toHaveLength(0);
+ });
+
+ it("should not add invalid expressions", async () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+ await dispatch(actions.addExpression(cx, "foo#"));
+ const state = getState();
+ expect(selectors.getExpressions(state)).toHaveLength(0);
+ expect(selectors.getExpressionError(state)).toBe(true);
+ });
+
+ it("should update an expression", async () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+
+ await dispatch(actions.addExpression(cx, "foo"));
+ const expression = selectors.getExpression(getState(), "foo");
+ if (!expression) {
+ throw new Error("expression must exist");
+ }
+
+ await dispatch(actions.updateExpression(cx, "bar", expression));
+ const bar = selectors.getExpression(getState(), "bar");
+
+ expect(bar && bar.input).toBe("bar");
+ });
+
+ it("should not update an expression w/ invalid code", async () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+
+ await dispatch(actions.addExpression(cx, "foo"));
+ const expression = selectors.getExpression(getState(), "foo");
+ if (!expression) {
+ throw new Error("expression must exist");
+ }
+ await dispatch(actions.updateExpression(cx, "#bar", expression));
+ expect(selectors.getExpression(getState(), "bar")).toBeUndefined();
+ });
+
+ it("should delete an expression", async () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+
+ await dispatch(actions.addExpression(cx, "foo"));
+ await dispatch(actions.addExpression(cx, "bar"));
+ expect(selectors.getExpressions(getState())).toHaveLength(2);
+
+ const expression = selectors.getExpression(getState(), "foo");
+
+ if (!expression) {
+ throw new Error("expression must exist");
+ }
+
+ const bar = selectors.getExpression(getState(), "bar");
+ dispatch(actions.deleteExpression(expression));
+ expect(selectors.getExpressions(getState())).toHaveLength(1);
+ expect(bar && bar.input).toBe("bar");
+ });
+
+ it("should evaluate expressions global scope", async () => {
+ const { dispatch, getState, cx } = createStore(mockThreadFront);
+ await dispatch(actions.addExpression(cx, "foo"));
+ await dispatch(actions.addExpression(cx, "bar"));
+
+ let foo = selectors.getExpression(getState(), "foo");
+ let bar = selectors.getExpression(getState(), "bar");
+ expect(foo && foo.value).toBe("bla");
+ expect(bar && bar.value).toBe("bla");
+
+ await dispatch(actions.evaluateExpressions(cx));
+ foo = selectors.getExpression(getState(), "foo");
+ bar = selectors.getExpression(getState(), "bar");
+ expect(foo && foo.value).toBe("bla");
+ expect(bar && bar.value).toBe("bla");
+ });
+
+ it("should evaluate expressions in specific scope", async () => {
+ const { dispatch, getState } = createStore(mockThreadFront);
+ await createFrames(getState, dispatch);
+
+ const cx = selectors.getThreadContext(getState());
+ await dispatch(actions.newGeneratedSource(makeSource("source")));
+ await dispatch(actions.addExpression(cx, "foo"));
+ await dispatch(actions.addExpression(cx, "bar"));
+
+ let foo = selectors.getExpression(getState(), "foo");
+ let bar = selectors.getExpression(getState(), "bar");
+ expect(foo && foo.value).toBe("boo");
+ expect(bar && bar.value).toBe("boo");
+
+ await dispatch(actions.evaluateExpressions(cx));
+ foo = selectors.getExpression(getState(), "foo");
+ bar = selectors.getExpression(getState(), "bar");
+ expect(foo && foo.value).toBe("boo");
+ expect(bar && bar.value).toBe("boo");
+ });
+
+ it("should get the autocomplete matches for the input", async () => {
+ const { cx, dispatch, getState } = createStore(mockThreadFront);
+ await dispatch(actions.autocomplete(cx, "to", 2));
+ expect(selectors.getAutocompleteMatchset(getState())).toMatchSnapshot();
+ });
+});
+
+async function createFrames(getState, dispatch) {
+ const frame = makeMockFrame();
+ await dispatch(actions.newGeneratedSource(makeSource("example.js")));
+ await dispatch(actions.newGeneratedSource(makeSource("source")));
+
+ await dispatch(
+ actions.paused({
+ thread: "FakeThread",
+ frame,
+ frames: [frame],
+ why: { type: "just because" },
+ })
+ );
+
+ await dispatch(
+ actions.selectFrame(selectors.getThreadContext(getState()), frame)
+ );
+}
diff --git a/devtools/client/debugger/src/actions/tests/fixtures/immutable.js b/devtools/client/debugger/src/actions/tests/fixtures/immutable.js
new file mode 100644
index 0000000000..e8ac7fb233
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/fixtures/immutable.js
@@ -0,0 +1,2 @@
+
+const m = Immutable.Map({a: 2})
diff --git a/devtools/client/debugger/src/actions/tests/fixtures/reactComponent.js b/devtools/client/debugger/src/actions/tests/fixtures/reactComponent.js
new file mode 100644
index 0000000000..526c852d99
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/fixtures/reactComponent.js
@@ -0,0 +1,7 @@
+import React, { Component } from "react";
+
+class FixtureComponent extends Component {
+ render() {
+ return null;
+ }
+}
diff --git a/devtools/client/debugger/src/actions/tests/fixtures/reactFuncComponent.js b/devtools/client/debugger/src/actions/tests/fixtures/reactFuncComponent.js
new file mode 100644
index 0000000000..3103161fe0
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/fixtures/reactFuncComponent.js
@@ -0,0 +1,5 @@
+import React, { Component } from "react";
+
+export default FixtureComponent = (props) => {
+ return <div>props.a</div>;
+}
diff --git a/devtools/client/debugger/src/actions/tests/fixtures/scopes.js b/devtools/client/debugger/src/actions/tests/fixtures/scopes.js
new file mode 100644
index 0000000000..3a38097f5e
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/fixtures/scopes.js
@@ -0,0 +1,11 @@
+// Program Scope
+
+function outer() {
+ function inner() {
+ const x = 1;
+ }
+
+ const declaration = function() {
+ const x = 1;
+ };
+}
diff --git a/devtools/client/debugger/src/actions/tests/helpers/breakpoints.js b/devtools/client/debugger/src/actions/tests/helpers/breakpoints.js
new file mode 100644
index 0000000000..e0279e5fc1
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/helpers/breakpoints.js
@@ -0,0 +1,77 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { createLocation } from "../../../utils/location";
+
+export function mockPendingBreakpoint(overrides = {}) {
+ const { sourceUrl, line, column, condition, disabled, hidden } = overrides;
+ return {
+ location: createLocation({
+ source: {
+ id: "",
+ url: sourceUrl || "http://localhost:8000/examples/bar.js",
+ },
+ sourceId: "",
+ sourceUrl: sourceUrl || "http://localhost:8000/examples/bar.js",
+ line: line || 5,
+ column: column || 1,
+ }),
+ generatedLocation: createLocation({
+ source: {
+ id: "",
+ url: sourceUrl || "http://localhost:8000/examples/bar.js",
+ },
+ sourceId: "",
+ sourceUrl: sourceUrl || "http://localhost:8000/examples/bar.js",
+ line: line || 5,
+ column: column || 1,
+ }),
+ astLocation: {
+ name: undefined,
+ offset: {
+ line: line || 5,
+ },
+ index: 0,
+ },
+ options: {
+ condition: condition || null,
+ hidden: hidden || false,
+ },
+ disabled: disabled || false,
+ };
+}
+
+export function generateBreakpoint(filename, line = 5, column = 0) {
+ return {
+ id: "breakpoint",
+ originalText: "",
+ text: "",
+ location: createLocation({
+ source: {
+ url: `http://localhost:8000/examples/${filename}`,
+ id: filename,
+ },
+ sourceUrl: `http://localhost:8000/examples/${filename}`,
+ sourceId: filename,
+ line,
+ column,
+ }),
+ generatedLocation: createLocation({
+ source: {
+ url: `http://localhost:8000/examples/${filename}`,
+ id: filename,
+ },
+ sourceUrl: `http://localhost:8000/examples/${filename}`,
+ sourceId: filename,
+ line,
+ column,
+ }),
+ astLocation: undefined,
+ options: {
+ condition: "",
+ hidden: false,
+ },
+ disabled: false,
+ };
+}
diff --git a/devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js b/devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js
new file mode 100644
index 0000000000..38dd55c274
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js
@@ -0,0 +1,49 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+export function createSource(name, code) {
+ name = name.replace(/\..*$/, "");
+ return {
+ source: code || `function ${name}() {\n return ${name} \n}`,
+ contentType: "text/javascript",
+ };
+}
+
+const sources = [
+ "a",
+ "b",
+ "foo",
+ "bar",
+ "foo1",
+ "foo2",
+ "a.js",
+ "baz.js",
+ "foobar.js",
+ "barfoo.js",
+ "foo.js",
+ "bar.js",
+ "base.js",
+ "bazz.js",
+ "jquery.js",
+];
+
+export const mockCommandClient = {
+ sourceContents: function ({ source }) {
+ return new Promise((resolve, reject) => {
+ if (sources.includes(source)) {
+ resolve(createSource(source));
+ }
+
+ reject(`unknown source: ${source}`);
+ });
+ },
+ setBreakpoint: async () => {},
+ removeBreakpoint: _id => Promise.resolve(),
+ threadFront: async () => {},
+ getFrameScopes: async () => {},
+ getFrames: async () => [],
+ evaluateExpressions: async () => {},
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+};
diff --git a/devtools/client/debugger/src/actions/tests/helpers/readFixture.js b/devtools/client/debugger/src/actions/tests/helpers/readFixture.js
new file mode 100644
index 0000000000..6c23641226
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/helpers/readFixture.js
@@ -0,0 +1,14 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import fs from "fs";
+import path from "path";
+
+export default function readFixture(name) {
+ const text = fs.readFileSync(
+ path.join(__dirname, `../fixtures/${name}`),
+ "utf8"
+ );
+ return text;
+}
diff --git a/devtools/client/debugger/src/actions/tests/navigation.spec.js b/devtools/client/debugger/src/actions/tests/navigation.spec.js
new file mode 100644
index 0000000000..e2572fde80
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/navigation.spec.js
@@ -0,0 +1,29 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { createStore, selectors, actions } from "../../utils/test-head";
+
+jest.mock("../../utils/editor");
+
+const { getActiveSearch } = selectors;
+
+const threadFront = {
+ sourceContents: async () => ({
+ source: "function foo1() {\n const foo = 5; return foo;\n}",
+ contentType: "text/javascript",
+ }),
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+};
+
+describe("navigation", () => {
+ it("navigation removes activeSearch 'file' value", async () => {
+ const { dispatch, getState } = createStore(threadFront);
+ dispatch(actions.setActiveSearch("file"));
+ expect(getActiveSearch(getState())).toBe("file");
+
+ await dispatch(actions.willNavigate("will-navigate"));
+ expect(getActiveSearch(getState())).toBe(null);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js b/devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js
new file mode 100644
index 0000000000..2baa17a79f
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js
@@ -0,0 +1,294 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+// TODO: we would like to mock this in the local tests
+import {
+ generateBreakpoint,
+ mockPendingBreakpoint,
+} from "./helpers/breakpoints.js";
+
+import { mockCommandClient } from "./helpers/mockCommandClient";
+import { asyncStore } from "../../utils/prefs";
+
+function loadInitialState(opts = {}) {
+ const mockedPendingBreakpoint = mockPendingBreakpoint({ ...opts, column: 2 });
+ const l = mockedPendingBreakpoint.location;
+ const id = `${l.sourceUrl}:${l.line}:${l.column}`;
+ asyncStore.pendingBreakpoints = { [id]: mockedPendingBreakpoint };
+
+ return { pendingBreakpoints: asyncStore.pendingBreakpoints };
+}
+
+jest.mock("../../utils/prefs", () => ({
+ prefs: {
+ clientSourceMapsEnabled: true,
+ expressions: [],
+ },
+ asyncStore: {
+ pendingBreakpoints: {},
+ },
+ clear: jest.fn(),
+ features: {
+ inlinePreview: true,
+ },
+}));
+
+import {
+ createStore,
+ selectors,
+ actions,
+ makeSource,
+ makeSourceURL,
+ waitForState,
+} from "../../utils/test-head";
+
+import sourceMapLoader from "devtools/client/shared/source-map-loader/index";
+
+function mockClient(bpPos = {}) {
+ return {
+ ...mockCommandClient,
+ setSkipPausing: jest.fn(),
+ getSourceActorBreakpointPositions: async () => bpPos,
+ getSourceActorBreakableLines: async () => [],
+ };
+}
+
+function mockSourceMaps() {
+ return {
+ ...sourceMapLoader,
+ getOriginalSourceText: async id => ({
+ id,
+ text: "",
+ contentType: "text/javascript",
+ }),
+ getGeneratedRangesForOriginal: async () => [
+ { start: { line: 0, column: 0 }, end: { line: 10, column: 10 } },
+ ],
+ getOriginalLocations: async items => items,
+ };
+}
+
+describe("when adding breakpoints", () => {
+ it("a corresponding pending breakpoint should be added", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [1] }),
+ loadInitialState(),
+ mockSourceMaps()
+ );
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ const bp = generateBreakpoint("foo.js", 5, 1);
+
+ await dispatch(actions.addBreakpoint(cx, bp.location));
+
+ expect(selectors.getPendingBreakpointList(getState())).toHaveLength(2);
+ });
+});
+
+describe("initializing when pending breakpoints exist in prefs", () => {
+ it("syncs pending breakpoints", async () => {
+ const { getState } = createStore(
+ mockClient({ 5: [0] }),
+ loadInitialState(),
+ mockSourceMaps()
+ );
+ const bps = selectors.getPendingBreakpoints(getState());
+ expect(bps).toMatchSnapshot();
+ });
+
+ it("re-adding breakpoints update existing pending breakpoints", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [1, 2] }),
+ loadInitialState(),
+ mockSourceMaps()
+ );
+ const bar = generateBreakpoint("bar.js", 5, 1);
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+ await dispatch(actions.addBreakpoint(cx, bar.location));
+
+ const bps = selectors.getPendingBreakpointList(getState());
+ expect(bps).toHaveLength(2);
+ });
+
+ it("adding bps doesn't remove existing pending breakpoints", async () => {
+ const { dispatch, getState, cx } = createStore(
+ mockClient({ 5: [0] }),
+ loadInitialState(),
+ mockSourceMaps()
+ );
+ const bp = generateBreakpoint("foo.js");
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ await dispatch(actions.addBreakpoint(cx, bp.location));
+
+ const bps = selectors.getPendingBreakpointList(getState());
+ expect(bps).toHaveLength(2);
+ });
+});
+
+describe("initializing with disabled pending breakpoints in prefs", () => {
+ it("syncs breakpoints with pending breakpoints", async () => {
+ const store = createStore(
+ mockClient({ 5: [2] }),
+ loadInitialState({ disabled: true }),
+ mockSourceMaps()
+ );
+
+ const { getState, dispatch, cx } = store;
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ await waitForState(store, state => {
+ const bps = selectors.getBreakpointsForSource(state, source.id);
+ return bps && !!Object.values(bps).length;
+ });
+
+ const bp = selectors.getBreakpointsList(getState()).find(({ location }) => {
+ return (
+ location.line == 5 &&
+ location.column == 2 &&
+ location.sourceId == source.id
+ );
+ });
+
+ if (!bp) {
+ throw new Error("no bp");
+ }
+ expect(bp.location.sourceId).toEqual(source.id);
+ expect(bp.disabled).toEqual(true);
+ });
+});
+
+describe("adding sources", () => {
+ it("corresponding breakpoints are added for a single source", async () => {
+ const store = createStore(
+ mockClient({ 5: [2] }),
+ loadInitialState({ disabled: true }),
+ mockSourceMaps()
+ );
+ const { getState, dispatch, cx } = store;
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(0);
+
+ const source = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source.id
+ );
+
+ await dispatch(actions.loadGeneratedSourceText({ cx, sourceActor }));
+
+ await waitForState(store, state => selectors.getBreakpointCount(state) > 0);
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ });
+
+ it("corresponding breakpoints are added to the original source", async () => {
+ const sourceURL = makeSourceURL("bar.js");
+ const store = createStore(mockClient({ 5: [2] }), loadInitialState(), {
+ getOriginalURLs: async source => [
+ {
+ id: sourceMapLoader.generatedToOriginalId(source.id, sourceURL),
+ url: sourceURL,
+ },
+ ],
+ getOriginalSourceText: async () => ({ text: "" }),
+ getGeneratedLocation: async location => location,
+ getOriginalLocation: async location => location,
+ getGeneratedRangesForOriginal: async () => [
+ { start: { line: 0, column: 0 }, end: { line: 10, column: 10 } },
+ ],
+ getOriginalLocations: async items =>
+ items.map(item => ({
+ ...item,
+ sourceId: sourceMapLoader.generatedToOriginalId(
+ item.sourceId,
+ sourceURL
+ ),
+ })),
+ });
+
+ const { getState, dispatch } = store;
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(0);
+
+ await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js", { sourceMapURL: "foo" }))
+ );
+
+ await waitForState(store, state => selectors.getBreakpointCount(state) > 0);
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ });
+
+ it("add corresponding breakpoints for multiple sources", async () => {
+ const store = createStore(
+ mockClient({ 5: [2] }),
+ loadInitialState({ disabled: true }),
+ mockSourceMaps()
+ );
+ const { getState, dispatch, cx } = store;
+
+ expect(selectors.getBreakpointCount(getState())).toEqual(0);
+
+ const [source1, source2] = await dispatch(
+ actions.newGeneratedSources([makeSource("bar.js"), makeSource("foo.js")])
+ );
+ const sourceActor1 = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source1.id
+ );
+ const sourceActor2 = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ source2.id
+ );
+
+ await dispatch(
+ actions.loadGeneratedSourceText({ cx, sourceActor: sourceActor1 })
+ );
+ await dispatch(
+ actions.loadGeneratedSourceText({ cx, sourceActor: sourceActor2 })
+ );
+
+ await waitForState(store, state => selectors.getBreakpointCount(state) > 0);
+ expect(selectors.getBreakpointCount(getState())).toEqual(1);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/tests/preview.spec.js b/devtools/client/debugger/src/actions/tests/preview.spec.js
new file mode 100644
index 0000000000..3b6c9c23ac
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/preview.spec.js
@@ -0,0 +1,217 @@
+/* eslint max-nested-callbacks: ["error", 6] */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ createStore,
+ selectors,
+ actions,
+ makeSource,
+ makeFrame,
+ waitForState,
+ waitATick,
+} from "../../utils/test-head";
+import { createLocation } from "../../utils/location";
+
+function waitForPreview(store, expression) {
+ return waitForState(store, state => {
+ const preview = selectors.getPreview(state);
+ return preview && preview.expression == expression;
+ });
+}
+
+function mockThreadFront(overrides) {
+ return {
+ evaluate: async () => ({ result: {} }),
+ getFrameScopes: async () => {},
+ getFrames: async () => [],
+ sourceContents: async () => ({
+ source: "",
+ contentType: "text/javascript",
+ }),
+ getSourceActorBreakpointPositions: async () => ({}),
+ getSourceActorBreakableLines: async () => [],
+ evaluateExpressions: async () => [],
+ loadObjectProperties: async () => ({}),
+ ...overrides,
+ };
+}
+
+function dispatchSetPreview(dispatch, context, expression, target) {
+ return dispatch(
+ actions.setPreview(
+ context,
+ expression,
+ {
+ start: { url: "foo.js", line: 1, column: 2 },
+ end: { url: "foo.js", line: 1, column: 5 },
+ },
+ { line: 2, column: 3 },
+ target.getBoundingClientRect(),
+ target
+ )
+ );
+}
+
+async function pause(store, client) {
+ const { dispatch, cx, getState } = store;
+ const source = makeSource("base.js");
+ const base = await dispatch(actions.newGeneratedSource(source));
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ base.id
+ );
+
+ await dispatch(actions.selectSource(cx, base, sourceActor));
+ const location = createLocation({ source: base, sourceActor });
+ await waitForState(store, state => selectors.getSymbols(state, location));
+
+ const { thread } = cx;
+ const frames = [makeFrame({ id: "frame1", sourceId: base.id, thread })];
+ client.getFrames = async () => frames;
+
+ await dispatch(
+ actions.paused({
+ thread,
+ frame: frames[0],
+ loadedObjects: [],
+ why: { type: "debuggerStatement" },
+ })
+ );
+}
+
+describe("preview", () => {
+ it("should generate previews", async () => {
+ const store = createStore(mockThreadFront());
+ const { dispatch, getState, cx } = store;
+ const source = makeSource("base.js");
+ const base = await dispatch(actions.newGeneratedSource(source));
+
+ await dispatch(actions.selectSource(cx, base));
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ base.id
+ );
+ const location = createLocation({ source: base, sourceActor });
+
+ await waitForState(store, state => selectors.getSymbols(state, location));
+ const frames = [makeFrame({ id: "f1", sourceId: base.id })];
+
+ await dispatch(
+ actions.paused({
+ thread: store.cx.thread,
+ frame: frames[0],
+ frames,
+ loadedObjects: [],
+ why: { type: "debuggerStatement" },
+ })
+ );
+
+ const newCx = selectors.getContext(getState());
+ const firstTarget = document.createElement("div");
+
+ dispatchSetPreview(dispatch, newCx, "foo", firstTarget);
+
+ expect(selectors.getPreview(getState())).toMatchSnapshot();
+ });
+
+ // When a 2nd setPreview is called before a 1st setPreview dispatches
+ // and the 2nd setPreview has not dispatched yet,
+ // the first setPreview should not finish dispatching
+ it("queued previews (w/ the 1st finishing first)", async () => {
+ let resolveFirst, resolveSecond;
+ const promises = [
+ new Promise(resolve => {
+ resolveFirst = resolve;
+ }),
+ new Promise(resolve => {
+ resolveSecond = resolve;
+ }),
+ ];
+
+ const client = mockThreadFront({
+ loadObjectProperties: () => promises.shift(),
+ });
+ const store = createStore(client);
+
+ const { dispatch, getState } = store;
+ await pause(store, client);
+
+ const newCx = selectors.getContext(getState());
+ const firstTarget = document.createElement("div");
+ const secondTarget = document.createElement("div");
+
+ // Start the dispatch of the first setPreview. At this point, it will not
+ // finish execution until we resolve the firstSetPreview
+ dispatchSetPreview(dispatch, newCx, "firstSetPreview", firstTarget);
+
+ // Start the dispatch of the second setPreview. At this point, it will not
+ // finish execution until we resolve the secondSetPreview
+ dispatchSetPreview(dispatch, newCx, "secondSetPreview", secondTarget);
+
+ let fail = false;
+
+ resolveFirst();
+ waitForPreview(store, "firstSetPreview").then(() => {
+ fail = true;
+ });
+
+ resolveSecond();
+ await waitForPreview(store, "secondSetPreview");
+ expect(fail).toEqual(false);
+
+ const preview = selectors.getPreview(getState());
+ expect(preview && preview.expression).toEqual("secondSetPreview");
+ });
+
+ // When a 2nd setPreview is called before a 1st setPreview dispatches
+ // and the 2nd setPreview has dispatched,
+ // the first setPreview should not finish dispatching
+ it("queued previews (w/ the 2nd finishing first)", async () => {
+ let resolveFirst, resolveSecond;
+ const promises = [
+ new Promise(resolve => {
+ resolveFirst = resolve;
+ }),
+ new Promise(resolve => {
+ resolveSecond = resolve;
+ }),
+ ];
+
+ const client = mockThreadFront({
+ loadObjectProperties: () => promises.shift(),
+ });
+ const store = createStore(client);
+
+ const { dispatch, getState } = store;
+ await pause(store, client);
+
+ const cx = selectors.getThreadContext(getState());
+ const firstTarget = document.createElement("div");
+ const secondTarget = document.createElement("div");
+
+ // Start the dispatch of the first setPreview. At this point, it will not
+ // finish execution until we resolve the firstSetPreview
+ dispatchSetPreview(dispatch, cx, "firstSetPreview", firstTarget);
+
+ // Start the dispatch of the second setPreview. At this point, it will not
+ // finish execution until we resolve the secondSetPreview
+ dispatchSetPreview(dispatch, cx, "secondSetPreview", secondTarget);
+
+ let fail = false;
+
+ resolveSecond();
+ await waitForPreview(store, "secondSetPreview");
+
+ resolveFirst();
+ waitForPreview(store, "firstSetPreview").then(() => {
+ fail = true;
+ });
+
+ await waitATick(() => expect(fail).toEqual(false));
+
+ const preview = selectors.getPreview(getState());
+ expect(preview && preview.expression).toEqual("secondSetPreview");
+ });
+});
diff --git a/devtools/client/debugger/src/actions/tests/sources-tree.spec.js b/devtools/client/debugger/src/actions/tests/sources-tree.spec.js
new file mode 100644
index 0000000000..916b2d015b
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/sources-tree.spec.js
@@ -0,0 +1,17 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { actions, selectors, createStore } from "../../utils/test-head";
+const { getExpandedState } = selectors;
+
+describe("source tree", () => {
+ it("should set the expanded state", () => {
+ const { dispatch, getState } = createStore();
+ const expandedState = new Set(["foo", "bar"]);
+
+ expect(getExpandedState(getState())).toEqual(new Set([]));
+ dispatch(actions.setExpandedState(expandedState));
+ expect(getExpandedState(getState())).toEqual(expandedState);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/tests/tabs.spec.js b/devtools/client/debugger/src/actions/tests/tabs.spec.js
new file mode 100644
index 0000000000..419e5b7e60
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/tabs.spec.js
@@ -0,0 +1,187 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ actions,
+ selectors,
+ createStore,
+ makeSource,
+} from "../../utils/test-head";
+const { getSelectedSource, getSourceTabs } = selectors;
+import { createLocation } from "../../utils/location";
+
+import { mockCommandClient } from "./helpers/mockCommandClient";
+
+describe("closing tabs", () => {
+ it("closing a tab", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ dispatch(actions.closeTab(cx, fooSource));
+
+ expect(getSelectedSource(getState())).toBe(undefined);
+ expect(getSourceTabs(getState())).toHaveLength(0);
+ });
+
+ it("closing the inactive tab", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const barSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: barSource, line: 1 }))
+ );
+ dispatch(actions.closeTab(cx, fooSource));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("bar.js");
+ expect(getSourceTabs(getState())).toHaveLength(1);
+ });
+
+ it("closing the only tab", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ dispatch(actions.closeTab(cx, fooSource));
+
+ expect(getSelectedSource(getState())).toBe(undefined);
+ expect(getSourceTabs(getState())).toHaveLength(0);
+ });
+
+ it("closing the active tab", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const barSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: barSource, line: 1 }))
+ );
+ await dispatch(actions.closeTab(cx, barSource));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("foo.js");
+ expect(getSourceTabs(getState())).toHaveLength(1);
+ });
+
+ it("closing many inactive tabs", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const barSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ const bazzSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bazz.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: barSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({ source: bazzSource, line: 1 })
+ )
+ );
+
+ const tabs = [
+ "http://localhost:8000/examples/foo.js",
+ "http://localhost:8000/examples/bar.js",
+ ];
+ dispatch(actions.closeTabs(cx, tabs));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("bazz.js");
+ expect(getSourceTabs(getState())).toHaveLength(1);
+ });
+
+ it("closing many tabs including the active tab", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const barSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ const bazzSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bazz.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: barSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(
+ cx,
+ createLocation({ source: bazzSource, line: 1 })
+ )
+ );
+ const tabs = [
+ "http://localhost:8000/examples/bar.js",
+ "http://localhost:8000/examples/bazz.js",
+ ];
+ await dispatch(actions.closeTabs(cx, tabs));
+
+ const selected = getSelectedSource(getState());
+ expect(selected && selected.id).toBe("foo.js");
+ expect(getSourceTabs(getState())).toHaveLength(1);
+ });
+
+ it("closing all the tabs", async () => {
+ const { dispatch, getState, cx } = createStore(mockCommandClient);
+
+ const fooSource = await dispatch(
+ actions.newGeneratedSource(makeSource("foo.js"))
+ );
+ const barSource = await dispatch(
+ actions.newGeneratedSource(makeSource("bar.js"))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: fooSource, line: 1 }))
+ );
+ await dispatch(
+ actions.selectLocation(cx, createLocation({ source: barSource, line: 1 }))
+ );
+ await dispatch(
+ actions.closeTabs(cx, [
+ "http://localhost:8000/examples/foo.js",
+ "http://localhost:8000/examples/bar.js",
+ ])
+ );
+
+ expect(getSelectedSource(getState())).toBe(undefined);
+ expect(getSourceTabs(getState())).toHaveLength(0);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/tests/ui.spec.js b/devtools/client/debugger/src/actions/tests/ui.spec.js
new file mode 100644
index 0000000000..0e13681a12
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tests/ui.spec.js
@@ -0,0 +1,90 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ createStore,
+ selectors,
+ actions,
+ makeSource,
+} from "../../utils/test-head";
+import { createLocation } from "../../utils/location";
+import { mockCommandClient } from "./helpers/mockCommandClient";
+
+const {
+ getActiveSearch,
+ getFrameworkGroupingState,
+ getPaneCollapse,
+ getHighlightedLineRangeForSelectedSource,
+} = selectors;
+
+describe("ui", () => {
+ it("should toggle the visible state of file search", () => {
+ const { dispatch, getState } = createStore();
+ expect(getActiveSearch(getState())).toBe(null);
+ dispatch(actions.setActiveSearch("file"));
+ expect(getActiveSearch(getState())).toBe("file");
+ });
+
+ it("should close file search", () => {
+ const { dispatch, getState } = createStore();
+ expect(getActiveSearch(getState())).toBe(null);
+ dispatch(actions.setActiveSearch("file"));
+ dispatch(actions.closeActiveSearch());
+ expect(getActiveSearch(getState())).toBe(null);
+ });
+
+ it("should toggle the collapse state of a pane", () => {
+ const { dispatch, getState } = createStore();
+ expect(getPaneCollapse(getState(), "start")).toBe(false);
+ dispatch(actions.togglePaneCollapse("start", true));
+ expect(getPaneCollapse(getState(), "start")).toBe(true);
+ });
+
+ it("should toggle the collapsed state of frameworks in the callstack", () => {
+ const { dispatch, getState } = createStore();
+ const currentState = getFrameworkGroupingState(getState());
+ dispatch(actions.toggleFrameworkGrouping(!currentState));
+ expect(getFrameworkGroupingState(getState())).toBe(!currentState);
+ });
+
+ it("should highlight lines", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+ const base = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ base.id
+ );
+ const cx = selectors.getThreadContext(getState());
+ //await dispatch(actions.selectSource(cx, base, sourceActor));
+ const location = createLocation({
+ source: base,
+ line: 1,
+ sourceActor,
+ });
+ await dispatch(actions.selectLocation(cx, location));
+
+ const range = { start: 3, end: 5, sourceId: base.id };
+ dispatch(actions.highlightLineRange(range));
+ expect(getHighlightedLineRangeForSelectedSource(getState())).toEqual(range);
+ });
+
+ it("should clear highlight lines", async () => {
+ const { dispatch, getState } = createStore(mockCommandClient);
+ const base = await dispatch(
+ actions.newGeneratedSource(makeSource("base.js"))
+ );
+ const sourceActor = selectors.getFirstSourceActorForGeneratedSource(
+ getState(),
+ base.id
+ );
+ const cx = selectors.getThreadContext(getState());
+ await dispatch(actions.selectSource(cx, base, sourceActor));
+ const range = { start: 3, end: 5, sourceId: "2" };
+ dispatch(actions.highlightLineRange(range));
+ dispatch(actions.clearHighlightLineRange());
+ expect(getHighlightedLineRangeForSelectedSource(getState())).toEqual(null);
+ });
+});
diff --git a/devtools/client/debugger/src/actions/threads.js b/devtools/client/debugger/src/actions/threads.js
new file mode 100644
index 0000000000..13f53e7c67
--- /dev/null
+++ b/devtools/client/debugger/src/actions/threads.js
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { createThread } from "../client/firefox/create";
+import { getSourcesToRemoveForThread } from "../selectors";
+
+export function addTarget(targetFront) {
+ return { type: "INSERT_THREAD", newThread: createThread(targetFront) };
+}
+
+export function removeTarget(targetFront) {
+ return ({ getState, dispatch }) => {
+ const threadActorID = targetFront.targetForm.threadActor;
+
+ // Just before emitting the REMOVE_THREAD action,
+ // synchronously compute the list of source and source actor objects
+ // which should be removed as that one target get removed.
+ //
+ // The list of source objects isn't trivial to compute as these objects
+ // are shared across targets/threads.
+ const { actors, sources } = getSourcesToRemoveForThread(
+ getState(),
+ threadActorID
+ );
+
+ dispatch({
+ type: "REMOVE_THREAD",
+ threadActorID,
+ actors,
+ sources,
+ });
+ };
+}
+
+export function toggleJavaScriptEnabled(enabled) {
+ return async ({ dispatch, client }) => {
+ await client.toggleJavaScriptEnabled(enabled);
+ dispatch({
+ type: "TOGGLE_JAVASCRIPT_ENABLED",
+ value: enabled,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/toolbox.js b/devtools/client/debugger/src/actions/toolbox.js
new file mode 100644
index 0000000000..a343c92863
--- /dev/null
+++ b/devtools/client/debugger/src/actions/toolbox.js
@@ -0,0 +1,43 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * @memberof actions/toolbox
+ * @static
+ */
+export function openLink(url) {
+ return async function ({ panel }) {
+ return panel.openLink(url);
+ };
+}
+
+export function evaluateInConsole(inputString) {
+ return async ({ panel }) => {
+ return panel.openConsoleAndEvaluate(inputString);
+ };
+}
+
+export function openElementInInspectorCommand(grip) {
+ return async ({ panel }) => {
+ return panel.openElementInInspector(grip);
+ };
+}
+
+export function openInspector(grip) {
+ return async ({ panel }) => {
+ return panel.openInspector();
+ };
+}
+
+export function highlightDomElement(grip) {
+ return async ({ panel }) => {
+ return panel.highlightDomElement(grip);
+ };
+}
+
+export function unHighlightDomElement(grip) {
+ return async ({ panel }) => {
+ return panel.unHighlightDomElement(grip);
+ };
+}
diff --git a/devtools/client/debugger/src/actions/tracing.js b/devtools/client/debugger/src/actions/tracing.js
new file mode 100644
index 0000000000..9cbe7bc20e
--- /dev/null
+++ b/devtools/client/debugger/src/actions/tracing.js
@@ -0,0 +1,49 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { getIsThreadCurrentlyTracing, getAllThreads } from "../selectors";
+import { PROMISE } from "./utils/middleware/promise";
+
+/**
+ * Toggle ON/OFF Javascript tracing for all targets,
+ * using the specified log method.
+ *
+ * @param {string} logMethod
+ * Can be "stdout" or "console". See TracerActor.
+ */
+export function toggleTracing(logMethod) {
+ return async ({ dispatch, getState, client, panel }) => {
+ // Check if any of the thread is currently tracing.
+ // For now, the UI can only toggle all the targets all at once.
+ const threads = getAllThreads(getState());
+ const isTracingEnabled = threads.some(thread =>
+ getIsThreadCurrentlyTracing(getState(), thread.actor)
+ );
+
+ // Automatically open the split console when enabling tracing to the console
+ if (!isTracingEnabled && logMethod == "console") {
+ await panel.toolbox.openSplitConsole({ focusConsoleInput: false });
+ }
+
+ return dispatch({
+ type: "TOGGLE_TRACING",
+ [PROMISE]: isTracingEnabled
+ ? client.stopTracing()
+ : client.startTracing(logMethod),
+ });
+ };
+}
+
+/**
+ * Called when tracing is toggled ON/OFF on a particular thread.
+ */
+export function tracingToggled(thread, enabled) {
+ return ({ dispatch }) => {
+ dispatch({
+ type: "TRACING_TOGGLED",
+ thread,
+ enabled,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/ui.js b/devtools/client/debugger/src/actions/ui.js
new file mode 100644
index 0000000000..67b2629135
--- /dev/null
+++ b/devtools/client/debugger/src/actions/ui.js
@@ -0,0 +1,290 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ getActiveSearch,
+ getPaneCollapse,
+ getQuickOpenEnabled,
+ getSource,
+ getSourceContent,
+ getMainThread,
+ getIgnoreListSourceUrls,
+ getSourceByURL,
+ getBreakpointsForSource,
+} from "../selectors";
+import { selectSource } from "../actions/sources/select";
+import {
+ getEditor,
+ getLocationsInViewport,
+ updateDocuments,
+} from "../utils/editor";
+import { blackboxSourceActorsForSource } from "./sources/blackbox";
+import { toggleBreakpoints } from "./breakpoints";
+import { copyToTheClipboard } from "../utils/clipboard";
+import { isFulfilled } from "../utils/async-value";
+import { primaryPaneTabs } from "../constants";
+
+export function setPrimaryPaneTab(tabName) {
+ return { type: "SET_PRIMARY_PANE_TAB", tabName };
+}
+
+export function closeActiveSearch() {
+ return {
+ type: "TOGGLE_ACTIVE_SEARCH",
+ value: null,
+ };
+}
+
+export function setActiveSearch(activeSearch) {
+ return ({ dispatch, getState }) => {
+ const activeSearchState = getActiveSearch(getState());
+ if (activeSearchState === activeSearch) {
+ return;
+ }
+
+ if (getQuickOpenEnabled(getState())) {
+ dispatch({ type: "CLOSE_QUICK_OPEN" });
+ }
+
+ // Open start panel if it was collapsed so the project search UI is visible
+ if (
+ activeSearch === primaryPaneTabs.PROJECT_SEARCH &&
+ getPaneCollapse(getState(), "start")
+ ) {
+ dispatch({
+ type: "TOGGLE_PANE",
+ position: "start",
+ paneCollapsed: false,
+ });
+ }
+
+ dispatch({
+ type: "TOGGLE_ACTIVE_SEARCH",
+ value: activeSearch,
+ });
+ };
+}
+
+export function toggleFrameworkGrouping(toggleValue) {
+ return ({ dispatch, getState }) => {
+ dispatch({
+ type: "TOGGLE_FRAMEWORK_GROUPING",
+ value: toggleValue,
+ });
+ };
+}
+
+export function toggleInlinePreview(toggleValue) {
+ return ({ dispatch, getState }) => {
+ dispatch({
+ type: "TOGGLE_INLINE_PREVIEW",
+ value: toggleValue,
+ });
+ };
+}
+
+export function toggleEditorWrapping(toggleValue) {
+ return ({ dispatch, getState }) => {
+ updateDocuments(doc => doc.cm.setOption("lineWrapping", toggleValue));
+
+ dispatch({
+ type: "TOGGLE_EDITOR_WRAPPING",
+ value: toggleValue,
+ });
+ };
+}
+
+export function toggleSourceMapsEnabled(toggleValue) {
+ return ({ dispatch, getState }) => {
+ dispatch({
+ type: "TOGGLE_SOURCE_MAPS_ENABLED",
+ value: toggleValue,
+ });
+ };
+}
+
+export function showSource(cx, sourceId) {
+ return ({ dispatch, getState }) => {
+ const source = getSource(getState(), sourceId);
+ if (!source) {
+ return;
+ }
+
+ if (getPaneCollapse(getState(), "start")) {
+ dispatch({
+ type: "TOGGLE_PANE",
+ position: "start",
+ paneCollapsed: false,
+ });
+ }
+
+ dispatch(setPrimaryPaneTab("sources"));
+
+ dispatch(selectSource(cx, source));
+ };
+}
+
+export function togglePaneCollapse(position, paneCollapsed) {
+ return ({ dispatch, getState }) => {
+ const prevPaneCollapse = getPaneCollapse(getState(), position);
+ if (prevPaneCollapse === paneCollapsed) {
+ return;
+ }
+
+ // Set active search to null when closing start panel if project search was active
+ if (
+ position === "start" &&
+ paneCollapsed &&
+ getActiveSearch(getState()) === primaryPaneTabs.PROJECT_SEARCH
+ ) {
+ dispatch(closeActiveSearch());
+ }
+
+ dispatch({
+ type: "TOGGLE_PANE",
+ position,
+ paneCollapsed,
+ });
+ };
+}
+
+/**
+ * Highlight one or many lines in CodeMirror for a given source.
+ *
+ * @param {Object} location
+ * @param {String} location.sourceId
+ * The precise source to highlight.
+ * @param {Number} location.start
+ * The 1-based index of first line to highlight.
+ * @param {Number} location.end
+ * The 1-based index of last line to highlight.
+ */
+export function highlightLineRange(location) {
+ return {
+ type: "HIGHLIGHT_LINES",
+ location,
+ };
+}
+
+export function flashLineRange(location) {
+ return ({ dispatch }) => {
+ dispatch(highlightLineRange(location));
+ setTimeout(() => dispatch(clearHighlightLineRange()), 200);
+ };
+}
+
+export function clearHighlightLineRange() {
+ return {
+ type: "CLEAR_HIGHLIGHT_LINES",
+ };
+}
+
+export function openConditionalPanel(location, log = false) {
+ if (!location) {
+ return null;
+ }
+
+ return {
+ type: "OPEN_CONDITIONAL_PANEL",
+ location,
+ log,
+ };
+}
+
+export function closeConditionalPanel() {
+ return {
+ type: "CLOSE_CONDITIONAL_PANEL",
+ };
+}
+
+export function clearProjectDirectoryRoot(cx) {
+ return {
+ type: "SET_PROJECT_DIRECTORY_ROOT",
+ cx,
+ url: "",
+ name: "",
+ };
+}
+
+export function setProjectDirectoryRoot(cx, newRoot, newName) {
+ return ({ dispatch, getState }) => {
+ // If the new project root is against the top level thread,
+ // replace its thread ID with "top-level", so that later,
+ // getDirectoryForUniquePath could match the project root,
+ // even after a page reload where the new top level thread actor ID
+ // will be different.
+ const mainThread = getMainThread(getState());
+ if (mainThread && newRoot.startsWith(mainThread.actor)) {
+ newRoot = newRoot.replace(mainThread.actor, "top-level");
+ }
+ dispatch({
+ type: "SET_PROJECT_DIRECTORY_ROOT",
+ cx,
+ url: newRoot,
+ name: newName,
+ });
+ };
+}
+
+export function updateViewport() {
+ return {
+ type: "SET_VIEWPORT",
+ viewport: getLocationsInViewport(getEditor()),
+ };
+}
+
+export function updateCursorPosition(cursorPosition) {
+ return { type: "SET_CURSOR_POSITION", cursorPosition };
+}
+
+export function setOrientation(orientation) {
+ return { type: "SET_ORIENTATION", orientation };
+}
+
+export function setSearchOptions(searchKey, searchOptions) {
+ return { type: "SET_SEARCH_OPTIONS", searchKey, searchOptions };
+}
+
+export function copyToClipboard(location) {
+ return ({ dispatch, getState }) => {
+ const content = getSourceContent(getState(), location);
+ if (content && isFulfilled(content) && content.value.type === "text") {
+ copyToTheClipboard(content.value.value);
+ }
+ };
+}
+
+export function setJavascriptTracingLogMethod(value) {
+ return ({ dispatch, getState }) => {
+ dispatch({
+ type: "SET_JAVASCRIPT_TRACING_LOG_METHOD",
+ value,
+ });
+ };
+}
+
+export function setHideOrShowIgnoredSources(shouldHide) {
+ return ({ dispatch, getState }) => {
+ dispatch({ type: "HIDE_IGNORED_SOURCES", shouldHide });
+ };
+}
+
+export function toggleSourceMapIgnoreList(cx, shouldEnable) {
+ return async thunkArgs => {
+ const { dispatch, getState } = thunkArgs;
+ const ignoreListSourceUrls = getIgnoreListSourceUrls(getState());
+ // Blackbox the source actors on the server
+ for (const url of ignoreListSourceUrls) {
+ const source = getSourceByURL(getState(), url);
+ await blackboxSourceActorsForSource(thunkArgs, source, shouldEnable);
+ // Disable breakpoints in sources on the ignore list
+ const breakpoints = getBreakpointsForSource(getState(), source.id);
+ await dispatch(toggleBreakpoints(cx, shouldEnable, breakpoints));
+ }
+ await dispatch({
+ type: "ENABLE_SOURCEMAP_IGNORELIST",
+ shouldEnable,
+ });
+ };
+}
diff --git a/devtools/client/debugger/src/actions/utils/create-store.js b/devtools/client/debugger/src/actions/utils/create-store.js
new file mode 100644
index 0000000000..9527c67afc
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/create-store.js
@@ -0,0 +1,72 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/* global window */
+
+/**
+ * Redux store utils
+ * @module utils/create-store
+ */
+
+import { createStore, applyMiddleware } from "redux";
+import { waitUntilService } from "./middleware/wait-service";
+import { log } from "./middleware/log";
+import { promise } from "./middleware/promise";
+import { thunk } from "./middleware/thunk";
+import { timing } from "./middleware/timing";
+import { context } from "./middleware/context";
+
+/**
+ * @memberof utils/create-store
+ * @static
+ */
+
+/**
+ * This creates a dispatcher with all the standard middleware in place
+ * that all code requires. It can also be optionally configured in
+ * various ways, such as logging and recording.
+ *
+ * @param {object} opts:
+ * - log: log all dispatched actions to console
+ * - history: an array to store every action in. Should only be
+ * used in tests.
+ * - middleware: array of middleware to be included in the redux store
+ * @memberof utils/create-store
+ * @static
+ */
+const configureStore = (opts = {}) => {
+ const middleware = [
+ thunk(opts.makeThunkArgs),
+ context,
+ promise,
+
+ // Order is important: services must go last as they always
+ // operate on "already transformed" actions. Actions going through
+ // them shouldn't have any special fields like promises, they
+ // should just be normal JSON objects.
+ waitUntilService,
+ ];
+
+ if (opts.middleware) {
+ opts.middleware.forEach(fn => middleware.push(fn));
+ }
+
+ if (opts.log) {
+ middleware.push(log);
+ }
+
+ if (opts.timing) {
+ middleware.push(timing);
+ }
+
+ // Hook in the redux devtools browser extension if it exists
+ const devtoolsExt =
+ typeof window === "object" && window.devToolsExtension
+ ? window.devToolsExtension()
+ : f => f;
+
+ return applyMiddleware(...middleware)(devtoolsExt(createStore));
+};
+
+export default configureStore;
diff --git a/devtools/client/debugger/src/actions/utils/middleware/context.js b/devtools/client/debugger/src/actions/utils/middleware/context.js
new file mode 100644
index 0000000000..ebadaa4eff
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/context.js
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ validateNavigateContext,
+ validateContext,
+} from "../../../utils/context";
+
+function validateActionContext(getState, action) {
+ if (action.type == "COMMAND" && action.status == "done") {
+ // The thread will have resumed execution since the action was initiated,
+ // so just make sure we haven't navigated.
+ validateNavigateContext(getState(), action.cx);
+ return;
+ }
+
+ // Validate using all available information in the context.
+ validateContext(getState(), action.cx);
+}
+
+// Middleware which looks for actions that have a cx property and ignores
+// them if the context is no longer valid.
+function context({ dispatch, getState }) {
+ return next => action => {
+ if ("cx" in action) {
+ validateActionContext(getState, action);
+ }
+ return next(action);
+ };
+}
+
+export { context };
diff --git a/devtools/client/debugger/src/actions/utils/middleware/log.js b/devtools/client/debugger/src/actions/utils/middleware/log.js
new file mode 100644
index 0000000000..b9592ce22c
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/log.js
@@ -0,0 +1,111 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import flags from "devtools/shared/flags";
+import { prefs } from "../../../utils/prefs";
+
+const ignoreList = [
+ "ADD_BREAKPOINT_POSITIONS",
+ "SET_SYMBOLS",
+ "OUT_OF_SCOPE_LOCATIONS",
+ "MAP_SCOPES",
+ "MAP_FRAMES",
+ "ADD_SCOPES",
+ "IN_SCOPE_LINES",
+ "REMOVE_BREAKPOINT",
+ "NODE_PROPERTIES_LOADED",
+ "SET_FOCUSED_SOURCE_ITEM",
+ "NODE_EXPAND",
+ "IN_SCOPE_LINES",
+ "SET_PREVIEW",
+];
+
+function cloneAction(action) {
+ action = action || {};
+ action = { ...action };
+
+ // ADD_TAB, ...
+ if (action.source?.text) {
+ const source = { ...action.source, text: "" };
+ action.source = source;
+ }
+
+ if (action.sources) {
+ const sources = action.sources.slice(0, 20).map(source => {
+ const url = !source.url || source.url.includes("data:") ? "" : source.url;
+ return { ...source, url };
+ });
+ action.sources = sources;
+ }
+
+ // LOAD_SOURCE_TEXT
+ if (action.text) {
+ action.text = "";
+ }
+
+ if (action.value?.text) {
+ const value = { ...action.value, text: "" };
+ action.value = value;
+ }
+
+ return action;
+}
+
+function formatPause(pause) {
+ return {
+ ...pause,
+ pauseInfo: { why: pause.why },
+ scopes: [],
+ loadedObjects: [],
+ };
+}
+
+function serializeAction(action) {
+ try {
+ action = cloneAction(action);
+ if (ignoreList.includes(action.type)) {
+ action = {};
+ }
+
+ if (action.type === "PAUSED") {
+ action = formatPause(action);
+ }
+
+ const serializer = function (key, value) {
+ // Serialize Object/LongString fronts
+ if (value?.getGrip) {
+ return value.getGrip();
+ }
+ return value;
+ };
+
+ // dump(`> ${action.type}...\n ${JSON.stringify(action, serializer)}\n`);
+ return JSON.stringify(action, serializer);
+ } catch (e) {
+ console.error(e);
+ return "";
+ }
+}
+
+/**
+ * A middleware that logs all actions coming through the system
+ * to the console.
+ */
+export function log({ dispatch, getState }) {
+ return next => action => {
+ const asyncMsg = !action.status ? "" : `[${action.status}]`;
+
+ if (prefs.logActions) {
+ if (flags.testing) {
+ dump(
+ `[ACTION] ${action.type} ${asyncMsg} - ${serializeAction(action)}\n`
+ );
+ } else {
+ console.log(action, asyncMsg);
+ }
+ }
+
+ next(action);
+ };
+}
diff --git a/devtools/client/debugger/src/actions/utils/middleware/moz.build b/devtools/client/debugger/src/actions/utils/middleware/moz.build
new file mode 100644
index 0000000000..f46a0bb725
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/moz.build
@@ -0,0 +1,15 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "context.js",
+ "log.js",
+ "promise.js",
+ "thunk.js",
+ "timing.js",
+ "wait-service.js",
+)
diff --git a/devtools/client/debugger/src/actions/utils/middleware/promise.js b/devtools/client/debugger/src/actions/utils/middleware/promise.js
new file mode 100644
index 0000000000..52054a1fcc
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/promise.js
@@ -0,0 +1,61 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { executeSoon } from "../../../utils/DevToolsUtils";
+
+import { pending, rejected, fulfilled } from "../../../utils/async-value";
+export function asyncActionAsValue(action) {
+ if (action.status === "start") {
+ return pending();
+ }
+ if (action.status === "error") {
+ return rejected(action.error);
+ }
+ return fulfilled(action.value);
+}
+
+let seqIdVal = 1;
+
+function seqIdGen() {
+ return seqIdVal++;
+}
+
+function promiseMiddleware({ dispatch, getState }) {
+ return next => action => {
+ if (!(PROMISE in action)) {
+ return next(action);
+ }
+
+ const seqId = seqIdGen().toString();
+ const { [PROMISE]: promiseInst, ...originalActionProperties } = action;
+
+ // Create a new action that doesn't have the promise field and has
+ // the `seqId` field that represents the sequence id
+ action = { ...originalActionProperties, seqId };
+
+ dispatch({ ...action, status: "start" });
+
+ // Return the promise so action creators can still compose if they
+ // want to.
+ return Promise.resolve(promiseInst)
+ .finally(() => new Promise(resolve => executeSoon(resolve)))
+ .then(
+ value => {
+ dispatch({ ...action, status: "done", value: value });
+ return value;
+ },
+ error => {
+ dispatch({
+ ...action,
+ status: "error",
+ error: error.message || error,
+ });
+ return Promise.reject(error);
+ }
+ );
+ };
+}
+
+export const PROMISE = "@@dispatch/promise";
+export { promiseMiddleware as promise };
diff --git a/devtools/client/debugger/src/actions/utils/middleware/thunk.js b/devtools/client/debugger/src/actions/utils/middleware/thunk.js
new file mode 100644
index 0000000000..fba17d516c
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/thunk.js
@@ -0,0 +1,22 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * A middleware that allows thunks (functions) to be dispatched. If
+ * it's a thunk, it is called with an argument that contains
+ * `dispatch`, `getState`, and any additional args passed in via the
+ * middleware constructure. This allows the action to create multiple
+ * actions (most likely asynchronously).
+ */
+export function thunk(makeArgs) {
+ return ({ dispatch, getState }) => {
+ const args = { dispatch, getState };
+
+ return next => action => {
+ return typeof action === "function"
+ ? action(makeArgs ? makeArgs(args, getState()) : args)
+ : next(action);
+ };
+ };
+}
diff --git a/devtools/client/debugger/src/actions/utils/middleware/timing.js b/devtools/client/debugger/src/actions/utils/middleware/timing.js
new file mode 100644
index 0000000000..d0bfa05977
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/timing.js
@@ -0,0 +1,26 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Redux middleware that sets performance markers for all actions such that they
+ * will appear in performance tooling under the User Timing API
+ */
+
+const mark = window.performance?.mark
+ ? window.performance.mark.bind(window.performance)
+ : a => {};
+
+const measure = window.performance?.measure
+ ? window.performance.measure.bind(window.performance)
+ : (a, b, c) => {};
+
+export function timing(store) {
+ return next => action => {
+ mark(`${action.type}_start`);
+ const result = next(action);
+ mark(`${action.type}_end`);
+ measure(`${action.type}`, `${action.type}_start`, `${action.type}_end`);
+ return result;
+ };
+}
diff --git a/devtools/client/debugger/src/actions/utils/middleware/wait-service.js b/devtools/client/debugger/src/actions/utils/middleware/wait-service.js
new file mode 100644
index 0000000000..337df7e336
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/middleware/wait-service.js
@@ -0,0 +1,62 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * A middleware which acts like a service, because it is stateful
+ * and "long-running" in the background. It provides the ability
+ * for actions to install a function to be run once when a specific
+ * condition is met by an action coming through the system. Think of
+ * it as a thunk that blocks until the condition is met. Example:
+ *
+ * ```js
+ * const services = { WAIT_UNTIL: require('wait-service').NAME };
+ *
+ * { type: services.WAIT_UNTIL,
+ * predicate: action => action.type === "ADD_ITEM",
+ * run: (dispatch, getState, action) => {
+ * // Do anything here. You only need to accept the arguments
+ * // if you need them. `action` is the action that satisfied
+ * // the predicate.
+ * }
+ * }
+ * ```
+ */
+export const NAME = "@@service/waitUntil";
+
+export function waitUntilService({ dispatch, getState }) {
+ let pending = [];
+
+ function checkPending(action) {
+ const readyRequests = [];
+ const stillPending = [];
+
+ // Find the pending requests whose predicates are satisfied with
+ // this action. Wait to run the requests until after we update the
+ // pending queue because the request handler may synchronously
+ // dispatch again and run this service (that use case is
+ // completely valid).
+ for (const request of pending) {
+ if (request.predicate(action)) {
+ readyRequests.push(request);
+ } else {
+ stillPending.push(request);
+ }
+ }
+
+ pending = stillPending;
+ for (const request of readyRequests) {
+ request.run(dispatch, getState, action);
+ }
+ }
+
+ return next => action => {
+ if (action.type === NAME) {
+ pending.push(action);
+ return null;
+ }
+ const result = next(action);
+ checkPending(action);
+ return result;
+ };
+}
diff --git a/devtools/client/debugger/src/actions/utils/moz.build b/devtools/client/debugger/src/actions/utils/moz.build
new file mode 100644
index 0000000000..08a43a218c
--- /dev/null
+++ b/devtools/client/debugger/src/actions/utils/moz.build
@@ -0,0 +1,12 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "middleware",
+]
+
+CompiledModules(
+ "create-store.js",
+)
diff --git a/devtools/client/debugger/src/client/README.md b/devtools/client/debugger/src/client/README.md
new file mode 100644
index 0000000000..4681a4e15e
--- /dev/null
+++ b/devtools/client/debugger/src/client/README.md
@@ -0,0 +1,47 @@
+# DevTools Client
+
+The DevTools client is responsible for managing the communication between the
+client application and JS server.
+
+- When the server sends a notification to the client, the client receives an
+ "event" and notifies the application via redux actions.
+- When the application, wants to send a command to the server, it invokes
+ "commands" in the client.
+
+The Debugger supports a Firefox and a Chrome client, which lets it attach and
+debug Firefox, Chrome, and Node contexts. The clients are defined in
+`src/client` and have an `onConnect` function, and a `commands` and `events`
+module.
+
+Both clients implement client adapters for translating commands and events into
+JSON packets. The chrome client debugger adapter is defined in
+[chrome-remote-interface][chrome-remote-interface]. The Firefox client is maintained in
+[devtools-client.js][devtools-client.js].
+
+## Firefox
+
+### Remote Debugger Protocol
+
+The [Remote Debugger Protocol][protocol] specifies the client / server API.
+
+### Interrupt
+
+When the client wants to add a breakpoint, it avoids race conditions by doing
+temporary pauses called interrupts.
+
+We want to do these interrupts transparently, so we've decided that the client
+should not notify the application that the thread has been paused or resumed.
+
+[protocol]: https://searchfox.org/mozilla-central/source/devtools/docs/backend/protocol.md
+[devtools-client.js]: https://searchfox.org/mozilla-central/source/devtools/client/devtools-client.js
+
+## Chrome
+
+### Chrome Debugger Protocol
+
+The chrome debugger protocol is available [here][devtools-protocol-viewer]. And
+is maintained in the devtools-protocol [repo][devtools-protocol-gh].
+
+[chrome-remote-interface]: https://github.com/cyrus-and/chrome-remote-interface
+[devtools-protocol-viewer]: https://chromedevtools.github.io/devtools-protocol/
+[devtools-protocol-gh]: https://github.com/ChromeDevTools/devtools-protocol
diff --git a/devtools/client/debugger/src/client/firefox.js b/devtools/client/debugger/src/client/firefox.js
new file mode 100644
index 0000000000..d66d168e37
--- /dev/null
+++ b/devtools/client/debugger/src/client/firefox.js
@@ -0,0 +1,215 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { setupCommands, clientCommands } from "./firefox/commands";
+import { setupCreate, createPause } from "./firefox/create";
+import { features } from "../utils/prefs";
+
+import { recordEvent } from "../utils/telemetry";
+import sourceQueue from "../utils/source-queue";
+import { getContext } from "../selectors";
+
+let actions;
+let commands;
+let targetCommand;
+let resourceCommand;
+
+export async function onConnect(_commands, _resourceCommand, _actions, store) {
+ actions = _actions;
+ commands = _commands;
+ targetCommand = _commands.targetCommand;
+ resourceCommand = _resourceCommand;
+
+ setupCommands(commands);
+ setupCreate({ store });
+
+ sourceQueue.initialize(actions);
+
+ const { descriptorFront } = commands;
+ const { targetFront } = targetCommand;
+
+ // For tab, browser and webextension toolboxes, we want to enable watching for
+ // worker targets as soon as the debugger is opened.
+ // And also for service workers, if the related experimental feature is enabled
+ if (
+ descriptorFront.isTabDescriptor ||
+ descriptorFront.isWebExtensionDescriptor ||
+ descriptorFront.isBrowserProcessDescriptor
+ ) {
+ targetCommand.listenForWorkers = true;
+ if (descriptorFront.isLocalTab && features.windowlessServiceWorkers) {
+ targetCommand.listenForServiceWorkers = true;
+ targetCommand.destroyServiceWorkersOnNavigation = true;
+ }
+ await targetCommand.startListening();
+ }
+
+ const options = {
+ // `pauseWorkersUntilAttach` is one option set when the debugger panel is opened rather that from the toolbox.
+ // The reason is to support early breakpoints in workers, which will force the workers to pause
+ // and later on (when TargetMixin.attachThread is called) resume worker execution, after passing the breakpoints.
+ // We only observe workers when the debugger panel is opened (see the few lines before and listenForWorkers = true).
+ // So if we were passing `pauseWorkersUntilAttach=true` from the toolbox code, workers would freeze as we would not watch
+ // for their targets and not resume them.
+ pauseWorkersUntilAttach: true,
+
+ // Bug 1719615 - Immediately turn on WASM debugging when the debugger opens.
+ // We avoid enabling that as soon as DevTools open as WASM generates different kind of machine code
+ // with debugging instruction which significantly increase the memory usage.
+ observeWasm: true,
+ };
+ await commands.threadConfigurationCommand.updateConfiguration(options);
+
+ // Select the top level target by default
+ await actions.selectThread(
+ getContext(store.getState()),
+ targetFront.threadFront.actor
+ );
+
+ await targetCommand.watchTargets({
+ types: targetCommand.ALL_TYPES,
+ onAvailable: onTargetAvailable,
+ onDestroyed: onTargetDestroyed,
+ });
+
+ // Use independant listeners for SOURCE and THREAD_STATE in order to ease
+ // doing batching and notify about a set of SOURCE's in one redux action.
+ await resourceCommand.watchResources([resourceCommand.TYPES.SOURCE], {
+ onAvailable: onSourceAvailable,
+ });
+ await resourceCommand.watchResources([resourceCommand.TYPES.THREAD_STATE], {
+ onAvailable: onThreadStateAvailable,
+ });
+ await resourceCommand.watchResources([resourceCommand.TYPES.TRACING_STATE], {
+ onAvailable: onTracingStateAvailable,
+ });
+
+ await resourceCommand.watchResources([resourceCommand.TYPES.ERROR_MESSAGE], {
+ onAvailable: actions.addExceptionFromResources,
+ });
+ await resourceCommand.watchResources([resourceCommand.TYPES.DOCUMENT_EVENT], {
+ onAvailable: onDocumentEventAvailable,
+ // we only care about future events for DOCUMENT_EVENT
+ ignoreExistingResources: true,
+ });
+}
+
+export function onDisconnect() {
+ targetCommand.unwatchTargets({
+ types: targetCommand.ALL_TYPES,
+ onAvailable: onTargetAvailable,
+ onDestroyed: onTargetDestroyed,
+ });
+ resourceCommand.unwatchResources([resourceCommand.TYPES.SOURCE], {
+ onAvailable: onSourceAvailable,
+ });
+ resourceCommand.unwatchResources([resourceCommand.TYPES.THREAD_STATE], {
+ onAvailable: onThreadStateAvailable,
+ });
+ resourceCommand.unwatchResources([resourceCommand.TYPES.TRACING_STATE], {
+ onAvailable: onTracingStateAvailable,
+ });
+ resourceCommand.unwatchResources([resourceCommand.TYPES.ERROR_MESSAGE], {
+ onAvailable: actions.addExceptionFromResources,
+ });
+ resourceCommand.unwatchResources([resourceCommand.TYPES.DOCUMENT_EVENT], {
+ onAvailable: onDocumentEventAvailable,
+ });
+ sourceQueue.clear();
+}
+
+async function onTargetAvailable({ targetFront, isTargetSwitching }) {
+ const isBrowserToolbox = commands.descriptorFront.isBrowserProcessDescriptor;
+ const isNonTopLevelFrameTarget =
+ !targetFront.isTopLevel &&
+ targetFront.targetType === targetCommand.TYPES.FRAME;
+
+ if (isBrowserToolbox && isNonTopLevelFrameTarget) {
+ // In the BrowserToolbox, non-top-level frame targets are already
+ // debugged via content-process targets.
+ // Do not attach the thread here, as it was already done by the
+ // corresponding content-process target.
+ return;
+ }
+
+ if (!targetFront.isTopLevel) {
+ await actions.addTarget(targetFront);
+ return;
+ }
+
+ // At this point, we expect the target and its thread to be attached.
+ const { threadFront } = targetFront;
+ if (!threadFront) {
+ console.error("The thread for", targetFront, "isn't attached.");
+ return;
+ }
+
+ // Retrieve possible event listener breakpoints
+ actions.getEventListenerBreakpointTypes().catch(e => console.error(e));
+
+ // Initialize the event breakpoints on the thread up front so that
+ // they are active once attached.
+ actions.addEventListenerBreakpoints([]).catch(e => console.error(e));
+
+ await actions.addTarget(targetFront);
+}
+
+function onTargetDestroyed({ targetFront }) {
+ actions.removeTarget(targetFront);
+}
+
+async function onSourceAvailable(sources) {
+ await actions.newGeneratedSources(sources);
+}
+
+async function onThreadStateAvailable(resources) {
+ for (const resource of resources) {
+ if (resource.targetFront.isDestroyed()) {
+ continue;
+ }
+ const threadFront = await resource.targetFront.getFront("thread");
+ if (resource.state == "paused") {
+ const pause = await createPause(threadFront.actor, resource);
+ await actions.paused(pause);
+ recordEvent("pause", { reason: resource.why.type });
+ } else if (resource.state == "resumed") {
+ await actions.resumed(threadFront.actorID);
+ }
+ }
+}
+
+async function onTracingStateAvailable(resources) {
+ for (const resource of resources) {
+ if (resource.targetFront.isDestroyed()) {
+ continue;
+ }
+ const threadFront = await resource.targetFront.getFront("thread");
+ await actions.tracingToggled(threadFront.actor, resource.enabled);
+ }
+}
+
+function onDocumentEventAvailable(events) {
+ for (const event of events) {
+ // Only consider top level document, and ignore remote iframes top document
+ if (!event.targetFront.isTopLevel) continue;
+ // The browser toolbox debugger doesn't support the iframe dropdown.
+ // you will always see all the sources of all targets of your debugging context.
+ //
+ // But still allow it to clear the debugger when reloading the addon, or when
+ // switching between fallback document and other addon document.
+ if (
+ event.isFrameSwitching &&
+ !commands.descriptorFront.isWebExtensionDescriptor
+ ) {
+ continue;
+ }
+ if (event.name == "will-navigate") {
+ actions.willNavigate({ url: event.newURI });
+ } else if (event.name == "dom-complete") {
+ actions.navigated();
+ }
+ }
+}
+
+export { clientCommands };
diff --git a/devtools/client/debugger/src/client/firefox/commands.js b/devtools/client/debugger/src/client/firefox/commands.js
new file mode 100644
index 0000000000..06f9d73854
--- /dev/null
+++ b/devtools/client/debugger/src/client/firefox/commands.js
@@ -0,0 +1,537 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { createFrame } from "./create";
+import { makeBreakpointServerLocationId } from "../../utils/breakpoint";
+
+import Reps from "devtools/client/shared/components/reps/index";
+
+let commands;
+let breakpoints;
+
+// The maximal number of stackframes to retrieve when pausing
+const CALL_STACK_PAGE_SIZE = 1000;
+
+function setupCommands(innerCommands) {
+ commands = innerCommands;
+ breakpoints = {};
+}
+
+function currentTarget() {
+ return commands.targetCommand.targetFront;
+}
+
+function currentThreadFront() {
+ return currentTarget().threadFront;
+}
+
+/**
+ * Create an object front for the passed grip
+ *
+ * @param {Object} grip
+ * @param {Object} frame: An optional frame that will manage the created object front.
+ * if not passed, the current thread front will manage the object.
+ * @returns {ObjectFront}
+ */
+function createObjectFront(grip, frame) {
+ if (!grip.actor) {
+ throw new Error("Actor is missing");
+ }
+ const threadFront = frame?.thread
+ ? lookupThreadFront(frame.thread)
+ : currentThreadFront();
+ const frameFront = frame ? threadFront.getActorByID(frame.id) : null;
+ return commands.client.createObjectFront(grip, threadFront, frameFront);
+}
+
+async function loadObjectProperties(root, threadActorID) {
+ const { utils } = Reps.objectInspector;
+ const properties = await utils.loadProperties.loadItemProperties(
+ root,
+ commands.client,
+ undefined,
+ threadActorID
+ );
+ return utils.node.getChildren({
+ item: root,
+ loadedProperties: new Map([[root.path, properties]]),
+ });
+}
+
+function releaseActor(actor) {
+ if (!actor) {
+ return Promise.resolve();
+ }
+ const objFront = commands.client.getFrontByID(actor);
+
+ if (!objFront) {
+ return Promise.resolve();
+ }
+
+ return objFront.release().catch(() => {});
+}
+
+function lookupTarget(thread) {
+ if (thread == currentThreadFront().actor) {
+ return currentTarget();
+ }
+
+ const targets = commands.targetCommand.getAllTargets(
+ commands.targetCommand.ALL_TYPES
+ );
+ return targets.find(target => target.targetForm.threadActor == thread);
+}
+
+function lookupThreadFront(thread) {
+ const target = lookupTarget(thread);
+ return target.threadFront;
+}
+
+function listThreadFronts() {
+ const targets = commands.targetCommand.getAllTargets(
+ commands.targetCommand.ALL_TYPES
+ );
+ return targets.map(target => target.threadFront).filter(front => !!front);
+}
+
+function forEachThread(iteratee) {
+ // We have to be careful here to atomically initiate the operation on every
+ // thread, with no intervening await. Otherwise, other code could run and
+ // trigger additional thread operations. Requests on server threads will
+ // resolve in FIFO order, and this could result in client and server state
+ // going out of sync.
+
+ const promises = listThreadFronts().map(
+ // If a thread shuts down while sending the message then it will
+ // throw. Ignore these exceptions.
+ t => iteratee(t).catch(e => console.log(e))
+ );
+
+ return Promise.all(promises);
+}
+
+/**
+ * Start JavaScript tracing for all targets.
+ *
+ * @param {String} logMethod
+ * Where to log the traces. Can be stdout or console.
+ */
+async function startTracing(logMethod) {
+ const targets = commands.targetCommand.getAllTargets(
+ commands.targetCommand.ALL_TYPES
+ );
+ await Promise.all(
+ targets.map(async targetFront => {
+ const tracerFront = await targetFront.getFront("tracer");
+ return tracerFront.startTracing(logMethod);
+ })
+ );
+}
+
+/**
+ * Stop JavaScript tracing for all targets.
+ */
+async function stopTracing() {
+ const targets = commands.targetCommand.getAllTargets(
+ commands.targetCommand.ALL_TYPES
+ );
+ await Promise.all(
+ targets.map(async targetFront => {
+ const tracerFront = await targetFront.getFront("tracer");
+ return tracerFront.stopTracing();
+ })
+ );
+}
+
+function resume(thread, frameId) {
+ return lookupThreadFront(thread).resume();
+}
+
+function stepIn(thread, frameId) {
+ return lookupThreadFront(thread).stepIn(frameId);
+}
+
+function stepOver(thread, frameId) {
+ return lookupThreadFront(thread).stepOver(frameId);
+}
+
+function stepOut(thread, frameId) {
+ return lookupThreadFront(thread).stepOut(frameId);
+}
+
+function restart(thread, frameId) {
+ return lookupThreadFront(thread).restart(frameId);
+}
+
+function breakOnNext(thread) {
+ return lookupThreadFront(thread).breakOnNext();
+}
+
+async function sourceContents({ actor, thread }) {
+ const sourceThreadFront = lookupThreadFront(thread);
+ const sourceFront = sourceThreadFront.source({ actor });
+ const { source, contentType } = await sourceFront.source();
+ return { source, contentType };
+}
+
+async function setXHRBreakpoint(path, method) {
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (!hasWatcherSupport) {
+ // Without watcher support, forward setXHRBreakpoint to all threads.
+ await forEachThread(thread => thread.setXHRBreakpoint(path, method));
+ return;
+ }
+ const breakpointsFront =
+ await commands.targetCommand.watcherFront.getBreakpointListActor();
+ await breakpointsFront.setXHRBreakpoint(path, method);
+}
+
+async function removeXHRBreakpoint(path, method) {
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (!hasWatcherSupport) {
+ // Without watcher support, forward removeXHRBreakpoint to all threads.
+ await forEachThread(thread => thread.removeXHRBreakpoint(path, method));
+ return;
+ }
+ const breakpointsFront =
+ await commands.targetCommand.watcherFront.getBreakpointListActor();
+ await breakpointsFront.removeXHRBreakpoint(path, method);
+}
+
+export function toggleJavaScriptEnabled(enabled) {
+ return commands.targetConfigurationCommand.updateConfiguration({
+ javascriptEnabled: enabled,
+ });
+}
+
+async function addWatchpoint(object, property, label, watchpointType) {
+ if (!currentTarget().getTrait("watchpoints")) {
+ return;
+ }
+ const objectFront = createObjectFront(object);
+ await objectFront.addWatchpoint(property, label, watchpointType);
+}
+
+async function removeWatchpoint(object, property) {
+ if (!currentTarget().getTrait("watchpoints")) {
+ return;
+ }
+ const objectFront = createObjectFront(object);
+ await objectFront.removeWatchpoint(property);
+}
+
+function hasBreakpoint(location) {
+ return !!breakpoints[makeBreakpointServerLocationId(location)];
+}
+
+function getServerBreakpointsList() {
+ return Object.values(breakpoints);
+}
+
+async function setBreakpoint(location, options) {
+ const breakpoint = breakpoints[makeBreakpointServerLocationId(location)];
+ if (
+ breakpoint &&
+ JSON.stringify(breakpoint.options) == JSON.stringify(options)
+ ) {
+ return null;
+ }
+ breakpoints[makeBreakpointServerLocationId(location)] = { location, options };
+
+ // Map frontend options to a more restricted subset of what
+ // the server supports. For example frontend uses `hidden` attribute
+ // which isn't meant to be passed to the server.
+ // (note that protocol.js specification isn't enough to filter attributes,
+ // all primitive attributes will be passed as-is)
+ const serverOptions = {
+ condition: options.condition,
+ logValue: options.logValue,
+ };
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (!hasWatcherSupport) {
+ // Without watcher support, unconditionally forward setBreakpoint to all threads.
+ return forEachThread(async thread =>
+ thread.setBreakpoint(location, serverOptions)
+ );
+ }
+ const breakpointsFront =
+ await commands.targetCommand.watcherFront.getBreakpointListActor();
+ await breakpointsFront.setBreakpoint(location, serverOptions);
+
+ // Call setBreakpoint for threads linked to targets
+ // not managed by the watcher.
+ return forEachThread(async thread => {
+ if (
+ !commands.targetCommand.hasTargetWatcherSupport(
+ thread.targetFront.targetType
+ )
+ ) {
+ return thread.setBreakpoint(location, serverOptions);
+ }
+
+ return Promise.resolve();
+ });
+}
+
+async function removeBreakpoint(location) {
+ delete breakpoints[makeBreakpointServerLocationId(location)];
+
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (!hasWatcherSupport) {
+ // Without watcher support, unconditionally forward removeBreakpoint to all threads.
+ return forEachThread(async thread => thread.removeBreakpoint(location));
+ }
+ const breakpointsFront =
+ await commands.targetCommand.watcherFront.getBreakpointListActor();
+ await breakpointsFront.removeBreakpoint(location);
+
+ // Call removeBreakpoint for threads linked to targets
+ // not managed by the watcher.
+ return forEachThread(async thread => {
+ if (
+ !commands.targetCommand.hasTargetWatcherSupport(
+ thread.targetFront.targetType
+ )
+ ) {
+ return thread.removeBreakpoint(location);
+ }
+
+ return Promise.resolve();
+ });
+}
+
+async function evaluateExpressions(scripts, options) {
+ return Promise.all(scripts.map(script => evaluate(script, options)));
+}
+
+async function evaluate(script, { frameId, threadId } = {}) {
+ if (!currentTarget() || !script) {
+ return { result: null };
+ }
+
+ const selectedTargetFront = threadId ? lookupTarget(threadId) : null;
+
+ return commands.scriptCommand.execute(script, {
+ frameActor: frameId,
+ selectedTargetFront,
+ });
+}
+
+async function autocomplete(input, cursor, frameId) {
+ if (!currentTarget() || !input) {
+ return {};
+ }
+ const consoleFront = await currentTarget().getFront("console");
+ if (!consoleFront) {
+ return {};
+ }
+
+ return new Promise(resolve => {
+ consoleFront.autocomplete(
+ input,
+ cursor,
+ result => resolve(result),
+ frameId
+ );
+ });
+}
+
+function getProperties(thread, grip) {
+ const objClient = lookupThreadFront(thread).pauseGrip(grip);
+
+ return objClient.getPrototypeAndProperties().then(resp => {
+ const { ownProperties, safeGetterValues } = resp;
+ for (const name in safeGetterValues) {
+ const { enumerable, writable, getterValue } = safeGetterValues[name];
+ ownProperties[name] = { enumerable, writable, value: getterValue };
+ }
+ return resp;
+ });
+}
+
+async function getFrames(thread) {
+ const threadFront = lookupThreadFront(thread);
+ const response = await threadFront.getFrames(0, CALL_STACK_PAGE_SIZE);
+
+ return Promise.all(
+ response.frames.map((frame, i) => createFrame(thread, frame, i))
+ );
+}
+
+async function getFrameScopes(frame) {
+ const frameFront = lookupThreadFront(frame.thread).getActorByID(frame.id);
+ return frameFront.getEnvironment();
+}
+
+async function pauseOnExceptions(
+ shouldPauseOnExceptions,
+ shouldPauseOnCaughtExceptions
+) {
+ await commands.threadConfigurationCommand.updateConfiguration({
+ pauseOnExceptions: shouldPauseOnExceptions,
+ ignoreCaughtExceptions: !shouldPauseOnCaughtExceptions,
+ });
+}
+
+async function blackBox(sourceActor, shouldBlackBox, ranges) {
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (hasWatcherSupport) {
+ const blackboxingFront =
+ await commands.targetCommand.watcherFront.getBlackboxingActor();
+ if (shouldBlackBox) {
+ await blackboxingFront.blackbox(sourceActor.url, ranges);
+ } else {
+ await blackboxingFront.unblackbox(sourceActor.url, ranges);
+ }
+ } else {
+ const sourceFront = currentThreadFront().source({
+ actor: sourceActor.actor,
+ });
+ // If there are no ranges, the whole source is being blackboxed
+ if (!ranges.length) {
+ await toggleBlackBoxSourceFront(sourceFront, shouldBlackBox);
+ return;
+ }
+ // Blackbox the specific ranges
+ for (const range of ranges) {
+ await toggleBlackBoxSourceFront(sourceFront, shouldBlackBox, range);
+ }
+ }
+}
+
+async function toggleBlackBoxSourceFront(sourceFront, shouldBlackBox, range) {
+ if (shouldBlackBox) {
+ await sourceFront.blackBox(range);
+ } else {
+ await sourceFront.unblackBox(range);
+ }
+}
+
+async function setSkipPausing(shouldSkip) {
+ await commands.threadConfigurationCommand.updateConfiguration({
+ skipBreakpoints: shouldSkip,
+ });
+}
+
+async function setEventListenerBreakpoints(ids) {
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (!hasWatcherSupport) {
+ await forEachThread(thread => thread.setActiveEventBreakpoints(ids));
+ return;
+ }
+ const breakpointListFront =
+ await commands.targetCommand.watcherFront.getBreakpointListActor();
+ await breakpointListFront.setActiveEventBreakpoints(ids);
+}
+
+async function getEventListenerBreakpointTypes() {
+ return currentThreadFront().getAvailableEventBreakpoints();
+}
+
+function pauseGrip(thread, func) {
+ return lookupThreadFront(thread).pauseGrip(func);
+}
+
+async function toggleEventLogging(logEventBreakpoints) {
+ await commands.threadConfigurationCommand.updateConfiguration({
+ logEventBreakpoints,
+ });
+}
+
+function getMainThread() {
+ return currentThreadFront().actor;
+}
+
+async function getSourceActorBreakpointPositions({ thread, actor }, range) {
+ const sourceThreadFront = lookupThreadFront(thread);
+ const sourceFront = sourceThreadFront.source({ actor });
+ return sourceFront.getBreakpointPositionsCompressed(range);
+}
+
+async function getSourceActorBreakableLines({ thread, actor }) {
+ let actorLines = [];
+ try {
+ const sourceThreadFront = lookupThreadFront(thread);
+ const sourceFront = sourceThreadFront.source({ actor });
+ actorLines = await sourceFront.getBreakableLines();
+ } catch (e) {
+ // Exceptions could be due to the target thread being shut down.
+ console.warn(`getSourceActorBreakableLines failed: ${e}`);
+ }
+
+ return actorLines;
+}
+
+function getFrontByID(actorID) {
+ return commands.client.getFrontByID(actorID);
+}
+
+function fetchAncestorFramePositions(index) {
+ currentThreadFront().fetchAncestorFramePositions(index);
+}
+
+async function setOverride(url, path) {
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (hasWatcherSupport) {
+ const networkFront =
+ await commands.targetCommand.watcherFront.getNetworkParentActor();
+ return networkFront.override(url, path);
+ }
+ return null;
+}
+
+async function removeOverride(url) {
+ const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
+ if (hasWatcherSupport) {
+ const networkFront =
+ await commands.targetCommand.watcherFront.getNetworkParentActor();
+ networkFront.removeOverride(url);
+ }
+}
+
+const clientCommands = {
+ autocomplete,
+ blackBox,
+ createObjectFront,
+ loadObjectProperties,
+ releaseActor,
+ pauseGrip,
+ startTracing,
+ stopTracing,
+ resume,
+ stepIn,
+ stepOut,
+ stepOver,
+ restart,
+ breakOnNext,
+ sourceContents,
+ getSourceActorBreakpointPositions,
+ getSourceActorBreakableLines,
+ hasBreakpoint,
+ getServerBreakpointsList,
+ setBreakpoint,
+ setXHRBreakpoint,
+ removeXHRBreakpoint,
+ addWatchpoint,
+ removeWatchpoint,
+ removeBreakpoint,
+ evaluate,
+ evaluateExpressions,
+ getProperties,
+ getFrameScopes,
+ getFrames,
+ pauseOnExceptions,
+ toggleEventLogging,
+ getMainThread,
+ setSkipPausing,
+ setEventListenerBreakpoints,
+ getEventListenerBreakpointTypes,
+ getFrontByID,
+ fetchAncestorFramePositions,
+ toggleJavaScriptEnabled,
+ setOverride,
+ removeOverride,
+};
+
+export { setupCommands, clientCommands };
diff --git a/devtools/client/debugger/src/client/firefox/create.js b/devtools/client/debugger/src/client/firefox/create.js
new file mode 100644
index 0000000000..97976aa358
--- /dev/null
+++ b/devtools/client/debugger/src/client/firefox/create.js
@@ -0,0 +1,392 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+// This module converts Firefox specific types to the generic types
+
+import {
+ hasSource,
+ hasSourceActor,
+ getSourceActor,
+ getSourceCount,
+} from "../../selectors";
+import { features } from "../../utils/prefs";
+import { isUrlExtension } from "../../utils/source";
+import { createLocation } from "../../utils/location";
+import { getDisplayURL } from "../../utils/sources-tree/getURL";
+
+let store;
+
+/**
+ * This function is to be called first before any other
+ * and allow having access to any instances of classes that are
+ * useful for this module
+ *
+ * @param {Object} dependencies
+ * @param {Object} dependencies.store
+ * The redux store object of the debugger frontend.
+ */
+export function setupCreate(dependencies) {
+ store = dependencies.store;
+}
+
+export async function createFrame(thread, frame, index = 0) {
+ if (!frame) {
+ return null;
+ }
+
+ // Because of throttling, the source may be available a bit late.
+ const sourceActor = await waitForSourceActorToBeRegisteredInStore(
+ frame.where.actor
+ );
+
+ const location = createLocation({
+ source: sourceActor.sourceObject,
+ sourceActor,
+ line: frame.where.line,
+ column: frame.where.column,
+ });
+
+ return {
+ id: frame.actorID,
+ thread,
+ displayName: frame.displayName,
+ location,
+ generatedLocation: location,
+ this: frame.this,
+ source: null,
+ index,
+ asyncCause: frame.asyncCause,
+ state: frame.state,
+ type: frame.type,
+ };
+}
+
+/**
+ * This method wait for the given source actor to be registered in Redux store.
+ *
+ * @param {String} sourceActorId
+ * Actor ID of the source to be waiting for.
+ */
+async function waitForSourceActorToBeRegisteredInStore(sourceActorId) {
+ if (!hasSourceActor(store.getState(), sourceActorId)) {
+ await new Promise(resolve => {
+ const unsubscribe = store.subscribe(check);
+ let currentSize = null;
+ function check() {
+ const previousSize = currentSize;
+ currentSize = store.getState().sourceActors.mutableSourceActors.size;
+ // For perf reason, avoid any extra computation if sources did not change
+ if (previousSize == currentSize) {
+ return;
+ }
+ if (hasSourceActor(store.getState(), sourceActorId)) {
+ unsubscribe();
+ resolve();
+ }
+ }
+ });
+ }
+ return getSourceActor(store.getState(), sourceActorId);
+}
+
+/**
+ * This method wait for the given source to be registered in Redux store.
+ *
+ * @param {String} sourceId
+ * The id of the source to be waiting for.
+ */
+export async function waitForSourceToBeRegisteredInStore(sourceId) {
+ return new Promise(resolve => {
+ if (hasSource(store.getState(), sourceId)) {
+ resolve();
+ return;
+ }
+ const unsubscribe = store.subscribe(check);
+ let currentSize = null;
+ function check() {
+ const previousSize = currentSize;
+ currentSize = getSourceCount(store.getState());
+ // For perf reason, avoid any extra computation if sources did not change
+ if (previousSize == currentSize) {
+ return;
+ }
+ if (hasSource(store.getState(), sourceId)) {
+ unsubscribe();
+ resolve();
+ }
+ }
+ });
+}
+
+// Compute the reducer's source ID for a given source front/resource.
+//
+// We have four kind of "sources":
+// * "sources" in sources.js reducer, which map to 1 or many:
+// * "source actors" in source-actors.js reducer, which map 1 for 1 with:
+// * "SOURCE" resources coming from ResourceCommand API
+// * SourceFront, which are retrieved via `ThreadFront.source(sourceResource)`
+//
+// Note that SOURCE resources are actually the "form" of the SourceActor,
+// with the addition of `resourceType` and `targetFront` attributes.
+//
+// Unfortunately, the debugger frontend interacts with these 4 type of objects.
+// The last three actually try to represent the exact same thing.
+//
+// Here this method received a SOURCE resource (the 3rd bullet point)
+export function makeSourceId(sourceResource) {
+ // Allows Jest to use custom, simplier IDs
+ if ("mockedJestID" in sourceResource) {
+ return sourceResource.mockedJestID;
+ }
+ // By default, within a given target, all sources will be grouped by URL.
+ // You will be having a unique Source object in sources.js reducer,
+ // while you might have many Source Actor objects in source-actors.js reducer.
+ //
+ // There is two distinct usecases here:
+ // * HTML pages, which will have one source object which represents the whole HTML page
+ // and it will relate to many source actors. One for each inline <script> tag.
+ // Each script tag's source actor will actually return the whole content of the html page
+ // and not only this one script tag content.
+ // * Scripts with the same URL injected many times.
+ // For example, two <script src=""> with the same location
+ // Or by using eval("...// # SourceURL=")
+ // All the scripts will be grouped under a unique Source object, while having dedicated
+ // Source Actor objects.
+ // An important point this time is that each actor may have a different source text content.
+ // For now, the debugger arbitrarily picks the first source actor's text content and never
+ // updates it. (See bug 1751063)
+ if (sourceResource.url) {
+ return `source-url-${sourceResource.url}`;
+ }
+
+ // Otherwise, we are processing a source without URL.
+ // This is typically evals, console evaluations, setTimeout/setInterval strings,
+ // DOM event handler strings (i.e. `<div onclick="foo">`), ...
+ // The main way to interact with them is to use a debugger statement from them,
+ // or have other panels ask the debugger to open them (like DOM event handlers from the inspector).
+ // We can register transient breakpoints against them (i.e. they will only apply to the current source actor instance)
+ return `source-actor-${sourceResource.actor}`;
+}
+
+/**
+ * Create the source object for a generated source that is stored in sources.js reducer.
+ * These generated sources relate to JS code which run in the
+ * debugged runtime (as oppose to original sources
+ * which are only available in debugger's environment).
+ *
+ * @param {SOURCE} sourceResource
+ * SOURCE resource coming from the ResourceCommand API.
+ * This represents the `SourceActor` from the server codebase.
+ */
+export function createGeneratedSource(sourceResource) {
+ return createSourceObject({
+ id: makeSourceId(sourceResource),
+ url: sourceResource.url,
+ extensionName: sourceResource.extensionName,
+ isWasm: !!features.wasm && sourceResource.introductionType === "wasm",
+ isExtension:
+ (sourceResource.url && isUrlExtension(sourceResource.url)) || false,
+ isHTML: !!sourceResource.isInlineSource,
+ });
+}
+
+/**
+ * Create the source object that is stored in sources.js reducer.
+ *
+ * This is an internal helper to this module to ensure all sources have the same shape.
+ * Do not use it outside of this module!
+ */
+function createSourceObject({
+ id,
+ url,
+ extensionName = null,
+ isWasm = false,
+ isExtension = false,
+ isPrettyPrinted = false,
+ isOriginal = false,
+ isHTML = false,
+}) {
+ return {
+ // The ID, computed by:
+ // * `makeSourceId` for generated,
+ // * `generatedToOriginalId` for both source map and pretty printed original,
+ id,
+
+ // Absolute URL for the source. This may be a fake URL for pretty printed sources
+ url,
+
+ // A (slightly tweaked) URL object to represent the source URL.
+ // The URL object is augmented of a "group" attribute and some other standard attributes
+ // are modified from their typical value. See getDisplayURL implementation.
+ displayURL: getDisplayURL(url, extensionName),
+
+ // Only set for generated sources that are WebExtension sources.
+ // This is especially useful to display the extension name for content scripts
+ // that executes against the page we are debugging.
+ extensionName,
+
+ // Will be true if the source URL starts with moz-extension://,
+ // which most likely means the source is a content script.
+ // (Note that when debugging an add-on all generated sources will most likely have this flag set to true)
+ isExtension,
+
+ // True if WASM is enabled *and* the generated source is a WASM source
+ isWasm,
+
+ // True if this source is an HTML and relates to many sources actors,
+ // one for each of its inline <script>
+ isHTML,
+
+ // True, if this is an original pretty printed source
+ isPrettyPrinted,
+
+ // True for source map original files, as well as pretty printed sources
+ isOriginal,
+ };
+}
+
+/**
+ * Create the source object for a source mapped original source that is stored in sources.js reducer.
+ * These original sources referred to by source maps.
+ * This isn't code that runs in the runtime, so it isn't associated with anything
+ * on the server side. It is associated with a generated source for the related bundle file
+ * which itself relates to an actual code that runs in the runtime.
+ *
+ * @param {String} id
+ * The ID of the source, computed by source map codebase.
+ * @param {String} url
+ * The URL of the original source file.
+ */
+export function createSourceMapOriginalSource(id, url) {
+ return createSourceObject({
+ id,
+ url,
+ isOriginal: true,
+ });
+}
+
+/**
+ * Create the source object for a pretty printed original source that is stored in sources.js reducer.
+ * These original pretty printed sources aren't code that run in the runtime,
+ * so it isn't associated with anything on the server side.
+ * It is associated with a generated source for the non-pretty-printed file
+ * which itself relates to an actual code that runs in the runtime.
+ *
+ * @param {String} id
+ * The ID of the source, computed by pretty print.
+ * @param {String} url
+ * The URL of the pretty-printed source file.
+ * This URL doesn't work. It is the URL of the non-pretty-printed file with ":formated" suffix.
+ */
+export function createPrettyPrintOriginalSource(id, url) {
+ return createSourceObject({
+ id,
+ url,
+ isOriginal: true,
+ isPrettyPrinted: true,
+ });
+}
+
+/**
+ * Create the "source actor" object that is stored in source-actor.js reducer.
+ * This will represent server's source actor in the reducer universe.
+ *
+ * @param {SOURCE} sourceResource
+ * SOURCE resource coming from the ResourceCommand API.
+ * This represents the `SourceActor` from the server codebase.
+ * @param {Object} sourceObject
+ * Source object stored in redux, i.e. created via createSourceObject.
+ */
+export function createSourceActor(sourceResource, sourceObject) {
+ const actorId = sourceResource.actor;
+
+ return {
+ id: actorId,
+ actor: actorId,
+ // As sourceResource is only SourceActor's form and not the SourceFront,
+ // we have to go through the target to retrieve the related ThreadActor's ID.
+ thread: sourceResource.targetFront.getCachedFront("thread").actorID,
+ // `source` is the reducer source ID
+ source: makeSourceId(sourceResource),
+ sourceObject,
+ sourceMapBaseURL: sourceResource.sourceMapBaseURL,
+ sourceMapURL: sourceResource.sourceMapURL,
+ url: sourceResource.url,
+ introductionType: sourceResource.introductionType,
+ sourceStartLine: sourceResource.sourceStartLine,
+ sourceStartColumn: sourceResource.sourceStartColumn,
+ sourceLength: sourceResource.sourceLength,
+ };
+}
+
+export async function createPause(thread, packet) {
+ const frame = await createFrame(thread, packet.frame);
+ return {
+ ...packet,
+ thread,
+ frame,
+ };
+}
+
+export function createThread(targetFront) {
+ const name = targetFront.isTopLevel
+ ? L10N.getStr("mainThread")
+ : targetFront.name;
+
+ return {
+ actor: targetFront.targetForm.threadActor,
+ url: targetFront.url,
+ isTopLevel: targetFront.isTopLevel,
+ targetType: targetFront.targetType,
+ name,
+ serviceWorkerStatus: targetFront.debuggerServiceWorkerStatus,
+ isWebExtension: targetFront.isWebExtension,
+ processID: targetFront.processID,
+ };
+}
+
+/**
+ * Defines the shape of a breakpoint
+ */
+export function createBreakpoint({
+ id,
+ thread,
+ disabled = false,
+ options = {},
+ location,
+ generatedLocation,
+ text,
+ originalText,
+}) {
+ return {
+ // The unique identifier (string) for the breakpoint, for details on its format and creation See `makeBreakpointId`
+ id,
+
+ // The thread actor id (string) which the source this breakpoint is created in belongs to
+ thread,
+
+ // This (boolean) specifies if the breakpoint is disabled or not
+ disabled,
+
+ // This (object) stores extra information about the breakpoint, which defines the type of the breakpoint (i.e conditional breakpoints, log points)
+ // {
+ // condition: <Boolean>,
+ // logValue: <String>,
+ // hidden: <Boolean>
+ // }
+ options,
+
+ // The location (object) information for the original source, for details on its format and structure See `createLocation`
+ location,
+
+ // The location (object) information for the generated source, for details on its format and structure See `createLocation`
+ generatedLocation,
+
+ // The text (string) on the line which the brekpoint is set in the generated source
+ text,
+
+ // The text (string) on the line which the breakpoint is set in the original source
+ originalText,
+ };
+}
diff --git a/devtools/client/debugger/src/client/firefox/moz.build b/devtools/client/debugger/src/client/firefox/moz.build
new file mode 100644
index 0000000000..9406133e17
--- /dev/null
+++ b/devtools/client/debugger/src/client/firefox/moz.build
@@ -0,0 +1,11 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "commands.js",
+ "create.js",
+)
diff --git a/devtools/client/debugger/src/client/moz.build b/devtools/client/debugger/src/client/moz.build
new file mode 100644
index 0000000000..cbaaa3a2a0
--- /dev/null
+++ b/devtools/client/debugger/src/client/moz.build
@@ -0,0 +1,12 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "firefox",
+]
+
+CompiledModules(
+ "firefox.js",
+)
diff --git a/devtools/client/debugger/src/components/A11yIntention.css b/devtools/client/debugger/src/components/A11yIntention.css
new file mode 100644
index 0000000000..e97a03ad32
--- /dev/null
+++ b/devtools/client/debugger/src/components/A11yIntention.css
@@ -0,0 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.A11y-mouse :focus {
+ outline: 0;
+}
diff --git a/devtools/client/debugger/src/components/A11yIntention.js b/devtools/client/debugger/src/components/A11yIntention.js
new file mode 100644
index 0000000000..fab894b216
--- /dev/null
+++ b/devtools/client/debugger/src/components/A11yIntention.js
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import PropTypes from "prop-types";
+import "./A11yIntention.css";
+
+export default class A11yIntention extends React.Component {
+ static get propTypes() {
+ return {
+ children: PropTypes.array.isRequired,
+ };
+ }
+
+ state = { keyboard: false };
+
+ handleKeyDown = () => {
+ this.setState({ keyboard: true });
+ };
+
+ handleMouseDown = () => {
+ this.setState({ keyboard: false });
+ };
+
+ render() {
+ return (
+ <div
+ className={this.state.keyboard ? "A11y-keyboard" : "A11y-mouse"}
+ onKeyDown={this.handleKeyDown}
+ onMouseDown={this.handleMouseDown}
+ >
+ {this.props.children}
+ </div>
+ );
+ }
+}
diff --git a/devtools/client/debugger/src/components/App.css b/devtools/client/debugger/src/components/App.css
new file mode 100644
index 0000000000..6a793c2f48
--- /dev/null
+++ b/devtools/client/debugger/src/components/App.css
@@ -0,0 +1,130 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+* {
+ box-sizing: border-box;
+}
+
+html,
+body {
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+#mount {
+ height: 100%;
+}
+
+button {
+ background: transparent;
+ border: none;
+ font-family: inherit;
+ font-size: inherit;
+}
+
+button:hover,
+button:focus {
+ background-color: var(--theme-toolbar-background-hover);
+}
+
+.theme-dark button:hover,
+.theme-dark button:focus {
+ background-color: var(--theme-toolbar-hover);
+}
+
+.debugger {
+ display: flex;
+ flex: 1;
+ height: 100%;
+}
+
+.debugger .tree-indent {
+ width: 16px;
+ margin-inline-start: 0;
+ border-inline-start: 0;
+}
+
+.editor-pane {
+ display: flex;
+ position: relative;
+ flex: 1;
+ background-color: var(--theme-body-background);
+ height: 100%;
+ overflow: hidden;
+}
+
+.editor-container {
+ width: 100%;
+}
+
+/* Utils */
+.absolute-center {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+
+.d-flex {
+ display: flex;
+}
+
+.align-items-center {
+ align-items: center;
+}
+
+.rounded-circle {
+ border-radius: 50%;
+}
+
+.text-white {
+ color: white;
+}
+
+.text-center {
+ text-align: center;
+}
+
+.min-width-0 {
+ min-width: 0;
+}
+
+/*
+ Prevents horizontal scrollbar from displaying when
+ right pane collapsed (#7505)
+*/
+.split-box > .splitter:last-child {
+ display: none;
+}
+
+/**
+ * In RTL layouts, the Debugger UI overlays the splitters. See Bug 1731233.
+ * Note: we need to the `.debugger` prefix here to beat the specificity of the
+ * general rule defined in SlitBox.css for `.split-box.vert > .splitter`.
+ */
+.debugger .split-box.vert > .splitter {
+ border-left-width: var(--devtools-splitter-inline-start-width);
+ border-right-width: var(--devtools-splitter-inline-end-width);
+
+ margin-left: calc(-1 * var(--devtools-splitter-inline-start-width) - 1px);
+ margin-right: calc(-1 * var(--devtools-splitter-inline-end-width));
+}
+
+::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ background: transparent;
+}
+
+::-webkit-scrollbar-track {
+ border-radius: 8px;
+ background: transparent;
+}
+
+::-webkit-scrollbar-thumb {
+ border-radius: 8px;
+ background: rgba(113, 113, 113, 0.5);
+}
diff --git a/devtools/client/debugger/src/components/App.js b/devtools/client/debugger/src/components/App.js
new file mode 100644
index 0000000000..011d743cd9
--- /dev/null
+++ b/devtools/client/debugger/src/components/App.js
@@ -0,0 +1,336 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../utils/connect";
+import { prefs } from "../utils/prefs";
+import { primaryPaneTabs } from "../constants";
+import actions from "../actions";
+import A11yIntention from "./A11yIntention";
+import { ShortcutsModal } from "./ShortcutsModal";
+
+import {
+ getSelectedSource,
+ getPaneCollapse,
+ getActiveSearch,
+ getQuickOpenEnabled,
+ getOrientation,
+} from "../selectors";
+
+const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
+const SplitBox = require("devtools/client/shared/components/splitter/SplitBox");
+const AppErrorBoundary = require("devtools/client/shared/components/AppErrorBoundary");
+
+const shortcuts = new KeyShortcuts({ window });
+
+const horizontalLayoutBreakpoint = window.matchMedia("(min-width: 800px)");
+const verticalLayoutBreakpoint = window.matchMedia(
+ "(min-width: 10px) and (max-width: 799px)"
+);
+
+import "./variables.css";
+import "./App.css";
+
+import "./shared/menu.css";
+
+import PrimaryPanes from "./PrimaryPanes";
+import Editor from "./Editor";
+import SecondaryPanes from "./SecondaryPanes";
+import WelcomeBox from "./WelcomeBox";
+import EditorTabs from "./Editor/Tabs";
+import EditorFooter from "./Editor/Footer";
+import QuickOpenModal from "./QuickOpenModal";
+
+class App extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ shortcutsModalEnabled: false,
+ startPanelSize: 0,
+ endPanelSize: 0,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ activeSearch: PropTypes.oneOf(["file", "project"]),
+ closeActiveSearch: PropTypes.func.isRequired,
+ closeQuickOpen: PropTypes.func.isRequired,
+ endPanelCollapsed: PropTypes.bool.isRequired,
+ fluentBundles: PropTypes.array.isRequired,
+ openQuickOpen: PropTypes.func.isRequired,
+ orientation: PropTypes.oneOf(["horizontal", "vertical"]).isRequired,
+ quickOpenEnabled: PropTypes.bool.isRequired,
+ selectedSource: PropTypes.object,
+ setActiveSearch: PropTypes.func.isRequired,
+ setOrientation: PropTypes.func.isRequired,
+ setPrimaryPaneTab: PropTypes.func.isRequired,
+ startPanelCollapsed: PropTypes.bool.isRequired,
+ toolboxDoc: PropTypes.object.isRequired,
+ };
+ }
+
+ getChildContext() {
+ return {
+ fluentBundles: this.props.fluentBundles,
+ toolboxDoc: this.props.toolboxDoc,
+ shortcuts,
+ l10n: L10N,
+ };
+ }
+
+ componentDidMount() {
+ horizontalLayoutBreakpoint.addListener(this.onLayoutChange);
+ verticalLayoutBreakpoint.addListener(this.onLayoutChange);
+ this.setOrientation();
+
+ shortcuts.on(L10N.getStr("symbolSearch.search.key2"), e =>
+ this.toggleQuickOpenModal(e, "@")
+ );
+
+ [
+ L10N.getStr("sources.search.key2"),
+ L10N.getStr("sources.search.alt.key"),
+ ].forEach(key => shortcuts.on(key, this.toggleQuickOpenModal));
+
+ shortcuts.on(L10N.getStr("gotoLineModal.key3"), e =>
+ this.toggleQuickOpenModal(e, ":")
+ );
+
+ shortcuts.on(
+ L10N.getStr("projectTextSearch.key"),
+ this.jumpToProjectSearch
+ );
+
+ shortcuts.on("Escape", this.onEscape);
+ shortcuts.on("CmdOrCtrl+/", this.onCommandSlash);
+ }
+
+ componentWillUnmount() {
+ horizontalLayoutBreakpoint.removeListener(this.onLayoutChange);
+ verticalLayoutBreakpoint.removeListener(this.onLayoutChange);
+ shortcuts.off(
+ L10N.getStr("symbolSearch.search.key2"),
+ this.toggleQuickOpenModal
+ );
+
+ [
+ L10N.getStr("sources.search.key2"),
+ L10N.getStr("sources.search.alt.key"),
+ ].forEach(key => shortcuts.off(key, this.toggleQuickOpenModal));
+
+ shortcuts.off(L10N.getStr("gotoLineModal.key3"), this.toggleQuickOpenModal);
+
+ shortcuts.off(
+ L10N.getStr("projectTextSearch.key"),
+ this.jumpToProjectSearch
+ );
+
+ shortcuts.off("Escape", this.onEscape);
+ shortcuts.off("CmdOrCtrl+/", this.onCommandSlash);
+ }
+
+ jumpToProjectSearch = e => {
+ e.preventDefault();
+ this.props.setPrimaryPaneTab(primaryPaneTabs.PROJECT_SEARCH);
+ this.props.setActiveSearch(primaryPaneTabs.PROJECT_SEARCH);
+ };
+
+ onEscape = e => {
+ const {
+ activeSearch,
+ closeActiveSearch,
+ closeQuickOpen,
+ quickOpenEnabled,
+ } = this.props;
+ const { shortcutsModalEnabled } = this.state;
+
+ if (activeSearch) {
+ e.preventDefault();
+ closeActiveSearch();
+ }
+
+ if (quickOpenEnabled) {
+ e.preventDefault();
+ closeQuickOpen();
+ }
+
+ if (shortcutsModalEnabled) {
+ e.preventDefault();
+ this.toggleShortcutsModal();
+ }
+ };
+
+ onCommandSlash = () => {
+ this.toggleShortcutsModal();
+ };
+
+ isHorizontal() {
+ return this.props.orientation === "horizontal";
+ }
+
+ toggleQuickOpenModal = (e, query) => {
+ const { quickOpenEnabled, openQuickOpen, closeQuickOpen } = this.props;
+
+ e.preventDefault();
+ e.stopPropagation();
+
+ if (quickOpenEnabled === true) {
+ closeQuickOpen();
+ return;
+ }
+
+ if (query != null) {
+ openQuickOpen(query);
+ return;
+ }
+ openQuickOpen();
+ };
+
+ onLayoutChange = () => {
+ this.setOrientation();
+ };
+
+ setOrientation() {
+ // If the orientation does not match (if it is not visible) it will
+ // not setOrientation, or if it is the same as before, calling
+ // setOrientation will not cause a rerender.
+ if (horizontalLayoutBreakpoint.matches) {
+ this.props.setOrientation("horizontal");
+ } else if (verticalLayoutBreakpoint.matches) {
+ this.props.setOrientation("vertical");
+ }
+ }
+
+ renderEditorPane = () => {
+ const { startPanelCollapsed, endPanelCollapsed } = this.props;
+ const { endPanelSize, startPanelSize } = this.state;
+ const horizontal = this.isHorizontal();
+
+ return (
+ <div className="editor-pane">
+ <div className="editor-container">
+ <EditorTabs
+ startPanelCollapsed={startPanelCollapsed}
+ endPanelCollapsed={endPanelCollapsed}
+ horizontal={horizontal}
+ />
+ <Editor startPanelSize={startPanelSize} endPanelSize={endPanelSize} />
+ {!this.props.selectedSource ? (
+ <WelcomeBox
+ horizontal={horizontal}
+ toggleShortcutsModal={() => this.toggleShortcutsModal()}
+ />
+ ) : null}
+ <EditorFooter horizontal={horizontal} />
+ </div>
+ </div>
+ );
+ };
+
+ toggleShortcutsModal() {
+ this.setState(prevState => ({
+ shortcutsModalEnabled: !prevState.shortcutsModalEnabled,
+ }));
+ }
+
+ // Important so that the tabs chevron updates appropriately when
+ // the user resizes the left or right columns
+ triggerEditorPaneResize() {
+ const editorPane = window.document.querySelector(".editor-pane");
+ if (editorPane) {
+ editorPane.dispatchEvent(new Event("resizeend"));
+ }
+ }
+
+ renderLayout = () => {
+ const { startPanelCollapsed, endPanelCollapsed } = this.props;
+ const horizontal = this.isHorizontal();
+
+ return (
+ <SplitBox
+ style={{ width: "100vw" }}
+ initialSize={prefs.endPanelSize}
+ minSize={30}
+ maxSize="70%"
+ splitterSize={1}
+ vert={horizontal}
+ onResizeEnd={num => {
+ prefs.endPanelSize = num;
+ this.triggerEditorPaneResize();
+ }}
+ startPanel={
+ <SplitBox
+ style={{ width: "100vw" }}
+ initialSize={prefs.startPanelSize}
+ minSize={30}
+ maxSize="85%"
+ splitterSize={1}
+ onResizeEnd={num => {
+ prefs.startPanelSize = num;
+ }}
+ startPanelCollapsed={startPanelCollapsed}
+ startPanel={<PrimaryPanes horizontal={horizontal} />}
+ endPanel={this.renderEditorPane()}
+ />
+ }
+ endPanelControl={true}
+ endPanel={<SecondaryPanes horizontal={horizontal} />}
+ endPanelCollapsed={endPanelCollapsed}
+ />
+ );
+ };
+
+ render() {
+ const { quickOpenEnabled } = this.props;
+ return (
+ <div className="debugger">
+ <AppErrorBoundary
+ componentName="Debugger"
+ panel={L10N.getStr("ToolboxDebugger.label")}
+ >
+ <A11yIntention>
+ {this.renderLayout()}
+ {quickOpenEnabled === true && (
+ <QuickOpenModal
+ shortcutsModalEnabled={this.state.shortcutsModalEnabled}
+ toggleShortcutsModal={() => this.toggleShortcutsModal()}
+ />
+ )}
+ <ShortcutsModal
+ enabled={this.state.shortcutsModalEnabled}
+ handleClose={() => this.toggleShortcutsModal()}
+ />
+ </A11yIntention>
+ </AppErrorBoundary>
+ </div>
+ );
+ }
+}
+
+App.childContextTypes = {
+ toolboxDoc: PropTypes.object,
+ shortcuts: PropTypes.object,
+ l10n: PropTypes.object,
+ fluentBundles: PropTypes.array,
+};
+
+const mapStateToProps = state => ({
+ selectedSource: getSelectedSource(state),
+ startPanelCollapsed: getPaneCollapse(state, "start"),
+ endPanelCollapsed: getPaneCollapse(state, "end"),
+ activeSearch: getActiveSearch(state),
+ quickOpenEnabled: getQuickOpenEnabled(state),
+ orientation: getOrientation(state),
+});
+
+export default connect(mapStateToProps, {
+ setActiveSearch: actions.setActiveSearch,
+ closeActiveSearch: actions.closeActiveSearch,
+ openQuickOpen: actions.openQuickOpen,
+ closeQuickOpen: actions.closeQuickOpen,
+ setOrientation: actions.setOrientation,
+ setPrimaryPaneTab: actions.setPrimaryPaneTab,
+})(App);
diff --git a/devtools/client/debugger/src/components/Editor/BlackboxLines.js b/devtools/client/debugger/src/components/Editor/BlackboxLines.js
new file mode 100644
index 0000000000..c81db9c598
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/BlackboxLines.js
@@ -0,0 +1,138 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import PropTypes from "prop-types";
+import { Component } from "react";
+import { toEditorLine, fromEditorLine } from "../../utils/editor";
+import { isLineBlackboxed } from "../../utils/source";
+import { isWasm } from "../../utils/wasm";
+
+// This renders blackbox line highlighting in the editor
+class BlackboxLines extends Component {
+ static get propTypes() {
+ return {
+ editor: PropTypes.object.isRequired,
+ selectedSource: PropTypes.object.isRequired,
+ blackboxedRangesForSelectedSource: PropTypes.array,
+ isSourceOnIgnoreList: PropTypes.bool,
+ };
+ }
+
+ componentDidMount() {
+ const { selectedSource, blackboxedRangesForSelectedSource, editor } =
+ this.props;
+
+ if (this.props.isSourceOnIgnoreList) {
+ this.setAllBlackboxLines(editor);
+ return;
+ }
+
+ // When `blackboxedRangesForSelectedSource` is defined and the array is empty,
+ // the whole source was blackboxed.
+ if (!blackboxedRangesForSelectedSource.length) {
+ this.setAllBlackboxLines(editor);
+ } else {
+ editor.codeMirror.operation(() => {
+ blackboxedRangesForSelectedSource.forEach(range => {
+ const start = toEditorLine(selectedSource.id, range.start.line);
+ const end = toEditorLine(selectedSource.id, range.end.line);
+ editor.codeMirror.eachLine(start, end, lineHandle => {
+ this.setBlackboxLine(editor, lineHandle);
+ });
+ });
+ });
+ }
+ }
+
+ componentDidUpdate() {
+ const {
+ selectedSource,
+ blackboxedRangesForSelectedSource,
+ editor,
+ isSourceOnIgnoreList,
+ } = this.props;
+
+ if (this.props.isSourceOnIgnoreList) {
+ this.setAllBlackboxLines(editor);
+ return;
+ }
+
+ // when unblackboxed
+ if (!blackboxedRangesForSelectedSource) {
+ this.clearAllBlackboxLines(editor);
+ return;
+ }
+
+ // When the whole source is blackboxed
+ if (!blackboxedRangesForSelectedSource.length) {
+ this.setAllBlackboxLines(editor);
+ return;
+ }
+
+ const sourceIsWasm = isWasm(selectedSource.id);
+
+ // TODO: Possible perf improvement. Instead of going
+ // over all the lines each time get diffs of what has
+ // changed and update those.
+ editor.codeMirror.operation(() => {
+ editor.codeMirror.eachLine(lineHandle => {
+ const line = fromEditorLine(
+ selectedSource.id,
+ editor.codeMirror.getLineNumber(lineHandle),
+ sourceIsWasm
+ );
+
+ if (
+ isLineBlackboxed(
+ blackboxedRangesForSelectedSource,
+ line,
+ isSourceOnIgnoreList
+ )
+ ) {
+ this.setBlackboxLine(editor, lineHandle);
+ } else {
+ this.clearBlackboxLine(editor, lineHandle);
+ }
+ });
+ });
+ }
+
+ componentWillUnmount() {
+ // Lets make sure we remove everything relating to
+ // blackboxing lines when this component is unmounted.
+ this.clearAllBlackboxLines(this.props.editor);
+ }
+
+ clearAllBlackboxLines(editor) {
+ editor.codeMirror.operation(() => {
+ editor.codeMirror.eachLine(lineHandle => {
+ this.clearBlackboxLine(editor, lineHandle);
+ });
+ });
+ }
+
+ setAllBlackboxLines(editor) {
+ //TODO:We might be able to handle the whole source
+ // than adding the blackboxing line by line
+ editor.codeMirror.operation(() => {
+ editor.codeMirror.eachLine(lineHandle => {
+ this.setBlackboxLine(editor, lineHandle);
+ });
+ });
+ }
+
+ clearBlackboxLine(editor, lineHandle) {
+ editor.codeMirror.removeLineClass(lineHandle, "wrap", "blackboxed-line");
+ }
+
+ setBlackboxLine(editor, lineHandle) {
+ editor.codeMirror.addLineClass(lineHandle, "wrap", "blackboxed-line");
+ }
+
+ render() {
+ return null;
+ }
+}
+
+export default BlackboxLines;
diff --git a/devtools/client/debugger/src/components/Editor/Breakpoint.js b/devtools/client/debugger/src/components/Editor/Breakpoint.js
new file mode 100644
index 0000000000..cce23c199f
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Breakpoint.js
@@ -0,0 +1,183 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { PureComponent } from "react";
+import PropTypes from "prop-types";
+
+import { getDocument, toEditorLine } from "../../utils/editor";
+import { getSelectedLocation } from "../../utils/selected-location";
+import { features } from "../../utils/prefs";
+import { showMenu } from "../../context-menu/menu";
+import { breakpointItems } from "./menus/breakpoints";
+const classnames = require("devtools/client/shared/classnames.js");
+
+const breakpointSvg = document.createElement("div");
+breakpointSvg.innerHTML =
+ '<svg viewBox="0 0 60 15" width="60" height="15"><path d="M53.07.5H1.5c-.54 0-1 .46-1 1v12c0 .54.46 1 1 1h51.57c.58 0 1.15-.26 1.53-.7l4.7-6.3-4.7-6.3c-.38-.44-.95-.7-1.53-.7z"/></svg>';
+
+class Breakpoint extends PureComponent {
+ static get propTypes() {
+ return {
+ cx: PropTypes.object.isRequired,
+ breakpoint: PropTypes.object.isRequired,
+ breakpointActions: PropTypes.object.isRequired,
+ editor: PropTypes.object.isRequired,
+ editorActions: PropTypes.object.isRequired,
+ selectedSource: PropTypes.object,
+ blackboxedRangesForSelectedSource: PropTypes.array,
+ isSelectedSourceOnIgnoreList: PropTypes.bool.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.addBreakpoint(this.props);
+ }
+
+ componentDidUpdate(prevProps) {
+ this.removeBreakpoint(prevProps);
+ this.addBreakpoint(this.props);
+ }
+
+ componentWillUnmount() {
+ this.removeBreakpoint(this.props);
+ }
+
+ makeMarker() {
+ const { breakpoint } = this.props;
+ const bp = breakpointSvg.cloneNode(true);
+
+ bp.className = classnames("editor new-breakpoint", {
+ "breakpoint-disabled": breakpoint.disabled,
+ "folding-enabled": features.codeFolding,
+ });
+ bp.onmousedown = this.onClick;
+ bp.oncontextmenu = this.onContextMenu;
+
+ return bp;
+ }
+
+ onClick = event => {
+ const { cx, breakpointActions, editorActions, breakpoint, selectedSource } =
+ this.props;
+
+ // ignore right clicks
+ if ((event.ctrlKey && event.button === 0) || event.button === 2) {
+ return;
+ }
+
+ event.stopPropagation();
+ event.preventDefault();
+
+ const selectedLocation = getSelectedLocation(breakpoint, selectedSource);
+ if (event.metaKey) {
+ editorActions.continueToHere(cx, selectedLocation);
+ return;
+ }
+
+ if (event.shiftKey) {
+ breakpointActions.toggleBreakpointsAtLine(
+ cx,
+ !breakpoint.disabled,
+ selectedLocation.line
+ );
+ return;
+ }
+
+ breakpointActions.removeBreakpointsAtLine(
+ cx,
+ selectedLocation.sourceId,
+ selectedLocation.line
+ );
+ };
+
+ onContextMenu = event => {
+ const {
+ cx,
+ breakpoint,
+ selectedSource,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList,
+ } = this.props;
+ event.stopPropagation();
+ event.preventDefault();
+ const selectedLocation = getSelectedLocation(breakpoint, selectedSource);
+
+ showMenu(
+ event,
+ breakpointItems(
+ cx,
+ breakpoint,
+ selectedLocation,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList
+ )
+ );
+ };
+
+ addBreakpoint(props) {
+ const { breakpoint, editor, selectedSource } = props;
+ const selectedLocation = getSelectedLocation(breakpoint, selectedSource);
+
+ // Hidden Breakpoints are never rendered on the client
+ if (breakpoint.options.hidden) {
+ return;
+ }
+
+ if (!selectedSource) {
+ return;
+ }
+
+ const sourceId = selectedSource.id;
+ const line = toEditorLine(sourceId, selectedLocation.line);
+ const doc = getDocument(sourceId);
+
+ doc.setGutterMarker(line, "breakpoints", this.makeMarker());
+
+ editor.codeMirror.addLineClass(line, "wrap", "new-breakpoint");
+ editor.codeMirror.removeLineClass(line, "wrap", "breakpoint-disabled");
+ editor.codeMirror.removeLineClass(line, "wrap", "has-condition");
+ editor.codeMirror.removeLineClass(line, "wrap", "has-log");
+
+ if (breakpoint.disabled) {
+ editor.codeMirror.addLineClass(line, "wrap", "breakpoint-disabled");
+ }
+
+ if (breakpoint.options.logValue) {
+ editor.codeMirror.addLineClass(line, "wrap", "has-log");
+ } else if (breakpoint.options.condition) {
+ editor.codeMirror.addLineClass(line, "wrap", "has-condition");
+ }
+ }
+
+ removeBreakpoint(props) {
+ const { selectedSource, breakpoint } = props;
+ if (!selectedSource) {
+ return;
+ }
+
+ const sourceId = selectedSource.id;
+ const doc = getDocument(sourceId);
+
+ if (!doc) {
+ return;
+ }
+
+ const selectedLocation = getSelectedLocation(breakpoint, selectedSource);
+ const line = toEditorLine(sourceId, selectedLocation.line);
+
+ doc.setGutterMarker(line, "breakpoints", null);
+ doc.removeLineClass(line, "wrap", "new-breakpoint");
+ doc.removeLineClass(line, "wrap", "breakpoint-disabled");
+ doc.removeLineClass(line, "wrap", "has-condition");
+ doc.removeLineClass(line, "wrap", "has-log");
+ }
+
+ render() {
+ return null;
+ }
+}
+
+export default Breakpoint;
diff --git a/devtools/client/debugger/src/components/Editor/Breakpoints.css b/devtools/client/debugger/src/components/Editor/Breakpoints.css
new file mode 100644
index 0000000000..1269f73f82
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Breakpoints.css
@@ -0,0 +1,153 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.theme-light {
+ --gutter-hover-background-color: #dde1e4;
+ --breakpoint-fill: var(--blue-50);
+ --breakpoint-stroke: var(--blue-60);
+}
+
+.theme-dark {
+ --gutter-hover-background-color: #414141;
+ --breakpoint-fill: var(--blue-55);
+ --breakpoint-stroke: var(--blue-40);
+}
+
+.theme-light,
+.theme-dark {
+ --logpoint-fill: var(--theme-graphs-purple);
+ --logpoint-stroke: var(--purple-60);
+ --breakpoint-condition-fill: var(--theme-graphs-yellow);
+ --breakpoint-condition-stroke: var(--theme-graphs-orange);
+ --breakpoint-skipped-opacity: 0.15;
+ --breakpoint-inactive-opacity: 0.3;
+ --breakpoint-disabled-opacity: 0.6;
+}
+
+/* Standard gutter breakpoints */
+.editor-wrapper .breakpoints {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+.new-breakpoint .CodeMirror-linenumber {
+ pointer-events: none;
+}
+
+.editor-wrapper :not(.empty-line, .new-breakpoint)
+ > .CodeMirror-gutter-wrapper
+ > .CodeMirror-linenumber:hover::after {
+ content: "";
+ position: absolute;
+ /* paint below the number */
+ z-index: -1;
+ top: 0;
+ left: 0;
+ right: -4px;
+ bottom: 0;
+ height: 15px;
+ background-color: var(--gutter-hover-background-color);
+ mask: url(chrome://devtools/content/debugger/images/breakpoint.svg)
+ no-repeat;
+ mask-size: auto 15px;
+ mask-position: right;
+}
+
+.editor.new-breakpoint svg {
+ fill: var(--breakpoint-fill);
+ stroke: var(--breakpoint-stroke);
+ width: 60px;
+ height: 15px;
+ position: absolute;
+ top: 0px;
+ right: -4px;
+}
+
+.editor .breakpoint {
+ position: absolute;
+ right: -2px;
+}
+
+.editor.new-breakpoint.folding-enabled svg {
+ right: -16px;
+}
+
+.new-breakpoint.has-condition .CodeMirror-gutter-wrapper svg {
+ fill: var(--breakpoint-condition-fill);
+ stroke: var(--breakpoint-condition-stroke);
+}
+
+.new-breakpoint.has-log .CodeMirror-gutter-wrapper svg {
+ fill: var(--logpoint-fill);
+ stroke: var(--logpoint-stroke);
+}
+
+.editor.new-breakpoint.breakpoint-disabled svg,
+.blackboxed-line .editor.new-breakpoint svg {
+ fill-opacity: var(--breakpoint-disabled-opacity);
+ stroke-opacity: var(--breakpoint-disabled-opacity);
+}
+
+.editor-wrapper.skip-pausing .editor.new-breakpoint svg {
+ fill-opacity: var(--breakpoint-skipped-opacity);
+}
+
+/* Columnn breakpoints */
+.column-breakpoint {
+ display: inline;
+ padding-inline-start: 1px;
+ padding-inline-end: 1px;
+}
+
+.column-breakpoint:hover {
+ background-color: transparent;
+}
+
+.column-breakpoint svg {
+ display: inline-block;
+ cursor: pointer;
+ height: 13px;
+ width: 11px;
+ vertical-align: top;
+ fill: var(--breakpoint-fill);
+ stroke: var(--breakpoint-stroke);
+ fill-opacity: var(--breakpoint-inactive-opacity);
+ stroke-opacity: var(--breakpoint-inactive-opacity);
+}
+
+.column-breakpoint.active svg {
+ fill: var(--breakpoint-fill);
+ stroke: var(--breakpoint-stroke);
+ fill-opacity: 1;
+ stroke-opacity: 1;
+}
+
+.column-breakpoint.disabled svg {
+ fill-opacity: var(--breakpoint-disabled-opacity);
+ stroke-opacity: var(--breakpoint-disabled-opacity);
+}
+
+.column-breakpoint.has-log.disabled svg {
+ fill-opacity: 0.5;
+ stroke-opacity: 0.5;
+}
+
+.column-breakpoint.has-condition svg {
+ fill: var(--breakpoint-condition-fill);
+ stroke: var(--breakpoint-condition-stroke);
+}
+
+.column-breakpoint.has-log svg {
+ fill: var(--logpoint-fill);
+ stroke: var(--logpoint-stroke);
+}
+
+.editor-wrapper.skip-pausing .column-breakpoint svg {
+ fill-opacity: var(--breakpoint-skipped-opacity);
+}
+
+.img.column-marker {
+ background-image: url(chrome://devtools/content/debugger/images/column-marker.svg);
+}
diff --git a/devtools/client/debugger/src/components/Editor/Breakpoints.js b/devtools/client/debugger/src/components/Editor/Breakpoints.js
new file mode 100644
index 0000000000..36added4ee
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Breakpoints.js
@@ -0,0 +1,96 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import PropTypes from "prop-types";
+import React, { Component } from "react";
+import Breakpoint from "./Breakpoint";
+
+import {
+ getSelectedSource,
+ getFirstVisibleBreakpoints,
+ getBlackBoxRanges,
+ isSourceMapIgnoreListEnabled,
+ isSourceOnSourceMapIgnoreList,
+} from "../../selectors";
+import { makeBreakpointId } from "../../utils/breakpoint";
+import { connect } from "../../utils/connect";
+import { breakpointItemActions } from "./menus/breakpoints";
+import { editorItemActions } from "./menus/editor";
+
+class Breakpoints extends Component {
+ static get propTypes() {
+ return {
+ cx: PropTypes.object,
+ breakpoints: PropTypes.array,
+ editor: PropTypes.object,
+ breakpointActions: PropTypes.object,
+ editorActions: PropTypes.object,
+ selectedSource: PropTypes.object,
+ blackboxedRanges: PropTypes.object,
+ isSelectedSourceOnIgnoreList: PropTypes.bool,
+ blackboxedRangesForSelectedSource: PropTypes.array,
+ };
+ }
+ render() {
+ const {
+ cx,
+ breakpoints,
+ selectedSource,
+ editor,
+ breakpointActions,
+ editorActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList,
+ } = this.props;
+
+ if (!selectedSource || !breakpoints) {
+ return null;
+ }
+
+ return (
+ <div>
+ {breakpoints.map(bp => {
+ return (
+ <Breakpoint
+ cx={cx}
+ key={makeBreakpointId(bp.location)}
+ breakpoint={bp}
+ selectedSource={selectedSource}
+ blackboxedRangesForSelectedSource={
+ blackboxedRangesForSelectedSource
+ }
+ isSelectedSourceOnIgnoreList={isSelectedSourceOnIgnoreList}
+ editor={editor}
+ breakpointActions={breakpointActions}
+ editorActions={editorActions}
+ />
+ );
+ })}
+ </div>
+ );
+ }
+}
+
+export default connect(
+ state => {
+ const selectedSource = getSelectedSource(state);
+ const blackboxedRanges = getBlackBoxRanges(state);
+ return {
+ // Retrieves only the first breakpoint per line so that the
+ // breakpoint marker represents only the first breakpoint
+ breakpoints: getFirstVisibleBreakpoints(state),
+ selectedSource,
+ blackboxedRangesForSelectedSource:
+ selectedSource && blackboxedRanges[selectedSource.url],
+ isSelectedSourceOnIgnoreList:
+ selectedSource &&
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, selectedSource),
+ };
+ },
+ dispatch => ({
+ breakpointActions: breakpointItemActions(dispatch),
+ editorActions: editorItemActions(dispatch),
+ })
+)(Breakpoints);
diff --git a/devtools/client/debugger/src/components/Editor/ColumnBreakpoint.js b/devtools/client/debugger/src/components/Editor/ColumnBreakpoint.js
new file mode 100644
index 0000000000..0577a61f5c
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/ColumnBreakpoint.js
@@ -0,0 +1,140 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { PureComponent } from "react";
+import PropTypes from "prop-types";
+import { showMenu } from "../../context-menu/menu";
+
+import { getDocument } from "../../utils/editor";
+import { breakpointItems, createBreakpointItems } from "./menus/breakpoints";
+import { getSelectedLocation } from "../../utils/selected-location";
+const classnames = require("devtools/client/shared/classnames.js");
+
+// eslint-disable-next-line max-len
+
+const breakpointButton = document.createElement("button");
+breakpointButton.innerHTML =
+ '<svg viewBox="0 0 11 13" width="11" height="13"><path d="M5.07.5H1.5c-.54 0-1 .46-1 1v10c0 .54.46 1 1 1h3.57c.58 0 1.15-.26 1.53-.7l3.7-5.3-3.7-5.3C6.22.76 5.65.5 5.07.5z"/></svg>';
+
+function makeBookmark({ breakpoint }, { onClick, onContextMenu }) {
+ const bp = breakpointButton.cloneNode(true);
+
+ const isActive = breakpoint && !breakpoint.disabled;
+ const isDisabled = breakpoint?.disabled;
+ const condition = breakpoint?.options.condition;
+ const logValue = breakpoint?.options.logValue;
+
+ bp.className = classnames("column-breakpoint", {
+ "has-condition": condition,
+ "has-log": logValue,
+ active: isActive,
+ disabled: isDisabled,
+ });
+
+ bp.setAttribute("title", logValue || condition || "");
+ bp.onclick = onClick;
+ bp.oncontextmenu = onContextMenu;
+
+ return bp;
+}
+
+export default class ColumnBreakpoint extends PureComponent {
+ bookmark;
+
+ static get propTypes() {
+ return {
+ breakpointActions: PropTypes.object.isRequired,
+ columnBreakpoint: PropTypes.object.isRequired,
+ cx: PropTypes.object.isRequired,
+ source: PropTypes.object.isRequired,
+ };
+ }
+
+ addColumnBreakpoint = nextProps => {
+ const { columnBreakpoint, source } = nextProps || this.props;
+
+ const sourceId = source.id;
+ const doc = getDocument(sourceId);
+ if (!doc) {
+ return;
+ }
+
+ const { line, column } = columnBreakpoint.location;
+ const widget = makeBookmark(columnBreakpoint, {
+ onClick: this.onClick,
+ onContextMenu: this.onContextMenu,
+ });
+
+ this.bookmark = doc.setBookmark({ line: line - 1, ch: column }, { widget });
+ };
+
+ clearColumnBreakpoint = () => {
+ if (this.bookmark) {
+ this.bookmark.clear();
+ this.bookmark = null;
+ }
+ };
+
+ onClick = event => {
+ event.stopPropagation();
+ event.preventDefault();
+ const { cx, columnBreakpoint, breakpointActions } = this.props;
+
+ // disable column breakpoint on shift-click.
+ if (event.shiftKey) {
+ const breakpoint = columnBreakpoint.breakpoint;
+ breakpointActions.toggleDisabledBreakpoint(cx, breakpoint);
+ return;
+ }
+
+ if (columnBreakpoint.breakpoint) {
+ breakpointActions.removeBreakpoint(cx, columnBreakpoint.breakpoint);
+ } else {
+ breakpointActions.addBreakpoint(cx, columnBreakpoint.location);
+ }
+ };
+
+ onContextMenu = event => {
+ event.stopPropagation();
+ event.preventDefault();
+ const {
+ cx,
+ columnBreakpoint: { breakpoint, location },
+ source,
+ breakpointActions,
+ } = this.props;
+
+ let items = createBreakpointItems(cx, location, breakpointActions);
+
+ if (breakpoint) {
+ const selectedLocation = getSelectedLocation(breakpoint, source);
+
+ items = breakpointItems(
+ cx,
+ breakpoint,
+ selectedLocation,
+ breakpointActions
+ );
+ }
+
+ showMenu(event, items);
+ };
+
+ componentDidMount() {
+ this.addColumnBreakpoint();
+ }
+
+ componentWillUnmount() {
+ this.clearColumnBreakpoint();
+ }
+
+ componentDidUpdate() {
+ this.clearColumnBreakpoint();
+ this.addColumnBreakpoint();
+ }
+
+ render() {
+ return null;
+ }
+}
diff --git a/devtools/client/debugger/src/components/Editor/ColumnBreakpoints.js b/devtools/client/debugger/src/components/Editor/ColumnBreakpoints.js
new file mode 100644
index 0000000000..62c2ab29e3
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/ColumnBreakpoints.js
@@ -0,0 +1,75 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+
+import ColumnBreakpoint from "./ColumnBreakpoint";
+
+import {
+ getSelectedSource,
+ visibleColumnBreakpoints,
+ getContext,
+ isSourceBlackBoxed,
+} from "../../selectors";
+import { connect } from "../../utils/connect";
+import { makeBreakpointId } from "../../utils/breakpoint";
+import { breakpointItemActions } from "./menus/breakpoints";
+
+// eslint-disable-next-line max-len
+
+class ColumnBreakpoints extends Component {
+ static get propTypes() {
+ return {
+ breakpointActions: PropTypes.object.isRequired,
+ columnBreakpoints: PropTypes.array.isRequired,
+ cx: PropTypes.object.isRequired,
+ editor: PropTypes.object.isRequired,
+ selectedSource: PropTypes.object,
+ };
+ }
+
+ render() {
+ const { cx, editor, columnBreakpoints, selectedSource, breakpointActions } =
+ this.props;
+
+ if (!selectedSource || columnBreakpoints.length === 0) {
+ return null;
+ }
+
+ let breakpoints;
+ editor.codeMirror.operation(() => {
+ breakpoints = columnBreakpoints.map(breakpoint => (
+ <ColumnBreakpoint
+ cx={cx}
+ key={makeBreakpointId(breakpoint.location)}
+ columnBreakpoint={breakpoint}
+ editor={editor}
+ source={selectedSource}
+ breakpointActions={breakpointActions}
+ />
+ ));
+ });
+ return <div>{breakpoints}</div>;
+ }
+}
+
+const mapStateToProps = state => {
+ // Avoid rendering this component is there is no selected source,
+ // or if the selected source is blackboxed.
+ // Also avoid computing visible column breakpoint when this happens.
+ const selectedSource = getSelectedSource(state);
+ if (!selectedSource || isSourceBlackBoxed(state, selectedSource)) {
+ return {};
+ }
+ return {
+ cx: getContext(state),
+ selectedSource,
+ columnBreakpoints: visibleColumnBreakpoints(state),
+ };
+};
+
+export default connect(mapStateToProps, dispatch => ({
+ breakpointActions: breakpointItemActions(dispatch),
+}))(ColumnBreakpoints);
diff --git a/devtools/client/debugger/src/components/Editor/ConditionalPanel.css b/devtools/client/debugger/src/components/Editor/ConditionalPanel.css
new file mode 100644
index 0000000000..4ce8dbcd8c
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/ConditionalPanel.css
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.conditional-breakpoint-panel {
+ cursor: initial;
+ margin: 1em 0;
+ position: relative;
+ display: flex;
+ align-items: center;
+ background: var(--theme-toolbar-background);
+ border-top: 1px solid var(--theme-splitter-color);
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.conditional-breakpoint-panel .prompt {
+ font-size: 1.8em;
+ color: var(--theme-graphs-orange);
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-bottom: 3px;
+ text-align: right;
+ width: 30px;
+ align-self: baseline;
+ margin-top: 3px;
+}
+
+.conditional-breakpoint-panel.log-point .prompt {
+ color: var(--purple-60);
+}
+
+.conditional-breakpoint-panel .CodeMirror {
+ margin: 6px 10px;
+}
+
+.conditional-breakpoint-panel .CodeMirror pre.CodeMirror-placeholder {
+ /* Match the color of the placeholder text to existing inputs in the Debugger */
+ color: var(--theme-text-color-alt);
+}
diff --git a/devtools/client/debugger/src/components/Editor/ConditionalPanel.js b/devtools/client/debugger/src/components/Editor/ConditionalPanel.js
new file mode 100644
index 0000000000..e451ffa960
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/ConditionalPanel.js
@@ -0,0 +1,274 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import ReactDOM from "react-dom";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import "./ConditionalPanel.css";
+import { toEditorLine } from "../../utils/editor";
+import { prefs } from "../../utils/prefs";
+import actions from "../../actions";
+
+import {
+ getClosestBreakpoint,
+ getConditionalPanelLocation,
+ getLogPointStatus,
+ getContext,
+} from "../../selectors";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+function addNewLine(doc) {
+ const cursor = doc.getCursor();
+ const pos = { line: cursor.line, ch: cursor.ch };
+ doc.replaceRange("\n", pos);
+}
+
+export class ConditionalPanel extends PureComponent {
+ cbPanel;
+ input;
+ codeMirror;
+ panelNode;
+ scrollParent;
+
+ constructor() {
+ super();
+ this.cbPanel = null;
+ }
+
+ static get propTypes() {
+ return {
+ breakpoint: PropTypes.object,
+ closeConditionalPanel: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ editor: PropTypes.object.isRequired,
+ location: PropTypes.any.isRequired,
+ log: PropTypes.bool.isRequired,
+ openConditionalPanel: PropTypes.func.isRequired,
+ setBreakpointOptions: PropTypes.func.isRequired,
+ };
+ }
+
+ keepFocusOnInput() {
+ if (this.input) {
+ this.input.focus();
+ }
+ }
+
+ saveAndClose = () => {
+ if (this.input) {
+ this.setBreakpoint(this.input.value.trim());
+ }
+
+ this.props.closeConditionalPanel();
+ };
+
+ onKey = e => {
+ if (e.key === "Enter") {
+ if (this.codeMirror && e.altKey) {
+ addNewLine(this.codeMirror.doc);
+ } else {
+ this.saveAndClose();
+ }
+ } else if (e.key === "Escape") {
+ this.props.closeConditionalPanel();
+ }
+ };
+
+ setBreakpoint(value) {
+ const { cx, log, breakpoint } = this.props;
+ // If breakpoint is `pending`, props will not contain a breakpoint.
+ // If source is a URL without location, breakpoint will contain no generatedLocation.
+ const location =
+ breakpoint && breakpoint.generatedLocation
+ ? breakpoint.generatedLocation
+ : this.props.location;
+ const options = breakpoint ? breakpoint.options : {};
+ const type = log ? "logValue" : "condition";
+ return this.props.setBreakpointOptions(cx, location, {
+ ...options,
+ [type]: value,
+ });
+ }
+
+ clearConditionalPanel() {
+ if (this.cbPanel) {
+ this.cbPanel.clear();
+ this.cbPanel = null;
+ }
+ if (this.scrollParent) {
+ this.scrollParent.removeEventListener("scroll", this.repositionOnScroll);
+ }
+ }
+
+ repositionOnScroll = () => {
+ if (this.panelNode && this.scrollParent) {
+ const { scrollLeft } = this.scrollParent;
+ this.panelNode.style.transform = `translateX(${scrollLeft}px)`;
+ }
+ };
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillMount() {
+ return this.renderToWidget(this.props);
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillUpdate() {
+ return this.clearConditionalPanel();
+ }
+
+ componentDidUpdate(prevProps) {
+ this.keepFocusOnInput();
+ }
+
+ componentWillUnmount() {
+ // This is called if CodeMirror is re-initializing itself before the
+ // user closes the conditional panel. Clear the widget, and re-render it
+ // as soon as this component gets remounted
+ return this.clearConditionalPanel();
+ }
+
+ renderToWidget(props) {
+ if (this.cbPanel) {
+ this.clearConditionalPanel();
+ }
+ const { location, editor } = props;
+
+ const editorLine = toEditorLine(location.sourceId, location.line || 0);
+ this.cbPanel = editor.codeMirror.addLineWidget(
+ editorLine,
+ this.renderConditionalPanel(props),
+ {
+ coverGutter: true,
+ noHScroll: true,
+ }
+ );
+
+ if (this.input) {
+ let parent = this.input.parentNode;
+ while (parent) {
+ if (
+ parent instanceof HTMLElement &&
+ parent.classList.contains("CodeMirror-scroll")
+ ) {
+ this.scrollParent = parent;
+ break;
+ }
+ parent = parent.parentNode;
+ }
+
+ if (this.scrollParent) {
+ this.scrollParent.addEventListener("scroll", this.repositionOnScroll);
+ this.repositionOnScroll();
+ }
+ }
+ }
+
+ createEditor = input => {
+ const { log, editor, closeConditionalPanel } = this.props;
+ const codeMirror = editor.CodeMirror.fromTextArea(input, {
+ mode: "javascript",
+ theme: "mozilla",
+ placeholder: L10N.getStr(
+ log
+ ? "editor.conditionalPanel.logPoint.placeholder2"
+ : "editor.conditionalPanel.placeholder2"
+ ),
+ cursorBlinkRate: prefs.cursorBlinkRate,
+ });
+
+ codeMirror.on("keydown", (cm, e) => {
+ if (e.key === "Enter") {
+ e.codemirrorIgnore = true;
+ }
+ });
+
+ codeMirror.on("blur", (cm, e) => {
+ if (
+ e?.relatedTarget &&
+ e.relatedTarget.closest(".conditional-breakpoint-panel")
+ ) {
+ return;
+ }
+
+ closeConditionalPanel();
+ });
+
+ const codeMirrorWrapper = codeMirror.getWrapperElement();
+
+ codeMirrorWrapper.addEventListener("keydown", e => {
+ codeMirror.save();
+ this.onKey(e);
+ });
+
+ this.input = input;
+ this.codeMirror = codeMirror;
+ codeMirror.focus();
+ codeMirror.setCursor(codeMirror.lineCount(), 0);
+ };
+
+ getDefaultValue() {
+ const { breakpoint, log } = this.props;
+ const options = breakpoint?.options || {};
+ return log ? options.logValue : options.condition;
+ }
+
+ renderConditionalPanel(props) {
+ const { log } = props;
+ const defaultValue = this.getDefaultValue();
+
+ const panel = document.createElement("div");
+ ReactDOM.render(
+ <div
+ className={classnames("conditional-breakpoint-panel", {
+ "log-point": log,
+ })}
+ onClick={() => this.keepFocusOnInput()}
+ ref={node => (this.panelNode = node)}
+ >
+ <div className="prompt">»</div>
+ <textarea
+ defaultValue={defaultValue}
+ ref={input => this.createEditor(input)}
+ />
+ </div>,
+ panel
+ );
+ return panel;
+ }
+
+ render() {
+ return null;
+ }
+}
+
+const mapStateToProps = state => {
+ const location = getConditionalPanelLocation(state);
+
+ if (!location) {
+ throw new Error("Conditional panel location needed.");
+ }
+
+ const breakpoint = getClosestBreakpoint(state, location);
+
+ return {
+ cx: getContext(state),
+ breakpoint,
+ location,
+ log: getLogPointStatus(state),
+ };
+};
+
+const { setBreakpointOptions, openConditionalPanel, closeConditionalPanel } =
+ actions;
+
+const mapDispatchToProps = {
+ setBreakpointOptions,
+ openConditionalPanel,
+ closeConditionalPanel,
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(ConditionalPanel);
diff --git a/devtools/client/debugger/src/components/Editor/DebugLine.js b/devtools/client/debugger/src/components/Editor/DebugLine.js
new file mode 100644
index 0000000000..95cfc5a94d
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/DebugLine.js
@@ -0,0 +1,138 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { PureComponent } from "react";
+import PropTypes from "prop-types";
+import {
+ toEditorPosition,
+ getDocument,
+ hasDocument,
+ startOperation,
+ endOperation,
+ getTokenEnd,
+} from "../../utils/editor";
+import { isException } from "../../utils/pause";
+import { getIndentation } from "../../utils/indentation";
+import { connect } from "../../utils/connect";
+import {
+ getVisibleSelectedFrame,
+ getPauseReason,
+ getSourceTextContent,
+ getCurrentThread,
+} from "../../selectors";
+
+export class DebugLine extends PureComponent {
+ debugExpression;
+
+ static get propTypes() {
+ return {
+ location: PropTypes.object,
+ why: PropTypes.object,
+ };
+ }
+
+ componentDidMount() {
+ const { why, location } = this.props;
+ this.setDebugLine(why, location);
+ }
+
+ componentWillUnmount() {
+ const { why, location } = this.props;
+ this.clearDebugLine(why, location);
+ }
+
+ componentDidUpdate(prevProps) {
+ const { why, location } = this.props;
+
+ startOperation();
+ this.clearDebugLine(prevProps.why, prevProps.location);
+ this.setDebugLine(why, location);
+ endOperation();
+ }
+
+ setDebugLine(why, location) {
+ if (!location) {
+ return;
+ }
+ const { sourceId } = location;
+ const doc = getDocument(sourceId);
+
+ let { line, column } = toEditorPosition(location);
+ let { markTextClass, lineClass } = this.getTextClasses(why);
+ doc.addLineClass(line, "wrap", lineClass);
+
+ const lineText = doc.getLine(line);
+ column = Math.max(column, getIndentation(lineText));
+
+ // If component updates because user clicks on
+ // another source tab, codeMirror will be null.
+ const columnEnd = doc.cm ? getTokenEnd(doc.cm, line, column) : null;
+
+ if (columnEnd === null) {
+ markTextClass += " to-line-end";
+ }
+
+ this.debugExpression = doc.markText(
+ { ch: column, line },
+ { ch: columnEnd, line },
+ { className: markTextClass }
+ );
+ }
+
+ clearDebugLine(why, location) {
+ // Avoid clearing the line if we didn't set a debug line before,
+ // or, if the document is no longer available
+ if (!location || !hasDocument(location.sourceId)) {
+ return;
+ }
+
+ if (this.debugExpression) {
+ this.debugExpression.clear();
+ }
+
+ const { line } = toEditorPosition(location);
+ const doc = getDocument(location.sourceId);
+ const { lineClass } = this.getTextClasses(why);
+ doc.removeLineClass(line, "wrap", lineClass);
+ }
+
+ getTextClasses(why) {
+ if (why && isException(why)) {
+ return {
+ markTextClass: "debug-expression-error",
+ lineClass: "new-debug-line-error",
+ };
+ }
+
+ return { markTextClass: "debug-expression", lineClass: "new-debug-line" };
+ }
+
+ render() {
+ return null;
+ }
+}
+
+function isDocumentReady(location, sourceTextContent) {
+ return location && sourceTextContent && hasDocument(location.sourceId);
+}
+
+const mapStateToProps = state => {
+ // Avoid unecessary intermediate updates when there is no location
+ // or the source text content isn't yet fully loaded
+ const frame = getVisibleSelectedFrame(state);
+ const location = frame?.location;
+ if (!location) {
+ return {};
+ }
+ const sourceTextContent = getSourceTextContent(state, location);
+ if (!isDocumentReady(location, sourceTextContent)) {
+ return {};
+ }
+ return {
+ location,
+ why: getPauseReason(state, getCurrentThread(state)),
+ };
+};
+
+export default connect(mapStateToProps)(DebugLine);
diff --git a/devtools/client/debugger/src/components/Editor/Editor.css b/devtools/client/debugger/src/components/Editor/Editor.css
new file mode 100644
index 0000000000..7ea45c629d
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Editor.css
@@ -0,0 +1,220 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.editor-wrapper {
+ --debug-line-border: rgb(145, 188, 219);
+ --debug-expression-background: rgba(202, 227, 255, 0.5);
+ --debug-line-error-border: rgb(255, 0, 0);
+ --debug-expression-error-background: rgba(231, 116, 113, 0.3);
+ --line-exception-background: hsl(344, 73%, 97%);
+ --highlight-line-duration: 5000ms;
+}
+
+.theme-dark .editor-wrapper {
+ --debug-expression-background: rgba(202, 227, 255, 0.3);
+ --debug-line-border: #7786a2;
+ --line-exception-background: hsl(345, 23%, 24%);
+}
+
+.editor-wrapper .CodeMirror-linewidget {
+ margin-right: -7px;
+}
+
+.editor-wrapper {
+ min-width: 0 !important;
+}
+
+.CodeMirror.cm-s-mozilla,
+.CodeMirror-scroll,
+.CodeMirror-sizer {
+ overflow-anchor: none;
+}
+
+/* Prevents inline preview from shifting source height (#1576163) */
+.CodeMirror-linewidget {
+ padding: 0;
+ display: flow-root;
+}
+
+/**
+ * There's a known codemirror flex issue with chrome that this addresses.
+ * BUG https://github.com/firefox-devtools/debugger/issues/63
+ */
+.editor-wrapper {
+ position: absolute;
+ width: calc(100% - 1px);
+ top: var(--editor-header-height);
+ bottom: var(--editor-footer-height);
+ left: 0px;
+}
+
+html[dir="rtl"] .editor-mount {
+ direction: ltr;
+}
+
+.function-search {
+ max-height: 300px;
+ overflow: hidden;
+}
+
+.function-search .results {
+ height: auto;
+}
+
+.editor.hit-marker {
+ height: 15px;
+}
+
+.editor-wrapper .highlight-lines {
+ background: var(--theme-selection-background-hover);
+}
+
+.CodeMirror {
+ width: 100%;
+ height: 100%;
+}
+
+.editor-wrapper .editor-mount {
+ width: 100%;
+ background-color: var(--theme-body-background);
+ font-size: var(--theme-code-font-size);
+ line-height: var(--theme-code-line-height);
+}
+
+/* set the linenumber white when there is a breakpoint */
+.editor-wrapper:not(.skip-pausing)
+ .new-breakpoint
+ .CodeMirror-gutter-wrapper
+ .CodeMirror-linenumber {
+ color: white;
+}
+
+/* move the breakpoint below the other gutter elements */
+.new-breakpoint .CodeMirror-gutter-elt:nth-child(2) {
+ z-index: 0;
+}
+
+.theme-dark .editor-wrapper .CodeMirror-line .cm-comment {
+ color: var(--theme-comment);
+}
+
+.debug-expression {
+ background-color: var(--debug-expression-background);
+ border-style: solid;
+ border-color: var(--debug-expression-background);
+ border-width: 1px 0px 1px 0px;
+ position: relative;
+}
+
+.debug-expression::before {
+ content: "";
+ line-height: 1px;
+ border-top: 1px solid var(--blue-50);
+ background: transparent;
+ position: absolute;
+ top: -2px;
+ left: 0px;
+ width: 100%;
+ }
+
+.debug-expression::after {
+ content: "";
+ line-height: 1px;
+ border-bottom: 1px solid var(--blue-50);
+ position: absolute;
+ bottom: -2px;
+ left: 0px;
+ width: 100%;
+ }
+
+.to-line-end ~ .CodeMirror-widget {
+ background-color: var(--debug-expression-background);
+}
+
+.debug-expression-error {
+ background-color: var(--debug-expression-error-background);
+}
+
+.new-debug-line > .CodeMirror-line {
+ background-color: transparent !important;
+ outline: var(--debug-line-border) solid 1px;
+}
+
+/* Don't display the highlight color since the debug line
+ is already highlighted */
+.new-debug-line .CodeMirror-activeline-background {
+ display: none;
+}
+
+.new-debug-line-error > .CodeMirror-line {
+ background-color: var(--debug-expression-error-background) !important;
+ outline: var(--debug-line-error-border) solid 1px;
+}
+
+/* Don't display the highlight color since the debug line
+ is already highlighted */
+.new-debug-line-error .CodeMirror-activeline-background {
+ display: none;
+}
+.highlight-line .CodeMirror-line {
+ animation-name: fade-highlight-out;
+ animation-duration: var(--highlight-line-duration);
+ animation-timing-function: ease-out;
+ animation-direction: forwards;
+}
+
+@keyframes fade-highlight-out {
+ 0% {
+ background-color: var(--theme-contrast-background);
+ }
+ 30% {
+ background-color: var(--theme-contrast-background);
+ }
+ 100% {
+ background-color: transparent;
+ }
+}
+
+.visible {
+ visibility: visible;
+}
+
+/* Code folding */
+.editor-wrapper .CodeMirror-foldgutter-open {
+ color: var(--grey-40);
+}
+
+.editor-wrapper .CodeMirror-foldgutter-open,
+.editor-wrapper .CodeMirror-foldgutter-folded {
+ fill: var(--grey-40);
+}
+
+.editor-wrapper .CodeMirror-foldgutter-open::before,
+.editor-wrapper .CodeMirror-foldgutter-open::after {
+ border-top: none;
+}
+
+.editor-wrapper .CodeMirror-foldgutter-folded::before,
+.editor-wrapper .CodeMirror-foldgutter-folded::after {
+ border-left: none;
+}
+
+.editor-wrapper .CodeMirror-foldgutter .CodeMirror-guttermarker-subtle {
+ visibility: visible;
+}
+
+.editor-wrapper .CodeMirror-foldgutter .CodeMirror-linenumber {
+ text-align: left;
+ padding: 0 0 0 2px;
+}
+
+/* Exception line */
+.line-exception {
+ background-color: var(--line-exception-background);
+}
+
+.mark-text-exception {
+ text-decoration: var(--red-50) wavy underline;
+ text-decoration-skip-ink: none;
+}
diff --git a/devtools/client/debugger/src/components/Editor/EditorMenu.js b/devtools/client/debugger/src/components/Editor/EditorMenu.js
new file mode 100644
index 0000000000..a865fcc9bd
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/EditorMenu.js
@@ -0,0 +1,111 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { Component } from "react";
+import PropTypes from "prop-types";
+
+import { connect } from "../../utils/connect";
+import { showMenu } from "../../context-menu/menu";
+
+import { getSourceLocationFromMouseEvent } from "../../utils/editor";
+import { isPretty } from "../../utils/source";
+import {
+ getPrettySource,
+ getIsCurrentThreadPaused,
+ getThreadContext,
+ isSourceWithMap,
+ getBlackBoxRanges,
+ isSourceOnSourceMapIgnoreList,
+ isSourceMapIgnoreListEnabled,
+} from "../../selectors";
+
+import { editorMenuItems, editorItemActions } from "./menus/editor";
+
+class EditorMenu extends Component {
+ static get propTypes() {
+ return {
+ clearContextMenu: PropTypes.func.isRequired,
+ contextMenu: PropTypes.object,
+ isSourceOnIgnoreList: PropTypes.bool,
+ };
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillUpdate(nextProps) {
+ this.props.clearContextMenu();
+ if (nextProps.contextMenu) {
+ this.showMenu(nextProps);
+ }
+ }
+
+ showMenu(props) {
+ const {
+ cx,
+ editor,
+ selectedSource,
+ blackboxedRanges,
+ editorActions,
+ hasMappedLocation,
+ isPaused,
+ editorWrappingEnabled,
+ contextMenu: event,
+ isSourceOnIgnoreList,
+ } = props;
+
+ const location = getSourceLocationFromMouseEvent(
+ editor,
+ selectedSource,
+ // Use a coercion, as contextMenu is optional
+ event
+ );
+
+ showMenu(
+ event,
+ editorMenuItems({
+ cx,
+ editorActions,
+ selectedSource,
+ blackboxedRanges,
+ hasMappedLocation,
+ location,
+ isPaused,
+ editorWrappingEnabled,
+ selectionText: editor.codeMirror.getSelection().trim(),
+ isTextSelected: editor.codeMirror.somethingSelected(),
+ editor,
+ isSourceOnIgnoreList,
+ })
+ );
+ }
+
+ render() {
+ return null;
+ }
+}
+
+const mapStateToProps = (state, props) => {
+ // This component is a no-op when contextmenu is false
+ if (!props.contextMenu) {
+ return {};
+ }
+ return {
+ cx: getThreadContext(state),
+ blackboxedRanges: getBlackBoxRanges(state),
+ isPaused: getIsCurrentThreadPaused(state),
+ hasMappedLocation:
+ (props.selectedSource.isOriginal ||
+ isSourceWithMap(state, props.selectedSource.id) ||
+ isPretty(props.selectedSource)) &&
+ !getPrettySource(state, props.selectedSource.id),
+ isSourceOnIgnoreList:
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, props.selectedSource),
+ };
+};
+
+const mapDispatchToProps = dispatch => ({
+ editorActions: editorItemActions(dispatch),
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(EditorMenu);
diff --git a/devtools/client/debugger/src/components/Editor/EmptyLines.js b/devtools/client/debugger/src/components/Editor/EmptyLines.js
new file mode 100644
index 0000000000..70a8c9c0a7
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/EmptyLines.js
@@ -0,0 +1,88 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { connect } from "../../utils/connect";
+import { Component } from "react";
+import PropTypes from "prop-types";
+import { getSelectedSource, getSelectedBreakableLines } from "../../selectors";
+import { fromEditorLine } from "../../utils/editor";
+import { isWasm } from "../../utils/wasm";
+
+class EmptyLines extends Component {
+ static get propTypes() {
+ return {
+ breakableLines: PropTypes.object.isRequired,
+ editor: PropTypes.object.isRequired,
+ selectedSource: PropTypes.object.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.disableEmptyLines();
+ }
+
+ componentDidUpdate() {
+ this.disableEmptyLines();
+ }
+
+ componentWillUnmount() {
+ const { editor } = this.props;
+
+ editor.codeMirror.operation(() => {
+ editor.codeMirror.eachLine(lineHandle => {
+ editor.codeMirror.removeLineClass(lineHandle, "wrap", "empty-line");
+ });
+ });
+ }
+
+ shouldComponentUpdate(nextProps) {
+ const { breakableLines, selectedSource } = this.props;
+ return (
+ // Breakable lines are something that evolves over time,
+ // but we either have them loaded or not. So only compare the size
+ // as sometimes we always get a blank new empty Set instance.
+ breakableLines.size != nextProps.breakableLines.size ||
+ selectedSource.id != nextProps.selectedSource.id
+ );
+ }
+
+ disableEmptyLines() {
+ const { breakableLines, selectedSource, editor } = this.props;
+
+ const { codeMirror } = editor;
+ const isSourceWasm = isWasm(selectedSource.id);
+
+ codeMirror.operation(() => {
+ const lineCount = codeMirror.lineCount();
+ for (let i = 0; i < lineCount; i++) {
+ const line = fromEditorLine(selectedSource.id, i, isSourceWasm);
+
+ if (breakableLines.has(line)) {
+ codeMirror.removeLineClass(i, "wrap", "empty-line");
+ } else {
+ codeMirror.addLineClass(i, "wrap", "empty-line");
+ }
+ }
+ });
+ }
+
+ render() {
+ return null;
+ }
+}
+
+const mapStateToProps = state => {
+ const selectedSource = getSelectedSource(state);
+ if (!selectedSource) {
+ throw new Error("no selectedSource");
+ }
+ const breakableLines = getSelectedBreakableLines(state);
+
+ return {
+ selectedSource,
+ breakableLines,
+ };
+};
+
+export default connect(mapStateToProps)(EmptyLines);
diff --git a/devtools/client/debugger/src/components/Editor/Exception.js b/devtools/client/debugger/src/components/Editor/Exception.js
new file mode 100644
index 0000000000..8527cfed07
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Exception.js
@@ -0,0 +1,96 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { PureComponent } from "react";
+import PropTypes from "prop-types";
+
+import { toEditorPosition, getTokenEnd, hasDocument } from "../../utils/editor";
+
+import { getIndentation } from "../../utils/indentation";
+import { createLocation } from "../../utils/location";
+
+export default class Exception extends PureComponent {
+ exceptionLine;
+ markText;
+
+ static get propTypes() {
+ return {
+ exception: PropTypes.object.isRequired,
+ doc: PropTypes.object.isRequired,
+ selectedSource: PropTypes.string.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.addEditorExceptionLine();
+ }
+
+ componentDidUpdate() {
+ this.clearEditorExceptionLine();
+ this.addEditorExceptionLine();
+ }
+
+ componentWillUnmount() {
+ this.clearEditorExceptionLine();
+ }
+
+ setEditorExceptionLine(doc, line, column, lineText) {
+ doc.addLineClass(line, "wrap", "line-exception");
+
+ column = Math.max(column, getIndentation(lineText));
+ const columnEnd = doc.cm ? getTokenEnd(doc.cm, line, column) : null;
+
+ const markText = doc.markText(
+ { ch: column, line },
+ { ch: columnEnd, line },
+ { className: "mark-text-exception" }
+ );
+
+ this.exceptionLine = line;
+ this.markText = markText;
+ }
+
+ addEditorExceptionLine() {
+ const { exception, doc, selectedSource } = this.props;
+ const { columnNumber, lineNumber } = exception;
+
+ if (!hasDocument(selectedSource.id)) {
+ return;
+ }
+
+ const location = createLocation({
+ column: columnNumber - 1,
+ line: lineNumber,
+ source: selectedSource,
+ });
+
+ const { line, column } = toEditorPosition(location);
+ const lineText = doc.getLine(line);
+
+ this.setEditorExceptionLine(doc, line, column, lineText);
+ }
+
+ clearEditorExceptionLine() {
+ if (this.markText) {
+ const { selectedSource } = this.props;
+
+ this.markText.clear();
+
+ if (hasDocument(selectedSource.id)) {
+ this.props.doc.removeLineClass(
+ this.exceptionLine,
+ "wrap",
+ "line-exception"
+ );
+ }
+ this.exceptionLine = null;
+ this.markText = null;
+ }
+ }
+
+ // This component is only used as a "proxy" to manipulate the editor.
+ render() {
+ return null;
+ }
+}
diff --git a/devtools/client/debugger/src/components/Editor/Exceptions.js b/devtools/client/debugger/src/components/Editor/Exceptions.js
new file mode 100644
index 0000000000..d1bac48b1b
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Exceptions.js
@@ -0,0 +1,67 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+
+import Exception from "./Exception";
+
+import {
+ getSelectedSource,
+ getSelectedSourceExceptions,
+} from "../../selectors";
+import { getDocument } from "../../utils/editor";
+
+class Exceptions extends Component {
+ static get propTypes() {
+ return {
+ exceptions: PropTypes.array,
+ selectedSource: PropTypes.object,
+ };
+ }
+
+ render() {
+ const { exceptions, selectedSource } = this.props;
+
+ if (!selectedSource || !exceptions.length) {
+ return null;
+ }
+
+ const doc = getDocument(selectedSource.id);
+
+ return (
+ <>
+ {exceptions.map(exc => (
+ <Exception
+ exception={exc}
+ doc={doc}
+ key={`${exc.sourceActorId}:${exc.lineNumber}`}
+ selectedSource={selectedSource}
+ />
+ ))}
+ </>
+ );
+ }
+}
+
+export default connect(state => {
+ const selectedSource = getSelectedSource(state);
+
+ // Avoid calling getSelectedSourceExceptions when there is no source selected.
+ if (!selectedSource) {
+ return {};
+ }
+
+ // Avoid causing any update until we start having exceptions
+ const exceptions = getSelectedSourceExceptions(state);
+ if (!exceptions.length) {
+ return {};
+ }
+
+ return {
+ exceptions: getSelectedSourceExceptions(state),
+ selectedSource,
+ };
+})(Exceptions);
diff --git a/devtools/client/debugger/src/components/Editor/Footer.css b/devtools/client/debugger/src/components/Editor/Footer.css
new file mode 100644
index 0000000000..aee6c51d38
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Footer.css
@@ -0,0 +1,85 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.source-footer {
+ background: var(--theme-body-background);
+ border-top: 1px solid var(--theme-splitter-color);
+ position: absolute;
+ display: flex;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ opacity: 1;
+ z-index: 1;
+ width: calc(100% - 1px);
+ user-select: none;
+ height: var(--editor-footer-height);
+ box-sizing: border-box;
+}
+
+.source-footer-start {
+ display: flex;
+ align-items: center;
+ justify-self: start;
+}
+
+.source-footer-end {
+ display: flex;
+ margin-left: auto;
+}
+
+.source-footer .commands * {
+ user-select: none;
+}
+
+.source-footer .commands {
+ display: flex;
+}
+
+.source-footer .commands .action {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ transition: opacity 200ms;
+ border: none;
+ background: transparent;
+ padding: 4px 6px;
+}
+
+.source-footer .commands button.action:hover {
+ background: var(--theme-toolbar-background-hover);
+}
+
+:root.theme-dark .source-footer .commands .action {
+ fill: var(--theme-body-color);
+}
+
+:root.theme-dark .source-footer .commands .action:hover {
+ fill: var(--theme-selection-color);
+}
+
+.source-footer .blackboxed .img.blackBox {
+ background-color: #806414;
+}
+
+.source-footer .commands button.prettyPrint:disabled {
+ opacity: 0.6;
+}
+
+.source-footer .mapped-source,
+.source-footer .cursor-position {
+ color: var(--theme-body-color);
+ padding-right: 2.5px;
+}
+
+.source-footer .mapped-source {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.source-footer .cursor-position {
+ padding: 5px;
+ white-space: nowrap;
+}
diff --git a/devtools/client/debugger/src/components/Editor/Footer.js b/devtools/client/debugger/src/components/Editor/Footer.js
new file mode 100644
index 0000000000..ea9acbc6f6
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Footer.js
@@ -0,0 +1,302 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import { createLocation } from "../../utils/location";
+import actions from "../../actions";
+import {
+ getSelectedSource,
+ getSelectedLocation,
+ getSelectedSourceTextContent,
+ getPrettySource,
+ getPaneCollapse,
+ getContext,
+ getGeneratedSource,
+ isSourceBlackBoxed,
+ canPrettyPrintSource,
+ getPrettyPrintMessage,
+ isSourceOnSourceMapIgnoreList,
+ isSourceMapIgnoreListEnabled,
+} from "../../selectors";
+
+import { isPretty, getFilename, shouldBlackbox } from "../../utils/source";
+
+import { PaneToggleButton } from "../shared/Button";
+import AccessibleImage from "../shared/AccessibleImage";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+import "./Footer.css";
+
+class SourceFooter extends PureComponent {
+ constructor() {
+ super();
+
+ this.state = { cursorPosition: { line: 0, column: 0 } };
+ }
+
+ static get propTypes() {
+ return {
+ canPrettyPrint: PropTypes.bool.isRequired,
+ prettyPrintMessage: PropTypes.string.isRequired,
+ cx: PropTypes.object.isRequired,
+ endPanelCollapsed: PropTypes.bool.isRequired,
+ horizontal: PropTypes.bool.isRequired,
+ jumpToMappedLocation: PropTypes.func.isRequired,
+ mappedSource: PropTypes.object,
+ selectedSource: PropTypes.object,
+ isSelectedSourceBlackBoxed: PropTypes.bool.isRequired,
+ sourceLoaded: PropTypes.bool.isRequired,
+ toggleBlackBox: PropTypes.func.isRequired,
+ togglePaneCollapse: PropTypes.func.isRequired,
+ togglePrettyPrint: PropTypes.func.isRequired,
+ isSourceOnIgnoreList: PropTypes.bool.isRequired,
+ };
+ }
+
+ componentDidUpdate() {
+ const eventDoc = document.querySelector(".editor-mount .CodeMirror");
+ // querySelector can return null
+ if (eventDoc) {
+ this.toggleCodeMirror(eventDoc, true);
+ }
+ }
+
+ componentWillUnmount() {
+ const eventDoc = document.querySelector(".editor-mount .CodeMirror");
+
+ if (eventDoc) {
+ this.toggleCodeMirror(eventDoc, false);
+ }
+ }
+
+ toggleCodeMirror(eventDoc, toggle) {
+ if (toggle === true) {
+ eventDoc.CodeMirror.on("cursorActivity", this.onCursorChange);
+ } else {
+ eventDoc.CodeMirror.off("cursorActivity", this.onCursorChange);
+ }
+ }
+
+ prettyPrintButton() {
+ const {
+ cx,
+ selectedSource,
+ canPrettyPrint,
+ prettyPrintMessage,
+ togglePrettyPrint,
+ sourceLoaded,
+ } = this.props;
+
+ if (!selectedSource) {
+ return null;
+ }
+
+ if (!sourceLoaded && selectedSource.isPrettyPrinted) {
+ return (
+ <div className="action" key="pretty-loader">
+ <AccessibleImage className="loader spin" />
+ </div>
+ );
+ }
+
+ const type = "prettyPrint";
+ return (
+ <button
+ onClick={() => {
+ if (!canPrettyPrint) {
+ return;
+ }
+ togglePrettyPrint(cx, selectedSource.id);
+ }}
+ className={classnames("action", type, {
+ active: sourceLoaded && canPrettyPrint,
+ pretty: isPretty(selectedSource),
+ })}
+ key={type}
+ title={prettyPrintMessage}
+ aria-label={prettyPrintMessage}
+ disabled={!canPrettyPrint}
+ >
+ <AccessibleImage className={type} />
+ </button>
+ );
+ }
+
+ blackBoxButton() {
+ const {
+ cx,
+ selectedSource,
+ isSelectedSourceBlackBoxed,
+ toggleBlackBox,
+ sourceLoaded,
+ isSourceOnIgnoreList,
+ } = this.props;
+
+ if (!selectedSource || !shouldBlackbox(selectedSource)) {
+ return null;
+ }
+
+ let tooltip = isSelectedSourceBlackBoxed
+ ? L10N.getStr("sourceFooter.unignore")
+ : L10N.getStr("sourceFooter.ignore");
+
+ if (isSourceOnIgnoreList) {
+ tooltip = L10N.getStr("sourceFooter.ignoreList");
+ }
+
+ const type = "black-box";
+
+ return (
+ <button
+ onClick={() => toggleBlackBox(cx, selectedSource)}
+ className={classnames("action", type, {
+ active: sourceLoaded,
+ blackboxed: isSelectedSourceBlackBoxed || isSourceOnIgnoreList,
+ })}
+ key={type}
+ title={tooltip}
+ aria-label={tooltip}
+ disabled={isSourceOnIgnoreList}
+ >
+ <AccessibleImage className="blackBox" />
+ </button>
+ );
+ }
+
+ renderToggleButton() {
+ if (this.props.horizontal) {
+ return null;
+ }
+
+ return (
+ <PaneToggleButton
+ key="toggle"
+ collapsed={this.props.endPanelCollapsed}
+ horizontal={this.props.horizontal}
+ handleClick={this.props.togglePaneCollapse}
+ position="end"
+ />
+ );
+ }
+
+ renderCommands() {
+ const commands = [this.blackBoxButton(), this.prettyPrintButton()].filter(
+ Boolean
+ );
+
+ return commands.length ? <div className="commands">{commands}</div> : null;
+ }
+
+ renderSourceSummary() {
+ const { cx, mappedSource, jumpToMappedLocation, selectedSource } =
+ this.props;
+
+ if (!mappedSource || !selectedSource || !selectedSource.isOriginal) {
+ return null;
+ }
+
+ const filename = getFilename(mappedSource);
+ const tooltip = L10N.getFormatStr(
+ "sourceFooter.mappedSourceTooltip",
+ filename
+ );
+ const title = L10N.getFormatStr("sourceFooter.mappedSource", filename);
+ const mappedSourceLocation = createLocation({
+ source: selectedSource,
+ line: 1,
+ column: 1,
+ });
+ return (
+ <button
+ className="mapped-source"
+ onClick={() => jumpToMappedLocation(cx, mappedSourceLocation)}
+ title={tooltip}
+ >
+ <span>{title}</span>
+ </button>
+ );
+ }
+
+ onCursorChange = event => {
+ const { line, ch } = event.doc.getCursor();
+ this.setState({ cursorPosition: { line, column: ch } });
+ };
+
+ renderCursorPosition() {
+ if (!this.props.selectedSource) {
+ return null;
+ }
+
+ const { line, column } = this.state.cursorPosition;
+
+ const text = L10N.getFormatStr(
+ "sourceFooter.currentCursorPosition",
+ line + 1,
+ column + 1
+ );
+ const title = L10N.getFormatStr(
+ "sourceFooter.currentCursorPosition.tooltip",
+ line + 1,
+ column + 1
+ );
+ return (
+ <div className="cursor-position" title={title}>
+ {text}
+ </div>
+ );
+ }
+
+ render() {
+ return (
+ <div className="source-footer">
+ <div className="source-footer-start">{this.renderCommands()}</div>
+ <div className="source-footer-end">
+ {this.renderSourceSummary()}
+ {this.renderCursorPosition()}
+ {this.renderToggleButton()}
+ </div>
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ const selectedSource = getSelectedSource(state);
+ const selectedLocation = getSelectedLocation(state);
+ const sourceTextContent = getSelectedSourceTextContent(state);
+
+ return {
+ cx: getContext(state),
+ selectedSource,
+ isSelectedSourceBlackBoxed: selectedSource
+ ? isSourceBlackBoxed(state, selectedSource)
+ : null,
+ isSourceOnIgnoreList:
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, selectedSource),
+ sourceLoaded: !!sourceTextContent,
+ mappedSource: getGeneratedSource(state, selectedSource),
+ prettySource: getPrettySource(
+ state,
+ selectedSource ? selectedSource.id : null
+ ),
+ endPanelCollapsed: getPaneCollapse(state, "end"),
+ canPrettyPrint: selectedLocation
+ ? canPrettyPrintSource(state, selectedLocation)
+ : false,
+ prettyPrintMessage: selectedLocation
+ ? getPrettyPrintMessage(state, selectedLocation)
+ : null,
+ };
+};
+
+export default connect(mapStateToProps, {
+ togglePrettyPrint: actions.togglePrettyPrint,
+ toggleBlackBox: actions.toggleBlackBox,
+ jumpToMappedLocation: actions.jumpToMappedLocation,
+ togglePaneCollapse: actions.togglePaneCollapse,
+})(SourceFooter);
diff --git a/devtools/client/debugger/src/components/Editor/HighlightCalls.css b/devtools/client/debugger/src/components/Editor/HighlightCalls.css
new file mode 100644
index 0000000000..b7e0402cab
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/HighlightCalls.css
@@ -0,0 +1,15 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.highlight-function-calls {
+ background-color: rgba(202, 227, 255, 0.5);
+}
+
+.theme-dark .highlight-function-calls {
+ background-color: #743884;
+}
+
+.highlight-function-calls:hover {
+ cursor: default;
+}
diff --git a/devtools/client/debugger/src/components/Editor/HighlightCalls.js b/devtools/client/debugger/src/components/Editor/HighlightCalls.js
new file mode 100644
index 0000000000..0063f66c7a
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/HighlightCalls.js
@@ -0,0 +1,110 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import {
+ getHighlightedCalls,
+ getThreadContext,
+ getCurrentThread,
+} from "../../selectors";
+import { getSourceLocationFromMouseEvent } from "../../utils/editor";
+import actions from "../../actions";
+import "./HighlightCalls.css";
+
+export class HighlightCalls extends Component {
+ previousCalls = null;
+
+ static get propTypes() {
+ return {
+ continueToHere: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ editor: PropTypes.object.isRequired,
+ highlightedCalls: PropTypes.array,
+ selectedSource: PropTypes.object,
+ };
+ }
+
+ componentDidUpdate() {
+ this.unhighlightFunctionCalls();
+ this.highlightFunctioCalls();
+ }
+
+ markCall = call => {
+ const { editor } = this.props;
+ const startLine = call.location.start.line - 1;
+ const endLine = call.location.end.line - 1;
+ const startColumn = call.location.start.column;
+ const endColumn = call.location.end.column;
+ const markedCall = editor.codeMirror.markText(
+ { line: startLine, ch: startColumn },
+ { line: endLine, ch: endColumn },
+ { className: "highlight-function-calls" }
+ );
+ return markedCall;
+ };
+
+ onClick = e => {
+ const { editor, selectedSource, cx, continueToHere } = this.props;
+
+ if (selectedSource) {
+ const location = getSourceLocationFromMouseEvent(
+ editor,
+ selectedSource,
+ e
+ );
+ continueToHere(cx, location);
+ editor.codeMirror.execCommand("singleSelection");
+ editor.codeMirror.execCommand("goGroupLeft");
+ }
+ };
+
+ highlightFunctioCalls() {
+ const { highlightedCalls } = this.props;
+
+ if (!highlightedCalls) {
+ return;
+ }
+
+ let markedCalls = [];
+ markedCalls = highlightedCalls.map(this.markCall);
+
+ const allMarkedElements = document.getElementsByClassName(
+ "highlight-function-calls"
+ );
+
+ for (let i = 0; i < allMarkedElements.length; i++) {
+ allMarkedElements[i].addEventListener("click", this.onClick);
+ }
+
+ this.previousCalls = markedCalls;
+ }
+
+ unhighlightFunctionCalls() {
+ if (!this.previousCalls) {
+ return;
+ }
+ this.previousCalls.forEach(call => call.clear());
+ this.previousCalls = null;
+ }
+
+ render() {
+ return null;
+ }
+}
+
+const mapStateToProps = state => {
+ const thread = getCurrentThread(state);
+ return {
+ highlightedCalls: getHighlightedCalls(state, thread),
+ cx: getThreadContext(state),
+ };
+};
+
+const { continueToHere } = actions;
+
+const mapDispatchToProps = { continueToHere };
+
+export default connect(mapStateToProps, mapDispatchToProps)(HighlightCalls);
diff --git a/devtools/client/debugger/src/components/Editor/HighlightLine.js b/devtools/client/debugger/src/components/Editor/HighlightLine.js
new file mode 100644
index 0000000000..3df0142127
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/HighlightLine.js
@@ -0,0 +1,183 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { Component } from "react";
+import PropTypes from "prop-types";
+import { toEditorLine, endOperation, startOperation } from "../../utils/editor";
+import { getDocument, hasDocument } from "../../utils/editor/source-documents";
+
+import { connect } from "../../utils/connect";
+import {
+ getVisibleSelectedFrame,
+ getSelectedLocation,
+ getSelectedSourceTextContent,
+ getPauseCommand,
+ getCurrentThread,
+} from "../../selectors";
+
+function isDebugLine(selectedFrame, selectedLocation) {
+ if (!selectedFrame) {
+ return false;
+ }
+
+ return (
+ selectedFrame.location.sourceId == selectedLocation.sourceId &&
+ selectedFrame.location.line == selectedLocation.line
+ );
+}
+
+function isDocumentReady(selectedLocation, selectedSourceTextContent) {
+ return (
+ selectedLocation &&
+ selectedSourceTextContent &&
+ hasDocument(selectedLocation.sourceId)
+ );
+}
+
+export class HighlightLine extends Component {
+ isStepping = false;
+ previousEditorLine = null;
+
+ static get propTypes() {
+ return {
+ pauseCommand: PropTypes.oneOf([
+ "expression",
+ "resume",
+ "stepOver",
+ "stepIn",
+ "stepOut",
+ ]),
+ selectedFrame: PropTypes.object,
+ selectedLocation: PropTypes.object.isRequired,
+ selectedSourceTextContent: PropTypes.object.isRequired,
+ };
+ }
+
+ shouldComponentUpdate(nextProps) {
+ const { selectedLocation, selectedSourceTextContent } = nextProps;
+ return this.shouldSetHighlightLine(
+ selectedLocation,
+ selectedSourceTextContent
+ );
+ }
+
+ componentDidUpdate(prevProps) {
+ this.completeHighlightLine(prevProps);
+ }
+
+ componentDidMount() {
+ this.completeHighlightLine(null);
+ }
+
+ shouldSetHighlightLine(selectedLocation, selectedSourceTextContent) {
+ const { sourceId, line } = selectedLocation;
+ const editorLine = toEditorLine(sourceId, line);
+
+ if (!isDocumentReady(selectedLocation, selectedSourceTextContent)) {
+ return false;
+ }
+
+ if (this.isStepping && editorLine === this.previousEditorLine) {
+ return false;
+ }
+
+ return true;
+ }
+
+ completeHighlightLine(prevProps) {
+ const {
+ pauseCommand,
+ selectedLocation,
+ selectedFrame,
+ selectedSourceTextContent,
+ } = this.props;
+ if (pauseCommand) {
+ this.isStepping = true;
+ }
+
+ startOperation();
+ if (prevProps) {
+ this.clearHighlightLine(
+ prevProps.selectedLocation,
+ prevProps.selectedSourceTextContent
+ );
+ }
+ this.setHighlightLine(
+ selectedLocation,
+ selectedFrame,
+ selectedSourceTextContent
+ );
+ endOperation();
+ }
+
+ setHighlightLine(selectedLocation, selectedFrame, selectedSourceTextContent) {
+ const { sourceId, line } = selectedLocation;
+ if (
+ !this.shouldSetHighlightLine(selectedLocation, selectedSourceTextContent)
+ ) {
+ return;
+ }
+
+ this.isStepping = false;
+ const editorLine = toEditorLine(sourceId, line);
+ this.previousEditorLine = editorLine;
+
+ if (!line || isDebugLine(selectedFrame, selectedLocation)) {
+ return;
+ }
+
+ const doc = getDocument(sourceId);
+ doc.addLineClass(editorLine, "wrap", "highlight-line");
+ this.resetHighlightLine(doc, editorLine);
+ }
+
+ resetHighlightLine(doc, editorLine) {
+ const editorWrapper = document.querySelector(".editor-wrapper");
+
+ if (editorWrapper === null) {
+ return;
+ }
+
+ const duration = parseInt(
+ getComputedStyle(editorWrapper).getPropertyValue(
+ "--highlight-line-duration"
+ ),
+ 10
+ );
+
+ setTimeout(
+ () => doc && doc.removeLineClass(editorLine, "wrap", "highlight-line"),
+ duration
+ );
+ }
+
+ clearHighlightLine(selectedLocation, selectedSourceTextContent) {
+ if (!isDocumentReady(selectedLocation, selectedSourceTextContent)) {
+ return;
+ }
+
+ const { line, sourceId } = selectedLocation;
+ const editorLine = toEditorLine(sourceId, line);
+ const doc = getDocument(sourceId);
+ doc.removeLineClass(editorLine, "wrap", "highlight-line");
+ }
+
+ render() {
+ return null;
+ }
+}
+
+export default connect(state => {
+ const selectedLocation = getSelectedLocation(state);
+
+ if (!selectedLocation) {
+ throw new Error("must have selected location");
+ }
+ return {
+ pauseCommand: getPauseCommand(state, getCurrentThread(state)),
+ selectedFrame: getVisibleSelectedFrame(state),
+ selectedLocation,
+ selectedSourceTextContent: getSelectedSourceTextContent(state),
+ };
+})(HighlightLine);
diff --git a/devtools/client/debugger/src/components/Editor/HighlightLines.js b/devtools/client/debugger/src/components/Editor/HighlightLines.js
new file mode 100644
index 0000000000..bffa209e7d
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/HighlightLines.js
@@ -0,0 +1,74 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { Component } from "react";
+import PropTypes from "prop-types";
+
+class HighlightLines extends Component {
+ static get propTypes() {
+ return {
+ editor: PropTypes.object.isRequired,
+ range: PropTypes.object.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.highlightLineRange();
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillUpdate() {
+ this.clearHighlightRange();
+ }
+
+ componentDidUpdate() {
+ this.highlightLineRange();
+ }
+
+ componentWillUnmount() {
+ this.clearHighlightRange();
+ }
+
+ clearHighlightRange() {
+ const { range, editor } = this.props;
+
+ const { codeMirror } = editor;
+
+ if (!range || !codeMirror) {
+ return;
+ }
+
+ const { start, end } = range;
+ codeMirror.operation(() => {
+ for (let line = start - 1; line < end; line++) {
+ codeMirror.removeLineClass(line, "wrap", "highlight-lines");
+ }
+ });
+ }
+
+ highlightLineRange = () => {
+ const { range, editor } = this.props;
+
+ const { codeMirror } = editor;
+
+ if (!range || !codeMirror) {
+ return;
+ }
+
+ const { start, end } = range;
+
+ codeMirror.operation(() => {
+ editor.alignLine(start);
+ for (let line = start - 1; line < end; line++) {
+ codeMirror.addLineClass(line, "wrap", "highlight-lines");
+ }
+ });
+ };
+
+ render() {
+ return null;
+ }
+}
+
+export default HighlightLines;
diff --git a/devtools/client/debugger/src/components/Editor/InlinePreview.css b/devtools/client/debugger/src/components/Editor/InlinePreview.css
new file mode 100644
index 0000000000..13f1b5e23c
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/InlinePreview.css
@@ -0,0 +1,29 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.inline-preview {
+ display: inline-block;
+ margin-inline-start: 8px;
+ user-select: none;
+}
+
+.inline-preview-outer {
+ background-color: var(--theme-inline-preview-background);
+ border: 1px solid var(--theme-inline-preview-border-color);
+ border-radius: 3px;
+ font-size: 10px;
+ margin-right: 5px;
+ white-space: nowrap;
+}
+
+.inline-preview-label {
+ padding: 0px 2px 0px 4px;
+ border-radius: 2px 0 0 2px;
+ color: var(--theme-inline-preview-label-color);
+ background-color: var(--theme-inline-preview-label-background);
+}
+
+.inline-preview-value {
+ padding: 2px 6px;
+}
diff --git a/devtools/client/debugger/src/components/Editor/InlinePreview.js b/devtools/client/debugger/src/components/Editor/InlinePreview.js
new file mode 100644
index 0000000000..f978965134
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/InlinePreview.js
@@ -0,0 +1,66 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+import Reps from "devtools/client/shared/components/reps/index";
+
+const {
+ REPS: {
+ Rep,
+ ElementNode: { supportsObject: isElement },
+ },
+ MODE,
+} = Reps;
+
+// Renders single variable preview inside a codemirror line widget
+class InlinePreview extends PureComponent {
+ static get propTypes() {
+ return {
+ highlightDomElement: PropTypes.func.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ value: PropTypes.any,
+ variable: PropTypes.string.isRequired,
+ };
+ }
+
+ showInScopes(variable) {
+ // TODO: focus on variable value in the scopes sidepanel
+ // we will need more info from parent comp
+ }
+
+ render() {
+ const {
+ value,
+ variable,
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ } = this.props;
+
+ const mode = isElement(value) ? MODE.TINY : MODE.SHORT;
+
+ return (
+ <span
+ className="inline-preview-outer"
+ onClick={() => this.showInScopes(variable)}
+ >
+ <span className="inline-preview-label">{variable}:</span>
+ <span className="inline-preview-value">
+ <Rep
+ object={value}
+ mode={mode}
+ onDOMNodeClick={grip => openElementInInspector(grip)}
+ onInspectIconClick={grip => openElementInInspector(grip)}
+ onDOMNodeMouseOver={grip => highlightDomElement(grip)}
+ onDOMNodeMouseOut={grip => unHighlightDomElement(grip)}
+ />
+ </span>
+ </span>
+ );
+ }
+}
+
+export default InlinePreview;
diff --git a/devtools/client/debugger/src/components/Editor/InlinePreviewRow.js b/devtools/client/debugger/src/components/Editor/InlinePreviewRow.js
new file mode 100644
index 0000000000..ad2631e01e
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/InlinePreviewRow.js
@@ -0,0 +1,101 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import ReactDOM from "react-dom";
+
+import actions from "../../actions";
+import assert from "../../utils/assert";
+import { connect } from "../../utils/connect";
+import InlinePreview from "./InlinePreview";
+
+import "./InlinePreview.css";
+
+// Handles rendering for each line ( row )
+// * Renders single widget for each line in codemirror
+// * Renders InlinePreview for each preview inside the widget
+class InlinePreviewRow extends PureComponent {
+ bookmark;
+ widgetNode;
+
+ componentDidMount() {
+ this.updatePreviewWidget(this.props, null);
+ }
+
+ componentDidUpdate(prevProps) {
+ this.updatePreviewWidget(this.props, prevProps);
+ }
+
+ componentWillUnmount() {
+ this.updatePreviewWidget(null, this.props);
+ }
+
+ updatePreviewWidget(props, prevProps) {
+ if (
+ this.bookmark &&
+ prevProps &&
+ (!props ||
+ prevProps.editor !== props.editor ||
+ prevProps.line !== props.line)
+ ) {
+ this.bookmark.clear();
+ this.bookmark = null;
+ this.widgetNode = null;
+ }
+
+ if (!props) {
+ assert(!this.bookmark, "Inline Preview widget shouldn't be present.");
+ return;
+ }
+
+ const {
+ editor,
+ line,
+ previews,
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ } = props;
+
+ if (!this.bookmark) {
+ this.widgetNode = document.createElement("div");
+ this.widgetNode.classList.add("inline-preview");
+ }
+
+ ReactDOM.render(
+ <React.Fragment>
+ {previews.map(preview => (
+ <InlinePreview
+ line={line}
+ key={`${line}-${preview.name}`}
+ variable={preview.name}
+ value={preview.value}
+ openElementInInspector={openElementInInspector}
+ highlightDomElement={highlightDomElement}
+ unHighlightDomElement={unHighlightDomElement}
+ />
+ ))}
+ </React.Fragment>,
+ this.widgetNode
+ );
+
+ this.bookmark = editor.codeMirror.setBookmark(
+ {
+ line,
+ ch: Infinity,
+ },
+ this.widgetNode
+ );
+ }
+
+ render() {
+ return null;
+ }
+}
+
+export default connect(() => ({}), {
+ openElementInInspector: actions.openElementInInspectorCommand,
+ highlightDomElement: actions.highlightDomElement,
+ unHighlightDomElement: actions.unHighlightDomElement,
+})(InlinePreviewRow);
diff --git a/devtools/client/debugger/src/components/Editor/InlinePreviews.js b/devtools/client/debugger/src/components/Editor/InlinePreviews.js
new file mode 100644
index 0000000000..8778cb373c
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/InlinePreviews.js
@@ -0,0 +1,83 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import InlinePreviewRow from "./InlinePreviewRow";
+import { connect } from "../../utils/connect";
+import {
+ getSelectedFrame,
+ getCurrentThread,
+ getInlinePreviews,
+} from "../../selectors";
+
+function hasPreviews(previews) {
+ return !!previews && !!Object.keys(previews).length;
+}
+
+class InlinePreviews extends Component {
+ static get propTypes() {
+ return {
+ editor: PropTypes.object.isRequired,
+ previews: PropTypes.object,
+ selectedFrame: PropTypes.object.isRequired,
+ selectedSource: PropTypes.object.isRequired,
+ };
+ }
+
+ shouldComponentUpdate({ previews }) {
+ return hasPreviews(previews);
+ }
+
+ render() {
+ const { editor, selectedFrame, selectedSource, previews } = this.props;
+
+ // Render only if currently open file is the one where debugger is paused
+ if (
+ !selectedFrame ||
+ selectedFrame.location.sourceId !== selectedSource.id ||
+ !hasPreviews(previews)
+ ) {
+ return null;
+ }
+ const previewsObj = previews;
+
+ let inlinePreviewRows;
+ editor.codeMirror.operation(() => {
+ inlinePreviewRows = Object.keys(previewsObj).map(line => {
+ const lineNum = parseInt(line, 10);
+
+ return (
+ <InlinePreviewRow
+ editor={editor}
+ key={line}
+ line={lineNum}
+ previews={previewsObj[line]}
+ />
+ );
+ });
+ });
+
+ return <div>{inlinePreviewRows}</div>;
+ }
+}
+
+const mapStateToProps = state => {
+ const thread = getCurrentThread(state);
+ const selectedFrame = getSelectedFrame(state, thread);
+
+ if (!selectedFrame) {
+ return {
+ selectedFrame: null,
+ previews: null,
+ };
+ }
+
+ return {
+ selectedFrame,
+ previews: getInlinePreviews(state, thread, selectedFrame.id),
+ };
+};
+
+export default connect(mapStateToProps)(InlinePreviews);
diff --git a/devtools/client/debugger/src/components/Editor/Preview.css b/devtools/client/debugger/src/components/Editor/Preview.css
new file mode 100644
index 0000000000..35b874315e
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview.css
@@ -0,0 +1,111 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.popover .preview {
+ background: var(--theme-body-background);
+ width: 350px;
+ border: 1px solid var(--theme-splitter-color);
+ padding: 10px;
+ height: auto;
+ min-height: inherit;
+ max-height: 200px;
+ overflow: auto;
+ box-shadow: 1px 2px 3px var(--popup-shadow-color);
+}
+
+.theme-dark .popover .preview {
+ box-shadow: 1px 2px 3px var(--popup-shadow-color);
+}
+
+.popover .preview .header {
+ width: 100%;
+ line-height: 20px;
+ border-bottom: 1px solid #cccccc;
+ display: flex;
+ flex-direction: column;
+}
+
+.popover .preview .header .link {
+ align-self: flex-end;
+ color: var(--theme-highlight-blue);
+ text-decoration: underline;
+}
+
+.selection,
+.debug-expression.selection {
+ background-color: var(--theme-highlight-yellow);
+}
+
+.theme-dark .selection,
+.theme-dark .debug-expression.selection {
+ background-color: #743884;
+}
+
+.theme-dark .cm-s-mozilla .selection,
+.theme-dark .cm-s-mozilla .debug-expression.selection {
+ color: #e7ebee;
+}
+
+.popover .preview .function-signature {
+ padding-top: 10px;
+}
+
+.theme-dark .popover .preview {
+ border-color: var(--theme-body-color);
+}
+
+.tooltip {
+ position: fixed;
+ z-index: 100;
+}
+
+.tooltip .preview {
+ background: var(--theme-toolbar-background);
+ max-width: inherit;
+ border: 1px solid var(--theme-splitter-color);
+ box-shadow: 1px 2px 4px 1px var(--theme-toolbar-background-alt);
+ padding: 5px;
+ height: auto;
+ min-height: inherit;
+ max-height: 200px;
+ overflow: auto;
+}
+
+.theme-dark .tooltip .preview {
+ border-color: var(--theme-body-color);
+}
+
+.tooltip .gap {
+ height: 4px;
+ padding-top: 4px;
+}
+
+.add-to-expression-bar {
+ border: 1px solid var(--theme-splitter-color);
+ border-top: none;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ font-size: 14px;
+ line-height: 30px;
+ background: var(--theme-toolbar-background);
+ color: var(--theme-text-color-inactive);
+ padding: 0 4px;
+}
+
+.add-to-expression-bar .prompt {
+ width: 1em;
+}
+
+.add-to-expression-bar .expression-to-save-label {
+ width: calc(100% - 4em);
+}
+
+.add-to-expression-bar .expression-to-save-button {
+ font-size: 14px;
+ color: var(--theme-comment);
+}
diff --git a/devtools/client/debugger/src/components/Editor/Preview/ExceptionPopup.js b/devtools/client/debugger/src/components/Editor/Preview/ExceptionPopup.js
new file mode 100644
index 0000000000..624a78fb8b
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview/ExceptionPopup.js
@@ -0,0 +1,164 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../../utils/connect";
+
+import Reps from "devtools/client/shared/components/reps/index";
+const {
+ REPS: { StringRep },
+} = Reps;
+
+import actions from "../../../actions";
+
+import { getThreadContext } from "../../../selectors";
+
+import AccessibleImage from "../../shared/AccessibleImage";
+
+const DevToolsUtils = require("devtools/shared/DevToolsUtils");
+const classnames = require("devtools/client/shared/classnames.js");
+
+const POPUP_SELECTOR = ".preview-popup.exception-popup";
+const ANONYMOUS_FN_NAME = "<anonymous>";
+
+// The exception popup works in two modes:
+// a. when the stacktrace is closed the exception popup
+// gets closed when the mouse leaves the popup.
+// b. when the stacktrace is opened the exception popup
+// gets closed only by clicking outside the popup.
+class ExceptionPopup extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ isStacktraceExpanded: false,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ clearPreview: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ mouseout: PropTypes.func.isRequired,
+ selectSourceURL: PropTypes.func.isRequired,
+ exception: PropTypes.object.isRequired,
+ };
+ }
+
+ updateTopWindow() {
+ // The ChromeWindow is used when the stacktrace is expanded to capture all clicks
+ // outside the popup so the popup can be closed only by clicking outside of it.
+ if (this.topWindow) {
+ this.topWindow.removeEventListener(
+ "mousedown",
+ this.onTopWindowClick,
+ true
+ );
+ this.topWindow = null;
+ }
+ this.topWindow = DevToolsUtils.getTopWindow(window.parent);
+ this.topWindow.addEventListener("mousedown", this.onTopWindowClick, true);
+ }
+
+ onTopWindowClick = e => {
+ const { cx, clearPreview } = this.props;
+
+ // When the stactrace is expaned the exception popup gets closed
+ // only by clicking ouside the popup.
+ if (!e.target.closest(POPUP_SELECTOR)) {
+ clearPreview(cx);
+ }
+ };
+
+ onExceptionMessageClick() {
+ const isStacktraceExpanded = this.state.isStacktraceExpanded;
+
+ this.updateTopWindow();
+ this.setState({ isStacktraceExpanded: !isStacktraceExpanded });
+ }
+
+ buildStackFrame(frame) {
+ const { cx, selectSourceURL } = this.props;
+ const { filename, lineNumber } = frame;
+ const functionName = frame.functionName || ANONYMOUS_FN_NAME;
+
+ return (
+ <div
+ className="frame"
+ onClick={() => selectSourceURL(cx, filename, { line: lineNumber })}
+ >
+ <span className="title">{functionName}</span>
+ <span className="location">
+ <span className="filename">{filename}</span>:
+ <span className="line">{lineNumber}</span>
+ </span>
+ </div>
+ );
+ }
+
+ renderStacktrace(stacktrace) {
+ const isStacktraceExpanded = this.state.isStacktraceExpanded;
+
+ if (stacktrace.length && isStacktraceExpanded) {
+ return (
+ <div className="exception-stacktrace">
+ {stacktrace.map(frame => this.buildStackFrame(frame))}
+ </div>
+ );
+ }
+ return null;
+ }
+
+ renderArrowIcon(stacktrace) {
+ if (stacktrace.length) {
+ return (
+ <AccessibleImage
+ className={classnames("arrow", {
+ expanded: this.state.isStacktraceExpanded,
+ })}
+ />
+ );
+ }
+ return null;
+ }
+
+ render() {
+ const {
+ exception: { stacktrace, errorMessage },
+ mouseout,
+ } = this.props;
+
+ return (
+ <div
+ className="preview-popup exception-popup"
+ dir="ltr"
+ onMouseLeave={() => mouseout(true, this.state.isStacktraceExpanded)}
+ >
+ <div
+ className="exception-message"
+ onClick={() => this.onExceptionMessageClick()}
+ >
+ {this.renderArrowIcon(stacktrace)}
+ {StringRep.rep({
+ object: errorMessage,
+ useQuotes: false,
+ className: "exception-text",
+ })}
+ </div>
+ {this.renderStacktrace(stacktrace)}
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => ({
+ cx: getThreadContext(state),
+});
+
+const mapDispatchToProps = {
+ selectSourceURL: actions.selectSourceURL,
+ clearPreview: actions.clearPreview,
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(ExceptionPopup);
diff --git a/devtools/client/debugger/src/components/Editor/Preview/Popup.css b/devtools/client/debugger/src/components/Editor/Preview/Popup.css
new file mode 100644
index 0000000000..3e578becf1
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview/Popup.css
@@ -0,0 +1,209 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.popover .preview-popup {
+ background: var(--theme-body-background);
+ width: 350px;
+ border: 1px solid var(--theme-splitter-color);
+ padding: 10px;
+ height: auto;
+ overflow: auto;
+ box-shadow: 1px 2px 3px var(--popup-shadow-color);
+}
+
+.preview-popup .tree {
+ /* Setting a fixed line height to avoid issues in custom formatters changing
+ * the line height like the CLJS DevTools */
+ line-height: 15px;
+}
+
+.gap svg {
+ pointer-events: none;
+}
+
+.gap polygon {
+ pointer-events: auto;
+}
+
+.theme-dark .popover .preview-popup {
+ box-shadow: 1px 2px 3px var(--popup-shadow-color);
+}
+
+.popover .preview-popup .header-container {
+ width: 100%;
+ line-height: 15px;
+ display: flex;
+ flex-direction: row;
+ margin-bottom: 5px;
+}
+
+.popover .preview-popup .logo {
+ width: 20px;
+ margin-right: 5px;
+}
+
+.popover .preview-popup .header-container h3 {
+ margin: 0;
+ margin-bottom: 5px;
+ font-weight: normal;
+ font-size: 14px;
+ line-height: 20px;
+ margin-left: 4px;
+}
+
+.popover .preview-popup .header .link {
+ align-self: flex-end;
+ color: var(--theme-highlight-blue);
+ text-decoration: underline;
+}
+
+.popover .preview-popup .object-node {
+ padding-inline-start: 0px;
+}
+
+.preview-token:hover {
+ cursor: default;
+}
+
+.preview-token,
+.debug-expression.preview-token {
+ background-color: var(--theme-highlight-yellow);
+}
+
+.theme-dark .preview-token,
+.theme-dark .debug-expression.preview-token {
+ background-color: #743884;
+}
+
+.theme-dark .cm-s-mozilla .preview-token,
+.theme-dark .cm-s-mozilla .debug-expression.preview-token {
+ color: #e7ebee;
+}
+
+.popover .preview-popup .function-signature {
+ padding-top: 10px;
+}
+
+.theme-dark .popover .preview-popup {
+ border-color: var(--theme-body-color);
+}
+
+.tooltip {
+ position: fixed;
+ z-index: 100;
+}
+
+.tooltip .preview-popup {
+ background: var(--theme-toolbar-background);
+ max-width: inherit;
+ border: 1px solid var(--theme-splitter-color);
+ box-shadow: 1px 2px 4px 1px var(--theme-toolbar-background-alt);
+ padding: 5px;
+ height: auto;
+ min-height: inherit;
+ max-height: 200px;
+ overflow: auto;
+}
+
+.theme-dark .tooltip .preview-popup {
+ border-color: var(--theme-body-color);
+}
+
+.tooltip .gap {
+ height: 4px;
+ padding-top: 0px;
+}
+
+.add-to-expression-bar {
+ border: 1px solid var(--theme-splitter-color);
+ border-top: none;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ font-size: 14px;
+ line-height: 30px;
+ background: var(--theme-toolbar-background);
+ color: var(--theme-text-color-inactive);
+ padding: 0 4px;
+}
+
+.add-to-expression-bar .prompt {
+ width: 1em;
+}
+
+.add-to-expression-bar .expression-to-save-label {
+ width: calc(100% - 4em);
+}
+
+.add-to-expression-bar .expression-to-save-button {
+ font-size: 14px;
+ color: var(--theme-comment);
+}
+
+/* Exception popup */
+.exception-popup .exception-text {
+ color: var(--red-70);
+}
+
+.theme-dark .exception-popup .exception-text {
+ color: var(--red-20);
+}
+
+.exception-popup .exception-message {
+ display: flex;
+ align-items: center;
+}
+
+.exception-message .arrow {
+ margin-inline-end: 4px;
+}
+
+.exception-popup .exception-stacktrace {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-column-gap: 8px;
+ padding-inline: 2px 3px;
+ line-height: var(--theme-code-line-height);
+}
+
+.exception-stacktrace .frame {
+ display: contents;
+ cursor: pointer;
+}
+
+.exception-stacktrace .title {
+ grid-column: 1/2;
+ color: var(--grey-90);
+}
+
+.theme-dark .exception-stacktrace .title {
+ color: white;
+}
+
+.exception-stacktrace .location {
+ grid-column: -1/-2;
+ color: var(--theme-highlight-purple);
+ direction: rtl;
+ text-align: end;
+ white-space: nowrap;
+ /* Force the location to be on one line and crop at start if wider then max-width */
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 350px;
+}
+
+.theme-dark .exception-stacktrace .location {
+ color: var(--blue-40);
+}
+
+.exception-stacktrace .line {
+ color: var(--theme-highlight-blue);
+}
+
+.theme-dark .exception-stacktrace .line {
+ color: hsl(210, 40%, 60%);
+}
diff --git a/devtools/client/debugger/src/components/Editor/Preview/Popup.js b/devtools/client/debugger/src/components/Editor/Preview/Popup.js
new file mode 100644
index 0000000000..3097d3c945
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview/Popup.js
@@ -0,0 +1,382 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../../utils/connect";
+
+import Reps from "devtools/client/shared/components/reps/index";
+const {
+ REPS: { Rep },
+ MODE,
+ objectInspector,
+} = Reps;
+
+const { ObjectInspector, utils } = objectInspector;
+
+const {
+ node: { nodeIsPrimitive, nodeIsFunction, nodeIsObject },
+} = utils;
+
+import ExceptionPopup from "./ExceptionPopup";
+
+import actions from "../../../actions";
+import { getThreadContext } from "../../../selectors";
+import Popover from "../../shared/Popover";
+import PreviewFunction from "../../shared/PreviewFunction";
+
+import "./Popup.css";
+
+export class Popup extends Component {
+ constructor(props) {
+ super(props);
+ }
+
+ static get propTypes() {
+ return {
+ clearPreview: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ editorRef: PropTypes.object.isRequired,
+ highlightDomElement: PropTypes.func.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ openLink: PropTypes.func.isRequired,
+ preview: PropTypes.object.isRequired,
+ selectSourceURL: PropTypes.func.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.addHighlightToToken();
+ }
+
+ componentWillUnmount() {
+ this.removeHighlightFromToken();
+ }
+
+ addHighlightToToken() {
+ const { target } = this.props.preview;
+ if (target) {
+ target.classList.add("preview-token");
+ addHighlightToTargetSiblings(target, this.props);
+ }
+ }
+
+ removeHighlightFromToken() {
+ const { target } = this.props.preview;
+ if (target) {
+ target.classList.remove("preview-token");
+ removeHighlightForTargetSiblings(target);
+ }
+ }
+
+ calculateMaxHeight = () => {
+ const { editorRef } = this.props;
+ if (!editorRef) {
+ return "auto";
+ }
+
+ const { height, top } = editorRef.getBoundingClientRect();
+ const maxHeight = height + top;
+ if (maxHeight < 250) {
+ return maxHeight;
+ }
+
+ return 250;
+ };
+
+ createElement(element) {
+ return document.createElement(element);
+ }
+
+ renderFunctionPreview() {
+ const {
+ cx,
+ selectSourceURL,
+ preview: { resultGrip },
+ } = this.props;
+
+ if (!resultGrip) {
+ return null;
+ }
+
+ const { location } = resultGrip;
+
+ return (
+ <div
+ className="preview-popup"
+ onClick={() =>
+ location &&
+ selectSourceURL(cx, location.url, {
+ line: location.line,
+ })
+ }
+ >
+ <PreviewFunction func={resultGrip} />
+ </div>
+ );
+ }
+
+ renderObjectPreview() {
+ const {
+ preview: { root, properties },
+ openLink,
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ } = this.props;
+
+ const usesCustomFormatter =
+ root?.contents?.value?.useCustomFormatter ?? false;
+
+ if (!properties.length) {
+ return (
+ <div className="preview-popup">
+ <span className="label">{L10N.getStr("preview.noProperties")}</span>
+ </div>
+ );
+ }
+
+ const roots = usesCustomFormatter ? [root] : properties;
+
+ return (
+ <div
+ className="preview-popup"
+ style={{ maxHeight: this.calculateMaxHeight() }}
+ >
+ <ObjectInspector
+ roots={roots}
+ autoExpandDepth={0}
+ autoReleaseObjectActors={false}
+ mode={usesCustomFormatter ? MODE.LONG : null}
+ disableWrap={true}
+ focusable={false}
+ openLink={openLink}
+ createElement={this.createElement}
+ onDOMNodeClick={grip => openElementInInspector(grip)}
+ onInspectIconClick={grip => openElementInInspector(grip)}
+ onDOMNodeMouseOver={grip => highlightDomElement(grip)}
+ onDOMNodeMouseOut={grip => unHighlightDomElement(grip)}
+ mayUseCustomFormatter={true}
+ />
+ </div>
+ );
+ }
+
+ renderSimplePreview() {
+ const {
+ openLink,
+ preview: { resultGrip },
+ } = this.props;
+ return (
+ <div className="preview-popup">
+ {Rep({
+ object: resultGrip,
+ mode: MODE.LONG,
+ openLink,
+ })}
+ </div>
+ );
+ }
+
+ renderExceptionPreview(exception) {
+ return (
+ <ExceptionPopup
+ exception={exception}
+ mouseout={this.onMouseOutException}
+ />
+ );
+ }
+
+ renderPreview() {
+ // We don't have to check and
+ // return on `false`, `""`, `0`, `undefined` etc,
+ // these falsy simple typed value because we want to
+ // do `renderSimplePreview` on these values below.
+ const {
+ preview: { root, exception },
+ } = this.props;
+
+ if (nodeIsFunction(root)) {
+ return this.renderFunctionPreview();
+ }
+
+ if (nodeIsObject(root)) {
+ return <div>{this.renderObjectPreview()}</div>;
+ }
+
+ if (exception) {
+ return this.renderExceptionPreview(exception);
+ }
+
+ return this.renderSimplePreview();
+ }
+
+ getPreviewType() {
+ const {
+ preview: { root, properties, exception },
+ } = this.props;
+ if (
+ exception ||
+ nodeIsPrimitive(root) ||
+ nodeIsFunction(root) ||
+ !Array.isArray(properties) ||
+ properties.length === 0
+ ) {
+ return "tooltip";
+ }
+
+ return "popover";
+ }
+
+ onMouseOut = () => {
+ const { clearPreview, cx } = this.props;
+
+ clearPreview(cx);
+ };
+
+ onMouseOutException = (shouldClearOnMouseout, isExceptionStactraceOpen) => {
+ // onMouseOutException can be called:
+ // a. when the mouse leaves Popover element
+ // b. when the mouse leaves ExceptionPopup element
+ // We want to prevent closing the popup when the stacktrace
+ // is expanded and the mouse leaves either the Popover element
+ // or the ExceptionPopup element.
+ const { clearPreview, cx } = this.props;
+
+ if (shouldClearOnMouseout) {
+ this.isExceptionStactraceOpen = isExceptionStactraceOpen;
+ }
+
+ if (!this.isExceptionStactraceOpen) {
+ clearPreview(cx);
+ }
+ };
+
+ render() {
+ const {
+ preview: { cursorPos, resultGrip, exception },
+ editorRef,
+ } = this.props;
+
+ if (
+ !exception &&
+ (typeof resultGrip == "undefined" || resultGrip?.optimizedOut)
+ ) {
+ return null;
+ }
+
+ const type = this.getPreviewType();
+ return (
+ <Popover
+ targetPosition={cursorPos}
+ type={type}
+ editorRef={editorRef}
+ target={this.props.preview.target}
+ mouseout={exception ? this.onMouseOutException : this.onMouseOut}
+ >
+ {this.renderPreview()}
+ </Popover>
+ );
+ }
+}
+
+export function addHighlightToTargetSiblings(target, props) {
+ // This function searches for related tokens that should also be highlighted when previewed.
+ // Here is the process:
+ // It conducts a search on the target's next siblings and then another search for the previous siblings.
+ // If a sibling is not an element node (nodeType === 1), the highlight is not added and the search is short-circuited.
+ // If the element sibling is the same token type as the target, and is also found in the preview expression, the highlight class is added.
+
+ const tokenType = target.classList.item(0);
+ const previewExpression = props.preview.expression;
+
+ if (
+ tokenType &&
+ previewExpression &&
+ target.innerHTML !== previewExpression
+ ) {
+ let nextSibling = target.nextSibling;
+ let nextElementSibling = target.nextElementSibling;
+
+ // Note: Declaring previous/next ELEMENT siblings as well because
+ // properties like innerHTML can't be checked on nextSibling
+ // without creating a flow error even if the node is an element type.
+ while (
+ nextSibling &&
+ nextElementSibling &&
+ nextSibling.nodeType === 1 &&
+ nextElementSibling.className.includes(tokenType) &&
+ previewExpression.includes(nextElementSibling.innerHTML)
+ ) {
+ // All checks passed, add highlight and continue the search.
+ nextElementSibling.classList.add("preview-token");
+
+ nextSibling = nextSibling.nextSibling;
+ nextElementSibling = nextElementSibling.nextElementSibling;
+ }
+
+ let previousSibling = target.previousSibling;
+ let previousElementSibling = target.previousElementSibling;
+
+ while (
+ previousSibling &&
+ previousElementSibling &&
+ previousSibling.nodeType === 1 &&
+ previousElementSibling.className.includes(tokenType) &&
+ previewExpression.includes(previousElementSibling.innerHTML)
+ ) {
+ // All checks passed, add highlight and continue the search.
+ previousElementSibling.classList.add("preview-token");
+
+ previousSibling = previousSibling.previousSibling;
+ previousElementSibling = previousElementSibling.previousElementSibling;
+ }
+ }
+}
+
+export function removeHighlightForTargetSiblings(target) {
+ // Look at target's previous and next token siblings.
+ // If they also have the highlight class 'preview-token',
+ // remove that class.
+ let nextSibling = target.nextElementSibling;
+ while (nextSibling && nextSibling.className.includes("preview-token")) {
+ nextSibling.classList.remove("preview-token");
+ nextSibling = nextSibling.nextElementSibling;
+ }
+ let previousSibling = target.previousElementSibling;
+ while (
+ previousSibling &&
+ previousSibling.className.includes("preview-token")
+ ) {
+ previousSibling.classList.remove("preview-token");
+ previousSibling = previousSibling.previousElementSibling;
+ }
+}
+
+const mapStateToProps = state => ({
+ cx: getThreadContext(state),
+});
+
+const {
+ addExpression,
+ selectSourceURL,
+ openLink,
+ openElementInInspectorCommand,
+ highlightDomElement,
+ unHighlightDomElement,
+ clearPreview,
+} = actions;
+
+const mapDispatchToProps = {
+ addExpression,
+ selectSourceURL,
+ openLink,
+ openElementInInspector: openElementInInspectorCommand,
+ highlightDomElement,
+ unHighlightDomElement,
+ clearPreview,
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(Popup);
diff --git a/devtools/client/debugger/src/components/Editor/Preview/index.js b/devtools/client/debugger/src/components/Editor/Preview/index.js
new file mode 100644
index 0000000000..0e2c70c557
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview/index.js
@@ -0,0 +1,136 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import PropTypes from "prop-types";
+import React, { PureComponent } from "react";
+import { connect } from "../../../utils/connect";
+
+import Popup from "./Popup";
+
+import {
+ getPreview,
+ getThreadContext,
+ getCurrentThread,
+ getHighlightedCalls,
+ getIsCurrentThreadPaused,
+} from "../../../selectors";
+import actions from "../../../actions";
+
+const EXCEPTION_MARKER = "mark-text-exception";
+
+class Preview extends PureComponent {
+ target = null;
+ constructor(props) {
+ super(props);
+ this.state = { selecting: false };
+ }
+
+ static get propTypes() {
+ return {
+ clearPreview: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ editor: PropTypes.object.isRequired,
+ editorRef: PropTypes.object.isRequired,
+ highlightedCalls: PropTypes.array,
+ isPaused: PropTypes.bool.isRequired,
+ preview: PropTypes.object,
+ setExceptionPreview: PropTypes.func.isRequired,
+ updatePreview: PropTypes.func.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ this.updateListeners();
+ }
+
+ componentWillUnmount() {
+ const { codeMirror } = this.props.editor;
+ const codeMirrorWrapper = codeMirror.getWrapperElement();
+
+ codeMirror.off("tokenenter", this.onTokenEnter);
+ codeMirror.off("scroll", this.onScroll);
+ codeMirrorWrapper.removeEventListener("mouseup", this.onMouseUp);
+ codeMirrorWrapper.removeEventListener("mousedown", this.onMouseDown);
+ }
+
+ updateListeners(prevProps) {
+ const { codeMirror } = this.props.editor;
+ const codeMirrorWrapper = codeMirror.getWrapperElement();
+ codeMirror.on("tokenenter", this.onTokenEnter);
+ codeMirror.on("scroll", this.onScroll);
+ codeMirrorWrapper.addEventListener("mouseup", this.onMouseUp);
+ codeMirrorWrapper.addEventListener("mousedown", this.onMouseDown);
+ }
+
+ onTokenEnter = ({ target, tokenPos }) => {
+ const { cx, editor, updatePreview, highlightedCalls, setExceptionPreview } =
+ this.props;
+
+ const isTargetException = target.classList.contains(EXCEPTION_MARKER);
+
+ if (isTargetException) {
+ setExceptionPreview(cx, target, tokenPos, editor.codeMirror);
+ return;
+ }
+
+ if (
+ this.props.isPaused &&
+ !this.state.selecting &&
+ highlightedCalls === null &&
+ !isTargetException
+ ) {
+ updatePreview(cx, target, tokenPos, editor.codeMirror);
+ }
+ };
+
+ onMouseUp = () => {
+ if (this.props.isPaused) {
+ this.setState({ selecting: false });
+ }
+ };
+
+ onMouseDown = () => {
+ if (this.props.isPaused) {
+ this.setState({ selecting: true });
+ }
+ };
+
+ onScroll = () => {
+ if (this.props.isPaused) {
+ this.props.clearPreview(this.props.cx);
+ }
+ };
+
+ render() {
+ const { preview } = this.props;
+ if (!preview || this.state.selecting) {
+ return null;
+ }
+
+ return (
+ <Popup
+ preview={preview}
+ editor={this.props.editor}
+ editorRef={this.props.editorRef}
+ />
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ const thread = getCurrentThread(state);
+ return {
+ highlightedCalls: getHighlightedCalls(state, thread),
+ cx: getThreadContext(state),
+ preview: getPreview(state),
+ isPaused: getIsCurrentThreadPaused(state),
+ };
+};
+
+export default connect(mapStateToProps, {
+ clearPreview: actions.clearPreview,
+ addExpression: actions.addExpression,
+ updatePreview: actions.updatePreview,
+ setExceptionPreview: actions.setExceptionPreview,
+})(Preview);
diff --git a/devtools/client/debugger/src/components/Editor/Preview/moz.build b/devtools/client/debugger/src/components/Editor/Preview/moz.build
new file mode 100644
index 0000000000..362faadc42
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview/moz.build
@@ -0,0 +1,12 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "ExceptionPopup.js",
+ "index.js",
+ "Popup.js",
+)
diff --git a/devtools/client/debugger/src/components/Editor/Preview/tests/Popup.spec.js b/devtools/client/debugger/src/components/Editor/Preview/tests/Popup.spec.js
new file mode 100644
index 0000000000..8c58fe9c63
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Preview/tests/Popup.spec.js
@@ -0,0 +1,107 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import {
+ addHighlightToTargetSiblings,
+ removeHighlightForTargetSiblings,
+} from "../Popup";
+
+describe("addHighlightToTargetSiblings", () => {
+ it("should add preview highlight class to related target siblings", async () => {
+ const div = document.createElement("div");
+ const divChildren = ["a", "divided", "token"];
+ divChildren.forEach(function (span) {
+ const child = document.createElement("span");
+ const text = document.createTextNode(span);
+ child.appendChild(text);
+ child.classList.add("cm-property");
+ div.appendChild(child);
+ });
+
+ const target = div.children[1];
+ const props = {
+ preview: {
+ expression: "adividedtoken",
+ },
+ };
+
+ addHighlightToTargetSiblings(target, props);
+
+ const previous = target.previousElementSibling;
+ if (previous && previous.className) {
+ expect(previous.className.includes("preview-token")).toEqual(true);
+ }
+
+ const next = target.nextElementSibling;
+ if (next && next.className) {
+ expect(next.className.includes("preview-token")).toEqual(true);
+ }
+ });
+
+ it("should not add preview highlight class to target's related siblings after non-element nodes", () => {
+ const div = document.createElement("div");
+
+ const elementBeforePeriod = document.createElement("span");
+ elementBeforePeriod.innerHTML = "object";
+ elementBeforePeriod.classList.add("cm-property");
+ div.appendChild(elementBeforePeriod);
+
+ const period = document.createTextNode(".");
+ div.appendChild(period);
+
+ const target = document.createElement("span");
+ target.innerHTML = "property";
+ target.classList.add("cm-property");
+ div.appendChild(target);
+
+ const anotherPeriod = document.createTextNode(".");
+ div.appendChild(anotherPeriod);
+
+ const elementAfterPeriod = document.createElement("span");
+ elementAfterPeriod.innerHTML = "anotherProperty";
+ elementAfterPeriod.classList.add("cm-property");
+ div.appendChild(elementAfterPeriod);
+
+ const props = {
+ preview: {
+ expression: "object.property.anotherproperty",
+ },
+ };
+ addHighlightToTargetSiblings(target, props);
+
+ expect(elementBeforePeriod.className.includes("preview-token")).toEqual(
+ false
+ );
+ expect(elementAfterPeriod.className.includes("preview-token")).toEqual(
+ false
+ );
+ });
+});
+
+describe("removeHighlightForTargetSiblings", () => {
+ it("should remove preview highlight class from target's related siblings", async () => {
+ const div = document.createElement("div");
+ const divChildren = ["a", "divided", "token"];
+ divChildren.forEach(function (span) {
+ const child = document.createElement("span");
+ const text = document.createTextNode(span);
+ child.appendChild(text);
+ child.classList.add("preview-token");
+ div.appendChild(child);
+ });
+ const target = div.children[1];
+
+ removeHighlightForTargetSiblings(target);
+
+ const previous = target.previousElementSibling;
+ if (previous && previous.className) {
+ expect(previous.className.includes("preview-token")).toEqual(false);
+ }
+
+ const next = target.nextElementSibling;
+ if (next && next.className) {
+ expect(next.className.includes("preview-token")).toEqual(false);
+ }
+ });
+});
diff --git a/devtools/client/debugger/src/components/Editor/SearchInFileBar.css b/devtools/client/debugger/src/components/Editor/SearchInFileBar.css
new file mode 100644
index 0000000000..0f75783c00
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/SearchInFileBar.css
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.search-bar {
+ position: relative;
+ display: flex;
+ border-top: 1px solid var(--theme-splitter-color);
+ height: var(--editor-searchbar-height);
+}
+
+/* display a fake outline above the search bar's top border, and above
+ the source footer's top border */
+.search-bar::before {
+ content: "";
+ position: absolute;
+ z-index: 10;
+ top: -1px;
+ left: 0;
+ right: 0;
+ bottom: -1px;
+ border: solid 1px var(--blue-50);
+ pointer-events: none;
+ opacity: 0;
+ transition: opacity 150ms ease-out;
+}
+
+.search-bar:focus-within::before {
+ opacity: 1;
+}
+
+.search-bar .search-outline {
+ flex-grow: 1;
+ border-width: 0;
+}
+
+.search-bar .result-list {
+ max-height: 230px;
+}
diff --git a/devtools/client/debugger/src/components/Editor/SearchInFileBar.js b/devtools/client/debugger/src/components/Editor/SearchInFileBar.js
new file mode 100644
index 0000000000..80a6d28fb0
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/SearchInFileBar.js
@@ -0,0 +1,371 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import PropTypes from "prop-types";
+import React, { Component } from "react";
+import { connect } from "../../utils/connect";
+import actions from "../../actions";
+import {
+ getActiveSearch,
+ getSelectedSource,
+ getContext,
+ getSelectedSourceTextContent,
+ getSearchOptions,
+} from "../../selectors";
+
+import { searchKeys } from "../../constants";
+import { scrollList } from "../../utils/result-list";
+
+import SearchInput from "../shared/SearchInput";
+import "./SearchInFileBar.css";
+
+const { PluralForm } = require("devtools/shared/plural-form");
+const { debounce } = require("devtools/shared/debounce");
+import { renderWasmText } from "../../utils/wasm";
+import {
+ clearSearch,
+ find,
+ findNext,
+ findPrev,
+ removeOverlay,
+} from "../../utils/editor";
+import { isFulfilled } from "../../utils/async-value";
+
+function getSearchShortcut() {
+ return L10N.getStr("sourceSearch.search.key2");
+}
+
+class SearchInFileBar extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ query: "",
+ selectedResultIndex: 0,
+ results: {
+ matches: [],
+ matchIndex: -1,
+ count: 0,
+ index: -1,
+ },
+ inputFocused: false,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ closeFileSearch: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ editor: PropTypes.object,
+ modifiers: PropTypes.object.isRequired,
+ searchInFileEnabled: PropTypes.bool.isRequired,
+ selectedSourceTextContent: PropTypes.bool.isRequired,
+ selectedSource: PropTypes.object.isRequired,
+ setActiveSearch: PropTypes.func.isRequired,
+ querySearchWorker: PropTypes.func.isRequired,
+ };
+ }
+
+ componentWillUnmount() {
+ const { shortcuts } = this.context;
+
+ shortcuts.off(getSearchShortcut(), this.toggleSearch);
+ shortcuts.off("Escape", this.onEscape);
+
+ this.doSearch.cancel();
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ const { query } = this.state;
+ // If a new source is selected update the file search results
+ if (
+ this.props.selectedSource &&
+ nextProps.selectedSource !== this.props.selectedSource &&
+ this.props.searchInFileEnabled &&
+ query
+ ) {
+ this.doSearch(query, false);
+ }
+ }
+
+ componentDidMount() {
+ // overwrite this.doSearch with debounced version to
+ // reduce frequency of queries
+ this.doSearch = debounce(this.doSearch, 100);
+ const { shortcuts } = this.context;
+
+ shortcuts.on(getSearchShortcut(), this.toggleSearch);
+ shortcuts.on("Escape", this.onEscape);
+ }
+
+ componentDidUpdate(prevProps, prevState) {
+ if (this.refs.resultList && this.refs.resultList.refs) {
+ scrollList(this.refs.resultList.refs, this.state.selectedResultIndex);
+ }
+ }
+
+ onEscape = e => {
+ this.closeSearch(e);
+ };
+
+ clearSearch = () => {
+ const { editor: ed } = this.props;
+ if (ed) {
+ const ctx = { ed, cm: ed.codeMirror };
+ removeOverlay(ctx, this.state.query);
+ }
+ };
+
+ closeSearch = e => {
+ const { cx, closeFileSearch, editor, searchInFileEnabled } = this.props;
+ this.clearSearch();
+ if (editor && searchInFileEnabled) {
+ closeFileSearch(cx, editor);
+ e.stopPropagation();
+ e.preventDefault();
+ }
+ this.setState({ inputFocused: false });
+ };
+
+ toggleSearch = e => {
+ e.stopPropagation();
+ e.preventDefault();
+ const { editor, searchInFileEnabled, setActiveSearch } = this.props;
+
+ // Set inputFocused to false, so that search query is highlighted whenever search shortcut is used, even if the input already has focus.
+ this.setState({ inputFocused: false });
+
+ if (!searchInFileEnabled) {
+ setActiveSearch("file");
+ }
+
+ if (searchInFileEnabled && editor) {
+ const query = editor.codeMirror.getSelection() || this.state.query;
+
+ if (query !== "") {
+ this.setState({ query, inputFocused: true });
+ this.doSearch(query);
+ } else {
+ this.setState({ query: "", inputFocused: true });
+ }
+ }
+ };
+
+ doSearch = async (query, focusFirstResult = true) => {
+ const { editor, modifiers, selectedSourceTextContent } = this.props;
+ if (
+ !editor ||
+ !selectedSourceTextContent ||
+ !isFulfilled(selectedSourceTextContent) ||
+ !modifiers
+ ) {
+ return;
+ }
+ const selectedContent = selectedSourceTextContent.value;
+
+ const ctx = { ed: editor, cm: editor.codeMirror };
+
+ if (!query) {
+ clearSearch(ctx.cm, query);
+ return;
+ }
+
+ let text;
+ if (selectedContent.type === "wasm") {
+ text = renderWasmText(this.props.selectedSource.id, selectedContent).join(
+ "\n"
+ );
+ } else {
+ text = selectedContent.value;
+ }
+
+ const matches = await this.props.querySearchWorker(query, text, modifiers);
+
+ const res = find(ctx, query, true, modifiers, focusFirstResult);
+ if (!res) {
+ return;
+ }
+
+ const { ch, line } = res;
+
+ const matchIndex = matches.findIndex(
+ elm => elm.line === line && elm.ch === ch
+ );
+ this.setState({
+ results: {
+ matches,
+ matchIndex,
+ count: matches.length,
+ index: ch,
+ },
+ });
+ };
+
+ traverseResults = (e, reverse = false) => {
+ e.stopPropagation();
+ e.preventDefault();
+ const { editor } = this.props;
+
+ if (!editor) {
+ return;
+ }
+
+ const ctx = { ed: editor, cm: editor.codeMirror };
+
+ const { modifiers } = this.props;
+ const { query } = this.state;
+ const { matches } = this.state.results;
+
+ if (query === "" && !this.props.searchInFileEnabled) {
+ this.props.setActiveSearch("file");
+ }
+
+ if (modifiers) {
+ const findArgs = [ctx, query, true, modifiers];
+ const results = reverse ? findPrev(...findArgs) : findNext(...findArgs);
+
+ if (!results) {
+ return;
+ }
+ const { ch, line } = results;
+ const matchIndex = matches.findIndex(
+ elm => elm.line === line && elm.ch === ch
+ );
+ this.setState({
+ results: {
+ matches,
+ matchIndex,
+ count: matches.length,
+ index: ch,
+ },
+ });
+ }
+ };
+
+ // Handlers
+
+ onChange = e => {
+ this.setState({ query: e.target.value });
+
+ return this.doSearch(e.target.value);
+ };
+
+ onFocus = e => {
+ this.setState({ inputFocused: true });
+ };
+
+ onBlur = e => {
+ this.setState({ inputFocused: false });
+ };
+
+ onKeyDown = e => {
+ if (e.key !== "Enter" && e.key !== "F3") {
+ return;
+ }
+
+ this.traverseResults(e, e.shiftKey);
+ e.preventDefault();
+ this.doSearch(e.target.value);
+ };
+
+ onHistoryScroll = query => {
+ this.setState({ query });
+ this.doSearch(query);
+ };
+
+ // Renderers
+ buildSummaryMsg() {
+ const {
+ query,
+ results: { matchIndex, count, index },
+ } = this.state;
+
+ if (query.trim() == "") {
+ return "";
+ }
+
+ if (count == 0) {
+ return L10N.getStr("editor.noResultsFound");
+ }
+
+ if (index == -1) {
+ const resultsSummaryString = L10N.getStr("sourceSearch.resultsSummary1");
+ return PluralForm.get(count, resultsSummaryString).replace("#1", count);
+ }
+
+ const searchResultsString = L10N.getStr("editor.searchResults1");
+ return PluralForm.get(count, searchResultsString)
+ .replace("#1", count)
+ .replace("%d", matchIndex + 1);
+ }
+
+ shouldShowErrorEmoji() {
+ const {
+ query,
+ results: { count },
+ } = this.state;
+ return !!query && !count;
+ }
+
+ render() {
+ const { searchInFileEnabled } = this.props;
+ const {
+ results: { count },
+ } = this.state;
+
+ if (!searchInFileEnabled) {
+ return <div />;
+ }
+
+ return (
+ <div className="search-bar">
+ <SearchInput
+ query={this.state.query}
+ count={count}
+ placeholder={L10N.getStr("sourceSearch.search.placeholder2")}
+ summaryMsg={this.buildSummaryMsg()}
+ isLoading={false}
+ onChange={this.onChange}
+ onFocus={this.onFocus}
+ onBlur={this.onBlur}
+ showErrorEmoji={this.shouldShowErrorEmoji()}
+ onKeyDown={this.onKeyDown}
+ onHistoryScroll={this.onHistoryScroll}
+ handleNext={e => this.traverseResults(e, false)}
+ handlePrev={e => this.traverseResults(e, true)}
+ shouldFocus={this.state.inputFocused}
+ showClose={true}
+ showExcludePatterns={false}
+ handleClose={this.closeSearch}
+ showSearchModifiers={true}
+ searchKey={searchKeys.FILE_SEARCH}
+ onToggleSearchModifier={() => this.doSearch(this.state.query)}
+ />
+ </div>
+ );
+ }
+}
+
+SearchInFileBar.contextTypes = {
+ shortcuts: PropTypes.object,
+};
+
+const mapStateToProps = (state, p) => {
+ const selectedSource = getSelectedSource(state);
+
+ return {
+ cx: getContext(state),
+ searchInFileEnabled: getActiveSearch(state) === "file",
+ selectedSource,
+ selectedSourceTextContent: getSelectedSourceTextContent(state),
+ modifiers: getSearchOptions(state, "file-search"),
+ };
+};
+
+export default connect(mapStateToProps, {
+ setFileSearchQuery: actions.setFileSearchQuery,
+ setActiveSearch: actions.setActiveSearch,
+ closeFileSearch: actions.closeFileSearch,
+ querySearchWorker: actions.querySearchWorker,
+})(SearchInFileBar);
diff --git a/devtools/client/debugger/src/components/Editor/Tab.js b/devtools/client/debugger/src/components/Editor/Tab.js
new file mode 100644
index 0000000000..2f296f9346
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Tab.js
@@ -0,0 +1,282 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+
+import { showMenu, buildMenu } from "../../context-menu/menu";
+
+import SourceIcon from "../shared/SourceIcon";
+import { CloseButton } from "../shared/Button";
+import { copyToTheClipboard } from "../../utils/clipboard";
+
+import actions from "../../actions";
+
+import {
+ getDisplayPath,
+ getFileURL,
+ getRawSourceURL,
+ getSourceQueryString,
+ getTruncatedFileName,
+ isPretty,
+ shouldBlackbox,
+} from "../../utils/source";
+import { getTabMenuItems } from "../../utils/tabs";
+import { createLocation } from "../../utils/location";
+
+import {
+ getSelectedLocation,
+ getActiveSearch,
+ getSourcesForTabs,
+ isSourceBlackBoxed,
+ getContext,
+ isSourceMapIgnoreListEnabled,
+ isSourceOnSourceMapIgnoreList,
+} from "../../selectors";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+class Tab extends PureComponent {
+ static get propTypes() {
+ return {
+ activeSearch: PropTypes.string,
+ closeTab: PropTypes.func.isRequired,
+ closeTabs: PropTypes.func.isRequired,
+ copyToClipboard: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ onDragEnd: PropTypes.func.isRequired,
+ onDragOver: PropTypes.func.isRequired,
+ onDragStart: PropTypes.func.isRequired,
+ selectSource: PropTypes.func.isRequired,
+ selectedLocation: PropTypes.object,
+ showSource: PropTypes.func.isRequired,
+ source: PropTypes.object.isRequired,
+ sourceActor: PropTypes.object.isRequired,
+ tabSources: PropTypes.array.isRequired,
+ toggleBlackBox: PropTypes.func.isRequired,
+ togglePrettyPrint: PropTypes.func.isRequired,
+ isBlackBoxed: PropTypes.bool.isRequired,
+ isSourceOnIgnoreList: PropTypes.bool.isRequired,
+ };
+ }
+
+ onTabContextMenu = (event, tab) => {
+ event.preventDefault();
+ this.showContextMenu(event, tab);
+ };
+
+ showContextMenu(e, tab) {
+ const {
+ cx,
+ closeTab,
+ closeTabs,
+ copyToClipboard,
+ tabSources,
+ showSource,
+ toggleBlackBox,
+ togglePrettyPrint,
+ selectedLocation,
+ source,
+ isBlackBoxed,
+ isSourceOnIgnoreList,
+ } = this.props;
+
+ const tabCount = tabSources.length;
+ const otherTabs = tabSources.filter(t => t.id !== tab);
+ const sourceTab = tabSources.find(t => t.id == tab);
+ const tabURLs = tabSources.map(t => t.url);
+ const otherTabURLs = otherTabs.map(t => t.url);
+
+ if (!sourceTab || !selectedLocation || !selectedLocation.sourceId) {
+ return;
+ }
+
+ const tabMenuItems = getTabMenuItems();
+ const items = [
+ {
+ item: {
+ ...tabMenuItems.closeTab,
+ click: () => closeTab(cx, sourceTab),
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.closeOtherTabs,
+ click: () => closeTabs(cx, otherTabURLs),
+ disabled: otherTabURLs.length === 0,
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.closeTabsToEnd,
+ click: () => {
+ const tabIndex = tabSources.findIndex(t => t.id == tab);
+ closeTabs(
+ cx,
+ tabURLs.filter((t, i) => i > tabIndex)
+ );
+ },
+ disabled:
+ tabCount === 1 ||
+ tabSources.some((t, i) => t === tab && tabCount - 1 === i),
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.closeAllTabs,
+ click: () => closeTabs(cx, tabURLs),
+ },
+ },
+ { item: { type: "separator" } },
+ {
+ item: {
+ ...tabMenuItems.copySource,
+ disabled: selectedLocation.sourceId !== tab,
+ click: () => copyToClipboard(sourceTab),
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.copySourceUri2,
+ disabled: !selectedLocation.sourceUrl,
+ click: () => copyToTheClipboard(getRawSourceURL(sourceTab.url)),
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.showSource,
+ disabled: !selectedLocation.sourceUrl,
+ click: () => showSource(cx, tab),
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.toggleBlackBox,
+ label: isBlackBoxed
+ ? L10N.getStr("ignoreContextItem.unignore")
+ : L10N.getStr("ignoreContextItem.ignore"),
+ disabled: isSourceOnIgnoreList || !shouldBlackbox(source),
+ click: () => toggleBlackBox(cx, source),
+ },
+ },
+ {
+ item: {
+ ...tabMenuItems.prettyPrint,
+ click: () => togglePrettyPrint(cx, tab),
+ disabled: isPretty(sourceTab),
+ },
+ },
+ ];
+
+ showMenu(e, buildMenu(items));
+ }
+
+ isSourceSearchEnabled() {
+ return this.props.activeSearch === "source";
+ }
+
+ render() {
+ const {
+ cx,
+ selectedLocation,
+ selectSource,
+ closeTab,
+ source,
+ sourceActor,
+ tabSources,
+ onDragOver,
+ onDragStart,
+ onDragEnd,
+ } = this.props;
+ const sourceId = source.id;
+ const active =
+ selectedLocation &&
+ sourceId == selectedLocation.sourceId &&
+ !this.isSourceSearchEnabled();
+ const isPrettyCode = isPretty(source);
+
+ function onClickClose(e) {
+ e.stopPropagation();
+ closeTab(cx, source);
+ }
+
+ function handleTabClick(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ return selectSource(cx, source, sourceActor);
+ }
+
+ const className = classnames("source-tab", {
+ active,
+ pretty: isPrettyCode,
+ blackboxed: this.props.isBlackBoxed,
+ });
+
+ const path = getDisplayPath(source, tabSources);
+ const query = getSourceQueryString(source);
+
+ return (
+ <div
+ draggable
+ onDragOver={onDragOver}
+ onDragStart={onDragStart}
+ onDragEnd={onDragEnd}
+ className={className}
+ key={sourceId}
+ onClick={handleTabClick}
+ // Accommodate middle click to close tab
+ onMouseUp={e => e.button === 1 && closeTab(cx, source)}
+ onContextMenu={e => this.onTabContextMenu(e, sourceId)}
+ title={getFileURL(source, false)}
+ >
+ <SourceIcon
+ location={createLocation({ source, sourceActor })}
+ forTab={true}
+ modifier={icon =>
+ ["file", "javascript"].includes(icon) ? null : icon
+ }
+ />
+ <div className="filename">
+ {getTruncatedFileName(source, query)}
+ {path && <span>{`../${path}/..`}</span>}
+ </div>
+ <CloseButton
+ handleClick={onClickClose}
+ tooltip={L10N.getStr("sourceTabs.closeTabButtonTooltip")}
+ />
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = (state, { source }) => {
+ return {
+ cx: getContext(state),
+ tabSources: getSourcesForTabs(state),
+ selectedLocation: getSelectedLocation(state),
+ isBlackBoxed: isSourceBlackBoxed(state, source),
+ isSourceOnIgnoreList:
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, source),
+ activeSearch: getActiveSearch(state),
+ };
+};
+
+export default connect(
+ mapStateToProps,
+ {
+ selectSource: actions.selectSource,
+ copyToClipboard: actions.copyToClipboard,
+ closeTab: actions.closeTab,
+ closeTabs: actions.closeTabs,
+ togglePrettyPrint: actions.togglePrettyPrint,
+ showSource: actions.showSource,
+ toggleBlackBox: actions.toggleBlackBox,
+ },
+ null,
+ {
+ withRef: true,
+ }
+)(Tab);
diff --git a/devtools/client/debugger/src/components/Editor/Tabs.css b/devtools/client/debugger/src/components/Editor/Tabs.css
new file mode 100644
index 0000000000..565d8588f1
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Tabs.css
@@ -0,0 +1,125 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.source-header {
+ display: flex;
+ width: 100%;
+ height: var(--editor-header-height);
+ border-bottom: 1px solid var(--theme-splitter-color);
+ background-color: var(--theme-toolbar-background);
+}
+
+.source-header * {
+ user-select: none;
+}
+
+.source-header .command-bar {
+ flex: initial;
+ flex-shrink: 0;
+ border-bottom: 0;
+ border-inline-start: 1px solid var(--theme-splitter-color);
+}
+
+.source-tabs {
+ flex: auto;
+ align-self: flex-start;
+ align-items: flex-start;
+ /* Reserve space for the overflow button (even if not visible) */
+ padding-inline-end: 28px;
+}
+
+.source-tab {
+ display: inline-flex;
+ align-items: center;
+ position: relative;
+ min-width: 40px;
+ max-width: 100%;
+ overflow: hidden;
+ padding: 4px 10px;
+ cursor: default;
+ height: calc(var(--editor-header-height) - 1px);
+ font-size: 12px;
+ background-color: transparent;
+ vertical-align: bottom;
+}
+
+.source-tab::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 2px;
+ background-color: var(--tab-line-color, transparent);
+ transition: transform 250ms var(--animation-curve),
+ opacity 250ms var(--animation-curve);
+ opacity: 0;
+ transform: scaleX(0);
+}
+
+.source-tab.active {
+ --tab-line-color: var(--tab-line-selected-color);
+ color: var(--theme-toolbar-selected-color);
+ border-bottom-color: transparent;
+}
+
+.source-tab:not(.active):hover {
+ --tab-line-color: var(--tab-line-hover-color);
+ background-color: var(--theme-toolbar-hover);
+}
+
+.source-tab:hover::before,
+.source-tab.active::before {
+ opacity: 1;
+ transform: scaleX(1);
+}
+
+.source-tab .img:is(.prettyPrint,.blackBox) {
+ mask-size: 14px;
+}
+
+.source-tab .img.prettyPrint {
+ background-color: currentColor;
+}
+
+.source-tab .img.source-icon.blackBox {
+ background-color: #806414;
+}
+
+.source-tab .filename {
+ display: block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ padding-inline-end: 4px;
+}
+
+.source-tab .filename span {
+ opacity: 0.7;
+ padding-inline-start: 4px;
+}
+
+.source-tab .close-btn {
+ visibility: hidden;
+ margin-inline-end: -6px;
+}
+
+.source-tab.active .close-btn {
+ color: inherit;
+}
+
+.source-tab.active .close-btn,
+.source-tab:hover .close-btn {
+ visibility: visible;
+}
+
+.source-tab.active .source-icon {
+ background-color: currentColor;
+}
+
+.source-tab .close-btn:hover,
+.source-tab .close-btn:focus {
+ color: var(--theme-selection-color);
+ background-color: var(--theme-selection-background);
+}
diff --git a/devtools/client/debugger/src/components/Editor/Tabs.js b/devtools/client/debugger/src/components/Editor/Tabs.js
new file mode 100644
index 0000000000..3f38f216a0
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/Tabs.js
@@ -0,0 +1,332 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import ReactDOM from "react-dom";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+
+import {
+ getSourceTabs,
+ getSelectedSource,
+ getSourcesForTabs,
+ getIsPaused,
+ getCurrentThread,
+ getContext,
+ getBlackBoxRanges,
+} from "../../selectors";
+import { isVisible } from "../../utils/ui";
+
+import { getHiddenTabs } from "../../utils/tabs";
+import { getFilename, isPretty, getFileURL } from "../../utils/source";
+import actions from "../../actions";
+
+import "./Tabs.css";
+
+import Tab from "./Tab";
+import { PaneToggleButton } from "../shared/Button";
+import Dropdown from "../shared/Dropdown";
+import AccessibleImage from "../shared/AccessibleImage";
+import CommandBar from "../SecondaryPanes/CommandBar";
+
+const { debounce } = require("devtools/shared/debounce");
+
+function haveTabSourcesChanged(tabSources, prevTabSources) {
+ if (tabSources.length !== prevTabSources.length) {
+ return true;
+ }
+
+ for (let i = 0; i < tabSources.length; ++i) {
+ if (tabSources[i].id !== prevTabSources[i].id) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+class Tabs extends PureComponent {
+ constructor(props) {
+ super(props);
+ this.state = {
+ dropdownShown: false,
+ hiddenTabs: [],
+ };
+
+ this.onResize = debounce(() => {
+ this.updateHiddenTabs();
+ });
+ }
+
+ static get propTypes() {
+ return {
+ cx: PropTypes.object.isRequired,
+ endPanelCollapsed: PropTypes.bool.isRequired,
+ horizontal: PropTypes.bool.isRequired,
+ isPaused: PropTypes.bool.isRequired,
+ moveTab: PropTypes.func.isRequired,
+ moveTabBySourceId: PropTypes.func.isRequired,
+ selectSource: PropTypes.func.isRequired,
+ selectedSource: PropTypes.object,
+ blackBoxRanges: PropTypes.object.isRequired,
+ startPanelCollapsed: PropTypes.bool.isRequired,
+ tabSources: PropTypes.array.isRequired,
+ tabs: PropTypes.array.isRequired,
+ togglePaneCollapse: PropTypes.func.isRequired,
+ };
+ }
+
+ get draggedSource() {
+ return this._draggedSource == null
+ ? { url: null, id: null }
+ : this._draggedSource;
+ }
+
+ set draggedSource(source) {
+ this._draggedSource = source;
+ }
+
+ get draggedSourceIndex() {
+ return this._draggedSourceIndex == null ? -1 : this._draggedSourceIndex;
+ }
+
+ set draggedSourceIndex(index) {
+ this._draggedSourceIndex = index;
+ }
+
+ componentDidUpdate(prevProps) {
+ if (
+ this.props.selectedSource !== prevProps.selectedSource ||
+ haveTabSourcesChanged(this.props.tabSources, prevProps.tabSources)
+ ) {
+ this.updateHiddenTabs();
+ }
+ }
+
+ componentDidMount() {
+ window.requestIdleCallback(this.updateHiddenTabs);
+ window.addEventListener("resize", this.onResize);
+ window.document
+ .querySelector(".editor-pane")
+ .addEventListener("resizeend", this.onResize);
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener("resize", this.onResize);
+ window.document
+ .querySelector(".editor-pane")
+ .removeEventListener("resizeend", this.onResize);
+ }
+
+ /*
+ * Updates the hiddenSourceTabs state, by
+ * finding the source tabs which are wrapped and are not on the top row.
+ */
+ updateHiddenTabs = () => {
+ if (!this.refs.sourceTabs) {
+ return;
+ }
+ const { selectedSource, tabSources, moveTab } = this.props;
+ const sourceTabEls = this.refs.sourceTabs.children;
+ const hiddenTabs = getHiddenTabs(tabSources, sourceTabEls);
+
+ if (
+ selectedSource &&
+ isVisible() &&
+ hiddenTabs.find(tab => tab.id == selectedSource.id)
+ ) {
+ moveTab(selectedSource.url, 0);
+ return;
+ }
+
+ this.setState({ hiddenTabs });
+ };
+
+ toggleSourcesDropdown() {
+ this.setState(prevState => ({
+ dropdownShown: !prevState.dropdownShown,
+ }));
+ }
+
+ getIconClass(source) {
+ if (isPretty(source)) {
+ return "prettyPrint";
+ }
+ if (this.props.blackBoxRanges[source.url]) {
+ return "blackBox";
+ }
+ return "file";
+ }
+
+ renderDropdownSource = source => {
+ const { cx, selectSource } = this.props;
+ const filename = getFilename(source);
+
+ const onClick = () => selectSource(cx, source);
+ return (
+ <li key={source.id} onClick={onClick} title={getFileURL(source, false)}>
+ <AccessibleImage
+ className={`dropdown-icon ${this.getIconClass(source)}`}
+ />
+ <span className="dropdown-label">{filename}</span>
+ </li>
+ );
+ };
+
+ onTabDragStart = (source, index) => {
+ this.draggedSource = source;
+ this.draggedSourceIndex = index;
+ };
+
+ onTabDragEnd = () => {
+ this.draggedSource = null;
+ this.draggedSourceIndex = null;
+ };
+
+ onTabDragOver = (e, source, hoveredTabIndex) => {
+ const { moveTabBySourceId } = this.props;
+ if (hoveredTabIndex === this.draggedSourceIndex) {
+ return;
+ }
+
+ const tabDOM = ReactDOM.findDOMNode(
+ this.refs[`tab_${source.id}`].getWrappedInstance()
+ );
+
+ const tabDOMRect = tabDOM.getBoundingClientRect();
+ const { pageX: mouseCursorX } = e;
+ if (
+ /* Case: the mouse cursor moves into the left half of any target tab */
+ mouseCursorX - tabDOMRect.left <
+ tabDOMRect.width / 2
+ ) {
+ // The current tab goes to the left of the target tab
+ const targetTab =
+ hoveredTabIndex > this.draggedSourceIndex
+ ? hoveredTabIndex - 1
+ : hoveredTabIndex;
+ moveTabBySourceId(this.draggedSource.id, targetTab);
+ this.draggedSourceIndex = targetTab;
+ } else if (
+ /* Case: the mouse cursor moves into the right half of any target tab */
+ mouseCursorX - tabDOMRect.left >=
+ tabDOMRect.width / 2
+ ) {
+ // The current tab goes to the right of the target tab
+ const targetTab =
+ hoveredTabIndex < this.draggedSourceIndex
+ ? hoveredTabIndex + 1
+ : hoveredTabIndex;
+ moveTabBySourceId(this.draggedSource.id, targetTab);
+ this.draggedSourceIndex = targetTab;
+ }
+ };
+
+ renderTabs() {
+ const { tabs } = this.props;
+ if (!tabs) {
+ return null;
+ }
+
+ return (
+ <div className="source-tabs" ref="sourceTabs">
+ {tabs.map(({ source, sourceActor }, index) => {
+ return (
+ <Tab
+ onDragStart={_ => this.onTabDragStart(source, index)}
+ onDragOver={e => {
+ this.onTabDragOver(e, source, index);
+ e.preventDefault();
+ }}
+ onDragEnd={this.onTabDragEnd}
+ key={index}
+ source={source}
+ sourceActor={sourceActor}
+ ref={`tab_${source.id}`}
+ />
+ );
+ })}
+ </div>
+ );
+ }
+
+ renderDropdown() {
+ const { hiddenTabs } = this.state;
+ if (!hiddenTabs || !hiddenTabs.length) {
+ return null;
+ }
+
+ const Panel = <ul>{hiddenTabs.map(this.renderDropdownSource)}</ul>;
+ const icon = <AccessibleImage className="more-tabs" />;
+
+ return <Dropdown panel={Panel} icon={icon} />;
+ }
+
+ renderCommandBar() {
+ const { horizontal, endPanelCollapsed, isPaused } = this.props;
+ if (!endPanelCollapsed || !isPaused) {
+ return null;
+ }
+
+ return <CommandBar horizontal={horizontal} />;
+ }
+
+ renderStartPanelToggleButton() {
+ return (
+ <PaneToggleButton
+ position="start"
+ collapsed={this.props.startPanelCollapsed}
+ handleClick={this.props.togglePaneCollapse}
+ />
+ );
+ }
+
+ renderEndPanelToggleButton() {
+ const { horizontal, endPanelCollapsed, togglePaneCollapse } = this.props;
+ if (!horizontal) {
+ return null;
+ }
+
+ return (
+ <PaneToggleButton
+ position="end"
+ collapsed={endPanelCollapsed}
+ handleClick={togglePaneCollapse}
+ horizontal={horizontal}
+ />
+ );
+ }
+
+ render() {
+ return (
+ <div className="source-header">
+ {this.renderStartPanelToggleButton()}
+ {this.renderTabs()}
+ {this.renderDropdown()}
+ {this.renderEndPanelToggleButton()}
+ {this.renderCommandBar()}
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ cx: getContext(state),
+ selectedSource: getSelectedSource(state),
+ tabSources: getSourcesForTabs(state),
+ tabs: getSourceTabs(state),
+ blackBoxRanges: getBlackBoxRanges(state),
+ isPaused: getIsPaused(state, getCurrentThread(state)),
+ };
+};
+
+export default connect(mapStateToProps, {
+ selectSource: actions.selectSource,
+ moveTab: actions.moveTab,
+ moveTabBySourceId: actions.moveTabBySourceId,
+ closeTab: actions.closeTab,
+ togglePaneCollapse: actions.togglePaneCollapse,
+ showSource: actions.showSource,
+})(Tabs);
diff --git a/devtools/client/debugger/src/components/Editor/index.js b/devtools/client/debugger/src/components/Editor/index.js
new file mode 100644
index 0000000000..fcaa129944
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/index.js
@@ -0,0 +1,808 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import PropTypes from "prop-types";
+import React, { PureComponent } from "react";
+import { bindActionCreators } from "redux";
+import ReactDOM from "react-dom";
+import { connect } from "../../utils/connect";
+
+import { getLineText, isLineBlackboxed } from "./../../utils/source";
+import { createLocation } from "./../../utils/location";
+import { features } from "../../utils/prefs";
+import { getIndentation } from "../../utils/indentation";
+
+import { showMenu } from "../../context-menu/menu";
+import {
+ createBreakpointItems,
+ breakpointItemActions,
+} from "./menus/breakpoints";
+
+import {
+ continueToHereItem,
+ editorItemActions,
+ blackBoxLineMenuItem,
+} from "./menus/editor";
+
+import {
+ getActiveSearch,
+ getSelectedLocation,
+ getSelectedSource,
+ getSelectedSourceTextContent,
+ getSelectedBreakableLines,
+ getConditionalPanelLocation,
+ getSymbols,
+ getIsCurrentThreadPaused,
+ getCurrentThread,
+ getThreadContext,
+ getSkipPausing,
+ getInlinePreview,
+ getEditorWrapping,
+ getHighlightedCalls,
+ getBlackBoxRanges,
+ isSourceBlackBoxed,
+ getHighlightedLineRangeForSelectedSource,
+ isSourceMapIgnoreListEnabled,
+ isSourceOnSourceMapIgnoreList,
+} from "../../selectors";
+
+// Redux actions
+import actions from "../../actions";
+
+import SearchInFileBar from "./SearchInFileBar";
+import HighlightLines from "./HighlightLines";
+import Preview from "./Preview";
+import Breakpoints from "./Breakpoints";
+import ColumnBreakpoints from "./ColumnBreakpoints";
+import DebugLine from "./DebugLine";
+import HighlightLine from "./HighlightLine";
+import EmptyLines from "./EmptyLines";
+import EditorMenu from "./EditorMenu";
+import ConditionalPanel from "./ConditionalPanel";
+import InlinePreviews from "./InlinePreviews";
+import HighlightCalls from "./HighlightCalls";
+import Exceptions from "./Exceptions";
+import BlackboxLines from "./BlackboxLines";
+
+import {
+ showSourceText,
+ showLoading,
+ showErrorMessage,
+ getEditor,
+ clearEditor,
+ getCursorLine,
+ getCursorColumn,
+ lineAtHeight,
+ toSourceLine,
+ getDocument,
+ scrollToColumn,
+ toEditorPosition,
+ getSourceLocationFromMouseEvent,
+ hasDocument,
+ onMouseOver,
+ startOperation,
+ endOperation,
+} from "../../utils/editor";
+
+import { resizeToggleButton, resizeBreakpointGutter } from "../../utils/ui";
+
+const { debounce } = require("devtools/shared/debounce");
+const classnames = require("devtools/client/shared/classnames.js");
+
+const { appinfo } = Services;
+const isMacOS = appinfo.OS === "Darwin";
+
+function isSecondary(ev) {
+ return isMacOS && ev.ctrlKey && ev.button === 0;
+}
+
+function isCmd(ev) {
+ return isMacOS ? ev.metaKey : ev.ctrlKey;
+}
+
+import "./Editor.css";
+import "./Breakpoints.css";
+import "./InlinePreview.css";
+
+const cssVars = {
+ searchbarHeight: "var(--editor-searchbar-height)",
+};
+
+class Editor extends PureComponent {
+ static get propTypes() {
+ return {
+ selectedSource: PropTypes.object,
+ selectedSourceTextContent: PropTypes.object,
+ selectedSourceIsBlackBoxed: PropTypes.bool,
+ cx: PropTypes.object.isRequired,
+ closeTab: PropTypes.func.isRequired,
+ toggleBreakpointAtLine: PropTypes.func.isRequired,
+ conditionalPanelLocation: PropTypes.object,
+ closeConditionalPanel: PropTypes.func.isRequired,
+ openConditionalPanel: PropTypes.func.isRequired,
+ updateViewport: PropTypes.func.isRequired,
+ isPaused: PropTypes.bool.isRequired,
+ highlightCalls: PropTypes.func.isRequired,
+ unhighlightCalls: PropTypes.func.isRequired,
+ breakpointActions: PropTypes.object.isRequired,
+ editorActions: PropTypes.object.isRequired,
+ addBreakpointAtLine: PropTypes.func.isRequired,
+ continueToHere: PropTypes.func.isRequired,
+ toggleBlackBox: PropTypes.func.isRequired,
+ updateCursorPosition: PropTypes.func.isRequired,
+ jumpToMappedLocation: PropTypes.func.isRequired,
+ selectedLocation: PropTypes.object,
+ symbols: PropTypes.object,
+ startPanelSize: PropTypes.number.isRequired,
+ endPanelSize: PropTypes.number.isRequired,
+ searchInFileEnabled: PropTypes.bool.isRequired,
+ inlinePreviewEnabled: PropTypes.bool.isRequired,
+ editorWrappingEnabled: PropTypes.bool.isRequired,
+ skipPausing: PropTypes.bool.isRequired,
+ blackboxedRanges: PropTypes.object.isRequired,
+ breakableLines: PropTypes.object.isRequired,
+ highlightedLineRange: PropTypes.object,
+ isSourceOnIgnoreList: PropTypes.bool,
+ };
+ }
+
+ $editorWrapper;
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ editor: null,
+ contextMenu: null,
+ };
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ let { editor } = this.state;
+
+ if (!editor && nextProps.selectedSource) {
+ editor = this.setupEditor();
+ }
+
+ const shouldUpdateText =
+ nextProps.selectedSource !== this.props.selectedSource ||
+ nextProps.selectedSourceTextContent !==
+ this.props.selectedSourceTextContent ||
+ nextProps.symbols !== this.props.symbols;
+
+ const shouldUpdateSize =
+ nextProps.startPanelSize !== this.props.startPanelSize ||
+ nextProps.endPanelSize !== this.props.endPanelSize;
+
+ const shouldScroll =
+ nextProps.selectedLocation &&
+ this.shouldScrollToLocation(nextProps, editor);
+
+ if (shouldUpdateText || shouldUpdateSize || shouldScroll) {
+ startOperation();
+ if (shouldUpdateText) {
+ this.setText(nextProps, editor);
+ }
+ if (shouldUpdateSize) {
+ editor.codeMirror.setSize();
+ }
+ if (shouldScroll) {
+ this.scrollToLocation(nextProps, editor);
+ }
+ endOperation();
+ }
+
+ if (this.props.selectedSource != nextProps.selectedSource) {
+ this.props.updateViewport();
+ resizeBreakpointGutter(editor.codeMirror);
+ resizeToggleButton(editor.codeMirror);
+ }
+ }
+
+ setupEditor() {
+ const editor = getEditor();
+
+ // disables the default search shortcuts
+ editor._initShortcuts = () => {};
+
+ const node = ReactDOM.findDOMNode(this);
+ if (node instanceof HTMLElement) {
+ editor.appendToLocalElement(node.querySelector(".editor-mount"));
+ }
+
+ const { codeMirror } = editor;
+ const codeMirrorWrapper = codeMirror.getWrapperElement();
+
+ codeMirror.on("gutterClick", this.onGutterClick);
+
+ if (features.commandClick) {
+ document.addEventListener("keydown", this.commandKeyDown);
+ document.addEventListener("keyup", this.commandKeyUp);
+ }
+
+ // Set code editor wrapper to be focusable
+ codeMirrorWrapper.tabIndex = 0;
+ codeMirrorWrapper.addEventListener("keydown", e => this.onKeyDown(e));
+ codeMirrorWrapper.addEventListener("click", e => this.onClick(e));
+ codeMirrorWrapper.addEventListener("mouseover", onMouseOver(codeMirror));
+
+ const toggleFoldMarkerVisibility = e => {
+ if (node instanceof HTMLElement) {
+ node
+ .querySelectorAll(".CodeMirror-guttermarker-subtle")
+ .forEach(elem => {
+ elem.classList.toggle("visible");
+ });
+ }
+ };
+
+ const codeMirrorGutter = codeMirror.getGutterElement();
+ codeMirrorGutter.addEventListener("mouseleave", toggleFoldMarkerVisibility);
+ codeMirrorGutter.addEventListener("mouseenter", toggleFoldMarkerVisibility);
+ codeMirrorWrapper.addEventListener("contextmenu", event =>
+ this.openMenu(event)
+ );
+
+ codeMirror.on("scroll", this.onEditorScroll);
+ this.onEditorScroll();
+ this.setState({ editor });
+ return editor;
+ }
+
+ componentDidMount() {
+ const { shortcuts } = this.context;
+
+ shortcuts.on(L10N.getStr("toggleBreakpoint.key"), this.onToggleBreakpoint);
+ shortcuts.on(
+ L10N.getStr("toggleCondPanel.breakpoint.key"),
+ this.onToggleConditionalPanel
+ );
+ shortcuts.on(
+ L10N.getStr("toggleCondPanel.logPoint.key"),
+ this.onToggleConditionalPanel
+ );
+ shortcuts.on(
+ L10N.getStr("sourceTabs.closeTab.key"),
+ this.onCloseShortcutPress
+ );
+ shortcuts.on("Esc", this.onEscape);
+ }
+
+ onCloseShortcutPress = e => {
+ const { cx, selectedSource } = this.props;
+ if (selectedSource) {
+ e.preventDefault();
+ e.stopPropagation();
+ this.props.closeTab(cx, selectedSource, "shortcut");
+ }
+ };
+
+ componentWillUnmount() {
+ const { editor } = this.state;
+ if (editor) {
+ editor.destroy();
+ editor.codeMirror.off("scroll", this.onEditorScroll);
+ this.setState({ editor: null });
+ }
+
+ const { shortcuts } = this.context;
+ shortcuts.off(L10N.getStr("sourceTabs.closeTab.key"));
+ shortcuts.off(L10N.getStr("toggleBreakpoint.key"));
+ shortcuts.off(L10N.getStr("toggleCondPanel.breakpoint.key"));
+ shortcuts.off(L10N.getStr("toggleCondPanel.logPoint.key"));
+ }
+
+ getCurrentLine() {
+ const { codeMirror } = this.state.editor;
+ const { selectedSource } = this.props;
+ if (!selectedSource) {
+ return null;
+ }
+
+ const line = getCursorLine(codeMirror);
+ return toSourceLine(selectedSource.id, line);
+ }
+
+ onToggleBreakpoint = e => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ const line = this.getCurrentLine();
+ if (typeof line !== "number") {
+ return;
+ }
+
+ this.props.toggleBreakpointAtLine(this.props.cx, line);
+ };
+
+ onToggleConditionalPanel = e => {
+ e.stopPropagation();
+ e.preventDefault();
+
+ const {
+ conditionalPanelLocation,
+ closeConditionalPanel,
+ openConditionalPanel,
+ selectedSource,
+ } = this.props;
+
+ const line = this.getCurrentLine();
+
+ const { codeMirror } = this.state.editor;
+ // add one to column for correct position in editor.
+ const column = getCursorColumn(codeMirror) + 1;
+
+ if (conditionalPanelLocation) {
+ return closeConditionalPanel();
+ }
+
+ if (!selectedSource || typeof line !== "number") {
+ return null;
+ }
+
+ return openConditionalPanel(
+ createLocation({
+ line,
+ column,
+ source: selectedSource,
+ }),
+ false
+ );
+ };
+
+ onEditorScroll = debounce(this.props.updateViewport, 75);
+
+ commandKeyDown = e => {
+ const { key } = e;
+ if (this.props.isPaused && key === "Meta") {
+ const { cx, highlightCalls } = this.props;
+ highlightCalls(cx);
+ }
+ };
+
+ commandKeyUp = e => {
+ const { key } = e;
+ if (key === "Meta") {
+ const { cx, unhighlightCalls } = this.props;
+ unhighlightCalls(cx);
+ }
+ };
+
+ onKeyDown(e) {
+ const { codeMirror } = this.state.editor;
+ const { key, target } = e;
+ const codeWrapper = codeMirror.getWrapperElement();
+ const textArea = codeWrapper.querySelector("textArea");
+
+ if (key === "Escape" && target == textArea) {
+ e.stopPropagation();
+ e.preventDefault();
+ codeWrapper.focus();
+ } else if (key === "Enter" && target == codeWrapper) {
+ e.preventDefault();
+ // Focus into editor's text area
+ textArea.focus();
+ }
+ }
+
+ /*
+ * The default Esc command is overridden in the CodeMirror keymap to allow
+ * the Esc keypress event to be catched by the toolbox and trigger the
+ * split console. Restore it here, but preventDefault if and only if there
+ * is a multiselection.
+ */
+ onEscape = e => {
+ if (!this.state.editor) {
+ return;
+ }
+
+ const { codeMirror } = this.state.editor;
+ if (codeMirror.listSelections().length > 1) {
+ codeMirror.execCommand("singleSelection");
+ e.preventDefault();
+ }
+ };
+
+ openMenu(event) {
+ event.stopPropagation();
+ event.preventDefault();
+
+ const {
+ cx,
+ selectedSource,
+ selectedSourceTextContent,
+ breakpointActions,
+ editorActions,
+ isPaused,
+ conditionalPanelLocation,
+ closeConditionalPanel,
+ isSourceOnIgnoreList,
+ blackboxedRanges,
+ } = this.props;
+ const { editor } = this.state;
+ if (!selectedSource || !editor) {
+ return;
+ }
+
+ // only allow one conditionalPanel location.
+ if (conditionalPanelLocation) {
+ closeConditionalPanel();
+ }
+
+ const target = event.target;
+ const { id: sourceId } = selectedSource;
+ const line = lineAtHeight(editor, sourceId, event);
+
+ if (typeof line != "number") {
+ return;
+ }
+
+ const location = createLocation({
+ line,
+ column: undefined,
+ source: selectedSource,
+ });
+
+ if (target.classList.contains("CodeMirror-linenumber")) {
+ const lineText = getLineText(
+ sourceId,
+ selectedSourceTextContent,
+ line
+ ).trim();
+
+ showMenu(event, [
+ ...createBreakpointItems(cx, location, breakpointActions, lineText),
+ { type: "separator" },
+ continueToHereItem(cx, location, isPaused, editorActions),
+ { type: "separator" },
+ blackBoxLineMenuItem(
+ cx,
+ selectedSource,
+ editorActions,
+ editor,
+ blackboxedRanges,
+ isSourceOnIgnoreList,
+ line
+ ),
+ ]);
+ return;
+ }
+
+ if (target.getAttribute("id") === "columnmarker") {
+ return;
+ }
+
+ this.setState({ contextMenu: event });
+ }
+
+ clearContextMenu = () => {
+ this.setState({ contextMenu: null });
+ };
+
+ onGutterClick = (cm, line, gutter, ev) => {
+ const {
+ cx,
+ selectedSource,
+ conditionalPanelLocation,
+ closeConditionalPanel,
+ addBreakpointAtLine,
+ continueToHere,
+ breakableLines,
+ blackboxedRanges,
+ isSourceOnIgnoreList,
+ } = this.props;
+
+ // ignore right clicks in the gutter
+ if (isSecondary(ev) || ev.button === 2 || !selectedSource) {
+ return;
+ }
+
+ if (conditionalPanelLocation) {
+ closeConditionalPanel();
+ return;
+ }
+
+ if (gutter === "CodeMirror-foldgutter") {
+ return;
+ }
+
+ const sourceLine = toSourceLine(selectedSource.id, line);
+ if (typeof sourceLine !== "number") {
+ return;
+ }
+
+ // ignore clicks on a non-breakable line
+ if (!breakableLines.has(sourceLine)) {
+ return;
+ }
+
+ if (isCmd(ev)) {
+ continueToHere(
+ cx,
+ createLocation({
+ line: sourceLine,
+ column: undefined,
+ source: selectedSource,
+ })
+ );
+ return;
+ }
+
+ addBreakpointAtLine(
+ cx,
+ sourceLine,
+ ev.altKey,
+ ev.shiftKey ||
+ isLineBlackboxed(
+ blackboxedRanges[selectedSource.url],
+ sourceLine,
+ isSourceOnIgnoreList
+ )
+ );
+ };
+
+ onGutterContextMenu = event => {
+ this.openMenu(event);
+ };
+
+ onClick(e) {
+ const { cx, selectedSource, updateCursorPosition, jumpToMappedLocation } =
+ this.props;
+
+ if (selectedSource) {
+ const sourceLocation = getSourceLocationFromMouseEvent(
+ this.state.editor,
+ selectedSource,
+ e
+ );
+
+ if (e.metaKey && e.altKey) {
+ jumpToMappedLocation(cx, sourceLocation);
+ }
+
+ updateCursorPosition(sourceLocation);
+ }
+ }
+
+ shouldScrollToLocation(nextProps, editor) {
+ const { selectedLocation, selectedSource, selectedSourceTextContent } =
+ this.props;
+ if (
+ !editor ||
+ !nextProps.selectedSource ||
+ !nextProps.selectedLocation ||
+ !nextProps.selectedLocation.line ||
+ !nextProps.selectedSourceTextContent
+ ) {
+ return false;
+ }
+
+ const isFirstLoad =
+ (!selectedSource || !selectedSourceTextContent) &&
+ nextProps.selectedSourceTextContent;
+ const locationChanged = selectedLocation !== nextProps.selectedLocation;
+ const symbolsChanged = nextProps.symbols != this.props.symbols;
+
+ return isFirstLoad || locationChanged || symbolsChanged;
+ }
+
+ scrollToLocation(nextProps, editor) {
+ const { selectedLocation, selectedSource } = nextProps;
+
+ let { line, column } = toEditorPosition(selectedLocation);
+
+ if (selectedSource && hasDocument(selectedSource.id)) {
+ const doc = getDocument(selectedSource.id);
+ const lineText = doc.getLine(line);
+ column = Math.max(column, getIndentation(lineText));
+ }
+
+ scrollToColumn(editor.codeMirror, line, column);
+ }
+
+ setText(props, editor) {
+ const { selectedSource, selectedSourceTextContent, symbols } = props;
+
+ if (!editor) {
+ return;
+ }
+
+ // check if we previously had a selected source
+ if (!selectedSource) {
+ this.clearEditor();
+ return;
+ }
+
+ if (!selectedSourceTextContent?.value) {
+ showLoading(editor);
+ return;
+ }
+
+ if (selectedSourceTextContent.state === "rejected") {
+ let { value } = selectedSourceTextContent;
+ if (typeof value !== "string") {
+ value = "Unexpected source error";
+ }
+
+ this.showErrorMessage(value);
+ return;
+ }
+
+ showSourceText(editor, selectedSource, selectedSourceTextContent, symbols);
+ }
+
+ clearEditor() {
+ const { editor } = this.state;
+ if (!editor) {
+ return;
+ }
+
+ clearEditor(editor);
+ }
+
+ showErrorMessage(msg) {
+ const { editor } = this.state;
+ if (!editor) {
+ return;
+ }
+
+ showErrorMessage(editor, msg);
+ }
+
+ getInlineEditorStyles() {
+ const { searchInFileEnabled } = this.props;
+
+ if (searchInFileEnabled) {
+ return {
+ height: `calc(100% - ${cssVars.searchbarHeight})`,
+ };
+ }
+
+ return {
+ height: "100%",
+ };
+ }
+
+ renderItems() {
+ const {
+ cx,
+ selectedSource,
+ conditionalPanelLocation,
+ isPaused,
+ inlinePreviewEnabled,
+ editorWrappingEnabled,
+ highlightedLineRange,
+ blackboxedRanges,
+ isSourceOnIgnoreList,
+ selectedSourceIsBlackBoxed,
+ } = this.props;
+ const { editor, contextMenu } = this.state;
+
+ if (!selectedSource || !editor || !getDocument(selectedSource.id)) {
+ return null;
+ }
+
+ return (
+ <div>
+ <HighlightCalls editor={editor} selectedSource={selectedSource} />
+ <DebugLine />
+ <HighlightLine />
+ <EmptyLines editor={editor} />
+ <Breakpoints editor={editor} cx={cx} />
+ <Preview editor={editor} editorRef={this.$editorWrapper} />
+ {highlightedLineRange ? (
+ <HighlightLines editor={editor} range={highlightedLineRange} />
+ ) : null}
+ {isSourceOnIgnoreList || selectedSourceIsBlackBoxed ? (
+ <BlackboxLines
+ editor={editor}
+ selectedSource={selectedSource}
+ isSourceOnIgnoreList={isSourceOnIgnoreList}
+ blackboxedRangesForSelectedSource={
+ blackboxedRanges[selectedSource.url]
+ }
+ />
+ ) : null}
+ <Exceptions />
+ <EditorMenu
+ editor={editor}
+ contextMenu={contextMenu}
+ clearContextMenu={this.clearContextMenu}
+ selectedSource={selectedSource}
+ editorWrappingEnabled={editorWrappingEnabled}
+ />
+ {conditionalPanelLocation ? <ConditionalPanel editor={editor} /> : null}
+ <ColumnBreakpoints editor={editor} />
+ {isPaused && inlinePreviewEnabled ? (
+ <InlinePreviews editor={editor} selectedSource={selectedSource} />
+ ) : null}
+ </div>
+ );
+ }
+
+ renderSearchInFileBar() {
+ if (!this.props.selectedSource) {
+ return null;
+ }
+
+ return <SearchInFileBar editor={this.state.editor} />;
+ }
+
+ render() {
+ const { selectedSourceIsBlackBoxed, skipPausing } = this.props;
+ return (
+ <div
+ className={classnames("editor-wrapper", {
+ blackboxed: selectedSourceIsBlackBoxed,
+ "skip-pausing": skipPausing,
+ })}
+ ref={c => (this.$editorWrapper = c)}
+ >
+ <div
+ className="editor-mount devtools-monospace"
+ style={this.getInlineEditorStyles()}
+ />
+ {this.renderSearchInFileBar()}
+ {this.renderItems()}
+ </div>
+ );
+ }
+}
+
+Editor.contextTypes = {
+ shortcuts: PropTypes.object,
+};
+
+const mapStateToProps = state => {
+ const selectedSource = getSelectedSource(state);
+ const selectedLocation = getSelectedLocation(state);
+
+ return {
+ cx: getThreadContext(state),
+ selectedLocation,
+ selectedSource,
+ selectedSourceTextContent: getSelectedSourceTextContent(state),
+ selectedSourceIsBlackBoxed: selectedSource
+ ? isSourceBlackBoxed(state, selectedSource)
+ : null,
+ isSourceOnIgnoreList:
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, selectedSource),
+ searchInFileEnabled: getActiveSearch(state) === "file",
+ conditionalPanelLocation: getConditionalPanelLocation(state),
+ symbols: getSymbols(state, selectedLocation),
+ isPaused: getIsCurrentThreadPaused(state),
+ skipPausing: getSkipPausing(state),
+ inlinePreviewEnabled: getInlinePreview(state),
+ editorWrappingEnabled: getEditorWrapping(state),
+ highlightedCalls: getHighlightedCalls(state, getCurrentThread(state)),
+ blackboxedRanges: getBlackBoxRanges(state),
+ breakableLines: getSelectedBreakableLines(state),
+ highlightedLineRange: getHighlightedLineRangeForSelectedSource(state),
+ };
+};
+
+const mapDispatchToProps = dispatch => ({
+ ...bindActionCreators(
+ {
+ openConditionalPanel: actions.openConditionalPanel,
+ closeConditionalPanel: actions.closeConditionalPanel,
+ continueToHere: actions.continueToHere,
+ toggleBreakpointAtLine: actions.toggleBreakpointAtLine,
+ addBreakpointAtLine: actions.addBreakpointAtLine,
+ jumpToMappedLocation: actions.jumpToMappedLocation,
+ updateViewport: actions.updateViewport,
+ updateCursorPosition: actions.updateCursorPosition,
+ closeTab: actions.closeTab,
+ toggleBlackBox: actions.toggleBlackBox,
+ highlightCalls: actions.highlightCalls,
+ unhighlightCalls: actions.unhighlightCalls,
+ },
+ dispatch
+ ),
+ breakpointActions: breakpointItemActions(dispatch),
+ editorActions: editorItemActions(dispatch),
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(Editor);
diff --git a/devtools/client/debugger/src/components/Editor/menus/breakpoints.js b/devtools/client/debugger/src/components/Editor/menus/breakpoints.js
new file mode 100644
index 0000000000..b130d8a9b7
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/menus/breakpoints.js
@@ -0,0 +1,293 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import actions from "../../../actions";
+import { bindActionCreators } from "redux";
+import { features } from "../../../utils/prefs";
+import { formatKeyShortcut } from "../../../utils/text";
+import { isLineBlackboxed } from "../../../utils/source";
+
+export const addBreakpointItem = (cx, location, breakpointActions) => ({
+ id: "node-menu-add-breakpoint",
+ label: L10N.getStr("editor.addBreakpoint"),
+ accesskey: L10N.getStr("shortcuts.toggleBreakpoint.accesskey"),
+ disabled: false,
+ click: () => breakpointActions.addBreakpoint(cx, location),
+ accelerator: formatKeyShortcut(L10N.getStr("toggleBreakpoint.key")),
+});
+
+export const removeBreakpointItem = (cx, breakpoint, breakpointActions) => ({
+ id: "node-menu-remove-breakpoint",
+ label: L10N.getStr("editor.removeBreakpoint"),
+ accesskey: L10N.getStr("shortcuts.toggleBreakpoint.accesskey"),
+ disabled: false,
+ click: () => breakpointActions.removeBreakpoint(cx, breakpoint),
+ accelerator: formatKeyShortcut(L10N.getStr("toggleBreakpoint.key")),
+});
+
+export const addConditionalBreakpointItem = (location, breakpointActions) => ({
+ id: "node-menu-add-conditional-breakpoint",
+ label: L10N.getStr("editor.addConditionBreakpoint"),
+ accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.breakpoint.key")),
+ accesskey: L10N.getStr("editor.addConditionBreakpoint.accesskey"),
+ disabled: false,
+ click: () => breakpointActions.openConditionalPanel(location),
+});
+
+export const editConditionalBreakpointItem = (location, breakpointActions) => ({
+ id: "node-menu-edit-conditional-breakpoint",
+ label: L10N.getStr("editor.editConditionBreakpoint"),
+ accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.breakpoint.key")),
+ accesskey: L10N.getStr("editor.addConditionBreakpoint.accesskey"),
+ disabled: false,
+ click: () => breakpointActions.openConditionalPanel(location),
+});
+
+export const conditionalBreakpointItem = (
+ breakpoint,
+ location,
+ breakpointActions
+) => {
+ const {
+ options: { condition },
+ } = breakpoint;
+ return condition
+ ? editConditionalBreakpointItem(location, breakpointActions)
+ : addConditionalBreakpointItem(location, breakpointActions);
+};
+
+export const addLogPointItem = (location, breakpointActions) => ({
+ id: "node-menu-add-log-point",
+ label: L10N.getStr("editor.addLogPoint"),
+ accesskey: L10N.getStr("editor.addLogPoint.accesskey"),
+ disabled: false,
+ click: () => breakpointActions.openConditionalPanel(location, true),
+ accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
+});
+
+export const editLogPointItem = (location, breakpointActions) => ({
+ id: "node-menu-edit-log-point",
+ label: L10N.getStr("editor.editLogPoint"),
+ accesskey: L10N.getStr("editor.editLogPoint.accesskey"),
+ disabled: false,
+ click: () => breakpointActions.openConditionalPanel(location, true),
+ accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
+});
+
+export const logPointItem = (breakpoint, location, breakpointActions) => {
+ const {
+ options: { logValue },
+ } = breakpoint;
+ return logValue
+ ? editLogPointItem(location, breakpointActions)
+ : addLogPointItem(location, breakpointActions);
+};
+
+export const toggleDisabledBreakpointItem = (
+ cx,
+ breakpoint,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList
+) => {
+ return {
+ accesskey: L10N.getStr("editor.disableBreakpoint.accesskey"),
+ disabled: isLineBlackboxed(
+ blackboxedRangesForSelectedSource,
+ breakpoint.location.line,
+ isSelectedSourceOnIgnoreList
+ ),
+ click: () => breakpointActions.toggleDisabledBreakpoint(cx, breakpoint),
+ ...(breakpoint.disabled
+ ? {
+ id: "node-menu-enable-breakpoint",
+ label: L10N.getStr("editor.enableBreakpoint"),
+ }
+ : {
+ id: "node-menu-disable-breakpoint",
+ label: L10N.getStr("editor.disableBreakpoint"),
+ }),
+ };
+};
+
+export const toggleDbgStatementItem = (
+ cx,
+ location,
+ breakpointActions,
+ breakpoint
+) => {
+ if (breakpoint && breakpoint.options.condition === "false") {
+ return {
+ disabled: false,
+ id: "node-menu-enable-dbgStatement",
+ label: L10N.getStr("breakpointMenuItem.enabledbg.label"),
+ click: () =>
+ breakpointActions.setBreakpointOptions(cx, location, {
+ ...breakpoint.options,
+ condition: null,
+ }),
+ };
+ }
+
+ return {
+ disabled: false,
+ id: "node-menu-disable-dbgStatement",
+ label: L10N.getStr("breakpointMenuItem.disabledbg.label"),
+ click: () =>
+ breakpointActions.setBreakpointOptions(cx, location, {
+ condition: "false",
+ }),
+ };
+};
+
+export function breakpointItems(
+ cx,
+ breakpoint,
+ selectedLocation,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList
+) {
+ const items = [
+ removeBreakpointItem(cx, breakpoint, breakpointActions),
+ toggleDisabledBreakpointItem(
+ cx,
+ breakpoint,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList
+ ),
+ ];
+
+ if (breakpoint.originalText.startsWith("debugger")) {
+ items.push(
+ { type: "separator" },
+ toggleDbgStatementItem(
+ cx,
+ selectedLocation,
+ breakpointActions,
+ breakpoint
+ )
+ );
+ }
+
+ items.push(
+ { type: "separator" },
+ removeBreakpointsOnLineItem(cx, selectedLocation, breakpointActions),
+ breakpoint.disabled
+ ? enableBreakpointsOnLineItem(
+ cx,
+ selectedLocation,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList
+ )
+ : disableBreakpointsOnLineItem(cx, selectedLocation, breakpointActions),
+ { type: "separator" }
+ );
+
+ items.push(
+ conditionalBreakpointItem(breakpoint, selectedLocation, breakpointActions)
+ );
+ items.push(logPointItem(breakpoint, selectedLocation, breakpointActions));
+
+ return items;
+}
+
+export function createBreakpointItems(
+ cx,
+ location,
+ breakpointActions,
+ lineText
+) {
+ const items = [
+ addBreakpointItem(cx, location, breakpointActions),
+ addConditionalBreakpointItem(location, breakpointActions),
+ ];
+
+ if (features.logPoints) {
+ items.push(addLogPointItem(location, breakpointActions));
+ }
+
+ if (lineText && lineText.startsWith("debugger")) {
+ items.push(toggleDbgStatementItem(cx, location, breakpointActions));
+ }
+ return items;
+}
+
+// ToDo: Only enable if there are more than one breakpoints on a line?
+export const removeBreakpointsOnLineItem = (
+ cx,
+ location,
+ breakpointActions
+) => ({
+ id: "node-menu-remove-breakpoints-on-line",
+ label: L10N.getStr("breakpointMenuItem.removeAllAtLine.label"),
+ accesskey: L10N.getStr("breakpointMenuItem.removeAllAtLine.accesskey"),
+ disabled: false,
+ click: () =>
+ breakpointActions.removeBreakpointsAtLine(
+ cx,
+ location.sourceId,
+ location.line
+ ),
+});
+
+export const enableBreakpointsOnLineItem = (
+ cx,
+ location,
+ breakpointActions,
+ blackboxedRangesForSelectedSource,
+ isSelectedSourceOnIgnoreList
+) => ({
+ id: "node-menu-remove-breakpoints-on-line",
+ label: L10N.getStr("breakpointMenuItem.enableAllAtLine.label"),
+ accesskey: L10N.getStr("breakpointMenuItem.enableAllAtLine.accesskey"),
+ disabled: isLineBlackboxed(
+ blackboxedRangesForSelectedSource,
+ location.line,
+ isSelectedSourceOnIgnoreList
+ ),
+ click: () =>
+ breakpointActions.enableBreakpointsAtLine(
+ cx,
+ location.sourceId,
+ location.line
+ ),
+});
+
+export const disableBreakpointsOnLineItem = (
+ cx,
+ location,
+ breakpointActions
+) => ({
+ id: "node-menu-remove-breakpoints-on-line",
+ label: L10N.getStr("breakpointMenuItem.disableAllAtLine.label"),
+ accesskey: L10N.getStr("breakpointMenuItem.disableAllAtLine.accesskey"),
+ disabled: false,
+ click: () =>
+ breakpointActions.disableBreakpointsAtLine(
+ cx,
+ location.sourceId,
+ location.line
+ ),
+});
+
+export function breakpointItemActions(dispatch) {
+ return bindActionCreators(
+ {
+ addBreakpoint: actions.addBreakpoint,
+ removeBreakpoint: actions.removeBreakpoint,
+ removeBreakpointsAtLine: actions.removeBreakpointsAtLine,
+ enableBreakpointsAtLine: actions.enableBreakpointsAtLine,
+ disableBreakpointsAtLine: actions.disableBreakpointsAtLine,
+ disableBreakpoint: actions.disableBreakpoint,
+ toggleDisabledBreakpoint: actions.toggleDisabledBreakpoint,
+ toggleBreakpointsAtLine: actions.toggleBreakpointsAtLine,
+ setBreakpointOptions: actions.setBreakpointOptions,
+ openConditionalPanel: actions.openConditionalPanel,
+ },
+ dispatch
+ );
+}
diff --git a/devtools/client/debugger/src/components/Editor/menus/editor.js b/devtools/client/debugger/src/components/Editor/menus/editor.js
new file mode 100644
index 0000000000..5ed3c96f6f
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/menus/editor.js
@@ -0,0 +1,403 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { bindActionCreators } from "redux";
+
+import { copyToTheClipboard } from "../../../utils/clipboard";
+import {
+ getRawSourceURL,
+ getFilename,
+ shouldBlackbox,
+ findBlackBoxRange,
+} from "../../../utils/source";
+import { toSourceLine } from "../../../utils/editor";
+import { downloadFile } from "../../../utils/utils";
+import { features } from "../../../utils/prefs";
+
+import { isFulfilled } from "../../../utils/async-value";
+import actions from "../../../actions";
+
+// Menu Items
+export const continueToHereItem = (cx, location, isPaused, editorActions) => ({
+ accesskey: L10N.getStr("editor.continueToHere.accesskey"),
+ disabled: !isPaused,
+ click: () => editorActions.continueToHere(cx, location),
+ id: "node-menu-continue-to-here",
+ label: L10N.getStr("editor.continueToHere.label"),
+});
+
+const copyToClipboardItem = (selectionText, editorActions) => ({
+ id: "node-menu-copy-to-clipboard",
+ label: L10N.getStr("copyToClipboard.label"),
+ accesskey: L10N.getStr("copyToClipboard.accesskey"),
+ disabled: selectionText.length === 0,
+ click: () => copyToTheClipboard(selectionText),
+});
+
+const copySourceItem = (selectedContent, editorActions) => ({
+ id: "node-menu-copy-source",
+ label: L10N.getStr("copySource.label"),
+ accesskey: L10N.getStr("copySource.accesskey"),
+ disabled: false,
+ click: () =>
+ selectedContent.type === "text" &&
+ copyToTheClipboard(selectedContent.value),
+});
+
+const copySourceUri2Item = (selectedSource, editorActions) => ({
+ id: "node-menu-copy-source-url",
+ label: L10N.getStr("copySourceUri2"),
+ accesskey: L10N.getStr("copySourceUri2.accesskey"),
+ disabled: !selectedSource.url,
+ click: () => copyToTheClipboard(getRawSourceURL(selectedSource.url)),
+});
+
+const jumpToMappedLocationItem = (
+ cx,
+ selectedSource,
+ location,
+ hasMappedLocation,
+ editorActions
+) => ({
+ id: "node-menu-jump",
+ label: L10N.getFormatStr(
+ "editor.jumpToMappedLocation1",
+ selectedSource.isOriginal
+ ? L10N.getStr("generated")
+ : L10N.getStr("original")
+ ),
+ accesskey: L10N.getStr("editor.jumpToMappedLocation1.accesskey"),
+ disabled: !hasMappedLocation,
+ click: () => editorActions.jumpToMappedLocation(cx, location),
+});
+
+const showSourceMenuItem = (cx, selectedSource, editorActions) => ({
+ id: "node-menu-show-source",
+ label: L10N.getStr("sourceTabs.revealInTree"),
+ accesskey: L10N.getStr("sourceTabs.revealInTree.accesskey"),
+ disabled: !selectedSource.url,
+ click: () => editorActions.showSource(cx, selectedSource.id),
+});
+
+const blackBoxMenuItem = (
+ cx,
+ selectedSource,
+ blackboxedRanges,
+ editorActions,
+ isSourceOnIgnoreList
+) => {
+ const isBlackBoxed = !!blackboxedRanges[selectedSource.url];
+ return {
+ id: "node-menu-blackbox",
+ label: isBlackBoxed
+ ? L10N.getStr("ignoreContextItem.unignore")
+ : L10N.getStr("ignoreContextItem.ignore"),
+ accesskey: isBlackBoxed
+ ? L10N.getStr("ignoreContextItem.unignore.accesskey")
+ : L10N.getStr("ignoreContextItem.ignore.accesskey"),
+ disabled: isSourceOnIgnoreList || !shouldBlackbox(selectedSource),
+ click: () => editorActions.toggleBlackBox(cx, selectedSource),
+ };
+};
+
+export const blackBoxLineMenuItem = (
+ cx,
+ selectedSource,
+ editorActions,
+ editor,
+ blackboxedRanges,
+ isSourceOnIgnoreList,
+ // the clickedLine is passed when the context menu
+ // is opened from the gutter, it is not available when the
+ // the context menu is opened from the editor.
+ clickedLine = null
+) => {
+ const { codeMirror } = editor;
+ const from = codeMirror.getCursor("from");
+ const to = codeMirror.getCursor("to");
+
+ const startLine = clickedLine ?? toSourceLine(selectedSource.id, from.line);
+ const endLine = clickedLine ?? toSourceLine(selectedSource.id, to.line);
+
+ const blackboxRange = findBlackBoxRange(selectedSource, blackboxedRanges, {
+ start: startLine,
+ end: endLine,
+ });
+
+ const selectedLineIsBlackBoxed = !!blackboxRange;
+
+ const isSingleLine = selectedLineIsBlackBoxed
+ ? blackboxRange.start.line == blackboxRange.end.line
+ : startLine == endLine;
+
+ const isSourceFullyBlackboxed =
+ blackboxedRanges[selectedSource.url] &&
+ !blackboxedRanges[selectedSource.url].length;
+
+ // The ignore/unignore line context menu item should be disabled when
+ // 1) The source is on the sourcemap ignore list
+ // 2) The whole source is blackboxed or
+ // 3) Multiple lines are blackboxed or
+ // 4) Multiple lines are selected in the editor
+ const shouldDisable =
+ isSourceOnIgnoreList || isSourceFullyBlackboxed || !isSingleLine;
+
+ return {
+ id: "node-menu-blackbox-line",
+ label: !selectedLineIsBlackBoxed
+ ? L10N.getStr("ignoreContextItem.ignoreLine")
+ : L10N.getStr("ignoreContextItem.unignoreLine"),
+ accesskey: !selectedLineIsBlackBoxed
+ ? L10N.getStr("ignoreContextItem.ignoreLine.accesskey")
+ : L10N.getStr("ignoreContextItem.unignoreLine.accesskey"),
+ disabled: shouldDisable,
+ click: () => {
+ const selectionRange = {
+ start: {
+ line: startLine,
+ column: clickedLine == null ? from.ch : 0,
+ },
+ end: {
+ line: endLine,
+ column: clickedLine == null ? to.ch : 0,
+ },
+ };
+
+ editorActions.toggleBlackBox(
+ cx,
+ selectedSource,
+ !selectedLineIsBlackBoxed,
+ selectedLineIsBlackBoxed ? [blackboxRange] : [selectionRange]
+ );
+ },
+ };
+};
+
+const blackBoxLinesMenuItem = (
+ cx,
+ selectedSource,
+ editorActions,
+ editor,
+ blackboxedRanges,
+ isSourceOnIgnoreList
+) => {
+ const { codeMirror } = editor;
+ const from = codeMirror.getCursor("from");
+ const to = codeMirror.getCursor("to");
+
+ const startLine = toSourceLine(selectedSource.id, from.line);
+ const endLine = toSourceLine(selectedSource.id, to.line);
+
+ const blackboxRange = findBlackBoxRange(selectedSource, blackboxedRanges, {
+ start: startLine,
+ end: endLine,
+ });
+
+ const selectedLinesAreBlackBoxed = !!blackboxRange;
+
+ return {
+ id: "node-menu-blackbox-lines",
+ label: !selectedLinesAreBlackBoxed
+ ? L10N.getStr("ignoreContextItem.ignoreLines")
+ : L10N.getStr("ignoreContextItem.unignoreLines"),
+ accesskey: !selectedLinesAreBlackBoxed
+ ? L10N.getStr("ignoreContextItem.ignoreLines.accesskey")
+ : L10N.getStr("ignoreContextItem.unignoreLines.accesskey"),
+ disabled: isSourceOnIgnoreList,
+ click: () => {
+ const selectionRange = {
+ start: {
+ line: startLine,
+ column: from.ch,
+ },
+ end: {
+ line: endLine,
+ column: to.ch,
+ },
+ };
+
+ editorActions.toggleBlackBox(
+ cx,
+ selectedSource,
+ !selectedLinesAreBlackBoxed,
+ selectedLinesAreBlackBoxed ? [blackboxRange] : [selectionRange]
+ );
+ },
+ };
+};
+
+const watchExpressionItem = (
+ cx,
+ selectedSource,
+ selectionText,
+ editorActions
+) => ({
+ id: "node-menu-add-watch-expression",
+ label: L10N.getStr("expressions.label"),
+ accesskey: L10N.getStr("expressions.accesskey"),
+ click: () => editorActions.addExpression(cx, selectionText),
+});
+
+const evaluateInConsoleItem = (
+ selectedSource,
+ selectionText,
+ editorActions
+) => ({
+ id: "node-menu-evaluate-in-console",
+ label: L10N.getStr("evaluateInConsole.label"),
+ click: () => editorActions.evaluateInConsole(selectionText),
+});
+
+const downloadFileItem = (selectedSource, selectedContent, editorActions) => ({
+ id: "node-menu-download-file",
+ label: L10N.getStr("downloadFile.label"),
+ accesskey: L10N.getStr("downloadFile.accesskey"),
+ click: () => downloadFile(selectedContent, getFilename(selectedSource)),
+});
+
+const inlinePreviewItem = editorActions => ({
+ id: "node-menu-inline-preview",
+ label: features.inlinePreview
+ ? L10N.getStr("inlinePreview.hide.label")
+ : L10N.getStr("inlinePreview.show.label"),
+ click: () => editorActions.toggleInlinePreview(!features.inlinePreview),
+});
+
+const editorWrappingItem = (editorActions, editorWrappingEnabled) => ({
+ id: "node-menu-editor-wrapping",
+ label: editorWrappingEnabled
+ ? L10N.getStr("editorWrapping.hide.label")
+ : L10N.getStr("editorWrapping.show.label"),
+ click: () => editorActions.toggleEditorWrapping(!editorWrappingEnabled),
+});
+
+export function editorMenuItems({
+ cx,
+ editorActions,
+ selectedSource,
+ blackboxedRanges,
+ location,
+ selectionText,
+ hasMappedLocation,
+ isTextSelected,
+ isPaused,
+ editorWrappingEnabled,
+ editor,
+ isSourceOnIgnoreList,
+}) {
+ const items = [];
+
+ const content =
+ selectedSource.content && isFulfilled(selectedSource.content)
+ ? selectedSource.content.value
+ : null;
+
+ items.push(
+ jumpToMappedLocationItem(
+ cx,
+ selectedSource,
+ location,
+ hasMappedLocation,
+ editorActions
+ ),
+ continueToHereItem(cx, location, isPaused, editorActions),
+ { type: "separator" },
+ copyToClipboardItem(selectionText, editorActions),
+ ...(!selectedSource.isWasm
+ ? [
+ ...(content ? [copySourceItem(content, editorActions)] : []),
+ copySourceUri2Item(selectedSource, editorActions),
+ ]
+ : []),
+ ...(content
+ ? [downloadFileItem(selectedSource, content, editorActions)]
+ : []),
+ { type: "separator" },
+ showSourceMenuItem(cx, selectedSource, editorActions),
+ { type: "separator" },
+ blackBoxMenuItem(
+ cx,
+ selectedSource,
+ blackboxedRanges,
+ editorActions,
+ isSourceOnIgnoreList
+ )
+ );
+
+ const startLine = toSourceLine(
+ selectedSource.id,
+ editor.codeMirror.getCursor("from").line
+ );
+ const endLine = toSourceLine(
+ selectedSource.id,
+ editor.codeMirror.getCursor("to").line
+ );
+
+ // Find any blackbox ranges that exist for the selected lines
+ const blackboxRange = findBlackBoxRange(selectedSource, blackboxedRanges, {
+ start: startLine,
+ end: endLine,
+ });
+
+ const isMultiLineSelection = blackboxRange
+ ? blackboxRange.start.line !== blackboxRange.end.line
+ : startLine !== endLine;
+
+ // When the range is defined and is an empty array,
+ // the whole source is blackboxed
+ const theWholeSourceIsBlackBoxed =
+ blackboxedRanges[selectedSource.url] &&
+ !blackboxedRanges[selectedSource.url].length;
+
+ if (!theWholeSourceIsBlackBoxed) {
+ const blackBoxSourceLinesMenuItem = isMultiLineSelection
+ ? blackBoxLinesMenuItem
+ : blackBoxLineMenuItem;
+
+ items.push(
+ blackBoxSourceLinesMenuItem(
+ cx,
+ selectedSource,
+ editorActions,
+ editor,
+ blackboxedRanges,
+ isSourceOnIgnoreList
+ )
+ );
+ }
+
+ if (isTextSelected) {
+ items.push(
+ { type: "separator" },
+ watchExpressionItem(cx, selectedSource, selectionText, editorActions),
+ evaluateInConsoleItem(selectedSource, selectionText, editorActions)
+ );
+ }
+
+ items.push(
+ { type: "separator" },
+ inlinePreviewItem(editorActions),
+ editorWrappingItem(editorActions, editorWrappingEnabled)
+ );
+
+ return items;
+}
+
+export function editorItemActions(dispatch) {
+ return bindActionCreators(
+ {
+ addExpression: actions.addExpression,
+ continueToHere: actions.continueToHere,
+ evaluateInConsole: actions.evaluateInConsole,
+ flashLineRange: actions.flashLineRange,
+ jumpToMappedLocation: actions.jumpToMappedLocation,
+ showSource: actions.showSource,
+ toggleBlackBox: actions.toggleBlackBox,
+ toggleBlackBoxLines: actions.toggleBlackBoxLines,
+ toggleInlinePreview: actions.toggleInlinePreview,
+ toggleEditorWrapping: actions.toggleEditorWrapping,
+ },
+ dispatch
+ );
+}
diff --git a/devtools/client/debugger/src/components/Editor/menus/moz.build b/devtools/client/debugger/src/components/Editor/menus/moz.build
new file mode 100644
index 0000000000..18009aa2db
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/menus/moz.build
@@ -0,0 +1,12 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "breakpoints.js",
+ "editor.js",
+ "source.js",
+)
diff --git a/devtools/client/debugger/src/components/Editor/menus/source.js b/devtools/client/debugger/src/components/Editor/menus/source.js
new file mode 100644
index 0000000000..0ba8834e6f
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/menus/source.js
@@ -0,0 +1,3 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
diff --git a/devtools/client/debugger/src/components/Editor/moz.build b/devtools/client/debugger/src/components/Editor/moz.build
new file mode 100644
index 0000000000..b31918f2e0
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/moz.build
@@ -0,0 +1,34 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += [
+ "menus",
+ "Preview",
+]
+
+CompiledModules(
+ "BlackboxLines.js",
+ "Breakpoint.js",
+ "Breakpoints.js",
+ "ColumnBreakpoint.js",
+ "ColumnBreakpoints.js",
+ "ConditionalPanel.js",
+ "DebugLine.js",
+ "EditorMenu.js",
+ "EmptyLines.js",
+ "Exception.js",
+ "Exceptions.js",
+ "Footer.js",
+ "HighlightCalls.js",
+ "HighlightLine.js",
+ "HighlightLines.js",
+ "index.js",
+ "InlinePreview.js",
+ "InlinePreviewRow.js",
+ "InlinePreviews.js",
+ "SearchInFileBar.js",
+ "Tab.js",
+ "Tabs.js",
+)
diff --git a/devtools/client/debugger/src/components/Editor/tests/Breakpoints.spec.js b/devtools/client/debugger/src/components/Editor/tests/Breakpoints.spec.js
new file mode 100644
index 0000000000..915b812dff
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/Breakpoints.spec.js
@@ -0,0 +1,54 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+import Breakpoints from "../Breakpoints";
+
+const BreakpointsComponent = Breakpoints.WrappedComponent;
+
+function generateDefaults(overrides) {
+ const sourceId = "server1.conn1.child1/source1";
+ const matchingBreakpoints = [{ location: { source: { id: sourceId } } }];
+
+ return {
+ selectedSource: { sourceId, get: () => false },
+ editor: {
+ codeMirror: {
+ setGutterMarker: jest.fn(),
+ },
+ },
+ blackboxedRanges: {},
+ cx: {},
+ breakpointActions: {},
+ editorActions: {},
+ breakpoints: matchingBreakpoints,
+ ...overrides,
+ };
+}
+
+function render(overrides = {}) {
+ const props = generateDefaults(overrides);
+ const component = shallow(<BreakpointsComponent {...props} />);
+ return { component, props };
+}
+
+describe("Breakpoints Component", () => {
+ it("should render breakpoints without columns", async () => {
+ const sourceId = "server1.conn1.child1/source1";
+ const breakpoints = [{ location: { source: { id: sourceId } } }];
+
+ const { component, props } = render({ breakpoints });
+ expect(component.find("Breakpoint")).toHaveLength(props.breakpoints.length);
+ });
+
+ it("should render breakpoints with columns", async () => {
+ const sourceId = "server1.conn1.child1/source1";
+ const breakpoints = [{ location: { column: 2, source: { id: sourceId } } }];
+
+ const { component, props } = render({ breakpoints });
+ expect(component.find("Breakpoint")).toHaveLength(props.breakpoints.length);
+ expect(component).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/debugger/src/components/Editor/tests/ConditionalPanel.spec.js b/devtools/client/debugger/src/components/Editor/tests/ConditionalPanel.spec.js
new file mode 100644
index 0000000000..05e4dcb727
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/ConditionalPanel.spec.js
@@ -0,0 +1,77 @@
+/* eslint max-nested-callbacks: ["error", 7] */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { mount } from "enzyme";
+import { ConditionalPanel } from "../ConditionalPanel";
+import * as mocks from "../../../utils/test-mockup";
+
+const source = mocks.makeMockSource();
+
+function generateDefaults(overrides, log, line, column, condition, logValue) {
+ const breakpoint = mocks.makeMockBreakpoint(source, line, column);
+ breakpoint.options.condition = condition;
+ breakpoint.options.logValue = logValue;
+
+ return {
+ editor: {
+ CodeMirror: {
+ fromTextArea: jest.fn(() => {
+ return {
+ on: jest.fn(),
+ getWrapperElement: jest.fn(() => {
+ return {
+ addEventListener: jest.fn(),
+ };
+ }),
+ focus: jest.fn(),
+ setCursor: jest.fn(),
+ lineCount: jest.fn(),
+ };
+ }),
+ },
+ codeMirror: {
+ addLineWidget: jest.fn(),
+ },
+ },
+ location: breakpoint.location,
+ source,
+ breakpoint,
+ log,
+ getDefaultValue: jest.fn(),
+ openConditionalPanel: jest.fn(),
+ closeConditionalPanel: jest.fn(),
+ ...overrides,
+ };
+}
+
+function render(log, line, column, condition, logValue, overrides = {}) {
+ const defaults = generateDefaults(
+ overrides,
+ log,
+ line,
+ column,
+ condition,
+ logValue
+ );
+ const props = { ...defaults, ...overrides };
+ const wrapper = mount(<ConditionalPanel {...props} />);
+ return { wrapper, props };
+}
+
+describe("ConditionalPanel", () => {
+ it("it should render at location of selected breakpoint", () => {
+ const { wrapper } = render(false, 2, 2);
+ expect(wrapper).toMatchSnapshot();
+ });
+ it("it should render with condition at selected breakpoint location", () => {
+ const { wrapper } = render(false, 3, 3, "I'm a condition", "not a log");
+ expect(wrapper).toMatchSnapshot();
+ });
+ it("it should render with logpoint at selected breakpoint location", () => {
+ const { wrapper } = render(true, 4, 4, "not a condition", "I'm a log");
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js b/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js
new file mode 100644
index 0000000000..a7fcb53a2d
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js
@@ -0,0 +1,85 @@
+/* eslint max-nested-callbacks: ["error", 7] */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+
+import DebugLine from "../DebugLine";
+
+import { setDocument } from "../../../utils/editor";
+
+function createMockDocument(clear) {
+ const doc = {
+ addLineClass: jest.fn(),
+ removeLineClass: jest.fn(),
+ markText: jest.fn(() => ({ clear })),
+ getLine: line => "",
+ };
+
+ return doc;
+}
+
+function generateDefaults(editor, overrides) {
+ return {
+ editor,
+ pauseInfo: {
+ why: { type: "breakpoint" },
+ },
+ frame: null,
+ sourceTextContent: null,
+ ...overrides,
+ };
+}
+
+function createLocation(line) {
+ return {
+ source: {
+ id: "foo",
+ },
+ sourceId: "foo",
+ line,
+ column: 2,
+ };
+}
+
+function render(overrides = {}) {
+ const clear = jest.fn();
+ const editor = { codeMirror: {} };
+ const props = generateDefaults(editor, overrides);
+
+ const doc = createMockDocument(clear);
+ setDocument("foo", doc);
+
+ const component = shallow(<DebugLine.WrappedComponent {...props} />, {
+ lifecycleExperimental: true,
+ });
+ return { component, props, clear, editor, doc };
+}
+
+describe("DebugLine Component", () => {
+ describe("pausing at the first location", () => {
+ describe("when there is no selected frame", () => {
+ it("should not set the debug line", () => {
+ const { component, props, doc } = render({ frame: null });
+ const line = 2;
+ const location = createLocation(line);
+
+ component.setProps({ ...props, location });
+ expect(doc.removeLineClass).not.toHaveBeenCalled();
+ });
+ });
+
+ describe("when there is a different source", () => {
+ it("should not set the debug line", async () => {
+ const { component, doc } = render();
+ const newSelectedFrame = { location: { sourceId: "bar" } };
+ expect(doc.removeLineClass).not.toHaveBeenCalled();
+
+ component.setProps({ frame: newSelectedFrame });
+ expect(doc.removeLineClass).not.toHaveBeenCalled();
+ });
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/components/Editor/tests/Footer.spec.js b/devtools/client/debugger/src/components/Editor/tests/Footer.spec.js
new file mode 100644
index 0000000000..b58ba45cb3
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/Footer.spec.js
@@ -0,0 +1,67 @@
+/* eslint max-nested-callbacks: ["error", 7] */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+
+import SourceFooter from "../Footer";
+import { createSourceObject } from "../../../utils/test-head";
+import { setDocument } from "../../../utils/editor";
+
+function createMockDocument(clear, position) {
+ const doc = {
+ getCursor: jest.fn(() => position),
+ };
+ return doc;
+}
+
+function generateDefaults(overrides) {
+ return {
+ editor: {
+ codeMirror: {
+ doc: {},
+ cursorActivity: jest.fn(),
+ on: jest.fn(),
+ },
+ },
+ endPanelCollapsed: false,
+ selectedSource: {
+ ...createSourceObject("foo"),
+ content: null,
+ },
+ ...overrides,
+ };
+}
+
+function render(overrides = {}, position = { line: 0, column: 0 }) {
+ const clear = jest.fn();
+ const props = generateDefaults(overrides);
+
+ const doc = createMockDocument(clear, position);
+ setDocument(props.selectedSource.id, doc);
+
+ const component = shallow(<SourceFooter.WrappedComponent {...props} />, {
+ lifecycleExperimental: true,
+ });
+ return { component, props, clear, doc };
+}
+
+describe("SourceFooter Component", () => {
+ describe("default case", () => {
+ it("should render", () => {
+ const { component } = render();
+ expect(component).toMatchSnapshot();
+ });
+ });
+
+ describe("move cursor", () => {
+ it("should render new cursor position", () => {
+ const { component } = render();
+ component.setState({ cursorPosition: { line: 5, column: 10 } });
+
+ expect(component).toMatchSnapshot();
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Breakpoints.spec.js.snap b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Breakpoints.spec.js.snap
new file mode 100644
index 0000000000..48cda915a4
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Breakpoints.spec.js.snap
@@ -0,0 +1,35 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Breakpoints Component should render breakpoints with columns 1`] = `
+<div>
+ <Breakpoint
+ breakpoint={
+ Object {
+ "location": Object {
+ "column": 2,
+ "source": Object {
+ "id": "server1.conn1.child1/source1",
+ },
+ },
+ }
+ }
+ breakpointActions={Object {}}
+ cx={Object {}}
+ editor={
+ Object {
+ "codeMirror": Object {
+ "setGutterMarker": [MockFunction],
+ },
+ }
+ }
+ editorActions={Object {}}
+ key="undefined:undefined:2"
+ selectedSource={
+ Object {
+ "get": [Function],
+ "sourceId": "server1.conn1.child1/source1",
+ }
+ }
+ />
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/Editor/tests/__snapshots__/ConditionalPanel.spec.js.snap b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/ConditionalPanel.spec.js.snap
new file mode 100644
index 0000000000..d2f52bb6e3
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/ConditionalPanel.spec.js.snap
@@ -0,0 +1,630 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ConditionalPanel it should render at location of selected breakpoint 1`] = `
+<ConditionalPanel
+ breakpoint={
+ Object {
+ "disabled": false,
+ "generatedLocation": Object {
+ "column": 2,
+ "line": 2,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ },
+ "id": "breakpoint",
+ "location": Object {
+ "column": 2,
+ "line": 2,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ },
+ "options": Object {
+ "condition": undefined,
+ "logValue": undefined,
+ },
+ "originalText": "text",
+ "text": "text",
+ }
+ }
+ closeConditionalPanel={[MockFunction]}
+ editor={
+ Object {
+ "CodeMirror": Object {
+ "fromTextArea": [MockFunction] {
+ "calls": Array [
+ Array [
+ <textarea />,
+ Object {
+ "cursorBlinkRate": 530,
+ "mode": "javascript",
+ "placeholder": "Breakpoint condition, e.g. items.length > 0",
+ "theme": "mozilla",
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": Object {
+ "focus": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "getWrapperElement": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": Object {
+ "addEventListener": [MockFunction] {
+ "calls": Array [
+ Array [
+ "keydown",
+ [Function],
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ "lineCount": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "on": [MockFunction] {
+ "calls": Array [
+ Array [
+ "keydown",
+ [Function],
+ ],
+ Array [
+ "blur",
+ [Function],
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "setCursor": [MockFunction] {
+ "calls": Array [
+ Array [
+ undefined,
+ 0,
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ "codeMirror": Object {
+ "addLineWidget": [MockFunction] {
+ "calls": Array [
+ Array [
+ 1,
+ <div>
+ <div
+ class="conditional-breakpoint-panel"
+ >
+ <div
+ class="prompt"
+ >
+ »
+ </div>
+ <textarea />
+ </div>
+ </div>,
+ Object {
+ "coverGutter": true,
+ "noHScroll": true,
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ }
+ }
+ getDefaultValue={[MockFunction]}
+ location={
+ Object {
+ "column": 2,
+ "line": 2,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ }
+ }
+ log={false}
+ openConditionalPanel={[MockFunction]}
+ source={
+ Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ }
+ }
+/>
+`;
+
+exports[`ConditionalPanel it should render with condition at selected breakpoint location 1`] = `
+<ConditionalPanel
+ breakpoint={
+ Object {
+ "disabled": false,
+ "generatedLocation": Object {
+ "column": 3,
+ "line": 3,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ },
+ "id": "breakpoint",
+ "location": Object {
+ "column": 3,
+ "line": 3,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ },
+ "options": Object {
+ "condition": "I'm a condition",
+ "logValue": "not a log",
+ },
+ "originalText": "text",
+ "text": "text",
+ }
+ }
+ closeConditionalPanel={[MockFunction]}
+ editor={
+ Object {
+ "CodeMirror": Object {
+ "fromTextArea": [MockFunction] {
+ "calls": Array [
+ Array [
+ <textarea>
+ I'm a condition
+ </textarea>,
+ Object {
+ "cursorBlinkRate": 530,
+ "mode": "javascript",
+ "placeholder": "Breakpoint condition, e.g. items.length > 0",
+ "theme": "mozilla",
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": Object {
+ "focus": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "getWrapperElement": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": Object {
+ "addEventListener": [MockFunction] {
+ "calls": Array [
+ Array [
+ "keydown",
+ [Function],
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ "lineCount": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "on": [MockFunction] {
+ "calls": Array [
+ Array [
+ "keydown",
+ [Function],
+ ],
+ Array [
+ "blur",
+ [Function],
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "setCursor": [MockFunction] {
+ "calls": Array [
+ Array [
+ undefined,
+ 0,
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ "codeMirror": Object {
+ "addLineWidget": [MockFunction] {
+ "calls": Array [
+ Array [
+ 2,
+ <div>
+ <div
+ class="conditional-breakpoint-panel"
+ >
+ <div
+ class="prompt"
+ >
+ »
+ </div>
+ <textarea>
+ I'm a condition
+ </textarea>
+ </div>
+ </div>,
+ Object {
+ "coverGutter": true,
+ "noHScroll": true,
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ }
+ }
+ getDefaultValue={[MockFunction]}
+ location={
+ Object {
+ "column": 3,
+ "line": 3,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ }
+ }
+ log={false}
+ openConditionalPanel={[MockFunction]}
+ source={
+ Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ }
+ }
+/>
+`;
+
+exports[`ConditionalPanel it should render with logpoint at selected breakpoint location 1`] = `
+<ConditionalPanel
+ breakpoint={
+ Object {
+ "disabled": false,
+ "generatedLocation": Object {
+ "column": 4,
+ "line": 4,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ },
+ "id": "breakpoint",
+ "location": Object {
+ "column": 4,
+ "line": 4,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ },
+ "options": Object {
+ "condition": "not a condition",
+ "logValue": "I'm a log",
+ },
+ "originalText": "text",
+ "text": "text",
+ }
+ }
+ closeConditionalPanel={[MockFunction]}
+ editor={
+ Object {
+ "CodeMirror": Object {
+ "fromTextArea": [MockFunction] {
+ "calls": Array [
+ Array [
+ <textarea>
+ I'm a log
+ </textarea>,
+ Object {
+ "cursorBlinkRate": 530,
+ "mode": "javascript",
+ "placeholder": "Log message, e.g. displayName",
+ "theme": "mozilla",
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": Object {
+ "focus": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "getWrapperElement": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": Object {
+ "addEventListener": [MockFunction] {
+ "calls": Array [
+ Array [
+ "keydown",
+ [Function],
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ "lineCount": [MockFunction] {
+ "calls": Array [
+ Array [],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "on": [MockFunction] {
+ "calls": Array [
+ Array [
+ "keydown",
+ [Function],
+ ],
+ Array [
+ "blur",
+ [Function],
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ "setCursor": [MockFunction] {
+ "calls": Array [
+ Array [
+ undefined,
+ 0,
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ "codeMirror": Object {
+ "addLineWidget": [MockFunction] {
+ "calls": Array [
+ Array [
+ 3,
+ <div>
+ <div
+ class="conditional-breakpoint-panel log-point"
+ >
+ <div
+ class="prompt"
+ >
+ »
+ </div>
+ <textarea>
+ I'm a log
+ </textarea>
+ </div>
+ </div>,
+ Object {
+ "coverGutter": true,
+ "noHScroll": true,
+ },
+ ],
+ ],
+ "results": Array [
+ Object {
+ "type": "return",
+ "value": undefined,
+ },
+ ],
+ },
+ },
+ }
+ }
+ getDefaultValue={[MockFunction]}
+ location={
+ Object {
+ "column": 4,
+ "line": 4,
+ "source": Object {
+ "id": "source",
+ },
+ "sourceId": "source",
+ }
+ }
+ log={true}
+ openConditionalPanel={[MockFunction]}
+ source={
+ Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ }
+ }
+/>
+`;
diff --git a/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap
new file mode 100644
index 0000000000..d6123d4c67
--- /dev/null
+++ b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap
@@ -0,0 +1,105 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`SourceFooter Component default case should render 1`] = `
+<div
+ className="source-footer"
+>
+ <div
+ className="source-footer-start"
+ >
+ <div
+ className="commands"
+ >
+ <button
+ aria-label="Ignore source"
+ className="action black-box"
+ key="black-box"
+ onClick={[Function]}
+ title="Ignore source"
+ >
+ <AccessibleImage
+ className="blackBox"
+ />
+ </button>
+ <button
+ className="action prettyPrint"
+ disabled={true}
+ key="prettyPrint"
+ onClick={[Function]}
+ >
+ <AccessibleImage
+ className="prettyPrint"
+ />
+ </button>
+ </div>
+ </div>
+ <div
+ className="source-footer-end"
+ >
+ <div
+ className="cursor-position"
+ title="(Line 1, column 1)"
+ >
+ (1, 1)
+ </div>
+ <PaneToggleButton
+ collapsed={false}
+ horizontal={false}
+ key="toggle"
+ position="end"
+ />
+ </div>
+</div>
+`;
+
+exports[`SourceFooter Component move cursor should render new cursor position 1`] = `
+<div
+ className="source-footer"
+>
+ <div
+ className="source-footer-start"
+ >
+ <div
+ className="commands"
+ >
+ <button
+ aria-label="Ignore source"
+ className="action black-box"
+ key="black-box"
+ onClick={[Function]}
+ title="Ignore source"
+ >
+ <AccessibleImage
+ className="blackBox"
+ />
+ </button>
+ <button
+ className="action prettyPrint"
+ disabled={true}
+ key="prettyPrint"
+ onClick={[Function]}
+ >
+ <AccessibleImage
+ className="prettyPrint"
+ />
+ </button>
+ </div>
+ </div>
+ <div
+ className="source-footer-end"
+ >
+ <div
+ className="cursor-position"
+ title="(Line 6, column 11)"
+ >
+ (6, 11)
+ </div>
+ <PaneToggleButton
+ collapsed={false}
+ horizontal={false}
+ key="toggle"
+ position="end"
+ />
+ </div>
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Outline.css b/devtools/client/debugger/src/components/PrimaryPanes/Outline.css
new file mode 100644
index 0000000000..cbad0bddc3
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/Outline.css
@@ -0,0 +1,205 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+
+.sources-panel .outline {
+ display: flex;
+ height: 100%;
+}
+
+.source-outline-tabs {
+ font-size: 12px;
+ width: 100%;
+ background: var(--theme-body-background);
+ display: flex;
+ user-select: none;
+ box-sizing: border-box;
+ height: var(--editor-header-height);
+ margin: 0;
+ padding: 0;
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.source-outline-tabs .tab {
+ align-items: center;
+ background-color: var(--theme-toolbar-background);
+ color: var(--theme-toolbar-color);
+ cursor: default;
+ display: inline-flex;
+ flex: 1;
+ justify-content: center;
+ overflow: hidden;
+ padding: 4px 8px;
+ position: relative;
+}
+
+.source-outline-tabs .tab::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 2px;
+ background-color: var(--tab-line-color, transparent);
+ transition: transform 250ms var(--animation-curve),
+ opacity 250ms var(--animation-curve);
+ opacity: 0;
+ transform: scaleX(0);
+}
+
+.source-outline-tabs .tab.active {
+ --tab-line-color: var(--tab-line-selected-color);
+ color: var(--theme-toolbar-selected-color);
+ border-bottom-color: transparent;
+}
+
+.source-outline-tabs .tab:not(.active):hover {
+ --tab-line-color: var(--tab-line-hover-color);
+ background-color: var(--theme-toolbar-hover);
+}
+
+.source-outline-tabs .tab:hover::before,
+.source-outline-tabs .tab.active::before {
+ opacity: 1;
+ transform: scaleX(1);
+}
+
+.source-outline-panel {
+ flex: 1;
+ overflow: auto;
+}
+
+.outline {
+ overflow-y: hidden;
+}
+
+.outline > div {
+ width: 100%;
+ position: relative;
+}
+
+.outline-pane-info {
+ padding: 0.5em;
+ width: 100%;
+ font-style: italic;
+ text-align: center;
+ user-select: none;
+ font-size: 12px;
+ overflow: hidden;
+}
+
+.outline-list {
+ margin: 0;
+ padding: 4px 0;
+ position: absolute;
+ top: 25px;
+ bottom: 25px;
+ left: 0;
+ right: 0;
+ list-style-type: none;
+ overflow: auto;
+}
+
+.outline-list__class-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.outline-list__class-list > .outline-list__element {
+ padding-inline-start: 2rem;
+}
+
+.outline-list__class-list .function-signature .function-name {
+ color: var(--theme-highlight-green);
+}
+
+.outline-list .function-signature .paren {
+ color: inherit;
+}
+
+.outline-list__class h2 {
+ font-weight: normal;
+ font-size: 1em;
+ padding: 3px 0;
+ padding-inline-start: 10px;
+ color: var(--blue-55);
+ margin: 0;
+}
+
+.outline-list__class:not(:first-child) h2 {
+ margin-top: 12px;
+}
+
+.outline-list h2:hover {
+ background: var(--theme-toolbar-background-hover);
+}
+
+.theme-dark .outline-list h2 {
+ color: var(--theme-highlight-blue);
+}
+
+.outline-list h2 .keyword {
+ color: var(--theme-highlight-red);
+}
+
+.outline-list__class h2.focused {
+ background: var(--theme-selection-background);
+}
+
+.outline-list__class h2.focused,
+.outline-list__class h2.focused .keyword {
+ color: var(--theme-selection-color);
+}
+
+.outline-list__element {
+ padding: 3px 10px 3px 10px;
+ cursor: default;
+ white-space: nowrap;
+}
+
+.outline-list > .outline-list__element {
+ padding-inline-start: 1rem;
+}
+
+.outline-list__element-icon {
+ padding-inline-end: 0.4rem;
+}
+
+.outline-list__element:hover {
+ background: var(--theme-toolbar-background-hover);
+}
+
+.outline-list__element.focused {
+ background: var(--theme-selection-background);
+}
+
+.outline-list__element.focused .outline-list__element-icon,
+.outline-list__element.focused .function-signature * {
+ color: var(--theme-selection-color);
+}
+
+.outline-footer {
+ display: flex;
+ box-sizing: border-box;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 25px;
+ background: var(--theme-body-background);
+ border-top: 1px solid var(--theme-splitter-color);
+ opacity: 1;
+ z-index: 1;
+ user-select: none;
+}
+
+.outline-footer button {
+ color: var(--theme-body-color);
+}
+
+.outline-footer button.active {
+ background: var(--theme-selection-background);
+ color: var(--theme-selection-color);
+}
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js
new file mode 100644
index 0000000000..8e0aa17ca4
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js
@@ -0,0 +1,372 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { showMenu } from "../../context-menu/menu";
+import { connect } from "../../utils/connect";
+import { score as fuzzaldrinScore } from "fuzzaldrin-plus";
+
+import { containsPosition, positionAfter } from "../../utils/ast";
+import { copyToTheClipboard } from "../../utils/clipboard";
+import { findFunctionText } from "../../utils/function";
+import { createLocation } from "../../utils/location";
+
+import actions from "../../actions";
+import {
+ getSelectedLocation,
+ getSelectedSource,
+ getSelectedSourceTextContent,
+ getSymbols,
+ getCursorPosition,
+ getContext,
+} from "../../selectors";
+
+import OutlineFilter from "./OutlineFilter";
+import "./Outline.css";
+import PreviewFunction from "../shared/PreviewFunction";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+// Set higher to make the fuzzaldrin filter more specific
+const FUZZALDRIN_FILTER_THRESHOLD = 15000;
+
+/**
+ * Check whether the name argument matches the fuzzy filter argument
+ */
+const filterOutlineItem = (name, filter) => {
+ if (!filter) {
+ return true;
+ }
+
+ if (filter.length === 1) {
+ // when filter is a single char just check if it starts with the char
+ return filter.toLowerCase() === name.toLowerCase()[0];
+ }
+ return fuzzaldrinScore(name, filter) > FUZZALDRIN_FILTER_THRESHOLD;
+};
+
+// Checks if an element is visible inside its parent element
+function isVisible(element, parent) {
+ const parentRect = parent.getBoundingClientRect();
+ const elementRect = element.getBoundingClientRect();
+
+ const parentTop = parentRect.top;
+ const parentBottom = parentRect.bottom;
+ const elTop = elementRect.top;
+ const elBottom = elementRect.bottom;
+
+ return parentTop < elTop && parentBottom > elBottom;
+}
+
+export class Outline extends Component {
+ constructor(props) {
+ super(props);
+ this.focusedElRef = null;
+ this.state = { filter: "", focusedItem: null };
+ }
+
+ static get propTypes() {
+ return {
+ alphabetizeOutline: PropTypes.bool.isRequired,
+ cursorPosition: PropTypes.object,
+ cx: PropTypes.object.isRequired,
+ flashLineRange: PropTypes.func.isRequired,
+ getFunctionText: PropTypes.func.isRequired,
+ onAlphabetizeClick: PropTypes.func.isRequired,
+ selectLocation: PropTypes.func.isRequired,
+ selectedSource: PropTypes.object.isRequired,
+ symbols: PropTypes.object.isRequired,
+ };
+ }
+
+ componentDidUpdate(prevProps) {
+ const { cursorPosition, symbols } = this.props;
+ if (
+ cursorPosition &&
+ symbols &&
+ cursorPosition !== prevProps.cursorPosition
+ ) {
+ this.setFocus(cursorPosition);
+ }
+
+ if (
+ this.focusedElRef &&
+ !isVisible(this.focusedElRef, this.refs.outlineList)
+ ) {
+ this.focusedElRef.scrollIntoView({ block: "center" });
+ }
+ }
+
+ setFocus(cursorPosition) {
+ const { symbols } = this.props;
+ let classes = [];
+ let functions = [];
+
+ if (symbols) {
+ ({ classes, functions } = symbols);
+ }
+
+ // Find items that enclose the selected location
+ const enclosedItems = [...classes, ...functions].filter(
+ ({ name, location }) =>
+ name != "anonymous" && containsPosition(location, cursorPosition)
+ );
+
+ if (!enclosedItems.length) {
+ this.setState({ focusedItem: null });
+ return;
+ }
+
+ // Find the closest item to the selected location to focus
+ const closestItem = enclosedItems.reduce((item, closest) =>
+ positionAfter(item.location, closest.location) ? item : closest
+ );
+
+ this.setState({ focusedItem: closestItem });
+ }
+
+ selectItem(selectedItem) {
+ const { cx, selectedSource, selectLocation } = this.props;
+ if (!selectedSource || !selectedItem) {
+ return;
+ }
+
+ selectLocation(
+ cx,
+ createLocation({
+ source: selectedSource,
+ line: selectedItem.location.start.line,
+ column: selectedItem.location.start.column,
+ })
+ );
+
+ this.setState({ focusedItem: selectedItem });
+ }
+
+ onContextMenu(event, func) {
+ event.stopPropagation();
+ event.preventDefault();
+
+ const { selectedSource, flashLineRange, getFunctionText } = this.props;
+
+ if (!selectedSource) {
+ return;
+ }
+
+ const sourceLine = func.location.start.line;
+ const functionText = getFunctionText(sourceLine);
+
+ const copyFunctionItem = {
+ id: "node-menu-copy-function",
+ label: L10N.getStr("copyFunction.label"),
+ accesskey: L10N.getStr("copyFunction.accesskey"),
+ disabled: !functionText,
+ click: () => {
+ flashLineRange({
+ start: sourceLine,
+ end: func.location.end.line,
+ sourceId: selectedSource.id,
+ });
+ return copyToTheClipboard(functionText);
+ },
+ };
+ const menuOptions = [copyFunctionItem];
+ showMenu(event, menuOptions);
+ }
+
+ updateFilter = filter => {
+ this.setState({ filter: filter.trim() });
+ };
+
+ renderPlaceholder() {
+ const placeholderMessage = this.props.selectedSource
+ ? L10N.getStr("outline.noFunctions")
+ : L10N.getStr("outline.noFileSelected");
+
+ return <div className="outline-pane-info">{placeholderMessage}</div>;
+ }
+
+ renderLoading() {
+ return (
+ <div className="outline-pane-info">{L10N.getStr("loadingText")}</div>
+ );
+ }
+
+ renderFunction(func) {
+ const { focusedItem } = this.state;
+ const { name, location, parameterNames } = func;
+ const isFocused = focusedItem === func;
+
+ return (
+ <li
+ key={`${name}:${location.start.line}:${location.start.column}`}
+ className={classnames("outline-list__element", { focused: isFocused })}
+ ref={el => {
+ if (isFocused) {
+ this.focusedElRef = el;
+ }
+ }}
+ onClick={() => this.selectItem(func)}
+ onContextMenu={e => this.onContextMenu(e, func)}
+ >
+ <span className="outline-list__element-icon">λ</span>
+ <PreviewFunction func={{ name, parameterNames }} />
+ </li>
+ );
+ }
+
+ renderClassHeader(klass) {
+ return (
+ <div>
+ <span className="keyword">class</span> {klass}
+ </div>
+ );
+ }
+
+ renderClassFunctions(klass, functions) {
+ const { symbols } = this.props;
+
+ if (!symbols || klass == null || !functions.length) {
+ return null;
+ }
+
+ const { focusedItem } = this.state;
+ const classFunc = functions.find(func => func.name === klass);
+ const classFunctions = functions.filter(func => func.klass === klass);
+ const classInfo = symbols.classes.find(c => c.name === klass);
+
+ const item = classFunc || classInfo;
+ const isFocused = focusedItem === item;
+
+ return (
+ <li
+ className="outline-list__class"
+ ref={el => {
+ if (isFocused) {
+ this.focusedElRef = el;
+ }
+ }}
+ key={klass}
+ >
+ <h2
+ className={classnames("", { focused: isFocused })}
+ onClick={() => this.selectItem(item)}
+ >
+ {classFunc
+ ? this.renderFunction(classFunc)
+ : this.renderClassHeader(klass)}
+ </h2>
+ <ul className="outline-list__class-list">
+ {classFunctions.map(func => this.renderFunction(func))}
+ </ul>
+ </li>
+ );
+ }
+
+ renderFunctions(functions) {
+ const { filter } = this.state;
+ let classes = [...new Set(functions.map(({ klass }) => klass))];
+ const namedFunctions = functions.filter(
+ ({ name, klass }) =>
+ filterOutlineItem(name, filter) && !klass && !classes.includes(name)
+ );
+
+ const classFunctions = functions.filter(
+ ({ name, klass }) => filterOutlineItem(name, filter) && !!klass
+ );
+
+ if (this.props.alphabetizeOutline) {
+ const sortByName = (a, b) => (a.name < b.name ? -1 : 1);
+ namedFunctions.sort(sortByName);
+ classes = classes.sort();
+ classFunctions.sort(sortByName);
+ }
+
+ return (
+ <ul
+ ref="outlineList"
+ className="outline-list devtools-monospace"
+ dir="ltr"
+ >
+ {namedFunctions.map(func => this.renderFunction(func))}
+ {classes.map(klass => this.renderClassFunctions(klass, classFunctions))}
+ </ul>
+ );
+ }
+
+ renderFooter() {
+ return (
+ <div className="outline-footer">
+ <button
+ onClick={this.props.onAlphabetizeClick}
+ className={this.props.alphabetizeOutline ? "active" : ""}
+ >
+ {L10N.getStr("outline.sortLabel")}
+ </button>
+ </div>
+ );
+ }
+
+ render() {
+ const { symbols, selectedSource } = this.props;
+ const { filter } = this.state;
+
+ if (!selectedSource) {
+ return this.renderPlaceholder();
+ }
+
+ if (!symbols) {
+ return this.renderLoading();
+ }
+
+ const symbolsToDisplay = symbols.functions.filter(
+ ({ name }) => name != "anonymous"
+ );
+
+ if (symbolsToDisplay.length === 0) {
+ return this.renderPlaceholder();
+ }
+
+ return (
+ <div className="outline">
+ <div>
+ <OutlineFilter filter={filter} updateFilter={this.updateFilter} />
+ {this.renderFunctions(symbolsToDisplay)}
+ {this.renderFooter()}
+ </div>
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ const selectedSource = getSelectedSource(state);
+ const symbols = getSymbols(state, getSelectedLocation(state));
+
+ return {
+ cx: getContext(state),
+ symbols,
+ selectedSource,
+ cursorPosition: getCursorPosition(state),
+ getFunctionText: line => {
+ if (selectedSource) {
+ const selectedSourceTextContent = getSelectedSourceTextContent(state);
+ return findFunctionText(
+ line,
+ selectedSource,
+ selectedSourceTextContent,
+ symbols
+ );
+ }
+
+ return null;
+ },
+ };
+};
+
+export default connect(mapStateToProps, {
+ selectLocation: actions.selectLocation,
+ flashLineRange: actions.flashLineRange,
+})(Outline);
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.css b/devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.css
new file mode 100644
index 0000000000..354093fc31
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.css
@@ -0,0 +1,30 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.outline-filter {
+ border: 1px solid var(--theme-splitter-color);
+ border-top: 0px;
+}
+
+.outline-filter-input {
+ height: 24px;
+ width: 100%;
+ background-color: var(--theme-sidebar-background);
+ color: var(--theme-body-color);
+ font-size: inherit;
+ user-select: text;
+}
+
+.outline-filter-input.focused {
+ border: 1px solid var(--theme-highlight-blue);
+}
+
+.outline-filter-input::placeholder {
+ color: var(--theme-text-color-alt);
+ opacity: 1;
+}
+
+.theme-dark .outline-filter-input.focused {
+ border: 1px solid var(--blue-50);
+}
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.js b/devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.js
new file mode 100644
index 0000000000..1d3daed0d9
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/OutlineFilter.js
@@ -0,0 +1,63 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+const classnames = require("devtools/client/shared/classnames.js");
+
+import "./OutlineFilter.css";
+
+export default class OutlineFilter extends Component {
+ state = { focused: false };
+
+ static get propTypes() {
+ return {
+ filter: PropTypes.string.isRequired,
+ updateFilter: PropTypes.func.isRequired,
+ };
+ }
+
+ setFocus = shouldFocus => {
+ this.setState({ focused: shouldFocus });
+ };
+
+ onChange = e => {
+ this.props.updateFilter(e.target.value);
+ };
+
+ onKeyDown = e => {
+ if (e.key === "Escape" && this.props.filter !== "") {
+ // use preventDefault to override toggling the split-console which is
+ // also bound to the ESC key
+ e.preventDefault();
+ this.props.updateFilter("");
+ } else if (e.key === "Enter") {
+ // We must prevent the form submission from taking any action
+ // https://github.com/firefox-devtools/debugger/pull/7308
+ e.preventDefault();
+ }
+ };
+
+ render() {
+ const { focused } = this.state;
+ return (
+ <div className="outline-filter">
+ <form>
+ <input
+ className={classnames("outline-filter-input devtools-filterinput", {
+ focused,
+ })}
+ onFocus={() => this.setFocus(true)}
+ onBlur={() => this.setFocus(false)}
+ placeholder={L10N.getStr("outline.placeholder")}
+ value={this.props.filter}
+ type="text"
+ onChange={this.onChange}
+ onKeyDown={this.onKeyDown}
+ />
+ </form>
+ </div>
+ );
+ }
+}
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.css b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.css
new file mode 100644
index 0000000000..f6d5e132ea
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.css
@@ -0,0 +1,165 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.search-container {
+ position: absolute;
+ top: var(--editor-header-height);
+ left: 0;
+ width: calc(100% - 1px);
+ height: calc(100% - var(--editor-header-height));
+ display: flex;
+ flex-direction: column;
+ z-index: 20;
+ overflow-y: hidden;
+
+ /* Using the same colors as the Netmonitor's --table-selection-background-hover */
+ --search-result-background-hover: rgba(209, 232, 255, 0.8);
+}
+
+.theme-dark .search-container {
+ --search-result-background-hover: rgba(53, 59, 72, 1);
+}
+
+.project-text-search {
+ flex-grow: 1;
+ display: flex;
+ flex-direction: column;
+ overflow-y: hidden;
+ height: 100%;
+}
+
+.project-text-search .result {
+ display: contents;
+ cursor: default;
+ line-height: 16px;
+ font-size: 11px;
+ font-family: var(--monospace-font-family);
+}
+
+.project-text-search .result:hover > * {
+ background-color: var(--search-result-background-hover);
+}
+
+.project-text-search .result .line-number {
+ grid-column: 1;
+ padding-block: 1px;
+ padding-inline-start: 4px;
+ padding-inline-end: 6px;
+ text-align: end;
+ color: var(--theme-text-color-alt);
+}
+
+.project-text-search .result .line-value {
+ grid-column: 2;
+ padding-block: 1px;
+ padding-inline-end: 4px;
+ text-overflow: ellipsis;
+ overflow-x: hidden;
+}
+
+.project-text-search .result .query-match {
+ border-bottom: 1px solid var(--theme-contrast-border);
+ color: var(--theme-contrast-color);
+ background-color: var(--theme-contrast-background);
+}
+
+.project-text-search .result.focused .query-match {
+ border-bottom: none;
+ color: var(--theme-selection-background);
+ background-color: var(--theme-selection-color);
+}
+
+.project-text-search .tree-indent {
+ display: none;
+}
+
+.project-text-search .no-result-msg {
+ color: var(--theme-text-color-inactive);
+ font-size: 24px;
+ padding: 4px 15px;
+ max-width: 100%;
+ overflow-wrap: break-word;
+ hyphens: auto;
+}
+
+.project-text-search .file-result {
+ grid-column: 1/3;
+ display: flex;
+ align-items: center;
+ width: 100%;
+ min-height: 24px;
+ padding: 2px 4px;
+ font-weight: bold;
+ font-size: 12px;
+ line-height: 16px;
+ cursor: default;
+}
+
+.project-text-search .file-result .img {
+ margin-inline: 2px;
+}
+
+.project-text-search .file-result .img.file {
+ margin-inline-end: 4px;
+}
+
+.project-text-search .file-path {
+ flex: 0 1 auto;
+ padding-inline-end: 4px;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.project-text-search .file-path:empty {
+ display: none;
+}
+
+.project-text-search .search-field {
+ display: flex;
+ align-self: stretch;
+ flex-grow: 1;
+ width: 100%;
+ border-bottom: none;
+}
+
+.project-text-search .tree {
+ overflow-x: hidden;
+ overflow-y: auto;
+ height: 100%;
+ display: grid;
+ min-width: 100%;
+ white-space: nowrap;
+ user-select: none;
+ align-content: start;
+ /* Align the second column to the search input's text value */
+ grid-template-columns: minmax(40px, auto) 1fr;
+ padding-top: 4px;
+}
+
+/* Fake padding-bottom using a pseudo-element because Gecko doesn't render the
+ padding-bottom in a scroll container */
+.project-text-search .tree::after {
+ content: "";
+ display: block;
+ height: 4px;
+}
+
+.project-text-search .tree .tree-node {
+ display: contents;
+}
+
+/* Focus values */
+
+.project-text-search .file-result.focused,
+.project-text-search .result.focused .line-value,
+.project-text-search .result.focused .line-number {
+ color: var(--theme-selection-color);
+ background-color: var(--theme-selection-background);
+}
+
+.project-text-search .file-result.focused .img {
+ background-color: currentColor;
+}
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js
new file mode 100644
index 0000000000..922e266c40
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js
@@ -0,0 +1,327 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import actions from "../../actions";
+
+import { getEditor } from "../../utils/editor";
+import { searchKeys } from "../../constants";
+
+import { statusType } from "../../reducers/project-text-search";
+import { getRelativePath } from "../../utils/sources-tree/utils";
+import { getFormattedSourceId } from "../../utils/source";
+import {
+ getProjectSearchResults,
+ getProjectSearchStatus,
+ getProjectSearchQuery,
+ getContext,
+} from "../../selectors";
+
+import SearchInput from "../shared/SearchInput";
+import AccessibleImage from "../shared/AccessibleImage";
+
+const { PluralForm } = require("devtools/shared/plural-form");
+const classnames = require("devtools/client/shared/classnames.js");
+const Tree = require("devtools/client/shared/components/Tree");
+
+import "./ProjectSearch.css";
+
+function getFilePath(item, index) {
+ return item.type === "RESULT"
+ ? `${item.location.source.id}-${index || "$"}`
+ : `${item.location.source.id}-${item.location.line}-${
+ item.location.column
+ }-${index || "$"}`;
+}
+
+export class ProjectSearch extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ inputValue: this.props.query || "",
+ inputFocused: false,
+ focusedItem: null,
+ expanded: new Set(),
+ };
+ }
+
+ static get propTypes() {
+ return {
+ clearSearch: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ doSearchForHighlight: PropTypes.func.isRequired,
+ query: PropTypes.string.isRequired,
+ results: PropTypes.array.isRequired,
+ searchSources: PropTypes.func.isRequired,
+ selectSpecificLocation: PropTypes.func.isRequired,
+ setActiveSearch: PropTypes.func.isRequired,
+ status: PropTypes.oneOf([
+ "INITIAL",
+ "FETCHING",
+ "CANCELED",
+ "DONE",
+ "ERROR",
+ ]).isRequired,
+ modifiers: PropTypes.object,
+ toggleProjectSearchModifier: PropTypes.func,
+ };
+ }
+
+ componentDidMount() {
+ const { shortcuts } = this.context;
+ shortcuts.on("Enter", this.onEnterPress);
+ }
+
+ componentWillUnmount() {
+ const { shortcuts } = this.context;
+ shortcuts.off("Enter", this.onEnterPress);
+ }
+
+ componentDidUpdate(prevProps) {
+ // If the query changes in redux, also change it in the UI
+ if (prevProps.query !== this.props.query) {
+ this.setState({ inputValue: this.props.query });
+ }
+ }
+
+ doSearch(searchTerm) {
+ if (searchTerm) {
+ this.props.searchSources(this.props.cx, searchTerm);
+ }
+ }
+
+ selectMatchItem = matchItem => {
+ this.props.selectSpecificLocation(this.props.cx, matchItem.location);
+ this.props.doSearchForHighlight(
+ this.state.inputValue,
+ getEditor(),
+ matchItem.location.line,
+ matchItem.location.column
+ );
+ };
+
+ highlightMatches = lineMatch => {
+ const { value, matchIndex, match } = lineMatch;
+ const len = match.length;
+
+ return (
+ <span className="line-value">
+ <span className="line-match" key={0}>
+ {value.slice(0, matchIndex)}
+ </span>
+ <span className="query-match" key={1}>
+ {value.substr(matchIndex, len)}
+ </span>
+ <span className="line-match" key={2}>
+ {value.slice(matchIndex + len, value.length)}
+ </span>
+ </span>
+ );
+ };
+
+ getResultCount = () =>
+ this.props.results.reduce((count, file) => count + file.matches.length, 0);
+
+ onKeyDown = e => {
+ if (e.key === "Escape") {
+ return;
+ }
+
+ e.stopPropagation();
+
+ this.setState({ focusedItem: null });
+ this.doSearch(this.state.inputValue);
+ };
+
+ onHistoryScroll = query => {
+ this.setState({ inputValue: query });
+ };
+
+ onEnterPress = () => {
+ // This is to select a match from the search result.
+ if (!this.state.focusedItem || this.state.inputFocused) {
+ return;
+ }
+ if (this.state.focusedItem.type === "MATCH") {
+ this.selectMatchItem(this.state.focusedItem);
+ }
+ };
+
+ onFocus = item => {
+ if (this.state.focusedItem !== item) {
+ this.setState({ focusedItem: item });
+ }
+ };
+
+ inputOnChange = e => {
+ const inputValue = e.target.value;
+ const { cx, clearSearch } = this.props;
+ this.setState({ inputValue });
+ if (inputValue === "") {
+ clearSearch(cx);
+ }
+ };
+
+ renderFile = (file, focused, expanded) => {
+ const matchesLength = file.matches.length;
+ const matches = ` (${matchesLength} match${matchesLength > 1 ? "es" : ""})`;
+ return (
+ <div
+ className={classnames("file-result", { focused })}
+ key={file.location.source.id}
+ >
+ <AccessibleImage className={classnames("arrow", { expanded })} />
+ <AccessibleImage className="file" />
+ <span className="file-path">
+ {file.location.source.url
+ ? getRelativePath(file.location.source.url)
+ : getFormattedSourceId(file.location.source.id)}
+ </span>
+ <span className="matches-summary">{matches}</span>
+ </div>
+ );
+ };
+
+ renderMatch = (match, focused) => {
+ return (
+ <div
+ className={classnames("result", { focused })}
+ onClick={() => setTimeout(() => this.selectMatchItem(match), 50)}
+ >
+ <span className="line-number" key={match.location.line}>
+ {match.location.line}
+ </span>
+ {this.highlightMatches(match)}
+ </div>
+ );
+ };
+
+ renderItem = (item, depth, focused, _, expanded) => {
+ if (item.type === "RESULT") {
+ return this.renderFile(item, focused, expanded);
+ }
+ return this.renderMatch(item, focused);
+ };
+
+ renderResults = () => {
+ const { status, results } = this.props;
+ if (!this.props.query) {
+ return null;
+ }
+ if (results.length) {
+ return (
+ <Tree
+ getRoots={() => results}
+ getChildren={file => file.matches || []}
+ itemHeight={24}
+ autoExpandAll={true}
+ autoExpandDepth={1}
+ autoExpandNodeChildrenLimit={100}
+ getParent={item => null}
+ getPath={getFilePath}
+ renderItem={this.renderItem}
+ focused={this.state.focusedItem}
+ onFocus={this.onFocus}
+ isExpanded={item => {
+ return this.state.expanded.has(item);
+ }}
+ onExpand={item => {
+ const { expanded } = this.state;
+ expanded.add(item);
+ this.setState({ expanded });
+ }}
+ onCollapse={item => {
+ const { expanded } = this.state;
+ expanded.delete(item);
+ this.setState({ expanded });
+ }}
+ getKey={getFilePath}
+ />
+ );
+ }
+ const msg =
+ status === statusType.fetching
+ ? L10N.getStr("loadingText")
+ : L10N.getStr("projectTextSearch.noResults");
+ return <div className="no-result-msg absolute-center">{msg}</div>;
+ };
+
+ renderSummary = () => {
+ if (this.props.query !== "") {
+ const resultsSummaryString = L10N.getStr("sourceSearch.resultsSummary2");
+ const count = this.getResultCount();
+ return PluralForm.get(count, resultsSummaryString).replace("#1", count);
+ }
+ return "";
+ };
+
+ shouldShowErrorEmoji() {
+ return !this.getResultCount() && this.props.status === statusType.done;
+ }
+
+ renderInput() {
+ const { status } = this.props;
+
+ return (
+ <SearchInput
+ query={this.state.inputValue}
+ count={this.getResultCount()}
+ placeholder={L10N.getStr("projectTextSearch.placeholder")}
+ size="small"
+ showErrorEmoji={this.shouldShowErrorEmoji()}
+ summaryMsg={this.renderSummary()}
+ isLoading={status === statusType.fetching}
+ onChange={this.inputOnChange}
+ onFocus={() => this.setState({ inputFocused: true })}
+ onBlur={() => this.setState({ inputFocused: false })}
+ onKeyDown={this.onKeyDown}
+ onHistoryScroll={this.onHistoryScroll}
+ showClose={false}
+ showExcludePatterns={true}
+ excludePatternsLabel={L10N.getStr(
+ "projectTextSearch.excludePatterns.label"
+ )}
+ excludePatternsPlaceholder={L10N.getStr(
+ "projectTextSearch.excludePatterns.placeholder"
+ )}
+ ref="searchInput"
+ showSearchModifiers={true}
+ searchKey={searchKeys.PROJECT_SEARCH}
+ onToggleSearchModifier={() => this.doSearch(this.state.inputValue)}
+ />
+ );
+ }
+
+ render() {
+ return (
+ <div className="search-container">
+ <div className="project-text-search">
+ <div className="header">{this.renderInput()}</div>
+ {this.renderResults()}
+ </div>
+ </div>
+ );
+ }
+}
+
+ProjectSearch.contextTypes = {
+ shortcuts: PropTypes.object,
+};
+
+const mapStateToProps = state => ({
+ cx: getContext(state),
+ results: getProjectSearchResults(state),
+ query: getProjectSearchQuery(state),
+ status: getProjectSearchStatus(state),
+});
+
+export default connect(mapStateToProps, {
+ searchSources: actions.searchSources,
+ clearSearch: actions.clearSearch,
+ selectSpecificLocation: actions.selectSpecificLocation,
+ setActiveSearch: actions.setActiveSearch,
+ doSearchForHighlight: actions.doSearchForHighlight,
+})(ProjectSearch);
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Sources.css b/devtools/client/debugger/src/components/PrimaryPanes/Sources.css
new file mode 100644
index 0000000000..e0e251cb47
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/Sources.css
@@ -0,0 +1,219 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.sources-panel {
+ background-color: var(--theme-sidebar-background);
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ overflow: hidden;
+ position: relative;
+}
+
+.sources-panel * {
+ user-select: none;
+}
+
+/***********************/
+/* Souces Panel layout */
+/***********************/
+
+.sources-list {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ overflow: hidden;
+}
+
+.sources-list .sources-clear-root-container {
+ grid-area: custom-root;
+}
+
+.sources-list :is(.tree, .no-sources-message) {
+ grid-area: sources-tree-or-empty-message;
+}
+
+/****************/
+/* Custom root */
+/****************/
+
+.sources-clear-root {
+ padding: 4px 8px;
+ width: 100%;
+ text-align: start;
+ white-space: nowrap;
+ color: inherit;
+ display: flex;
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.sources-clear-root .home {
+ background-color: var(--theme-icon-dimmed-color);
+}
+
+.sources-clear-root .breadcrumb {
+ width: 5px;
+ margin: 0 2px 0 6px;
+ vertical-align: bottom;
+ background: var(--theme-text-color-alt);
+}
+
+.sources-clear-root-label {
+ margin-left: 5px;
+ line-height: 16px;
+}
+
+/*****************/
+/* Sources tree */
+/*****************/
+
+.sources-list .tree {
+ flex-grow: 1;
+ padding: 4px 0;
+ user-select: none;
+
+ white-space: nowrap;
+ overflow: auto;
+ min-width: 100%;
+
+ display: grid;
+ grid-template-columns: 1fr;
+ align-content: start;
+
+ line-height: 1.4em;
+}
+
+.sources-list .tree .node {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ padding-block: 8px;
+ padding-inline: 6px 8px;
+}
+
+.sources-list .tree .tree-node:not(.focused):hover {
+ background: var(--theme-toolbar-background-hover);
+}
+
+.sources-list .tree button {
+ display: block;
+}
+
+.sources-list .tree .node {
+ padding: 2px 3px;
+ position: relative;
+}
+
+.sources-list .tree .node.focused {
+ color: var(--theme-selection-color);
+ background-color: var(--theme-selection-background);
+}
+
+html:not([dir="rtl"]) .sources-list .tree .node > div {
+ margin-left: 10px;
+}
+
+html[dir="rtl"] .sources-list .tree .node > div {
+ margin-right: 10px;
+}
+
+.sources-list .tree-node button {
+ position: fixed;
+}
+
+.sources-list .img {
+ margin-inline-end: 4px;
+}
+
+.sources-list .tree .focused .img {
+ --icon-color: #ffffff;
+ background-color: var(--icon-color);
+ fill: var(--icon-color);
+}
+
+/* Use the same width as .img.arrow */
+.sources-list .tree .img.no-arrow {
+ width: 10px;
+ visibility: hidden;
+}
+
+.sources-list .tree .label .suffix {
+ font-style: italic;
+ font-size: 0.9em;
+ color: var(--theme-comment);
+}
+
+.sources-list .tree .focused .label .suffix {
+ color: inherit;
+}
+
+.theme-dark .source-list .node.focused {
+ background-color: var(--theme-tab-toolbar-background);
+}
+
+.sources-list .tree .blackboxed {
+ color: #806414;
+}
+
+.sources-list .img.blackBox {
+ mask-size: 13px;
+ background-color: #806414;
+}
+
+.sources-list .tree .label {
+ display: inline-block;
+ line-height: 16px;
+}
+
+.source-list-footer {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 5px;
+ justify-content: center;
+ text-align: center;
+ min-height: var(--editor-footer-height);
+ border-block-start: 1px solid var(--theme-warning-border);
+ user-select: none;
+ padding: 3px 10px;
+ color: var(--theme-warning-color);
+ background-color: var(--theme-warning-background);
+}
+
+.source-list-footer .devtools-togglebutton {
+ background-color: var(--theme-toolbar-hover);
+}
+
+.source-list-footer .devtools-togglebutton:hover {
+ background-color: var(--theme-toolbar-hover);
+ cursor: pointer;
+}
+
+
+/* Removes start margin when a custom root is used */
+.sources-list-custom-root
+ .tree
+ > .tree-node[data-expandable="false"][aria-level="0"] {
+ padding-inline-start: 4px;
+}
+
+.sources-list .tree-node[data-expandable="false"] .tree-indent:last-of-type {
+ margin-inline-end: 0;
+}
+
+
+/*****************/
+/* No Sources */
+/*****************/
+
+.no-sources-message {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-style: italic;
+ text-align: center;
+ padding: 0.5em;
+ font-size: 12px;
+ user-select: none;
+}
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js
new file mode 100644
index 0000000000..c570bdd5a0
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTree.js
@@ -0,0 +1,510 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+// Dependencies
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+
+// Selectors
+import {
+ getSelectedLocation,
+ getMainThreadHost,
+ getExpandedState,
+ getProjectDirectoryRoot,
+ getProjectDirectoryRootName,
+ getSourcesTreeSources,
+ getFocusedSourceItem,
+ getContext,
+ getGeneratedSourceByURL,
+ getBlackBoxRanges,
+ getHideIgnoredSources,
+} from "../../selectors";
+
+// Actions
+import actions from "../../actions";
+
+// Components
+import SourcesTreeItem from "./SourcesTreeItem";
+import AccessibleImage from "../shared/AccessibleImage";
+
+// Utils
+import { getRawSourceURL } from "../../utils/source";
+import { createLocation } from "../../utils/location";
+
+const classnames = require("devtools/client/shared/classnames.js");
+const Tree = require("devtools/client/shared/components/Tree");
+
+function shouldAutoExpand(item, mainThreadHost) {
+ // There is only one case where we want to force auto expand,
+ // when we are on the group of the page's domain.
+ return item.type == "group" && item.groupName === mainThreadHost;
+}
+
+/**
+ * Get the SourceItem displayed in the SourceTree for a given "tree location".
+ *
+ * @param {Object} treeLocation
+ * An object containing the Source coming from the sources.js reducer and the source actor
+ * See getTreeLocation().
+ * @param {object} rootItems
+ * Result of getSourcesTreeSources selector, containing all sources sorted in a tree structure.
+ * items to be displayed in the source tree.
+ * @return {SourceItem}
+ * The directory source item where the given source is displayed.
+ */
+function getSourceItemForTreeLocation(treeLocation, rootItems) {
+ // Sources without URLs are not visible in the SourceTree
+ const { source, sourceActor } = treeLocation;
+
+ if (!source.url) {
+ return null;
+ }
+ const { displayURL } = source;
+ function findSourceInItem(item, path) {
+ if (item.type == "source") {
+ if (item.source.url == source.url) {
+ return item;
+ }
+ return null;
+ }
+ // Bail out if we the current item doesn't match the source
+ if (item.type == "thread" && item.threadActorID != sourceActor?.thread) {
+ return null;
+ }
+ if (item.type == "group" && displayURL.group != item.groupName) {
+ return null;
+ }
+ if (item.type == "directory" && !path.startsWith(item.path)) {
+ return null;
+ }
+ // Otherwise, walk down the tree if this ancestor item seems to match
+ for (const child of item.children) {
+ const match = findSourceInItem(child, path);
+ if (match) {
+ return match;
+ }
+ }
+
+ return null;
+ }
+ for (const rootItem of rootItems) {
+ // Note that when we are setting a project root, rootItem
+ // may no longer be only Thread Item, but also be Group, Directory or Source Items.
+ const item = findSourceInItem(rootItem, displayURL.path);
+ if (item) {
+ return item;
+ }
+ }
+ return null;
+}
+
+class SourcesTree extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {};
+ }
+
+ static get propTypes() {
+ return {
+ cx: PropTypes.object.isRequired,
+ mainThreadHost: PropTypes.string.isRequired,
+ expanded: PropTypes.object.isRequired,
+ focusItem: PropTypes.func.isRequired,
+ focused: PropTypes.object,
+ projectRoot: PropTypes.string.isRequired,
+ selectSource: PropTypes.func.isRequired,
+ selectedTreeLocation: PropTypes.object,
+ setExpandedState: PropTypes.func.isRequired,
+ blackBoxRanges: PropTypes.object.isRequired,
+ rootItems: PropTypes.object.isRequired,
+ clearProjectDirectoryRoot: PropTypes.func.isRequired,
+ projectRootName: PropTypes.string.isRequired,
+ setHideOrShowIgnoredSources: PropTypes.func.isRequired,
+ hideIgnoredSources: PropTypes.bool.isRequired,
+ };
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ const { selectedTreeLocation } = this.props;
+
+ // We might fail to find the source if its thread is registered late,
+ // so that we should re-search the selected source if state.focused is null.
+ if (
+ nextProps.selectedTreeLocation?.source &&
+ (nextProps.selectedTreeLocation.source != selectedTreeLocation?.source ||
+ (nextProps.selectedTreeLocation.source ===
+ selectedTreeLocation?.source &&
+ nextProps.selectedTreeLocation.sourceActor !=
+ selectedTreeLocation?.sourceActor) ||
+ !this.props.focused)
+ ) {
+ const sourceItem = getSourceItemForTreeLocation(
+ nextProps.selectedTreeLocation,
+ this.props.rootItems
+ );
+ if (sourceItem) {
+ // Walk up the tree to expand all ancestor items up to the root of the tree.
+ const expanded = new Set(this.props.expanded);
+ let parentDirectory = sourceItem;
+ while (parentDirectory) {
+ expanded.add(this.getKey(parentDirectory));
+ parentDirectory = this.getParent(parentDirectory);
+ }
+ this.props.setExpandedState(expanded);
+ this.onFocus(sourceItem);
+ }
+ }
+ }
+
+ selectSourceItem = item => {
+ this.props.selectSource(this.props.cx, item.source, item.sourceActor);
+ };
+
+ onFocus = item => {
+ this.props.focusItem(item);
+ };
+
+ onActivate = item => {
+ if (item.type == "source") {
+ this.selectSourceItem(item);
+ }
+ };
+
+ onExpand = (item, shouldIncludeChildren) => {
+ this.setExpanded(item, true, shouldIncludeChildren);
+ };
+
+ onCollapse = (item, shouldIncludeChildren) => {
+ this.setExpanded(item, false, shouldIncludeChildren);
+ };
+
+ setExpanded = (item, isExpanded, shouldIncludeChildren) => {
+ const { expanded } = this.props;
+ let changed = false;
+ const expandItem = i => {
+ const key = this.getKey(i);
+ if (isExpanded) {
+ changed |= !expanded.has(key);
+ expanded.add(key);
+ } else {
+ changed |= expanded.has(key);
+ expanded.delete(key);
+ }
+ };
+ expandItem(item);
+
+ if (shouldIncludeChildren) {
+ let parents = [item];
+ while (parents.length) {
+ const children = [];
+ for (const parent of parents) {
+ for (const child of this.getChildren(parent)) {
+ expandItem(child);
+ children.push(child);
+ }
+ }
+ parents = children;
+ }
+ }
+ if (changed) {
+ this.props.setExpandedState(expanded);
+ }
+ };
+
+ isEmpty() {
+ return !this.getRoots().length;
+ }
+
+ renderEmptyElement(message) {
+ return (
+ <div key="empty" className="no-sources-message">
+ {message}
+ </div>
+ );
+ }
+
+ getRoots = () => {
+ return this.props.rootItems;
+ };
+
+ getKey = item => {
+ // As this is used as React key in Tree component,
+ // we need to update the key when switching to a new project root
+ // otherwise these items won't be updated and will have a buggy padding start.
+ const { projectRoot } = this.props;
+ if (projectRoot) {
+ return projectRoot + item.uniquePath;
+ }
+ return item.uniquePath;
+ };
+
+ getChildren = item => {
+ // This is the precial magic that coalesce "empty" folders,
+ // i.e folders which have only one sub-folder as children.
+ function skipEmptyDirectories(directory) {
+ if (directory.type != "directory") {
+ return directory;
+ }
+ if (
+ directory.children.length == 1 &&
+ directory.children[0].type == "directory"
+ ) {
+ return skipEmptyDirectories(directory.children[0]);
+ }
+ return directory;
+ }
+ if (item.type == "thread") {
+ return item.children;
+ } else if (item.type == "group" || item.type == "directory") {
+ return item.children.map(skipEmptyDirectories);
+ }
+ return [];
+ };
+
+ getParent = item => {
+ if (item.type == "thread") {
+ return null;
+ }
+ const { rootItems } = this.props;
+ // This is the second magic which skip empty folders
+ // (See getChildren comment)
+ function skipEmptyDirectories(directory) {
+ if (
+ directory.type == "group" ||
+ directory.type == "thread" ||
+ rootItems.includes(directory)
+ ) {
+ return directory;
+ }
+ if (
+ directory.children.length == 1 &&
+ directory.children[0].type == "directory"
+ ) {
+ return skipEmptyDirectories(directory.parent);
+ }
+ return directory;
+ }
+ return skipEmptyDirectories(item.parent);
+ };
+
+ /**
+ * Computes 4 lists:
+ * - `sourcesInside`: the list of all Source Items that are
+ * children of the current item (can be thread/group/directory).
+ * This include any nested level of children.
+ * - `sourcesOutside`: all other Source Items.
+ * i.e. all sources that are in any other folder of any group/thread.
+ * - `allInsideBlackBoxed`, all sources of `sourcesInside` which are currently
+ * blackboxed.
+ * - `allOutsideBlackBoxed`, all sources of `sourcesOutside` which are currently
+ * blackboxed.
+ */
+ getBlackBoxSourcesGroups = item => {
+ const allSources = [];
+ function collectAllSources(list, _item) {
+ if (_item.children) {
+ _item.children.forEach(i => collectAllSources(list, i));
+ }
+ if (_item.type == "source") {
+ list.push(_item.source);
+ }
+ }
+ for (const rootItem of this.props.rootItems) {
+ collectAllSources(allSources, rootItem);
+ }
+
+ const sourcesInside = [];
+ collectAllSources(sourcesInside, item);
+
+ const sourcesOutside = allSources.filter(
+ source => !sourcesInside.includes(source)
+ );
+ const allInsideBlackBoxed = sourcesInside.every(
+ source => this.props.blackBoxRanges[source.url]
+ );
+ const allOutsideBlackBoxed = sourcesOutside.every(
+ source => this.props.blackBoxRanges[source.url]
+ );
+
+ return {
+ sourcesInside,
+ sourcesOutside,
+ allInsideBlackBoxed,
+ allOutsideBlackBoxed,
+ };
+ };
+
+ renderProjectRootHeader() {
+ const { cx, projectRootName } = this.props;
+
+ if (!projectRootName) {
+ return null;
+ }
+
+ return (
+ <div key="root" className="sources-clear-root-container">
+ <button
+ className="sources-clear-root"
+ onClick={() => this.props.clearProjectDirectoryRoot(cx)}
+ title={L10N.getStr("removeDirectoryRoot.label")}
+ >
+ <AccessibleImage className="home" />
+ <AccessibleImage className="breadcrumb" />
+ <span className="sources-clear-root-label">{projectRootName}</span>
+ </button>
+ </div>
+ );
+ }
+
+ renderItem = (item, depth, focused, _, expanded) => {
+ const { mainThreadHost, projectRoot } = this.props;
+ return (
+ <SourcesTreeItem
+ item={item}
+ depth={depth}
+ focused={focused}
+ autoExpand={shouldAutoExpand(item, mainThreadHost)}
+ expanded={expanded}
+ focusItem={this.onFocus}
+ selectSourceItem={this.selectSourceItem}
+ projectRoot={projectRoot}
+ setExpanded={this.setExpanded}
+ getBlackBoxSourcesGroups={this.getBlackBoxSourcesGroups}
+ getParent={this.getParent}
+ />
+ );
+ };
+
+ renderTree() {
+ const { expanded, focused } = this.props;
+
+ const treeProps = {
+ autoExpandAll: false,
+ autoExpandDepth: 1,
+ expanded,
+ focused,
+ getChildren: this.getChildren,
+ getParent: this.getParent,
+ getKey: this.getKey,
+ getRoots: this.getRoots,
+ itemHeight: 21,
+ key: this.isEmpty() ? "empty" : "full",
+ onCollapse: this.onCollapse,
+ onExpand: this.onExpand,
+ onFocus: this.onFocus,
+ isExpanded: item => {
+ return this.props.expanded.has(this.getKey(item));
+ },
+ onActivate: this.onActivate,
+ renderItem: this.renderItem,
+ preventBlur: true,
+ };
+
+ return <Tree {...treeProps} />;
+ }
+
+ renderPane(child) {
+ const { projectRoot } = this.props;
+
+ return (
+ <div
+ key="pane"
+ className={classnames("sources-pane", {
+ "sources-list-custom-root": !!projectRoot,
+ })}
+ >
+ {child}
+ </div>
+ );
+ }
+
+ renderFooter() {
+ if (this.props.hideIgnoredSources) {
+ return (
+ <footer className="source-list-footer">
+ {L10N.getStr("ignoredSourcesHidden")}
+ <button
+ className="devtools-togglebutton"
+ onClick={() => this.props.setHideOrShowIgnoredSources(false)}
+ title={L10N.getStr("showIgnoredSources.tooltip.label")}
+ >
+ {L10N.getStr("showIgnoredSources")}
+ </button>
+ </footer>
+ );
+ }
+ return null;
+ }
+
+ render() {
+ const { projectRoot } = this.props;
+ return (
+ <div
+ key="pane"
+ className={classnames("sources-list", {
+ "sources-list-custom-root": !!projectRoot,
+ })}
+ >
+ {this.isEmpty() ? (
+ this.renderEmptyElement(L10N.getStr("noSourcesText"))
+ ) : (
+ <>
+ {this.renderProjectRootHeader()}
+ {this.renderTree()}
+ {this.renderFooter()}
+ </>
+ )}
+ </div>
+ );
+ }
+}
+
+function getTreeLocation(state, location) {
+ // In the SourceTree, we never show the pretty printed sources and only
+ // the minified version, so if we are selecting a pretty file, fake selecting
+ // the minified version.
+ if (location?.source.isPrettyPrinted) {
+ const source = getGeneratedSourceByURL(
+ state,
+ getRawSourceURL(location.source.url)
+ );
+ if (source) {
+ return createLocation({
+ source,
+ // A source actor is required by getSourceItemForTreeLocation
+ // in order to know in which thread this source relates to.
+ sourceActor: location.sourceActor,
+ });
+ }
+ }
+ return location;
+}
+
+const mapStateToProps = state => {
+ const rootItems = getSourcesTreeSources(state);
+
+ return {
+ cx: getContext(state),
+ selectedTreeLocation: getTreeLocation(state, getSelectedLocation(state)),
+ mainThreadHost: getMainThreadHost(state),
+ expanded: getExpandedState(state),
+ focused: getFocusedSourceItem(state),
+ projectRoot: getProjectDirectoryRoot(state),
+ rootItems,
+ blackBoxRanges: getBlackBoxRanges(state),
+ projectRootName: getProjectDirectoryRootName(state),
+ hideIgnoredSources: getHideIgnoredSources(state),
+ };
+};
+
+export default connect(mapStateToProps, {
+ selectSource: actions.selectSource,
+ setExpandedState: actions.setExpandedState,
+ focusItem: actions.focusItem,
+ clearProjectDirectoryRoot: actions.clearProjectDirectoryRoot,
+ setHideOrShowIgnoredSources: actions.setHideOrShowIgnoredSources,
+})(SourcesTree);
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js
new file mode 100644
index 0000000000..874df4c77c
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js
@@ -0,0 +1,457 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import { showMenu } from "../../context-menu/menu";
+
+import SourceIcon from "../shared/SourceIcon";
+import AccessibleImage from "../shared/AccessibleImage";
+
+import {
+ getGeneratedSourceByURL,
+ getContext,
+ getFirstSourceActorForGeneratedSource,
+ isSourceOverridden,
+ getHideIgnoredSources,
+ isSourceMapIgnoreListEnabled,
+ isSourceOnSourceMapIgnoreList,
+} from "../../selectors";
+import actions from "../../actions";
+
+import { shouldBlackbox, sourceTypes } from "../../utils/source";
+import { copyToTheClipboard } from "../../utils/clipboard";
+import { saveAsLocalFile } from "../../utils/utils";
+import { createLocation } from "../../utils/location";
+import { safeDecodeItemName } from "../../utils/sources-tree/utils";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+class SourceTreeItem extends Component {
+ static get propTypes() {
+ return {
+ autoExpand: PropTypes.bool.isRequired,
+ blackBoxSources: PropTypes.func.isRequired,
+ clearProjectDirectoryRoot: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ depth: PropTypes.number.isRequired,
+ expanded: PropTypes.bool.isRequired,
+ focusItem: PropTypes.func.isRequired,
+ focused: PropTypes.bool.isRequired,
+ getBlackBoxSourcesGroups: PropTypes.func.isRequired,
+ hasMatchingGeneratedSource: PropTypes.bool.isRequired,
+ item: PropTypes.object.isRequired,
+ loadSourceText: PropTypes.func.isRequired,
+ getFirstSourceActorForGeneratedSource: PropTypes.func.isRequired,
+ projectRoot: PropTypes.string.isRequired,
+ selectSourceItem: PropTypes.func.isRequired,
+ setExpanded: PropTypes.func.isRequired,
+ setProjectDirectoryRoot: PropTypes.func.isRequired,
+ toggleBlackBox: PropTypes.func.isRequired,
+ getParent: PropTypes.func.isRequired,
+ setOverrideSource: PropTypes.func.isRequired,
+ removeOverrideSource: PropTypes.func.isRequired,
+ isOverridden: PropTypes.bool,
+ hideIgnoredSources: PropTypes.bool,
+ isSourceOnIgnoreList: PropTypes.bool,
+ };
+ }
+
+ componentDidMount() {
+ const { autoExpand, item } = this.props;
+ if (autoExpand) {
+ this.props.setExpanded(item, true, false);
+ }
+ }
+
+ onClick = e => {
+ const { item, focusItem, selectSourceItem } = this.props;
+
+ focusItem(item);
+ if (item.type == "source") {
+ selectSourceItem(item);
+ }
+ };
+
+ onContextMenu = event => {
+ const copySourceUri2Label = L10N.getStr("copySourceUri2");
+ const copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey");
+ const setDirectoryRootLabel = L10N.getStr("setDirectoryRoot.label");
+ const setDirectoryRootKey = L10N.getStr("setDirectoryRoot.accesskey");
+ const removeDirectoryRootLabel = L10N.getStr("removeDirectoryRoot.label");
+
+ event.stopPropagation();
+ event.preventDefault();
+
+ const menuOptions = [];
+
+ const { item, isOverridden, cx, isSourceOnIgnoreList } = this.props;
+ if (item.type == "source") {
+ const { source } = item;
+ const copySourceUri2 = {
+ id: "node-menu-copy-source",
+ label: copySourceUri2Label,
+ accesskey: copySourceUri2Key,
+ disabled: false,
+ click: () => copyToTheClipboard(source.url),
+ };
+
+ const ignoreStr = item.isBlackBoxed ? "unignore" : "ignore";
+ const blackBoxMenuItem = {
+ id: "node-menu-blackbox",
+ label: L10N.getStr(`ignoreContextItem.${ignoreStr}`),
+ accesskey: L10N.getStr(`ignoreContextItem.${ignoreStr}.accesskey`),
+ disabled: isSourceOnIgnoreList || !shouldBlackbox(source),
+ click: () => this.props.toggleBlackBox(cx, source),
+ };
+ const downloadFileItem = {
+ id: "node-menu-download-file",
+ label: L10N.getStr("downloadFile.label"),
+ accesskey: L10N.getStr("downloadFile.accesskey"),
+ disabled: false,
+ click: () => this.saveLocalFile(cx, source),
+ };
+
+ const overrideStr = !isOverridden ? "override" : "removeOverride";
+ const overridesItem = {
+ id: "node-menu-overrides",
+ label: L10N.getStr(`overridesContextItem.${overrideStr}`),
+ accesskey: L10N.getStr(`overridesContextItem.${overrideStr}.accesskey`),
+ disabled: !!source.isHTML,
+ click: () => this.handleLocalOverride(cx, source, isOverridden),
+ };
+
+ menuOptions.push(
+ copySourceUri2,
+ blackBoxMenuItem,
+ downloadFileItem,
+ overridesItem
+ );
+ }
+
+ // All other types other than source are folder-like
+ if (item.type != "source") {
+ this.addCollapseExpandAllOptions(menuOptions, item);
+
+ const { depth, projectRoot } = this.props;
+
+ if (projectRoot == item.uniquePath) {
+ menuOptions.push({
+ id: "node-remove-directory-root",
+ label: removeDirectoryRootLabel,
+ disabled: false,
+ click: () => this.props.clearProjectDirectoryRoot(cx),
+ });
+ } else {
+ menuOptions.push({
+ id: "node-set-directory-root",
+ label: setDirectoryRootLabel,
+ accesskey: setDirectoryRootKey,
+ disabled: false,
+ click: () =>
+ this.props.setProjectDirectoryRoot(
+ cx,
+ item.uniquePath,
+ this.renderItemName(depth)
+ ),
+ });
+ }
+
+ this.addBlackboxAllOption(menuOptions, item);
+ }
+
+ showMenu(event, menuOptions);
+ };
+
+ saveLocalFile = async (cx, source) => {
+ if (!source) {
+ return null;
+ }
+
+ const data = await this.props.loadSourceText(cx, source);
+ if (!data) {
+ return null;
+ }
+ return saveAsLocalFile(data.value, source.displayURL.filename);
+ };
+
+ handleLocalOverride = async (cx, source, isOverridden) => {
+ if (!isOverridden) {
+ const localPath = await this.saveLocalFile(cx, source);
+ if (localPath) {
+ this.props.setOverrideSource(cx, source, localPath);
+ }
+ } else {
+ this.props.removeOverrideSource(cx, source);
+ }
+ };
+
+ addBlackboxAllOption = (menuOptions, item) => {
+ const { cx, depth, projectRoot } = this.props;
+ const {
+ sourcesInside,
+ sourcesOutside,
+ allInsideBlackBoxed,
+ allOutsideBlackBoxed,
+ } = this.props.getBlackBoxSourcesGroups(item);
+
+ let blackBoxInsideMenuItemLabel;
+ let blackBoxOutsideMenuItemLabel;
+ if (depth === 0 || (depth === 1 && projectRoot === "")) {
+ blackBoxInsideMenuItemLabel = allInsideBlackBoxed
+ ? L10N.getStr("unignoreAllInGroup.label")
+ : L10N.getStr("ignoreAllInGroup.label");
+ if (sourcesOutside.length) {
+ blackBoxOutsideMenuItemLabel = allOutsideBlackBoxed
+ ? L10N.getStr("unignoreAllOutsideGroup.label")
+ : L10N.getStr("ignoreAllOutsideGroup.label");
+ }
+ } else {
+ blackBoxInsideMenuItemLabel = allInsideBlackBoxed
+ ? L10N.getStr("unignoreAllInDir.label")
+ : L10N.getStr("ignoreAllInDir.label");
+ if (sourcesOutside.length) {
+ blackBoxOutsideMenuItemLabel = allOutsideBlackBoxed
+ ? L10N.getStr("unignoreAllOutsideDir.label")
+ : L10N.getStr("ignoreAllOutsideDir.label");
+ }
+ }
+
+ const blackBoxInsideMenuItem = {
+ id: allInsideBlackBoxed
+ ? "node-unblackbox-all-inside"
+ : "node-blackbox-all-inside",
+ label: blackBoxInsideMenuItemLabel,
+ disabled: false,
+ click: () =>
+ this.props.blackBoxSources(cx, sourcesInside, !allInsideBlackBoxed),
+ };
+
+ if (sourcesOutside.length) {
+ menuOptions.push({
+ id: "node-blackbox-all",
+ label: L10N.getStr("ignoreAll.label"),
+ submenu: [
+ blackBoxInsideMenuItem,
+ {
+ id: allOutsideBlackBoxed
+ ? "node-unblackbox-all-outside"
+ : "node-blackbox-all-outside",
+ label: blackBoxOutsideMenuItemLabel,
+ disabled: false,
+ click: () =>
+ this.props.blackBoxSources(
+ cx,
+ sourcesOutside,
+ !allOutsideBlackBoxed
+ ),
+ },
+ ],
+ });
+ } else {
+ menuOptions.push(blackBoxInsideMenuItem);
+ }
+ };
+
+ addCollapseExpandAllOptions = (menuOptions, item) => {
+ const { setExpanded } = this.props;
+
+ menuOptions.push({
+ id: "node-menu-collapse-all",
+ label: L10N.getStr("collapseAll.label"),
+ disabled: false,
+ click: () => setExpanded(item, false, true),
+ });
+
+ menuOptions.push({
+ id: "node-menu-expand-all",
+ label: L10N.getStr("expandAll.label"),
+ disabled: false,
+ click: () => setExpanded(item, true, true),
+ });
+ };
+
+ renderItemArrow() {
+ const { item, expanded } = this.props;
+ return item.type != "source" ? (
+ <AccessibleImage className={classnames("arrow", { expanded })} />
+ ) : (
+ <span className="img no-arrow" />
+ );
+ }
+
+ renderIcon(item, depth) {
+ if (item.type == "thread") {
+ const icon = item.thread.targetType.includes("worker")
+ ? "worker"
+ : "window";
+ return <AccessibleImage className={classnames(icon)} />;
+ }
+ if (item.type == "group") {
+ if (item.groupName === "Webpack") {
+ return <AccessibleImage className="webpack" />;
+ } else if (item.groupName === "Angular") {
+ return <AccessibleImage className="angular" />;
+ }
+ // Check if the group relates to an extension.
+ // This happens when a webextension injects a content script.
+ if (item.isForExtensionSource) {
+ return <AccessibleImage className="extension" />;
+ }
+
+ return <AccessibleImage className="globe-small" />;
+ }
+ if (item.type == "directory") {
+ return <AccessibleImage className="folder" />;
+ }
+ if (item.type == "source") {
+ const { source, sourceActor } = item;
+ return (
+ <SourceIcon
+ location={createLocation({ source, sourceActor })}
+ modifier={icon => {
+ // In the SourceTree, extension files should use the file-extension based icon,
+ // whereas we use the extension icon in other Components (eg. source tabs and breakpoints pane).
+ if (icon === "extension") {
+ return (
+ sourceTypes[source.displayURL.fileExtension] || "javascript"
+ );
+ }
+ return icon + (this.props.isOverridden ? " override" : "");
+ }}
+ />
+ );
+ }
+
+ return null;
+ }
+
+ renderItemName(depth) {
+ const { item } = this.props;
+
+ if (item.type == "thread") {
+ const { thread } = item;
+ return (
+ thread.name +
+ (thread.serviceWorkerStatus ? ` (${thread.serviceWorkerStatus})` : "")
+ );
+ }
+ if (item.type == "group") {
+ return safeDecodeItemName(item.groupName);
+ }
+ if (item.type == "directory") {
+ const parentItem = this.props.getParent(item);
+ return safeDecodeItemName(
+ item.path.replace(parentItem.path, "").replace(/^\//, "")
+ );
+ }
+ if (item.type == "source") {
+ const { displayURL } = item.source;
+ const name =
+ displayURL.filename + (displayURL.search ? displayURL.search : "");
+ return safeDecodeItemName(name);
+ }
+
+ return null;
+ }
+
+ renderItemTooltip() {
+ const { item } = this.props;
+
+ if (item.type == "thread") {
+ return item.thread.name;
+ }
+ if (item.type == "group") {
+ return item.groupName;
+ }
+ if (item.type == "directory") {
+ return item.path;
+ }
+ if (item.type == "source") {
+ return item.source.url;
+ }
+
+ return null;
+ }
+
+ render() {
+ const {
+ item,
+ depth,
+ focused,
+ hasMatchingGeneratedSource,
+ hideIgnoredSources,
+ } = this.props;
+
+ if (hideIgnoredSources && item.isBlackBoxed) {
+ return null;
+ }
+ const suffix = hasMatchingGeneratedSource ? (
+ <span className="suffix">{L10N.getStr("sourceFooter.mappedSuffix")}</span>
+ ) : null;
+
+ return (
+ <div
+ className={classnames("node", {
+ focused,
+ blackboxed: item.type == "source" && item.isBlackBoxed,
+ })}
+ key={item.path}
+ onClick={this.onClick}
+ onContextMenu={this.onContextMenu}
+ title={this.renderItemTooltip()}
+ >
+ {this.renderItemArrow()}
+ {this.renderIcon(item, depth)}
+ <span className="label">
+ {this.renderItemName(depth)}
+ {suffix}
+ </span>
+ </div>
+ );
+ }
+}
+
+function getHasMatchingGeneratedSource(state, source) {
+ if (!source || !source.isOriginal) {
+ return false;
+ }
+
+ return !!getGeneratedSourceByURL(state, source.url);
+}
+
+const mapStateToProps = (state, props) => {
+ const { item } = props;
+ if (item.type == "source") {
+ const { source } = item;
+ return {
+ cx: getContext(state),
+ hasMatchingGeneratedSource: getHasMatchingGeneratedSource(state, source),
+ getFirstSourceActorForGeneratedSource: (sourceId, threadId) =>
+ getFirstSourceActorForGeneratedSource(state, sourceId, threadId),
+ isOverridden: isSourceOverridden(state, source),
+ hideIgnoredSources: getHideIgnoredSources(state),
+ isSourceOnIgnoreList:
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, source),
+ };
+ }
+ return {
+ cx: getContext(state),
+ getFirstSourceActorForGeneratedSource: (sourceId, threadId) =>
+ getFirstSourceActorForGeneratedSource(state, sourceId, threadId),
+ };
+};
+
+export default connect(mapStateToProps, {
+ setProjectDirectoryRoot: actions.setProjectDirectoryRoot,
+ clearProjectDirectoryRoot: actions.clearProjectDirectoryRoot,
+ toggleBlackBox: actions.toggleBlackBox,
+ loadSourceText: actions.loadSourceText,
+ blackBoxSources: actions.blackBoxSources,
+ setBlackBoxAllOutside: actions.setBlackBoxAllOutside,
+ setOverrideSource: actions.setOverrideSource,
+ removeOverrideSource: actions.removeOverrideSource,
+})(SourceTreeItem);
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/index.js b/devtools/client/debugger/src/components/PrimaryPanes/index.js
new file mode 100644
index 0000000000..c0ab3075bd
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/index.js
@@ -0,0 +1,132 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { Tab, Tabs, TabList, TabPanels } from "react-aria-components/src/tabs";
+
+import actions from "../../actions";
+import { getSelectedPrimaryPaneTab, getContext } from "../../selectors";
+import { prefs } from "../../utils/prefs";
+import { connect } from "../../utils/connect";
+import { primaryPaneTabs } from "../../constants";
+import { formatKeyShortcut } from "../../utils/text";
+
+import Outline from "./Outline";
+import SourcesTree from "./SourcesTree";
+import ProjectSearch from "./ProjectSearch";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+import "./Sources.css";
+
+const tabs = [
+ primaryPaneTabs.SOURCES,
+ primaryPaneTabs.OUTLINE,
+ primaryPaneTabs.PROJECT_SEARCH,
+];
+
+class PrimaryPanes extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ alphabetizeOutline: prefs.alphabetizeOutline,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ cx: PropTypes.object.isRequired,
+ projectRootName: PropTypes.string.isRequired,
+ selectedTab: PropTypes.oneOf(tabs).isRequired,
+ setPrimaryPaneTab: PropTypes.func.isRequired,
+ setActiveSearch: PropTypes.func.isRequired,
+ closeActiveSearch: PropTypes.func.isRequired,
+ };
+ }
+
+ onAlphabetizeClick = () => {
+ const alphabetizeOutline = !prefs.alphabetizeOutline;
+ prefs.alphabetizeOutline = alphabetizeOutline;
+ this.setState({ alphabetizeOutline });
+ };
+
+ onActivateTab = index => {
+ const tab = tabs.at(index);
+ this.props.setPrimaryPaneTab(tab);
+ if (tab == primaryPaneTabs.PROJECT_SEARCH) {
+ this.props.setActiveSearch(tab);
+ } else {
+ this.props.closeActiveSearch();
+ }
+ };
+
+ renderTabList() {
+ return [
+ <Tab
+ className={classnames("tab sources-tab", {
+ active: this.props.selectedTab === primaryPaneTabs.SOURCES,
+ })}
+ key="sources-tab"
+ >
+ {formatKeyShortcut(L10N.getStr("sources.header"))}
+ </Tab>,
+ <Tab
+ className={classnames("tab outline-tab", {
+ active: this.props.selectedTab === primaryPaneTabs.OUTLINE,
+ })}
+ key="outline-tab"
+ >
+ {formatKeyShortcut(L10N.getStr("outline.header"))}
+ </Tab>,
+ <Tab
+ className={classnames("tab search-tab", {
+ active: this.props.selectedTab === primaryPaneTabs.PROJECT_SEARCH,
+ })}
+ key="search-tab"
+ >
+ {formatKeyShortcut(L10N.getStr("search.header"))}
+ </Tab>,
+ ];
+ }
+
+ render() {
+ const { selectedTab } = this.props;
+ return (
+ <Tabs
+ activeIndex={tabs.indexOf(selectedTab)}
+ className="sources-panel"
+ onActivateTab={this.onActivateTab}
+ >
+ <TabList className="source-outline-tabs">
+ {this.renderTabList()}
+ </TabList>
+ <TabPanels className="source-outline-panel" hasFocusableContent>
+ <SourcesTree />
+ <Outline
+ alphabetizeOutline={this.state.alphabetizeOutline}
+ onAlphabetizeClick={this.onAlphabetizeClick}
+ />
+ <ProjectSearch />
+ </TabPanels>
+ </Tabs>
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ cx: getContext(state),
+ selectedTab: getSelectedPrimaryPaneTab(state),
+ };
+};
+
+const connector = connect(mapStateToProps, {
+ setPrimaryPaneTab: actions.setPrimaryPaneTab,
+ setActiveSearch: actions.setActiveSearch,
+ closeActiveSearch: actions.closeActiveSearch,
+});
+
+export default connector(PrimaryPanes);
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/moz.build b/devtools/client/debugger/src/components/PrimaryPanes/moz.build
new file mode 100644
index 0000000000..fc73b7bee7
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/moz.build
@@ -0,0 +1,15 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "index.js",
+ "Outline.js",
+ "OutlineFilter.js",
+ "ProjectSearch.js",
+ "SourcesTree.js",
+ "SourcesTreeItem.js",
+)
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/tests/ProjectSearch.spec.js b/devtools/client/debugger/src/components/PrimaryPanes/tests/ProjectSearch.spec.js
new file mode 100644
index 0000000000..10f9f197fe
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/tests/ProjectSearch.spec.js
@@ -0,0 +1,326 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { Provider } from "react-redux";
+import configureStore from "redux-mock-store";
+import PropTypes from "prop-types";
+
+import { mount, shallow } from "enzyme";
+import { ProjectSearch } from "../ProjectSearch";
+import { statusType } from "../../../reducers/project-text-search";
+import { mockcx } from "../../../utils/test-mockup";
+import { searchKeys } from "../../../constants";
+
+const hooks = { on: [], off: [] };
+const shortcuts = {
+ dispatch(eventName) {
+ hooks.on.forEach(hook => {
+ if (hook.event === eventName) {
+ hook.cb();
+ }
+ });
+ hooks.off.forEach(hook => {
+ if (hook.event === eventName) {
+ hook.cb();
+ }
+ });
+ },
+ on: jest.fn((event, cb) => hooks.on.push({ event, cb })),
+ off: jest.fn((event, cb) => hooks.off.push({ event, cb })),
+};
+
+const context = { shortcuts };
+
+const testResults = [
+ {
+ location: {
+ source: {
+ url: "testFilePath1",
+ },
+ },
+ type: "RESULT",
+ matches: [
+ {
+ match: "match1",
+ value: "some thing match1",
+ location: {
+ source: {},
+ column: 30,
+ },
+ type: "MATCH",
+ },
+ {
+ match: "match2",
+ value: "some thing match2",
+ location: {
+ source: {},
+ column: 60,
+ },
+ type: "MATCH",
+ },
+ {
+ match: "match3",
+ value: "some thing match3",
+ location: {
+ source: {},
+ column: 90,
+ },
+ type: "MATCH",
+ },
+ ],
+ },
+ {
+ location: {
+ source: {
+ url: "testFilePath2",
+ },
+ },
+ type: "RESULT",
+ matches: [
+ {
+ match: "match4",
+ value: "some thing match4",
+ location: {
+ source: {},
+ column: 80,
+ },
+ type: "MATCH",
+ },
+ {
+ match: "match5",
+ value: "some thing match5",
+ location: {
+ source: {},
+ column: 40,
+ },
+ type: "MATCH",
+ },
+ ],
+ },
+];
+
+const testMatch = {
+ type: "MATCH",
+ match: "match1",
+ value: "some thing match1",
+ sourceId: "some-target/source42",
+ location: {
+ source: {
+ id: "some-target/source42",
+ },
+ line: 3,
+ column: 30,
+ },
+};
+
+function render(overrides = {}, mounted = false) {
+ const mockStore = configureStore([]);
+ const store = mockStore({
+ ui: {
+ mutableSearchOptions: {
+ [searchKeys.PROJECT_SEARCH]: {
+ regexMatch: false,
+ wholeWord: false,
+ caseSensitive: false,
+ excludePatterns: "",
+ },
+ },
+ },
+ });
+ const props = {
+ cx: mockcx,
+ status: "DONE",
+ sources: {},
+ results: [],
+ query: "foo",
+ activeSearch: "project",
+ closeProjectSearch: jest.fn(),
+ searchSources: jest.fn(),
+ clearSearch: jest.fn(),
+ updateSearchStatus: jest.fn(),
+ selectSpecificLocation: jest.fn(),
+ doSearchForHighlight: jest.fn(),
+ setActiveSearch: jest.fn(),
+ ...overrides,
+ };
+
+ if (mounted) {
+ return mount(
+ <Provider store={store}>
+ <ProjectSearch {...props} />
+ </Provider>,
+ { context, childContextTypes: { shortcuts: PropTypes.object } }
+ ).childAt(0);
+ }
+
+ return shallow(
+ <Provider store={store}>
+ <ProjectSearch {...props} />
+ </Provider>,
+ { context }
+ ).dive();
+}
+
+describe("ProjectSearch", () => {
+ beforeEach(() => {
+ context.shortcuts.on.mockClear();
+ context.shortcuts.off.mockClear();
+ });
+
+ it("renders nothing when disabled", () => {
+ const component = render({ activeSearch: "" });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("where <Enter> has not been pressed", () => {
+ const component = render({ query: "" });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("found no search results", () => {
+ const component = render();
+ expect(component).toMatchSnapshot();
+ });
+
+ it("should display loading message while search is in progress", () => {
+ const component = render({
+ query: "match",
+ status: statusType.fetching,
+ });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("found search results", () => {
+ const component = render(
+ {
+ query: "match",
+ results: testResults,
+ },
+ true
+ );
+ expect(component).toMatchSnapshot();
+ });
+
+ it("turns off shortcuts on unmount", () => {
+ const component = render({
+ query: "",
+ });
+ expect(component).toMatchSnapshot();
+ component.unmount();
+ expect(context.shortcuts.off).toHaveBeenCalled();
+ });
+
+ it("calls inputOnChange", () => {
+ const component = render(
+ {
+ results: testResults,
+ },
+ true
+ );
+ component
+ .find("SearchInput .search-field input")
+ .simulate("change", { target: { value: "bar" } });
+ expect(component.state().inputValue).toEqual("bar");
+ });
+
+ it("onKeyDown Escape/Other", () => {
+ const searchSources = jest.fn();
+ const component = render(
+ {
+ results: testResults,
+ searchSources,
+ },
+ true
+ );
+ component
+ .find("SearchInput .search-field input")
+ .simulate("keydown", { key: "Escape" });
+ expect(searchSources).not.toHaveBeenCalled();
+ searchSources.mockClear();
+ component
+ .find("SearchInput .search-field input")
+ .simulate("keydown", { key: "Other", stopPropagation: jest.fn() });
+ expect(searchSources).not.toHaveBeenCalled();
+ });
+
+ it("onKeyDown Enter", () => {
+ const searchSources = jest.fn();
+ const component = render(
+ {
+ results: testResults,
+ searchSources,
+ },
+ true
+ );
+ component
+ .find("SearchInput .search-field input")
+ .simulate("keydown", { key: "Enter", stopPropagation: jest.fn() });
+ expect(searchSources).toHaveBeenCalledWith(mockcx, "foo");
+ });
+
+ it("onEnterPress shortcut no match or setExpanded", () => {
+ const selectSpecificLocation = jest.fn();
+ const component = render(
+ {
+ results: testResults,
+ selectSpecificLocation,
+ },
+ true
+ );
+ component.instance().state.focusedItem = null;
+ shortcuts.dispatch("Enter");
+ expect(selectSpecificLocation).not.toHaveBeenCalled();
+ });
+
+ it("onEnterPress shortcut match", () => {
+ const selectSpecificLocation = jest.fn();
+ const component = render(
+ {
+ results: testResults,
+ selectSpecificLocation,
+ },
+ true
+ );
+ component.instance().state.focusedItem = { ...testMatch };
+ shortcuts.dispatch("Enter");
+ expect(selectSpecificLocation).toHaveBeenCalledWith(mockcx, {
+ source: {
+ id: "some-target/source42",
+ },
+ line: 3,
+ column: 30,
+ });
+ });
+
+ it("state.inputValue responds to prop.query changes", () => {
+ const component = render({ query: "foo" });
+ expect(component.state().inputValue).toEqual("foo");
+ component.setProps({ query: "" });
+ expect(component.state().inputValue).toEqual("");
+ });
+
+ describe("showErrorEmoji", () => {
+ it("false if not done & results", () => {
+ const component = render({
+ status: statusType.fetching,
+ results: testResults,
+ });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("false if not done & no results", () => {
+ const component = render({
+ status: statusType.fetching,
+ });
+ expect(component).toMatchSnapshot();
+ });
+
+ // "false if done & has results"
+ // is the same test as "found search results"
+
+ // "true if done & has no results"
+ // is the same test as "found no search results"
+ });
+});
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/ProjectSearch.spec.js.snap b/devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/ProjectSearch.spec.js.snap
new file mode 100644
index 0000000000..4be18c4753
--- /dev/null
+++ b/devtools/client/debugger/src/components/PrimaryPanes/tests/__snapshots__/ProjectSearch.spec.js.snap
@@ -0,0 +1,1111 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ProjectSearch found no search results 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={0}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={false}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="foo"
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={true}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="0 results"
+ />
+ </div>
+ <div
+ className="no-result-msg absolute-center"
+ >
+ No results found
+ </div>
+ </div>
+</div>
+`;
+
+exports[`ProjectSearch found search results 1`] = `
+<ProjectSearch
+ activeSearch="project"
+ clearSearch={[MockFunction]}
+ closeProjectSearch={[MockFunction]}
+ cx={
+ Object {
+ "navigateCounter": 0,
+ }
+ }
+ doSearchForHighlight={[MockFunction]}
+ query="match"
+ results={
+ Array [
+ Object {
+ "location": Object {
+ "source": Object {
+ "url": "testFilePath1",
+ },
+ },
+ "matches": Array [
+ Object {
+ "location": Object {
+ "column": 30,
+ "source": Object {},
+ },
+ "match": "match1",
+ "type": "MATCH",
+ "value": "some thing match1",
+ },
+ Object {
+ "location": Object {
+ "column": 60,
+ "source": Object {},
+ },
+ "match": "match2",
+ "type": "MATCH",
+ "value": "some thing match2",
+ },
+ Object {
+ "location": Object {
+ "column": 90,
+ "source": Object {},
+ },
+ "match": "match3",
+ "type": "MATCH",
+ "value": "some thing match3",
+ },
+ ],
+ "type": "RESULT",
+ },
+ Object {
+ "location": Object {
+ "source": Object {
+ "url": "testFilePath2",
+ },
+ },
+ "matches": Array [
+ Object {
+ "location": Object {
+ "column": 80,
+ "source": Object {},
+ },
+ "match": "match4",
+ "type": "MATCH",
+ "value": "some thing match4",
+ },
+ Object {
+ "location": Object {
+ "column": 40,
+ "source": Object {},
+ },
+ "match": "match5",
+ "type": "MATCH",
+ "value": "some thing match5",
+ },
+ ],
+ "type": "RESULT",
+ },
+ ]
+ }
+ searchSources={[MockFunction]}
+ selectSpecificLocation={[MockFunction]}
+ setActiveSearch={[MockFunction]}
+ sources={Object {}}
+ status="DONE"
+ updateSearchStatus={[MockFunction]}
+>
+ <div
+ className="search-container"
+ >
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={5}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={false}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="match"
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={false}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="5 results"
+ >
+ <SearchInput
+ count={5}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ expanded={false}
+ hasPrefix={false}
+ isLoading={false}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="match"
+ searchKey="project-search"
+ searchOptions={
+ Object {
+ "caseSensitive": false,
+ "excludePatterns": "",
+ "regexMatch": false,
+ "wholeWord": false,
+ }
+ }
+ selectedItemId=""
+ setSearchOptions={[Function]}
+ showClose={false}
+ showErrorEmoji={false}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="5 results"
+ >
+ <div
+ className="search-outline"
+ >
+ <div
+ aria-expanded={false}
+ aria-haspopup="listbox"
+ aria-owns="result-list"
+ className="search-field small"
+ role="combobox"
+ >
+ <AccessibleImage
+ className="search"
+ >
+ <span
+ className="img search"
+ />
+ </AccessibleImage>
+ <input
+ aria-activedescendant=""
+ aria-autocomplete="list"
+ aria-controls="result-list"
+ className=""
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onKeyDown={[Function]}
+ placeholder="Find in files…"
+ spellCheck={false}
+ value="match"
+ />
+ <div
+ className="search-field-summary"
+ >
+ 5 results
+ </div>
+ <div
+ className="search-buttons-bar"
+ >
+ <SearchModifiers
+ modifiers={
+ Object {
+ "caseSensitive": false,
+ "excludePatterns": "",
+ "regexMatch": false,
+ "wholeWord": false,
+ }
+ }
+ onToggleSearchModifier={[Function]}
+ >
+ <div
+ className="search-modifiers"
+ >
+ <span
+ className="pipe-divider"
+ />
+ <button
+ className="regex-match-btn "
+ onKeyDown={[Function]}
+ onMouseDown={[Function]}
+ title="Use Regular Expression"
+ >
+ <span
+ className="regex-match"
+ />
+ </button>
+ <button
+ className="case-sensitive-btn "
+ onKeyDown={[Function]}
+ onMouseDown={[Function]}
+ title="Match Case"
+ >
+ <span
+ className="case-match"
+ />
+ </button>
+ <button
+ className="whole-word-btn "
+ onKeyDown={[Function]}
+ onMouseDown={[Function]}
+ title="Match Whole Word"
+ >
+ <span
+ className="whole-word-match"
+ />
+ </button>
+ </div>
+ </SearchModifiers>
+ </div>
+ </div>
+ <div
+ className="exclude-patterns-field small"
+ >
+ <label>
+ files to exclude
+ </label>
+ <input
+ onChange={[Function]}
+ onKeyDown={[Function]}
+ placeholder="e.g. **/node_modules/**,app.js"
+ value=""
+ />
+ </div>
+ </div>
+ </SearchInput>
+ </Connect(SearchInput)>
+ </div>
+ <Tree
+ autoExpandAll={true}
+ autoExpandDepth={1}
+ autoExpandNodeChildrenLimit={100}
+ focused={null}
+ getChildren={[Function]}
+ getKey={[Function]}
+ getParent={[Function]}
+ getPath={[Function]}
+ getRoots={[Function]}
+ isExpanded={[Function]}
+ itemHeight={24}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ onFocus={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-activedescendant={null}
+ className="tree "
+ onBlur={[Function]}
+ onFocus={[Function]}
+ onKeyDown={[Function]}
+ onKeyPress={[Function]}
+ onKeyUp={[Function]}
+ role="tree"
+ style={Object {}}
+ tabIndex="0"
+ >
+ <TreeNode
+ active={false}
+ depth={0}
+ expanded={true}
+ focused={false}
+ id="undefined-$"
+ index={0}
+ isExpandable={true}
+ item={
+ Object {
+ "location": Object {
+ "source": Object {
+ "url": "testFilePath1",
+ },
+ },
+ "matches": Array [
+ Object {
+ "location": Object {
+ "column": 30,
+ "source": Object {},
+ },
+ "match": "match1",
+ "type": "MATCH",
+ "value": "some thing match1",
+ },
+ Object {
+ "location": Object {
+ "column": 60,
+ "source": Object {},
+ },
+ "match": "match2",
+ "type": "MATCH",
+ "value": "some thing match2",
+ },
+ Object {
+ "location": Object {
+ "column": 90,
+ "source": Object {},
+ },
+ "match": "match3",
+ "type": "MATCH",
+ "value": "some thing match3",
+ },
+ ],
+ "type": "RESULT",
+ }
+ }
+ key="undefined-$-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-expanded={true}
+ aria-level={1}
+ className="tree-node"
+ data-expandable={true}
+ id="undefined-$"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <div
+ className="file-result"
+ >
+ <AccessibleImage
+ className="arrow expanded"
+ >
+ <span
+ className="img arrow expanded"
+ />
+ </AccessibleImage>
+ <AccessibleImage
+ className="file"
+ >
+ <span
+ className="img file"
+ />
+ </AccessibleImage>
+ <span
+ className="file-path"
+ />
+ <span
+ className="matches-summary"
+ >
+ (3 matches)
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ <TreeNode
+ active={false}
+ depth={1}
+ expanded={false}
+ focused={false}
+ id="undefined-undefined-30-1"
+ index={1}
+ isExpandable={false}
+ item={
+ Object {
+ "location": Object {
+ "column": 30,
+ "source": Object {},
+ },
+ "match": "match1",
+ "type": "MATCH",
+ "value": "some thing match1",
+ }
+ }
+ key="undefined-undefined-30-1-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-level={2}
+ className="tree-node"
+ data-expandable={false}
+ id="undefined-undefined-30-1"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <span
+ className="tree-indent tree-last-indent"
+ >
+ ​
+ </span>
+ <div
+ className="result"
+ onClick={[Function]}
+ >
+ <span
+ className="line-number"
+ />
+ <span
+ className="line-value"
+ >
+ <span
+ className="line-match"
+ key="0"
+ >
+ some thing match1
+ </span>
+ <span
+ className="query-match"
+ key="1"
+ >
+ some t
+ </span>
+ <span
+ className="line-match"
+ key="2"
+ >
+ some thing match1
+ </span>
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ <TreeNode
+ active={false}
+ depth={1}
+ expanded={false}
+ focused={false}
+ id="undefined-undefined-60-2"
+ index={2}
+ isExpandable={false}
+ item={
+ Object {
+ "location": Object {
+ "column": 60,
+ "source": Object {},
+ },
+ "match": "match2",
+ "type": "MATCH",
+ "value": "some thing match2",
+ }
+ }
+ key="undefined-undefined-60-2-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-level={2}
+ className="tree-node"
+ data-expandable={false}
+ id="undefined-undefined-60-2"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <span
+ className="tree-indent tree-last-indent"
+ >
+ ​
+ </span>
+ <div
+ className="result"
+ onClick={[Function]}
+ >
+ <span
+ className="line-number"
+ />
+ <span
+ className="line-value"
+ >
+ <span
+ className="line-match"
+ key="0"
+ >
+ some thing match2
+ </span>
+ <span
+ className="query-match"
+ key="1"
+ >
+ some t
+ </span>
+ <span
+ className="line-match"
+ key="2"
+ >
+ some thing match2
+ </span>
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ <TreeNode
+ active={false}
+ depth={1}
+ expanded={false}
+ focused={false}
+ id="undefined-undefined-90-3"
+ index={3}
+ isExpandable={false}
+ item={
+ Object {
+ "location": Object {
+ "column": 90,
+ "source": Object {},
+ },
+ "match": "match3",
+ "type": "MATCH",
+ "value": "some thing match3",
+ }
+ }
+ key="undefined-undefined-90-3-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-level={2}
+ className="tree-node"
+ data-expandable={false}
+ id="undefined-undefined-90-3"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <span
+ className="tree-indent tree-last-indent"
+ >
+ ​
+ </span>
+ <div
+ className="result"
+ onClick={[Function]}
+ >
+ <span
+ className="line-number"
+ />
+ <span
+ className="line-value"
+ >
+ <span
+ className="line-match"
+ key="0"
+ >
+ some thing match3
+ </span>
+ <span
+ className="query-match"
+ key="1"
+ >
+ some t
+ </span>
+ <span
+ className="line-match"
+ key="2"
+ >
+ some thing match3
+ </span>
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ <TreeNode
+ active={false}
+ depth={0}
+ expanded={true}
+ focused={false}
+ id="undefined-4"
+ index={4}
+ isExpandable={true}
+ item={
+ Object {
+ "location": Object {
+ "source": Object {
+ "url": "testFilePath2",
+ },
+ },
+ "matches": Array [
+ Object {
+ "location": Object {
+ "column": 80,
+ "source": Object {},
+ },
+ "match": "match4",
+ "type": "MATCH",
+ "value": "some thing match4",
+ },
+ Object {
+ "location": Object {
+ "column": 40,
+ "source": Object {},
+ },
+ "match": "match5",
+ "type": "MATCH",
+ "value": "some thing match5",
+ },
+ ],
+ "type": "RESULT",
+ }
+ }
+ key="undefined-4-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-expanded={true}
+ aria-level={1}
+ className="tree-node"
+ data-expandable={true}
+ id="undefined-4"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <div
+ className="file-result"
+ >
+ <AccessibleImage
+ className="arrow expanded"
+ >
+ <span
+ className="img arrow expanded"
+ />
+ </AccessibleImage>
+ <AccessibleImage
+ className="file"
+ >
+ <span
+ className="img file"
+ />
+ </AccessibleImage>
+ <span
+ className="file-path"
+ />
+ <span
+ className="matches-summary"
+ >
+ (2 matches)
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ <TreeNode
+ active={false}
+ depth={1}
+ expanded={false}
+ focused={false}
+ id="undefined-undefined-80-5"
+ index={5}
+ isExpandable={false}
+ item={
+ Object {
+ "location": Object {
+ "column": 80,
+ "source": Object {},
+ },
+ "match": "match4",
+ "type": "MATCH",
+ "value": "some thing match4",
+ }
+ }
+ key="undefined-undefined-80-5-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-level={2}
+ className="tree-node"
+ data-expandable={false}
+ id="undefined-undefined-80-5"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <span
+ className="tree-indent tree-last-indent"
+ >
+ ​
+ </span>
+ <div
+ className="result"
+ onClick={[Function]}
+ >
+ <span
+ className="line-number"
+ />
+ <span
+ className="line-value"
+ >
+ <span
+ className="line-match"
+ key="0"
+ >
+ some thing match4
+ </span>
+ <span
+ className="query-match"
+ key="1"
+ >
+ some t
+ </span>
+ <span
+ className="line-match"
+ key="2"
+ >
+ some thing match4
+ </span>
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ <TreeNode
+ active={false}
+ depth={1}
+ expanded={false}
+ focused={false}
+ id="undefined-undefined-40-6"
+ index={6}
+ isExpandable={false}
+ item={
+ Object {
+ "location": Object {
+ "column": 40,
+ "source": Object {},
+ },
+ "match": "match5",
+ "type": "MATCH",
+ "value": "some thing match5",
+ }
+ }
+ key="undefined-undefined-40-6-inactive"
+ onClick={[Function]}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ renderItem={[Function]}
+ >
+ <div
+ aria-level={2}
+ className="tree-node"
+ data-expandable={false}
+ id="undefined-undefined-40-6"
+ onClick={[Function]}
+ onKeyDownCapture={null}
+ role="treeitem"
+ >
+ <span
+ className="tree-indent tree-last-indent"
+ >
+ ​
+ </span>
+ <div
+ className="result"
+ onClick={[Function]}
+ >
+ <span
+ className="line-number"
+ />
+ <span
+ className="line-value"
+ >
+ <span
+ className="line-match"
+ key="0"
+ >
+ some thing match5
+ </span>
+ <span
+ className="query-match"
+ key="1"
+ >
+ some t
+ </span>
+ <span
+ className="line-match"
+ key="2"
+ >
+ some thing match5
+ </span>
+ </span>
+ </div>
+ </div>
+ </TreeNode>
+ </div>
+ </Tree>
+ </div>
+ </div>
+</ProjectSearch>
+`;
+
+exports[`ProjectSearch renders nothing when disabled 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={0}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={false}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="foo"
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={true}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="0 results"
+ />
+ </div>
+ <div
+ className="no-result-msg absolute-center"
+ >
+ No results found
+ </div>
+ </div>
+</div>
+`;
+
+exports[`ProjectSearch should display loading message while search is in progress 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={0}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={true}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="match"
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={false}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="0 results"
+ />
+ </div>
+ <div
+ className="no-result-msg absolute-center"
+ >
+ Loading…
+ </div>
+ </div>
+</div>
+`;
+
+exports[`ProjectSearch showErrorEmoji false if not done & no results 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={0}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={true}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="foo"
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={false}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="0 results"
+ />
+ </div>
+ <div
+ className="no-result-msg absolute-center"
+ >
+ Loading…
+ </div>
+ </div>
+</div>
+`;
+
+exports[`ProjectSearch showErrorEmoji false if not done & results 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={5}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={true}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query="foo"
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={false}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg="5 results"
+ />
+ </div>
+ <Tree
+ autoExpandAll={true}
+ autoExpandDepth={1}
+ autoExpandNodeChildrenLimit={100}
+ focused={null}
+ getChildren={[Function]}
+ getKey={[Function]}
+ getParent={[Function]}
+ getPath={[Function]}
+ getRoots={[Function]}
+ isExpanded={[Function]}
+ itemHeight={24}
+ onCollapse={[Function]}
+ onExpand={[Function]}
+ onFocus={[Function]}
+ renderItem={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`ProjectSearch turns off shortcuts on unmount 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={0}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={false}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query=""
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={true}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg=""
+ />
+ </div>
+ </div>
+</div>
+`;
+
+exports[`ProjectSearch where <Enter> has not been pressed 1`] = `
+<div
+ className="search-container"
+>
+ <div
+ className="project-text-search"
+ >
+ <div
+ className="header"
+ >
+ <Connect(SearchInput)
+ count={0}
+ excludePatternsLabel="files to exclude"
+ excludePatternsPlaceholder="e.g. **/node_modules/**,app.js"
+ isLoading={false}
+ onBlur={[Function]}
+ onChange={[Function]}
+ onFocus={[Function]}
+ onHistoryScroll={[Function]}
+ onKeyDown={[Function]}
+ onToggleSearchModifier={[Function]}
+ placeholder="Find in files…"
+ query=""
+ searchKey="project-search"
+ showClose={false}
+ showErrorEmoji={true}
+ showExcludePatterns={true}
+ showSearchModifiers={true}
+ size="small"
+ summaryMsg=""
+ />
+ </div>
+ </div>
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/QuickOpenModal.css b/devtools/client/debugger/src/components/QuickOpenModal.css
new file mode 100644
index 0000000000..5a2627b99f
--- /dev/null
+++ b/devtools/client/debugger/src/components/QuickOpenModal.css
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.result-item .title .highlight {
+ font-weight: bold;
+ background-color: transparent;
+}
+
+.selected .highlight {
+ color: white;
+}
+
+.result-item .subtitle .highlight {
+ color: var(--grey-90);
+ font-weight: 500;
+ background-color: transparent;
+}
+
+.theme-dark .result-item .title .highlight,
+.theme-dark .result-item .subtitle .highlight {
+ color: white;
+}
+
+.loading-indicator {
+ padding: 5px 0 5px 0;
+ text-align: center;
+}
diff --git a/devtools/client/debugger/src/components/QuickOpenModal.js b/devtools/client/debugger/src/components/QuickOpenModal.js
new file mode 100644
index 0000000000..f993b0f6c1
--- /dev/null
+++ b/devtools/client/debugger/src/components/QuickOpenModal.js
@@ -0,0 +1,524 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../utils/connect";
+import fuzzyAldrin from "fuzzaldrin-plus";
+import { basename } from "../utils/path";
+import { createLocation } from "../utils/location";
+
+const { throttle } = require("devtools/shared/throttle");
+
+import actions from "../actions";
+import {
+ getDisplayedSourcesList,
+ getQuickOpenEnabled,
+ getQuickOpenQuery,
+ getQuickOpenType,
+ getSelectedSource,
+ getSelectedLocation,
+ getSettledSourceTextContent,
+ getSymbols,
+ getTabs,
+ getContext,
+ getBlackBoxRanges,
+ getProjectDirectoryRoot,
+} from "../selectors";
+import { memoizeLast } from "../utils/memoizeLast";
+import { scrollList } from "../utils/result-list";
+import { searchKeys } from "../constants";
+import {
+ formatSymbols,
+ parseLineColumn,
+ formatShortcutResults,
+ formatSourceForList,
+} from "../utils/quick-open";
+import Modal from "./shared/Modal";
+import SearchInput from "./shared/SearchInput";
+import ResultList from "./shared/ResultList";
+
+import "./QuickOpenModal.css";
+
+const maxResults = 100;
+
+const SIZE_BIG = { size: "big" };
+const SIZE_DEFAULT = {};
+
+function filter(values, query) {
+ const preparedQuery = fuzzyAldrin.prepareQuery(query);
+
+ return fuzzyAldrin.filter(values, query, {
+ key: "value",
+ maxResults,
+ preparedQuery,
+ });
+}
+
+export class QuickOpenModal extends Component {
+ // Put it on the class so it can be retrieved in tests
+ static UPDATE_RESULTS_THROTTLE = 100;
+
+ constructor(props) {
+ super(props);
+ this.state = { results: null, selectedIndex: 0 };
+ }
+
+ static get propTypes() {
+ return {
+ closeQuickOpen: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ displayedSources: PropTypes.array.isRequired,
+ blackBoxRanges: PropTypes.object.isRequired,
+ enabled: PropTypes.bool.isRequired,
+ highlightLineRange: PropTypes.func.isRequired,
+ clearHighlightLineRange: PropTypes.func.isRequired,
+ query: PropTypes.string.isRequired,
+ searchType: PropTypes.oneOf([
+ "functions",
+ "goto",
+ "gotoSource",
+ "other",
+ "shortcuts",
+ "sources",
+ "variables",
+ ]).isRequired,
+ selectSpecificLocation: PropTypes.func.isRequired,
+ selectedContentLoaded: PropTypes.bool,
+ selectedSource: PropTypes.object,
+ setQuickOpenQuery: PropTypes.func.isRequired,
+ shortcutsModalEnabled: PropTypes.bool.isRequired,
+ symbols: PropTypes.object.isRequired,
+ symbolsLoading: PropTypes.bool.isRequired,
+ tabUrls: PropTypes.array.isRequired,
+ toggleShortcutsModal: PropTypes.func.isRequired,
+ projectDirectoryRoot: PropTypes.string,
+ };
+ }
+
+ setResults(results) {
+ if (results) {
+ results = results.slice(0, maxResults);
+ }
+ this.setState({ results });
+ }
+
+ componentDidMount() {
+ const { query, shortcutsModalEnabled, toggleShortcutsModal } = this.props;
+
+ this.updateResults(query);
+
+ if (shortcutsModalEnabled) {
+ toggleShortcutsModal();
+ }
+ }
+
+ componentDidUpdate(prevProps) {
+ const nowEnabled = !prevProps.enabled && this.props.enabled;
+ const queryChanged = prevProps.query !== this.props.query;
+
+ if (this.refs.resultList && this.refs.resultList.refs) {
+ scrollList(this.refs.resultList.refs, this.state.selectedIndex);
+ }
+
+ if (nowEnabled || queryChanged) {
+ this.updateResults(this.props.query);
+ }
+ }
+
+ closeModal = () => {
+ this.props.closeQuickOpen();
+ };
+
+ dropGoto = query => {
+ const index = query.indexOf(":");
+ return index !== -1 ? query.slice(0, index) : query;
+ };
+
+ formatSources = memoizeLast(
+ (displayedSources, tabUrls, blackBoxRanges, projectDirectoryRoot) => {
+ // Note that we should format all displayed sources,
+ // the actual filtering will only be done late from `searchSources()`
+ return displayedSources.map(source => {
+ const isBlackBoxed = !!blackBoxRanges[source.url];
+ const hasTabOpened = tabUrls.includes(source.url);
+ return formatSourceForList(
+ source,
+ hasTabOpened,
+ isBlackBoxed,
+ projectDirectoryRoot
+ );
+ });
+ }
+ );
+
+ searchSources = query => {
+ const { displayedSources, tabUrls, blackBoxRanges, projectDirectoryRoot } =
+ this.props;
+
+ const sources = this.formatSources(
+ displayedSources,
+ tabUrls,
+ blackBoxRanges,
+ projectDirectoryRoot
+ );
+ const results =
+ query == "" ? sources : filter(sources, this.dropGoto(query));
+ return this.setResults(results);
+ };
+
+ searchSymbols = query => {
+ const {
+ symbols: { functions },
+ } = this.props;
+
+ let results = functions;
+ results = results.filter(result => result.title !== "anonymous");
+
+ if (query === "@" || query === "#") {
+ return this.setResults(results);
+ }
+ results = filter(results, query.slice(1));
+ return this.setResults(results);
+ };
+
+ searchShortcuts = query => {
+ const results = formatShortcutResults();
+ if (query == "?") {
+ this.setResults(results);
+ } else {
+ this.setResults(filter(results, query.slice(1)));
+ }
+ };
+
+ /**
+ * This method is called when we just opened the modal and the query input is empty
+ */
+ showTopSources = () => {
+ const { tabUrls, blackBoxRanges, projectDirectoryRoot } = this.props;
+ let { displayedSources } = this.props;
+
+ // If there is some tabs opened, only show tab's sources.
+ // Otherwise, we display all visible sources (per SourceTree definition),
+ // setResults will restrict the number of results to a maximum limit.
+ if (tabUrls.length) {
+ displayedSources = displayedSources.filter(
+ source => !!source.url && tabUrls.includes(source.url)
+ );
+ }
+
+ this.setResults(
+ this.formatSources(
+ displayedSources,
+ tabUrls,
+ blackBoxRanges,
+ projectDirectoryRoot
+ )
+ );
+ };
+
+ updateResults = throttle(query => {
+ if (this.isGotoQuery()) {
+ return;
+ }
+
+ if (query == "" && !this.isShortcutQuery()) {
+ this.showTopSources();
+ return;
+ }
+
+ if (this.isSymbolSearch()) {
+ this.searchSymbols(query);
+ return;
+ }
+
+ if (this.isShortcutQuery()) {
+ this.searchShortcuts(query);
+ return;
+ }
+
+ this.searchSources(query);
+ }, QuickOpenModal.UPDATE_RESULTS_THROTTLE);
+
+ setModifier = item => {
+ if (["@", "#", ":"].includes(item.id)) {
+ this.props.setQuickOpenQuery(item.id);
+ }
+ };
+
+ selectResultItem = (e, item) => {
+ if (item == null) {
+ return;
+ }
+
+ if (this.isShortcutQuery()) {
+ this.setModifier(item);
+ return;
+ }
+
+ if (this.isGotoSourceQuery()) {
+ const location = parseLineColumn(this.props.query);
+ this.gotoLocation({ ...location, source: item.source });
+ return;
+ }
+
+ if (this.isSymbolSearch()) {
+ this.gotoLocation({
+ line:
+ item.location && item.location.start ? item.location.start.line : 0,
+ });
+ return;
+ }
+
+ this.gotoLocation({ source: item.source, line: 0 });
+ };
+
+ onSelectResultItem = item => {
+ const { selectedSource, highlightLineRange, clearHighlightLineRange } =
+ this.props;
+ if (
+ selectedSource == null ||
+ !this.isSymbolSearch() ||
+ !this.isFunctionQuery()
+ ) {
+ return;
+ }
+
+ if (item.location) {
+ highlightLineRange({
+ start: item.location.start.line,
+ end: item.location.end.line,
+ sourceId: selectedSource.id,
+ });
+ } else {
+ clearHighlightLineRange();
+ }
+ };
+
+ traverseResults = e => {
+ const direction = e.key === "ArrowUp" ? -1 : 1;
+ const { selectedIndex, results } = this.state;
+ const resultCount = this.getResultCount();
+ const index = selectedIndex + direction;
+ const nextIndex = (index + resultCount) % resultCount || 0;
+
+ this.setState({ selectedIndex: nextIndex });
+
+ if (results != null) {
+ this.onSelectResultItem(results[nextIndex]);
+ }
+ };
+
+ gotoLocation = location => {
+ const { cx, selectSpecificLocation, selectedSource } = this.props;
+
+ if (location != null) {
+ selectSpecificLocation(
+ cx,
+ createLocation({
+ source: location.source || selectedSource,
+ line: location.line,
+ column: location.column,
+ })
+ );
+ this.closeModal();
+ }
+ };
+
+ onChange = e => {
+ const { selectedSource, selectedContentLoaded, setQuickOpenQuery } =
+ this.props;
+ setQuickOpenQuery(e.target.value);
+ const noSource = !selectedSource || !selectedContentLoaded;
+ if ((noSource && this.isSymbolSearch()) || this.isGotoQuery()) {
+ return;
+ }
+
+ // Wait for the next tick so that reducer updates are complete.
+ const targetValue = e.target.value;
+ setTimeout(() => this.updateResults(targetValue), 0);
+ };
+
+ onKeyDown = e => {
+ const { enabled, query } = this.props;
+ const { results, selectedIndex } = this.state;
+ const isGoToQuery = this.isGotoQuery();
+
+ if ((!enabled || !results) && !isGoToQuery) {
+ return;
+ }
+
+ if (e.key === "Enter") {
+ if (isGoToQuery) {
+ const location = parseLineColumn(query);
+ this.gotoLocation(location);
+ return;
+ }
+
+ if (results) {
+ this.selectResultItem(e, results[selectedIndex]);
+ return;
+ }
+ }
+
+ if (e.key === "Tab") {
+ this.closeModal();
+ return;
+ }
+
+ if (["ArrowUp", "ArrowDown"].includes(e.key)) {
+ e.preventDefault();
+ this.traverseResults(e);
+ }
+ };
+
+ getResultCount = () => {
+ const { results } = this.state;
+ return results && results.length ? results.length : 0;
+ };
+
+ // Query helpers
+ isFunctionQuery = () => this.props.searchType === "functions";
+ isSymbolSearch = () => this.isFunctionQuery();
+ isGotoQuery = () => this.props.searchType === "goto";
+ isGotoSourceQuery = () => this.props.searchType === "gotoSource";
+ isShortcutQuery = () => this.props.searchType === "shortcuts";
+ isSourcesQuery = () => this.props.searchType === "sources";
+ isSourceSearch = () => this.isSourcesQuery() || this.isGotoSourceQuery();
+
+ /* eslint-disable react/no-danger */
+ renderHighlight(candidateString, query, name) {
+ const options = {
+ wrap: {
+ tagOpen: '<mark class="highlight">',
+ tagClose: "</mark>",
+ },
+ };
+ const html = fuzzyAldrin.wrap(candidateString, query, options);
+ return <div dangerouslySetInnerHTML={{ __html: html }} />;
+ }
+
+ highlightMatching = (query, results) => {
+ let newQuery = query;
+ if (newQuery === "") {
+ return results;
+ }
+ newQuery = query.replace(/[@:#?]/gi, " ");
+
+ return results.map(result => {
+ if (typeof result.title == "string") {
+ return {
+ ...result,
+ title: this.renderHighlight(
+ result.title,
+ basename(newQuery),
+ "title"
+ ),
+ };
+ }
+ return result;
+ });
+ };
+
+ shouldShowErrorEmoji() {
+ const { query } = this.props;
+ if (this.isGotoQuery()) {
+ return !/^:\d*$/.test(query);
+ }
+ return !!query && !this.getResultCount();
+ }
+
+ getSummaryMessage() {
+ let summaryMsg = "";
+ if (this.isGotoQuery()) {
+ summaryMsg = L10N.getStr("shortcuts.gotoLine");
+ } else if (this.isFunctionQuery() && this.props.symbolsLoading) {
+ summaryMsg = L10N.getStr("loadingText");
+ }
+ return summaryMsg;
+ }
+
+ render() {
+ const { enabled, query } = this.props;
+ const { selectedIndex, results } = this.state;
+
+ if (!enabled) {
+ return null;
+ }
+ const items = this.highlightMatching(query, results || []);
+ const expanded = !!items && !!items.length;
+
+ return (
+ <Modal in={enabled} handleClose={this.closeModal}>
+ <SearchInput
+ query={query}
+ hasPrefix={true}
+ count={this.getResultCount()}
+ placeholder={L10N.getStr("sourceSearch.search2")}
+ summaryMsg={this.getSummaryMessage()}
+ showErrorEmoji={this.shouldShowErrorEmoji()}
+ isLoading={false}
+ onChange={this.onChange}
+ onKeyDown={this.onKeyDown}
+ handleClose={this.closeModal}
+ expanded={expanded}
+ showClose={false}
+ searchKey={searchKeys.QUICKOPEN_SEARCH}
+ showExcludePatterns={false}
+ showSearchModifiers={false}
+ selectedItemId={
+ expanded && items[selectedIndex] ? items[selectedIndex].id : ""
+ }
+ {...(this.isSourceSearch() ? SIZE_BIG : SIZE_DEFAULT)}
+ />
+ {results && (
+ <ResultList
+ key="results"
+ items={items}
+ selected={selectedIndex}
+ selectItem={this.selectResultItem}
+ ref="resultList"
+ expanded={expanded}
+ {...(this.isSourceSearch() ? SIZE_BIG : SIZE_DEFAULT)}
+ />
+ )}
+ </Modal>
+ );
+ }
+}
+
+/* istanbul ignore next: ignoring testing of redux connection stuff */
+function mapStateToProps(state) {
+ const selectedSource = getSelectedSource(state);
+ const location = getSelectedLocation(state);
+ const displayedSources = getDisplayedSourcesList(state);
+ const tabs = getTabs(state);
+ const tabUrls = [...new Set(tabs.map(tab => tab.url))];
+ const symbols = getSymbols(state, location);
+
+ return {
+ cx: getContext(state),
+ enabled: getQuickOpenEnabled(state),
+ displayedSources,
+ blackBoxRanges: getBlackBoxRanges(state),
+ projectDirectoryRoot: getProjectDirectoryRoot(state),
+ selectedSource,
+ selectedContentLoaded: location
+ ? !!getSettledSourceTextContent(state, location)
+ : undefined,
+ symbols: formatSymbols(symbols, maxResults),
+ symbolsLoading: !symbols,
+ query: getQuickOpenQuery(state),
+ searchType: getQuickOpenType(state),
+ tabUrls,
+ };
+}
+
+export default connect(mapStateToProps, {
+ selectSpecificLocation: actions.selectSpecificLocation,
+ setQuickOpenQuery: actions.setQuickOpenQuery,
+ highlightLineRange: actions.highlightLineRange,
+ clearHighlightLineRange: actions.clearHighlightLineRange,
+ closeQuickOpen: actions.closeQuickOpen,
+})(QuickOpenModal);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js
new file mode 100644
index 0000000000..368170bed7
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js
@@ -0,0 +1,219 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../../utils/connect";
+import { createSelector } from "reselect";
+import actions from "../../../actions";
+
+import showContextMenu from "./BreakpointsContextMenu";
+import { CloseButton } from "../../shared/Button";
+
+import { getSelectedText, makeBreakpointId } from "../../../utils/breakpoint";
+import { getSelectedLocation } from "../../../utils/selected-location";
+import { isLineBlackboxed } from "../../../utils/source";
+
+import {
+ getBreakpointsList,
+ getSelectedFrame,
+ getSelectedSource,
+ getCurrentThread,
+ getContext,
+ isSourceMapIgnoreListEnabled,
+ isSourceOnSourceMapIgnoreList,
+} from "../../../selectors";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+class Breakpoint extends PureComponent {
+ static get propTypes() {
+ return {
+ breakpoint: PropTypes.object.isRequired,
+ cx: PropTypes.object.isRequired,
+ disableBreakpoint: PropTypes.func.isRequired,
+ editor: PropTypes.object.isRequired,
+ enableBreakpoint: PropTypes.func.isRequired,
+ frame: PropTypes.object,
+ openConditionalPanel: PropTypes.func.isRequired,
+ removeBreakpoint: PropTypes.func.isRequired,
+ selectSpecificLocation: PropTypes.func.isRequired,
+ selectedSource: PropTypes.object,
+ source: PropTypes.object.isRequired,
+ blackboxedRangesForSource: PropTypes.array.isRequired,
+ checkSourceOnIgnoreList: PropTypes.func.isRequired,
+ };
+ }
+
+ onContextMenu = e => {
+ showContextMenu({ ...this.props, contextMenuEvent: e });
+ };
+
+ get selectedLocation() {
+ const { breakpoint, selectedSource } = this.props;
+ return getSelectedLocation(breakpoint, selectedSource);
+ }
+
+ onDoubleClick = () => {
+ const { breakpoint, openConditionalPanel } = this.props;
+ if (breakpoint.options.condition) {
+ openConditionalPanel(this.selectedLocation);
+ } else if (breakpoint.options.logValue) {
+ openConditionalPanel(this.selectedLocation, true);
+ }
+ };
+
+ selectBreakpoint = event => {
+ event.preventDefault();
+ const { cx, selectSpecificLocation } = this.props;
+ selectSpecificLocation(cx, this.selectedLocation);
+ };
+
+ removeBreakpoint = event => {
+ const { cx, removeBreakpoint, breakpoint } = this.props;
+ event.stopPropagation();
+ removeBreakpoint(cx, breakpoint);
+ };
+
+ handleBreakpointCheckbox = () => {
+ const { cx, breakpoint, enableBreakpoint, disableBreakpoint } = this.props;
+ if (breakpoint.disabled) {
+ enableBreakpoint(cx, breakpoint);
+ } else {
+ disableBreakpoint(cx, breakpoint);
+ }
+ };
+
+ isCurrentlyPausedAtBreakpoint() {
+ const { frame } = this.props;
+ if (!frame) {
+ return false;
+ }
+
+ const bpId = makeBreakpointId(this.selectedLocation);
+ const frameId = makeBreakpointId(frame.selectedLocation);
+ return bpId == frameId;
+ }
+
+ getBreakpointLocation() {
+ const { source } = this.props;
+ const { column, line } = this.selectedLocation;
+
+ const isWasm = source?.isWasm;
+ const columnVal = column ? `:${column}` : "";
+ const bpLocation = isWasm
+ ? `0x${line.toString(16).toUpperCase()}`
+ : `${line}${columnVal}`;
+
+ return bpLocation;
+ }
+
+ getBreakpointText() {
+ const { breakpoint, selectedSource } = this.props;
+ const { condition, logValue } = breakpoint.options;
+ return logValue || condition || getSelectedText(breakpoint, selectedSource);
+ }
+
+ highlightText(text = "", editor) {
+ const node = document.createElement("div");
+ editor.CodeMirror.runMode(text, "application/javascript", node);
+ return { __html: node.innerHTML };
+ }
+
+ render() {
+ const {
+ breakpoint,
+ editor,
+ blackboxedRangesForSource,
+ checkSourceOnIgnoreList,
+ } = this.props;
+ const text = this.getBreakpointText();
+ const labelId = `${breakpoint.id}-label`;
+
+ return (
+ <div
+ className={classnames({
+ breakpoint,
+ paused: this.isCurrentlyPausedAtBreakpoint(),
+ disabled: breakpoint.disabled,
+ "is-conditional": !!breakpoint.options.condition,
+ "is-log": !!breakpoint.options.logValue,
+ })}
+ onClick={this.selectBreakpoint}
+ onDoubleClick={this.onDoubleClick}
+ onContextMenu={this.onContextMenu}
+ >
+ <input
+ id={breakpoint.id}
+ type="checkbox"
+ className="breakpoint-checkbox"
+ checked={!breakpoint.disabled}
+ disabled={isLineBlackboxed(
+ blackboxedRangesForSource,
+ breakpoint.location.line,
+ checkSourceOnIgnoreList(breakpoint.location.source)
+ )}
+ onChange={this.handleBreakpointCheckbox}
+ onClick={ev => ev.stopPropagation()}
+ aria-labelledby={labelId}
+ />
+ <span
+ id={labelId}
+ className="breakpoint-label cm-s-mozilla devtools-monospace"
+ onClick={this.selectBreakpoint}
+ title={text}
+ >
+ <span dangerouslySetInnerHTML={this.highlightText(text, editor)} />
+ </span>
+ <div className="breakpoint-line-close">
+ <div className="breakpoint-line devtools-monospace">
+ {this.getBreakpointLocation()}
+ </div>
+ <CloseButton
+ handleClick={e => this.removeBreakpoint(e)}
+ tooltip={L10N.getStr("breakpoints.removeBreakpointTooltip")}
+ />
+ </div>
+ </div>
+ );
+ }
+}
+
+const getFormattedFrame = createSelector(
+ getSelectedSource,
+ getSelectedFrame,
+ (selectedSource, frame) => {
+ if (!frame) {
+ return null;
+ }
+
+ return {
+ ...frame,
+ selectedLocation: getSelectedLocation(frame, selectedSource),
+ };
+ }
+);
+
+const mapStateToProps = (state, p) => ({
+ cx: getContext(state),
+ breakpoints: getBreakpointsList(state),
+ frame: getFormattedFrame(state, getCurrentThread(state)),
+ checkSourceOnIgnoreList: source =>
+ isSourceMapIgnoreListEnabled(state) &&
+ isSourceOnSourceMapIgnoreList(state, source),
+});
+
+export default connect(mapStateToProps, {
+ enableBreakpoint: actions.enableBreakpoint,
+ removeBreakpoint: actions.removeBreakpoint,
+ removeBreakpoints: actions.removeBreakpoints,
+ removeAllBreakpoints: actions.removeAllBreakpoints,
+ disableBreakpoint: actions.disableBreakpoint,
+ selectSpecificLocation: actions.selectSpecificLocation,
+ setBreakpointOptions: actions.setBreakpointOptions,
+ toggleAllBreakpoints: actions.toggleAllBreakpoints,
+ toggleBreakpoints: actions.toggleBreakpoints,
+ toggleDisabledBreakpoint: actions.toggleDisabledBreakpoint,
+ openConditionalPanel: actions.openConditionalPanel,
+})(Breakpoint);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeading.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeading.js
new file mode 100644
index 0000000000..c2c29cc258
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeading.js
@@ -0,0 +1,88 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+
+import { connect } from "../../../utils/connect";
+import actions from "../../../actions";
+
+import {
+ getTruncatedFileName,
+ getDisplayPath,
+ getSourceQueryString,
+ getFileURL,
+} from "../../../utils/source";
+import { createLocation } from "../../../utils/location";
+import {
+ getBreakpointsForSource,
+ getContext,
+ getFirstSourceActorForGeneratedSource,
+} from "../../../selectors";
+
+import SourceIcon from "../../shared/SourceIcon";
+
+import showContextMenu from "./BreakpointHeadingsContextMenu";
+
+class BreakpointHeading extends PureComponent {
+ static get propTypes() {
+ return {
+ cx: PropTypes.object.isRequired,
+ sources: PropTypes.array.isRequired,
+ source: PropTypes.object.isRequired,
+ firstSourceActor: PropTypes.object,
+ selectSource: PropTypes.func.isRequired,
+ };
+ }
+ onContextMenu = e => {
+ showContextMenu({ ...this.props, contextMenuEvent: e });
+ };
+
+ render() {
+ const { cx, sources, source, selectSource } = this.props;
+
+ const path = getDisplayPath(source, sources);
+ const query = getSourceQueryString(source);
+
+ return (
+ <div
+ className="breakpoint-heading"
+ title={getFileURL(source, false)}
+ onClick={() => selectSource(cx, source)}
+ onContextMenu={this.onContextMenu}
+ >
+ <SourceIcon
+ // Breakpoints are displayed per source and may relate to many source actors.
+ // Arbitrarily pick the first source actor to compute the matching source icon
+ // The source actor is used to pick one specific source text content and guess
+ // the related framework icon.
+ location={createLocation({
+ source,
+ sourceActor: this.props.firstSourceActor,
+ })}
+ modifier={icon =>
+ ["file", "javascript"].includes(icon) ? null : icon
+ }
+ />
+ <div className="filename">
+ {getTruncatedFileName(source, query)}
+ {path && <span>{`../${path}/..`}</span>}
+ </div>
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = (state, { source }) => ({
+ cx: getContext(state),
+ breakpointsForSource: getBreakpointsForSource(state, source.id),
+ firstSourceActor: getFirstSourceActorForGeneratedSource(state, source.id),
+});
+
+export default connect(mapStateToProps, {
+ selectSource: actions.selectSource,
+ enableBreakpointsInSource: actions.enableBreakpointsInSource,
+ disableBreakpointsInSource: actions.disableBreakpointsInSource,
+ removeBreakpointsInSource: actions.removeBreakpointsInSource,
+})(BreakpointHeading);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeadingsContextMenu.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeadingsContextMenu.js
new file mode 100644
index 0000000000..cdd3910b00
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointHeadingsContextMenu.js
@@ -0,0 +1,77 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { buildMenu, showMenu } from "../../../context-menu/menu";
+
+export default function showContextMenu(props) {
+ const {
+ cx,
+ source,
+ breakpointsForSource,
+ disableBreakpointsInSource,
+ enableBreakpointsInSource,
+ removeBreakpointsInSource,
+ contextMenuEvent,
+ } = props;
+
+ contextMenuEvent.preventDefault();
+
+ const enableInSourceLabel = L10N.getStr(
+ "breakpointHeadingsMenuItem.enableInSource.label"
+ );
+ const disableInSourceLabel = L10N.getStr(
+ "breakpointHeadingsMenuItem.disableInSource.label"
+ );
+ const removeInSourceLabel = L10N.getStr(
+ "breakpointHeadingsMenuItem.removeInSource.label"
+ );
+ const enableInSourceKey = L10N.getStr(
+ "breakpointHeadingsMenuItem.enableInSource.accesskey"
+ );
+ const disableInSourceKey = L10N.getStr(
+ "breakpointHeadingsMenuItem.disableInSource.accesskey"
+ );
+ const removeInSourceKey = L10N.getStr(
+ "breakpointHeadingsMenuItem.removeInSource.accesskey"
+ );
+
+ const disableInSourceItem = {
+ id: "node-menu-disable-in-source",
+ label: disableInSourceLabel,
+ accesskey: disableInSourceKey,
+ disabled: false,
+ click: () => disableBreakpointsInSource(cx, source),
+ };
+
+ const enableInSourceItem = {
+ id: "node-menu-enable-in-source",
+ label: enableInSourceLabel,
+ accesskey: enableInSourceKey,
+ disabled: false,
+ click: () => enableBreakpointsInSource(cx, source),
+ };
+
+ const removeInSourceItem = {
+ id: "node-menu-enable-in-source",
+ label: removeInSourceLabel,
+ accesskey: removeInSourceKey,
+ disabled: false,
+ click: () => removeBreakpointsInSource(cx, source),
+ };
+
+ const hideDisableInSourceItem = breakpointsForSource.every(
+ breakpoint => breakpoint.disabled
+ );
+ const hideEnableInSourceItem = breakpointsForSource.every(
+ breakpoint => !breakpoint.disabled
+ );
+
+ const items = [
+ { item: disableInSourceItem, hidden: () => hideDisableInSourceItem },
+ { item: enableInSourceItem, hidden: () => hideEnableInSourceItem },
+ { item: removeInSourceItem, hidden: () => false },
+ ];
+
+ showMenu(contextMenuEvent, buildMenu(items));
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoints.css b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoints.css
new file mode 100644
index 0000000000..98075058b8
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoints.css
@@ -0,0 +1,249 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.breakpoints-pane > ._content {
+ overflow-x: auto;
+}
+
+.breakpoints-exceptions-options *,
+.breakpoints-list * {
+ user-select: none;
+}
+
+.breakpoints-list {
+ padding: 4px 0;
+}
+
+.breakpoints-list .breakpoint-heading {
+ text-overflow: ellipsis;
+ width: 100%;
+ font-size: 12px;
+ line-height: 16px;
+}
+
+.breakpoint-heading:not(:first-child) {
+ margin-top: 2px;
+}
+
+.breakpoints-list .breakpoint-heading .filename {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.breakpoints-list .breakpoint-heading .filename span {
+ opacity: 0.7;
+ padding-left: 4px;
+}
+
+.breakpoints-list .breakpoint-heading,
+.breakpoints-list .breakpoint {
+ color: var(--theme-text-color-strong);
+ position: relative;
+ cursor: pointer;
+}
+
+.breakpoints-list .breakpoint-heading,
+.breakpoints-list .breakpoint,
+.breakpoints-exceptions,
+.breakpoints-exceptions-caught {
+ display: flex;
+ align-items: center;
+ overflow: hidden;
+ padding-top: 2px;
+ padding-bottom: 2px;
+ padding-inline-start: 16px;
+ padding-inline-end: 12px;
+}
+
+.breakpoints-exceptions {
+ padding-bottom: 3px;
+ padding-top: 3px;
+ user-select: none;
+}
+
+.breakpoints-exceptions-caught {
+ padding-bottom: 3px;
+ padding-top: 3px;
+ padding-inline-start: 36px;
+}
+
+.breakpoints-exceptions-options {
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+
+.xhr-breakpoints-pane .breakpoints-exceptions-options {
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.breakpoints-exceptions-options:not(.empty) {
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.breakpoints-exceptions input,
+.breakpoints-exceptions-caught input {
+ padding-inline-start: 2px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-inline-start: 0;
+ margin-inline-end: 2px;
+ vertical-align: text-bottom;
+}
+
+.breakpoint-exceptions-label {
+ line-height: 14px;
+ padding-inline-end: 8px;
+ cursor: default;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+html[dir="rtl"] .breakpoints-list .breakpoint,
+html[dir="rtl"] .breakpoints-list .breakpoint-heading,
+html[dir="rtl"] .breakpoints-exceptions {
+ border-right: 4px solid transparent;
+}
+
+html:not([dir="rtl"]) .breakpoints-list .breakpoint,
+html:not([dir="rtl"]) .breakpoints-list .breakpoint-heading,
+html:not([dir="rtl"]) .breakpoints-exceptions {
+ border-left: 4px solid transparent;
+}
+
+html .breakpoints-list .breakpoint.is-conditional {
+ border-inline-start-color: var(--theme-graphs-yellow);
+}
+
+html .breakpoints-list .breakpoint.is-log {
+ border-inline-start-color: var(--theme-graphs-purple);
+}
+
+html .breakpoints-list .breakpoint.paused {
+ background-color: var(--theme-toolbar-background-alt);
+ border-color: var(--breakpoint-active-color);
+}
+
+.breakpoints-list .breakpoint:hover {
+ background-color: var(--search-overlays-semitransparent);
+}
+
+.breakpoint-line-close {
+ margin-inline-start: 4px;
+}
+
+.breakpoints-list .breakpoint .breakpoint-line {
+ font-size: 11px;
+ color: var(--theme-comment);
+ min-width: 16px;
+ text-align: end;
+ padding-top: 1px;
+ padding-bottom: 1px;
+}
+
+.breakpoints-list .breakpoint:hover .breakpoint-line,
+.breakpoints-list .breakpoint-line-close:focus-within .breakpoint-line {
+ color: transparent;
+}
+
+.breakpoints-list .breakpoint.paused:hover {
+ border-color: var(--breakpoint-active-color-hover);
+}
+
+.breakpoints-list .breakpoint-label {
+ display: inline-block;
+ cursor: pointer;
+ flex-grow: 1;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ font-size: 11px;
+}
+
+.breakpoints-list .breakpoint-label span,
+.breakpoint-line-close {
+ display: inline;
+ line-height: 14px;
+}
+
+.breakpoint-checkbox {
+ margin-inline-start: 0px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ vertical-align: text-bottom;
+}
+
+.breakpoint-label .location {
+ width: 100%;
+ display: inline-block;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ padding: 1px 0;
+ vertical-align: bottom;
+}
+
+.breakpoints-list .pause-indicator {
+ flex: 0 1 content;
+ order: 3;
+}
+
+.breakpoint .close-btn {
+ position: absolute;
+ /* hide button outside of row until hovered or focused */
+ top: -100px;
+}
+
+[dir="ltr"] .breakpoint .close-btn {
+ right: 12px;
+}
+
+[dir="rtl"] .breakpoint .close-btn {
+ left: 12px;
+}
+
+/* Reveal the remove button on hover/focus */
+.breakpoint:hover .close-btn,
+.breakpoint .close-btn:focus {
+ top: calc(50% - 8px);
+}
+
+/* Hide the line number when revealing the remove button (since they're overlayed) */
+.breakpoint-line-close:focus-within .breakpoint-line,
+.breakpoint:hover .breakpoint-line {
+ visibility: hidden;
+}
+
+.CodeMirror.cm-s-mozilla-breakpoint {
+ cursor: pointer;
+}
+
+.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-lines {
+ padding: 0;
+}
+
+.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-sizer {
+ min-width: initial !important;
+}
+
+.breakpoints-list .breakpoint .CodeMirror.cm-s-mozilla-breakpoint {
+ transition: opacity 0.15s linear;
+}
+
+.breakpoints-list .breakpoint.disabled .CodeMirror.cm-s-mozilla-breakpoint {
+ opacity: 0.5;
+}
+
+.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-line span[role="presentation"] {
+ max-width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: inline-block;
+}
+
+.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-code,
+.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-scroll {
+ pointer-events: none;
+}
+
+.CodeMirror.cm-s-mozilla-breakpoint {
+ padding-top: 1px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
new file mode 100644
index 0000000000..c2d8f3ff33
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
@@ -0,0 +1,365 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { buildMenu, showMenu } from "../../../context-menu/menu";
+import { getSelectedLocation } from "../../../utils/selected-location";
+import { isLineBlackboxed } from "../../../utils/source";
+import { features } from "../../../utils/prefs";
+import { formatKeyShortcut } from "../../../utils/text";
+
+export default function showContextMenu(props) {
+ const {
+ cx,
+ breakpoint,
+ breakpoints,
+ selectedSource,
+ removeBreakpoint,
+ removeBreakpoints,
+ removeAllBreakpoints,
+ toggleBreakpoints,
+ toggleAllBreakpoints,
+ toggleDisabledBreakpoint,
+ selectSpecificLocation,
+ setBreakpointOptions,
+ openConditionalPanel,
+ contextMenuEvent,
+ blackboxedRangesForSource,
+ checkSourceOnIgnoreList,
+ } = props;
+
+ contextMenuEvent.preventDefault();
+
+ const deleteSelfLabel = L10N.getStr("breakpointMenuItem.deleteSelf2.label");
+ const deleteAllLabel = L10N.getStr("breakpointMenuItem.deleteAll2.label");
+ const deleteOthersLabel = L10N.getStr(
+ "breakpointMenuItem.deleteOthers2.label"
+ );
+ const enableSelfLabel = L10N.getStr("breakpointMenuItem.enableSelf2.label");
+ const enableAllLabel = L10N.getStr("breakpointMenuItem.enableAll2.label");
+ const enableOthersLabel = L10N.getStr(
+ "breakpointMenuItem.enableOthers2.label"
+ );
+ const disableSelfLabel = L10N.getStr("breakpointMenuItem.disableSelf2.label");
+ const disableAllLabel = L10N.getStr("breakpointMenuItem.disableAll2.label");
+ const disableOthersLabel = L10N.getStr(
+ "breakpointMenuItem.disableOthers2.label"
+ );
+ const enableDbgStatementLabel = L10N.getStr(
+ "breakpointMenuItem.enabledbg.label"
+ );
+ const disableDbgStatementLabel = L10N.getStr(
+ "breakpointMenuItem.disabledbg.label"
+ );
+ const removeConditionLabel = L10N.getStr(
+ "breakpointMenuItem.removeCondition2.label"
+ );
+ const addConditionLabel = L10N.getStr(
+ "breakpointMenuItem.addCondition2.label"
+ );
+ const editConditionLabel = L10N.getStr(
+ "breakpointMenuItem.editCondition2.label"
+ );
+
+ const deleteSelfKey = L10N.getStr("breakpointMenuItem.deleteSelf2.accesskey");
+ const deleteAllKey = L10N.getStr("breakpointMenuItem.deleteAll2.accesskey");
+ const deleteOthersKey = L10N.getStr(
+ "breakpointMenuItem.deleteOthers2.accesskey"
+ );
+ const enableSelfKey = L10N.getStr("breakpointMenuItem.enableSelf2.accesskey");
+ const enableAllKey = L10N.getStr("breakpointMenuItem.enableAll2.accesskey");
+ const enableOthersKey = L10N.getStr(
+ "breakpointMenuItem.enableOthers2.accesskey"
+ );
+ const disableSelfKey = L10N.getStr(
+ "breakpointMenuItem.disableSelf2.accesskey"
+ );
+ const disableAllKey = L10N.getStr("breakpointMenuItem.disableAll2.accesskey");
+ const disableOthersKey = L10N.getStr(
+ "breakpointMenuItem.disableOthers2.accesskey"
+ );
+ const removeConditionKey = L10N.getStr(
+ "breakpointMenuItem.removeCondition2.accesskey"
+ );
+ const editConditionKey = L10N.getStr(
+ "breakpointMenuItem.editCondition2.accesskey"
+ );
+ const addConditionKey = L10N.getStr(
+ "breakpointMenuItem.addCondition2.accesskey"
+ );
+
+ const selectedLocation = getSelectedLocation(breakpoint, selectedSource);
+ const otherBreakpoints = breakpoints.filter(b => b.id !== breakpoint.id);
+ const enabledBreakpoints = breakpoints.filter(b => !b.disabled);
+ const disabledBreakpoints = breakpoints.filter(b => b.disabled);
+ const otherEnabledBreakpoints = breakpoints.filter(
+ b => !b.disabled && b.id !== breakpoint.id
+ );
+ const otherDisabledBreakpoints = breakpoints.filter(
+ b => b.disabled && b.id !== breakpoint.id
+ );
+
+ const deleteSelfItem = {
+ id: "node-menu-delete-self",
+ label: deleteSelfLabel,
+ accesskey: deleteSelfKey,
+ disabled: false,
+ click: () => {
+ removeBreakpoint(cx, breakpoint);
+ },
+ };
+
+ const deleteAllItem = {
+ id: "node-menu-delete-all",
+ label: deleteAllLabel,
+ accesskey: deleteAllKey,
+ disabled: false,
+ click: () => removeAllBreakpoints(cx),
+ };
+
+ const deleteOthersItem = {
+ id: "node-menu-delete-other",
+ label: deleteOthersLabel,
+ accesskey: deleteOthersKey,
+ disabled: false,
+ click: () => removeBreakpoints(cx, otherBreakpoints),
+ };
+
+ const enableSelfItem = {
+ id: "node-menu-enable-self",
+ label: enableSelfLabel,
+ accesskey: enableSelfKey,
+ disabled: isLineBlackboxed(
+ blackboxedRangesForSource,
+ breakpoint.location.line,
+ checkSourceOnIgnoreList(breakpoint.location.source)
+ ),
+ click: () => {
+ toggleDisabledBreakpoint(cx, breakpoint);
+ },
+ };
+
+ const enableAllItem = {
+ id: "node-menu-enable-all",
+ label: enableAllLabel,
+ accesskey: enableAllKey,
+ disabled: isLineBlackboxed(
+ blackboxedRangesForSource,
+ breakpoint.location.line,
+ checkSourceOnIgnoreList(breakpoint.location.source)
+ ),
+ click: () => toggleAllBreakpoints(cx, false),
+ };
+
+ const enableOthersItem = {
+ id: "node-menu-enable-others",
+ label: enableOthersLabel,
+ accesskey: enableOthersKey,
+ disabled: isLineBlackboxed(
+ blackboxedRangesForSource,
+ breakpoint.location.line,
+ checkSourceOnIgnoreList(breakpoint.location.source)
+ ),
+ click: () => toggleBreakpoints(cx, false, otherDisabledBreakpoints),
+ };
+
+ const disableSelfItem = {
+ id: "node-menu-disable-self",
+ label: disableSelfLabel,
+ accesskey: disableSelfKey,
+ disabled: false,
+ click: () => {
+ toggleDisabledBreakpoint(cx, breakpoint);
+ },
+ };
+
+ const disableAllItem = {
+ id: "node-menu-disable-all",
+ label: disableAllLabel,
+ accesskey: disableAllKey,
+ disabled: false,
+ click: () => toggleAllBreakpoints(cx, true),
+ };
+
+ const disableOthersItem = {
+ id: "node-menu-disable-others",
+ label: disableOthersLabel,
+ accesskey: disableOthersKey,
+ click: () => toggleBreakpoints(cx, true, otherEnabledBreakpoints),
+ };
+
+ const enableDbgStatementItem = {
+ id: "node-menu-enable-dbgStatement",
+ label: enableDbgStatementLabel,
+ disabled: false,
+ click: () =>
+ setBreakpointOptions(cx, selectedLocation, {
+ ...breakpoint.options,
+ condition: null,
+ }),
+ };
+
+ const disableDbgStatementItem = {
+ id: "node-menu-disable-dbgStatement",
+ label: disableDbgStatementLabel,
+ disabled: false,
+ click: () =>
+ setBreakpointOptions(cx, selectedLocation, {
+ ...breakpoint.options,
+ condition: "false",
+ }),
+ };
+
+ const removeConditionItem = {
+ id: "node-menu-remove-condition",
+ label: removeConditionLabel,
+ accesskey: removeConditionKey,
+ disabled: false,
+ click: () =>
+ setBreakpointOptions(cx, selectedLocation, {
+ ...breakpoint.options,
+ condition: null,
+ }),
+ };
+
+ const addConditionItem = {
+ id: "node-menu-add-condition",
+ label: addConditionLabel,
+ accesskey: addConditionKey,
+ click: () => {
+ selectSpecificLocation(cx, selectedLocation);
+ openConditionalPanel(selectedLocation);
+ },
+ accelerator: formatKeyShortcut(
+ L10N.getStr("toggleCondPanel.breakpoint.key")
+ ),
+ };
+
+ const editConditionItem = {
+ id: "node-menu-edit-condition",
+ label: editConditionLabel,
+ accesskey: editConditionKey,
+ click: () => {
+ selectSpecificLocation(cx, selectedLocation);
+ openConditionalPanel(selectedLocation);
+ },
+ accelerator: formatKeyShortcut(
+ L10N.getStr("toggleCondPanel.breakpoint.key")
+ ),
+ };
+
+ const addLogPointItem = {
+ id: "node-menu-add-log-point",
+ label: L10N.getStr("editor.addLogPoint"),
+ accesskey: L10N.getStr("editor.addLogPoint.accesskey"),
+ disabled: false,
+ click: () => {
+ selectSpecificLocation(cx, selectedLocation);
+ openConditionalPanel(selectedLocation, true);
+ },
+ accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
+ };
+
+ const editLogPointItem = {
+ id: "node-menu-edit-log-point",
+ label: L10N.getStr("editor.editLogPoint"),
+ accesskey: L10N.getStr("editor.editLogPoint.accesskey"),
+ disabled: false,
+ click: () => {
+ selectSpecificLocation(cx, selectedLocation);
+ openConditionalPanel(selectedLocation, true);
+ },
+ accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
+ };
+
+ const removeLogPointItem = {
+ id: "node-menu-remove-log",
+ label: L10N.getStr("editor.removeLogPoint.label"),
+ accesskey: L10N.getStr("editor.removeLogPoint.accesskey"),
+ disabled: false,
+ click: () =>
+ setBreakpointOptions(cx, selectedLocation, {
+ ...breakpoint.options,
+ logValue: null,
+ }),
+ };
+
+ const logPointItem = breakpoint.options.logValue
+ ? editLogPointItem
+ : addLogPointItem;
+
+ const hideEnableSelfItem = !breakpoint.disabled;
+ const hideEnableAllItem = disabledBreakpoints.length === 0;
+ const hideEnableOthersItem = otherDisabledBreakpoints.length === 0;
+ const hideDisableAllItem = enabledBreakpoints.length === 0;
+ const hideDisableOthersItem = otherEnabledBreakpoints.length === 0;
+ const hideDisableSelfItem = breakpoint.disabled;
+ const hideEnableDbgStatementItem =
+ !breakpoint.originalText.startsWith("debugger") ||
+ (breakpoint.originalText.startsWith("debugger") &&
+ breakpoint.options.condition !== "false");
+ const hideDisableDbgStatementItem =
+ !breakpoint.originalText.startsWith("debugger") ||
+ (breakpoint.originalText.startsWith("debugger") &&
+ breakpoint.options.condition === "false");
+ const items = [
+ { item: enableSelfItem, hidden: () => hideEnableSelfItem },
+ { item: enableAllItem, hidden: () => hideEnableAllItem },
+ { item: enableOthersItem, hidden: () => hideEnableOthersItem },
+ {
+ item: { type: "separator" },
+ hidden: () =>
+ hideEnableSelfItem && hideEnableAllItem && hideEnableOthersItem,
+ },
+ { item: deleteSelfItem },
+ { item: deleteAllItem },
+ { item: deleteOthersItem, hidden: () => breakpoints.length === 1 },
+ {
+ item: { type: "separator" },
+ hidden: () =>
+ hideDisableSelfItem && hideDisableAllItem && hideDisableOthersItem,
+ },
+
+ { item: disableSelfItem, hidden: () => hideDisableSelfItem },
+ { item: disableAllItem, hidden: () => hideDisableAllItem },
+ { item: disableOthersItem, hidden: () => hideDisableOthersItem },
+ {
+ item: { type: "separator" },
+ },
+ {
+ item: enableDbgStatementItem,
+ hidden: () => hideEnableDbgStatementItem,
+ },
+ {
+ item: disableDbgStatementItem,
+ hidden: () => hideDisableDbgStatementItem,
+ },
+ {
+ item: { type: "separator" },
+ hidden: () => hideDisableDbgStatementItem && hideEnableDbgStatementItem,
+ },
+ {
+ item: addConditionItem,
+ hidden: () => breakpoint.options.condition,
+ },
+ {
+ item: editConditionItem,
+ hidden: () => !breakpoint.options.condition,
+ },
+ {
+ item: removeConditionItem,
+ hidden: () => !breakpoint.options.condition,
+ },
+ {
+ item: logPointItem,
+ hidden: () => !features.logPoints,
+ },
+ {
+ item: removeLogPointItem,
+ hidden: () => !features.logPoints || !breakpoint.options.logValue,
+ },
+ ];
+
+ showMenu(contextMenuEvent, buildMenu(items));
+ return null;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/ExceptionOption.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/ExceptionOption.js
new file mode 100644
index 0000000000..0b7d70fc62
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/ExceptionOption.js
@@ -0,0 +1,31 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import PropTypes from "prop-types";
+
+export default function ExceptionOption({
+ className,
+ isChecked = false,
+ label,
+ onChange,
+}) {
+ return (
+ <div className={className} onClick={onChange}>
+ <input
+ type="checkbox"
+ checked={isChecked ? "checked" : ""}
+ onChange={e => e.stopPropagation() && onChange()}
+ />
+ <div className="breakpoint-exceptions-label">{label}</div>
+ </div>
+ );
+}
+
+ExceptionOption.propTypes = {
+ className: PropTypes.string.isRequired,
+ isChecked: PropTypes.bool.isRequired,
+ label: PropTypes.string.isRequired,
+ onChange: PropTypes.func.isRequired,
+};
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/index.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/index.js
new file mode 100644
index 0000000000..3a3cc19afa
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/index.js
@@ -0,0 +1,152 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../../utils/connect";
+
+import ExceptionOption from "./ExceptionOption";
+
+import Breakpoint from "./Breakpoint";
+import BreakpointHeading from "./BreakpointHeading";
+
+import actions from "../../../actions";
+import { getSelectedLocation } from "../../../utils/selected-location";
+import { createHeadlessEditor } from "../../../utils/editor/create-editor";
+
+import { makeBreakpointId } from "../../../utils/breakpoint";
+
+import {
+ getSelectedSource,
+ getBreakpointSources,
+ getBlackBoxRanges,
+} from "../../../selectors";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+import "./Breakpoints.css";
+
+class Breakpoints extends Component {
+ static get propTypes() {
+ return {
+ breakpointSources: PropTypes.array.isRequired,
+ pauseOnExceptions: PropTypes.func.isRequired,
+ selectedSource: PropTypes.object,
+ shouldPauseOnCaughtExceptions: PropTypes.bool.isRequired,
+ shouldPauseOnExceptions: PropTypes.bool.isRequired,
+ blackboxedRanges: PropTypes.array.isRequired,
+ };
+ }
+
+ componentWillUnmount() {
+ this.removeEditor();
+ }
+
+ getEditor() {
+ if (!this.headlessEditor) {
+ this.headlessEditor = createHeadlessEditor();
+ }
+ return this.headlessEditor;
+ }
+
+ removeEditor() {
+ if (!this.headlessEditor) {
+ return;
+ }
+ this.headlessEditor.destroy();
+ this.headlessEditor = null;
+ }
+
+ renderExceptionsOptions() {
+ const {
+ breakpointSources,
+ shouldPauseOnExceptions,
+ shouldPauseOnCaughtExceptions,
+ pauseOnExceptions,
+ } = this.props;
+
+ const isEmpty = !breakpointSources.length;
+
+ return (
+ <div
+ className={classnames("breakpoints-exceptions-options", {
+ empty: isEmpty,
+ })}
+ >
+ <ExceptionOption
+ className="breakpoints-exceptions"
+ label={L10N.getStr("pauseOnExceptionsItem2")}
+ isChecked={shouldPauseOnExceptions}
+ onChange={() => pauseOnExceptions(!shouldPauseOnExceptions, false)}
+ />
+
+ {shouldPauseOnExceptions && (
+ <ExceptionOption
+ className="breakpoints-exceptions-caught"
+ label={L10N.getStr("pauseOnCaughtExceptionsItem")}
+ isChecked={shouldPauseOnCaughtExceptions}
+ onChange={() =>
+ pauseOnExceptions(true, !shouldPauseOnCaughtExceptions)
+ }
+ />
+ )}
+ </div>
+ );
+ }
+
+ renderBreakpoints() {
+ const { breakpointSources, selectedSource, blackboxedRanges } = this.props;
+ if (!breakpointSources.length) {
+ return null;
+ }
+
+ const editor = this.getEditor();
+ const sources = breakpointSources.map(({ source }) => source);
+
+ return (
+ <div className="pane breakpoints-list">
+ {breakpointSources.map(({ source, breakpoints }) => {
+ return [
+ <BreakpointHeading
+ key={source.id}
+ source={source}
+ sources={sources}
+ />,
+ breakpoints.map(breakpoint => (
+ <Breakpoint
+ breakpoint={breakpoint}
+ source={source}
+ blackboxedRangesForSource={blackboxedRanges[source.url]}
+ selectedSource={selectedSource}
+ editor={editor}
+ key={makeBreakpointId(
+ getSelectedLocation(breakpoint, selectedSource)
+ )}
+ />
+ )),
+ ];
+ })}
+ </div>
+ );
+ }
+
+ render() {
+ return (
+ <div className="pane">
+ {this.renderExceptionsOptions()}
+ {this.renderBreakpoints()}
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => ({
+ breakpointSources: getBreakpointSources(state),
+ selectedSource: getSelectedSource(state),
+ blackboxedRanges: getBlackBoxRanges(state),
+});
+
+export default connect(mapStateToProps, {
+ pauseOnExceptions: actions.pauseOnExceptions,
+})(Breakpoints);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/moz.build b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/moz.build
new file mode 100644
index 0000000000..2b075efdd4
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/moz.build
@@ -0,0 +1,15 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "Breakpoint.js",
+ "BreakpointHeading.js",
+ "BreakpointHeadingsContextMenu.js",
+ "BreakpointsContextMenu.js",
+ "ExceptionOption.js",
+ "index.js",
+)
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/Breakpoint.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/Breakpoint.spec.js
new file mode 100644
index 0000000000..a28f9b06d5
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/Breakpoint.spec.js
@@ -0,0 +1,104 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+
+import Breakpoint from "../Breakpoint";
+import {
+ createSourceObject,
+ createOriginalSourceObject,
+} from "../../../../utils/test-head";
+
+describe("Breakpoint", () => {
+ it("simple", () => {
+ const { component } = render();
+ expect(component).toMatchSnapshot();
+ });
+
+ it("disabled", () => {
+ const { component } = render({}, makeBreakpoint({ disabled: true }));
+ expect(component).toMatchSnapshot();
+ });
+
+ it("paused at a generatedLocation", () => {
+ const { component } = render({
+ frame: { selectedLocation: generatedLocation },
+ });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("paused at an original location", () => {
+ const source = createSourceObject("foo");
+ const origSource = createOriginalSourceObject(source);
+
+ const { component } = render(
+ {
+ selectedSource: origSource,
+ frame: { selectedLocation: location },
+ },
+ { location, options: {} }
+ );
+
+ expect(component).toMatchSnapshot();
+ });
+
+ it("paused at a different", () => {
+ const { component } = render({
+ frame: { selectedLocation: { ...generatedLocation, line: 14 } },
+ });
+ expect(component).toMatchSnapshot();
+ });
+});
+
+const generatedLocation = { source: { id: "foo" }, line: 53, column: 73 };
+const location = { source: { id: "foo/original" }, line: 5, column: 7 };
+
+function render(overrides = {}, breakpointOverrides = {}) {
+ const props = generateDefaults(overrides, breakpointOverrides);
+ const component = shallow(<Breakpoint.WrappedComponent {...props} />);
+ const defaultState = component.state();
+ const instance = component.instance();
+
+ return { component, props, defaultState, instance };
+}
+
+function makeBreakpoint(overrides = {}) {
+ return {
+ location,
+ generatedLocation,
+ disabled: false,
+ options: {},
+ ...overrides,
+ id: 1,
+ };
+}
+
+function generateDefaults(overrides = {}, breakpointOverrides = {}) {
+ const source = createSourceObject("foo");
+ const breakpoint = makeBreakpoint(breakpointOverrides);
+ const selectedSource = createSourceObject("foo");
+ return {
+ cx: {},
+ disableBreakpoint: () => {},
+ enableBreakpoint: () => {},
+ openConditionalPanel: () => {},
+ removeBreakpoint: () => {},
+ selectSpecificLocation: () => {},
+ blackboxedRangesForSource: [],
+ checkSourceOnIgnoreList: () => {},
+ source,
+ breakpoint,
+ selectedSource,
+ frame: null,
+ editor: {
+ CodeMirror: {
+ runMode: function () {
+ return "";
+ },
+ },
+ },
+ ...overrides,
+ };
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/BreakpointsContextMenu.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/BreakpointsContextMenu.spec.js
new file mode 100644
index 0000000000..87194f762d
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/BreakpointsContextMenu.spec.js
@@ -0,0 +1,134 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+
+import BreakpointsContextMenu from "../BreakpointsContextMenu";
+import { buildMenu } from "../../../../context-menu/menu";
+
+import {
+ makeMockBreakpoint,
+ makeMockSource,
+ mockcx,
+} from "../../../../utils/test-mockup";
+
+jest.mock("../../../../context-menu/menu");
+
+function render(disabled = false) {
+ const props = generateDefaults(disabled);
+ const component = shallow(<BreakpointsContextMenu {...props} />);
+ return { component, props };
+}
+
+function generateDefaults(disabled) {
+ const source = makeMockSource(
+ "https://example.com/main.js",
+ "source-https://example.com/main.js"
+ );
+ const breakpoints = [
+ {
+ ...makeMockBreakpoint(source, 1),
+ id: "https://example.com/main.js:1:",
+ disabled,
+ options: {
+ condition: "",
+ logValue: "",
+ hidden: false,
+ },
+ },
+ {
+ ...makeMockBreakpoint(source, 2),
+ id: "https://example.com/main.js:2:",
+ disabled,
+ options: {
+ hidden: false,
+ },
+ },
+ {
+ ...makeMockBreakpoint(source, 3),
+ id: "https://example.com/main.js:3:",
+ disabled,
+ },
+ ];
+
+ const props = {
+ cx: mockcx,
+ breakpoints,
+ breakpoint: breakpoints[0],
+ removeBreakpoint: jest.fn(),
+ removeBreakpoints: jest.fn(),
+ removeAllBreakpoints: jest.fn(),
+ toggleBreakpoints: jest.fn(),
+ toggleAllBreakpoints: jest.fn(),
+ toggleDisabledBreakpoint: jest.fn(),
+ selectSpecificLocation: jest.fn(),
+ setBreakpointCondition: jest.fn(),
+ openConditionalPanel: jest.fn(),
+ contextMenuEvent: { preventDefault: jest.fn() },
+ selectedSource: makeMockSource(),
+ setBreakpointOptions: jest.fn(),
+ checkSourceOnIgnoreList: jest.fn(),
+ };
+ return props;
+}
+
+describe("BreakpointsContextMenu", () => {
+ afterEach(() => {
+ buildMenu.mockReset();
+ });
+
+ describe("context menu actions affecting other breakpoints", () => {
+ it("'remove others' calls removeBreakpoints with proper arguments", () => {
+ const { props } = render();
+ const menuItems = buildMenu.mock.calls[0][0];
+ const deleteOthers = menuItems.find(
+ item => item.item.id === "node-menu-delete-other"
+ );
+ deleteOthers.item.click();
+
+ expect(props.removeBreakpoints).toHaveBeenCalled();
+
+ const otherBreakpoints = [props.breakpoints[1], props.breakpoints[2]];
+ expect(props.removeBreakpoints.mock.calls[0][1]).toEqual(
+ otherBreakpoints
+ );
+ });
+
+ it("'enable others' calls toggleBreakpoints with proper arguments", () => {
+ const { props } = render(true);
+ const menuItems = buildMenu.mock.calls[0][0];
+ const enableOthers = menuItems.find(
+ item => item.item.id === "node-menu-enable-others"
+ );
+ enableOthers.item.click();
+
+ expect(props.toggleBreakpoints).toHaveBeenCalled();
+
+ expect(props.toggleBreakpoints.mock.calls[0][1]).toBe(false);
+
+ const otherBreakpoints = [props.breakpoints[1], props.breakpoints[2]];
+ expect(props.toggleBreakpoints.mock.calls[0][2]).toEqual(
+ otherBreakpoints
+ );
+ });
+
+ it("'disable others' calls toggleBreakpoints with proper arguments", () => {
+ const { props } = render();
+ const menuItems = buildMenu.mock.calls[0][0];
+ const disableOthers = menuItems.find(
+ item => item.item.id === "node-menu-disable-others"
+ );
+ disableOthers.item.click();
+
+ expect(props.toggleBreakpoints).toHaveBeenCalled();
+ expect(props.toggleBreakpoints.mock.calls[0][1]).toBe(true);
+
+ const otherBreakpoints = [props.breakpoints[1], props.breakpoints[2]];
+ expect(props.toggleBreakpoints.mock.calls[0][2]).toEqual(
+ otherBreakpoints
+ );
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/ExceptionOption.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/ExceptionOption.spec.js
new file mode 100644
index 0000000000..238551cc10
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/ExceptionOption.spec.js
@@ -0,0 +1,22 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+
+import ExceptionOption from "../ExceptionOption";
+
+describe("ExceptionOption renders", () => {
+ it("with values", () => {
+ const component = shallow(
+ <ExceptionOption
+ label="testLabel"
+ isChecked={true}
+ onChange={() => null}
+ className="testClassName"
+ />
+ );
+ expect(component).toMatchSnapshot();
+ });
+});
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/Breakpoint.spec.js.snap b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/Breakpoint.spec.js.snap
new file mode 100644
index 0000000000..45f44e42f7
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/Breakpoint.spec.js.snap
@@ -0,0 +1,231 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Breakpoint disabled 1`] = `
+<div
+ className="breakpoint disabled"
+ onClick={[Function]}
+ onContextMenu={[Function]}
+ onDoubleClick={[Function]}
+>
+ <input
+ aria-labelledby="1-label"
+ checked={false}
+ className="breakpoint-checkbox"
+ disabled={true}
+ id={1}
+ onChange={[Function]}
+ onClick={[Function]}
+ type="checkbox"
+ />
+ <span
+ className="breakpoint-label cm-s-mozilla devtools-monospace"
+ id="1-label"
+ onClick={[Function]}
+ >
+ <span
+ dangerouslySetInnerHTML={
+ Object {
+ "__html": "",
+ }
+ }
+ />
+ </span>
+ <div
+ className="breakpoint-line-close"
+ >
+ <div
+ className="breakpoint-line devtools-monospace"
+ >
+ 53:73
+ </div>
+ <CloseButton
+ handleClick={[Function]}
+ tooltip="Remove breakpoint"
+ />
+ </div>
+</div>
+`;
+
+exports[`Breakpoint paused at a different 1`] = `
+<div
+ className="breakpoint"
+ onClick={[Function]}
+ onContextMenu={[Function]}
+ onDoubleClick={[Function]}
+>
+ <input
+ aria-labelledby="1-label"
+ checked={true}
+ className="breakpoint-checkbox"
+ disabled={true}
+ id={1}
+ onChange={[Function]}
+ onClick={[Function]}
+ type="checkbox"
+ />
+ <span
+ className="breakpoint-label cm-s-mozilla devtools-monospace"
+ id="1-label"
+ onClick={[Function]}
+ >
+ <span
+ dangerouslySetInnerHTML={
+ Object {
+ "__html": "",
+ }
+ }
+ />
+ </span>
+ <div
+ className="breakpoint-line-close"
+ >
+ <div
+ className="breakpoint-line devtools-monospace"
+ >
+ 53:73
+ </div>
+ <CloseButton
+ handleClick={[Function]}
+ tooltip="Remove breakpoint"
+ />
+ </div>
+</div>
+`;
+
+exports[`Breakpoint paused at a generatedLocation 1`] = `
+<div
+ className="breakpoint paused"
+ onClick={[Function]}
+ onContextMenu={[Function]}
+ onDoubleClick={[Function]}
+>
+ <input
+ aria-labelledby="1-label"
+ checked={true}
+ className="breakpoint-checkbox"
+ disabled={true}
+ id={1}
+ onChange={[Function]}
+ onClick={[Function]}
+ type="checkbox"
+ />
+ <span
+ className="breakpoint-label cm-s-mozilla devtools-monospace"
+ id="1-label"
+ onClick={[Function]}
+ >
+ <span
+ dangerouslySetInnerHTML={
+ Object {
+ "__html": "",
+ }
+ }
+ />
+ </span>
+ <div
+ className="breakpoint-line-close"
+ >
+ <div
+ className="breakpoint-line devtools-monospace"
+ >
+ 53:73
+ </div>
+ <CloseButton
+ handleClick={[Function]}
+ tooltip="Remove breakpoint"
+ />
+ </div>
+</div>
+`;
+
+exports[`Breakpoint paused at an original location 1`] = `
+<div
+ className="breakpoint paused"
+ onClick={[Function]}
+ onContextMenu={[Function]}
+ onDoubleClick={[Function]}
+>
+ <input
+ aria-labelledby="1-label"
+ checked={true}
+ className="breakpoint-checkbox"
+ disabled={true}
+ id={1}
+ onChange={[Function]}
+ onClick={[Function]}
+ type="checkbox"
+ />
+ <span
+ className="breakpoint-label cm-s-mozilla devtools-monospace"
+ id="1-label"
+ onClick={[Function]}
+ >
+ <span
+ dangerouslySetInnerHTML={
+ Object {
+ "__html": "",
+ }
+ }
+ />
+ </span>
+ <div
+ className="breakpoint-line-close"
+ >
+ <div
+ className="breakpoint-line devtools-monospace"
+ >
+ 5:7
+ </div>
+ <CloseButton
+ handleClick={[Function]}
+ tooltip="Remove breakpoint"
+ />
+ </div>
+</div>
+`;
+
+exports[`Breakpoint simple 1`] = `
+<div
+ className="breakpoint"
+ onClick={[Function]}
+ onContextMenu={[Function]}
+ onDoubleClick={[Function]}
+>
+ <input
+ aria-labelledby="1-label"
+ checked={true}
+ className="breakpoint-checkbox"
+ disabled={true}
+ id={1}
+ onChange={[Function]}
+ onClick={[Function]}
+ type="checkbox"
+ />
+ <span
+ className="breakpoint-label cm-s-mozilla devtools-monospace"
+ id="1-label"
+ onClick={[Function]}
+ >
+ <span
+ dangerouslySetInnerHTML={
+ Object {
+ "__html": "",
+ }
+ }
+ />
+ </span>
+ <div
+ className="breakpoint-line-close"
+ >
+ <div
+ className="breakpoint-line devtools-monospace"
+ >
+ 53:73
+ </div>
+ <CloseButton
+ handleClick={[Function]}
+ tooltip="Remove breakpoint"
+ />
+ </div>
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/ExceptionOption.spec.js.snap b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/ExceptionOption.spec.js.snap
new file mode 100644
index 0000000000..19b5937676
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/tests/__snapshots__/ExceptionOption.spec.js.snap
@@ -0,0 +1,19 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ExceptionOption renders with values 1`] = `
+<div
+ className="testClassName"
+ onClick={[Function]}
+>
+ <input
+ checked="checked"
+ onChange={[Function]}
+ type="checkbox"
+ />
+ <div
+ className="breakpoint-exceptions-label"
+ >
+ testLabel
+ </div>
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.css b/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.css
new file mode 100644
index 0000000000..68bd0bfcdd
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.css
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.command-bar {
+ flex: 0 0 29px;
+ border-bottom: 1px solid var(--theme-splitter-color);
+ display: flex;
+ overflow: hidden;
+ z-index: 1;
+ background-color: var(--theme-toolbar-background);
+}
+
+html[dir="rtl"] .command-bar {
+ border-right: 1px solid var(--theme-splitter-color);
+}
+
+.command-bar .filler {
+ flex-grow: 1;
+}
+
+.command-bar .step-position {
+ color: var(--theme-text-color-inactive);
+ padding-top: 8px;
+ margin-inline-end: 4px;
+}
+
+.command-bar .divider {
+ width: 1px;
+ background: var(--theme-splitter-color);
+ height: 10px;
+ margin: 11px 6px 0 6px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js b/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js
new file mode 100644
index 0000000000..a8f4173924
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js
@@ -0,0 +1,433 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+
+import { connect } from "../../utils/connect";
+import { features, prefs } from "../../utils/prefs";
+import {
+ getIsWaitingOnBreak,
+ getSkipPausing,
+ getCurrentThread,
+ isTopFrameSelected,
+ getThreadContext,
+ getIsCurrentThreadPaused,
+ getIsThreadCurrentlyTracing,
+ getJavascriptTracingLogMethod,
+} from "../../selectors";
+import { formatKeyShortcut } from "../../utils/text";
+import actions from "../../actions";
+import { debugBtn } from "../shared/Button/CommandBarButton";
+import AccessibleImage from "../shared/AccessibleImage";
+import "./CommandBar.css";
+import { showMenu } from "../../context-menu/menu";
+
+const classnames = require("devtools/client/shared/classnames.js");
+const MenuButton = require("devtools/client/shared/components/menu/MenuButton");
+const MenuItem = require("devtools/client/shared/components/menu/MenuItem");
+const MenuList = require("devtools/client/shared/components/menu/MenuList");
+
+const isMacOS = Services.appinfo.OS === "Darwin";
+
+// NOTE: the "resume" command will call either the resume or breakOnNext action
+// depending on whether or not the debugger is paused or running
+const COMMANDS = ["resume", "stepOver", "stepIn", "stepOut"];
+
+const KEYS = {
+ WINNT: {
+ resume: "F8",
+ stepOver: "F10",
+ stepIn: "F11",
+ stepOut: "Shift+F11",
+ },
+ Darwin: {
+ resume: "Cmd+\\",
+ stepOver: "Cmd+'",
+ stepIn: "Cmd+;",
+ stepOut: "Cmd+Shift+:",
+ stepOutDisplay: "Cmd+Shift+;",
+ },
+ Linux: {
+ resume: "F8",
+ stepOver: "F10",
+ stepIn: "F11",
+ stepOut: "Shift+F11",
+ },
+};
+
+const LOG_METHODS = {
+ CONSOLE: "console",
+ STDOUT: "stdout",
+};
+
+function getKey(action) {
+ return getKeyForOS(Services.appinfo.OS, action);
+}
+
+function getKeyForOS(os, action) {
+ const osActions = KEYS[os] || KEYS.Linux;
+ return osActions[action];
+}
+
+function formatKey(action) {
+ const key = getKey(`${action}Display`) || getKey(action);
+ if (isMacOS) {
+ const winKey =
+ getKeyForOS("WINNT", `${action}Display`) || getKeyForOS("WINNT", action);
+ // display both Windows type and Mac specific keys
+ return formatKeyShortcut([key, winKey].join(" "));
+ }
+ return formatKeyShortcut(key);
+}
+
+class CommandBar extends Component {
+ constructor() {
+ super();
+
+ this.state = {};
+ }
+ static get propTypes() {
+ return {
+ breakOnNext: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ horizontal: PropTypes.bool.isRequired,
+ isPaused: PropTypes.bool.isRequired,
+ isTracingEnabled: PropTypes.bool.isRequired,
+ isWaitingOnBreak: PropTypes.bool.isRequired,
+ javascriptEnabled: PropTypes.bool.isRequired,
+ trace: PropTypes.func.isRequired,
+ resume: PropTypes.func.isRequired,
+ skipPausing: PropTypes.bool.isRequired,
+ stepIn: PropTypes.func.isRequired,
+ stepOut: PropTypes.func.isRequired,
+ stepOver: PropTypes.func.isRequired,
+ toggleEditorWrapping: PropTypes.func.isRequired,
+ toggleInlinePreview: PropTypes.func.isRequired,
+ toggleJavaScriptEnabled: PropTypes.func.isRequired,
+ toggleSkipPausing: PropTypes.any.isRequired,
+ toggleSourceMapsEnabled: PropTypes.func.isRequired,
+ topFrameSelected: PropTypes.bool.isRequired,
+ toggleTracing: PropTypes.func.isRequired,
+ logMethod: PropTypes.string.isRequired,
+ setJavascriptTracingLogMethod: PropTypes.func.isRequired,
+ setHideOrShowIgnoredSources: PropTypes.func.isRequired,
+ toggleSourceMapIgnoreList: PropTypes.func.isRequired,
+ };
+ }
+
+ componentWillUnmount() {
+ const { shortcuts } = this.context;
+
+ COMMANDS.forEach(action => shortcuts.off(getKey(action)));
+
+ if (isMacOS) {
+ COMMANDS.forEach(action => shortcuts.off(getKeyForOS("WINNT", action)));
+ }
+ }
+
+ componentDidMount() {
+ const { shortcuts } = this.context;
+
+ COMMANDS.forEach(action =>
+ shortcuts.on(getKey(action), e => this.handleEvent(e, action))
+ );
+
+ if (isMacOS) {
+ // The Mac supports both the Windows Function keys
+ // as well as the Mac non-Function keys
+ COMMANDS.forEach(action =>
+ shortcuts.on(getKeyForOS("WINNT", action), e =>
+ this.handleEvent(e, action)
+ )
+ );
+ }
+ }
+
+ handleEvent(e, action) {
+ const { cx } = this.props;
+ e.preventDefault();
+ e.stopPropagation();
+ if (action === "resume") {
+ this.props.isPaused ? this.props.resume() : this.props.breakOnNext(cx);
+ } else {
+ this.props[action](cx);
+ }
+ }
+
+ renderStepButtons() {
+ const { isPaused, topFrameSelected } = this.props;
+ const className = isPaused ? "active" : "disabled";
+ const isDisabled = !isPaused;
+
+ return [
+ this.renderTraceButton(),
+ this.renderPauseButton(),
+ debugBtn(
+ () => this.props.stepOver(),
+ "stepOver",
+ className,
+ L10N.getFormatStr("stepOverTooltip", formatKey("stepOver")),
+ isDisabled
+ ),
+ debugBtn(
+ () => this.props.stepIn(),
+ "stepIn",
+ className,
+ L10N.getFormatStr("stepInTooltip", formatKey("stepIn")),
+ isDisabled || !topFrameSelected
+ ),
+ debugBtn(
+ () => this.props.stepOut(),
+ "stepOut",
+ className,
+ L10N.getFormatStr("stepOutTooltip", formatKey("stepOut")),
+ isDisabled
+ ),
+ ];
+ }
+
+ resume() {
+ this.props.resume();
+ }
+
+ renderTraceButton() {
+ if (!features.javascriptTracing) {
+ return null;
+ }
+ // Display a button which:
+ // - on left click, would toggle on/off javascript tracing
+ // - on right click, would display a context menu allowing to choose the loggin output (console or stdout)
+ return (
+ <button
+ className={`devtools-button command-bar-button debugger-trace-menu-button ${
+ this.props.isTracingEnabled ? "active" : ""
+ }`}
+ title={
+ this.props.isTracingEnabled
+ ? L10N.getStr("stopTraceButtonTooltip")
+ : L10N.getFormatStr("startTraceButtonTooltip", this.props.logMethod)
+ }
+ onClick={event => {
+ this.props.toggleTracing(this.props.logMethod);
+ }}
+ onContextMenu={event => {
+ event.preventDefault();
+ event.stopPropagation();
+
+ // Avoid showing the menu to avoid having to support chaging tracing config "live"
+ if (this.props.isTracingEnabled) {
+ return;
+ }
+
+ const items = [
+ {
+ id: "debugger-trace-menu-item-console",
+ label: L10N.getStr("traceInWebConsole"),
+ checked: this.props.logMethod == LOG_METHODS.CONSOLE,
+ click: () => {
+ this.props.setJavascriptTracingLogMethod(LOG_METHODS.CONSOLE);
+ },
+ },
+ {
+ id: "debugger-trace-menu-item-stdout",
+ label: L10N.getStr("traceInStdout"),
+ checked: this.props.logMethod == LOG_METHODS.STDOUT,
+ click: () => {
+ this.props.setJavascriptTracingLogMethod(LOG_METHODS.STDOUT);
+ },
+ },
+ ];
+ showMenu(event, items);
+ }}
+ />
+ );
+ }
+
+ renderPauseButton() {
+ const { cx, breakOnNext, isWaitingOnBreak } = this.props;
+
+ if (this.props.isPaused) {
+ return debugBtn(
+ () => this.resume(),
+ "resume",
+ "active",
+ L10N.getFormatStr("resumeButtonTooltip", formatKey("resume"))
+ );
+ }
+
+ if (isWaitingOnBreak) {
+ return debugBtn(
+ null,
+ "pause",
+ "disabled",
+ L10N.getStr("pausePendingButtonTooltip"),
+ true
+ );
+ }
+
+ return debugBtn(
+ () => breakOnNext(cx),
+ "pause",
+ "active",
+ L10N.getFormatStr("pauseButtonTooltip", formatKey("resume"))
+ );
+ }
+
+ renderSkipPausingButton() {
+ const { skipPausing, toggleSkipPausing } = this.props;
+
+ return (
+ <button
+ className={classnames(
+ "command-bar-button",
+ "command-bar-skip-pausing",
+ {
+ active: skipPausing,
+ }
+ )}
+ title={
+ skipPausing
+ ? L10N.getStr("undoSkipPausingTooltip.label")
+ : L10N.getStr("skipPausingTooltip.label")
+ }
+ onClick={toggleSkipPausing}
+ >
+ <AccessibleImage
+ className={skipPausing ? "enable-pausing" : "disable-pausing"}
+ />
+ </button>
+ );
+ }
+
+ renderSettingsButton() {
+ const { toolboxDoc } = this.context;
+
+ return (
+ <MenuButton
+ menuId="debugger-settings-menu-button"
+ toolboxDoc={toolboxDoc}
+ className="devtools-button command-bar-button debugger-settings-menu-button"
+ title={L10N.getStr("settings.button.label")}
+ >
+ {() => this.renderSettingsMenuItems()}
+ </MenuButton>
+ );
+ }
+
+ renderSettingsMenuItems() {
+ return (
+ <MenuList id="debugger-settings-menu-list">
+ <MenuItem
+ key="debugger-settings-menu-item-disable-javascript"
+ className="menu-item debugger-settings-menu-item-disable-javascript"
+ checked={!this.props.javascriptEnabled}
+ label={L10N.getStr("settings.disableJavaScript.label")}
+ tooltip={L10N.getStr("settings.disableJavaScript.tooltip")}
+ onClick={() => {
+ this.props.toggleJavaScriptEnabled(!this.props.javascriptEnabled);
+ }}
+ />
+ <MenuItem
+ key="debugger-settings-menu-item-disable-inline-previews"
+ checked={features.inlinePreview}
+ label={L10N.getStr("inlinePreview.toggle.label")}
+ tooltip={L10N.getStr("inlinePreview.toggle.tooltip")}
+ onClick={() =>
+ this.props.toggleInlinePreview(!features.inlinePreview)
+ }
+ />
+ <MenuItem
+ key="debugger-settings-menu-item-disable-wrap-lines"
+ checked={prefs.editorWrapping}
+ label={L10N.getStr("editorWrapping.toggle.label")}
+ tooltip={L10N.getStr("editorWrapping.toggle.tooltip")}
+ onClick={() => this.props.toggleEditorWrapping(!prefs.editorWrapping)}
+ />
+ <MenuItem
+ key="debugger-settings-menu-item-disable-sourcemaps"
+ checked={prefs.clientSourceMapsEnabled}
+ label={L10N.getStr("settings.toggleSourceMaps.label")}
+ tooltip={L10N.getStr("settings.toggleSourceMaps.tooltip")}
+ onClick={() =>
+ this.props.toggleSourceMapsEnabled(!prefs.clientSourceMapsEnabled)
+ }
+ />
+ <MenuItem
+ key="debugger-settings-menu-item-hide-ignored-sources"
+ className="menu-item debugger-settings-menu-item-hide-ignored-sources"
+ checked={prefs.hideIgnoredSources}
+ label={L10N.getStr("settings.hideIgnoredSources.label")}
+ tooltip={L10N.getStr("settings.hideIgnoredSources.tooltip")}
+ onClick={() =>
+ this.props.setHideOrShowIgnoredSources(!prefs.hideIgnoredSources)
+ }
+ />
+ <MenuItem
+ key="debugger-settings-menu-item-enable-sourcemap-ignore-list"
+ className="menu-item debugger-settings-menu-item-enable-sourcemap-ignore-list"
+ checked={prefs.sourceMapIgnoreListEnabled}
+ label={L10N.getStr("settings.enableSourceMapIgnoreList.label")}
+ tooltip={L10N.getStr("settings.enableSourceMapIgnoreList.tooltip")}
+ onClick={() =>
+ this.props.toggleSourceMapIgnoreList(
+ this.props.cx,
+ !prefs.sourceMapIgnoreListEnabled
+ )
+ }
+ />
+ </MenuList>
+ );
+ }
+
+ render() {
+ return (
+ <div
+ className={classnames("command-bar", {
+ vertical: !this.props.horizontal,
+ })}
+ >
+ {this.renderStepButtons()}
+ <div className="filler" />
+ {this.renderSkipPausingButton()}
+ <div className="devtools-separator" />
+ {this.renderSettingsButton()}
+ </div>
+ );
+ }
+}
+
+CommandBar.contextTypes = {
+ shortcuts: PropTypes.object,
+ toolboxDoc: PropTypes.object,
+};
+
+const mapStateToProps = state => ({
+ cx: getThreadContext(state),
+ isWaitingOnBreak: getIsWaitingOnBreak(state, getCurrentThread(state)),
+ skipPausing: getSkipPausing(state),
+ topFrameSelected: isTopFrameSelected(state, getCurrentThread(state)),
+ javascriptEnabled: state.ui.javascriptEnabled,
+ isPaused: getIsCurrentThreadPaused(state),
+ isTracingEnabled: getIsThreadCurrentlyTracing(state, getCurrentThread(state)),
+ logMethod: getJavascriptTracingLogMethod(state),
+});
+
+export default connect(mapStateToProps, {
+ toggleTracing: actions.toggleTracing,
+ setJavascriptTracingLogMethod: actions.setJavascriptTracingLogMethod,
+ resume: actions.resume,
+ stepIn: actions.stepIn,
+ stepOut: actions.stepOut,
+ stepOver: actions.stepOver,
+ breakOnNext: actions.breakOnNext,
+ pauseOnExceptions: actions.pauseOnExceptions,
+ toggleSkipPausing: actions.toggleSkipPausing,
+ toggleInlinePreview: actions.toggleInlinePreview,
+ toggleEditorWrapping: actions.toggleEditorWrapping,
+ toggleSourceMapsEnabled: actions.toggleSourceMapsEnabled,
+ toggleJavaScriptEnabled: actions.toggleJavaScriptEnabled,
+ setHideOrShowIgnoredSources: actions.setHideOrShowIgnoredSources,
+ toggleSourceMapIgnoreList: actions.toggleSourceMapIgnoreList,
+})(CommandBar);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.css b/devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.css
new file mode 100644
index 0000000000..b525783984
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.css
@@ -0,0 +1,76 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+ .dom-mutation-empty {
+ padding: 6px 20px;
+ text-align: center;
+ font-style: italic;
+ color: var(--theme-body-color);
+ white-space: normal;
+ }
+
+ .dom-mutation-empty a {
+ text-decoration: underline;
+ color: var(--theme-toolbar-selected-color);
+ cursor: pointer;
+ }
+
+.dom-mutation-list * {
+ user-select: none;
+}
+
+.dom-mutation-list {
+ padding: 4px 0;
+ list-style-type: none;
+}
+
+.dom-mutation-list li {
+ position: relative;
+
+ display: flex;
+ align-items: start;
+ overflow: hidden;
+ padding-top: 2px;
+ padding-bottom: 2px;
+ padding-inline-start: 20px;
+ padding-inline-end: 12px;
+}
+
+.dom-mutation-list input {
+ margin: 2px 3px;
+
+ padding-inline-start: 2px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-inline-start: 0;
+ margin-inline-end: 2px;
+ vertical-align: text-bottom;
+}
+
+.dom-mutation-info {
+ flex-grow: 1;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ margin-inline-end: 20px;
+}
+
+.dom-mutation-list .close-btn {
+ position: absolute;
+ /* hide button outside of row until hovered or focused */
+ top: -100px;
+}
+
+/* Reveal the remove button on hover/focus */
+.dom-mutation-list li:hover .close-btn,
+.dom-mutation-list li .close-btn:focus {
+ top: calc(50% - 8px);
+}
+
+[dir="ltr"] .dom-mutation-list .close-btn {
+ right: 12px;
+}
+
+[dir="rtl"] .dom-mutation-list .close-btn {
+ left: 12px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.js b/devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.js
new file mode 100644
index 0000000000..375dad5563
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/DOMMutationBreakpoints.js
@@ -0,0 +1,175 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+
+import Reps from "devtools/client/shared/components/reps/index";
+const {
+ REPS: { Rep },
+ MODE,
+} = Reps;
+import { translateNodeFrontToGrip } from "inspector-shared-utils";
+
+import {
+ deleteDOMMutationBreakpoint,
+ toggleDOMMutationBreakpointState,
+} from "framework-actions";
+
+import actions from "../../actions";
+import { connect } from "../../utils/connect";
+
+import { CloseButton } from "../shared/Button";
+
+import "./DOMMutationBreakpoints.css";
+
+const localizationTerms = {
+ subtree: L10N.getStr("domMutationTypes.subtree"),
+ attribute: L10N.getStr("domMutationTypes.attribute"),
+ removal: L10N.getStr("domMutationTypes.removal"),
+};
+
+class DOMMutationBreakpointsContents extends Component {
+ static get propTypes() {
+ return {
+ breakpoints: PropTypes.array.isRequired,
+ deleteBreakpoint: PropTypes.func.isRequired,
+ highlightDomElement: PropTypes.func.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ openInspector: PropTypes.func.isRequired,
+ setSkipPausing: PropTypes.func.isRequired,
+ toggleBreakpoint: PropTypes.func.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ };
+ }
+
+ handleBreakpoint(breakpointId, shouldEnable) {
+ const { toggleBreakpoint, setSkipPausing } = this.props;
+
+ // The user has enabled a mutation breakpoint so we should no
+ // longer skip pausing
+ if (shouldEnable) {
+ setSkipPausing(false);
+ }
+ toggleBreakpoint(breakpointId, shouldEnable);
+ }
+
+ renderItem(breakpoint) {
+ const {
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ deleteBreakpoint,
+ } = this.props;
+ const { enabled, id: breakpointId, nodeFront, mutationType } = breakpoint;
+
+ return (
+ <li key={breakpoint.id}>
+ <input
+ type="checkbox"
+ checked={enabled}
+ onChange={() => this.handleBreakpoint(breakpointId, !enabled)}
+ />
+ <div className="dom-mutation-info">
+ <div className="dom-mutation-label">
+ {Rep({
+ object: translateNodeFrontToGrip(nodeFront),
+ mode: MODE.TINY,
+ onDOMNodeClick: () => openElementInInspector(nodeFront),
+ onInspectIconClick: () => openElementInInspector(nodeFront),
+ onDOMNodeMouseOver: () => highlightDomElement(nodeFront),
+ onDOMNodeMouseOut: () => unHighlightDomElement(),
+ })}
+ </div>
+ <div className="dom-mutation-type">
+ {localizationTerms[mutationType] || mutationType}
+ </div>
+ </div>
+ <CloseButton
+ handleClick={() => deleteBreakpoint(nodeFront, mutationType)}
+ />
+ </li>
+ );
+ }
+
+ /* eslint-disable react/no-danger */
+ renderEmpty() {
+ const { openInspector } = this.props;
+ const text = L10N.getFormatStr(
+ "noDomMutationBreakpoints",
+ `<a>${L10N.getStr("inspectorTool")}</a>`
+ );
+
+ return (
+ <div className="dom-mutation-empty">
+ <div
+ onClick={() => openInspector()}
+ dangerouslySetInnerHTML={{ __html: text }}
+ />
+ </div>
+ );
+ }
+
+ render() {
+ const { breakpoints } = this.props;
+
+ if (breakpoints.length === 0) {
+ return this.renderEmpty();
+ }
+
+ return (
+ <ul className="dom-mutation-list">
+ {breakpoints.map(breakpoint => this.renderItem(breakpoint))}
+ </ul>
+ );
+ }
+}
+
+const mapStateToProps = state => ({
+ breakpoints: state.domMutationBreakpoints.breakpoints,
+});
+
+const DOMMutationBreakpointsPanel = connect(
+ mapStateToProps,
+ {
+ deleteBreakpoint: deleteDOMMutationBreakpoint,
+ toggleBreakpoint: toggleDOMMutationBreakpointState,
+ },
+ undefined,
+ { storeKey: "toolbox-store" }
+)(DOMMutationBreakpointsContents);
+
+class DomMutationBreakpoints extends Component {
+ static get propTypes() {
+ return {
+ highlightDomElement: PropTypes.func.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ openInspector: PropTypes.func.isRequired,
+ setSkipPausing: PropTypes.func.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ };
+ }
+
+ render() {
+ return (
+ <DOMMutationBreakpointsPanel
+ openElementInInspector={this.props.openElementInInspector}
+ highlightDomElement={this.props.highlightDomElement}
+ unHighlightDomElement={this.props.unHighlightDomElement}
+ setSkipPausing={this.props.setSkipPausing}
+ openInspector={this.props.openInspector}
+ />
+ );
+ }
+}
+
+export default connect(undefined, {
+ // the debugger-specific action bound to the debugger store
+ // since there is no `storeKey`
+ openElementInInspector: actions.openElementInInspectorCommand,
+ highlightDomElement: actions.highlightDomElement,
+ unHighlightDomElement: actions.unHighlightDomElement,
+ setSkipPausing: actions.setSkipPausing,
+ openInspector: actions.openInspector,
+})(DomMutationBreakpoints);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.css b/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.css
new file mode 100644
index 0000000000..2ca0670367
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.css
@@ -0,0 +1,154 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.event-listeners-content {
+ padding-block: 4px;
+}
+
+.event-listeners-content ul {
+ padding: 0;
+ list-style-type: none;
+}
+
+.event-listeners-content button:hover,
+.event-listeners-content button:focus {
+ background: none;
+}
+
+.event-listener-group {
+ user-select: none;
+}
+
+.event-listener-header {
+ display: flex;
+ align-items: center;
+}
+
+.event-listener-expand {
+ border: none;
+ background: none;
+ padding: 4px 5px;
+ line-height: 12px;
+}
+
+.event-listener-expand:hover {
+ background: transparent;
+}
+
+.event-listener-group input[type="checkbox"] {
+ margin: 0;
+ margin-inline-end: 4px;
+}
+
+.event-listener-label {
+ display: flex;
+ align-items: center;
+ padding-inline-end: 10px;
+}
+
+.event-listener-category {
+ padding: 3px 0;
+ line-height: 14px;
+}
+
+.event-listeners-content .arrow {
+ margin-inline-end: 0;
+}
+
+.event-listeners-content .arrow.expanded {
+ transform: rotate(0deg);
+}
+
+.event-listeners-content .arrow.expanded:dir(rtl) {
+ transform: rotate(90deg);
+}
+
+.event-listeners-list {
+ border-block-start: 1px;
+ padding-inline: 18px 20px;
+}
+
+.event-listener-event {
+ display: flex;
+ align-items: center;
+}
+
+.event-listeners-list .event-listener-event {
+ margin-inline-start: 40px;
+}
+
+.event-search-results-list .event-listener-event {
+ padding-inline: 20px;
+}
+
+.event-listener-name {
+ line-height: 14px;
+ padding: 3px 0;
+}
+
+.event-listener-event input {
+ margin-inline: 0 4px;
+ margin-block: 0;
+}
+
+.event-search-container {
+ display: flex;
+ border: 1px solid transparent;
+ border-block-end: 1px solid var(--theme-splitter-color);
+}
+
+.event-search-form {
+ display: flex;
+ flex-grow: 1;
+}
+
+.event-search-input {
+ flex-grow: 1;
+ margin: 0;
+ font-size: inherit;
+ background-color: var(--theme-sidebar-background);
+ border: 0;
+ outline: 0;
+ height: 24px;
+ color: var(--theme-body-color);
+ background-image: url("chrome://devtools/skin/images/filter-small.svg");
+ background-position-x: 4px;
+ background-position-y: 50%;
+ background-repeat: no-repeat;
+ background-size: 12px;
+ -moz-context-properties: fill;
+ fill: var(--theme-icon-dimmed-color);
+ text-align: match-parent;
+}
+
+:root:dir(ltr) .event-search-input {
+ /* Be explicit about left/right direction to prevent the text/placeholder
+ * from overlapping the background image when the user changes the text
+ * direction manually (e.g. via Ctrl+Shift). */
+ padding-left: 19px;
+ padding-right: 12px;
+}
+
+:root:dir(rtl) .event-search-input {
+ background-position-x: right 4px;
+ padding-right: 19px;
+ padding-left: 12px;
+}
+
+.category-label {
+ color: var(--theme-comment);
+}
+
+.event-search-input::placeholder {
+ color: var(--theme-text-color-alt);
+ opacity: 1;
+}
+
+.event-search-container:focus-within {
+ border: 1px solid var(--theme-highlight-blue);
+}
+
+.devtools-searchinput-clear {
+ margin-inline-end: 8px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js b/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js
new file mode 100644
index 0000000000..8b7c9975b0
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js
@@ -0,0 +1,295 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+
+import { connect } from "../../utils/connect";
+import actions from "../../actions";
+import {
+ getActiveEventListeners,
+ getEventListenerBreakpointTypes,
+ getEventListenerExpanded,
+} from "../../selectors";
+
+import AccessibleImage from "../shared/AccessibleImage";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+import "./EventListeners.css";
+
+class EventListeners extends Component {
+ state = {
+ searchText: "",
+ focused: false,
+ };
+
+ static get propTypes() {
+ return {
+ activeEventListeners: PropTypes.array.isRequired,
+ addEventListenerExpanded: PropTypes.func.isRequired,
+ addEventListeners: PropTypes.func.isRequired,
+ categories: PropTypes.array.isRequired,
+ expandedCategories: PropTypes.array.isRequired,
+ removeEventListenerExpanded: PropTypes.func.isRequired,
+ removeEventListeners: PropTypes.func.isRequired,
+ };
+ }
+
+ hasMatch(eventOrCategoryName, searchText) {
+ const lowercaseEventOrCategoryName = eventOrCategoryName.toLowerCase();
+ const lowercaseSearchText = searchText.toLowerCase();
+
+ return lowercaseEventOrCategoryName.includes(lowercaseSearchText);
+ }
+
+ getSearchResults() {
+ const { searchText } = this.state;
+ const { categories } = this.props;
+ const searchResults = categories.reduce((results, cat, index) => {
+ const category = categories[index];
+
+ if (this.hasMatch(category.name, searchText)) {
+ results[category.name] = category.events;
+ } else {
+ results[category.name] = category.events.filter(event =>
+ this.hasMatch(event.name, searchText)
+ );
+ }
+
+ return results;
+ }, {});
+
+ return searchResults;
+ }
+
+ onCategoryToggle(category) {
+ const {
+ expandedCategories,
+ removeEventListenerExpanded,
+ addEventListenerExpanded,
+ } = this.props;
+
+ if (expandedCategories.includes(category)) {
+ removeEventListenerExpanded(category);
+ } else {
+ addEventListenerExpanded(category);
+ }
+ }
+
+ onCategoryClick(category, isChecked) {
+ const { addEventListeners, removeEventListeners } = this.props;
+ const eventsIds = category.events.map(event => event.id);
+
+ if (isChecked) {
+ addEventListeners(eventsIds);
+ } else {
+ removeEventListeners(eventsIds);
+ }
+ }
+
+ onEventTypeClick(eventId, isChecked) {
+ const { addEventListeners, removeEventListeners } = this.props;
+ if (isChecked) {
+ addEventListeners([eventId]);
+ } else {
+ removeEventListeners([eventId]);
+ }
+ }
+
+ onInputChange = event => {
+ this.setState({ searchText: event.currentTarget.value });
+ };
+
+ onKeyDown = event => {
+ if (event.key === "Escape") {
+ this.setState({ searchText: "" });
+ }
+ };
+
+ onFocus = event => {
+ this.setState({ focused: true });
+ };
+
+ onBlur = event => {
+ this.setState({ focused: false });
+ };
+
+ renderSearchInput() {
+ const { focused, searchText } = this.state;
+ const placeholder = L10N.getStr("eventListenersHeader1.placeholder");
+
+ return (
+ <form className="event-search-form" onSubmit={e => e.preventDefault()}>
+ <input
+ className={classnames("event-search-input", { focused })}
+ placeholder={placeholder}
+ value={searchText}
+ onChange={this.onInputChange}
+ onKeyDown={this.onKeyDown}
+ onFocus={this.onFocus}
+ onBlur={this.onBlur}
+ />
+ </form>
+ );
+ }
+
+ renderClearSearchButton() {
+ const { searchText } = this.state;
+
+ if (!searchText) {
+ return null;
+ }
+
+ return (
+ <button
+ onClick={() => this.setState({ searchText: "" })}
+ className="devtools-searchinput-clear"
+ />
+ );
+ }
+
+ renderCategoriesList() {
+ const { categories } = this.props;
+
+ return (
+ <ul className="event-listeners-list">
+ {categories.map((category, index) => {
+ return (
+ <li className="event-listener-group" key={index}>
+ {this.renderCategoryHeading(category)}
+ {this.renderCategoryListing(category)}
+ </li>
+ );
+ })}
+ </ul>
+ );
+ }
+
+ renderSearchResultsList() {
+ const searchResults = this.getSearchResults();
+
+ return (
+ <ul className="event-search-results-list">
+ {Object.keys(searchResults).map(category => {
+ return searchResults[category].map(event => {
+ return this.renderListenerEvent(event, category);
+ });
+ })}
+ </ul>
+ );
+ }
+
+ renderCategoryHeading(category) {
+ const { activeEventListeners, expandedCategories } = this.props;
+ const { events } = category;
+
+ const expanded = expandedCategories.includes(category.name);
+ const checked = events.every(({ id }) => activeEventListeners.includes(id));
+ const indeterminate =
+ !checked && events.some(({ id }) => activeEventListeners.includes(id));
+
+ return (
+ <div className="event-listener-header">
+ <button
+ className="event-listener-expand"
+ onClick={() => this.onCategoryToggle(category.name)}
+ >
+ <AccessibleImage className={classnames("arrow", { expanded })} />
+ </button>
+ <label className="event-listener-label">
+ <input
+ type="checkbox"
+ value={category.name}
+ onChange={e => {
+ this.onCategoryClick(
+ category,
+ // Clicking an indeterminate checkbox should always have the
+ // effect of disabling any selected items.
+ indeterminate ? false : e.target.checked
+ );
+ }}
+ checked={checked}
+ ref={el => el && (el.indeterminate = indeterminate)}
+ />
+ <span className="event-listener-category">{category.name}</span>
+ </label>
+ </div>
+ );
+ }
+
+ renderCategoryListing(category) {
+ const { expandedCategories } = this.props;
+
+ const expanded = expandedCategories.includes(category.name);
+ if (!expanded) {
+ return null;
+ }
+
+ return (
+ <ul>
+ {category.events.map(event => {
+ return this.renderListenerEvent(event, category.name);
+ })}
+ </ul>
+ );
+ }
+
+ renderCategory(category) {
+ return <span className="category-label">{category} ▸ </span>;
+ }
+
+ renderListenerEvent(event, category) {
+ const { activeEventListeners } = this.props;
+ const { searchText } = this.state;
+
+ return (
+ <li className="event-listener-event" key={event.id}>
+ <label className="event-listener-label">
+ <input
+ type="checkbox"
+ value={event.id}
+ onChange={e => this.onEventTypeClick(event.id, e.target.checked)}
+ checked={activeEventListeners.includes(event.id)}
+ />
+ <span className="event-listener-name">
+ {searchText ? this.renderCategory(category) : null}
+ {event.name}
+ </span>
+ </label>
+ </li>
+ );
+ }
+
+ render() {
+ const { searchText } = this.state;
+
+ return (
+ <div className="event-listeners">
+ <div className="event-search-container">
+ {this.renderSearchInput()}
+ {this.renderClearSearchButton()}
+ </div>
+ <div className="event-listeners-content">
+ {searchText
+ ? this.renderSearchResultsList()
+ : this.renderCategoriesList()}
+ </div>
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => ({
+ activeEventListeners: getActiveEventListeners(state),
+ categories: getEventListenerBreakpointTypes(state),
+ expandedCategories: getEventListenerExpanded(state),
+});
+
+export default connect(mapStateToProps, {
+ addEventListeners: actions.addEventListenerBreakpoints,
+ removeEventListeners: actions.removeEventListenerBreakpoints,
+ addEventListenerExpanded: actions.addEventListenerExpanded,
+ removeEventListenerExpanded: actions.removeEventListenerExpanded,
+})(EventListeners);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Expressions.css b/devtools/client/debugger/src/components/SecondaryPanes/Expressions.css
new file mode 100644
index 0000000000..c4291c80ff
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Expressions.css
@@ -0,0 +1,175 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.expression-input-form {
+ width: 100%;
+}
+
+.input-expression {
+ width: 100%;
+ margin: 0;
+ font-size: inherit;
+ border: 1px;
+ background-color: var(--theme-sidebar-background);
+ height: 24px;
+ padding-inline-start: 19px;
+ padding-inline-end: 12px;
+ color: var(--theme-body-color);
+ outline: 0;
+}
+
+@keyframes shake {
+ 0%,
+ 100% {
+ transform: translateX(0);
+ }
+ 20%,
+ 60% {
+ transform: translateX(-10px);
+ }
+ 40%,
+ 80% {
+ transform: translateX(10px);
+ }
+}
+
+.input-expression::placeholder {
+ color: var(--theme-text-color-alt);
+ opacity: 1;
+}
+
+.input-expression:focus {
+ cursor: text;
+}
+
+.expressions-list .expression-input-container {
+ height: var(--expression-item-height);
+}
+
+.expressions-list .input-expression {
+ /* Prevent vertical bounce when editing an existing Watch Expression */
+ height: 100%;
+}
+
+.expressions-list {
+ /* TODO: add normalize */
+ margin: 0;
+ padding: 4px 0px;
+ overflow-x: auto;
+}
+
+.expression-input-container {
+ display: flex;
+ border: 1px solid transparent;
+}
+
+.expression-input-container.focused {
+ border: 1px solid var(--theme-highlight-blue);
+}
+
+:root.theme-dark .expression-input-container.focused {
+ border: 1px solid var(--blue-50);
+}
+
+.expression-input-container.error {
+ border: 1px solid red;
+}
+
+.expression-container {
+ padding-top: 3px;
+ padding-bottom: 3px;
+ padding-inline-start: 20px;
+ padding-inline-end: 12px;
+ width: 100%;
+ color: var(--theme-body-color);
+ background-color: var(--theme-body-background);
+ display: block;
+ position: relative;
+ overflow: hidden;
+}
+
+.expression-container > .tree {
+ width: 100%;
+ overflow: hidden;
+}
+
+.expression-container .tree .tree-node[aria-level="1"] {
+ padding-top: 0px;
+ /* keep line-height at 14px to prevent row from shifting upon expansion */
+ line-height: 14px;
+}
+
+.expression-container .tree-node[aria-level="1"] .object-label {
+ font-family: var(--monospace-font-family);
+}
+
+:root.theme-light .expression-container:hover {
+ background-color: var(--search-overlays-semitransparent);
+}
+
+:root.theme-dark .expression-container:hover {
+ background-color: var(--search-overlays-semitransparent);
+}
+
+.tree .tree-node:not(.focused):hover {
+ background-color: transparent;
+}
+
+.expression-container__close-btn {
+ position: absolute;
+ /* hiding button outside of row until hovered or focused */
+ top: -100px;
+}
+
+.expression-container:hover .expression-container__close-btn,
+.expression-container:focus-within .expression-container__close-btn,
+.expression-container__close-btn:focus-within {
+ top: 0;
+}
+
+.expression-content .object-node {
+ padding-inline-start: 0px;
+ cursor: default;
+}
+
+.expressions-list .tree.object-inspector .node.object-node {
+ max-width: calc(100% - 20px);
+ min-width: 0;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.expression-container__close-btn {
+ max-height: 16px;
+ padding-inline-start: 4px;
+}
+
+[dir="ltr"] .expression-container__close-btn {
+ right: 0;
+}
+
+[dir="rtl"] .expression-container__close-btn {
+ left: 0;
+}
+
+.expression-content {
+ display: flex;
+ align-items: center;
+ flex-grow: 1;
+ position: relative;
+}
+
+.expression-content .tree {
+ overflow: hidden;
+ flex-grow: 1;
+ line-height: 15px;
+}
+
+.expression-content .tree-node[data-expandable="false"][aria-level="1"] {
+ padding-inline-start: 0px;
+}
+
+.input-expression:not(:placeholder-shown) {
+ font-family: var(--monospace-font-family);
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Expressions.js b/devtools/client/debugger/src/components/SecondaryPanes/Expressions.js
new file mode 100644
index 0000000000..308e6d4de5
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Expressions.js
@@ -0,0 +1,395 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import { features } from "../../utils/prefs";
+
+import { objectInspector } from "devtools/client/shared/components/reps/index";
+
+import actions from "../../actions";
+import {
+ getExpressions,
+ getExpressionError,
+ getAutocompleteMatchset,
+ getThreadContext,
+} from "../../selectors";
+import { getExpressionResultGripAndFront } from "../../utils/expressions";
+
+import { CloseButton } from "../shared/Button";
+
+import "./Expressions.css";
+
+const { debounce } = require("devtools/shared/debounce");
+const classnames = require("devtools/client/shared/classnames.js");
+
+const { ObjectInspector } = objectInspector;
+
+class Expressions extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ editing: false,
+ editIndex: -1,
+ inputValue: "",
+ focused: false,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ addExpression: PropTypes.func.isRequired,
+ autocomplete: PropTypes.func.isRequired,
+ autocompleteMatches: PropTypes.array,
+ clearAutocomplete: PropTypes.func.isRequired,
+ clearExpressionError: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ deleteExpression: PropTypes.func.isRequired,
+ expressionError: PropTypes.bool.isRequired,
+ expressions: PropTypes.array.isRequired,
+ highlightDomElement: PropTypes.func.isRequired,
+ onExpressionAdded: PropTypes.func.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ openLink: PropTypes.any.isRequired,
+ showInput: PropTypes.bool.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ updateExpression: PropTypes.func.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ const { showInput } = this.props;
+
+ // Ensures that the input is focused when the "+"
+ // is clicked while the panel is collapsed
+ if (showInput && this._input) {
+ this._input.focus();
+ }
+ }
+
+ clear = () => {
+ this.setState(() => {
+ this.props.clearExpressionError();
+ return { editing: false, editIndex: -1, inputValue: "", focused: false };
+ });
+ };
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ if (this.state.editing && !nextProps.expressionError) {
+ this.clear();
+ }
+
+ // Ensures that the add watch expression input
+ // is no longer visible when the new watch expression is rendered
+ if (this.props.expressions.length < nextProps.expressions.length) {
+ this.hideInput();
+ }
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ const { editing, inputValue, focused } = this.state;
+ const { expressions, expressionError, showInput, autocompleteMatches } =
+ this.props;
+
+ return (
+ autocompleteMatches !== nextProps.autocompleteMatches ||
+ expressions !== nextProps.expressions ||
+ expressionError !== nextProps.expressionError ||
+ editing !== nextState.editing ||
+ inputValue !== nextState.inputValue ||
+ nextProps.showInput !== showInput ||
+ focused !== nextState.focused
+ );
+ }
+
+ componentDidUpdate(prevProps, prevState) {
+ const input = this._input;
+
+ if (!input) {
+ return;
+ }
+
+ if (!prevState.editing && this.state.editing) {
+ input.setSelectionRange(0, input.value.length);
+ input.focus();
+ } else if (this.props.showInput && !this.state.focused) {
+ input.focus();
+ }
+ }
+
+ editExpression(expression, index) {
+ this.setState({
+ inputValue: expression.input,
+ editing: true,
+ editIndex: index,
+ });
+ }
+
+ deleteExpression(e, expression) {
+ e.stopPropagation();
+ const { deleteExpression } = this.props;
+ deleteExpression(expression);
+ }
+
+ handleChange = e => {
+ const { target } = e;
+ if (features.autocompleteExpression) {
+ this.findAutocompleteMatches(target.value, target.selectionStart);
+ }
+ this.setState({ inputValue: target.value });
+ };
+
+ findAutocompleteMatches = debounce((value, selectionStart) => {
+ const { autocomplete } = this.props;
+ autocomplete(this.props.cx, value, selectionStart);
+ }, 250);
+
+ handleKeyDown = e => {
+ if (e.key === "Escape") {
+ this.clear();
+ }
+ };
+
+ hideInput = () => {
+ this.setState({ focused: false });
+ this.props.onExpressionAdded();
+ this.props.clearExpressionError();
+ };
+
+ createElement = element => {
+ return document.createElement(element);
+ };
+
+ onFocus = () => {
+ this.setState({ focused: true });
+ };
+
+ onBlur() {
+ this.clear();
+ this.hideInput();
+ }
+
+ handleExistingSubmit = async (e, expression) => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ this.props.updateExpression(
+ this.props.cx,
+ this.state.inputValue,
+ expression
+ );
+ };
+
+ handleNewSubmit = async e => {
+ const { inputValue } = this.state;
+ e.preventDefault();
+ e.stopPropagation();
+
+ this.props.clearExpressionError();
+ await this.props.addExpression(this.props.cx, this.state.inputValue);
+ this.setState({
+ editing: false,
+ editIndex: -1,
+ inputValue: this.props.expressionError ? inputValue : "",
+ });
+
+ this.props.clearAutocomplete();
+ };
+
+ renderExpression = (expression, index) => {
+ const {
+ expressionError,
+ openLink,
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ } = this.props;
+
+ const { editing, editIndex } = this.state;
+ const { input, updating } = expression;
+ const isEditingExpr = editing && editIndex === index;
+ if (isEditingExpr || (isEditingExpr && expressionError)) {
+ return this.renderExpressionEditInput(expression);
+ }
+
+ if (updating) {
+ return null;
+ }
+
+ const { expressionResultGrip, expressionResultFront } =
+ getExpressionResultGripAndFront(expression);
+
+ const root = {
+ name: expression.input,
+ path: input,
+ contents: {
+ value: expressionResultGrip,
+ front: expressionResultFront,
+ },
+ };
+
+ return (
+ <li className="expression-container" key={input} title={expression.input}>
+ <div className="expression-content">
+ <ObjectInspector
+ roots={[root]}
+ autoExpandDepth={0}
+ disableWrap={true}
+ openLink={openLink}
+ createElement={this.createElement}
+ onDoubleClick={(items, { depth }) => {
+ if (depth === 0) {
+ this.editExpression(expression, index);
+ }
+ }}
+ onDOMNodeClick={grip => openElementInInspector(grip)}
+ onInspectIconClick={grip => openElementInInspector(grip)}
+ onDOMNodeMouseOver={grip => highlightDomElement(grip)}
+ onDOMNodeMouseOut={grip => unHighlightDomElement(grip)}
+ shouldRenderTooltip={true}
+ mayUseCustomFormatter={true}
+ />
+ <div className="expression-container__close-btn">
+ <CloseButton
+ handleClick={e => this.deleteExpression(e, expression)}
+ tooltip={L10N.getStr("expressions.remove.tooltip")}
+ />
+ </div>
+ </div>
+ </li>
+ );
+ };
+
+ renderExpressions() {
+ const { expressions, showInput } = this.props;
+
+ return (
+ <>
+ <ul className="pane expressions-list">
+ {expressions.map(this.renderExpression)}
+ </ul>
+ {showInput && this.renderNewExpressionInput()}
+ </>
+ );
+ }
+
+ renderAutoCompleteMatches() {
+ if (!features.autocompleteExpression) {
+ return null;
+ }
+ const { autocompleteMatches } = this.props;
+ if (autocompleteMatches) {
+ return (
+ <datalist id="autocomplete-matches">
+ {autocompleteMatches.map((match, index) => {
+ return <option key={index} value={match} />;
+ })}
+ </datalist>
+ );
+ }
+ return <datalist id="autocomplete-matches" />;
+ }
+
+ renderNewExpressionInput() {
+ const { expressionError } = this.props;
+ const { editing, inputValue, focused } = this.state;
+ const error = editing === false && expressionError === true;
+ const placeholder = error
+ ? L10N.getStr("expressions.errorMsg")
+ : L10N.getStr("expressions.placeholder");
+
+ return (
+ <form
+ className={classnames(
+ "expression-input-container expression-input-form",
+ { focused, error }
+ )}
+ onSubmit={this.handleNewSubmit}
+ >
+ <input
+ className="input-expression"
+ type="text"
+ placeholder={placeholder}
+ onChange={this.handleChange}
+ onBlur={this.hideInput}
+ onKeyDown={this.handleKeyDown}
+ onFocus={this.onFocus}
+ value={!editing ? inputValue : ""}
+ ref={c => (this._input = c)}
+ {...(features.autocompleteExpression && {
+ list: "autocomplete-matches",
+ })}
+ />
+ {this.renderAutoCompleteMatches()}
+ <input type="submit" style={{ display: "none" }} />
+ </form>
+ );
+ }
+
+ renderExpressionEditInput(expression) {
+ const { expressionError } = this.props;
+ const { inputValue, editing, focused } = this.state;
+ const error = editing === true && expressionError === true;
+
+ return (
+ <form
+ key={expression.input}
+ className={classnames(
+ "expression-input-container expression-input-form",
+ { focused, error }
+ )}
+ onSubmit={e => this.handleExistingSubmit(e, expression)}
+ >
+ <input
+ className={classnames("input-expression", { error })}
+ type="text"
+ onChange={this.handleChange}
+ onBlur={this.clear}
+ onKeyDown={this.handleKeyDown}
+ onFocus={this.onFocus}
+ value={editing ? inputValue : expression.input}
+ ref={c => (this._input = c)}
+ {...(features.autocompleteExpression && {
+ list: "autocomplete-matches",
+ })}
+ />
+ {this.renderAutoCompleteMatches()}
+ <input type="submit" style={{ display: "none" }} />
+ </form>
+ );
+ }
+
+ render() {
+ const { expressions } = this.props;
+
+ if (expressions.length === 0) {
+ return this.renderNewExpressionInput();
+ }
+
+ return this.renderExpressions();
+ }
+}
+
+const mapStateToProps = state => ({
+ cx: getThreadContext(state),
+ autocompleteMatches: getAutocompleteMatchset(state),
+ expressions: getExpressions(state),
+ expressionError: getExpressionError(state),
+});
+
+export default connect(mapStateToProps, {
+ autocomplete: actions.autocomplete,
+ clearAutocomplete: actions.clearAutocomplete,
+ addExpression: actions.addExpression,
+ clearExpressionError: actions.clearExpressionError,
+ updateExpression: actions.updateExpression,
+ deleteExpression: actions.deleteExpression,
+ openLink: actions.openLink,
+ openElementInInspector: actions.openElementInInspectorCommand,
+ highlightDomElement: actions.highlightDomElement,
+ unHighlightDomElement: actions.unHighlightDomElement,
+})(Expressions);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js
new file mode 100644
index 0000000000..4ea94df95d
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js
@@ -0,0 +1,197 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component, memo } from "react";
+import PropTypes from "prop-types";
+
+import AccessibleImage from "../../shared/AccessibleImage";
+import { formatDisplayName } from "../../../utils/pause/frames";
+import { getFilename, getFileURL } from "../../../utils/source";
+import FrameMenu from "./FrameMenu";
+import FrameIndent from "./FrameIndent";
+const classnames = require("devtools/client/shared/classnames.js");
+
+function FrameTitle({ frame, options = {}, l10n }) {
+ const displayName = formatDisplayName(frame, options, l10n);
+ return <span className="title">{displayName}</span>;
+}
+
+FrameTitle.propTypes = {
+ frame: PropTypes.object.isRequired,
+ options: PropTypes.object.isRequired,
+ l10n: PropTypes.object.isRequired,
+};
+
+const FrameLocation = memo(({ frame, displayFullUrl = false }) => {
+ if (!frame.source) {
+ return null;
+ }
+
+ if (frame.library) {
+ return (
+ <span className="location">
+ {frame.library}
+ <AccessibleImage
+ className={`annotation-logo ${frame.library.toLowerCase()}`}
+ />
+ </span>
+ );
+ }
+
+ const { location, source } = frame;
+ const filename = displayFullUrl
+ ? getFileURL(source, false)
+ : getFilename(source);
+
+ return (
+ <span className="location" title={source.url}>
+ <span className="filename">{filename}</span>:
+ <span className="line">{location.line}</span>
+ </span>
+ );
+});
+
+FrameLocation.displayName = "FrameLocation";
+
+FrameLocation.propTypes = {
+ frame: PropTypes.object.isRequired,
+ displayFullUrl: PropTypes.bool.isRequired,
+};
+
+export default class FrameComponent extends Component {
+ static defaultProps = {
+ hideLocation: false,
+ shouldMapDisplayName: true,
+ disableContextMenu: false,
+ };
+
+ static get propTypes() {
+ return {
+ copyStackTrace: PropTypes.func.isRequired,
+ cx: PropTypes.object,
+ disableContextMenu: PropTypes.bool.isRequired,
+ displayFullUrl: PropTypes.bool.isRequired,
+ frame: PropTypes.object.isRequired,
+ frameworkGroupingOn: PropTypes.bool.isRequired,
+ getFrameTitle: PropTypes.func,
+ hideLocation: PropTypes.bool.isRequired,
+ panel: PropTypes.oneOf(["debugger", "webconsole"]).isRequired,
+ restart: PropTypes.func,
+ selectFrame: PropTypes.func.isRequired,
+ selectedFrame: PropTypes.object,
+ shouldMapDisplayName: PropTypes.bool.isRequired,
+ toggleBlackBox: PropTypes.func,
+ toggleFrameworkGrouping: PropTypes.func.isRequired,
+ };
+ }
+
+ get isSelectable() {
+ return this.props.panel == "webconsole";
+ }
+
+ get isDebugger() {
+ return this.props.panel == "debugger";
+ }
+
+ onContextMenu(event) {
+ const {
+ frame,
+ copyStackTrace,
+ toggleFrameworkGrouping,
+ toggleBlackBox,
+ frameworkGroupingOn,
+ cx,
+ restart,
+ } = this.props;
+ FrameMenu(
+ frame,
+ frameworkGroupingOn,
+ { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox, restart },
+ event,
+ cx
+ );
+ }
+
+ onMouseDown(e, frame, selectedFrame) {
+ if (e.button !== 0) {
+ return;
+ }
+
+ this.props.selectFrame(this.props.cx, frame);
+ }
+
+ onKeyUp(event, frame, selectedFrame) {
+ if (event.key != "Enter") {
+ return;
+ }
+
+ this.props.selectFrame(this.props.cx, frame);
+ }
+
+ render() {
+ const {
+ frame,
+ selectedFrame,
+ hideLocation,
+ shouldMapDisplayName,
+ displayFullUrl,
+ getFrameTitle,
+ disableContextMenu,
+ } = this.props;
+ const { l10n } = this.context;
+
+ const className = classnames("frame", {
+ selected: selectedFrame && selectedFrame.id === frame.id,
+ });
+
+ if (!frame.source) {
+ throw new Error("no frame source");
+ }
+
+ const title = getFrameTitle
+ ? getFrameTitle(
+ `${getFileURL(frame.source, false)}:${frame.location.line}`
+ )
+ : undefined;
+
+ return (
+ <div
+ role="listitem"
+ key={frame.id}
+ className={className}
+ onMouseDown={e => this.onMouseDown(e, frame, selectedFrame)}
+ onKeyUp={e => this.onKeyUp(e, frame, selectedFrame)}
+ onContextMenu={disableContextMenu ? null : e => this.onContextMenu(e)}
+ tabIndex={0}
+ title={title}
+ >
+ {frame.asyncCause && (
+ <span className="location-async-cause">
+ {this.isSelectable && <FrameIndent />}
+ {this.isDebugger ? (
+ <span className="async-label">{frame.asyncCause}</span>
+ ) : (
+ l10n.getFormatStr("stacktrace.asyncStack", frame.asyncCause)
+ )}
+ {this.isSelectable && <br className="clipboard-only" />}
+ </span>
+ )}
+ {this.isSelectable && <FrameIndent />}
+ <FrameTitle
+ frame={frame}
+ options={{ shouldMapDisplayName }}
+ l10n={l10n}
+ />
+ {!hideLocation && <span className="clipboard-only"> </span>}
+ {!hideLocation && (
+ <FrameLocation frame={frame} displayFullUrl={displayFullUrl} />
+ )}
+ {this.isSelectable && <br className="clipboard-only" />}
+ </div>
+ );
+ }
+}
+
+FrameComponent.displayName = "Frame";
+FrameComponent.contextTypes = { l10n: PropTypes.object };
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js
new file mode 100644
index 0000000000..55eb5da08a
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js
@@ -0,0 +1,13 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+
+export default function FrameIndent() {
+ return (
+ <span className="frame-indent clipboard-only">
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ );
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameMenu.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameMenu.js
new file mode 100644
index 0000000000..a92db936ba
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameMenu.js
@@ -0,0 +1,105 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import { showMenu } from "../../../context-menu/menu";
+import { copyToTheClipboard } from "../../../utils/clipboard";
+
+const blackboxString = "ignoreContextItem.ignore";
+const unblackboxString = "ignoreContextItem.unignore";
+
+function formatMenuElement(labelString, click, disabled = false) {
+ const label = L10N.getStr(labelString);
+ const accesskey = L10N.getStr(`${labelString}.accesskey`);
+ const id = `node-menu-${labelString}`;
+ return {
+ id,
+ label,
+ accesskey,
+ disabled,
+ click,
+ };
+}
+
+function copySourceElement(url) {
+ return formatMenuElement("copySourceUri2", () => copyToTheClipboard(url));
+}
+
+function copyStackTraceElement(copyStackTrace) {
+ return formatMenuElement("copyStackTrace", () => copyStackTrace());
+}
+
+function toggleFrameworkGroupingElement(
+ toggleFrameworkGrouping,
+ frameworkGroupingOn
+) {
+ const actionType = frameworkGroupingOn
+ ? "framework.disableGrouping"
+ : "framework.enableGrouping";
+
+ return formatMenuElement(actionType, () => toggleFrameworkGrouping());
+}
+
+function blackBoxSource(cx, source, toggleBlackBox) {
+ const toggleBlackBoxString = source.isBlackBoxed
+ ? unblackboxString
+ : blackboxString;
+
+ return formatMenuElement(toggleBlackBoxString, () =>
+ toggleBlackBox(cx, source)
+ );
+}
+
+function restartFrame(cx, frame, restart) {
+ return formatMenuElement("restartFrame", () => restart(cx, frame));
+}
+
+function isValidRestartFrame(frame, callbacks) {
+ // Hides 'Restart Frame' item for call stack groups context menu,
+ // otherwise can be misleading for the user which frame gets restarted.
+ if (!callbacks.restart) {
+ return false;
+ }
+
+ // Any frame state than 'on-stack' is either dismissed by the server
+ // or can potentially cause unexpected errors.
+ // Global frame has frame.callee equal to null and can't be restarted.
+ return frame.type === "call" && frame.state === "on-stack";
+}
+
+export default function FrameMenu(
+ frame,
+ frameworkGroupingOn,
+ callbacks,
+ event,
+ cx
+) {
+ event.stopPropagation();
+ event.preventDefault();
+
+ const menuOptions = [];
+
+ if (isValidRestartFrame(frame, callbacks)) {
+ const restartFrameItem = restartFrame(cx, frame, callbacks.restart);
+ menuOptions.push(restartFrameItem);
+ }
+
+ const toggleFrameworkElement = toggleFrameworkGroupingElement(
+ callbacks.toggleFrameworkGrouping,
+ frameworkGroupingOn
+ );
+ menuOptions.push(toggleFrameworkElement);
+
+ const { source } = frame;
+ if (source) {
+ const copySourceUri2 = copySourceElement(source.url);
+ menuOptions.push(copySourceUri2);
+ menuOptions.push(blackBoxSource(cx, source, callbacks.toggleBlackBox));
+ }
+
+ const copyStackTraceItem = copyStackTraceElement(callbacks.copyStackTrace);
+
+ menuOptions.push(copyStackTraceItem);
+
+ showMenu(event, menuOptions);
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css
new file mode 100644
index 0000000000..5f57f97e51
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css
@@ -0,0 +1,185 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.frames [role="list"] {
+ list-style: none;
+ margin: 0;
+ padding: 4px 0;
+}
+
+.frames [role="list"] [role="listitem"] {
+ padding-bottom: 2px;
+ overflow: hidden;
+ display: flex;
+ justify-content: space-between;
+ column-gap: 0.5em;
+ flex-direction: row;
+ align-items: center;
+ margin: 0;
+ max-width: 100%;
+ flex-wrap: wrap;
+}
+
+.frames [role="list"] [role="listitem"] * {
+ user-select: none;
+}
+
+.frames .badge {
+ flex-shrink: 0;
+ margin-inline-end: 10px;
+}
+
+.frames .location {
+ font-weight: normal;
+ margin: 0;
+ flex-grow: 1;
+ max-width: 100%;
+ overflow: hidden;
+ white-space: nowrap;
+ /* Trick to get the ellipsis at the start of the string */
+ text-overflow: ellipsis;
+ direction: rtl;
+}
+
+.call-stack-pane:dir(ltr) .frames .location {
+ padding-right: 10px;
+ text-align: right;
+}
+
+.call-stack-pane:dir(rtl) .frames .location {
+ padding-left: 10px;
+ text-align: left;
+}
+
+.call-stack-pane .location-async-cause {
+ color: var(--theme-comment);
+}
+
+.theme-light .frames .location {
+ color: var(--theme-comment);
+}
+
+:root.theme-dark .frames .location {
+ color: var(--theme-body-color);
+ opacity: 0.6;
+}
+
+.frames .title {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ padding-inline-start: 10px;
+}
+
+.frames-group .title {
+ padding-inline-start: 40px;
+}
+
+.frames [role="list"] [role="listitem"]:hover,
+.frames [role="list"] [role="listitem"]:focus {
+ background-color: var(--theme-toolbar-background-alt);
+}
+
+.frames [role="list"] [role="listitem"]:hover .location-async-cause,
+.frames [role="list"] [role="listitem"]:focus .location-async-cause,
+.frames [role="list"] [role="listitem"]:hover .async-label,
+.frames [role="list"] [role="listitem"]:focus .async-label {
+ background-color: var(--theme-body-background);
+}
+
+.theme-dark .frames [role="list"] [role="listitem"]:focus,
+.theme-dark .frames [role="list"] [role="listitem"]:focus .async-label,
+.theme-dark .frames [role="list"] [role="listitem"]:focus .async-label {
+ background-color: var(--theme-tab-toolbar-background);
+}
+
+.frames [role="list"] [role="listitem"].selected,
+.frames [role="list"] [role="listitem"].selected .async-label {
+ background-color: var(--theme-selection-background);
+ color: white;
+}
+
+.frames [role="list"] [role="listitem"].selected i.annotation-logo svg path {
+ fill: white;
+}
+
+:root.theme-light .frames [role="list"] [role="listitem"].selected .location,
+:root.theme-dark .frames [role="list"] [role="listitem"].selected .location {
+ color: white;
+}
+
+.frames .show-more-container {
+ display: flex;
+ min-height: 24px;
+ padding: 4px 0;
+}
+
+.frames .show-more {
+ text-align: center;
+ padding: 8px 0px;
+ margin: 7px 10px 7px 7px;
+ border: 1px solid var(--theme-splitter-color);
+ background-color: var(--theme-tab-toolbar-background);
+ width: 100%;
+ font-size: inherit;
+ color: inherit;
+}
+
+.frames .show-more:hover {
+ background-color: var(--theme-toolbar-background-hover);
+}
+
+.frames .img.annotation-logo {
+ margin-inline-end: 4px;
+ background-color: currentColor;
+}
+
+/*
+ * We also show the library icon in locations, which are forced to RTL.
+ */
+.frames .location .img.annotation-logo {
+ margin-inline-start: 4px;
+}
+
+/* Some elements are added to the DOM only to be printed into the clipboard
+ when the user copy some elements. We don't want those elements to mess with
+ the layout so we put them outside of the screen
+*/
+.frames .clipboard-only {
+ position: absolute;
+ left: -9999px;
+}
+
+.call-stack-pane [role="listitem"] .location-async-cause {
+ height: 20px;
+ line-height: 20px;
+ color: var(--theme-icon-dimmed-color);
+ display: block;
+ z-index: 4;
+ position: relative;
+ padding-inline-start: 17px;
+ width: 100%;
+ pointer-events: none;
+}
+
+.frames-group .location-async-cause {
+ padding-inline-start: 47px;
+}
+
+.call-stack-pane [role="listitem"] .location-async-cause::after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ z-index: -1;
+ height: 30px;
+ top: 50%;
+ width: 100%;
+ border-top: 1px solid var(--theme-tab-toolbar-background);;
+}
+
+.call-stack-pane .async-label {
+ z-index: 1;
+ background-color: var(--theme-sidebar-background);
+ padding: 0 3px;
+ display: inline-block;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.css b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.css
new file mode 100644
index 0000000000..14dbea9954
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.css
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.frames-group .group,
+.frames-group .group .location {
+ font-weight: 500;
+ cursor: default;
+ /*
+ * direction:rtl is set in Frames.css to overflow the location text from the
+ * start. Here we need to reset it in order to display the framework icon
+ * after the framework name.
+ */
+ direction: ltr;
+}
+
+.frames-group.expanded .group,
+.frames-group.expanded .group .location {
+ color: var(--theme-highlight-blue);
+}
+
+.frames-group .frames-list {
+ border-top: 1px solid var(--theme-splitter-color);
+ border-bottom: 1px solid var(--theme-splitter-color);
+}
+
+.frames-group.expanded .badge {
+ color: var(--theme-highlight-blue);
+}
+
+.frames-group .img.arrow {
+ margin-inline-start: -1px;
+ margin-inline-end: 4px;
+}
+
+.frames-group .group-description {
+ padding-inline-start: 6px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.js
new file mode 100644
index 0000000000..162c89a2a6
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Group.js
@@ -0,0 +1,197 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+
+import { getLibraryFromUrl } from "../../../utils/pause/frames";
+
+import FrameMenu from "./FrameMenu";
+import AccessibleImage from "../../shared/AccessibleImage";
+import FrameComponent from "./Frame";
+
+import "./Group.css";
+
+import Badge from "../../shared/Badge";
+import FrameIndent from "./FrameIndent";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+function FrameLocation({ frame, expanded }) {
+ const library = frame.library || getLibraryFromUrl(frame);
+ if (!library) {
+ return null;
+ }
+
+ const arrowClassName = classnames("arrow", { expanded });
+ return (
+ <span className="group-description">
+ <AccessibleImage className={arrowClassName} />
+ <AccessibleImage className={`annotation-logo ${library.toLowerCase()}`} />
+ <span className="group-description-name">{library}</span>
+ </span>
+ );
+}
+
+FrameLocation.propTypes = {
+ expanded: PropTypes.any.isRequired,
+ frame: PropTypes.object.isRequired,
+};
+
+FrameLocation.displayName = "FrameLocation";
+
+export default class Group extends Component {
+ constructor(...args) {
+ super(...args);
+ this.state = { expanded: false };
+ }
+
+ static get propTypes() {
+ return {
+ copyStackTrace: PropTypes.func.isRequired,
+ cx: PropTypes.object,
+ disableContextMenu: PropTypes.bool.isRequired,
+ displayFullUrl: PropTypes.bool.isRequired,
+ frameworkGroupingOn: PropTypes.bool.isRequired,
+ getFrameTitle: PropTypes.func,
+ group: PropTypes.array.isRequired,
+ panel: PropTypes.oneOf(["debugger", "webconsole"]).isRequired,
+ restart: PropTypes.func,
+ selectFrame: PropTypes.func.isRequired,
+ selectLocation: PropTypes.func,
+ selectedFrame: PropTypes.object,
+ toggleBlackBox: PropTypes.func,
+ toggleFrameworkGrouping: PropTypes.func.isRequired,
+ };
+ }
+
+ get isSelectable() {
+ return this.props.panel == "webconsole";
+ }
+
+ onContextMenu(event) {
+ const {
+ group,
+ copyStackTrace,
+ toggleFrameworkGrouping,
+ toggleBlackBox,
+ frameworkGroupingOn,
+ cx,
+ } = this.props;
+ const frame = group[0];
+ FrameMenu(
+ frame,
+ frameworkGroupingOn,
+ { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox },
+ event,
+ cx
+ );
+ }
+
+ toggleFrames = event => {
+ event.stopPropagation();
+ this.setState(prevState => ({ expanded: !prevState.expanded }));
+ };
+
+ renderFrames() {
+ const {
+ cx,
+ group,
+ selectFrame,
+ selectLocation,
+ selectedFrame,
+ toggleFrameworkGrouping,
+ frameworkGroupingOn,
+ toggleBlackBox,
+ copyStackTrace,
+ displayFullUrl,
+ getFrameTitle,
+ disableContextMenu,
+ panel,
+ restart,
+ } = this.props;
+
+ const { expanded } = this.state;
+ if (!expanded) {
+ return null;
+ }
+
+ return (
+ <div className="frames-list">
+ {group.reduce((acc, frame, i) => {
+ if (this.isSelectable) {
+ acc.push(<FrameIndent key={`frame-indent-${i}`} />);
+ }
+ return acc.concat(
+ <FrameComponent
+ cx={cx}
+ copyStackTrace={copyStackTrace}
+ frame={frame}
+ frameworkGroupingOn={frameworkGroupingOn}
+ hideLocation={true}
+ key={frame.id}
+ selectedFrame={selectedFrame}
+ selectFrame={selectFrame}
+ selectLocation={selectLocation}
+ shouldMapDisplayName={false}
+ toggleBlackBox={toggleBlackBox}
+ toggleFrameworkGrouping={toggleFrameworkGrouping}
+ displayFullUrl={displayFullUrl}
+ getFrameTitle={getFrameTitle}
+ disableContextMenu={disableContextMenu}
+ panel={panel}
+ restart={restart}
+ />
+ );
+ }, [])}
+ </div>
+ );
+ }
+
+ renderDescription() {
+ const { l10n } = this.context;
+ const { group } = this.props;
+ const { expanded } = this.state;
+
+ const frame = group[0];
+ const l10NEntry = expanded
+ ? "callStack.group.collapseTooltip"
+ : "callStack.group.expandTooltip";
+ const title = l10n.getFormatStr(l10NEntry, frame.library);
+
+ return (
+ <div
+ role="listitem"
+ key={frame.id}
+ className="group"
+ onClick={this.toggleFrames}
+ tabIndex={0}
+ title={title}
+ >
+ {this.isSelectable && <FrameIndent />}
+ <FrameLocation frame={frame} expanded={expanded} />
+ {this.isSelectable && <span className="clipboard-only"> </span>}
+ <Badge>{this.props.group.length}</Badge>
+ {this.isSelectable && <br className="clipboard-only" />}
+ </div>
+ );
+ }
+
+ render() {
+ const { expanded } = this.state;
+ const { disableContextMenu } = this.props;
+ return (
+ <div
+ className={classnames("frames-group", { expanded })}
+ onContextMenu={disableContextMenu ? null : e => this.onContextMenu(e)}
+ >
+ {this.renderDescription()}
+ {this.renderFrames()}
+ </div>
+ );
+ }
+}
+
+Group.displayName = "Group";
+Group.contextTypes = { l10n: PropTypes.object };
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/index.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/index.js
new file mode 100644
index 0000000000..5c48af8cb3
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/index.js
@@ -0,0 +1,231 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import { connect } from "../../../utils/connect";
+import PropTypes from "prop-types";
+
+import FrameComponent from "./Frame";
+import Group from "./Group";
+
+import actions from "../../../actions";
+import { collapseFrames, formatCopyName } from "../../../utils/pause/frames";
+import { copyToTheClipboard } from "../../../utils/clipboard";
+
+import {
+ getFrameworkGroupingState,
+ getSelectedFrame,
+ getCallStackFrames,
+ getCurrentThread,
+ getThreadContext,
+} from "../../../selectors";
+
+import "./Frames.css";
+
+const NUM_FRAMES_SHOWN = 7;
+
+class Frames extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ showAllFrames: !!props.disableFrameTruncate,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ cx: PropTypes.object,
+ disableContextMenu: PropTypes.bool.isRequired,
+ disableFrameTruncate: PropTypes.bool.isRequired,
+ displayFullUrl: PropTypes.bool.isRequired,
+ frames: PropTypes.array.isRequired,
+ frameworkGroupingOn: PropTypes.bool.isRequired,
+ getFrameTitle: PropTypes.func,
+ panel: PropTypes.oneOf(["debugger", "webconsole"]).isRequired,
+ restart: PropTypes.func,
+ selectFrame: PropTypes.func.isRequired,
+ selectLocation: PropTypes.func,
+ selectedFrame: PropTypes.object,
+ toggleBlackBox: PropTypes.func,
+ toggleFrameworkGrouping: PropTypes.func,
+ };
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ const { frames, selectedFrame, frameworkGroupingOn } = this.props;
+ const { showAllFrames } = this.state;
+ return (
+ frames !== nextProps.frames ||
+ selectedFrame !== nextProps.selectedFrame ||
+ showAllFrames !== nextState.showAllFrames ||
+ frameworkGroupingOn !== nextProps.frameworkGroupingOn
+ );
+ }
+
+ toggleFramesDisplay = () => {
+ this.setState(prevState => ({
+ showAllFrames: !prevState.showAllFrames,
+ }));
+ };
+
+ collapseFrames(frames) {
+ const { frameworkGroupingOn } = this.props;
+ if (!frameworkGroupingOn) {
+ return frames;
+ }
+
+ return collapseFrames(frames);
+ }
+
+ truncateFrames(frames) {
+ const numFramesToShow = this.state.showAllFrames
+ ? frames.length
+ : NUM_FRAMES_SHOWN;
+
+ return frames.slice(0, numFramesToShow);
+ }
+
+ copyStackTrace = () => {
+ const { frames } = this.props;
+ const { l10n } = this.context;
+ const framesToCopy = frames.map(f => formatCopyName(f, l10n)).join("\n");
+ copyToTheClipboard(framesToCopy);
+ };
+
+ toggleFrameworkGrouping = () => {
+ const { toggleFrameworkGrouping, frameworkGroupingOn } = this.props;
+ toggleFrameworkGrouping(!frameworkGroupingOn);
+ };
+
+ renderFrames(frames) {
+ const {
+ cx,
+ selectFrame,
+ selectLocation,
+ selectedFrame,
+ toggleBlackBox,
+ frameworkGroupingOn,
+ displayFullUrl,
+ getFrameTitle,
+ disableContextMenu,
+ panel,
+ restart,
+ } = this.props;
+
+ const framesOrGroups = this.truncateFrames(this.collapseFrames(frames));
+
+ // We're not using a <ul> because it adds new lines before and after when
+ // the user copies the trace. Needed for the console which has several
+ // places where we don't want to have those new lines.
+ return (
+ <div role="list">
+ {framesOrGroups.map(frameOrGroup =>
+ frameOrGroup.id ? (
+ <FrameComponent
+ cx={cx}
+ frame={frameOrGroup}
+ toggleFrameworkGrouping={this.toggleFrameworkGrouping}
+ copyStackTrace={this.copyStackTrace}
+ frameworkGroupingOn={frameworkGroupingOn}
+ selectFrame={selectFrame}
+ selectLocation={selectLocation}
+ selectedFrame={selectedFrame}
+ toggleBlackBox={toggleBlackBox}
+ key={String(frameOrGroup.id)}
+ displayFullUrl={displayFullUrl}
+ getFrameTitle={getFrameTitle}
+ disableContextMenu={disableContextMenu}
+ panel={panel}
+ restart={restart}
+ />
+ ) : (
+ <Group
+ cx={cx}
+ group={frameOrGroup}
+ toggleFrameworkGrouping={this.toggleFrameworkGrouping}
+ copyStackTrace={this.copyStackTrace}
+ frameworkGroupingOn={frameworkGroupingOn}
+ selectFrame={selectFrame}
+ selectLocation={selectLocation}
+ selectedFrame={selectedFrame}
+ toggleBlackBox={toggleBlackBox}
+ key={frameOrGroup[0].id}
+ displayFullUrl={displayFullUrl}
+ getFrameTitle={getFrameTitle}
+ disableContextMenu={disableContextMenu}
+ panel={panel}
+ restart={restart}
+ />
+ )
+ )}
+ </div>
+ );
+ }
+
+ renderToggleButton(frames) {
+ const { l10n } = this.context;
+ const buttonMessage = this.state.showAllFrames
+ ? l10n.getStr("callStack.collapse")
+ : l10n.getStr("callStack.expand");
+
+ frames = this.collapseFrames(frames);
+ if (frames.length <= NUM_FRAMES_SHOWN) {
+ return null;
+ }
+
+ return (
+ <div className="show-more-container">
+ <button className="show-more" onClick={this.toggleFramesDisplay}>
+ {buttonMessage}
+ </button>
+ </div>
+ );
+ }
+
+ render() {
+ const { frames, disableFrameTruncate } = this.props;
+
+ if (!frames) {
+ return (
+ <div className="pane frames">
+ <div className="pane-info empty">
+ {L10N.getStr("callStack.notPaused")}
+ </div>
+ </div>
+ );
+ }
+
+ return (
+ <div className="pane frames">
+ {this.renderFrames(frames)}
+ {disableFrameTruncate ? null : this.renderToggleButton(frames)}
+ </div>
+ );
+ }
+}
+
+Frames.contextTypes = { l10n: PropTypes.object };
+
+const mapStateToProps = state => ({
+ cx: getThreadContext(state),
+ frames: getCallStackFrames(state),
+ frameworkGroupingOn: getFrameworkGroupingState(state),
+ selectedFrame: getSelectedFrame(state, getCurrentThread(state)),
+ disableFrameTruncate: false,
+ disableContextMenu: false,
+ displayFullUrl: false,
+});
+
+export default connect(mapStateToProps, {
+ selectFrame: actions.selectFrame,
+ selectLocation: actions.selectLocation,
+ toggleBlackBox: actions.toggleBlackBox,
+ toggleFrameworkGrouping: actions.toggleFrameworkGrouping,
+ restart: actions.restart,
+})(Frames);
+
+// Export the non-connected component in order to use it outside of the debugger
+// panel (e.g. console, netmonitor, …).
+export { Frames };
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/moz.build b/devtools/client/debugger/src/components/SecondaryPanes/Frames/moz.build
new file mode 100644
index 0000000000..f775363b14
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/moz.build
@@ -0,0 +1,14 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DIRS += []
+
+CompiledModules(
+ "Frame.js",
+ "FrameIndent.js",
+ "FrameMenu.js",
+ "Group.js",
+ "index.js",
+)
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frame.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frame.spec.js
new file mode 100644
index 0000000000..10ec961858
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frame.spec.js
@@ -0,0 +1,155 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow, mount } from "enzyme";
+import Frame from "../Frame.js";
+import {
+ makeMockFrame,
+ makeMockSource,
+ mockthreadcx,
+} from "../../../../utils/test-mockup";
+
+import FrameMenu from "../FrameMenu";
+jest.mock("../FrameMenu", () => jest.fn());
+
+function frameProperties(frame, selectedFrame, overrides = {}) {
+ return {
+ cx: mockthreadcx,
+ frame,
+ selectedFrame,
+ copyStackTrace: jest.fn(),
+ contextTypes: {},
+ selectFrame: jest.fn(),
+ selectLocation: jest.fn(),
+ toggleBlackBox: jest.fn(),
+ displayFullUrl: false,
+ frameworkGroupingOn: false,
+ panel: "webconsole",
+ toggleFrameworkGrouping: null,
+ restart: jest.fn(),
+ ...overrides,
+ };
+}
+
+function render(frameToSelect = {}, overrides = {}, propsOverrides = {}) {
+ const source = makeMockSource("foo-view.js");
+ const defaultFrame = makeMockFrame("1", source, undefined, 10, "renderFoo");
+
+ const frame = { ...defaultFrame, ...overrides };
+ const selectedFrame = { ...frame, ...frameToSelect };
+
+ const props = frameProperties(frame, selectedFrame, propsOverrides);
+ const component = shallow(<Frame {...props} />);
+ return { component, props };
+}
+
+describe("Frame", () => {
+ it("user frame", () => {
+ const { component } = render();
+ expect(component).toMatchSnapshot();
+ });
+
+ it("user frame (not selected)", () => {
+ const { component } = render({ id: "2" });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("library frame", () => {
+ const source = makeMockSource("backbone.js");
+ const backboneFrame = {
+ ...makeMockFrame("3", source, undefined, 12, "updateEvents"),
+ library: "backbone",
+ };
+
+ const { component } = render({ id: "3" }, backboneFrame);
+ expect(component).toMatchSnapshot();
+ });
+
+ it("filename only", () => {
+ const source = makeMockSource(
+ "https://firefox.com/assets/src/js/foo-view.js"
+ );
+ const frame = makeMockFrame("1", source, undefined, 10, "renderFoo");
+
+ const props = frameProperties(frame, null);
+ const component = mount(<Frame {...props} />);
+ expect(component.text()).toBe("    renderFoo foo-view.js:10");
+ });
+
+ it("full URL", () => {
+ const url = `https://${"a".repeat(100)}.com/assets/src/js/foo-view.js`;
+ const source = makeMockSource(url);
+ const frame = makeMockFrame("1", source, undefined, 10, "renderFoo");
+
+ const props = frameProperties(frame, null, { displayFullUrl: true });
+ const component = mount(<Frame {...props} />);
+ expect(component.text()).toBe(`    renderFoo ${url}:10`);
+ });
+
+ it("renders asyncCause", () => {
+ const url = `https://example.com/async.js`;
+ const source = makeMockSource(url);
+ const frame = makeMockFrame("1", source, undefined, 10, "timeoutFn");
+ frame.asyncCause = "setTimeout handler";
+
+ const props = frameProperties(frame);
+ const component = mount(<Frame {...props} />, { context: { l10n: L10N } });
+ expect(component.find(".location-async-cause").text()).toBe(
+ `    (Async: setTimeout handler)`
+ );
+ });
+
+ it("getFrameTitle", () => {
+ const url = `https://${"a".repeat(100)}.com/assets/src/js/foo-view.js`;
+ const source = makeMockSource(url);
+ const frame = makeMockFrame("1", source, undefined, 10, "renderFoo");
+
+ const props = frameProperties(frame, null, {
+ getFrameTitle: x => `Jump to ${x}`,
+ });
+ const component = shallow(<Frame {...props} />);
+ expect(component.prop("title")).toBe(`Jump to ${url}:10`);
+ expect(component).toMatchSnapshot();
+ });
+
+ describe("mouse events", () => {
+ it("does not call FrameMenu when disableContextMenu is true", () => {
+ const { component } = render(undefined, undefined, {
+ disableContextMenu: true,
+ });
+
+ const mockEvent = "mockEvent";
+ component.simulate("contextmenu", mockEvent);
+
+ expect(FrameMenu).toHaveBeenCalledTimes(0);
+ });
+
+ it("calls FrameMenu on right click", () => {
+ const { component, props } = render();
+ const {
+ copyStackTrace,
+ toggleFrameworkGrouping,
+ toggleBlackBox,
+ cx,
+ restart,
+ } = props;
+ const mockEvent = "mockEvent";
+ component.simulate("contextmenu", mockEvent);
+
+ expect(FrameMenu).toHaveBeenCalledWith(
+ props.frame,
+ props.frameworkGroupingOn,
+ {
+ copyStackTrace,
+ toggleFrameworkGrouping,
+ toggleBlackBox,
+ restart,
+ },
+ mockEvent,
+ cx
+ );
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/FrameMenu.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/FrameMenu.spec.js
new file mode 100644
index 0000000000..dbaa98f5cf
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/FrameMenu.spec.js
@@ -0,0 +1,117 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import FrameMenu from "../FrameMenu";
+
+import { showMenu } from "../../../../context-menu/menu";
+import { copyToTheClipboard } from "../../../../utils/clipboard";
+import {
+ makeMockFrame,
+ makeMockSource,
+ mockthreadcx,
+} from "../../../../utils/test-mockup";
+
+jest.mock("../../../../context-menu/menu", () => ({ showMenu: jest.fn() }));
+jest.mock("../../../../utils/clipboard", () => ({
+ copyToTheClipboard: jest.fn(),
+}));
+
+function generateMockId(labelString) {
+ return `node-menu-${labelString}`;
+}
+
+describe("FrameMenu", () => {
+ let mockEvent;
+ let mockFrame;
+ let emptyFrame;
+ let callbacks;
+ let frameworkGroupingOn;
+ let toggleFrameworkGrouping;
+
+ beforeEach(() => {
+ mockFrame = makeMockFrame(undefined, makeMockSource("isFake"));
+ mockEvent = {
+ stopPropagation: jest.fn(),
+ preventDefault: jest.fn(),
+ };
+ callbacks = {
+ toggleFrameworkGrouping,
+ toggleBlackbox: jest.fn(),
+ copyToTheClipboard,
+ restart: jest.fn(),
+ };
+ emptyFrame = {};
+ });
+
+ afterEach(() => {
+ showMenu.mockClear();
+ });
+
+ it("sends three element in menuOpts to showMenu if source is present", () => {
+ const restartFrameId = generateMockId("restartFrame");
+ const sourceId = generateMockId("copySourceUri2");
+ const stacktraceId = generateMockId("copyStackTrace");
+ const frameworkGroupingId = generateMockId("framework.enableGrouping");
+ const blackBoxId = generateMockId("ignoreContextItem.ignore");
+
+ FrameMenu(
+ mockFrame,
+ frameworkGroupingOn,
+ callbacks,
+ mockEvent,
+ mockthreadcx
+ );
+
+ const receivedArray = showMenu.mock.calls[0][1];
+ expect(showMenu).toHaveBeenCalledWith(mockEvent, receivedArray);
+ const receivedArrayIds = receivedArray.map(item => item.id);
+ expect(receivedArrayIds).toEqual([
+ restartFrameId,
+ frameworkGroupingId,
+ sourceId,
+ blackBoxId,
+ stacktraceId,
+ ]);
+ });
+
+ it("sends one element in menuOpts without source", () => {
+ const stacktraceId = generateMockId("copyStackTrace");
+ const frameworkGrouping = generateMockId("framework.enableGrouping");
+
+ FrameMenu(
+ emptyFrame,
+ frameworkGroupingOn,
+ callbacks,
+ mockEvent,
+ mockthreadcx
+ );
+
+ const receivedArray = showMenu.mock.calls[0][1];
+ expect(showMenu).toHaveBeenCalledWith(mockEvent, receivedArray);
+ const receivedArrayIds = receivedArray.map(item => item.id);
+ expect(receivedArrayIds).toEqual([frameworkGrouping, stacktraceId]);
+ });
+
+ it("uses the disableGrouping text if frameworkGroupingOn is false", () => {
+ const stacktraceId = generateMockId("copyStackTrace");
+ const frameworkGrouping = generateMockId("framework.disableGrouping");
+
+ FrameMenu(emptyFrame, true, callbacks, mockEvent, mockthreadcx);
+
+ const receivedArray = showMenu.mock.calls[0][1];
+ const receivedArrayIds = receivedArray.map(item => item.id);
+ expect(receivedArrayIds).toEqual([frameworkGrouping, stacktraceId]);
+ });
+
+ it("uses the enableGrouping text if frameworkGroupingOn is true", () => {
+ const stacktraceId = generateMockId("copyStackTrace");
+ const frameworkGrouping = generateMockId("framework.enableGrouping");
+
+ FrameMenu(emptyFrame, false, callbacks, mockEvent, mockthreadcx);
+
+ const receivedArray = showMenu.mock.calls[0][1];
+ const receivedArrayIds = receivedArray.map(item => item.id);
+ expect(receivedArrayIds).toEqual([frameworkGrouping, stacktraceId]);
+ });
+});
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frames.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frames.spec.js
new file mode 100644
index 0000000000..da60418b07
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Frames.spec.js
@@ -0,0 +1,295 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { mount, shallow } from "enzyme";
+import Frames from "../index.js";
+// eslint-disable-next-line
+import { formatCallStackFrames } from "../../../../selectors/getCallStackFrames";
+import { makeMockFrame, makeMockSource } from "../../../../utils/test-mockup";
+
+function render(overrides = {}) {
+ const defaultProps = {
+ frames: null,
+ selectedFrame: null,
+ frameworkGroupingOn: false,
+ toggleFrameworkGrouping: jest.fn(),
+ contextTypes: {},
+ selectFrame: jest.fn(),
+ toggleBlackBox: jest.fn(),
+ };
+
+ const props = { ...defaultProps, ...overrides };
+ const component = shallow(<Frames.WrappedComponent {...props} />, {
+ context: { l10n: L10N },
+ });
+
+ return component;
+}
+
+describe("Frames", () => {
+ describe("Supports different number of frames", () => {
+ it("empty frames", () => {
+ const component = render();
+ expect(component).toMatchSnapshot();
+ expect(component.find(".show-more").exists()).toBeFalsy();
+ });
+
+ it("one frame", () => {
+ const frames = [{ id: 1 }];
+ const selectedFrame = frames[0];
+ const component = render({ frames, selectedFrame });
+
+ expect(component.find(".show-more").exists()).toBeFalsy();
+ expect(component).toMatchSnapshot();
+ });
+
+ it("toggling the show more button", () => {
+ const frames = [
+ { id: 1 },
+ { id: 2 },
+ { id: 3 },
+ { id: 4 },
+ { id: 5 },
+ { id: 6 },
+ { id: 7 },
+ { id: 8 },
+ { id: 9 },
+ { id: 10 },
+ ];
+
+ const selectedFrame = frames[0];
+ const component = render({ selectedFrame, frames });
+
+ const getToggleBtn = () => component.find(".show-more");
+ const getFrames = () => component.find("Frame");
+
+ expect(getToggleBtn().text()).toEqual("Expand rows");
+ expect(getFrames()).toHaveLength(7);
+
+ getToggleBtn().simulate("click");
+ expect(getToggleBtn().text()).toEqual("Collapse rows");
+ expect(getFrames()).toHaveLength(10);
+ expect(component).toMatchSnapshot();
+ });
+
+ it("disable frame truncation", () => {
+ const framesNumber = 20;
+ const frames = Array.from({ length: framesNumber }, (_, i) => ({
+ id: i + 1,
+ }));
+
+ const component = render({
+ frames,
+ disableFrameTruncate: true,
+ });
+
+ const getToggleBtn = () => component.find(".show-more");
+ const getFrames = () => component.find("Frame");
+
+ expect(getToggleBtn().exists()).toBeFalsy();
+ expect(getFrames()).toHaveLength(framesNumber);
+
+ expect(component).toMatchSnapshot();
+ });
+
+ it("shows the full URL", () => {
+ const frames = [
+ {
+ id: 1,
+ displayName: "renderFoo",
+ location: {
+ line: 55,
+ },
+ source: {
+ url: "http://myfile.com/mahscripts.js",
+ },
+ },
+ ];
+
+ const component = mount(
+ <Frames.WrappedComponent
+ frames={frames}
+ disableFrameTruncate={true}
+ displayFullUrl={true}
+ />
+ );
+ expect(component.text()).toBe(
+ "renderFoo http://myfile.com/mahscripts.js:55"
+ );
+ });
+
+ it("passes the getFrameTitle prop to the Frame component", () => {
+ const frames = [
+ {
+ id: 1,
+ displayName: "renderFoo",
+ location: {
+ line: 55,
+ },
+ source: {
+ url: "http://myfile.com/mahscripts.js",
+ },
+ },
+ ];
+ const getFrameTitle = () => {};
+ const component = render({ frames, getFrameTitle });
+
+ expect(component.find("Frame").prop("getFrameTitle")).toBe(getFrameTitle);
+ expect(component).toMatchSnapshot();
+ });
+
+ it("passes the getFrameTitle prop to the Group component", () => {
+ const frames = [
+ {
+ id: 1,
+ displayName: "renderFoo",
+ location: {
+ line: 55,
+ },
+ source: {
+ url: "http://myfile.com/mahscripts.js",
+ },
+ },
+ {
+ id: 2,
+ library: "back",
+ displayName: "a",
+ location: {
+ line: 55,
+ },
+ source: {
+ url: "http://myfile.com/back.js",
+ },
+ },
+ {
+ id: 3,
+ library: "back",
+ displayName: "b",
+ location: {
+ line: 55,
+ },
+ source: {
+ url: "http://myfile.com/back.js",
+ },
+ },
+ ];
+ const getFrameTitle = () => {};
+ const component = render({
+ frames,
+ getFrameTitle,
+ frameworkGroupingOn: true,
+ });
+
+ expect(component.find("Group").prop("getFrameTitle")).toBe(getFrameTitle);
+ });
+ });
+
+ describe("Blackboxed Frames", () => {
+ it("filters blackboxed frames", () => {
+ const source1 = makeMockSource("source1", "1");
+ const source2 = makeMockSource("source2", "2");
+ source2.isBlackBoxed = true;
+
+ const frames = [
+ makeMockFrame("1", source1),
+ makeMockFrame("2", source2),
+ makeMockFrame("3", source1),
+ makeMockFrame("8", source2),
+ ];
+
+ const blackboxedRanges = {
+ source2: [],
+ };
+
+ const processedFrames = formatCallStackFrames(
+ frames,
+ source1,
+ blackboxedRanges
+ );
+ const selectedFrame = frames[0];
+
+ const component = render({
+ frames: processedFrames,
+ frameworkGroupingOn: false,
+ selectedFrame,
+ });
+
+ expect(component.find("Frame")).toHaveLength(2);
+ expect(component).toMatchSnapshot();
+ });
+ });
+
+ describe("Library Frames", () => {
+ it("toggling framework frames", () => {
+ const frames = [
+ { id: 1 },
+ { id: 2, library: "back" },
+ { id: 3, library: "back" },
+ { id: 8 },
+ ];
+
+ const selectedFrame = frames[0];
+ const frameworkGroupingOn = false;
+ const component = render({ frames, frameworkGroupingOn, selectedFrame });
+
+ expect(component.find("Frame")).toHaveLength(4);
+ expect(component).toMatchSnapshot();
+
+ component.setProps({ frameworkGroupingOn: true });
+
+ expect(component.find("Frame")).toHaveLength(2);
+ expect(component).toMatchSnapshot();
+ });
+
+ it("groups all the Webpack-related frames", () => {
+ const frames = [
+ { id: "1-appFrame" },
+ {
+ id: "2-webpackBootstrapFrame",
+ source: { url: "webpack:///webpack/bootstrap 01d88449ca6e9335a66f" },
+ },
+ {
+ id: "3-webpackBundleFrame",
+ source: { url: "https://foo.com/bundle.js" },
+ },
+ {
+ id: "4-webpackBootstrapFrame",
+ source: { url: "webpack:///webpack/bootstrap 01d88449ca6e9335a66f" },
+ },
+ {
+ id: "5-webpackBundleFrame",
+ source: { url: "https://foo.com/bundle.js" },
+ },
+ ];
+ const selectedFrame = frames[0];
+ const frameworkGroupingOn = true;
+ const component = render({ frames, frameworkGroupingOn, selectedFrame });
+
+ expect(component).toMatchSnapshot();
+ });
+
+ it("selectable framework frames", () => {
+ const frames = [
+ { id: 1 },
+ { id: 2, library: "back" },
+ { id: 3, library: "back" },
+ { id: 8 },
+ ];
+
+ const selectedFrame = frames[0];
+
+ const component = render({
+ frames,
+ frameworkGroupingOn: false,
+ selectedFrame,
+ selectable: true,
+ });
+ expect(component).toMatchSnapshot();
+
+ component.setProps({ frameworkGroupingOn: true });
+ expect(component).toMatchSnapshot();
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Group.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Group.spec.js
new file mode 100644
index 0000000000..8ff1454d1a
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/Group.spec.js
@@ -0,0 +1,134 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React from "react";
+import { shallow } from "enzyme";
+import Group from "../Group.js";
+import {
+ makeMockFrame,
+ makeMockSource,
+ mockthreadcx,
+} from "../../../../utils/test-mockup";
+
+import FrameMenu from "../FrameMenu";
+jest.mock("../FrameMenu", () => jest.fn());
+
+function render(overrides = {}) {
+ const frame = { ...makeMockFrame(), displayName: "foo", library: "Back" };
+ const defaultProps = {
+ cx: mockthreadcx,
+ group: [frame],
+ selectedFrame: frame,
+ frameworkGroupingOn: true,
+ toggleFrameworkGrouping: jest.fn(),
+ selectFrame: jest.fn(),
+ selectLocation: jest.fn(),
+ copyStackTrace: jest.fn(),
+ toggleBlackBox: jest.fn(),
+ disableContextMenu: false,
+ displayFullUrl: false,
+ panel: "webconsole",
+ restart: jest.fn(),
+ };
+
+ const props = { ...defaultProps, ...overrides };
+ const component = shallow(<Group {...props} />, {
+ context: { l10n: L10N },
+ });
+ return { component, props };
+}
+
+describe("Group", () => {
+ it("displays a group", () => {
+ const { component } = render();
+ expect(component).toMatchSnapshot();
+ });
+
+ it("passes the getFrameTitle prop to the Frame components", () => {
+ const mahscripts = makeMockSource("http://myfile.com/mahscripts.js");
+ const back = makeMockSource("http://myfile.com/back.js");
+ const group = [
+ {
+ ...makeMockFrame("1", mahscripts, undefined, 55, "renderFoo"),
+ library: "Back",
+ },
+ {
+ ...makeMockFrame("2", back, undefined, 55, "a"),
+ library: "Back",
+ },
+ {
+ ...makeMockFrame("3", back, undefined, 55, "b"),
+ library: "Back",
+ },
+ ];
+ const getFrameTitle = () => {};
+ const { component } = render({ group, getFrameTitle });
+
+ component.setState({ expanded: true });
+
+ const frameComponents = component.find("Frame");
+ expect(frameComponents).toHaveLength(3);
+ frameComponents.forEach(node => {
+ expect(node.prop("getFrameTitle")).toBe(getFrameTitle);
+ });
+ expect(component).toMatchSnapshot();
+ });
+
+ it("renders group with anonymous functions", () => {
+ const mahscripts = makeMockSource("http://myfile.com/mahscripts.js");
+ const back = makeMockSource("http://myfile.com/back.js");
+ const group = [
+ {
+ ...makeMockFrame("1", mahscripts, undefined, 55),
+ library: "Back",
+ },
+ {
+ ...makeMockFrame("2", back, undefined, 55),
+ library: "Back",
+ },
+ {
+ ...makeMockFrame("3", back, undefined, 55),
+ library: "Back",
+ },
+ ];
+
+ const { component } = render({ group });
+ expect(component).toMatchSnapshot();
+ component.setState({ expanded: true });
+ expect(component).toMatchSnapshot();
+ });
+
+ describe("mouse events", () => {
+ it("does not call FrameMenu when disableContextMenu is true", () => {
+ const { component } = render({
+ disableContextMenu: true,
+ });
+
+ const mockEvent = "mockEvent";
+ component.simulate("contextmenu", mockEvent);
+
+ expect(FrameMenu).toHaveBeenCalledTimes(0);
+ });
+
+ it("calls FrameMenu on right click", () => {
+ const { component, props } = render();
+ const { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox, cx } =
+ props;
+ const mockEvent = "mockEvent";
+ component.simulate("contextmenu", mockEvent);
+
+ expect(FrameMenu).toHaveBeenCalledWith(
+ props.group[0],
+ props.frameworkGroupingOn,
+ {
+ copyStackTrace,
+ toggleFrameworkGrouping,
+ toggleBlackBox,
+ },
+ mockEvent,
+ cx
+ );
+ });
+ });
+});
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frame.spec.js.snap b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frame.spec.js.snap
new file mode 100644
index 0000000000..2b1edaeef7
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frame.spec.js.snap
@@ -0,0 +1,1196 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Frame getFrameTitle 1`] = `
+<div
+ className="frame"
+ key="1"
+ onContextMenu={[Function]}
+ onKeyUp={[Function]}
+ onMouseDown={[Function]}
+ role="listitem"
+ tabIndex={0}
+ title="Jump to https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js:10"
+>
+ <FrameIndent />
+ <FrameTitle
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ options={
+ Object {
+ "shouldMapDisplayName": true,
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <FrameLocation
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
+ "path": "/assets/src/js/foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/assets/src/js/foo-view.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <br
+ className="clipboard-only"
+ />
+</div>
+`;
+
+exports[`Frame library frame 1`] = `
+<div
+ className="frame selected"
+ key="3"
+ onContextMenu={[Function]}
+ onKeyUp={[Function]}
+ onMouseDown={[Function]}
+ role="listitem"
+ tabIndex={0}
+>
+ <FrameIndent />
+ <FrameTitle
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "updateEvents",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 12,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "3",
+ "index": 0,
+ "library": "backbone",
+ "location": Object {
+ "column": undefined,
+ "line": 12,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ options={
+ Object {
+ "shouldMapDisplayName": true,
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <FrameLocation
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "updateEvents",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 12,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "3",
+ "index": 0,
+ "library": "backbone",
+ "location": Object {
+ "column": undefined,
+ "line": 12,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "backbone.js",
+ "group": "",
+ "path": "backbone.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "backbone.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <br
+ className="clipboard-only"
+ />
+</div>
+`;
+
+exports[`Frame user frame (not selected) 1`] = `
+<div
+ className="frame"
+ key="1"
+ onContextMenu={[Function]}
+ onKeyUp={[Function]}
+ onMouseDown={[Function]}
+ role="listitem"
+ tabIndex={0}
+>
+ <FrameIndent />
+ <FrameTitle
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ options={
+ Object {
+ "shouldMapDisplayName": true,
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <FrameLocation
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <br
+ className="clipboard-only"
+ />
+</div>
+`;
+
+exports[`Frame user frame 1`] = `
+<div
+ className="frame selected"
+ key="1"
+ onContextMenu={[Function]}
+ onKeyUp={[Function]}
+ onMouseDown={[Function]}
+ role="listitem"
+ tabIndex={0}
+>
+ <FrameIndent />
+ <FrameTitle
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ options={
+ Object {
+ "shouldMapDisplayName": true,
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <FrameLocation
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 10,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "foo-view.js",
+ "group": "",
+ "path": "foo-view.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "foo-view.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <br
+ className="clipboard-only"
+ />
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frames.spec.js.snap b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frames.spec.js.snap
new file mode 100644
index 0000000000..9a9c2a379f
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Frames.spec.js.snap
@@ -0,0 +1,1651 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Frames Blackboxed Frames filters blackboxed frames 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-1",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-1",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-3",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "id": "3",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="3"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-1",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "sourceActor": Object {
+ "actor": "1-actor",
+ "id": "1-actor",
+ "source": "1",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ },
+ "sourceActorId": "1-actor",
+ "sourceId": "1",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "source1",
+ "group": "",
+ "path": "source1",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "1",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "source1",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Library Frames groups all the Webpack-related frames 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": "1-appFrame",
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={false}
+ key="1-appFrame"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": "1-appFrame",
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Group
+ copyStackTrace={[Function]}
+ frameworkGroupingOn={true}
+ group={
+ Array [
+ Object {
+ "id": "2-webpackBootstrapFrame",
+ "source": Object {
+ "url": "webpack:///webpack/bootstrap 01d88449ca6e9335a66f",
+ },
+ },
+ Object {
+ "id": "3-webpackBundleFrame",
+ "source": Object {
+ "url": "https://foo.com/bundle.js",
+ },
+ },
+ Object {
+ "id": "4-webpackBootstrapFrame",
+ "source": Object {
+ "url": "webpack:///webpack/bootstrap 01d88449ca6e9335a66f",
+ },
+ },
+ Object {
+ "id": "5-webpackBundleFrame",
+ "source": Object {
+ "url": "https://foo.com/bundle.js",
+ },
+ },
+ ]
+ }
+ key="2-webpackBootstrapFrame"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": "1-appFrame",
+ }
+ }
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Library Frames selectable framework frames 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 2,
+ "library": "back",
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="2"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 3,
+ "library": "back",
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="3"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 8,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="8"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Library Frames selectable framework frames 2`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Group
+ copyStackTrace={[Function]}
+ frameworkGroupingOn={true}
+ group={
+ Array [
+ Object {
+ "id": 2,
+ "library": "back",
+ },
+ Object {
+ "id": 3,
+ "library": "back",
+ },
+ ]
+ }
+ key="2"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 8,
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={false}
+ key="8"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Library Frames toggling framework frames 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 2,
+ "library": "back",
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="2"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 3,
+ "library": "back",
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="3"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 8,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="8"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Library Frames toggling framework frames 2`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Group
+ copyStackTrace={[Function]}
+ frameworkGroupingOn={true}
+ group={
+ Array [
+ Object {
+ "id": 2,
+ "library": "back",
+ },
+ Object {
+ "id": 3,
+ "library": "back",
+ },
+ ]
+ }
+ key="2"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 8,
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={false}
+ key="8"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Supports different number of frames disable frame truncation 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 2,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="2"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 3,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="3"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 4,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="4"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 5,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="5"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 6,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="6"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 7,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="7"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 8,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="8"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 9,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="9"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 10,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="10"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 11,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="11"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 12,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="12"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 13,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="13"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 14,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="14"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 15,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="15"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 16,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="16"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 17,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="17"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 18,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="18"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 19,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="19"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 20,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="20"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Supports different number of frames empty frames 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ className="pane-info empty"
+ >
+ Not paused
+ </div>
+</div>
+`;
+
+exports[`Frames Supports different number of frames one frame 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Supports different number of frames passes the getFrameTitle prop to the Frame component 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "displayName": "renderFoo",
+ "id": 1,
+ "location": Object {
+ "line": 55,
+ },
+ "source": Object {
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ }
+ }
+ frameworkGroupingOn={false}
+ getFrameTitle={[Function]}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={null}
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Frames Supports different number of frames toggling the show more button 1`] = `
+<div
+ className="pane frames"
+>
+ <div
+ role="list"
+ >
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 1,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="1"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 2,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="2"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 3,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="3"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 4,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="4"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 5,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="5"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 6,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="6"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 7,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="7"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 8,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="8"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 9,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="9"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ <Frame
+ copyStackTrace={[Function]}
+ disableContextMenu={false}
+ frame={
+ Object {
+ "id": 10,
+ }
+ }
+ frameworkGroupingOn={false}
+ hideLocation={false}
+ key="10"
+ selectFrame={[MockFunction]}
+ selectedFrame={
+ Object {
+ "id": 1,
+ }
+ }
+ shouldMapDisplayName={true}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[Function]}
+ />
+ </div>
+ <div
+ className="show-more-container"
+ >
+ <button
+ className="show-more"
+ onClick={[Function]}
+ >
+ Collapse rows
+ </button>
+ </div>
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Group.spec.js.snap b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Group.spec.js.snap
new file mode 100644
index 0000000000..d6542f7fd2
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/tests/__snapshots__/Group.spec.js.snap
@@ -0,0 +1,2440 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Group displays a group 1`] = `
+<div
+ className="frames-group"
+ onContextMenu={[Function]}
+>
+ <div
+ className="group"
+ key="frame"
+ onClick={[Function]}
+ role="listitem"
+ tabIndex={0}
+ title="Show Back frames"
+ >
+ <FrameIndent />
+ <FrameLocation
+ expanded={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <Badge>
+ 1
+ </Badge>
+ <br
+ className="clipboard-only"
+ />
+ </div>
+</div>
+`;
+
+exports[`Group passes the getFrameTitle prop to the Frame components 1`] = `
+<div
+ className="frames-group expanded"
+ onContextMenu={[Function]}
+>
+ <div
+ className="group"
+ key="1"
+ onClick={[Function]}
+ role="listitem"
+ tabIndex={0}
+ title="Collapse Back frames"
+ >
+ <FrameIndent />
+ <FrameLocation
+ expanded={true}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <Badge>
+ 3
+ </Badge>
+ <br
+ className="clipboard-only"
+ />
+ </div>
+ <div
+ className="frames-list"
+ >
+ <FrameIndent
+ key="frame-indent-0"
+ />
+ <Frame
+ copyStackTrace={[MockFunction]}
+ cx={
+ Object {
+ "isPaused": false,
+ "navigateCounter": 0,
+ "pauseCounter": 0,
+ "thread": "FakeThread",
+ }
+ }
+ disableContextMenu={false}
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "renderFoo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={true}
+ getFrameTitle={[Function]}
+ hideLocation={true}
+ key="1"
+ panel="webconsole"
+ restart={[MockFunction]}
+ selectFrame={[MockFunction]}
+ selectLocation={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={false}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[MockFunction]}
+ />
+ <FrameIndent
+ key="frame-indent-1"
+ />
+ <Frame
+ copyStackTrace={[MockFunction]}
+ cx={
+ Object {
+ "isPaused": false,
+ "navigateCounter": 0,
+ "pauseCounter": 0,
+ "thread": "FakeThread",
+ }
+ }
+ disableContextMenu={false}
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "a",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "2",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={true}
+ getFrameTitle={[Function]}
+ hideLocation={true}
+ key="2"
+ panel="webconsole"
+ restart={[MockFunction]}
+ selectFrame={[MockFunction]}
+ selectLocation={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={false}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[MockFunction]}
+ />
+ <FrameIndent
+ key="frame-indent-2"
+ />
+ <Frame
+ copyStackTrace={[MockFunction]}
+ cx={
+ Object {
+ "isPaused": false,
+ "navigateCounter": 0,
+ "pauseCounter": 0,
+ "thread": "FakeThread",
+ }
+ }
+ disableContextMenu={false}
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "b",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "3",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={true}
+ getFrameTitle={[Function]}
+ hideLocation={true}
+ key="3"
+ panel="webconsole"
+ restart={[MockFunction]}
+ selectFrame={[MockFunction]}
+ selectLocation={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={false}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[MockFunction]}
+ />
+ </div>
+</div>
+`;
+
+exports[`Group renders group with anonymous functions 1`] = `
+<div
+ className="frames-group"
+ onContextMenu={[Function]}
+>
+ <div
+ className="group"
+ key="1"
+ onClick={[Function]}
+ role="listitem"
+ tabIndex={0}
+ title="Show Back frames"
+ >
+ <FrameIndent />
+ <FrameLocation
+ expanded={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-1",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <Badge>
+ 3
+ </Badge>
+ <br
+ className="clipboard-only"
+ />
+ </div>
+</div>
+`;
+
+exports[`Group renders group with anonymous functions 2`] = `
+<div
+ className="frames-group expanded"
+ onContextMenu={[Function]}
+>
+ <div
+ className="group"
+ key="1"
+ onClick={[Function]}
+ role="listitem"
+ tabIndex={0}
+ title="Collapse Back frames"
+ >
+ <FrameIndent />
+ <FrameLocation
+ expanded={true}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-1",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ />
+ <span
+ className="clipboard-only"
+ >
+
+ </span>
+ <Badge>
+ 3
+ </Badge>
+ <br
+ className="clipboard-only"
+ />
+ </div>
+ <div
+ className="frames-list"
+ >
+ <FrameIndent
+ key="frame-indent-0"
+ />
+ <Frame
+ copyStackTrace={[MockFunction]}
+ cx={
+ Object {
+ "isPaused": false,
+ "navigateCounter": 0,
+ "pauseCounter": 0,
+ "thread": "FakeThread",
+ }
+ }
+ disableContextMenu={false}
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-1",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "1",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "mahscripts.js",
+ "group": "myfile.com",
+ "path": "/mahscripts.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/mahscripts.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={true}
+ key="1"
+ panel="webconsole"
+ restart={[MockFunction]}
+ selectFrame={[MockFunction]}
+ selectLocation={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={false}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[MockFunction]}
+ />
+ <FrameIndent
+ key="frame-indent-1"
+ />
+ <Frame
+ copyStackTrace={[MockFunction]}
+ cx={
+ Object {
+ "isPaused": false,
+ "navigateCounter": 0,
+ "pauseCounter": 0,
+ "thread": "FakeThread",
+ }
+ }
+ disableContextMenu={false}
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-2",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "2",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={true}
+ key="2"
+ panel="webconsole"
+ restart={[MockFunction]}
+ selectFrame={[MockFunction]}
+ selectLocation={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={false}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[MockFunction]}
+ />
+ <FrameIndent
+ key="frame-indent-2"
+ />
+ <Frame
+ copyStackTrace={[MockFunction]}
+ cx={
+ Object {
+ "isPaused": false,
+ "navigateCounter": 0,
+ "pauseCounter": 0,
+ "thread": "FakeThread",
+ }
+ }
+ disableContextMenu={false}
+ displayFullUrl={false}
+ frame={
+ Object {
+ "asyncCause": null,
+ "displayName": "display-3",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "3",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 55,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "js",
+ "filename": "back.js",
+ "group": "myfile.com",
+ "path": "/back.js",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "http://myfile.com/back.js",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ frameworkGroupingOn={true}
+ hideLocation={true}
+ key="3"
+ panel="webconsole"
+ restart={[MockFunction]}
+ selectFrame={[MockFunction]}
+ selectLocation={[MockFunction]}
+ selectedFrame={
+ Object {
+ "asyncCause": null,
+ "displayName": "foo",
+ "generatedLocation": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "id": "frame",
+ "index": 0,
+ "library": "Back",
+ "location": Object {
+ "column": undefined,
+ "line": 4,
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "sourceActor": Object {
+ "actor": "source-actor",
+ "id": "source-actor",
+ "source": "source",
+ "sourceObject": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ },
+ "sourceActorId": "source-actor",
+ "sourceId": "source",
+ "sourceUrl": "",
+ },
+ "scope": Object {
+ "actor": "scope-actor",
+ "bindings": Object {
+ "arguments": Array [],
+ "variables": Object {},
+ },
+ "function": null,
+ "object": null,
+ "parent": null,
+ "scopeKind": "",
+ "type": "block",
+ },
+ "source": Object {
+ "displayURL": Object {
+ "fileExtension": "",
+ "filename": "url",
+ "group": "",
+ "path": "url",
+ "search": "",
+ },
+ "extensionName": null,
+ "id": "source",
+ "isExtension": false,
+ "isOriginal": false,
+ "isPrettyPrinted": false,
+ "isWasm": false,
+ "thread": "FakeThread",
+ "url": "url",
+ },
+ "state": "on-stack",
+ "this": Object {},
+ "thread": "FakeThread",
+ "type": "call",
+ }
+ }
+ shouldMapDisplayName={false}
+ toggleBlackBox={[MockFunction]}
+ toggleFrameworkGrouping={[MockFunction]}
+ />
+ </div>
+</div>
+`;
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Scopes.css b/devtools/client/debugger/src/components/SecondaryPanes/Scopes.css
new file mode 100644
index 0000000000..6f47c45d19
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Scopes.css
@@ -0,0 +1,104 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.secondary-panes .map-scopes-header {
+ padding-inline-end: 3px;
+}
+
+.secondary-panes .header-buttons .img.shortcuts {
+ width: 14px;
+ height: 14px;
+ /* Better vertical centering of the icon */
+ margin-top: -2px;
+}
+
+.scopes-content .node.object-node {
+ padding-inline-start: 7px;
+}
+
+.scopes-content .pane.scopes-list {
+ font-family: var(--monospace-font-family);
+}
+
+.scopes-content .toggle-map-scopes a.mdn {
+ padding-inline-start: 3px;
+}
+
+.scopes-content .toggle-map-scopes .img.shortcuts {
+ background: var(--theme-comment);
+}
+
+.object-node.default-property {
+ opacity: 0.6;
+}
+
+.object-node {
+ padding-inline-start: 20px;
+}
+
+html[dir="rtl"] .object-node {
+ padding-right: 4px;
+}
+
+.object-label {
+ color: var(--theme-highlight-blue);
+}
+
+.objectBox-object,
+.objectBox-text,
+.objectBox-table,
+.objectLink-textNode,
+.objectLink-event,
+.objectLink-eventLog,
+.objectLink-regexp,
+.objectLink-object,
+.objectLink-Date,
+.theme-dark .objectBox-object,
+.theme-light .objectBox-object {
+ white-space: nowrap;
+}
+
+.scopes-pane ._content {
+ overflow: auto;
+}
+
+.scopes-list {
+ padding: 4px 0px;
+}
+
+.scopes-list .function-signature {
+ display: inline-block;
+}
+
+.scopes-list .scope-type-toggle {
+ text-align: center;
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+.scopes-list .scope-type-toggle button {
+ /* Override color so that the link doesn't turn purple */
+ color: var(--theme-body-color);
+ font-size: inherit;
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+.scopes-list .scope-type-toggle button:hover {
+ background: transparent;
+}
+
+.scopes-list .tree.object-inspector .node.object-node {
+ display: flex;
+ align-items: center;
+}
+
+.scopes-list .tree.object-inspector .tree-node button.arrow,
+.scopes-list button.invoke-getter {
+ margin-top: 2px;
+}
+
+.scopes-list .tree {
+ line-height: 15px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Scopes.js b/devtools/client/debugger/src/components/SecondaryPanes/Scopes.js
new file mode 100644
index 0000000000..2b6b5f94c9
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Scopes.js
@@ -0,0 +1,311 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+import { showMenu } from "../../context-menu/menu";
+import { connect } from "../../utils/connect";
+import actions from "../../actions";
+
+import {
+ getSelectedSource,
+ getSelectedFrame,
+ getGeneratedFrameScope,
+ getOriginalFrameScope,
+ getPauseReason,
+ isMapScopesEnabled,
+ getThreadContext,
+ getLastExpandedScopes,
+ getIsCurrentThreadPaused,
+} from "../../selectors";
+import { getScopes } from "../../utils/pause/scopes";
+import { getScopeItemPath } from "../../utils/pause/scopes/utils";
+import { clientCommands } from "../../client/firefox";
+
+import { objectInspector } from "devtools/client/shared/components/reps/index";
+
+import "./Scopes.css";
+
+const { ObjectInspector } = objectInspector;
+
+class Scopes extends PureComponent {
+ constructor(props) {
+ const { why, selectedFrame, originalFrameScopes, generatedFrameScopes } =
+ props;
+
+ super(props);
+
+ this.state = {
+ originalScopes: getScopes(why, selectedFrame, originalFrameScopes),
+ generatedScopes: getScopes(why, selectedFrame, generatedFrameScopes),
+ showOriginal: true,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ addWatchpoint: PropTypes.func.isRequired,
+ cx: PropTypes.object.isRequired,
+ expandedScopes: PropTypes.array.isRequired,
+ generatedFrameScopes: PropTypes.object,
+ highlightDomElement: PropTypes.func.isRequired,
+ isLoading: PropTypes.bool.isRequired,
+ isPaused: PropTypes.bool.isRequired,
+ mapScopesEnabled: PropTypes.bool.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ openLink: PropTypes.func.isRequired,
+ originalFrameScopes: PropTypes.object,
+ removeWatchpoint: PropTypes.func.isRequired,
+ selectedFrame: PropTypes.object.isRequired,
+ setExpandedScope: PropTypes.func.isRequired,
+ toggleMapScopes: PropTypes.func.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ why: PropTypes.object.isRequired,
+ };
+ }
+
+ // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507
+ UNSAFE_componentWillReceiveProps(nextProps) {
+ const {
+ selectedFrame,
+ originalFrameScopes,
+ generatedFrameScopes,
+ isPaused,
+ } = this.props;
+ const isPausedChanged = isPaused !== nextProps.isPaused;
+ const selectedFrameChanged = selectedFrame !== nextProps.selectedFrame;
+ const originalFrameScopesChanged =
+ originalFrameScopes !== nextProps.originalFrameScopes;
+ const generatedFrameScopesChanged =
+ generatedFrameScopes !== nextProps.generatedFrameScopes;
+
+ if (
+ isPausedChanged ||
+ selectedFrameChanged ||
+ originalFrameScopesChanged ||
+ generatedFrameScopesChanged
+ ) {
+ this.setState({
+ originalScopes: getScopes(
+ nextProps.why,
+ nextProps.selectedFrame,
+ nextProps.originalFrameScopes
+ ),
+ generatedScopes: getScopes(
+ nextProps.why,
+ nextProps.selectedFrame,
+ nextProps.generatedFrameScopes
+ ),
+ });
+ }
+ }
+
+ onToggleMapScopes = () => {
+ this.props.toggleMapScopes();
+ };
+
+ onContextMenu = (event, item) => {
+ const { addWatchpoint, removeWatchpoint } = this.props;
+
+ if (!item.parent || !item.contents.configurable) {
+ return;
+ }
+
+ if (!item.contents || item.contents.watchpoint) {
+ const removeWatchpointLabel = L10N.getStr("watchpoints.removeWatchpoint");
+
+ const removeWatchpointItem = {
+ id: "node-menu-remove-watchpoint",
+ label: removeWatchpointLabel,
+ disabled: false,
+ click: () => removeWatchpoint(item),
+ };
+
+ const menuItems = [removeWatchpointItem];
+ showMenu(event, menuItems);
+ return;
+ }
+
+ const addSetWatchpointLabel = L10N.getStr("watchpoints.setWatchpoint");
+ const addGetWatchpointLabel = L10N.getStr("watchpoints.getWatchpoint");
+ const addGetOrSetWatchpointLabel = L10N.getStr(
+ "watchpoints.getOrSetWatchpoint"
+ );
+ const watchpointsSubmenuLabel = L10N.getStr("watchpoints.submenu");
+
+ const addSetWatchpointItem = {
+ id: "node-menu-add-set-watchpoint",
+ label: addSetWatchpointLabel,
+ disabled: false,
+ click: () => addWatchpoint(item, "set"),
+ };
+
+ const addGetWatchpointItem = {
+ id: "node-menu-add-get-watchpoint",
+ label: addGetWatchpointLabel,
+ disabled: false,
+ click: () => addWatchpoint(item, "get"),
+ };
+
+ const addGetOrSetWatchpointItem = {
+ id: "node-menu-add-get-watchpoint",
+ label: addGetOrSetWatchpointLabel,
+ disabled: false,
+ click: () => addWatchpoint(item, "getorset"),
+ };
+
+ const watchpointsSubmenuItem = {
+ id: "node-menu-watchpoints",
+ label: watchpointsSubmenuLabel,
+ disabled: false,
+ click: () => addWatchpoint(item, "set"),
+ submenu: [
+ addSetWatchpointItem,
+ addGetWatchpointItem,
+ addGetOrSetWatchpointItem,
+ ],
+ };
+
+ const menuItems = [watchpointsSubmenuItem];
+ showMenu(event, menuItems);
+ };
+
+ renderWatchpointButton = item => {
+ const { removeWatchpoint } = this.props;
+
+ if (
+ !item ||
+ !item.contents ||
+ !item.contents.watchpoint ||
+ typeof L10N === "undefined"
+ ) {
+ return null;
+ }
+
+ const { watchpoint } = item.contents;
+ return (
+ <button
+ className={`remove-watchpoint-${watchpoint}`}
+ title={L10N.getStr("watchpoints.removeWatchpointTooltip")}
+ onClick={e => {
+ e.stopPropagation();
+ removeWatchpoint(item);
+ }}
+ />
+ );
+ };
+
+ renderScopesList() {
+ const {
+ cx,
+ isLoading,
+ openLink,
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ mapScopesEnabled,
+ selectedFrame,
+ setExpandedScope,
+ expandedScopes,
+ } = this.props;
+ const { originalScopes, generatedScopes, showOriginal } = this.state;
+
+ const scopes =
+ (showOriginal && mapScopesEnabled && originalScopes) || generatedScopes;
+
+ function initiallyExpanded(item) {
+ return expandedScopes.some(path => path == getScopeItemPath(item));
+ }
+
+ if (scopes && !!scopes.length && !isLoading) {
+ return (
+ <div className="pane scopes-list">
+ <ObjectInspector
+ roots={scopes}
+ autoExpandAll={false}
+ autoExpandDepth={1}
+ client={clientCommands}
+ createElement={tagName => document.createElement(tagName)}
+ disableWrap={true}
+ dimTopLevelWindow={true}
+ frame={selectedFrame}
+ mayUseCustomFormatter={true}
+ openLink={openLink}
+ onDOMNodeClick={grip => openElementInInspector(grip)}
+ onInspectIconClick={grip => openElementInInspector(grip)}
+ onDOMNodeMouseOver={grip => highlightDomElement(grip)}
+ onDOMNodeMouseOut={grip => unHighlightDomElement(grip)}
+ onContextMenu={this.onContextMenu}
+ setExpanded={(path, expand) => setExpandedScope(cx, path, expand)}
+ initiallyExpanded={initiallyExpanded}
+ renderItemActions={this.renderWatchpointButton}
+ shouldRenderTooltip={true}
+ />
+ </div>
+ );
+ }
+
+ let stateText = L10N.getStr("scopes.notPaused");
+ if (this.props.isPaused) {
+ if (isLoading) {
+ stateText = L10N.getStr("loadingText");
+ } else {
+ stateText = L10N.getStr("scopes.notAvailable");
+ }
+ }
+
+ return (
+ <div className="pane scopes-list">
+ <div className="pane-info">{stateText}</div>
+ </div>
+ );
+ }
+
+ render() {
+ return <div className="scopes-content">{this.renderScopesList()}</div>;
+ }
+}
+
+const mapStateToProps = state => {
+ const cx = getThreadContext(state);
+ const selectedFrame = getSelectedFrame(state, cx.thread);
+ const selectedSource = getSelectedSource(state);
+
+ const { scope: originalFrameScopes, pending: originalPending } =
+ getOriginalFrameScope(
+ state,
+ cx.thread,
+ selectedSource?.id,
+ selectedFrame?.id
+ ) || { scope: null, pending: false };
+
+ const { scope: generatedFrameScopes, pending: generatedPending } =
+ getGeneratedFrameScope(state, cx.thread, selectedFrame?.id) || {
+ scope: null,
+ pending: false,
+ };
+
+ return {
+ cx,
+ selectedFrame,
+ mapScopesEnabled: isMapScopesEnabled(state),
+ isLoading: generatedPending || originalPending,
+ why: getPauseReason(state, cx.thread),
+ originalFrameScopes,
+ generatedFrameScopes,
+ expandedScopes: getLastExpandedScopes(state, cx.thread),
+ isPaused: getIsCurrentThreadPaused(state),
+ };
+};
+
+export default connect(mapStateToProps, {
+ openLink: actions.openLink,
+ openElementInInspector: actions.openElementInInspectorCommand,
+ highlightDomElement: actions.highlightDomElement,
+ unHighlightDomElement: actions.unHighlightDomElement,
+ toggleMapScopes: actions.toggleMapScopes,
+ setExpandedScope: actions.setExpandedScope,
+ addWatchpoint: actions.addWatchpoint,
+ removeWatchpoint: actions.removeWatchpoint,
+})(Scopes);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/SecondaryPanes.css b/devtools/client/debugger/src/components/SecondaryPanes/SecondaryPanes.css
new file mode 100644
index 0000000000..dec84252f8
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/SecondaryPanes.css
@@ -0,0 +1,86 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.secondary-panes {
+ overflow-x: hidden;
+ overflow-y: auto;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ white-space: nowrap;
+ background-color: var(--theme-sidebar-background);
+ --breakpoint-expression-right-clear-space: 36px;
+}
+
+.secondary-panes .controlled > div {
+ max-width: 100%;
+}
+
+/*
+ We apply overflow to the container with the commandbar.
+ This allows the commandbar to remain fixed when scrolling
+ until the content completely ends. Not just the height of
+ the wrapper.
+ Ref: https://github.com/firefox-devtools/debugger/issues/3426
+*/
+
+.secondary-panes-wrapper {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.secondary-panes .accordion {
+ flex: 1 0 auto;
+ margin-bottom: 0;
+}
+
+.secondary-panes-wrapper .accordion li:last-child ._content {
+ border-bottom: 0;
+}
+
+.pane {
+ color: var(--theme-body-color);
+}
+
+.pane .pane-info {
+ font-style: italic;
+ text-align: center;
+ padding: 0.5em;
+ user-select: none;
+ cursor: default;
+}
+
+.secondary-panes .breakpoints-buttons {
+ display: flex;
+}
+
+.dropdown {
+ width: 20em;
+ overflow: auto;
+}
+
+.secondary-panes input[type="checkbox"] {
+ margin: 0;
+ margin-inline-end: 4px;
+ vertical-align: middle;
+}
+
+.secondary-panes-wrapper .command-bar.bottom {
+ background-color: var(--theme-body-background);
+}
+
+/**
+ * Skip Pausing style
+ * Add a gray background and lower content opacity
+ */
+.skip-pausing .xhr-breakpoints-pane ._content,
+.skip-pausing .breakpoints-pane ._content,
+.skip-pausing .event-listeners-pane ._content,
+.skip-pausing .dom-mutations-pane ._content {
+ background-color: var(--skip-pausing-background-color);
+ opacity: var(--skip-pausing-opacity);
+ color: var(--skip-pausing-color);
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Thread.js b/devtools/client/debugger/src/components/SecondaryPanes/Thread.js
new file mode 100644
index 0000000000..c9db8a25ef
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Thread.js
@@ -0,0 +1,70 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+
+import actions from "../../actions";
+import { getCurrentThread, getIsPaused, getContext } from "../../selectors";
+import AccessibleImage from "../shared/AccessibleImage";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+export class Thread extends Component {
+ static get propTypes() {
+ return {
+ currentThread: PropTypes.string.isRequired,
+ cx: PropTypes.object.isRequired,
+ isPaused: PropTypes.bool.isRequired,
+ selectThread: PropTypes.func.isRequired,
+ thread: PropTypes.object.isRequired,
+ };
+ }
+
+ onSelectThread = () => {
+ const { thread } = this.props;
+ this.props.selectThread(this.props.cx, thread.actor);
+ };
+
+ render() {
+ const { currentThread, isPaused, thread } = this.props;
+
+ const isWorker = thread.targetType.includes("worker");
+ let label = thread.name;
+ if (thread.serviceWorkerStatus) {
+ label += ` (${thread.serviceWorkerStatus})`;
+ }
+
+ return (
+ <div
+ className={classnames("thread", {
+ selected: thread.actor == currentThread,
+ })}
+ key={thread.actor}
+ onClick={this.onSelectThread}
+ >
+ <div className="icon">
+ <AccessibleImage className={isWorker ? "worker" : "window"} />
+ </div>
+ <div className="label">{label}</div>
+ {isPaused ? (
+ <div className="pause-badge">
+ <AccessibleImage className="pause" />
+ </div>
+ ) : null}
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = (state, props) => ({
+ cx: getContext(state),
+ currentThread: getCurrentThread(state),
+ isPaused: getIsPaused(state, props.thread.actor),
+});
+
+export default connect(mapStateToProps, {
+ selectThread: actions.selectThread,
+})(Thread);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Threads.css b/devtools/client/debugger/src/components/SecondaryPanes/Threads.css
new file mode 100644
index 0000000000..49e150dd44
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Threads.css
@@ -0,0 +1,63 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.threads-list {
+ padding: 4px 0;
+}
+
+.threads-list * {
+ user-select: none;
+}
+
+.threads-list > .thread {
+ font-size: inherit;
+ color: var(--theme-text-color-strong);
+ padding: 2px 6px;
+ padding-inline-start: 20px;
+ line-height: 16px;
+ position: relative;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+}
+
+.threads-list > .thread:hover {
+ background-color: var(--search-overlays-semitransparent);
+}
+
+.threads-list > .thread.selected {
+ background-color: var(--tab-line-selected-color);
+}
+
+.threads-list .icon {
+ flex: none;
+ margin-inline-end: 4px;
+}
+
+.threads-list .img {
+ display: block;
+}
+
+.threads-list .label {
+ display: inline-block;
+ flex-grow: 1;
+ flex-shrink: 1;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.threads-list .pause-badge {
+ flex: none;
+ margin-inline-start: 4px;
+}
+
+.threads-list > .thread.selected {
+ background: var(--theme-selection-background);
+ color: var(--theme-selection-color);
+}
+
+.threads-list > .thread.selected .img {
+ background-color: currentColor;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Threads.js b/devtools/client/debugger/src/components/SecondaryPanes/Threads.js
new file mode 100644
index 0000000000..4dbf0ff081
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Threads.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+
+import { getAllThreads } from "../../selectors";
+import Thread from "./Thread";
+
+import "./Threads.css";
+
+export class Threads extends Component {
+ static get propTypes() {
+ return {
+ threads: PropTypes.array.isRequired,
+ };
+ }
+
+ render() {
+ const { threads } = this.props;
+
+ return (
+ <div className="pane threads-list">
+ {threads.map(thread => (
+ <Thread thread={thread} key={thread.actor} />
+ ))}
+ </div>
+ );
+ }
+}
+
+const mapStateToProps = state => ({
+ threads: getAllThreads(state),
+});
+
+export default connect(mapStateToProps)(Threads);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.css b/devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.css
new file mode 100644
index 0000000000..cbe2ebf4c9
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.css
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.why-paused {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ border-bottom: 1px solid var(--theme-splitter-color);
+ background-color: hsl(54, 100%, 92%);
+ color: var(--theme-body-color);
+ font-size: 12px;
+ cursor: default;
+ min-height: 44px;
+ padding: 6px;
+ white-space: normal;
+ font-weight: bold;
+}
+
+.why-paused > div {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+.why-paused .info.icon {
+ align-self: center;
+ padding-right: 4px;
+ margin-inline-start: 14px;
+ margin-inline-end: 3px;
+}
+
+.why-paused .pause.reason {
+ display: flex;
+ flex-direction: column;
+ padding-right: 4px;
+}
+
+.theme-dark .secondary-panes .why-paused {
+ background-color: hsl(42, 37%, 19%);
+ color: hsl(43, 94%, 81%);
+}
+
+.why-paused .message {
+ font-style: italic;
+ font-weight: 100;
+}
+
+.why-paused .mutationNode {
+ font-weight: normal;
+}
+
+.why-paused .message.warning {
+ color: var(--theme-graphs-full-red);
+ font-family: var(--monospace-font-family);
+ font-size: 10px;
+ font-style: normal;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.js b/devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.js
new file mode 100644
index 0000000000..5123649f37
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/WhyPaused.js
@@ -0,0 +1,183 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+const {
+ LocalizationProvider,
+ Localized,
+} = require("devtools/client/shared/vendor/fluent-react");
+
+import React, { PureComponent } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import AccessibleImage from "../shared/AccessibleImage";
+import actions from "../../actions";
+
+import Reps from "devtools/client/shared/components/reps/index";
+const {
+ REPS: { Rep },
+ MODE,
+} = Reps;
+
+import { getPauseReason } from "../../utils/pause";
+import {
+ getCurrentThread,
+ getPaneCollapse,
+ getPauseReason as getWhy,
+} from "../../selectors";
+
+import "./WhyPaused.css";
+
+class WhyPaused extends PureComponent {
+ constructor(props) {
+ super(props);
+ this.state = { hideWhyPaused: "" };
+ }
+
+ static get propTypes() {
+ return {
+ delay: PropTypes.number.isRequired,
+ endPanelCollapsed: PropTypes.bool.isRequired,
+ highlightDomElement: PropTypes.func.isRequired,
+ openElementInInspector: PropTypes.func.isRequired,
+ unHighlightDomElement: PropTypes.func.isRequired,
+ why: PropTypes.object,
+ };
+ }
+
+ componentDidUpdate() {
+ const { delay } = this.props;
+
+ if (delay) {
+ setTimeout(() => {
+ this.setState({ hideWhyPaused: "" });
+ }, delay);
+ } else {
+ this.setState({ hideWhyPaused: "pane why-paused" });
+ }
+ }
+
+ renderExceptionSummary(exception) {
+ if (typeof exception === "string") {
+ return exception;
+ }
+
+ const { preview } = exception;
+ if (!preview || !preview.name || !preview.message) {
+ return null;
+ }
+
+ return `${preview.name}: ${preview.message}`;
+ }
+
+ renderMessage(why) {
+ const { type, exception, message } = why;
+
+ if (type == "exception" && exception) {
+ // Our types for 'Why' are too general because 'type' can be 'string'.
+ // $FlowFixMe - We should have a proper discriminating union of reasons.
+ const summary = this.renderExceptionSummary(exception);
+ return <div className="message warning">{summary}</div>;
+ }
+
+ if (type === "mutationBreakpoint" && why.nodeGrip) {
+ const { nodeGrip, ancestorGrip, action } = why;
+ const {
+ openElementInInspector,
+ highlightDomElement,
+ unHighlightDomElement,
+ } = this.props;
+
+ const targetRep = Rep({
+ object: nodeGrip,
+ mode: MODE.TINY,
+ onDOMNodeClick: () => openElementInInspector(nodeGrip),
+ onInspectIconClick: () => openElementInInspector(nodeGrip),
+ onDOMNodeMouseOver: () => highlightDomElement(nodeGrip),
+ onDOMNodeMouseOut: () => unHighlightDomElement(),
+ });
+
+ const ancestorRep = ancestorGrip
+ ? Rep({
+ object: ancestorGrip,
+ mode: MODE.TINY,
+ onDOMNodeClick: () => openElementInInspector(ancestorGrip),
+ onInspectIconClick: () => openElementInInspector(ancestorGrip),
+ onDOMNodeMouseOver: () => highlightDomElement(ancestorGrip),
+ onDOMNodeMouseOut: () => unHighlightDomElement(),
+ })
+ : null;
+
+ return (
+ <div>
+ <div className="message">{why.message}</div>
+ <div className="mutationNode">
+ {ancestorRep}
+ {ancestorGrip ? (
+ <span className="why-paused-ancestor">
+ <Localized
+ id={
+ action === "remove"
+ ? "whypaused-mutation-breakpoint-removed"
+ : "whypaused-mutation-breakpoint-added"
+ }
+ ></Localized>
+ {targetRep}
+ </span>
+ ) : (
+ targetRep
+ )}
+ </div>
+ </div>
+ );
+ }
+
+ if (typeof message == "string") {
+ return <div className="message">{message}</div>;
+ }
+
+ return null;
+ }
+
+ render() {
+ const { endPanelCollapsed, why } = this.props;
+ const { fluentBundles } = this.context;
+ const reason = getPauseReason(why);
+
+ if (!why || !reason || endPanelCollapsed) {
+ return <div className={this.state.hideWhyPaused} />;
+ }
+ return (
+ // We're rendering the LocalizationProvider component from here and not in an upper
+ // component because it does set a new context, overriding the context that we set
+ // in the first place in <App>, which breaks some components.
+ // This should be fixed in Bug 1743155.
+ <LocalizationProvider bundles={fluentBundles || []}>
+ <div className="pane why-paused">
+ <div>
+ <div className="info icon">
+ <AccessibleImage className="info" />
+ </div>
+ <div className="pause reason">
+ <Localized id={reason}></Localized>
+ {this.renderMessage(why)}
+ </div>
+ </div>
+ </div>
+ </LocalizationProvider>
+ );
+ }
+}
+
+WhyPaused.contextTypes = { fluentBundles: PropTypes.array };
+
+const mapStateToProps = state => ({
+ endPanelCollapsed: getPaneCollapse(state, "end"),
+ why: getWhy(state, getCurrentThread(state)),
+});
+
+export default connect(mapStateToProps, {
+ openElementInInspector: actions.openElementInInspectorCommand,
+ highlightDomElement: actions.highlightDomElement,
+ unHighlightDomElement: actions.unHighlightDomElement,
+})(WhyPaused);
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.css b/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.css
new file mode 100644
index 0000000000..5f0352a93c
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.css
@@ -0,0 +1,131 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+.xhr-breakpoints-pane ._content {
+ overflow-x: auto;
+}
+
+.xhr-input-container {
+ display: flex;
+ border: 1px solid transparent;
+}
+
+.xhr-input-container.focused {
+ border: 1px solid var(--theme-highlight-blue);
+}
+
+:root.theme-dark .xhr-input-container.focused {
+ border: 1px solid var(--blue-50);
+}
+
+.xhr-input-container.error {
+ border: 1px solid red;
+}
+
+.xhr-input-form {
+ display: inline-flex;
+ width: 100%;
+ padding-inline-start: 20px;
+ padding-inline-end: 12px;
+ /* Stop select height from increasing as input height increases */
+ align-items: center;
+}
+
+.xhr-checkbox {
+ margin-inline-start: 0;
+ margin-inline-end: 4px;
+}
+
+.xhr-input-url {
+ border: 1px;
+ flex-grow: 1;
+ background-color: var(--theme-sidebar-background);
+ font-size: inherit;
+ height: 24px;
+ color: var(--theme-body-color);
+}
+
+.xhr-input-url::placeholder {
+ color: var(--theme-text-color-alt);
+ opacity: 1;
+}
+
+.xhr-input-url:focus {
+ cursor: text;
+ outline: none;
+}
+
+.expressions-list .xhr-input-container {
+ height: var(--expression-item-height);
+}
+
+.expressions-list .xhr-input-url {
+ /* Prevent vertical bounce when editing an existing XHR Breakpoint */
+ height: 100%;
+}
+
+.xhr-container {
+ border-left: 4px solid transparent;
+ width: 100%;
+ color: var(--theme-body-color);
+ padding-inline-start: 16px;
+ padding-inline-end: 12px;
+ display: flex;
+ align-items: center;
+ position: relative;
+ height: var(--expression-item-height);
+}
+
+:root.theme-light .xhr-container:hover {
+ background-color: var(--search-overlays-semitransparent);
+}
+
+:root.theme-dark .xhr-container:hover {
+ background-color: var(--search-overlays-semitransparent);
+}
+
+.xhr-label-method {
+ line-height: 14px;
+ display: inline-block;
+ margin-inline-end: 2px;
+}
+
+.xhr-input-method {
+ display: none;
+ /* Vertically center select in form */
+ margin-top: 2px;
+}
+
+.expressions-list .xhr-input-method {
+ margin-top: 0px;
+}
+
+.xhr-input-container.focused .xhr-input-method {
+ display: block;
+}
+
+.xhr-label-url {
+ max-width: calc(100% - var(--breakpoint-expression-right-clear-space));
+ color: var(--theme-comment);
+ display: inline-block;
+ cursor: text;
+ flex-grow: 1;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ padding: 0px 2px 0px 2px;
+ line-height: 14px;
+}
+
+.xhr-container label {
+ flex-grow: 1;
+ display: flex;
+ align-items: center;
+ overflow-x: hidden;
+}
+
+.xhr-container__close-btn {
+ display: flex;
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
diff --git a/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js b/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js
new file mode 100644
index 0000000000..721b132a3b
--- /dev/null
+++ b/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js
@@ -0,0 +1,361 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+import React, { Component } from "react";
+import PropTypes from "prop-types";
+import { connect } from "../../utils/connect";
+import actions from "../../actions";
+
+import { CloseButton } from "../shared/Button";
+
+import "./XHRBreakpoints.css";
+import { getXHRBreakpoints, shouldPauseOnAnyXHR } from "../../selectors";
+import ExceptionOption from "./Breakpoints/ExceptionOption";
+
+const classnames = require("devtools/client/shared/classnames.js");
+
+// At present, the "Pause on any URL" checkbox creates an xhrBreakpoint
+// of "ANY" with no path, so we can remove that before creating the list
+function getExplicitXHRBreakpoints(xhrBreakpoints) {
+ return xhrBreakpoints.filter(bp => bp.path !== "");
+}
+
+const xhrMethods = [
+ "ANY",
+ "GET",
+ "POST",
+ "PUT",
+ "HEAD",
+ "DELETE",
+ "PATCH",
+ "OPTIONS",
+];
+
+class XHRBreakpoints extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ editing: false,
+ inputValue: "",
+ inputMethod: "ANY",
+ focused: false,
+ editIndex: -1,
+ clickedOnFormElement: false,
+ };
+ }
+
+ static get propTypes() {
+ return {
+ disableXHRBreakpoint: PropTypes.func.isRequired,
+ enableXHRBreakpoint: PropTypes.func.isRequired,
+ onXHRAdded: PropTypes.func.isRequired,
+ removeXHRBreakpoint: PropTypes.func.isRequired,
+ setXHRBreakpoint: PropTypes.func.isRequired,
+ shouldPauseOnAny: PropTypes.bool.isRequired,
+ showInput: PropTypes.bool.isRequired,
+ togglePauseOnAny: PropTypes.func.isRequired,
+ updateXHRBreakpoint: PropTypes.func.isRequired,
+ xhrBreakpoints: PropTypes.array.isRequired,
+ };
+ }
+
+ componentDidMount() {
+ const { showInput } = this.props;
+
+ // Ensures that the input is focused when the "+"
+ // is clicked while the panel is collapsed
+ if (this._input && showInput) {
+ this._input.focus();
+ }
+ }
+
+ componentDidUpdate(prevProps, prevState) {
+ const input = this._input;
+
+ if (!input) {
+ return;
+ }
+
+ if (!prevState.editing && this.state.editing) {
+ input.setSelectionRange(0, input.value.length);
+ input.focus();
+ } else if (this.props.showInput && !this.state.focused) {
+ input.focus();
+ }
+ }
+
+ handleNewSubmit = e => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ const setXHRBreakpoint = function () {
+ this.props.setXHRBreakpoint(
+ this.state.inputValue,
+ this.state.inputMethod
+ );
+ this.hideInput();
+ };
+
+ // force update inputMethod in state for mochitest purposes
+ // before setting XHR breakpoint
+ this.setState(
+ { inputMethod: e.target.children[1].value },
+ setXHRBreakpoint
+ );
+ };
+
+ handleExistingSubmit = e => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ const { editIndex, inputValue, inputMethod } = this.state;
+ const { xhrBreakpoints } = this.props;
+ const { path, method } = xhrBreakpoints[editIndex];
+
+ if (path !== inputValue || method != inputMethod) {
+ this.props.updateXHRBreakpoint(editIndex, inputValue, inputMethod);
+ }
+
+ this.hideInput();
+ };
+
+ handleChange = e => {
+ this.setState({ inputValue: e.target.value });
+ };
+
+ handleMethodChange = e => {
+ this.setState({
+ focused: true,
+ editing: true,
+ inputMethod: e.target.value,
+ });
+ };
+
+ hideInput = () => {
+ if (this.state.clickedOnFormElement) {
+ this.setState({
+ focused: true,
+ clickedOnFormElement: false,
+ });
+ } else {
+ this.setState({
+ focused: false,
+ editing: false,
+ editIndex: -1,
+ inputValue: "",
+ inputMethod: "ANY",
+ });
+ this.props.onXHRAdded();
+ }
+ };
+
+ onFocus = () => {
+ this.setState({ focused: true, editing: true });
+ };
+
+ onMouseDown = e => {
+ this.setState({ editing: false, clickedOnFormElement: true });
+ };
+
+ handleTab = e => {
+ if (e.key !== "Tab") {
+ return;
+ }
+
+ if (e.currentTarget.nodeName === "INPUT") {
+ this.setState({
+ clickedOnFormElement: true,
+ editing: false,
+ });
+ } else if (e.currentTarget.nodeName === "SELECT" && !e.shiftKey) {
+ // The user has tabbed off the select and we should
+ // cancel the edit
+ this.hideInput();
+ }
+ };
+
+ editExpression = index => {
+ const { xhrBreakpoints } = this.props;
+ const { path, method } = xhrBreakpoints[index];
+ this.setState({
+ inputValue: path,
+ inputMethod: method,
+ editing: true,
+ editIndex: index,
+ });
+ };
+
+ renderXHRInput(onSubmit) {
+ const { focused, inputValue } = this.state;
+ const placeholder = L10N.getStr("xhrBreakpoints.placeholder");
+
+ return (
+ <form
+ key="xhr-input-container"
+ className={classnames("xhr-input-container xhr-input-form", {
+ focused,
+ })}
+ onSubmit={onSubmit}
+ >
+ <input
+ className="xhr-input-url"
+ type="text"
+ placeholder={placeholder}
+ onChange={this.handleChange}
+ onBlur={this.hideInput}
+ onFocus={this.onFocus}
+ value={inputValue}
+ onKeyDown={this.handleTab}
+ ref={c => (this._input = c)}
+ />
+ {this.renderMethodSelectElement()}
+ <input type="submit" style={{ display: "none" }} />
+ </form>
+ );
+ }
+
+ handleCheckbox = index => {
+ const { xhrBreakpoints, enableXHRBreakpoint, disableXHRBreakpoint } =
+ this.props;
+ const breakpoint = xhrBreakpoints[index];
+ if (breakpoint.disabled) {
+ enableXHRBreakpoint(index);
+ } else {
+ disableXHRBreakpoint(index);
+ }
+ };
+
+ renderBreakpoint = breakpoint => {
+ const { path, disabled, method } = breakpoint;
+ const { editIndex } = this.state;
+ const { removeXHRBreakpoint, xhrBreakpoints } = this.props;
+
+ // The "pause on any" checkbox
+ if (!path) {
+ return null;
+ }
+
+ // Finds the xhrbreakpoint so as to not make assumptions about position
+ const index = xhrBreakpoints.findIndex(
+ bp => bp.path === path && bp.method === method
+ );
+
+ if (index === editIndex) {
+ return this.renderXHRInput(this.handleExistingSubmit);
+ }
+
+ return (
+ <li
+ className="xhr-container"
+ key={`${path}-${method}`}
+ title={path}
+ onDoubleClick={(items, options) => this.editExpression(index)}
+ >
+ <label>
+ <input
+ type="checkbox"
+ className="xhr-checkbox"
+ checked={!disabled}
+ onChange={() => this.handleCheckbox(index)}
+ onClick={ev => ev.stopPropagation()}
+ />
+ <div className="xhr-label-method">{method}</div>
+ <div className="xhr-label-url">{path}</div>
+ <div className="xhr-container__close-btn">
+ <CloseButton handleClick={e => removeXHRBreakpoint(index)} />
+ </div>
+ </label>
+ </li>
+ );
+ };
+
+ renderBreakpoints = explicitXhrBreakpoints => {
+ const { showInput } = this.props;
+
+ return (
+ <>
+ <ul className="pane expressions-list">
+ {explicitXhrBreakpoints.map(this.renderBreakpoint)}
+ </ul>
+ {showInput && this.renderXHRInput(this.handleNewSubmit)}
+ </>
+ );
+ };
+
+ renderCheckbox = explicitXhrBreakpoints =>