@browserless.io/browserless 2.2.0-beta-6 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -2
- package/bin/browserless.js +1 -1
- package/bin/scaffold/README.md +8 -7
- package/build/browserless.js +7 -6
- package/build/browsers/chrome.cdp.d.ts +6 -0
- package/build/browsers/chrome.cdp.js +6 -0
- package/build/browsers/chrome.playwright.d.ts +6 -0
- package/build/browsers/chrome.playwright.js +6 -0
- package/build/browsers/{cdp-chromium.d.ts → chromium.cdp.d.ts} +3 -2
- package/build/browsers/{cdp-chromium.js → chromium.cdp.js} +16 -10
- package/build/browsers/{playwright-chromium.d.ts → chromium.playwright.d.ts} +3 -2
- package/build/browsers/{playwright-chromium.js → chromium.playwright.js} +6 -5
- package/build/browsers/{playwright-firefox.d.ts → firefox.playwright.d.ts} +2 -2
- package/build/browsers/{playwright-firefox.js → firefox.playwright.js} +4 -4
- package/build/browsers/index.d.ts +20 -10
- package/build/browsers/index.js +110 -11
- package/build/browsers/{playwright-webkit.d.ts → webkit.playwright.d.ts} +2 -2
- package/build/browsers/{playwright-webkit.js → webkit.playwright.js} +4 -4
- package/build/data/selectors.json +1 -1
- package/build/exports.d.ts +6 -4
- package/build/exports.js +6 -4
- package/build/http.d.ts +22 -1
- package/build/http.js +21 -0
- package/build/router.js +19 -3
- package/build/routes/{chromium/http/content-post.body.json → chrome/http/content.post.body.json} +8 -8
- package/build/routes/chrome/http/content.post.d.ts +7 -0
- package/build/routes/chrome/http/content.post.js +6 -0
- package/build/routes/chrome/http/download.post.d.ts +7 -0
- package/build/routes/chrome/http/download.post.js +6 -0
- package/build/routes/chrome/http/function.post.d.ts +7 -0
- package/build/routes/chrome/http/function.post.js +6 -0
- package/build/routes/chrome/http/json-list.get.d.ts +1 -0
- package/build/routes/chrome/http/json-list.get.js +1 -0
- package/build/routes/chrome/http/json-new.put.d.ts +1 -0
- package/build/routes/chrome/http/json-new.put.js +1 -0
- package/build/routes/chrome/http/json-protocol.get.d.ts +1 -0
- package/build/routes/chrome/http/json-protocol.get.js +1 -0
- package/build/routes/chrome/http/json-version.get.d.ts +1 -0
- package/build/routes/chrome/http/json-version.get.js +1 -0
- package/build/routes/chrome/http/json-version.get.response.json +44 -0
- package/build/routes/{chromium/http/pdf-post.body.json → chrome/http/pdf.post.body.json} +8 -8
- package/build/routes/chrome/http/pdf.post.d.ts +7 -0
- package/build/routes/chrome/http/pdf.post.js +6 -0
- package/build/routes/chrome/http/performance.post.d.ts +7 -0
- package/build/routes/chrome/http/performance.post.js +6 -0
- package/build/routes/{chromium/http/scrape-post.body.json → chrome/http/scrape.post.body.json} +8 -8
- package/build/routes/chrome/http/scrape.post.d.ts +7 -0
- package/build/routes/chrome/http/scrape.post.js +6 -0
- package/build/routes/{chromium/http/screenshot-post.body.json → chrome/http/screenshot.post.body.json} +8 -8
- package/build/routes/chrome/http/screenshot.post.d.ts +7 -0
- package/build/routes/chrome/http/screenshot.post.js +6 -0
- package/build/routes/chrome/tests/content.spec.js +311 -0
- package/build/routes/chrome/tests/download.spec.js +67 -0
- package/build/routes/chrome/tests/function.spec.d.ts +1 -0
- package/build/routes/chrome/tests/function.spec.js +245 -0
- package/build/routes/chrome/tests/json-version.spec.d.ts +1 -0
- package/build/routes/chrome/tests/json-version.spec.js +37 -0
- package/build/routes/chrome/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/chrome/tests/page-websocket.spec.js +97 -0
- package/build/routes/chrome/tests/pdf.spec.d.ts +1 -0
- package/build/routes/chrome/tests/pdf.spec.js +333 -0
- package/build/routes/chrome/tests/performance.spec.d.ts +1 -0
- package/build/routes/chrome/tests/performance.spec.js +124 -0
- package/build/routes/chrome/tests/scrape.spec.d.ts +1 -0
- package/build/routes/chrome/tests/scrape.spec.js +354 -0
- package/build/routes/chrome/tests/screenshot.spec.d.ts +1 -0
- package/build/routes/chrome/tests/screenshot.spec.js +339 -0
- package/build/routes/chrome/tests/websocket.spec.d.ts +1 -0
- package/build/routes/chrome/tests/websocket.spec.js +371 -0
- package/build/routes/chrome/ws/browser.d.ts +6 -0
- package/build/routes/chrome/ws/browser.js +5 -0
- package/build/routes/chrome/ws/cdp.d.ts +7 -0
- package/build/routes/chrome/ws/cdp.js +6 -0
- package/build/routes/chrome/ws/cdp.query.json +120 -0
- package/build/routes/chrome/ws/page.d.ts +6 -0
- package/build/routes/chrome/ws/page.js +5 -0
- package/build/routes/chrome/ws/page.query.json +120 -0
- package/build/routes/chrome/ws/playwright.d.ts +7 -0
- package/build/routes/chrome/ws/playwright.js +6 -0
- package/build/routes/chromium/http/content.post.body.json +510 -0
- package/build/routes/chromium/http/content.post.d.ts +1 -0
- package/build/routes/chromium/http/content.post.js +1 -0
- package/build/routes/chromium/http/content.post.query.json +183 -0
- package/build/routes/chromium/http/content.post.response.json +5 -0
- package/build/routes/chromium/http/download.post.body.json +32 -0
- package/build/routes/chromium/http/download.post.d.ts +1 -0
- package/build/routes/chromium/http/download.post.js +1 -0
- package/build/routes/chromium/http/download.post.query.json +120 -0
- package/build/routes/chromium/http/download.post.response.json +4 -0
- package/build/routes/chromium/http/function.post.body.json +32 -0
- package/build/routes/chromium/http/function.post.d.ts +1 -0
- package/build/routes/chromium/http/function.post.js +1 -0
- package/build/routes/chromium/http/function.post.query.json +120 -0
- package/build/routes/chromium/http/function.post.response.json +4 -0
- package/build/routes/chromium/http/json-list.get.d.ts +1 -0
- package/build/routes/chromium/http/json-list.get.js +1 -0
- package/build/routes/chromium/http/json-list.get.response.json +52 -0
- package/build/routes/chromium/http/json-new.put.d.ts +1 -0
- package/build/routes/chromium/http/json-new.put.js +1 -0
- package/build/routes/chromium/http/json-new.put.response.json +44 -0
- package/build/routes/chromium/http/json-protocol.get.d.ts +1 -0
- package/build/routes/chromium/http/json-protocol.get.js +1 -0
- package/build/routes/chromium/http/json-protocol.get.response.json +6 -0
- package/build/routes/chromium/http/json-version.get.d.ts +1 -0
- package/build/routes/chromium/http/json-version.get.js +1 -0
- package/build/routes/chromium/http/json-version.get.response.json +44 -0
- package/build/routes/chromium/http/pdf.post.body.json +654 -0
- package/build/routes/chromium/http/pdf.post.d.ts +1 -0
- package/build/routes/chromium/http/pdf.post.js +1 -0
- package/build/routes/chromium/http/pdf.post.query.json +120 -0
- package/build/routes/chromium/http/pdf.post.response.json +5 -0
- package/build/routes/chromium/http/performance.post.body.json +26 -0
- package/build/routes/chromium/http/performance.post.d.ts +1 -0
- package/build/routes/chromium/http/performance.post.js +1 -0
- package/build/routes/chromium/http/performance.post.query.json +120 -0
- package/build/routes/chromium/http/performance.post.response.json +7 -0
- package/build/routes/chromium/http/scrape.post.body.json +557 -0
- package/build/routes/chromium/http/scrape.post.d.ts +1 -0
- package/build/routes/chromium/http/scrape.post.js +1 -0
- package/build/routes/chromium/http/scrape.post.query.json +183 -0
- package/build/routes/chromium/http/scrape.post.response.json +309 -0
- package/build/routes/chromium/http/screenshot.post.body.json +600 -0
- package/build/routes/chromium/http/screenshot.post.d.ts +1 -0
- package/build/routes/chromium/http/screenshot.post.js +1 -0
- package/build/routes/chromium/http/screenshot.post.query.json +120 -0
- package/build/routes/chromium/http/screenshot.post.response.json +5 -0
- package/build/routes/chromium/tests/content.spec.js +16 -16
- package/build/routes/chromium/tests/download.spec.js +3 -3
- package/build/routes/chromium/tests/function.spec.js +10 -10
- package/build/routes/chromium/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/chromium/tests/page-websocket.spec.js +97 -0
- package/build/routes/chromium/tests/pdf.spec.js +16 -16
- package/build/routes/chromium/tests/performance.spec.js +7 -7
- package/build/routes/chromium/tests/scrape.spec.js +15 -15
- package/build/routes/chromium/tests/screenshot.spec.js +17 -17
- package/build/routes/chromium/tests/websocket.spec.js +31 -37
- package/build/routes/chromium/ws/browser.d.ts +1 -16
- package/build/routes/chromium/ws/browser.js +1 -10
- package/build/routes/chromium/ws/cdp.d.ts +1 -0
- package/build/routes/chromium/ws/cdp.js +1 -0
- package/build/routes/chromium/ws/cdp.query.json +120 -0
- package/build/routes/chromium/ws/page.d.ts +1 -16
- package/build/routes/chromium/ws/page.js +1 -10
- package/build/routes/chromium/ws/playwright.d.ts +1 -0
- package/build/routes/chromium/ws/playwright.js +1 -0
- package/build/routes/firefox/ws/{playwright-firefox.d.ts → playwright.d.ts} +5 -5
- package/build/routes/firefox/ws/{playwright-firefox.js → playwright.js} +4 -4
- package/build/routes/management/http/{sessions-get.response.json → sessions.get.response.json} +11 -1
- package/build/routes/management/http/{static-get.js → static.get.js} +2 -2
- package/build/routes/webkit/ws/{playwright-webkit.d.ts → playwright.d.ts} +5 -5
- package/build/routes/webkit/ws/{playwright-webkit.js → playwright.js} +4 -4
- package/build/routes/webkit/ws/playwright.query.json +100 -0
- package/build/{routes/chromium/ws/cdp-chromium.d.ts → shared/browser.ws.d.ts} +4 -4
- package/build/shared/browser.ws.js +12 -0
- package/build/{routes/chromium/ws/playwright-chromium.d.ts → shared/chromium.playwright.ws.d.ts} +4 -4
- package/build/{routes/chromium/ws/playwright-chromium.js → shared/chromium.playwright.ws.js} +6 -3
- package/build/shared/chromium.ws.d.ts +16 -0
- package/build/shared/chromium.ws.js +10 -0
- package/build/{routes/chromium/http/content-post.d.ts → shared/content.http.d.ts} +3 -3
- package/build/{routes/chromium/http/content-post.js → shared/content.http.js} +3 -3
- package/build/{routes/chromium/http/download-post.d.ts → shared/download.http.d.ts} +3 -3
- package/build/{routes/chromium/http/download-post.js → shared/download.http.js} +4 -4
- package/build/{routes/chromium/http/function-post.d.ts → shared/function.http.d.ts} +3 -3
- package/build/{routes/chromium/http/function-post.js → shared/function.http.js} +4 -4
- package/build/{routes/chromium/http/json-new.d.ts → shared/json-list.http.d.ts} +2 -3
- package/build/{routes/chromium/http/json-list.js → shared/json-list.http.js} +5 -8
- package/build/{routes/chromium/http/json-list.d.ts → shared/json-new.http.d.ts} +2 -3
- package/build/shared/json-new.http.js +34 -0
- package/build/{routes/chromium/http/json-protocol-get.js → shared/json-protocol.http.js} +2 -2
- package/build/{routes/chromium/http/json-version-get.js → shared/json-version.http.js} +3 -3
- package/build/shared/page.ws.d.ts +16 -0
- package/build/shared/page.ws.js +13 -0
- package/build/{routes/chromium/http/pdf-post.d.ts → shared/pdf.http.d.ts} +3 -3
- package/build/{routes/chromium/http/pdf-post.js → shared/pdf.http.js} +3 -3
- package/build/{routes/chromium/http/performance.d.ts → shared/performance.http.d.ts} +3 -3
- package/build/{routes/chromium/http/performance.js → shared/performance.http.js} +4 -4
- package/build/{routes/chromium/http/scrape-post.d.ts → shared/scrape.http.d.ts} +3 -3
- package/build/{routes/chromium/http/scrape-post.js → shared/scrape.http.js} +3 -3
- package/build/{routes/chromium/http/screenshot-post.d.ts → shared/screenshot.http.d.ts} +3 -3
- package/build/{routes/chromium/http/screenshot-post.js → shared/screenshot.http.js} +3 -3
- package/build/shared/utils/performance/child.d.ts +1 -0
- package/build/{routes/chromium → shared}/utils/performance/main.js +1 -1
- package/build/shared/utils/performance/types.js +1 -0
- package/build/shim.js +2 -1
- package/build/types.d.ts +10 -8
- package/build/utils.d.ts +8 -3
- package/build/utils.js +24 -11
- package/docker/base/Dockerfile +1 -1
- package/docker/chrome/Dockerfile +4 -4
- package/docker/chromium/.dockerignore +16 -0
- package/docker/chromium/Dockerfile +40 -0
- package/docker/firefox/Dockerfile +1 -1
- package/docker/multi/Dockerfile +13 -1
- package/docker/webkit/Dockerfile +1 -1
- package/extensions/ublock/3p-filters.html +1 -1
- package/extensions/ublock/_locales/ar/messages.json +4 -0
- package/extensions/ublock/_locales/az/messages.json +4 -0
- package/extensions/ublock/_locales/be/messages.json +4 -0
- package/extensions/ublock/_locales/bg/messages.json +5 -1
- package/extensions/ublock/_locales/bn/messages.json +4 -0
- package/extensions/ublock/_locales/br_FR/messages.json +6 -2
- package/extensions/ublock/_locales/bs/messages.json +4 -0
- package/extensions/ublock/_locales/ca/messages.json +4 -0
- package/extensions/ublock/_locales/cs/messages.json +4 -0
- package/extensions/ublock/_locales/cv/messages.json +4 -0
- package/extensions/ublock/_locales/cy/messages.json +1294 -0
- package/extensions/ublock/_locales/da/messages.json +4 -0
- package/extensions/ublock/_locales/de/messages.json +5 -1
- package/extensions/ublock/_locales/el/messages.json +4 -0
- package/extensions/ublock/_locales/en/messages.json +4 -0
- package/extensions/ublock/_locales/en_GB/messages.json +4 -0
- package/extensions/ublock/_locales/eo/messages.json +9 -5
- package/extensions/ublock/_locales/es/messages.json +4 -0
- package/extensions/ublock/_locales/et/messages.json +4 -0
- package/extensions/ublock/_locales/eu/messages.json +8 -4
- package/extensions/ublock/_locales/fa/messages.json +4 -0
- package/extensions/ublock/_locales/fi/messages.json +4 -0
- package/extensions/ublock/_locales/fil/messages.json +4 -0
- package/extensions/ublock/_locales/fr/messages.json +4 -0
- package/extensions/ublock/_locales/fy/messages.json +4 -0
- package/extensions/ublock/_locales/gl/messages.json +4 -0
- package/extensions/ublock/_locales/gu/messages.json +4 -0
- package/extensions/ublock/_locales/he/messages.json +4 -0
- package/extensions/ublock/_locales/hi/messages.json +4 -0
- package/extensions/ublock/_locales/hr/messages.json +4 -0
- package/extensions/ublock/_locales/hu/messages.json +4 -0
- package/extensions/ublock/_locales/hy/messages.json +4 -0
- package/extensions/ublock/_locales/id/messages.json +5 -1
- package/extensions/ublock/_locales/it/messages.json +4 -0
- package/extensions/ublock/_locales/ja/messages.json +4 -0
- package/extensions/ublock/_locales/ka/messages.json +34 -30
- package/extensions/ublock/_locales/kk/messages.json +4 -0
- package/extensions/ublock/_locales/kn/messages.json +4 -0
- package/extensions/ublock/_locales/ko/messages.json +4 -0
- package/extensions/ublock/_locales/ku/messages.json +4 -0
- package/extensions/ublock/_locales/lt/messages.json +4 -0
- package/extensions/ublock/_locales/lv/messages.json +4 -0
- package/extensions/ublock/_locales/mk/messages.json +4 -0
- package/extensions/ublock/_locales/ml/messages.json +4 -0
- package/extensions/ublock/_locales/mr/messages.json +4 -0
- package/extensions/ublock/_locales/ms/messages.json +13 -9
- package/extensions/ublock/_locales/nb/messages.json +4 -0
- package/extensions/ublock/_locales/nl/messages.json +4 -0
- package/extensions/ublock/_locales/no/messages.json +4 -0
- package/extensions/ublock/_locales/oc/messages.json +4 -0
- package/extensions/ublock/_locales/pa/messages.json +4 -0
- package/extensions/ublock/_locales/pl/messages.json +5 -1
- package/extensions/ublock/_locales/pt_BR/messages.json +4 -0
- package/extensions/ublock/_locales/pt_PT/messages.json +4 -0
- package/extensions/ublock/_locales/ro/messages.json +5 -1
- package/extensions/ublock/_locales/ru/messages.json +4 -0
- package/extensions/ublock/_locales/si/messages.json +4 -0
- package/extensions/ublock/_locales/sk/messages.json +4 -0
- package/extensions/ublock/_locales/sl/messages.json +4 -0
- package/extensions/ublock/_locales/so/messages.json +4 -0
- package/extensions/ublock/_locales/sq/messages.json +4 -0
- package/extensions/ublock/_locales/sr/messages.json +4 -0
- package/extensions/ublock/_locales/sv/messages.json +4 -0
- package/extensions/ublock/_locales/sw/messages.json +4 -0
- package/extensions/ublock/_locales/ta/messages.json +4 -0
- package/extensions/ublock/_locales/te/messages.json +4 -0
- package/extensions/ublock/_locales/th/messages.json +12 -8
- package/extensions/ublock/_locales/tr/messages.json +4 -0
- package/extensions/ublock/_locales/uk/messages.json +4 -0
- package/extensions/ublock/_locales/ur/messages.json +4 -0
- package/extensions/ublock/_locales/vi/messages.json +4 -0
- package/extensions/ublock/_locales/zh_CN/messages.json +6 -2
- package/extensions/ublock/_locales/zh_TW/messages.json +6 -2
- package/extensions/ublock/assets/assets.json +11 -11
- package/extensions/ublock/assets/resources/scriptlets.js +660 -378
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +7173 -3455
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +18829 -1918
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +21 -26
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +118 -46
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +710 -1117
- package/extensions/ublock/assets/ublock/badlists.txt +0 -4
- package/extensions/ublock/assets/ublock/badware.min.txt +116 -105
- package/extensions/ublock/assets/ublock/filters.min.txt +1443 -1097
- package/extensions/ublock/assets/ublock/privacy.min.txt +50 -31
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +97 -108
- package/extensions/ublock/assets/ublock/unbreak.min.txt +64 -21
- package/extensions/ublock/css/1p-filters.css +4 -0
- package/extensions/ublock/css/3p-filters.css +6 -4
- package/extensions/ublock/css/common.css +1 -1
- package/extensions/ublock/css/fa-icons.css +1 -0
- package/extensions/ublock/css/logger-ui.css +72 -52
- package/extensions/ublock/css/popup-fenix.css +1 -1
- package/extensions/ublock/img/fontawesome/fontawesome-defs.svg +1 -0
- package/extensions/ublock/js/3p-filters.js +3 -3
- package/extensions/ublock/js/assets.js +7 -4
- package/extensions/ublock/js/background.js +1 -3
- package/extensions/ublock/js/benchmarks.js +1 -0
- package/extensions/ublock/js/broadcast.js +12 -0
- package/extensions/ublock/js/click2load.js +2 -3
- package/extensions/ublock/js/codemirror/ubo-static-filtering.js +1 -0
- package/extensions/ublock/js/commands.js +10 -0
- package/extensions/ublock/js/contentscript-extra.js +13 -11
- package/extensions/ublock/js/contentscript.js +0 -31
- package/extensions/ublock/js/contextmenu.js +5 -1
- package/extensions/ublock/js/dyna-rules.js +83 -52
- package/extensions/ublock/js/fa-icons.js +1 -0
- package/extensions/ublock/js/filtering-context.js +0 -2
- package/extensions/ublock/js/i18n.js +1 -5
- package/extensions/ublock/js/logger-ui.js +71 -38
- package/extensions/ublock/js/logger.js +18 -14
- package/extensions/ublock/js/messaging.js +17 -5
- package/extensions/ublock/js/popup-fenix.js +6 -6
- package/extensions/ublock/js/scriptlet-filtering-core.js +14 -12
- package/extensions/ublock/js/scriptlet-filtering.js +149 -53
- package/extensions/ublock/js/scriptlets/scriptlet-loglevel-1.js +49 -0
- package/extensions/ublock/js/scriptlets/scriptlet-loglevel-2.js +49 -0
- package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -1
- package/extensions/ublock/js/static-dnr-filtering.js +4 -2
- package/extensions/ublock/js/static-filtering-parser.js +14 -8
- package/extensions/ublock/js/static-net-filtering.js +32 -30
- package/extensions/ublock/js/storage.js +18 -4
- package/extensions/ublock/js/traffic.js +3 -3
- package/extensions/ublock/js/ublock.js +1 -1
- package/extensions/ublock/js/vapi-background.js +15 -7
- package/extensions/ublock/logger-ui.html +18 -10
- package/extensions/ublock/manifest.json +4 -1
- package/extensions/ublock/web_accessible_resources/chartbeat.js +3 -0
- package/package.json +12 -11
- package/scripts/build-function.js +1 -1
- package/scripts/build-open-api.js +3 -2
- package/scripts/clean.js +6 -1
- package/scripts/install-debugger.js +20 -0
- package/scripts/install-devtools.js +40 -0
- package/src/browserless.ts +11 -9
- package/src/browsers/chrome.cdp.ts +10 -0
- package/src/browsers/chrome.playwright.ts +10 -0
- package/src/browsers/{cdp-chromium.ts → chromium.cdp.ts} +20 -13
- package/src/browsers/{playwright-chromium.ts → chromium.playwright.ts} +7 -6
- package/src/browsers/{playwright-firefox.ts → firefox.playwright.ts} +5 -5
- package/src/browsers/index.ts +160 -23
- package/src/browsers/{playwright-webkit.ts → webkit.playwright.ts} +5 -5
- package/src/exports.ts +6 -4
- package/src/http.ts +21 -0
- package/src/router.ts +21 -5
- package/src/routes/chrome/http/content.post.ts +14 -0
- package/src/routes/chrome/http/download.post.ts +14 -0
- package/src/routes/chrome/http/function.post.ts +14 -0
- package/src/routes/chrome/http/json-list.get.ts +1 -0
- package/src/routes/chrome/http/json-new.put.ts +1 -0
- package/src/routes/chrome/http/json-protocol.get.ts +1 -0
- package/src/routes/chrome/http/json-version.get.ts +1 -0
- package/src/routes/chrome/http/pdf.post.ts +14 -0
- package/src/routes/chrome/http/performance.post.ts +14 -0
- package/src/routes/chrome/http/scrape.post.ts +14 -0
- package/src/routes/chrome/http/screenshot.post.ts +14 -0
- package/src/routes/chrome/tests/content.spec.ts +375 -0
- package/src/routes/chrome/tests/download.spec.ts +77 -0
- package/src/routes/chrome/tests/function.spec.ts +282 -0
- package/src/routes/chrome/tests/json-version.spec.ts +52 -0
- package/src/routes/chrome/tests/page-websocket.spec.ts +129 -0
- package/src/routes/chrome/tests/pdf.spec.ts +380 -0
- package/src/routes/chrome/tests/performance.spec.ts +155 -0
- package/src/routes/chrome/tests/scrape.spec.ts +417 -0
- package/src/routes/chrome/tests/screenshot.spec.ts +387 -0
- package/src/routes/chrome/tests/websocket.spec.ts +491 -0
- package/src/routes/chrome/ws/browser.ts +8 -0
- package/src/routes/chrome/ws/cdp.ts +12 -0
- package/src/routes/chrome/ws/page.ts +8 -0
- package/src/routes/chrome/ws/playwright.ts +12 -0
- package/src/routes/chromium/http/content.post.ts +6 -0
- package/src/routes/chromium/http/download.post.ts +6 -0
- package/src/routes/chromium/http/function.post.ts +6 -0
- package/src/routes/chromium/http/json-list.get.ts +1 -0
- package/src/routes/chromium/http/json-new.put.ts +1 -0
- package/src/routes/chromium/http/json-protocol.get.ts +1 -0
- package/src/routes/chromium/http/json-version.get.ts +1 -0
- package/src/routes/chromium/http/pdf.post.ts +6 -0
- package/src/routes/chromium/http/performance.post.ts +6 -0
- package/src/routes/chromium/http/scrape.post.ts +6 -0
- package/src/routes/chromium/http/screenshot.post.ts +6 -0
- package/src/routes/chromium/tests/content.spec.ts +36 -28
- package/src/routes/chromium/tests/download.spec.ts +3 -3
- package/src/routes/chromium/tests/function.spec.ts +18 -15
- package/src/routes/chromium/tests/page-websocket.spec.ts +129 -0
- package/src/routes/chromium/tests/pdf.spec.ts +31 -26
- package/src/routes/chromium/tests/performance.spec.ts +46 -34
- package/src/routes/chromium/tests/scrape.spec.ts +23 -20
- package/src/routes/chromium/tests/screenshot.spec.ts +24 -24
- package/src/routes/chromium/tests/websocket.spec.ts +31 -40
- package/src/routes/chromium/ws/browser.ts +1 -29
- package/src/routes/chromium/ws/cdp.ts +1 -0
- package/src/routes/chromium/ws/page.ts +1 -29
- package/src/routes/chromium/ws/playwright.ts +4 -0
- package/src/routes/firefox/ws/{playwright-firefox.ts → playwright.ts} +5 -5
- package/src/routes/management/http/{static-get.ts → static.get.ts} +2 -2
- package/src/routes/webkit/ws/{playwright-webkit.ts → playwright.ts} +5 -5
- package/src/shared/browser.ws.ts +34 -0
- package/src/{routes/chromium/ws/playwright-chromium.ts → shared/chromium.playwright.ws.ts} +7 -4
- package/src/{routes/chromium/ws/cdp-chromium.ts → shared/chromium.ws.ts} +6 -6
- package/src/{routes/chromium/http/content-post.ts → shared/content.http.ts} +4 -4
- package/src/{routes/chromium/http/download-post.ts → shared/download.http.ts} +4 -4
- package/src/{routes/chromium/http/function-post.ts → shared/function.http.ts} +4 -4
- package/src/shared/json-list.http.ts +35 -0
- package/src/{routes/chromium/http/json-new.ts → shared/json-new.http.ts} +23 -7
- package/src/{routes/chromium/http/json-protocol-get.ts → shared/json-protocol.http.ts} +3 -5
- package/src/{routes/chromium/http/json-version-get.ts → shared/json-version.http.ts} +4 -5
- package/src/shared/page.ws.ts +35 -0
- package/src/{routes/chromium/http/pdf-post.ts → shared/pdf.http.ts} +4 -4
- package/src/{routes/chromium/http/performance.ts → shared/performance.http.ts} +4 -4
- package/src/{routes/chromium/http/scrape-post.ts → shared/scrape.http.ts} +4 -4
- package/src/{routes/chromium/http/screenshot-post.ts → shared/screenshot.http.ts} +4 -4
- package/src/{routes/chromium → shared}/utils/function/handler.ts +2 -2
- package/src/{routes/chromium → shared}/utils/performance/main.ts +1 -2
- package/src/shim.ts +2 -1
- package/src/types.ts +27 -20
- package/src/utils.ts +32 -14
- package/static/devtools/Images/accelerometer-back.svg +1 -0
- package/static/devtools/Images/accelerometer-bottom.png +0 -0
- package/static/devtools/Images/accelerometer-front.svg +1 -0
- package/static/devtools/Images/accelerometer-left.png +0 -0
- package/static/devtools/Images/accelerometer-right.png +0 -0
- package/static/devtools/Images/accelerometer-top.png +0 -0
- package/static/devtools/Images/baseline-icon.svg +1 -0
- package/static/devtools/Images/breaking_change_icon.svg +1 -0
- package/static/devtools/Images/checkboxCheckmark.svg +1 -0
- package/static/devtools/Images/checker.png +0 -0
- package/static/devtools/Images/chevrons.svg +1 -0
- package/static/devtools/Images/chromeDisabledSelect.png +0 -0
- package/static/devtools/Images/chromeDisabledSelect_2x.png +0 -0
- package/static/devtools/Images/chromeLeft.avif +0 -0
- package/static/devtools/Images/chromeMiddle.avif +0 -0
- package/static/devtools/Images/chromeRight.avif +0 -0
- package/static/devtools/Images/chromeSelect.svg +1 -0
- package/static/devtools/Images/chromeSelectDark.svg +1 -0
- package/static/devtools/Images/cssoverview_icons_2x.avif +0 -0
- package/static/devtools/Images/dropdown_7x6_icon.svg +1 -0
- package/static/devtools/Images/elements_panel_icon.svg +1 -0
- package/static/devtools/Images/errorWave.svg +1 -0
- package/static/devtools/Images/error_icon.svg +1 -0
- package/static/devtools/Images/feedback_thin_16x16_icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-around-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-between-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-evenly-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-direction-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-center-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-around-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-between-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-evenly-icon.svg +1 -0
- package/static/devtools/Images/ic_checkmark_16x16.svg +3 -0
- package/static/devtools/Images/ic_delete_filter.svg +1 -0
- package/static/devtools/Images/ic_delete_list.svg +1 -0
- package/static/devtools/Images/ic_info_black_18dp.svg +1 -0
- package/static/devtools/Images/ic_page_next_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_page_prev_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_redo_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_show_node_16x16.svg +4 -0
- package/static/devtools/Images/ic_suggest_color.svg +6 -0
- package/static/devtools/Images/ic_undo_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_warning_black_18dp.svg +1 -0
- package/static/devtools/Images/issue-text-icon.svg +1 -0
- package/static/devtools/Images/largeIcons.svg +1 -0
- package/static/devtools/Images/lighthouse_logo.svg +1 -0
- package/static/devtools/Images/link_icon.svg +1 -0
- package/static/devtools/Images/mediumIcons.svg +1 -0
- package/static/devtools/Images/navigationControls.png +0 -0
- package/static/devtools/Images/navigationControls_2x.png +0 -0
- package/static/devtools/Images/network_panel_icon.svg +1 -0
- package/static/devtools/Images/nodeIcon.avif +0 -0
- package/static/devtools/Images/node_search_icon.svg +1 -0
- package/static/devtools/Images/popoverArrows.png +0 -0
- package/static/devtools/Images/profileGroupIcon.png +0 -0
- package/static/devtools/Images/profileIcon.png +0 -0
- package/static/devtools/Images/profileSmallIcon.png +0 -0
- package/static/devtools/Images/radioDot-dark-theme.png +0 -0
- package/static/devtools/Images/radioDot.png +0 -0
- package/static/devtools/Images/refresh_12x12_icon.svg +1 -0
- package/static/devtools/Images/resizeDiagonal.svg +1 -0
- package/static/devtools/Images/resizeHorizontal.svg +1 -0
- package/static/devtools/Images/resizeVertical.svg +1 -0
- package/static/devtools/Images/resourceCSSIcon.png +0 -0
- package/static/devtools/Images/resourceDocumentIcon.png +0 -0
- package/static/devtools/Images/resourceDocumentIconSmall.png +0 -0
- package/static/devtools/Images/resourceJSIcon.png +0 -0
- package/static/devtools/Images/resourcePlainIcon.png +0 -0
- package/static/devtools/Images/resourcePlainIconSmall.png +0 -0
- package/static/devtools/Images/resourcesTimeGraphIcon.avif +0 -0
- package/static/devtools/Images/searchNext.png +0 -0
- package/static/devtools/Images/searchPrev.png +0 -0
- package/static/devtools/Images/securityIcons.svg +1 -0
- package/static/devtools/Images/settings_14x14_icon.svg +1 -0
- package/static/devtools/Images/smallIcons.svg +1 -0
- package/static/devtools/Images/sources_panel_icon.svg +1 -0
- package/static/devtools/Images/speech.png +0 -0
- package/static/devtools/Images/toolbarResizerVertical.png +0 -0
- package/static/devtools/Images/touchCursor.png +0 -0
- package/static/devtools/Images/touchCursor_2x.png +0 -0
- package/static/devtools/Images/treeoutlineTriangles.svg +1 -0
- package/static/devtools/Images/warning_icon.svg +1 -0
- package/static/devtools/Images/whatsnew.avif +0 -0
- package/static/devtools/Tests.js +1654 -0
- package/static/devtools/accessibility/accessibility-legacy.js +1 -0
- package/static/devtools/accessibility/accessibility-meta.js +1 -0
- package/static/devtools/accessibility/accessibility.js +1 -0
- package/static/devtools/accessibility/accessibility_module.js +1 -0
- package/static/devtools/accessibility_test_runner/accessibility_test_runner.js +77 -0
- package/static/devtools/accessibility_test_runner/accessibility_test_runner_module.js +0 -0
- package/static/devtools/animation/animation-legacy.js +1 -0
- package/static/devtools/animation/animation-meta.js +1 -0
- package/static/devtools/animation/animation.js +1 -0
- package/static/devtools/animation/animation_module.js +1 -0
- package/static/devtools/application_test_runner/AppcacheTestRunner.js +220 -0
- package/static/devtools/application_test_runner/CacheStorageTestRunner.js +286 -0
- package/static/devtools/application_test_runner/IndexedDBTestRunner.js +476 -0
- package/static/devtools/application_test_runner/ResourceTreeTestRunner.js +99 -0
- package/static/devtools/application_test_runner/ResourcesTestRunner.js +167 -0
- package/static/devtools/application_test_runner/ServiceWorkersTestRunner.js +131 -0
- package/static/devtools/application_test_runner/application_test_runner.js +10 -0
- package/static/devtools/application_test_runner/application_test_runner_module.js +0 -0
- package/static/devtools/axe_core_test_runner/axe_core_test_runner.js +174 -0
- package/static/devtools/axe_core_test_runner/axe_core_test_runner_module.js +0 -0
- package/static/devtools/bindings/bindings-legacy.js +1 -0
- package/static/devtools/bindings/bindings.js +1 -0
- package/static/devtools/bindings_test_runner/AutomappingTestRunner.js +130 -0
- package/static/devtools/bindings_test_runner/BindingsTestRunner.js +238 -0
- package/static/devtools/bindings_test_runner/IsolatedFilesystemTestRunner.js +287 -0
- package/static/devtools/bindings_test_runner/OverridesTestRunner.js +26 -0
- package/static/devtools/bindings_test_runner/PersistenceTestRunner.js +109 -0
- package/static/devtools/bindings_test_runner/bindings_test_runner.js +9 -0
- package/static/devtools/bindings_test_runner/bindings_test_runner_module.js +0 -0
- package/static/devtools/browser_debugger/browser_debugger-legacy.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger-meta.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger_module.js +1 -0
- package/static/devtools/browser_sdk/browser_sdk-meta.js +1 -0
- package/static/devtools/browser_sdk/browser_sdk.js +1 -0
- package/static/devtools/changes/changes-legacy.js +1 -0
- package/static/devtools/changes/changes-meta.js +1 -0
- package/static/devtools/changes/changes.js +1 -0
- package/static/devtools/changes/changes_module.js +1 -0
- package/static/devtools/client_variations/client_variations.js +1 -0
- package/static/devtools/client_variations/client_variations_module.js +0 -0
- package/static/devtools/cm/cm.js +1 -0
- package/static/devtools/cm/cm_module.js +1 -0
- package/static/devtools/cm_headless/cm_headless.js +1 -0
- package/static/devtools/color_picker/color_picker-legacy.js +1 -0
- package/static/devtools/color_picker/color_picker.js +1 -0
- package/static/devtools/color_picker/color_picker_module.js +1 -0
- package/static/devtools/common/common-legacy.js +1 -0
- package/static/devtools/common/common.js +1 -0
- package/static/devtools/component_helpers/component_helpers.js +1 -0
- package/static/devtools/components/components-legacy.js +1 -0
- package/static/devtools/components/components.js +1 -0
- package/static/devtools/console/console-legacy.js +1 -0
- package/static/devtools/console/console-meta.js +1 -0
- package/static/devtools/console/console.js +6 -0
- package/static/devtools/console/console_module.js +1 -0
- package/static/devtools/console_counters/console_counters-legacy.js +1 -0
- package/static/devtools/console_counters/console_counters.js +1 -0
- package/static/devtools/console_test_runner/console_test_runner.js +696 -0
- package/static/devtools/console_test_runner/console_test_runner_module.js +0 -0
- package/static/devtools/cookie_table/cookie_table-legacy.js +1 -0
- package/static/devtools/cookie_table/cookie_table.js +1 -0
- package/static/devtools/cookie_table/cookie_table_module.js +1 -0
- package/static/devtools/coverage/coverage-legacy.js +1 -0
- package/static/devtools/coverage/coverage-meta.js +1 -0
- package/static/devtools/coverage/coverage.js +1 -0
- package/static/devtools/coverage/coverage_module.js +1 -0
- package/static/devtools/coverage_test_runner/coverage_test_runner.js +151 -0
- package/static/devtools/coverage_test_runner/coverage_test_runner_module.js +0 -0
- package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner.js +72 -0
- package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner_module.js +0 -0
- package/static/devtools/css_overview/css_overview-meta.js +1 -0
- package/static/devtools/css_overview/css_overview.js +146 -0
- package/static/devtools/css_overview/css_overview_module.js +1 -0
- package/static/devtools/data_grid/data_grid-legacy.js +1 -0
- package/static/devtools/data_grid/data_grid.js +1 -0
- package/static/devtools/data_grid/data_grid_module.js +1 -0
- package/static/devtools/data_grid_test_runner/data_grid_test_runner.js +78 -0
- package/static/devtools/data_grid_test_runner/data_grid_test_runner_module.js +0 -0
- package/static/devtools/developer_resources/developer_resources-legacy.js +1 -0
- package/static/devtools/developer_resources/developer_resources-meta.js +1 -0
- package/static/devtools/developer_resources/developer_resources.js +1 -0
- package/static/devtools/developer_resources/developer_resources_module.js +1 -0
- package/static/devtools/device_mode_test_runner/device_mode_test_runner.js +45 -0
- package/static/devtools/device_mode_test_runner/device_mode_test_runner_module.js +0 -0
- package/static/devtools/devtools_app.html +20 -0
- package/static/devtools/devtools_app.js +1 -0
- package/static/devtools/devtools_compatibility.js +1546 -0
- package/static/devtools/diff/diff-legacy.js +1 -0
- package/static/devtools/diff/diff.js +1 -0
- package/static/devtools/diff/diff_module.js +0 -0
- package/static/devtools/dom_extension/dom_extension.js +1 -0
- package/static/devtools/elements/elements-legacy.js +1 -0
- package/static/devtools/elements/elements-meta.js +1 -0
- package/static/devtools/elements/elements.js +469 -0
- package/static/devtools/elements/elements_module.js +1 -0
- package/static/devtools/elements_test_runner/EditDOMTestRunner.js +78 -0
- package/static/devtools/elements_test_runner/ElementsPanelShadowSelectionOnRefreshTestRunner.js +39 -0
- package/static/devtools/elements_test_runner/ElementsTestRunner.js +1280 -0
- package/static/devtools/elements_test_runner/SetOuterHTMLTestRunner.js +115 -0
- package/static/devtools/elements_test_runner/StylesUpdateLinksTestRunner.js +134 -0
- package/static/devtools/elements_test_runner/elements_test_runner.js +9 -0
- package/static/devtools/elements_test_runner/elements_test_runner_module.js +0 -0
- package/static/devtools/emulated_devices/emulated_devices_module.js +0 -0
- package/static/devtools/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/static/devtools/emulation/emulation-legacy.js +1 -0
- package/static/devtools/emulation/emulation-meta.js +1 -0
- package/static/devtools/emulation/emulation.js +1 -0
- package/static/devtools/event_listeners/event_listeners-legacy.js +1 -0
- package/static/devtools/event_listeners/event_listeners.js +1 -0
- package/static/devtools/event_listeners/event_listeners_module.js +1 -0
- package/static/devtools/extensions/extensions-legacy.js +1 -0
- package/static/devtools/extensions/extensions.js +1 -0
- package/static/devtools/extensions_test_runner/ExtensionsNetworkTestRunner.js +27 -0
- package/static/devtools/extensions_test_runner/ExtensionsTestRunner.js +68 -0
- package/static/devtools/extensions_test_runner/extensions_test_runner.js +6 -0
- package/static/devtools/extensions_test_runner/extensions_test_runner_module.js +0 -0
- package/static/devtools/formatter/formatter-legacy.js +1 -0
- package/static/devtools/formatter/formatter.js +1 -0
- package/static/devtools/formatter/formatter_module.js +0 -0
- package/static/devtools/formatter_worker/FormatterActions.js +1 -0
- package/static/devtools/formatter_worker/formatter_worker-entrypoint.js +1 -0
- package/static/devtools/formatter_worker/formatter_worker.js +1 -0
- package/static/devtools/har_importer/har_importer-legacy.js +1 -0
- package/static/devtools/har_importer/har_importer.js +1 -0
- package/static/devtools/har_importer/har_importer_module.js +0 -0
- package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner.js +740 -0
- package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner_module.js +0 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model-legacy.js +1 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model.js +1 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model_module.js +0 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-legacy.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker_module.js +0 -0
- package/static/devtools/help/help-legacy.js +1 -0
- package/static/devtools/help/help-meta.js +1 -0
- package/static/devtools/help/help.js +1 -0
- package/static/devtools/help/help_module.js +1 -0
- package/static/devtools/host/host-legacy.js +1 -0
- package/static/devtools/host/host.js +1 -0
- package/static/devtools/i18n/i18n.js +1 -0
- package/static/devtools/i18n/i18n_locales-tsconfig.json +8 -0
- package/static/devtools/i18n/locales/en-US.json +3566 -0
- package/static/devtools/inline_editor/inline_editor-legacy.js +1 -0
- package/static/devtools/inline_editor/inline_editor.js +203 -0
- package/static/devtools/inline_editor/inline_editor_module.js +1 -0
- package/static/devtools/input/input-legacy.js +1 -0
- package/static/devtools/input/input-meta.js +1 -0
- package/static/devtools/input/input.js +1 -0
- package/static/devtools/input/input_module.js +1 -0
- package/static/devtools/inspector.html +20 -0
- package/static/devtools/inspector.js +1 -0
- package/static/devtools/inspector_main/inspector_main-legacy.js +1 -0
- package/static/devtools/inspector_main/inspector_main-meta.js +1 -0
- package/static/devtools/inspector_main/inspector_main.js +1 -0
- package/static/devtools/integration_test_runner.html +14 -0
- package/static/devtools/integration_test_runner.js +2 -0
- package/static/devtools/issues/issues-legacy.js +1 -0
- package/static/devtools/issues/issues-meta.js +1 -0
- package/static/devtools/issues/issues.js +67 -0
- package/static/devtools/issues/issues_module.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata-legacy.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata_module.js +0 -0
- package/static/devtools/js_app.html +20 -0
- package/static/devtools/js_app.js +1 -0
- package/static/devtools/js_main/js_main-legacy.js +1 -0
- package/static/devtools/js_main/js_main.js +1 -0
- package/static/devtools/js_profiler/js_profiler-meta.js +1 -0
- package/static/devtools/js_profiler/js_profiler.js +1 -0
- package/static/devtools/js_profiler/js_profiler_module.js +0 -0
- package/static/devtools/layer_viewer/layer_viewer-legacy.js +1 -0
- package/static/devtools/layer_viewer/layer_viewer.js +1 -0
- package/static/devtools/layer_viewer/layer_viewer_module.js +1 -0
- package/static/devtools/layers/layers-legacy.js +1 -0
- package/static/devtools/layers/layers-meta.js +1 -0
- package/static/devtools/layers/layers.js +1 -0
- package/static/devtools/layers/layers_module.js +0 -0
- package/static/devtools/layers_test_runner/layers_test_runner.js +156 -0
- package/static/devtools/layers_test_runner/layers_test_runner_module.js +0 -0
- package/static/devtools/lighthouse/lighthouse-legacy.js +1 -0
- package/static/devtools/lighthouse/lighthouse-meta.js +1 -0
- package/static/devtools/lighthouse/lighthouse.js +70 -0
- package/static/devtools/lighthouse/lighthouse_module.js +1 -0
- package/static/devtools/lighthouse_test_runner/lighthouse_test_runner.js +136 -0
- package/static/devtools/lighthouse_test_runner/lighthouse_test_runner_module.js +0 -0
- package/static/devtools/lighthouse_worker/LighthouseService.js +195 -0
- package/static/devtools/lighthouse_worker/lighthouse_worker.js +6 -0
- package/static/devtools/lighthouse_worker.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector-legacy.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector-meta.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector.js +399 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector_module.js +0 -0
- package/static/devtools/main/main-legacy.js +1 -0
- package/static/devtools/main/main.js +1 -0
- package/static/devtools/media/media-legacy.js +1 -0
- package/static/devtools/media/media-meta.js +1 -0
- package/static/devtools/media/media.js +1 -0
- package/static/devtools/media/media_module.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling-legacy.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling-meta.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling.js +1 -0
- package/static/devtools/ndb_app.html +20 -0
- package/static/devtools/ndb_app.js +1 -0
- package/static/devtools/network/network-legacy.js +1 -0
- package/static/devtools/network/network-meta.js +1 -0
- package/static/devtools/network/network.js +72 -0
- package/static/devtools/network/network_module.js +1 -0
- package/static/devtools/network_test_runner/network_test_runner.js +280 -0
- package/static/devtools/network_test_runner/network_test_runner_module.js +0 -0
- package/static/devtools/node_app.html +20 -0
- package/static/devtools/node_app.js +1 -0
- package/static/devtools/node_debugger/node_debugger-meta.js +1 -0
- package/static/devtools/node_debugger/node_debugger.js +1 -0
- package/static/devtools/node_debugger/node_debugger_module.js +0 -0
- package/static/devtools/node_main/node_main-legacy.js +1 -0
- package/static/devtools/node_main/node_main-meta.js +1 -0
- package/static/devtools/node_main/node_main.js +1 -0
- package/static/devtools/object_ui/object_ui-legacy.js +1 -0
- package/static/devtools/object_ui/object_ui.js +3 -0
- package/static/devtools/object_ui/object_ui_module.js +1 -0
- package/static/devtools/perf_ui/perf_ui-legacy.js +1 -0
- package/static/devtools/perf_ui/perf_ui.js +152 -0
- package/static/devtools/perf_ui/perf_ui_module.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor-legacy.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor-meta.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor_module.js +1 -0
- package/static/devtools/performance_test_runner/TimelineDataTestRunner.js +5375 -0
- package/static/devtools/performance_test_runner/TimelineTestRunner.js +446 -0
- package/static/devtools/performance_test_runner/performance_test_runner.js +6 -0
- package/static/devtools/performance_test_runner/performance_test_runner_module.js +0 -0
- package/static/devtools/persistence/persistence-legacy.js +1 -0
- package/static/devtools/persistence/persistence-meta.js +1 -0
- package/static/devtools/persistence/persistence.js +1 -0
- package/static/devtools/platform/platform.js +1 -0
- package/static/devtools/profiler/profiler-legacy.js +1 -0
- package/static/devtools/profiler/profiler-meta.js +1 -0
- package/static/devtools/profiler/profiler.js +8 -0
- package/static/devtools/profiler/profiler_module.js +1 -0
- package/static/devtools/protocol_client/protocol_client-legacy.js +1 -0
- package/static/devtools/protocol_client/protocol_client.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor-legacy.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor-meta.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor_module.js +1 -0
- package/static/devtools/quick_open/quick_open-legacy.js +1 -0
- package/static/devtools/quick_open/quick_open.js +1 -0
- package/static/devtools/quick_open/quick_open_module.js +1 -0
- package/static/devtools/recorder/recorder.js +1 -0
- package/static/devtools/resources/resources-legacy.js +1 -0
- package/static/devtools/resources/resources-meta.js +1 -0
- package/static/devtools/resources/resources.js +28 -0
- package/static/devtools/resources/resources_module.js +1 -0
- package/static/devtools/root/root-legacy.js +1 -0
- package/static/devtools/root/root.js +1 -0
- package/static/devtools/screencast/screencast-legacy.js +1 -0
- package/static/devtools/screencast/screencast.js +1 -0
- package/static/devtools/sdk/sdk-legacy.js +1 -0
- package/static/devtools/sdk/sdk.js +2 -0
- package/static/devtools/sdk_test_runner/sdk_test_runner.js +297 -0
- package/static/devtools/sdk_test_runner/sdk_test_runner_module.js +0 -0
- package/static/devtools/search/search-legacy.js +1 -0
- package/static/devtools/search/search.js +1 -0
- package/static/devtools/search/search_module.js +1 -0
- package/static/devtools/security/security-legacy.js +1 -0
- package/static/devtools/security/security-meta.js +1 -0
- package/static/devtools/security/security.js +1 -0
- package/static/devtools/security/security_module.js +1 -0
- package/static/devtools/security_test_runner/security_test_runner.js +32 -0
- package/static/devtools/security_test_runner/security_test_runner_module.js +0 -0
- package/static/devtools/services/services-legacy.js +1 -0
- package/static/devtools/services/services.js +1 -0
- package/static/devtools/settings/settings-legacy.js +1 -0
- package/static/devtools/settings/settings-meta.js +1 -0
- package/static/devtools/settings/settings.js +1 -0
- package/static/devtools/settings/settings_module.js +1 -0
- package/static/devtools/shell.js +1 -0
- package/static/devtools/snippets/snippets-legacy.js +1 -0
- package/static/devtools/snippets/snippets.js +1 -0
- package/static/devtools/snippets/snippets_module.js +0 -0
- package/static/devtools/source_frame/source_frame-legacy.js +1 -0
- package/static/devtools/source_frame/source_frame.js +1 -0
- package/static/devtools/source_frame/source_frame_module.js +1 -0
- package/static/devtools/sources/sources-legacy.js +1 -0
- package/static/devtools/sources/sources-meta.js +1 -0
- package/static/devtools/sources/sources.js +13 -0
- package/static/devtools/sources/sources_module.js +1 -0
- package/static/devtools/sources_test_runner/AutocompleteTestRunner.js +46 -0
- package/static/devtools/sources_test_runner/DebuggerTestRunner.js +895 -0
- package/static/devtools/sources_test_runner/EditorTestRunner.js +237 -0
- package/static/devtools/sources_test_runner/LiveEditTestRunner.js +33 -0
- package/static/devtools/sources_test_runner/SearchTestRunner.js +158 -0
- package/static/devtools/sources_test_runner/SourcesTestRunner.js +173 -0
- package/static/devtools/sources_test_runner/sources_test_runner.js +10 -0
- package/static/devtools/sources_test_runner/sources_test_runner_module.js +0 -0
- package/static/devtools/startup/startup.js +1 -0
- package/static/devtools/test_runner/test_runner.js +1 -0
- package/static/devtools/text_editor/text_editor-legacy.js +1 -0
- package/static/devtools/text_editor/text_editor.js +1 -0
- package/static/devtools/text_editor/text_editor_module.js +1 -0
- package/static/devtools/text_utils/text_utils-legacy.js +1 -0
- package/static/devtools/text_utils/text_utils.js +1 -0
- package/static/devtools/theme_support/theme_support.js +1 -0
- package/static/devtools/third_party/acorn/acorn-tsconfig.json +8 -0
- package/static/devtools/third_party/acorn/acorn.js +1 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.d.ts +209 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs +5261 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs.d.ts +2 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs.map +1 -0
- package/static/devtools/third_party/acorn-loose/acorn-loose-tsconfig.json +8 -0
- package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.d.ts +16 -0
- package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.mjs +1418 -0
- package/static/devtools/third_party/axe-core/axe.js +16423 -0
- package/static/devtools/third_party/chromium/chromium-tsconfig.json +8 -0
- package/static/devtools/third_party/chromium/client-variations/ClientVariations.d.ts +13 -0
- package/static/devtools/third_party/chromium/client-variations/ClientVariations.js +27 -0
- package/static/devtools/third_party/codemirror/codemirror-tsconfig.json +72 -0
- package/static/devtools/third_party/codemirror/package/addon/comment/comment.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/addon/comment/comment.js +211 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.js +201 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.js +158 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.js +105 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.js +157 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.js +163 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.js +131 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/overlay.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/overlay.js +90 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/simple.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/simple.js +216 -0
- package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.js +333 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/active-line.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/active-line.js +72 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.js +119 -0
- package/static/devtools/third_party/codemirror/package/lib/codemirror.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/lib/codemirror.js +9800 -0
- package/static/devtools/third_party/codemirror/package/mode/clike/clike.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/clike/clike.js +935 -0
- package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.js +292 -0
- package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.js +359 -0
- package/static/devtools/third_party/codemirror/package/mode/css/css.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/css/css.js +864 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.js +37 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.js +153 -0
- package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.js +942 -0
- package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.js +148 -0
- package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.js +280 -0
- package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.js +886 -0
- package/static/devtools/third_party/codemirror/package/mode/php/php.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/php/php.js +234 -0
- package/static/devtools/third_party/codemirror/package/mode/python/python.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/python/python.js +399 -0
- package/static/devtools/third_party/codemirror/package/mode/shell/shell.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/shell/shell.js +168 -0
- package/static/devtools/third_party/codemirror/package/mode/wast/wast.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/wast/wast.js +41 -0
- package/static/devtools/third_party/codemirror/package/mode/xml/xml.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/xml/xml.js +413 -0
- package/static/devtools/third_party/i18n/bundle-tsconfig.json +8 -0
- package/static/devtools/third_party/i18n/i18n.d.ts +108 -0
- package/static/devtools/third_party/i18n/i18n.js +4336 -0
- package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.js +1140 -0
- package/static/devtools/third_party/lighthouse/lighthouse-tsconfig.json +10 -0
- package/static/devtools/third_party/lighthouse/locales/ar-XB.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ar.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/bg.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ca.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/cs.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/da.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/de.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/el.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-GB.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-US.json +2297 -0
- package/static/devtools/third_party/lighthouse/locales/en-XA.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-XL.json +2297 -0
- package/static/devtools/third_party/lighthouse/locales/es-419.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/es.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fil.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/he.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hu.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/id.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/it.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ja.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ko.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/lt.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/lv.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/nl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/no.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pt-PT.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pt.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ro.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ru.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sk.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sr-Latn.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sv.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ta.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/te.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/th.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/tr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/uk.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/vi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh-HK.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh-TW.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh.json +2066 -0
- package/static/devtools/third_party/lighthouse/report-assets/report-generator.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/report-assets/report-generator.js +167 -0
- package/static/devtools/third_party/lighthouse/report-assets/report.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/report-assets/report.js +5032 -0
- package/static/devtools/third_party/lit-html/lit-html-tsconfig.json +22 -0
- package/static/devtools/third_party/lit-html/lit-html.js +120 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.d.ts +28 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.js +101 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.d.ts +22 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.js +37 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/live.d.ts +38 -0
- package/static/devtools/third_party/lit-html/package/directives/live.js +73 -0
- package/static/devtools/third_party/lit-html/package/directives/live.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.d.ts +37 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.js +415 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.d.ts +36 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.js +78 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.d.ts +39 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js +52 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.d.ts +59 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.js +63 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.d.ts +29 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.js +44 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/part.d.ts +46 -0
- package/static/devtools/third_party/lit-html/package/lib/part.js +23 -0
- package/static/devtools/third_party/lit-html/package/lib/part.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.d.ts +148 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.js +476 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/render.d.ts +33 -0
- package/static/devtools/third_party/lit-html/package/lib/render.js +43 -0
- package/static/devtools/third_party/lit-html/package/lib/render.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.d.ts +57 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.js +48 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.d.ts +30 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.js +134 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.d.ts +42 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.js +131 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template.d.ts +92 -0
- package/static/devtools/third_party/lit-html/package/lib/template.js +215 -0
- package/static/devtools/third_party/lit-html/package/lib/template.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lit-html.d.ts +42 -0
- package/static/devtools/third_party/lit-html/package/lit-html.js +59 -0
- package/static/devtools/third_party/lit-html/package/lit-html.js.map +1 -0
- package/static/devtools/third_party/marked/marked-tsconfig.json +8 -0
- package/static/devtools/third_party/marked/marked.js +1 -0
- package/static/devtools/third_party/marked/package/lib/marked.esm.d.ts +1 -0
- package/static/devtools/third_party/marked/package/lib/marked.esm.js +2584 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +53 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.js +64 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts +176 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js +356 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts +21 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +81 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +423 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +516 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +39 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +76 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts +26 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.js +30 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +120 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +266 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +72 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +60 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +181 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +316 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +174 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +647 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +53 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +77 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts +33 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js +873 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +76 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js +92 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts +25 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.js +33 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +34 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +37 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +59 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +89 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +109 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts +82 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.js +83 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +189 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +313 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +60 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +735 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +962 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +276 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +421 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +128 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +150 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +322 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +463 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +439 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +724 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +62 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +145 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +80 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +262 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +152 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js +31 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +910 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +1343 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts +21 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +135 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +133 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts +24 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.js +0 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +157 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts +61 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.js +72 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +98 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +137 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts +28 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.js +43 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts +47 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +94 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts +40 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.js +403 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +102 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +109 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js +24 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts +17 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.js +20 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +288 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +17 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +16 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +39 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +132 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +468 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +40 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +197 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +42 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +0 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +16 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +469 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +29 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +34 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +31 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +61 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +156 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +183 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +151 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +23 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +19 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.js +53 -0
- package/static/devtools/third_party/puppeteer/puppeteer-tsconfig.json +58 -0
- package/static/devtools/third_party/puppeteer/puppeteer.js +1 -0
- package/static/devtools/third_party/wasmparser/package/dist/esm/WasmDis.js +1595 -0
- package/static/devtools/third_party/wasmparser/package/dist/esm/WasmParser.js +3120 -0
- package/static/devtools/third_party/wasmparser/wasmparser-tsconfig.json +9 -0
- package/static/devtools/timeline/timeline-legacy.js +1 -0
- package/static/devtools/timeline/timeline-meta.js +1 -0
- package/static/devtools/timeline/timeline.js +1 -0
- package/static/devtools/timeline/timeline_module.js +1 -0
- package/static/devtools/timeline_model/timeline_model-legacy.js +1 -0
- package/static/devtools/timeline_model/timeline_model.js +1 -0
- package/static/devtools/timeline_model/timeline_model_module.js +0 -0
- package/static/devtools/toolbox.html +20 -0
- package/static/devtools/toolbox.js +1 -0
- package/static/devtools/toolbox_bootstrap/toolbox_bootstrap.js +1 -0
- package/static/devtools/ui/components/components.js +378 -0
- package/static/devtools/ui/ui-legacy.js +1 -0
- package/static/devtools/ui/ui.js +3 -0
- package/static/devtools/ui/utils/utils.js +1 -0
- package/static/devtools/wasmparser_worker/wasmparser_worker-entrypoint.js +1 -0
- package/static/devtools/wasmparser_worker/wasmparser_worker.js +1 -0
- package/static/devtools/web_audio/graph_visualizer/graph_visualizer.js +1 -0
- package/static/devtools/web_audio/web_audio-legacy.js +1 -0
- package/static/devtools/web_audio/web_audio-meta.js +1 -0
- package/static/devtools/web_audio/web_audio.js +23 -0
- package/static/devtools/web_audio/web_audio_module.js +1 -0
- package/static/devtools/webauthn/webauthn-legacy.js +1 -0
- package/static/devtools/webauthn/webauthn-meta.js +1 -0
- package/static/devtools/webauthn/webauthn.js +6 -0
- package/static/devtools/webauthn/webauthn_module.js +1 -0
- package/static/devtools/worker_app.html +20 -0
- package/static/devtools/worker_app.js +1 -0
- package/static/devtools/worker_main/worker_main-legacy.js +1 -0
- package/static/devtools/worker_main/worker_main.js +1 -0
- package/static/devtools/worker_service/worker_service.js +1 -0
- package/static/devtools/workspace/workspace-legacy.js +1 -0
- package/static/devtools/workspace/workspace.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff-legacy.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff_module.js +0 -0
- package/static/docs/swagger.json +2337 -279
- package/static/function/client.js +1037 -992
- package/build/routes/chromium/http/json-new.js +0 -23
- package/build/routes/chromium/http/json-version-get.response.json +0 -37
- package/build/routes/chromium/utils/cdp.d.ts +0 -2
- package/build/routes/chromium/utils/cdp.js +0 -14
- package/build/routes/chromium/ws/cdp-chromium.js +0 -10
- package/src/routes/chromium/http/json-list.ts +0 -50
- package/src/routes/chromium/utils/cdp.ts +0 -19
- package/build/routes/{chromium/http/content-post.query.json → chrome/http/content.post.query.json} +0 -0
- package/build/routes/{chromium/http/content-post.response.json → chrome/http/content.post.response.json} +0 -0
- package/build/routes/{chromium/http/download-post.body.json → chrome/http/download.post.body.json} +0 -0
- package/build/routes/{chromium/http/download-post.query.json → chrome/http/download.post.query.json} +0 -0
- package/build/routes/{chromium/http/download-post.response.json → chrome/http/download.post.response.json} +0 -0
- package/build/routes/{chromium/http/function-post.body.json → chrome/http/function.post.body.json} +0 -0
- package/build/routes/{chromium/http/function-post.query.json → chrome/http/function.post.query.json} +0 -0
- package/build/routes/{chromium/http/function-post.response.json → chrome/http/function.post.response.json} +0 -0
- package/build/routes/{chromium/http/json-list.response.json → chrome/http/json-list.get.response.json} +0 -0
- package/build/routes/{chromium/http/json-new.response.json → chrome/http/json-new.put.response.json} +0 -0
- package/build/routes/{chromium/http/json-protocol-get.response.json → chrome/http/json-protocol.get.response.json} +0 -0
- package/build/routes/{chromium/http/pdf-post.query.json → chrome/http/pdf.post.query.json} +0 -0
- package/build/routes/{chromium/http/pdf-post.response.json → chrome/http/pdf.post.response.json} +0 -0
- package/build/routes/{chromium/http/performance.body.json → chrome/http/performance.post.body.json} +0 -0
- package/build/routes/{chromium/http/performance.query.json → chrome/http/performance.post.query.json} +0 -0
- package/build/routes/{chromium/http/performance.response.json → chrome/http/performance.post.response.json} +0 -0
- package/build/routes/{chromium/http/scrape-post.query.json → chrome/http/scrape.post.query.json} +0 -0
- package/build/routes/{chromium/http/scrape-post.response.json → chrome/http/scrape.post.response.json} +0 -0
- package/build/routes/{chromium/http/screenshot-post.query.json → chrome/http/screenshot.post.query.json} +0 -0
- package/build/routes/{chromium/http/screenshot-post.response.json → chrome/http/screenshot.post.response.json} +0 -0
- package/build/routes/{chromium/utils/performance/child.d.ts → chrome/tests/content.spec.d.ts} +0 -0
- package/build/routes/{chromium/utils/performance/types.js → chrome/tests/download.spec.d.ts} +0 -0
- package/build/routes/{chromium/ws/cdp-chromium.query.json → chrome/ws/browser.query.json} +0 -0
- package/build/routes/{chromium/ws/playwright-chromium.query.json → chrome/ws/playwright.query.json} +0 -0
- package/build/routes/{firefox/ws/playwright-firefox.query.json → chromium/ws/playwright.query.json} +0 -0
- package/build/routes/{webkit/ws/playwright-webkit.query.json → firefox/ws/playwright.query.json} +0 -0
- package/build/routes/management/http/{config-get.d.ts → config.get.d.ts} +0 -0
- package/build/routes/management/http/{config-get.js → config.get.js} +0 -0
- package/build/routes/management/http/{config-get.response.json → config.get.response.json} +0 -0
- package/build/routes/management/http/{metrics-total-get.d.ts → metrics-total.get.d.ts} +0 -0
- package/build/routes/management/http/{metrics-total-get.js → metrics-total.get.js} +0 -0
- package/build/routes/management/http/{metrics-total-get.response.json → metrics-total.get.response.json} +0 -0
- package/build/routes/management/http/{metrics-get.d.ts → metrics.get.d.ts} +0 -0
- package/build/routes/management/http/{metrics-get.js → metrics.get.js} +0 -0
- package/build/routes/management/http/{metrics-get.response.json → metrics.get.response.json} +0 -0
- package/build/routes/management/http/{sessions-get.d.ts → sessions.get.d.ts} +0 -0
- package/build/routes/management/http/{sessions-get.js → sessions.get.js} +0 -0
- package/build/routes/management/http/{static-get.d.ts → static.get.d.ts} +0 -0
- package/build/{routes/chromium/http/json-protocol-get.d.ts → shared/json-protocol.http.d.ts} +1 -1
- package/build/{routes/chromium/http/json-version-get.d.ts → shared/json-version.http.d.ts} +1 -1
- /package/build/{routes/chromium → shared}/utils/function/client.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/function/client.js +0 -0
- /package/build/{routes/chromium → shared}/utils/function/handler.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/function/handler.js +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/child.js +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/main.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/types.d.ts +0 -0
- /package/src/routes/management/http/{config-get.ts → config.get.ts} +0 -0
- /package/src/routes/management/http/{metrics-total-get.ts → metrics-total.get.ts} +0 -0
- /package/src/routes/management/http/{metrics-get.ts → metrics.get.ts} +0 -0
- /package/src/routes/management/http/{sessions-get.ts → sessions.get.ts} +0 -0
- /package/src/{routes/chromium → shared}/utils/function/client.ts +0 -0
- /package/src/{routes/chromium → shared}/utils/performance/child.ts +0 -0
- /package/src/{routes/chromium → shared}/utils/performance/types.ts +0 -0
|
@@ -0,0 +1,4336 @@
|
|
|
1
|
+
// lighthouse.i18n 1.0.0, created with rollup.
|
|
2
|
+
// DO NOT MODIFY: Generated with buildi18nBundle.js.
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
|
+
|
|
7
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
8
|
+
return module = {
|
|
9
|
+
path: basedir,
|
|
10
|
+
exports: {},
|
|
11
|
+
require: function (path, base) {
|
|
12
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
13
|
+
}
|
|
14
|
+
}, fn(module, module.exports), module.exports;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function commonjsRequire () {
|
|
18
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var _package = createCommonjsModule(function (module, exports) {
|
|
22
|
+
/**
|
|
23
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
24
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
25
|
+
* Copyright JS Foundation and other contributors <https://js.foundation/>
|
|
26
|
+
* Released under MIT license <https://lodash.com/license>
|
|
27
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
28
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** Used as the size to enable large array optimizations. */
|
|
32
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
33
|
+
|
|
34
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
35
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
36
|
+
|
|
37
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
38
|
+
var COMPARE_PARTIAL_FLAG = 1,
|
|
39
|
+
COMPARE_UNORDERED_FLAG = 2;
|
|
40
|
+
|
|
41
|
+
/** Used as references for various `Number` constants. */
|
|
42
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
43
|
+
|
|
44
|
+
/** `Object#toString` result references. */
|
|
45
|
+
var argsTag = '[object Arguments]',
|
|
46
|
+
arrayTag = '[object Array]',
|
|
47
|
+
asyncTag = '[object AsyncFunction]',
|
|
48
|
+
boolTag = '[object Boolean]',
|
|
49
|
+
dateTag = '[object Date]',
|
|
50
|
+
errorTag = '[object Error]',
|
|
51
|
+
funcTag = '[object Function]',
|
|
52
|
+
genTag = '[object GeneratorFunction]',
|
|
53
|
+
mapTag = '[object Map]',
|
|
54
|
+
numberTag = '[object Number]',
|
|
55
|
+
nullTag = '[object Null]',
|
|
56
|
+
objectTag = '[object Object]',
|
|
57
|
+
promiseTag = '[object Promise]',
|
|
58
|
+
proxyTag = '[object Proxy]',
|
|
59
|
+
regexpTag = '[object RegExp]',
|
|
60
|
+
setTag = '[object Set]',
|
|
61
|
+
stringTag = '[object String]',
|
|
62
|
+
symbolTag = '[object Symbol]',
|
|
63
|
+
undefinedTag = '[object Undefined]',
|
|
64
|
+
weakMapTag = '[object WeakMap]';
|
|
65
|
+
|
|
66
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
67
|
+
dataViewTag = '[object DataView]',
|
|
68
|
+
float32Tag = '[object Float32Array]',
|
|
69
|
+
float64Tag = '[object Float64Array]',
|
|
70
|
+
int8Tag = '[object Int8Array]',
|
|
71
|
+
int16Tag = '[object Int16Array]',
|
|
72
|
+
int32Tag = '[object Int32Array]',
|
|
73
|
+
uint8Tag = '[object Uint8Array]',
|
|
74
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
75
|
+
uint16Tag = '[object Uint16Array]',
|
|
76
|
+
uint32Tag = '[object Uint32Array]';
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Used to match `RegExp`
|
|
80
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
81
|
+
*/
|
|
82
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
83
|
+
|
|
84
|
+
/** Used to detect host constructors (Safari). */
|
|
85
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
86
|
+
|
|
87
|
+
/** Used to detect unsigned integer values. */
|
|
88
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
89
|
+
|
|
90
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
91
|
+
var typedArrayTags = {};
|
|
92
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
93
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
94
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
95
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
96
|
+
typedArrayTags[uint32Tag] = true;
|
|
97
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
98
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
99
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
100
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
101
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
102
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
103
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
|
104
|
+
typedArrayTags[weakMapTag] = false;
|
|
105
|
+
|
|
106
|
+
/** Detect free variable `global` from Node.js. */
|
|
107
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
108
|
+
|
|
109
|
+
/** Detect free variable `self`. */
|
|
110
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
111
|
+
|
|
112
|
+
/** Used as a reference to the global object. */
|
|
113
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
114
|
+
|
|
115
|
+
/** Detect free variable `exports`. */
|
|
116
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
117
|
+
|
|
118
|
+
/** Detect free variable `module`. */
|
|
119
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
120
|
+
|
|
121
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
122
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
123
|
+
|
|
124
|
+
/** Detect free variable `process` from Node.js. */
|
|
125
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
126
|
+
|
|
127
|
+
/** Used to access faster Node.js helpers. */
|
|
128
|
+
var nodeUtil = (function() {
|
|
129
|
+
try {
|
|
130
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
131
|
+
} catch (e) {}
|
|
132
|
+
}());
|
|
133
|
+
|
|
134
|
+
/* Node.js helper references. */
|
|
135
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A specialized version of `_.filter` for arrays without support for
|
|
139
|
+
* iteratee shorthands.
|
|
140
|
+
*
|
|
141
|
+
* @private
|
|
142
|
+
* @param {Array} [array] The array to iterate over.
|
|
143
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
144
|
+
* @returns {Array} Returns the new filtered array.
|
|
145
|
+
*/
|
|
146
|
+
function arrayFilter(array, predicate) {
|
|
147
|
+
var index = -1,
|
|
148
|
+
length = array == null ? 0 : array.length,
|
|
149
|
+
resIndex = 0,
|
|
150
|
+
result = [];
|
|
151
|
+
|
|
152
|
+
while (++index < length) {
|
|
153
|
+
var value = array[index];
|
|
154
|
+
if (predicate(value, index, array)) {
|
|
155
|
+
result[resIndex++] = value;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Appends the elements of `values` to `array`.
|
|
163
|
+
*
|
|
164
|
+
* @private
|
|
165
|
+
* @param {Array} array The array to modify.
|
|
166
|
+
* @param {Array} values The values to append.
|
|
167
|
+
* @returns {Array} Returns `array`.
|
|
168
|
+
*/
|
|
169
|
+
function arrayPush(array, values) {
|
|
170
|
+
var index = -1,
|
|
171
|
+
length = values.length,
|
|
172
|
+
offset = array.length;
|
|
173
|
+
|
|
174
|
+
while (++index < length) {
|
|
175
|
+
array[offset + index] = values[index];
|
|
176
|
+
}
|
|
177
|
+
return array;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A specialized version of `_.some` for arrays without support for iteratee
|
|
182
|
+
* shorthands.
|
|
183
|
+
*
|
|
184
|
+
* @private
|
|
185
|
+
* @param {Array} [array] The array to iterate over.
|
|
186
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
187
|
+
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
188
|
+
* else `false`.
|
|
189
|
+
*/
|
|
190
|
+
function arraySome(array, predicate) {
|
|
191
|
+
var index = -1,
|
|
192
|
+
length = array == null ? 0 : array.length;
|
|
193
|
+
|
|
194
|
+
while (++index < length) {
|
|
195
|
+
if (predicate(array[index], index, array)) {
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
204
|
+
* or max array length checks.
|
|
205
|
+
*
|
|
206
|
+
* @private
|
|
207
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
208
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
209
|
+
* @returns {Array} Returns the array of results.
|
|
210
|
+
*/
|
|
211
|
+
function baseTimes(n, iteratee) {
|
|
212
|
+
var index = -1,
|
|
213
|
+
result = Array(n);
|
|
214
|
+
|
|
215
|
+
while (++index < n) {
|
|
216
|
+
result[index] = iteratee(index);
|
|
217
|
+
}
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
223
|
+
*
|
|
224
|
+
* @private
|
|
225
|
+
* @param {Function} func The function to cap arguments for.
|
|
226
|
+
* @returns {Function} Returns the new capped function.
|
|
227
|
+
*/
|
|
228
|
+
function baseUnary(func) {
|
|
229
|
+
return function(value) {
|
|
230
|
+
return func(value);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Checks if a `cache` value for `key` exists.
|
|
236
|
+
*
|
|
237
|
+
* @private
|
|
238
|
+
* @param {Object} cache The cache to query.
|
|
239
|
+
* @param {string} key The key of the entry to check.
|
|
240
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
241
|
+
*/
|
|
242
|
+
function cacheHas(cache, key) {
|
|
243
|
+
return cache.has(key);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Gets the value at `key` of `object`.
|
|
248
|
+
*
|
|
249
|
+
* @private
|
|
250
|
+
* @param {Object} [object] The object to query.
|
|
251
|
+
* @param {string} key The key of the property to get.
|
|
252
|
+
* @returns {*} Returns the property value.
|
|
253
|
+
*/
|
|
254
|
+
function getValue(object, key) {
|
|
255
|
+
return object == null ? undefined : object[key];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Converts `map` to its key-value pairs.
|
|
260
|
+
*
|
|
261
|
+
* @private
|
|
262
|
+
* @param {Object} map The map to convert.
|
|
263
|
+
* @returns {Array} Returns the key-value pairs.
|
|
264
|
+
*/
|
|
265
|
+
function mapToArray(map) {
|
|
266
|
+
var index = -1,
|
|
267
|
+
result = Array(map.size);
|
|
268
|
+
|
|
269
|
+
map.forEach(function(value, key) {
|
|
270
|
+
result[++index] = [key, value];
|
|
271
|
+
});
|
|
272
|
+
return result;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
277
|
+
*
|
|
278
|
+
* @private
|
|
279
|
+
* @param {Function} func The function to wrap.
|
|
280
|
+
* @param {Function} transform The argument transform.
|
|
281
|
+
* @returns {Function} Returns the new function.
|
|
282
|
+
*/
|
|
283
|
+
function overArg(func, transform) {
|
|
284
|
+
return function(arg) {
|
|
285
|
+
return func(transform(arg));
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Converts `set` to an array of its values.
|
|
291
|
+
*
|
|
292
|
+
* @private
|
|
293
|
+
* @param {Object} set The set to convert.
|
|
294
|
+
* @returns {Array} Returns the values.
|
|
295
|
+
*/
|
|
296
|
+
function setToArray(set) {
|
|
297
|
+
var index = -1,
|
|
298
|
+
result = Array(set.size);
|
|
299
|
+
|
|
300
|
+
set.forEach(function(value) {
|
|
301
|
+
result[++index] = value;
|
|
302
|
+
});
|
|
303
|
+
return result;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** Used for built-in method references. */
|
|
307
|
+
var arrayProto = Array.prototype,
|
|
308
|
+
funcProto = Function.prototype,
|
|
309
|
+
objectProto = Object.prototype;
|
|
310
|
+
|
|
311
|
+
/** Used to detect overreaching core-js shims. */
|
|
312
|
+
var coreJsData = root['__core-js_shared__'];
|
|
313
|
+
|
|
314
|
+
/** Used to resolve the decompiled source of functions. */
|
|
315
|
+
var funcToString = funcProto.toString;
|
|
316
|
+
|
|
317
|
+
/** Used to check objects for own properties. */
|
|
318
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
319
|
+
|
|
320
|
+
/** Used to detect methods masquerading as native. */
|
|
321
|
+
var maskSrcKey = (function() {
|
|
322
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
323
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
324
|
+
}());
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Used to resolve the
|
|
328
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
329
|
+
* of values.
|
|
330
|
+
*/
|
|
331
|
+
var nativeObjectToString = objectProto.toString;
|
|
332
|
+
|
|
333
|
+
/** Used to detect if a method is native. */
|
|
334
|
+
var reIsNative = RegExp('^' +
|
|
335
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
336
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
/** Built-in value references. */
|
|
340
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
341
|
+
Symbol = root.Symbol,
|
|
342
|
+
Uint8Array = root.Uint8Array,
|
|
343
|
+
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
|
344
|
+
splice = arrayProto.splice,
|
|
345
|
+
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
346
|
+
|
|
347
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
348
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols,
|
|
349
|
+
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
|
|
350
|
+
nativeKeys = overArg(Object.keys, Object);
|
|
351
|
+
|
|
352
|
+
/* Built-in method references that are verified to be native. */
|
|
353
|
+
var DataView = getNative(root, 'DataView'),
|
|
354
|
+
Map = getNative(root, 'Map'),
|
|
355
|
+
Promise = getNative(root, 'Promise'),
|
|
356
|
+
Set = getNative(root, 'Set'),
|
|
357
|
+
WeakMap = getNative(root, 'WeakMap'),
|
|
358
|
+
nativeCreate = getNative(Object, 'create');
|
|
359
|
+
|
|
360
|
+
/** Used to detect maps, sets, and weakmaps. */
|
|
361
|
+
var dataViewCtorString = toSource(DataView),
|
|
362
|
+
mapCtorString = toSource(Map),
|
|
363
|
+
promiseCtorString = toSource(Promise),
|
|
364
|
+
setCtorString = toSource(Set),
|
|
365
|
+
weakMapCtorString = toSource(WeakMap);
|
|
366
|
+
|
|
367
|
+
/** Used to convert symbols to primitives and strings. */
|
|
368
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
369
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Creates a hash object.
|
|
373
|
+
*
|
|
374
|
+
* @private
|
|
375
|
+
* @constructor
|
|
376
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
377
|
+
*/
|
|
378
|
+
function Hash(entries) {
|
|
379
|
+
var index = -1,
|
|
380
|
+
length = entries == null ? 0 : entries.length;
|
|
381
|
+
|
|
382
|
+
this.clear();
|
|
383
|
+
while (++index < length) {
|
|
384
|
+
var entry = entries[index];
|
|
385
|
+
this.set(entry[0], entry[1]);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Removes all key-value entries from the hash.
|
|
391
|
+
*
|
|
392
|
+
* @private
|
|
393
|
+
* @name clear
|
|
394
|
+
* @memberOf Hash
|
|
395
|
+
*/
|
|
396
|
+
function hashClear() {
|
|
397
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
398
|
+
this.size = 0;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Removes `key` and its value from the hash.
|
|
403
|
+
*
|
|
404
|
+
* @private
|
|
405
|
+
* @name delete
|
|
406
|
+
* @memberOf Hash
|
|
407
|
+
* @param {Object} hash The hash to modify.
|
|
408
|
+
* @param {string} key The key of the value to remove.
|
|
409
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
410
|
+
*/
|
|
411
|
+
function hashDelete(key) {
|
|
412
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
413
|
+
this.size -= result ? 1 : 0;
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Gets the hash value for `key`.
|
|
419
|
+
*
|
|
420
|
+
* @private
|
|
421
|
+
* @name get
|
|
422
|
+
* @memberOf Hash
|
|
423
|
+
* @param {string} key The key of the value to get.
|
|
424
|
+
* @returns {*} Returns the entry value.
|
|
425
|
+
*/
|
|
426
|
+
function hashGet(key) {
|
|
427
|
+
var data = this.__data__;
|
|
428
|
+
if (nativeCreate) {
|
|
429
|
+
var result = data[key];
|
|
430
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
431
|
+
}
|
|
432
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Checks if a hash value for `key` exists.
|
|
437
|
+
*
|
|
438
|
+
* @private
|
|
439
|
+
* @name has
|
|
440
|
+
* @memberOf Hash
|
|
441
|
+
* @param {string} key The key of the entry to check.
|
|
442
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
443
|
+
*/
|
|
444
|
+
function hashHas(key) {
|
|
445
|
+
var data = this.__data__;
|
|
446
|
+
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Sets the hash `key` to `value`.
|
|
451
|
+
*
|
|
452
|
+
* @private
|
|
453
|
+
* @name set
|
|
454
|
+
* @memberOf Hash
|
|
455
|
+
* @param {string} key The key of the value to set.
|
|
456
|
+
* @param {*} value The value to set.
|
|
457
|
+
* @returns {Object} Returns the hash instance.
|
|
458
|
+
*/
|
|
459
|
+
function hashSet(key, value) {
|
|
460
|
+
var data = this.__data__;
|
|
461
|
+
this.size += this.has(key) ? 0 : 1;
|
|
462
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
463
|
+
return this;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Add methods to `Hash`.
|
|
467
|
+
Hash.prototype.clear = hashClear;
|
|
468
|
+
Hash.prototype['delete'] = hashDelete;
|
|
469
|
+
Hash.prototype.get = hashGet;
|
|
470
|
+
Hash.prototype.has = hashHas;
|
|
471
|
+
Hash.prototype.set = hashSet;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Creates an list cache object.
|
|
475
|
+
*
|
|
476
|
+
* @private
|
|
477
|
+
* @constructor
|
|
478
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
479
|
+
*/
|
|
480
|
+
function ListCache(entries) {
|
|
481
|
+
var index = -1,
|
|
482
|
+
length = entries == null ? 0 : entries.length;
|
|
483
|
+
|
|
484
|
+
this.clear();
|
|
485
|
+
while (++index < length) {
|
|
486
|
+
var entry = entries[index];
|
|
487
|
+
this.set(entry[0], entry[1]);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Removes all key-value entries from the list cache.
|
|
493
|
+
*
|
|
494
|
+
* @private
|
|
495
|
+
* @name clear
|
|
496
|
+
* @memberOf ListCache
|
|
497
|
+
*/
|
|
498
|
+
function listCacheClear() {
|
|
499
|
+
this.__data__ = [];
|
|
500
|
+
this.size = 0;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Removes `key` and its value from the list cache.
|
|
505
|
+
*
|
|
506
|
+
* @private
|
|
507
|
+
* @name delete
|
|
508
|
+
* @memberOf ListCache
|
|
509
|
+
* @param {string} key The key of the value to remove.
|
|
510
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
511
|
+
*/
|
|
512
|
+
function listCacheDelete(key) {
|
|
513
|
+
var data = this.__data__,
|
|
514
|
+
index = assocIndexOf(data, key);
|
|
515
|
+
|
|
516
|
+
if (index < 0) {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
var lastIndex = data.length - 1;
|
|
520
|
+
if (index == lastIndex) {
|
|
521
|
+
data.pop();
|
|
522
|
+
} else {
|
|
523
|
+
splice.call(data, index, 1);
|
|
524
|
+
}
|
|
525
|
+
--this.size;
|
|
526
|
+
return true;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Gets the list cache value for `key`.
|
|
531
|
+
*
|
|
532
|
+
* @private
|
|
533
|
+
* @name get
|
|
534
|
+
* @memberOf ListCache
|
|
535
|
+
* @param {string} key The key of the value to get.
|
|
536
|
+
* @returns {*} Returns the entry value.
|
|
537
|
+
*/
|
|
538
|
+
function listCacheGet(key) {
|
|
539
|
+
var data = this.__data__,
|
|
540
|
+
index = assocIndexOf(data, key);
|
|
541
|
+
|
|
542
|
+
return index < 0 ? undefined : data[index][1];
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Checks if a list cache value for `key` exists.
|
|
547
|
+
*
|
|
548
|
+
* @private
|
|
549
|
+
* @name has
|
|
550
|
+
* @memberOf ListCache
|
|
551
|
+
* @param {string} key The key of the entry to check.
|
|
552
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
553
|
+
*/
|
|
554
|
+
function listCacheHas(key) {
|
|
555
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Sets the list cache `key` to `value`.
|
|
560
|
+
*
|
|
561
|
+
* @private
|
|
562
|
+
* @name set
|
|
563
|
+
* @memberOf ListCache
|
|
564
|
+
* @param {string} key The key of the value to set.
|
|
565
|
+
* @param {*} value The value to set.
|
|
566
|
+
* @returns {Object} Returns the list cache instance.
|
|
567
|
+
*/
|
|
568
|
+
function listCacheSet(key, value) {
|
|
569
|
+
var data = this.__data__,
|
|
570
|
+
index = assocIndexOf(data, key);
|
|
571
|
+
|
|
572
|
+
if (index < 0) {
|
|
573
|
+
++this.size;
|
|
574
|
+
data.push([key, value]);
|
|
575
|
+
} else {
|
|
576
|
+
data[index][1] = value;
|
|
577
|
+
}
|
|
578
|
+
return this;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Add methods to `ListCache`.
|
|
582
|
+
ListCache.prototype.clear = listCacheClear;
|
|
583
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
584
|
+
ListCache.prototype.get = listCacheGet;
|
|
585
|
+
ListCache.prototype.has = listCacheHas;
|
|
586
|
+
ListCache.prototype.set = listCacheSet;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Creates a map cache object to store key-value pairs.
|
|
590
|
+
*
|
|
591
|
+
* @private
|
|
592
|
+
* @constructor
|
|
593
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
594
|
+
*/
|
|
595
|
+
function MapCache(entries) {
|
|
596
|
+
var index = -1,
|
|
597
|
+
length = entries == null ? 0 : entries.length;
|
|
598
|
+
|
|
599
|
+
this.clear();
|
|
600
|
+
while (++index < length) {
|
|
601
|
+
var entry = entries[index];
|
|
602
|
+
this.set(entry[0], entry[1]);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Removes all key-value entries from the map.
|
|
608
|
+
*
|
|
609
|
+
* @private
|
|
610
|
+
* @name clear
|
|
611
|
+
* @memberOf MapCache
|
|
612
|
+
*/
|
|
613
|
+
function mapCacheClear() {
|
|
614
|
+
this.size = 0;
|
|
615
|
+
this.__data__ = {
|
|
616
|
+
'hash': new Hash,
|
|
617
|
+
'map': new (Map || ListCache),
|
|
618
|
+
'string': new Hash
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Removes `key` and its value from the map.
|
|
624
|
+
*
|
|
625
|
+
* @private
|
|
626
|
+
* @name delete
|
|
627
|
+
* @memberOf MapCache
|
|
628
|
+
* @param {string} key The key of the value to remove.
|
|
629
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
630
|
+
*/
|
|
631
|
+
function mapCacheDelete(key) {
|
|
632
|
+
var result = getMapData(this, key)['delete'](key);
|
|
633
|
+
this.size -= result ? 1 : 0;
|
|
634
|
+
return result;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Gets the map value for `key`.
|
|
639
|
+
*
|
|
640
|
+
* @private
|
|
641
|
+
* @name get
|
|
642
|
+
* @memberOf MapCache
|
|
643
|
+
* @param {string} key The key of the value to get.
|
|
644
|
+
* @returns {*} Returns the entry value.
|
|
645
|
+
*/
|
|
646
|
+
function mapCacheGet(key) {
|
|
647
|
+
return getMapData(this, key).get(key);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Checks if a map value for `key` exists.
|
|
652
|
+
*
|
|
653
|
+
* @private
|
|
654
|
+
* @name has
|
|
655
|
+
* @memberOf MapCache
|
|
656
|
+
* @param {string} key The key of the entry to check.
|
|
657
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
658
|
+
*/
|
|
659
|
+
function mapCacheHas(key) {
|
|
660
|
+
return getMapData(this, key).has(key);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Sets the map `key` to `value`.
|
|
665
|
+
*
|
|
666
|
+
* @private
|
|
667
|
+
* @name set
|
|
668
|
+
* @memberOf MapCache
|
|
669
|
+
* @param {string} key The key of the value to set.
|
|
670
|
+
* @param {*} value The value to set.
|
|
671
|
+
* @returns {Object} Returns the map cache instance.
|
|
672
|
+
*/
|
|
673
|
+
function mapCacheSet(key, value) {
|
|
674
|
+
var data = getMapData(this, key),
|
|
675
|
+
size = data.size;
|
|
676
|
+
|
|
677
|
+
data.set(key, value);
|
|
678
|
+
this.size += data.size == size ? 0 : 1;
|
|
679
|
+
return this;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// Add methods to `MapCache`.
|
|
683
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
684
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
685
|
+
MapCache.prototype.get = mapCacheGet;
|
|
686
|
+
MapCache.prototype.has = mapCacheHas;
|
|
687
|
+
MapCache.prototype.set = mapCacheSet;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
*
|
|
691
|
+
* Creates an array cache object to store unique values.
|
|
692
|
+
*
|
|
693
|
+
* @private
|
|
694
|
+
* @constructor
|
|
695
|
+
* @param {Array} [values] The values to cache.
|
|
696
|
+
*/
|
|
697
|
+
function SetCache(values) {
|
|
698
|
+
var index = -1,
|
|
699
|
+
length = values == null ? 0 : values.length;
|
|
700
|
+
|
|
701
|
+
this.__data__ = new MapCache;
|
|
702
|
+
while (++index < length) {
|
|
703
|
+
this.add(values[index]);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Adds `value` to the array cache.
|
|
709
|
+
*
|
|
710
|
+
* @private
|
|
711
|
+
* @name add
|
|
712
|
+
* @memberOf SetCache
|
|
713
|
+
* @alias push
|
|
714
|
+
* @param {*} value The value to cache.
|
|
715
|
+
* @returns {Object} Returns the cache instance.
|
|
716
|
+
*/
|
|
717
|
+
function setCacheAdd(value) {
|
|
718
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
719
|
+
return this;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Checks if `value` is in the array cache.
|
|
724
|
+
*
|
|
725
|
+
* @private
|
|
726
|
+
* @name has
|
|
727
|
+
* @memberOf SetCache
|
|
728
|
+
* @param {*} value The value to search for.
|
|
729
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
730
|
+
*/
|
|
731
|
+
function setCacheHas(value) {
|
|
732
|
+
return this.__data__.has(value);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
// Add methods to `SetCache`.
|
|
736
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
737
|
+
SetCache.prototype.has = setCacheHas;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Creates a stack cache object to store key-value pairs.
|
|
741
|
+
*
|
|
742
|
+
* @private
|
|
743
|
+
* @constructor
|
|
744
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
745
|
+
*/
|
|
746
|
+
function Stack(entries) {
|
|
747
|
+
var data = this.__data__ = new ListCache(entries);
|
|
748
|
+
this.size = data.size;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Removes all key-value entries from the stack.
|
|
753
|
+
*
|
|
754
|
+
* @private
|
|
755
|
+
* @name clear
|
|
756
|
+
* @memberOf Stack
|
|
757
|
+
*/
|
|
758
|
+
function stackClear() {
|
|
759
|
+
this.__data__ = new ListCache;
|
|
760
|
+
this.size = 0;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Removes `key` and its value from the stack.
|
|
765
|
+
*
|
|
766
|
+
* @private
|
|
767
|
+
* @name delete
|
|
768
|
+
* @memberOf Stack
|
|
769
|
+
* @param {string} key The key of the value to remove.
|
|
770
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
771
|
+
*/
|
|
772
|
+
function stackDelete(key) {
|
|
773
|
+
var data = this.__data__,
|
|
774
|
+
result = data['delete'](key);
|
|
775
|
+
|
|
776
|
+
this.size = data.size;
|
|
777
|
+
return result;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Gets the stack value for `key`.
|
|
782
|
+
*
|
|
783
|
+
* @private
|
|
784
|
+
* @name get
|
|
785
|
+
* @memberOf Stack
|
|
786
|
+
* @param {string} key The key of the value to get.
|
|
787
|
+
* @returns {*} Returns the entry value.
|
|
788
|
+
*/
|
|
789
|
+
function stackGet(key) {
|
|
790
|
+
return this.__data__.get(key);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Checks if a stack value for `key` exists.
|
|
795
|
+
*
|
|
796
|
+
* @private
|
|
797
|
+
* @name has
|
|
798
|
+
* @memberOf Stack
|
|
799
|
+
* @param {string} key The key of the entry to check.
|
|
800
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
801
|
+
*/
|
|
802
|
+
function stackHas(key) {
|
|
803
|
+
return this.__data__.has(key);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Sets the stack `key` to `value`.
|
|
808
|
+
*
|
|
809
|
+
* @private
|
|
810
|
+
* @name set
|
|
811
|
+
* @memberOf Stack
|
|
812
|
+
* @param {string} key The key of the value to set.
|
|
813
|
+
* @param {*} value The value to set.
|
|
814
|
+
* @returns {Object} Returns the stack cache instance.
|
|
815
|
+
*/
|
|
816
|
+
function stackSet(key, value) {
|
|
817
|
+
var data = this.__data__;
|
|
818
|
+
if (data instanceof ListCache) {
|
|
819
|
+
var pairs = data.__data__;
|
|
820
|
+
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
821
|
+
pairs.push([key, value]);
|
|
822
|
+
this.size = ++data.size;
|
|
823
|
+
return this;
|
|
824
|
+
}
|
|
825
|
+
data = this.__data__ = new MapCache(pairs);
|
|
826
|
+
}
|
|
827
|
+
data.set(key, value);
|
|
828
|
+
this.size = data.size;
|
|
829
|
+
return this;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
// Add methods to `Stack`.
|
|
833
|
+
Stack.prototype.clear = stackClear;
|
|
834
|
+
Stack.prototype['delete'] = stackDelete;
|
|
835
|
+
Stack.prototype.get = stackGet;
|
|
836
|
+
Stack.prototype.has = stackHas;
|
|
837
|
+
Stack.prototype.set = stackSet;
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
841
|
+
*
|
|
842
|
+
* @private
|
|
843
|
+
* @param {*} value The value to query.
|
|
844
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
845
|
+
* @returns {Array} Returns the array of property names.
|
|
846
|
+
*/
|
|
847
|
+
function arrayLikeKeys(value, inherited) {
|
|
848
|
+
var isArr = isArray(value),
|
|
849
|
+
isArg = !isArr && isArguments(value),
|
|
850
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
|
851
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
|
852
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
853
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
854
|
+
length = result.length;
|
|
855
|
+
|
|
856
|
+
for (var key in value) {
|
|
857
|
+
if ((inherited || hasOwnProperty.call(value, key)) &&
|
|
858
|
+
!(skipIndexes && (
|
|
859
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
860
|
+
key == 'length' ||
|
|
861
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
862
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
863
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
864
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
865
|
+
// Skip index properties.
|
|
866
|
+
isIndex(key, length)
|
|
867
|
+
))) {
|
|
868
|
+
result.push(key);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
return result;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
876
|
+
*
|
|
877
|
+
* @private
|
|
878
|
+
* @param {Array} array The array to inspect.
|
|
879
|
+
* @param {*} key The key to search for.
|
|
880
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
881
|
+
*/
|
|
882
|
+
function assocIndexOf(array, key) {
|
|
883
|
+
var length = array.length;
|
|
884
|
+
while (length--) {
|
|
885
|
+
if (eq(array[length][0], key)) {
|
|
886
|
+
return length;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
return -1;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
894
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
895
|
+
* symbols of `object`.
|
|
896
|
+
*
|
|
897
|
+
* @private
|
|
898
|
+
* @param {Object} object The object to query.
|
|
899
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
900
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
901
|
+
* @returns {Array} Returns the array of property names and symbols.
|
|
902
|
+
*/
|
|
903
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
904
|
+
var result = keysFunc(object);
|
|
905
|
+
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
910
|
+
*
|
|
911
|
+
* @private
|
|
912
|
+
* @param {*} value The value to query.
|
|
913
|
+
* @returns {string} Returns the `toStringTag`.
|
|
914
|
+
*/
|
|
915
|
+
function baseGetTag(value) {
|
|
916
|
+
if (value == null) {
|
|
917
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
918
|
+
}
|
|
919
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
920
|
+
? getRawTag(value)
|
|
921
|
+
: objectToString(value);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* The base implementation of `_.isArguments`.
|
|
926
|
+
*
|
|
927
|
+
* @private
|
|
928
|
+
* @param {*} value The value to check.
|
|
929
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
930
|
+
*/
|
|
931
|
+
function baseIsArguments(value) {
|
|
932
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* The base implementation of `_.isEqual` which supports partial comparisons
|
|
937
|
+
* and tracks traversed objects.
|
|
938
|
+
*
|
|
939
|
+
* @private
|
|
940
|
+
* @param {*} value The value to compare.
|
|
941
|
+
* @param {*} other The other value to compare.
|
|
942
|
+
* @param {boolean} bitmask The bitmask flags.
|
|
943
|
+
* 1 - Unordered comparison
|
|
944
|
+
* 2 - Partial comparison
|
|
945
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
|
946
|
+
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
947
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
948
|
+
*/
|
|
949
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
950
|
+
if (value === other) {
|
|
951
|
+
return true;
|
|
952
|
+
}
|
|
953
|
+
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
|
|
954
|
+
return value !== value && other !== other;
|
|
955
|
+
}
|
|
956
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
961
|
+
* deep comparisons and tracks traversed objects enabling objects with circular
|
|
962
|
+
* references to be compared.
|
|
963
|
+
*
|
|
964
|
+
* @private
|
|
965
|
+
* @param {Object} object The object to compare.
|
|
966
|
+
* @param {Object} other The other object to compare.
|
|
967
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
968
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
969
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
970
|
+
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
971
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
972
|
+
*/
|
|
973
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
974
|
+
var objIsArr = isArray(object),
|
|
975
|
+
othIsArr = isArray(other),
|
|
976
|
+
objTag = objIsArr ? arrayTag : getTag(object),
|
|
977
|
+
othTag = othIsArr ? arrayTag : getTag(other);
|
|
978
|
+
|
|
979
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
980
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
981
|
+
|
|
982
|
+
var objIsObj = objTag == objectTag,
|
|
983
|
+
othIsObj = othTag == objectTag,
|
|
984
|
+
isSameTag = objTag == othTag;
|
|
985
|
+
|
|
986
|
+
if (isSameTag && isBuffer(object)) {
|
|
987
|
+
if (!isBuffer(other)) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
objIsArr = true;
|
|
991
|
+
objIsObj = false;
|
|
992
|
+
}
|
|
993
|
+
if (isSameTag && !objIsObj) {
|
|
994
|
+
stack || (stack = new Stack);
|
|
995
|
+
return (objIsArr || isTypedArray(object))
|
|
996
|
+
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
997
|
+
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
998
|
+
}
|
|
999
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
1000
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
|
1001
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
|
1002
|
+
|
|
1003
|
+
if (objIsWrapped || othIsWrapped) {
|
|
1004
|
+
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
1005
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
1006
|
+
|
|
1007
|
+
stack || (stack = new Stack);
|
|
1008
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
if (!isSameTag) {
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
1014
|
+
stack || (stack = new Stack);
|
|
1015
|
+
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
1020
|
+
*
|
|
1021
|
+
* @private
|
|
1022
|
+
* @param {*} value The value to check.
|
|
1023
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
1024
|
+
* else `false`.
|
|
1025
|
+
*/
|
|
1026
|
+
function baseIsNative(value) {
|
|
1027
|
+
if (!isObject(value) || isMasked(value)) {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
1031
|
+
return pattern.test(toSource(value));
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
1036
|
+
*
|
|
1037
|
+
* @private
|
|
1038
|
+
* @param {*} value The value to check.
|
|
1039
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1040
|
+
*/
|
|
1041
|
+
function baseIsTypedArray(value) {
|
|
1042
|
+
return isObjectLike(value) &&
|
|
1043
|
+
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
1048
|
+
*
|
|
1049
|
+
* @private
|
|
1050
|
+
* @param {Object} object The object to query.
|
|
1051
|
+
* @returns {Array} Returns the array of property names.
|
|
1052
|
+
*/
|
|
1053
|
+
function baseKeys(object) {
|
|
1054
|
+
if (!isPrototype(object)) {
|
|
1055
|
+
return nativeKeys(object);
|
|
1056
|
+
}
|
|
1057
|
+
var result = [];
|
|
1058
|
+
for (var key in Object(object)) {
|
|
1059
|
+
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
|
1060
|
+
result.push(key);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return result;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
1068
|
+
* partial deep comparisons.
|
|
1069
|
+
*
|
|
1070
|
+
* @private
|
|
1071
|
+
* @param {Array} array The array to compare.
|
|
1072
|
+
* @param {Array} other The other array to compare.
|
|
1073
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1074
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
1075
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1076
|
+
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
|
1077
|
+
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
1078
|
+
*/
|
|
1079
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1080
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
|
1081
|
+
arrLength = array.length,
|
|
1082
|
+
othLength = other.length;
|
|
1083
|
+
|
|
1084
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
1087
|
+
// Assume cyclic values are equal.
|
|
1088
|
+
var stacked = stack.get(array);
|
|
1089
|
+
if (stacked && stack.get(other)) {
|
|
1090
|
+
return stacked == other;
|
|
1091
|
+
}
|
|
1092
|
+
var index = -1,
|
|
1093
|
+
result = true,
|
|
1094
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
|
|
1095
|
+
|
|
1096
|
+
stack.set(array, other);
|
|
1097
|
+
stack.set(other, array);
|
|
1098
|
+
|
|
1099
|
+
// Ignore non-index properties.
|
|
1100
|
+
while (++index < arrLength) {
|
|
1101
|
+
var arrValue = array[index],
|
|
1102
|
+
othValue = other[index];
|
|
1103
|
+
|
|
1104
|
+
if (customizer) {
|
|
1105
|
+
var compared = isPartial
|
|
1106
|
+
? customizer(othValue, arrValue, index, other, array, stack)
|
|
1107
|
+
: customizer(arrValue, othValue, index, array, other, stack);
|
|
1108
|
+
}
|
|
1109
|
+
if (compared !== undefined) {
|
|
1110
|
+
if (compared) {
|
|
1111
|
+
continue;
|
|
1112
|
+
}
|
|
1113
|
+
result = false;
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
// Recursively compare arrays (susceptible to call stack limits).
|
|
1117
|
+
if (seen) {
|
|
1118
|
+
if (!arraySome(other, function(othValue, othIndex) {
|
|
1119
|
+
if (!cacheHas(seen, othIndex) &&
|
|
1120
|
+
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1121
|
+
return seen.push(othIndex);
|
|
1122
|
+
}
|
|
1123
|
+
})) {
|
|
1124
|
+
result = false;
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
} else if (!(
|
|
1128
|
+
arrValue === othValue ||
|
|
1129
|
+
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
1130
|
+
)) {
|
|
1131
|
+
result = false;
|
|
1132
|
+
break;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
stack['delete'](array);
|
|
1136
|
+
stack['delete'](other);
|
|
1137
|
+
return result;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
1142
|
+
* the same `toStringTag`.
|
|
1143
|
+
*
|
|
1144
|
+
* **Note:** This function only supports comparing values with tags of
|
|
1145
|
+
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
1146
|
+
*
|
|
1147
|
+
* @private
|
|
1148
|
+
* @param {Object} object The object to compare.
|
|
1149
|
+
* @param {Object} other The other object to compare.
|
|
1150
|
+
* @param {string} tag The `toStringTag` of the objects to compare.
|
|
1151
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1152
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
1153
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1154
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1155
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1156
|
+
*/
|
|
1157
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1158
|
+
switch (tag) {
|
|
1159
|
+
case dataViewTag:
|
|
1160
|
+
if ((object.byteLength != other.byteLength) ||
|
|
1161
|
+
(object.byteOffset != other.byteOffset)) {
|
|
1162
|
+
return false;
|
|
1163
|
+
}
|
|
1164
|
+
object = object.buffer;
|
|
1165
|
+
other = other.buffer;
|
|
1166
|
+
|
|
1167
|
+
case arrayBufferTag:
|
|
1168
|
+
if ((object.byteLength != other.byteLength) ||
|
|
1169
|
+
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
1170
|
+
return false;
|
|
1171
|
+
}
|
|
1172
|
+
return true;
|
|
1173
|
+
|
|
1174
|
+
case boolTag:
|
|
1175
|
+
case dateTag:
|
|
1176
|
+
case numberTag:
|
|
1177
|
+
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
1178
|
+
// Invalid dates are coerced to `NaN`.
|
|
1179
|
+
return eq(+object, +other);
|
|
1180
|
+
|
|
1181
|
+
case errorTag:
|
|
1182
|
+
return object.name == other.name && object.message == other.message;
|
|
1183
|
+
|
|
1184
|
+
case regexpTag:
|
|
1185
|
+
case stringTag:
|
|
1186
|
+
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
1187
|
+
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
1188
|
+
// for more details.
|
|
1189
|
+
return object == (other + '');
|
|
1190
|
+
|
|
1191
|
+
case mapTag:
|
|
1192
|
+
var convert = mapToArray;
|
|
1193
|
+
|
|
1194
|
+
case setTag:
|
|
1195
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
1196
|
+
convert || (convert = setToArray);
|
|
1197
|
+
|
|
1198
|
+
if (object.size != other.size && !isPartial) {
|
|
1199
|
+
return false;
|
|
1200
|
+
}
|
|
1201
|
+
// Assume cyclic values are equal.
|
|
1202
|
+
var stacked = stack.get(object);
|
|
1203
|
+
if (stacked) {
|
|
1204
|
+
return stacked == other;
|
|
1205
|
+
}
|
|
1206
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
1207
|
+
|
|
1208
|
+
// Recursively compare objects (susceptible to call stack limits).
|
|
1209
|
+
stack.set(object, other);
|
|
1210
|
+
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1211
|
+
stack['delete'](object);
|
|
1212
|
+
return result;
|
|
1213
|
+
|
|
1214
|
+
case symbolTag:
|
|
1215
|
+
if (symbolValueOf) {
|
|
1216
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
return false;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
1224
|
+
* partial deep comparisons.
|
|
1225
|
+
*
|
|
1226
|
+
* @private
|
|
1227
|
+
* @param {Object} object The object to compare.
|
|
1228
|
+
* @param {Object} other The other object to compare.
|
|
1229
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1230
|
+
* @param {Function} customizer The function to customize comparisons.
|
|
1231
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1232
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1233
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1234
|
+
*/
|
|
1235
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1236
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
|
1237
|
+
objProps = getAllKeys(object),
|
|
1238
|
+
objLength = objProps.length,
|
|
1239
|
+
othProps = getAllKeys(other),
|
|
1240
|
+
othLength = othProps.length;
|
|
1241
|
+
|
|
1242
|
+
if (objLength != othLength && !isPartial) {
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1245
|
+
var index = objLength;
|
|
1246
|
+
while (index--) {
|
|
1247
|
+
var key = objProps[index];
|
|
1248
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
1249
|
+
return false;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
// Assume cyclic values are equal.
|
|
1253
|
+
var stacked = stack.get(object);
|
|
1254
|
+
if (stacked && stack.get(other)) {
|
|
1255
|
+
return stacked == other;
|
|
1256
|
+
}
|
|
1257
|
+
var result = true;
|
|
1258
|
+
stack.set(object, other);
|
|
1259
|
+
stack.set(other, object);
|
|
1260
|
+
|
|
1261
|
+
var skipCtor = isPartial;
|
|
1262
|
+
while (++index < objLength) {
|
|
1263
|
+
key = objProps[index];
|
|
1264
|
+
var objValue = object[key],
|
|
1265
|
+
othValue = other[key];
|
|
1266
|
+
|
|
1267
|
+
if (customizer) {
|
|
1268
|
+
var compared = isPartial
|
|
1269
|
+
? customizer(othValue, objValue, key, other, object, stack)
|
|
1270
|
+
: customizer(objValue, othValue, key, object, other, stack);
|
|
1271
|
+
}
|
|
1272
|
+
// Recursively compare objects (susceptible to call stack limits).
|
|
1273
|
+
if (!(compared === undefined
|
|
1274
|
+
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
1275
|
+
: compared
|
|
1276
|
+
)) {
|
|
1277
|
+
result = false;
|
|
1278
|
+
break;
|
|
1279
|
+
}
|
|
1280
|
+
skipCtor || (skipCtor = key == 'constructor');
|
|
1281
|
+
}
|
|
1282
|
+
if (result && !skipCtor) {
|
|
1283
|
+
var objCtor = object.constructor,
|
|
1284
|
+
othCtor = other.constructor;
|
|
1285
|
+
|
|
1286
|
+
// Non `Object` object instances with different constructors are not equal.
|
|
1287
|
+
if (objCtor != othCtor &&
|
|
1288
|
+
('constructor' in object && 'constructor' in other) &&
|
|
1289
|
+
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
1290
|
+
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
1291
|
+
result = false;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
stack['delete'](object);
|
|
1295
|
+
stack['delete'](other);
|
|
1296
|
+
return result;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Creates an array of own enumerable property names and symbols of `object`.
|
|
1301
|
+
*
|
|
1302
|
+
* @private
|
|
1303
|
+
* @param {Object} object The object to query.
|
|
1304
|
+
* @returns {Array} Returns the array of property names and symbols.
|
|
1305
|
+
*/
|
|
1306
|
+
function getAllKeys(object) {
|
|
1307
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Gets the data for `map`.
|
|
1312
|
+
*
|
|
1313
|
+
* @private
|
|
1314
|
+
* @param {Object} map The map to query.
|
|
1315
|
+
* @param {string} key The reference key.
|
|
1316
|
+
* @returns {*} Returns the map data.
|
|
1317
|
+
*/
|
|
1318
|
+
function getMapData(map, key) {
|
|
1319
|
+
var data = map.__data__;
|
|
1320
|
+
return isKeyable(key)
|
|
1321
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1322
|
+
: data.map;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* Gets the native function at `key` of `object`.
|
|
1327
|
+
*
|
|
1328
|
+
* @private
|
|
1329
|
+
* @param {Object} object The object to query.
|
|
1330
|
+
* @param {string} key The key of the method to get.
|
|
1331
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
1332
|
+
*/
|
|
1333
|
+
function getNative(object, key) {
|
|
1334
|
+
var value = getValue(object, key);
|
|
1335
|
+
return baseIsNative(value) ? value : undefined;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1340
|
+
*
|
|
1341
|
+
* @private
|
|
1342
|
+
* @param {*} value The value to query.
|
|
1343
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
1344
|
+
*/
|
|
1345
|
+
function getRawTag(value) {
|
|
1346
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
1347
|
+
tag = value[symToStringTag];
|
|
1348
|
+
|
|
1349
|
+
try {
|
|
1350
|
+
value[symToStringTag] = undefined;
|
|
1351
|
+
var unmasked = true;
|
|
1352
|
+
} catch (e) {}
|
|
1353
|
+
|
|
1354
|
+
var result = nativeObjectToString.call(value);
|
|
1355
|
+
if (unmasked) {
|
|
1356
|
+
if (isOwn) {
|
|
1357
|
+
value[symToStringTag] = tag;
|
|
1358
|
+
} else {
|
|
1359
|
+
delete value[symToStringTag];
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
return result;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Creates an array of the own enumerable symbols of `object`.
|
|
1367
|
+
*
|
|
1368
|
+
* @private
|
|
1369
|
+
* @param {Object} object The object to query.
|
|
1370
|
+
* @returns {Array} Returns the array of symbols.
|
|
1371
|
+
*/
|
|
1372
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
1373
|
+
if (object == null) {
|
|
1374
|
+
return [];
|
|
1375
|
+
}
|
|
1376
|
+
object = Object(object);
|
|
1377
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
1378
|
+
return propertyIsEnumerable.call(object, symbol);
|
|
1379
|
+
});
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* Gets the `toStringTag` of `value`.
|
|
1384
|
+
*
|
|
1385
|
+
* @private
|
|
1386
|
+
* @param {*} value The value to query.
|
|
1387
|
+
* @returns {string} Returns the `toStringTag`.
|
|
1388
|
+
*/
|
|
1389
|
+
var getTag = baseGetTag;
|
|
1390
|
+
|
|
1391
|
+
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
1392
|
+
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
1393
|
+
(Map && getTag(new Map) != mapTag) ||
|
|
1394
|
+
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
|
1395
|
+
(Set && getTag(new Set) != setTag) ||
|
|
1396
|
+
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
|
1397
|
+
getTag = function(value) {
|
|
1398
|
+
var result = baseGetTag(value),
|
|
1399
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
|
1400
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
|
1401
|
+
|
|
1402
|
+
if (ctorString) {
|
|
1403
|
+
switch (ctorString) {
|
|
1404
|
+
case dataViewCtorString: return dataViewTag;
|
|
1405
|
+
case mapCtorString: return mapTag;
|
|
1406
|
+
case promiseCtorString: return promiseTag;
|
|
1407
|
+
case setCtorString: return setTag;
|
|
1408
|
+
case weakMapCtorString: return weakMapTag;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
return result;
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* Checks if `value` is a valid array-like index.
|
|
1417
|
+
*
|
|
1418
|
+
* @private
|
|
1419
|
+
* @param {*} value The value to check.
|
|
1420
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
1421
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1422
|
+
*/
|
|
1423
|
+
function isIndex(value, length) {
|
|
1424
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
1425
|
+
return !!length &&
|
|
1426
|
+
(typeof value == 'number' || reIsUint.test(value)) &&
|
|
1427
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
1432
|
+
*
|
|
1433
|
+
* @private
|
|
1434
|
+
* @param {*} value The value to check.
|
|
1435
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
1436
|
+
*/
|
|
1437
|
+
function isKeyable(value) {
|
|
1438
|
+
var type = typeof value;
|
|
1439
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
1440
|
+
? (value !== '__proto__')
|
|
1441
|
+
: (value === null);
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* Checks if `func` has its source masked.
|
|
1446
|
+
*
|
|
1447
|
+
* @private
|
|
1448
|
+
* @param {Function} func The function to check.
|
|
1449
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1450
|
+
*/
|
|
1451
|
+
function isMasked(func) {
|
|
1452
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Checks if `value` is likely a prototype object.
|
|
1457
|
+
*
|
|
1458
|
+
* @private
|
|
1459
|
+
* @param {*} value The value to check.
|
|
1460
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1461
|
+
*/
|
|
1462
|
+
function isPrototype(value) {
|
|
1463
|
+
var Ctor = value && value.constructor,
|
|
1464
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
1465
|
+
|
|
1466
|
+
return value === proto;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1471
|
+
*
|
|
1472
|
+
* @private
|
|
1473
|
+
* @param {*} value The value to convert.
|
|
1474
|
+
* @returns {string} Returns the converted string.
|
|
1475
|
+
*/
|
|
1476
|
+
function objectToString(value) {
|
|
1477
|
+
return nativeObjectToString.call(value);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* Converts `func` to its source code.
|
|
1482
|
+
*
|
|
1483
|
+
* @private
|
|
1484
|
+
* @param {Function} func The function to convert.
|
|
1485
|
+
* @returns {string} Returns the source code.
|
|
1486
|
+
*/
|
|
1487
|
+
function toSource(func) {
|
|
1488
|
+
if (func != null) {
|
|
1489
|
+
try {
|
|
1490
|
+
return funcToString.call(func);
|
|
1491
|
+
} catch (e) {}
|
|
1492
|
+
try {
|
|
1493
|
+
return (func + '');
|
|
1494
|
+
} catch (e) {}
|
|
1495
|
+
}
|
|
1496
|
+
return '';
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* Performs a
|
|
1501
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1502
|
+
* comparison between two values to determine if they are equivalent.
|
|
1503
|
+
*
|
|
1504
|
+
* @static
|
|
1505
|
+
* @memberOf _
|
|
1506
|
+
* @since 4.0.0
|
|
1507
|
+
* @category Lang
|
|
1508
|
+
* @param {*} value The value to compare.
|
|
1509
|
+
* @param {*} other The other value to compare.
|
|
1510
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1511
|
+
* @example
|
|
1512
|
+
*
|
|
1513
|
+
* var object = { 'a': 1 };
|
|
1514
|
+
* var other = { 'a': 1 };
|
|
1515
|
+
*
|
|
1516
|
+
* _.eq(object, object);
|
|
1517
|
+
* // => true
|
|
1518
|
+
*
|
|
1519
|
+
* _.eq(object, other);
|
|
1520
|
+
* // => false
|
|
1521
|
+
*
|
|
1522
|
+
* _.eq('a', 'a');
|
|
1523
|
+
* // => true
|
|
1524
|
+
*
|
|
1525
|
+
* _.eq('a', Object('a'));
|
|
1526
|
+
* // => false
|
|
1527
|
+
*
|
|
1528
|
+
* _.eq(NaN, NaN);
|
|
1529
|
+
* // => true
|
|
1530
|
+
*/
|
|
1531
|
+
function eq(value, other) {
|
|
1532
|
+
return value === other || (value !== value && other !== other);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* Checks if `value` is likely an `arguments` object.
|
|
1537
|
+
*
|
|
1538
|
+
* @static
|
|
1539
|
+
* @memberOf _
|
|
1540
|
+
* @since 0.1.0
|
|
1541
|
+
* @category Lang
|
|
1542
|
+
* @param {*} value The value to check.
|
|
1543
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1544
|
+
* else `false`.
|
|
1545
|
+
* @example
|
|
1546
|
+
*
|
|
1547
|
+
* _.isArguments(function() { return arguments; }());
|
|
1548
|
+
* // => true
|
|
1549
|
+
*
|
|
1550
|
+
* _.isArguments([1, 2, 3]);
|
|
1551
|
+
* // => false
|
|
1552
|
+
*/
|
|
1553
|
+
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
1554
|
+
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
|
1555
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Checks if `value` is classified as an `Array` object.
|
|
1560
|
+
*
|
|
1561
|
+
* @static
|
|
1562
|
+
* @memberOf _
|
|
1563
|
+
* @since 0.1.0
|
|
1564
|
+
* @category Lang
|
|
1565
|
+
* @param {*} value The value to check.
|
|
1566
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1567
|
+
* @example
|
|
1568
|
+
*
|
|
1569
|
+
* _.isArray([1, 2, 3]);
|
|
1570
|
+
* // => true
|
|
1571
|
+
*
|
|
1572
|
+
* _.isArray(document.body.children);
|
|
1573
|
+
* // => false
|
|
1574
|
+
*
|
|
1575
|
+
* _.isArray('abc');
|
|
1576
|
+
* // => false
|
|
1577
|
+
*
|
|
1578
|
+
* _.isArray(_.noop);
|
|
1579
|
+
* // => false
|
|
1580
|
+
*/
|
|
1581
|
+
var isArray = Array.isArray;
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
1585
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
1586
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
1587
|
+
*
|
|
1588
|
+
* @static
|
|
1589
|
+
* @memberOf _
|
|
1590
|
+
* @since 4.0.0
|
|
1591
|
+
* @category Lang
|
|
1592
|
+
* @param {*} value The value to check.
|
|
1593
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
1594
|
+
* @example
|
|
1595
|
+
*
|
|
1596
|
+
* _.isArrayLike([1, 2, 3]);
|
|
1597
|
+
* // => true
|
|
1598
|
+
*
|
|
1599
|
+
* _.isArrayLike(document.body.children);
|
|
1600
|
+
* // => true
|
|
1601
|
+
*
|
|
1602
|
+
* _.isArrayLike('abc');
|
|
1603
|
+
* // => true
|
|
1604
|
+
*
|
|
1605
|
+
* _.isArrayLike(_.noop);
|
|
1606
|
+
* // => false
|
|
1607
|
+
*/
|
|
1608
|
+
function isArrayLike(value) {
|
|
1609
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Checks if `value` is a buffer.
|
|
1614
|
+
*
|
|
1615
|
+
* @static
|
|
1616
|
+
* @memberOf _
|
|
1617
|
+
* @since 4.3.0
|
|
1618
|
+
* @category Lang
|
|
1619
|
+
* @param {*} value The value to check.
|
|
1620
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
1621
|
+
* @example
|
|
1622
|
+
*
|
|
1623
|
+
* _.isBuffer(new Buffer(2));
|
|
1624
|
+
* // => true
|
|
1625
|
+
*
|
|
1626
|
+
* _.isBuffer(new Uint8Array(2));
|
|
1627
|
+
* // => false
|
|
1628
|
+
*/
|
|
1629
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* Performs a deep comparison between two values to determine if they are
|
|
1633
|
+
* equivalent.
|
|
1634
|
+
*
|
|
1635
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
1636
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
1637
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
1638
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
1639
|
+
* nodes are compared by strict equality, i.e. `===`.
|
|
1640
|
+
*
|
|
1641
|
+
* @static
|
|
1642
|
+
* @memberOf _
|
|
1643
|
+
* @since 0.1.0
|
|
1644
|
+
* @category Lang
|
|
1645
|
+
* @param {*} value The value to compare.
|
|
1646
|
+
* @param {*} other The other value to compare.
|
|
1647
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1648
|
+
* @example
|
|
1649
|
+
*
|
|
1650
|
+
* var object = { 'a': 1 };
|
|
1651
|
+
* var other = { 'a': 1 };
|
|
1652
|
+
*
|
|
1653
|
+
* _.isEqual(object, other);
|
|
1654
|
+
* // => true
|
|
1655
|
+
*
|
|
1656
|
+
* object === other;
|
|
1657
|
+
* // => false
|
|
1658
|
+
*/
|
|
1659
|
+
function isEqual(value, other) {
|
|
1660
|
+
return baseIsEqual(value, other);
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
/**
|
|
1664
|
+
* Checks if `value` is classified as a `Function` object.
|
|
1665
|
+
*
|
|
1666
|
+
* @static
|
|
1667
|
+
* @memberOf _
|
|
1668
|
+
* @since 0.1.0
|
|
1669
|
+
* @category Lang
|
|
1670
|
+
* @param {*} value The value to check.
|
|
1671
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
1672
|
+
* @example
|
|
1673
|
+
*
|
|
1674
|
+
* _.isFunction(_);
|
|
1675
|
+
* // => true
|
|
1676
|
+
*
|
|
1677
|
+
* _.isFunction(/abc/);
|
|
1678
|
+
* // => false
|
|
1679
|
+
*/
|
|
1680
|
+
function isFunction(value) {
|
|
1681
|
+
if (!isObject(value)) {
|
|
1682
|
+
return false;
|
|
1683
|
+
}
|
|
1684
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
1685
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
1686
|
+
var tag = baseGetTag(value);
|
|
1687
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* Checks if `value` is a valid array-like length.
|
|
1692
|
+
*
|
|
1693
|
+
* **Note:** This method is loosely based on
|
|
1694
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
1695
|
+
*
|
|
1696
|
+
* @static
|
|
1697
|
+
* @memberOf _
|
|
1698
|
+
* @since 4.0.0
|
|
1699
|
+
* @category Lang
|
|
1700
|
+
* @param {*} value The value to check.
|
|
1701
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
1702
|
+
* @example
|
|
1703
|
+
*
|
|
1704
|
+
* _.isLength(3);
|
|
1705
|
+
* // => true
|
|
1706
|
+
*
|
|
1707
|
+
* _.isLength(Number.MIN_VALUE);
|
|
1708
|
+
* // => false
|
|
1709
|
+
*
|
|
1710
|
+
* _.isLength(Infinity);
|
|
1711
|
+
* // => false
|
|
1712
|
+
*
|
|
1713
|
+
* _.isLength('3');
|
|
1714
|
+
* // => false
|
|
1715
|
+
*/
|
|
1716
|
+
function isLength(value) {
|
|
1717
|
+
return typeof value == 'number' &&
|
|
1718
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* Checks if `value` is the
|
|
1723
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
1724
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
1725
|
+
*
|
|
1726
|
+
* @static
|
|
1727
|
+
* @memberOf _
|
|
1728
|
+
* @since 0.1.0
|
|
1729
|
+
* @category Lang
|
|
1730
|
+
* @param {*} value The value to check.
|
|
1731
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
1732
|
+
* @example
|
|
1733
|
+
*
|
|
1734
|
+
* _.isObject({});
|
|
1735
|
+
* // => true
|
|
1736
|
+
*
|
|
1737
|
+
* _.isObject([1, 2, 3]);
|
|
1738
|
+
* // => true
|
|
1739
|
+
*
|
|
1740
|
+
* _.isObject(_.noop);
|
|
1741
|
+
* // => true
|
|
1742
|
+
*
|
|
1743
|
+
* _.isObject(null);
|
|
1744
|
+
* // => false
|
|
1745
|
+
*/
|
|
1746
|
+
function isObject(value) {
|
|
1747
|
+
var type = typeof value;
|
|
1748
|
+
return value != null && (type == 'object' || type == 'function');
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1753
|
+
* and has a `typeof` result of "object".
|
|
1754
|
+
*
|
|
1755
|
+
* @static
|
|
1756
|
+
* @memberOf _
|
|
1757
|
+
* @since 4.0.0
|
|
1758
|
+
* @category Lang
|
|
1759
|
+
* @param {*} value The value to check.
|
|
1760
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1761
|
+
* @example
|
|
1762
|
+
*
|
|
1763
|
+
* _.isObjectLike({});
|
|
1764
|
+
* // => true
|
|
1765
|
+
*
|
|
1766
|
+
* _.isObjectLike([1, 2, 3]);
|
|
1767
|
+
* // => true
|
|
1768
|
+
*
|
|
1769
|
+
* _.isObjectLike(_.noop);
|
|
1770
|
+
* // => false
|
|
1771
|
+
*
|
|
1772
|
+
* _.isObjectLike(null);
|
|
1773
|
+
* // => false
|
|
1774
|
+
*/
|
|
1775
|
+
function isObjectLike(value) {
|
|
1776
|
+
return value != null && typeof value == 'object';
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Checks if `value` is classified as a typed array.
|
|
1781
|
+
*
|
|
1782
|
+
* @static
|
|
1783
|
+
* @memberOf _
|
|
1784
|
+
* @since 3.0.0
|
|
1785
|
+
* @category Lang
|
|
1786
|
+
* @param {*} value The value to check.
|
|
1787
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1788
|
+
* @example
|
|
1789
|
+
*
|
|
1790
|
+
* _.isTypedArray(new Uint8Array);
|
|
1791
|
+
* // => true
|
|
1792
|
+
*
|
|
1793
|
+
* _.isTypedArray([]);
|
|
1794
|
+
* // => false
|
|
1795
|
+
*/
|
|
1796
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* Creates an array of the own enumerable property names of `object`.
|
|
1800
|
+
*
|
|
1801
|
+
* **Note:** Non-object values are coerced to objects. See the
|
|
1802
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
1803
|
+
* for more details.
|
|
1804
|
+
*
|
|
1805
|
+
* @static
|
|
1806
|
+
* @since 0.1.0
|
|
1807
|
+
* @memberOf _
|
|
1808
|
+
* @category Object
|
|
1809
|
+
* @param {Object} object The object to query.
|
|
1810
|
+
* @returns {Array} Returns the array of property names.
|
|
1811
|
+
* @example
|
|
1812
|
+
*
|
|
1813
|
+
* function Foo() {
|
|
1814
|
+
* this.a = 1;
|
|
1815
|
+
* this.b = 2;
|
|
1816
|
+
* }
|
|
1817
|
+
*
|
|
1818
|
+
* Foo.prototype.c = 3;
|
|
1819
|
+
*
|
|
1820
|
+
* _.keys(new Foo);
|
|
1821
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
1822
|
+
*
|
|
1823
|
+
* _.keys('hi');
|
|
1824
|
+
* // => ['0', '1']
|
|
1825
|
+
*/
|
|
1826
|
+
function keys(object) {
|
|
1827
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* This method returns a new empty array.
|
|
1832
|
+
*
|
|
1833
|
+
* @static
|
|
1834
|
+
* @memberOf _
|
|
1835
|
+
* @since 4.13.0
|
|
1836
|
+
* @category Util
|
|
1837
|
+
* @returns {Array} Returns the new empty array.
|
|
1838
|
+
* @example
|
|
1839
|
+
*
|
|
1840
|
+
* var arrays = _.times(2, _.stubArray);
|
|
1841
|
+
*
|
|
1842
|
+
* console.log(arrays);
|
|
1843
|
+
* // => [[], []]
|
|
1844
|
+
*
|
|
1845
|
+
* console.log(arrays[0] === arrays[1]);
|
|
1846
|
+
* // => false
|
|
1847
|
+
*/
|
|
1848
|
+
function stubArray() {
|
|
1849
|
+
return [];
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
/**
|
|
1853
|
+
* This method returns `false`.
|
|
1854
|
+
*
|
|
1855
|
+
* @static
|
|
1856
|
+
* @memberOf _
|
|
1857
|
+
* @since 4.13.0
|
|
1858
|
+
* @category Util
|
|
1859
|
+
* @returns {boolean} Returns `false`.
|
|
1860
|
+
* @example
|
|
1861
|
+
*
|
|
1862
|
+
* _.times(2, _.stubFalse);
|
|
1863
|
+
* // => [false, false]
|
|
1864
|
+
*/
|
|
1865
|
+
function stubFalse() {
|
|
1866
|
+
return false;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
module.exports = isEqual;
|
|
1870
|
+
});
|
|
1871
|
+
|
|
1872
|
+
var intlMessageformat = createCommonjsModule(function (module, exports) {
|
|
1873
|
+
(function (global, factory) {
|
|
1874
|
+
factory(exports) ;
|
|
1875
|
+
}(commonjsGlobal, function (exports) {
|
|
1876
|
+
var parser = /*
|
|
1877
|
+
* Generated by PEG.js 0.10.0.
|
|
1878
|
+
*
|
|
1879
|
+
* http://pegjs.org/
|
|
1880
|
+
*/
|
|
1881
|
+
(function() {
|
|
1882
|
+
|
|
1883
|
+
function peg$subclass(child, parent) {
|
|
1884
|
+
function ctor() { this.constructor = child; }
|
|
1885
|
+
ctor.prototype = parent.prototype;
|
|
1886
|
+
child.prototype = new ctor();
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
function peg$SyntaxError(message, expected, found, location) {
|
|
1890
|
+
this.message = message;
|
|
1891
|
+
this.expected = expected;
|
|
1892
|
+
this.found = found;
|
|
1893
|
+
this.location = location;
|
|
1894
|
+
this.name = "SyntaxError";
|
|
1895
|
+
|
|
1896
|
+
if (typeof Error.captureStackTrace === "function") {
|
|
1897
|
+
Error.captureStackTrace(this, peg$SyntaxError);
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
peg$subclass(peg$SyntaxError, Error);
|
|
1902
|
+
|
|
1903
|
+
peg$SyntaxError.buildMessage = function(expected, found) {
|
|
1904
|
+
var DESCRIBE_EXPECTATION_FNS = {
|
|
1905
|
+
literal: function(expectation) {
|
|
1906
|
+
return "\"" + literalEscape(expectation.text) + "\"";
|
|
1907
|
+
},
|
|
1908
|
+
|
|
1909
|
+
"class": function(expectation) {
|
|
1910
|
+
var escapedParts = "",
|
|
1911
|
+
i;
|
|
1912
|
+
|
|
1913
|
+
for (i = 0; i < expectation.parts.length; i++) {
|
|
1914
|
+
escapedParts += expectation.parts[i] instanceof Array
|
|
1915
|
+
? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
|
|
1916
|
+
: classEscape(expectation.parts[i]);
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
|
|
1920
|
+
},
|
|
1921
|
+
|
|
1922
|
+
any: function(expectation) {
|
|
1923
|
+
return "any character";
|
|
1924
|
+
},
|
|
1925
|
+
|
|
1926
|
+
end: function(expectation) {
|
|
1927
|
+
return "end of input";
|
|
1928
|
+
},
|
|
1929
|
+
|
|
1930
|
+
other: function(expectation) {
|
|
1931
|
+
return expectation.description;
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
function hex(ch) {
|
|
1936
|
+
return ch.charCodeAt(0).toString(16).toUpperCase();
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
function literalEscape(s) {
|
|
1940
|
+
return s
|
|
1941
|
+
.replace(/\\/g, '\\\\')
|
|
1942
|
+
.replace(/"/g, '\\"')
|
|
1943
|
+
.replace(/\0/g, '\\0')
|
|
1944
|
+
.replace(/\t/g, '\\t')
|
|
1945
|
+
.replace(/\n/g, '\\n')
|
|
1946
|
+
.replace(/\r/g, '\\r')
|
|
1947
|
+
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
|
|
1948
|
+
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
function classEscape(s) {
|
|
1952
|
+
return s
|
|
1953
|
+
.replace(/\\/g, '\\\\')
|
|
1954
|
+
.replace(/\]/g, '\\]')
|
|
1955
|
+
.replace(/\^/g, '\\^')
|
|
1956
|
+
.replace(/-/g, '\\-')
|
|
1957
|
+
.replace(/\0/g, '\\0')
|
|
1958
|
+
.replace(/\t/g, '\\t')
|
|
1959
|
+
.replace(/\n/g, '\\n')
|
|
1960
|
+
.replace(/\r/g, '\\r')
|
|
1961
|
+
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
|
|
1962
|
+
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
function describeExpectation(expectation) {
|
|
1966
|
+
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
function describeExpected(expected) {
|
|
1970
|
+
var descriptions = new Array(expected.length),
|
|
1971
|
+
i, j;
|
|
1972
|
+
|
|
1973
|
+
for (i = 0; i < expected.length; i++) {
|
|
1974
|
+
descriptions[i] = describeExpectation(expected[i]);
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
descriptions.sort();
|
|
1978
|
+
|
|
1979
|
+
if (descriptions.length > 0) {
|
|
1980
|
+
for (i = 1, j = 1; i < descriptions.length; i++) {
|
|
1981
|
+
if (descriptions[i - 1] !== descriptions[i]) {
|
|
1982
|
+
descriptions[j] = descriptions[i];
|
|
1983
|
+
j++;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
descriptions.length = j;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
switch (descriptions.length) {
|
|
1990
|
+
case 1:
|
|
1991
|
+
return descriptions[0];
|
|
1992
|
+
|
|
1993
|
+
case 2:
|
|
1994
|
+
return descriptions[0] + " or " + descriptions[1];
|
|
1995
|
+
|
|
1996
|
+
default:
|
|
1997
|
+
return descriptions.slice(0, -1).join(", ")
|
|
1998
|
+
+ ", or "
|
|
1999
|
+
+ descriptions[descriptions.length - 1];
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
function describeFound(found) {
|
|
2004
|
+
return found ? "\"" + literalEscape(found) + "\"" : "end of input";
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|
2008
|
+
};
|
|
2009
|
+
|
|
2010
|
+
function peg$parse(input, options) {
|
|
2011
|
+
options = options !== void 0 ? options : {};
|
|
2012
|
+
|
|
2013
|
+
var peg$FAILED = {},
|
|
2014
|
+
|
|
2015
|
+
peg$startRuleFunctions = { start: peg$parsestart },
|
|
2016
|
+
peg$startRuleFunction = peg$parsestart,
|
|
2017
|
+
|
|
2018
|
+
peg$c0 = function(elements) {
|
|
2019
|
+
return {
|
|
2020
|
+
type : 'messageFormatPattern',
|
|
2021
|
+
elements: elements,
|
|
2022
|
+
location: location()
|
|
2023
|
+
};
|
|
2024
|
+
},
|
|
2025
|
+
peg$c1 = function(chunks) {
|
|
2026
|
+
return chunks.reduce(function (all, chunk) {
|
|
2027
|
+
return all.concat(chunk)
|
|
2028
|
+
}, []).join('')
|
|
2029
|
+
},
|
|
2030
|
+
peg$c2 = function(messageText) {
|
|
2031
|
+
return {
|
|
2032
|
+
type : 'messageTextElement',
|
|
2033
|
+
value: messageText,
|
|
2034
|
+
location: location()
|
|
2035
|
+
};
|
|
2036
|
+
},
|
|
2037
|
+
peg$c3 = function(chars) { return chars.join(''); },
|
|
2038
|
+
peg$c4 = "{",
|
|
2039
|
+
peg$c5 = peg$literalExpectation("{", false),
|
|
2040
|
+
peg$c6 = ",",
|
|
2041
|
+
peg$c7 = peg$literalExpectation(",", false),
|
|
2042
|
+
peg$c8 = "}",
|
|
2043
|
+
peg$c9 = peg$literalExpectation("}", false),
|
|
2044
|
+
peg$c10 = function(id, format) {
|
|
2045
|
+
return {
|
|
2046
|
+
type : 'argumentElement',
|
|
2047
|
+
id : id,
|
|
2048
|
+
format: format && format[2],
|
|
2049
|
+
location: location()
|
|
2050
|
+
};
|
|
2051
|
+
},
|
|
2052
|
+
peg$c11 = "number",
|
|
2053
|
+
peg$c12 = peg$literalExpectation("number", false),
|
|
2054
|
+
peg$c13 = "date",
|
|
2055
|
+
peg$c14 = peg$literalExpectation("date", false),
|
|
2056
|
+
peg$c15 = "time",
|
|
2057
|
+
peg$c16 = peg$literalExpectation("time", false),
|
|
2058
|
+
peg$c17 = function(type, style) {
|
|
2059
|
+
return {
|
|
2060
|
+
type : type + 'Format',
|
|
2061
|
+
style: style && style[2],
|
|
2062
|
+
location: location()
|
|
2063
|
+
};
|
|
2064
|
+
},
|
|
2065
|
+
peg$c18 = "plural",
|
|
2066
|
+
peg$c19 = peg$literalExpectation("plural", false),
|
|
2067
|
+
peg$c20 = function(pluralStyle) {
|
|
2068
|
+
return {
|
|
2069
|
+
type : pluralStyle.type,
|
|
2070
|
+
ordinal: false,
|
|
2071
|
+
offset : pluralStyle.offset || 0,
|
|
2072
|
+
options: pluralStyle.options,
|
|
2073
|
+
location: location()
|
|
2074
|
+
};
|
|
2075
|
+
},
|
|
2076
|
+
peg$c21 = "selectordinal",
|
|
2077
|
+
peg$c22 = peg$literalExpectation("selectordinal", false),
|
|
2078
|
+
peg$c23 = function(pluralStyle) {
|
|
2079
|
+
return {
|
|
2080
|
+
type : pluralStyle.type,
|
|
2081
|
+
ordinal: true,
|
|
2082
|
+
offset : pluralStyle.offset || 0,
|
|
2083
|
+
options: pluralStyle.options,
|
|
2084
|
+
location: location()
|
|
2085
|
+
}
|
|
2086
|
+
},
|
|
2087
|
+
peg$c24 = "select",
|
|
2088
|
+
peg$c25 = peg$literalExpectation("select", false),
|
|
2089
|
+
peg$c26 = function(options) {
|
|
2090
|
+
return {
|
|
2091
|
+
type : 'selectFormat',
|
|
2092
|
+
options: options,
|
|
2093
|
+
location: location()
|
|
2094
|
+
};
|
|
2095
|
+
},
|
|
2096
|
+
peg$c27 = "=",
|
|
2097
|
+
peg$c28 = peg$literalExpectation("=", false),
|
|
2098
|
+
peg$c29 = function(selector, pattern) {
|
|
2099
|
+
return {
|
|
2100
|
+
type : 'optionalFormatPattern',
|
|
2101
|
+
selector: selector,
|
|
2102
|
+
value : pattern,
|
|
2103
|
+
location: location()
|
|
2104
|
+
};
|
|
2105
|
+
},
|
|
2106
|
+
peg$c30 = "offset:",
|
|
2107
|
+
peg$c31 = peg$literalExpectation("offset:", false),
|
|
2108
|
+
peg$c32 = function(number) {
|
|
2109
|
+
return number;
|
|
2110
|
+
},
|
|
2111
|
+
peg$c33 = function(offset, options) {
|
|
2112
|
+
return {
|
|
2113
|
+
type : 'pluralFormat',
|
|
2114
|
+
offset : offset,
|
|
2115
|
+
options: options,
|
|
2116
|
+
location: location()
|
|
2117
|
+
};
|
|
2118
|
+
},
|
|
2119
|
+
peg$c34 = peg$otherExpectation("whitespace"),
|
|
2120
|
+
peg$c35 = /^[ \t\n\r]/,
|
|
2121
|
+
peg$c36 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
|
|
2122
|
+
peg$c37 = peg$otherExpectation("optionalWhitespace"),
|
|
2123
|
+
peg$c38 = /^[0-9]/,
|
|
2124
|
+
peg$c39 = peg$classExpectation([["0", "9"]], false, false),
|
|
2125
|
+
peg$c40 = /^[0-9a-f]/i,
|
|
2126
|
+
peg$c41 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
|
|
2127
|
+
peg$c42 = "0",
|
|
2128
|
+
peg$c43 = peg$literalExpectation("0", false),
|
|
2129
|
+
peg$c44 = /^[1-9]/,
|
|
2130
|
+
peg$c45 = peg$classExpectation([["1", "9"]], false, false),
|
|
2131
|
+
peg$c46 = function(digits) {
|
|
2132
|
+
return parseInt(digits, 10);
|
|
2133
|
+
},
|
|
2134
|
+
peg$c47 = "'",
|
|
2135
|
+
peg$c48 = peg$literalExpectation("'", false),
|
|
2136
|
+
peg$c49 = /^[ \t\n\r,.+={}#]/,
|
|
2137
|
+
peg$c50 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], false, false),
|
|
2138
|
+
peg$c51 = peg$anyExpectation(),
|
|
2139
|
+
peg$c52 = function(char) { return char; },
|
|
2140
|
+
peg$c53 = function(sequence) { return sequence; },
|
|
2141
|
+
peg$c54 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
|
|
2142
|
+
peg$c55 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
|
|
2143
|
+
peg$c56 = "\\\\",
|
|
2144
|
+
peg$c57 = peg$literalExpectation("\\\\", false),
|
|
2145
|
+
peg$c58 = function() { return '\\'; },
|
|
2146
|
+
peg$c59 = "\\#",
|
|
2147
|
+
peg$c60 = peg$literalExpectation("\\#", false),
|
|
2148
|
+
peg$c61 = function() { return '\\#'; },
|
|
2149
|
+
peg$c62 = "\\{",
|
|
2150
|
+
peg$c63 = peg$literalExpectation("\\{", false),
|
|
2151
|
+
peg$c64 = function() { return '\u007B'; },
|
|
2152
|
+
peg$c65 = "\\}",
|
|
2153
|
+
peg$c66 = peg$literalExpectation("\\}", false),
|
|
2154
|
+
peg$c67 = function() { return '\u007D'; },
|
|
2155
|
+
peg$c68 = "\\u",
|
|
2156
|
+
peg$c69 = peg$literalExpectation("\\u", false),
|
|
2157
|
+
peg$c70 = function(digits) {
|
|
2158
|
+
return String.fromCharCode(parseInt(digits, 16));
|
|
2159
|
+
},
|
|
2160
|
+
|
|
2161
|
+
peg$currPos = 0,
|
|
2162
|
+
peg$savedPos = 0,
|
|
2163
|
+
peg$posDetailsCache = [{ line: 1, column: 1 }],
|
|
2164
|
+
peg$maxFailPos = 0,
|
|
2165
|
+
peg$maxFailExpected = [],
|
|
2166
|
+
peg$silentFails = 0,
|
|
2167
|
+
|
|
2168
|
+
peg$result;
|
|
2169
|
+
|
|
2170
|
+
if ("startRule" in options) {
|
|
2171
|
+
if (!(options.startRule in peg$startRuleFunctions)) {
|
|
2172
|
+
throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
function location() {
|
|
2179
|
+
return peg$computeLocation(peg$savedPos, peg$currPos);
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
function peg$literalExpectation(text, ignoreCase) {
|
|
2183
|
+
return { type: "literal", text: text, ignoreCase: ignoreCase };
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
function peg$classExpectation(parts, inverted, ignoreCase) {
|
|
2187
|
+
return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
function peg$anyExpectation() {
|
|
2191
|
+
return { type: "any" };
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
function peg$endExpectation() {
|
|
2195
|
+
return { type: "end" };
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
function peg$otherExpectation(description) {
|
|
2199
|
+
return { type: "other", description: description };
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
function peg$computePosDetails(pos) {
|
|
2203
|
+
var details = peg$posDetailsCache[pos], p;
|
|
2204
|
+
|
|
2205
|
+
if (details) {
|
|
2206
|
+
return details;
|
|
2207
|
+
} else {
|
|
2208
|
+
p = pos - 1;
|
|
2209
|
+
while (!peg$posDetailsCache[p]) {
|
|
2210
|
+
p--;
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
details = peg$posDetailsCache[p];
|
|
2214
|
+
details = {
|
|
2215
|
+
line: details.line,
|
|
2216
|
+
column: details.column
|
|
2217
|
+
};
|
|
2218
|
+
|
|
2219
|
+
while (p < pos) {
|
|
2220
|
+
if (input.charCodeAt(p) === 10) {
|
|
2221
|
+
details.line++;
|
|
2222
|
+
details.column = 1;
|
|
2223
|
+
} else {
|
|
2224
|
+
details.column++;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
p++;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
peg$posDetailsCache[pos] = details;
|
|
2231
|
+
return details;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
function peg$computeLocation(startPos, endPos) {
|
|
2236
|
+
var startPosDetails = peg$computePosDetails(startPos),
|
|
2237
|
+
endPosDetails = peg$computePosDetails(endPos);
|
|
2238
|
+
|
|
2239
|
+
return {
|
|
2240
|
+
start: {
|
|
2241
|
+
offset: startPos,
|
|
2242
|
+
line: startPosDetails.line,
|
|
2243
|
+
column: startPosDetails.column
|
|
2244
|
+
},
|
|
2245
|
+
end: {
|
|
2246
|
+
offset: endPos,
|
|
2247
|
+
line: endPosDetails.line,
|
|
2248
|
+
column: endPosDetails.column
|
|
2249
|
+
}
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
function peg$fail(expected) {
|
|
2254
|
+
if (peg$currPos < peg$maxFailPos) { return; }
|
|
2255
|
+
|
|
2256
|
+
if (peg$currPos > peg$maxFailPos) {
|
|
2257
|
+
peg$maxFailPos = peg$currPos;
|
|
2258
|
+
peg$maxFailExpected = [];
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
peg$maxFailExpected.push(expected);
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
function peg$buildStructuredError(expected, found, location) {
|
|
2265
|
+
return new peg$SyntaxError(
|
|
2266
|
+
peg$SyntaxError.buildMessage(expected, found),
|
|
2267
|
+
expected,
|
|
2268
|
+
found,
|
|
2269
|
+
location
|
|
2270
|
+
);
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
function peg$parsestart() {
|
|
2274
|
+
var s0;
|
|
2275
|
+
|
|
2276
|
+
s0 = peg$parsemessageFormatPattern();
|
|
2277
|
+
|
|
2278
|
+
return s0;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
function peg$parsemessageFormatPattern() {
|
|
2282
|
+
var s0, s1, s2;
|
|
2283
|
+
|
|
2284
|
+
s0 = peg$currPos;
|
|
2285
|
+
s1 = [];
|
|
2286
|
+
s2 = peg$parsemessageFormatElement();
|
|
2287
|
+
while (s2 !== peg$FAILED) {
|
|
2288
|
+
s1.push(s2);
|
|
2289
|
+
s2 = peg$parsemessageFormatElement();
|
|
2290
|
+
}
|
|
2291
|
+
if (s1 !== peg$FAILED) {
|
|
2292
|
+
peg$savedPos = s0;
|
|
2293
|
+
s1 = peg$c0(s1);
|
|
2294
|
+
}
|
|
2295
|
+
s0 = s1;
|
|
2296
|
+
|
|
2297
|
+
return s0;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
function peg$parsemessageFormatElement() {
|
|
2301
|
+
var s0;
|
|
2302
|
+
|
|
2303
|
+
s0 = peg$parsemessageTextElement();
|
|
2304
|
+
if (s0 === peg$FAILED) {
|
|
2305
|
+
s0 = peg$parseargumentElement();
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
return s0;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
function peg$parsemessageText() {
|
|
2312
|
+
var s0, s1, s2, s3, s4, s5;
|
|
2313
|
+
|
|
2314
|
+
s0 = peg$currPos;
|
|
2315
|
+
s1 = [];
|
|
2316
|
+
s2 = peg$currPos;
|
|
2317
|
+
s3 = peg$parse_();
|
|
2318
|
+
if (s3 !== peg$FAILED) {
|
|
2319
|
+
s4 = peg$parsechars();
|
|
2320
|
+
if (s4 !== peg$FAILED) {
|
|
2321
|
+
s5 = peg$parse_();
|
|
2322
|
+
if (s5 !== peg$FAILED) {
|
|
2323
|
+
s3 = [s3, s4, s5];
|
|
2324
|
+
s2 = s3;
|
|
2325
|
+
} else {
|
|
2326
|
+
peg$currPos = s2;
|
|
2327
|
+
s2 = peg$FAILED;
|
|
2328
|
+
}
|
|
2329
|
+
} else {
|
|
2330
|
+
peg$currPos = s2;
|
|
2331
|
+
s2 = peg$FAILED;
|
|
2332
|
+
}
|
|
2333
|
+
} else {
|
|
2334
|
+
peg$currPos = s2;
|
|
2335
|
+
s2 = peg$FAILED;
|
|
2336
|
+
}
|
|
2337
|
+
if (s2 !== peg$FAILED) {
|
|
2338
|
+
while (s2 !== peg$FAILED) {
|
|
2339
|
+
s1.push(s2);
|
|
2340
|
+
s2 = peg$currPos;
|
|
2341
|
+
s3 = peg$parse_();
|
|
2342
|
+
if (s3 !== peg$FAILED) {
|
|
2343
|
+
s4 = peg$parsechars();
|
|
2344
|
+
if (s4 !== peg$FAILED) {
|
|
2345
|
+
s5 = peg$parse_();
|
|
2346
|
+
if (s5 !== peg$FAILED) {
|
|
2347
|
+
s3 = [s3, s4, s5];
|
|
2348
|
+
s2 = s3;
|
|
2349
|
+
} else {
|
|
2350
|
+
peg$currPos = s2;
|
|
2351
|
+
s2 = peg$FAILED;
|
|
2352
|
+
}
|
|
2353
|
+
} else {
|
|
2354
|
+
peg$currPos = s2;
|
|
2355
|
+
s2 = peg$FAILED;
|
|
2356
|
+
}
|
|
2357
|
+
} else {
|
|
2358
|
+
peg$currPos = s2;
|
|
2359
|
+
s2 = peg$FAILED;
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
} else {
|
|
2363
|
+
s1 = peg$FAILED;
|
|
2364
|
+
}
|
|
2365
|
+
if (s1 !== peg$FAILED) {
|
|
2366
|
+
peg$savedPos = s0;
|
|
2367
|
+
s1 = peg$c1(s1);
|
|
2368
|
+
}
|
|
2369
|
+
s0 = s1;
|
|
2370
|
+
if (s0 === peg$FAILED) {
|
|
2371
|
+
s0 = peg$currPos;
|
|
2372
|
+
s1 = peg$parsews();
|
|
2373
|
+
if (s1 !== peg$FAILED) {
|
|
2374
|
+
s0 = input.substring(s0, peg$currPos);
|
|
2375
|
+
} else {
|
|
2376
|
+
s0 = s1;
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
return s0;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
function peg$parsemessageTextElement() {
|
|
2384
|
+
var s0, s1;
|
|
2385
|
+
|
|
2386
|
+
s0 = peg$currPos;
|
|
2387
|
+
s1 = peg$parsemessageText();
|
|
2388
|
+
if (s1 !== peg$FAILED) {
|
|
2389
|
+
peg$savedPos = s0;
|
|
2390
|
+
s1 = peg$c2(s1);
|
|
2391
|
+
}
|
|
2392
|
+
s0 = s1;
|
|
2393
|
+
|
|
2394
|
+
return s0;
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
function peg$parseargument() {
|
|
2398
|
+
var s0, s1, s2;
|
|
2399
|
+
|
|
2400
|
+
s0 = peg$parsenumber();
|
|
2401
|
+
if (s0 === peg$FAILED) {
|
|
2402
|
+
s0 = peg$currPos;
|
|
2403
|
+
s1 = [];
|
|
2404
|
+
s2 = peg$parsequoteEscapedChar();
|
|
2405
|
+
while (s2 !== peg$FAILED) {
|
|
2406
|
+
s1.push(s2);
|
|
2407
|
+
s2 = peg$parsequoteEscapedChar();
|
|
2408
|
+
}
|
|
2409
|
+
if (s1 !== peg$FAILED) {
|
|
2410
|
+
peg$savedPos = s0;
|
|
2411
|
+
s1 = peg$c3(s1);
|
|
2412
|
+
}
|
|
2413
|
+
s0 = s1;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
return s0;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
function peg$parseargumentElement() {
|
|
2420
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
|
2421
|
+
|
|
2422
|
+
s0 = peg$currPos;
|
|
2423
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2424
|
+
s1 = peg$c4;
|
|
2425
|
+
peg$currPos++;
|
|
2426
|
+
} else {
|
|
2427
|
+
s1 = peg$FAILED;
|
|
2428
|
+
if (peg$silentFails === 0) { peg$fail(peg$c5); }
|
|
2429
|
+
}
|
|
2430
|
+
if (s1 !== peg$FAILED) {
|
|
2431
|
+
s2 = peg$parse_();
|
|
2432
|
+
if (s2 !== peg$FAILED) {
|
|
2433
|
+
s3 = peg$parseargument();
|
|
2434
|
+
if (s3 !== peg$FAILED) {
|
|
2435
|
+
s4 = peg$parse_();
|
|
2436
|
+
if (s4 !== peg$FAILED) {
|
|
2437
|
+
s5 = peg$currPos;
|
|
2438
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2439
|
+
s6 = peg$c6;
|
|
2440
|
+
peg$currPos++;
|
|
2441
|
+
} else {
|
|
2442
|
+
s6 = peg$FAILED;
|
|
2443
|
+
if (peg$silentFails === 0) { peg$fail(peg$c7); }
|
|
2444
|
+
}
|
|
2445
|
+
if (s6 !== peg$FAILED) {
|
|
2446
|
+
s7 = peg$parse_();
|
|
2447
|
+
if (s7 !== peg$FAILED) {
|
|
2448
|
+
s8 = peg$parseelementFormat();
|
|
2449
|
+
if (s8 !== peg$FAILED) {
|
|
2450
|
+
s6 = [s6, s7, s8];
|
|
2451
|
+
s5 = s6;
|
|
2452
|
+
} else {
|
|
2453
|
+
peg$currPos = s5;
|
|
2454
|
+
s5 = peg$FAILED;
|
|
2455
|
+
}
|
|
2456
|
+
} else {
|
|
2457
|
+
peg$currPos = s5;
|
|
2458
|
+
s5 = peg$FAILED;
|
|
2459
|
+
}
|
|
2460
|
+
} else {
|
|
2461
|
+
peg$currPos = s5;
|
|
2462
|
+
s5 = peg$FAILED;
|
|
2463
|
+
}
|
|
2464
|
+
if (s5 === peg$FAILED) {
|
|
2465
|
+
s5 = null;
|
|
2466
|
+
}
|
|
2467
|
+
if (s5 !== peg$FAILED) {
|
|
2468
|
+
s6 = peg$parse_();
|
|
2469
|
+
if (s6 !== peg$FAILED) {
|
|
2470
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2471
|
+
s7 = peg$c8;
|
|
2472
|
+
peg$currPos++;
|
|
2473
|
+
} else {
|
|
2474
|
+
s7 = peg$FAILED;
|
|
2475
|
+
if (peg$silentFails === 0) { peg$fail(peg$c9); }
|
|
2476
|
+
}
|
|
2477
|
+
if (s7 !== peg$FAILED) {
|
|
2478
|
+
peg$savedPos = s0;
|
|
2479
|
+
s1 = peg$c10(s3, s5);
|
|
2480
|
+
s0 = s1;
|
|
2481
|
+
} else {
|
|
2482
|
+
peg$currPos = s0;
|
|
2483
|
+
s0 = peg$FAILED;
|
|
2484
|
+
}
|
|
2485
|
+
} else {
|
|
2486
|
+
peg$currPos = s0;
|
|
2487
|
+
s0 = peg$FAILED;
|
|
2488
|
+
}
|
|
2489
|
+
} else {
|
|
2490
|
+
peg$currPos = s0;
|
|
2491
|
+
s0 = peg$FAILED;
|
|
2492
|
+
}
|
|
2493
|
+
} else {
|
|
2494
|
+
peg$currPos = s0;
|
|
2495
|
+
s0 = peg$FAILED;
|
|
2496
|
+
}
|
|
2497
|
+
} else {
|
|
2498
|
+
peg$currPos = s0;
|
|
2499
|
+
s0 = peg$FAILED;
|
|
2500
|
+
}
|
|
2501
|
+
} else {
|
|
2502
|
+
peg$currPos = s0;
|
|
2503
|
+
s0 = peg$FAILED;
|
|
2504
|
+
}
|
|
2505
|
+
} else {
|
|
2506
|
+
peg$currPos = s0;
|
|
2507
|
+
s0 = peg$FAILED;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
return s0;
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
function peg$parseelementFormat() {
|
|
2514
|
+
var s0;
|
|
2515
|
+
|
|
2516
|
+
s0 = peg$parsesimpleFormat();
|
|
2517
|
+
if (s0 === peg$FAILED) {
|
|
2518
|
+
s0 = peg$parsepluralFormat();
|
|
2519
|
+
if (s0 === peg$FAILED) {
|
|
2520
|
+
s0 = peg$parseselectOrdinalFormat();
|
|
2521
|
+
if (s0 === peg$FAILED) {
|
|
2522
|
+
s0 = peg$parseselectFormat();
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
return s0;
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
function peg$parsesimpleFormat() {
|
|
2531
|
+
var s0, s1, s2, s3, s4, s5, s6;
|
|
2532
|
+
|
|
2533
|
+
s0 = peg$currPos;
|
|
2534
|
+
if (input.substr(peg$currPos, 6) === peg$c11) {
|
|
2535
|
+
s1 = peg$c11;
|
|
2536
|
+
peg$currPos += 6;
|
|
2537
|
+
} else {
|
|
2538
|
+
s1 = peg$FAILED;
|
|
2539
|
+
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
|
2540
|
+
}
|
|
2541
|
+
if (s1 === peg$FAILED) {
|
|
2542
|
+
if (input.substr(peg$currPos, 4) === peg$c13) {
|
|
2543
|
+
s1 = peg$c13;
|
|
2544
|
+
peg$currPos += 4;
|
|
2545
|
+
} else {
|
|
2546
|
+
s1 = peg$FAILED;
|
|
2547
|
+
if (peg$silentFails === 0) { peg$fail(peg$c14); }
|
|
2548
|
+
}
|
|
2549
|
+
if (s1 === peg$FAILED) {
|
|
2550
|
+
if (input.substr(peg$currPos, 4) === peg$c15) {
|
|
2551
|
+
s1 = peg$c15;
|
|
2552
|
+
peg$currPos += 4;
|
|
2553
|
+
} else {
|
|
2554
|
+
s1 = peg$FAILED;
|
|
2555
|
+
if (peg$silentFails === 0) { peg$fail(peg$c16); }
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
if (s1 !== peg$FAILED) {
|
|
2560
|
+
s2 = peg$parse_();
|
|
2561
|
+
if (s2 !== peg$FAILED) {
|
|
2562
|
+
s3 = peg$currPos;
|
|
2563
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2564
|
+
s4 = peg$c6;
|
|
2565
|
+
peg$currPos++;
|
|
2566
|
+
} else {
|
|
2567
|
+
s4 = peg$FAILED;
|
|
2568
|
+
if (peg$silentFails === 0) { peg$fail(peg$c7); }
|
|
2569
|
+
}
|
|
2570
|
+
if (s4 !== peg$FAILED) {
|
|
2571
|
+
s5 = peg$parse_();
|
|
2572
|
+
if (s5 !== peg$FAILED) {
|
|
2573
|
+
s6 = peg$parsechars();
|
|
2574
|
+
if (s6 !== peg$FAILED) {
|
|
2575
|
+
s4 = [s4, s5, s6];
|
|
2576
|
+
s3 = s4;
|
|
2577
|
+
} else {
|
|
2578
|
+
peg$currPos = s3;
|
|
2579
|
+
s3 = peg$FAILED;
|
|
2580
|
+
}
|
|
2581
|
+
} else {
|
|
2582
|
+
peg$currPos = s3;
|
|
2583
|
+
s3 = peg$FAILED;
|
|
2584
|
+
}
|
|
2585
|
+
} else {
|
|
2586
|
+
peg$currPos = s3;
|
|
2587
|
+
s3 = peg$FAILED;
|
|
2588
|
+
}
|
|
2589
|
+
if (s3 === peg$FAILED) {
|
|
2590
|
+
s3 = null;
|
|
2591
|
+
}
|
|
2592
|
+
if (s3 !== peg$FAILED) {
|
|
2593
|
+
peg$savedPos = s0;
|
|
2594
|
+
s1 = peg$c17(s1, s3);
|
|
2595
|
+
s0 = s1;
|
|
2596
|
+
} else {
|
|
2597
|
+
peg$currPos = s0;
|
|
2598
|
+
s0 = peg$FAILED;
|
|
2599
|
+
}
|
|
2600
|
+
} else {
|
|
2601
|
+
peg$currPos = s0;
|
|
2602
|
+
s0 = peg$FAILED;
|
|
2603
|
+
}
|
|
2604
|
+
} else {
|
|
2605
|
+
peg$currPos = s0;
|
|
2606
|
+
s0 = peg$FAILED;
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
return s0;
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
function peg$parsepluralFormat() {
|
|
2613
|
+
var s0, s1, s2, s3, s4, s5;
|
|
2614
|
+
|
|
2615
|
+
s0 = peg$currPos;
|
|
2616
|
+
if (input.substr(peg$currPos, 6) === peg$c18) {
|
|
2617
|
+
s1 = peg$c18;
|
|
2618
|
+
peg$currPos += 6;
|
|
2619
|
+
} else {
|
|
2620
|
+
s1 = peg$FAILED;
|
|
2621
|
+
if (peg$silentFails === 0) { peg$fail(peg$c19); }
|
|
2622
|
+
}
|
|
2623
|
+
if (s1 !== peg$FAILED) {
|
|
2624
|
+
s2 = peg$parse_();
|
|
2625
|
+
if (s2 !== peg$FAILED) {
|
|
2626
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2627
|
+
s3 = peg$c6;
|
|
2628
|
+
peg$currPos++;
|
|
2629
|
+
} else {
|
|
2630
|
+
s3 = peg$FAILED;
|
|
2631
|
+
if (peg$silentFails === 0) { peg$fail(peg$c7); }
|
|
2632
|
+
}
|
|
2633
|
+
if (s3 !== peg$FAILED) {
|
|
2634
|
+
s4 = peg$parse_();
|
|
2635
|
+
if (s4 !== peg$FAILED) {
|
|
2636
|
+
s5 = peg$parsepluralStyle();
|
|
2637
|
+
if (s5 !== peg$FAILED) {
|
|
2638
|
+
peg$savedPos = s0;
|
|
2639
|
+
s1 = peg$c20(s5);
|
|
2640
|
+
s0 = s1;
|
|
2641
|
+
} else {
|
|
2642
|
+
peg$currPos = s0;
|
|
2643
|
+
s0 = peg$FAILED;
|
|
2644
|
+
}
|
|
2645
|
+
} else {
|
|
2646
|
+
peg$currPos = s0;
|
|
2647
|
+
s0 = peg$FAILED;
|
|
2648
|
+
}
|
|
2649
|
+
} else {
|
|
2650
|
+
peg$currPos = s0;
|
|
2651
|
+
s0 = peg$FAILED;
|
|
2652
|
+
}
|
|
2653
|
+
} else {
|
|
2654
|
+
peg$currPos = s0;
|
|
2655
|
+
s0 = peg$FAILED;
|
|
2656
|
+
}
|
|
2657
|
+
} else {
|
|
2658
|
+
peg$currPos = s0;
|
|
2659
|
+
s0 = peg$FAILED;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
return s0;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
function peg$parseselectOrdinalFormat() {
|
|
2666
|
+
var s0, s1, s2, s3, s4, s5;
|
|
2667
|
+
|
|
2668
|
+
s0 = peg$currPos;
|
|
2669
|
+
if (input.substr(peg$currPos, 13) === peg$c21) {
|
|
2670
|
+
s1 = peg$c21;
|
|
2671
|
+
peg$currPos += 13;
|
|
2672
|
+
} else {
|
|
2673
|
+
s1 = peg$FAILED;
|
|
2674
|
+
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
|
2675
|
+
}
|
|
2676
|
+
if (s1 !== peg$FAILED) {
|
|
2677
|
+
s2 = peg$parse_();
|
|
2678
|
+
if (s2 !== peg$FAILED) {
|
|
2679
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2680
|
+
s3 = peg$c6;
|
|
2681
|
+
peg$currPos++;
|
|
2682
|
+
} else {
|
|
2683
|
+
s3 = peg$FAILED;
|
|
2684
|
+
if (peg$silentFails === 0) { peg$fail(peg$c7); }
|
|
2685
|
+
}
|
|
2686
|
+
if (s3 !== peg$FAILED) {
|
|
2687
|
+
s4 = peg$parse_();
|
|
2688
|
+
if (s4 !== peg$FAILED) {
|
|
2689
|
+
s5 = peg$parsepluralStyle();
|
|
2690
|
+
if (s5 !== peg$FAILED) {
|
|
2691
|
+
peg$savedPos = s0;
|
|
2692
|
+
s1 = peg$c23(s5);
|
|
2693
|
+
s0 = s1;
|
|
2694
|
+
} else {
|
|
2695
|
+
peg$currPos = s0;
|
|
2696
|
+
s0 = peg$FAILED;
|
|
2697
|
+
}
|
|
2698
|
+
} else {
|
|
2699
|
+
peg$currPos = s0;
|
|
2700
|
+
s0 = peg$FAILED;
|
|
2701
|
+
}
|
|
2702
|
+
} else {
|
|
2703
|
+
peg$currPos = s0;
|
|
2704
|
+
s0 = peg$FAILED;
|
|
2705
|
+
}
|
|
2706
|
+
} else {
|
|
2707
|
+
peg$currPos = s0;
|
|
2708
|
+
s0 = peg$FAILED;
|
|
2709
|
+
}
|
|
2710
|
+
} else {
|
|
2711
|
+
peg$currPos = s0;
|
|
2712
|
+
s0 = peg$FAILED;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
return s0;
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
function peg$parseselectFormat() {
|
|
2719
|
+
var s0, s1, s2, s3, s4, s5, s6;
|
|
2720
|
+
|
|
2721
|
+
s0 = peg$currPos;
|
|
2722
|
+
if (input.substr(peg$currPos, 6) === peg$c24) {
|
|
2723
|
+
s1 = peg$c24;
|
|
2724
|
+
peg$currPos += 6;
|
|
2725
|
+
} else {
|
|
2726
|
+
s1 = peg$FAILED;
|
|
2727
|
+
if (peg$silentFails === 0) { peg$fail(peg$c25); }
|
|
2728
|
+
}
|
|
2729
|
+
if (s1 !== peg$FAILED) {
|
|
2730
|
+
s2 = peg$parse_();
|
|
2731
|
+
if (s2 !== peg$FAILED) {
|
|
2732
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2733
|
+
s3 = peg$c6;
|
|
2734
|
+
peg$currPos++;
|
|
2735
|
+
} else {
|
|
2736
|
+
s3 = peg$FAILED;
|
|
2737
|
+
if (peg$silentFails === 0) { peg$fail(peg$c7); }
|
|
2738
|
+
}
|
|
2739
|
+
if (s3 !== peg$FAILED) {
|
|
2740
|
+
s4 = peg$parse_();
|
|
2741
|
+
if (s4 !== peg$FAILED) {
|
|
2742
|
+
s5 = [];
|
|
2743
|
+
s6 = peg$parseoptionalFormatPattern();
|
|
2744
|
+
if (s6 !== peg$FAILED) {
|
|
2745
|
+
while (s6 !== peg$FAILED) {
|
|
2746
|
+
s5.push(s6);
|
|
2747
|
+
s6 = peg$parseoptionalFormatPattern();
|
|
2748
|
+
}
|
|
2749
|
+
} else {
|
|
2750
|
+
s5 = peg$FAILED;
|
|
2751
|
+
}
|
|
2752
|
+
if (s5 !== peg$FAILED) {
|
|
2753
|
+
peg$savedPos = s0;
|
|
2754
|
+
s1 = peg$c26(s5);
|
|
2755
|
+
s0 = s1;
|
|
2756
|
+
} else {
|
|
2757
|
+
peg$currPos = s0;
|
|
2758
|
+
s0 = peg$FAILED;
|
|
2759
|
+
}
|
|
2760
|
+
} else {
|
|
2761
|
+
peg$currPos = s0;
|
|
2762
|
+
s0 = peg$FAILED;
|
|
2763
|
+
}
|
|
2764
|
+
} else {
|
|
2765
|
+
peg$currPos = s0;
|
|
2766
|
+
s0 = peg$FAILED;
|
|
2767
|
+
}
|
|
2768
|
+
} else {
|
|
2769
|
+
peg$currPos = s0;
|
|
2770
|
+
s0 = peg$FAILED;
|
|
2771
|
+
}
|
|
2772
|
+
} else {
|
|
2773
|
+
peg$currPos = s0;
|
|
2774
|
+
s0 = peg$FAILED;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
return s0;
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
function peg$parseselector() {
|
|
2781
|
+
var s0, s1, s2, s3;
|
|
2782
|
+
|
|
2783
|
+
s0 = peg$currPos;
|
|
2784
|
+
s1 = peg$currPos;
|
|
2785
|
+
if (input.charCodeAt(peg$currPos) === 61) {
|
|
2786
|
+
s2 = peg$c27;
|
|
2787
|
+
peg$currPos++;
|
|
2788
|
+
} else {
|
|
2789
|
+
s2 = peg$FAILED;
|
|
2790
|
+
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
|
2791
|
+
}
|
|
2792
|
+
if (s2 !== peg$FAILED) {
|
|
2793
|
+
s3 = peg$parsenumber();
|
|
2794
|
+
if (s3 !== peg$FAILED) {
|
|
2795
|
+
s2 = [s2, s3];
|
|
2796
|
+
s1 = s2;
|
|
2797
|
+
} else {
|
|
2798
|
+
peg$currPos = s1;
|
|
2799
|
+
s1 = peg$FAILED;
|
|
2800
|
+
}
|
|
2801
|
+
} else {
|
|
2802
|
+
peg$currPos = s1;
|
|
2803
|
+
s1 = peg$FAILED;
|
|
2804
|
+
}
|
|
2805
|
+
if (s1 !== peg$FAILED) {
|
|
2806
|
+
s0 = input.substring(s0, peg$currPos);
|
|
2807
|
+
} else {
|
|
2808
|
+
s0 = s1;
|
|
2809
|
+
}
|
|
2810
|
+
if (s0 === peg$FAILED) {
|
|
2811
|
+
s0 = peg$parsechars();
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
return s0;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
function peg$parseoptionalFormatPattern() {
|
|
2818
|
+
var s0, s1, s2, s3, s4, s5, s6;
|
|
2819
|
+
|
|
2820
|
+
s0 = peg$currPos;
|
|
2821
|
+
s1 = peg$parse_();
|
|
2822
|
+
if (s1 !== peg$FAILED) {
|
|
2823
|
+
s2 = peg$parseselector();
|
|
2824
|
+
if (s2 !== peg$FAILED) {
|
|
2825
|
+
s3 = peg$parse_();
|
|
2826
|
+
if (s3 !== peg$FAILED) {
|
|
2827
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2828
|
+
s4 = peg$c4;
|
|
2829
|
+
peg$currPos++;
|
|
2830
|
+
} else {
|
|
2831
|
+
s4 = peg$FAILED;
|
|
2832
|
+
if (peg$silentFails === 0) { peg$fail(peg$c5); }
|
|
2833
|
+
}
|
|
2834
|
+
if (s4 !== peg$FAILED) {
|
|
2835
|
+
s5 = peg$parsemessageFormatPattern();
|
|
2836
|
+
if (s5 !== peg$FAILED) {
|
|
2837
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2838
|
+
s6 = peg$c8;
|
|
2839
|
+
peg$currPos++;
|
|
2840
|
+
} else {
|
|
2841
|
+
s6 = peg$FAILED;
|
|
2842
|
+
if (peg$silentFails === 0) { peg$fail(peg$c9); }
|
|
2843
|
+
}
|
|
2844
|
+
if (s6 !== peg$FAILED) {
|
|
2845
|
+
peg$savedPos = s0;
|
|
2846
|
+
s1 = peg$c29(s2, s5);
|
|
2847
|
+
s0 = s1;
|
|
2848
|
+
} else {
|
|
2849
|
+
peg$currPos = s0;
|
|
2850
|
+
s0 = peg$FAILED;
|
|
2851
|
+
}
|
|
2852
|
+
} else {
|
|
2853
|
+
peg$currPos = s0;
|
|
2854
|
+
s0 = peg$FAILED;
|
|
2855
|
+
}
|
|
2856
|
+
} else {
|
|
2857
|
+
peg$currPos = s0;
|
|
2858
|
+
s0 = peg$FAILED;
|
|
2859
|
+
}
|
|
2860
|
+
} else {
|
|
2861
|
+
peg$currPos = s0;
|
|
2862
|
+
s0 = peg$FAILED;
|
|
2863
|
+
}
|
|
2864
|
+
} else {
|
|
2865
|
+
peg$currPos = s0;
|
|
2866
|
+
s0 = peg$FAILED;
|
|
2867
|
+
}
|
|
2868
|
+
} else {
|
|
2869
|
+
peg$currPos = s0;
|
|
2870
|
+
s0 = peg$FAILED;
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
return s0;
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
function peg$parseoffset() {
|
|
2877
|
+
var s0, s1, s2, s3;
|
|
2878
|
+
|
|
2879
|
+
s0 = peg$currPos;
|
|
2880
|
+
if (input.substr(peg$currPos, 7) === peg$c30) {
|
|
2881
|
+
s1 = peg$c30;
|
|
2882
|
+
peg$currPos += 7;
|
|
2883
|
+
} else {
|
|
2884
|
+
s1 = peg$FAILED;
|
|
2885
|
+
if (peg$silentFails === 0) { peg$fail(peg$c31); }
|
|
2886
|
+
}
|
|
2887
|
+
if (s1 !== peg$FAILED) {
|
|
2888
|
+
s2 = peg$parse_();
|
|
2889
|
+
if (s2 !== peg$FAILED) {
|
|
2890
|
+
s3 = peg$parsenumber();
|
|
2891
|
+
if (s3 !== peg$FAILED) {
|
|
2892
|
+
peg$savedPos = s0;
|
|
2893
|
+
s1 = peg$c32(s3);
|
|
2894
|
+
s0 = s1;
|
|
2895
|
+
} else {
|
|
2896
|
+
peg$currPos = s0;
|
|
2897
|
+
s0 = peg$FAILED;
|
|
2898
|
+
}
|
|
2899
|
+
} else {
|
|
2900
|
+
peg$currPos = s0;
|
|
2901
|
+
s0 = peg$FAILED;
|
|
2902
|
+
}
|
|
2903
|
+
} else {
|
|
2904
|
+
peg$currPos = s0;
|
|
2905
|
+
s0 = peg$FAILED;
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
return s0;
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
function peg$parsepluralStyle() {
|
|
2912
|
+
var s0, s1, s2, s3, s4;
|
|
2913
|
+
|
|
2914
|
+
s0 = peg$currPos;
|
|
2915
|
+
s1 = peg$parseoffset();
|
|
2916
|
+
if (s1 === peg$FAILED) {
|
|
2917
|
+
s1 = null;
|
|
2918
|
+
}
|
|
2919
|
+
if (s1 !== peg$FAILED) {
|
|
2920
|
+
s2 = peg$parse_();
|
|
2921
|
+
if (s2 !== peg$FAILED) {
|
|
2922
|
+
s3 = [];
|
|
2923
|
+
s4 = peg$parseoptionalFormatPattern();
|
|
2924
|
+
if (s4 !== peg$FAILED) {
|
|
2925
|
+
while (s4 !== peg$FAILED) {
|
|
2926
|
+
s3.push(s4);
|
|
2927
|
+
s4 = peg$parseoptionalFormatPattern();
|
|
2928
|
+
}
|
|
2929
|
+
} else {
|
|
2930
|
+
s3 = peg$FAILED;
|
|
2931
|
+
}
|
|
2932
|
+
if (s3 !== peg$FAILED) {
|
|
2933
|
+
peg$savedPos = s0;
|
|
2934
|
+
s1 = peg$c33(s1, s3);
|
|
2935
|
+
s0 = s1;
|
|
2936
|
+
} else {
|
|
2937
|
+
peg$currPos = s0;
|
|
2938
|
+
s0 = peg$FAILED;
|
|
2939
|
+
}
|
|
2940
|
+
} else {
|
|
2941
|
+
peg$currPos = s0;
|
|
2942
|
+
s0 = peg$FAILED;
|
|
2943
|
+
}
|
|
2944
|
+
} else {
|
|
2945
|
+
peg$currPos = s0;
|
|
2946
|
+
s0 = peg$FAILED;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
return s0;
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
function peg$parsews() {
|
|
2953
|
+
var s0, s1;
|
|
2954
|
+
|
|
2955
|
+
peg$silentFails++;
|
|
2956
|
+
s0 = [];
|
|
2957
|
+
if (peg$c35.test(input.charAt(peg$currPos))) {
|
|
2958
|
+
s1 = input.charAt(peg$currPos);
|
|
2959
|
+
peg$currPos++;
|
|
2960
|
+
} else {
|
|
2961
|
+
s1 = peg$FAILED;
|
|
2962
|
+
if (peg$silentFails === 0) { peg$fail(peg$c36); }
|
|
2963
|
+
}
|
|
2964
|
+
if (s1 !== peg$FAILED) {
|
|
2965
|
+
while (s1 !== peg$FAILED) {
|
|
2966
|
+
s0.push(s1);
|
|
2967
|
+
if (peg$c35.test(input.charAt(peg$currPos))) {
|
|
2968
|
+
s1 = input.charAt(peg$currPos);
|
|
2969
|
+
peg$currPos++;
|
|
2970
|
+
} else {
|
|
2971
|
+
s1 = peg$FAILED;
|
|
2972
|
+
if (peg$silentFails === 0) { peg$fail(peg$c36); }
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
} else {
|
|
2976
|
+
s0 = peg$FAILED;
|
|
2977
|
+
}
|
|
2978
|
+
peg$silentFails--;
|
|
2979
|
+
if (s0 === peg$FAILED) {
|
|
2980
|
+
s1 = peg$FAILED;
|
|
2981
|
+
if (peg$silentFails === 0) { peg$fail(peg$c34); }
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
return s0;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
function peg$parse_() {
|
|
2988
|
+
var s0, s1, s2;
|
|
2989
|
+
|
|
2990
|
+
peg$silentFails++;
|
|
2991
|
+
s0 = peg$currPos;
|
|
2992
|
+
s1 = [];
|
|
2993
|
+
s2 = peg$parsews();
|
|
2994
|
+
while (s2 !== peg$FAILED) {
|
|
2995
|
+
s1.push(s2);
|
|
2996
|
+
s2 = peg$parsews();
|
|
2997
|
+
}
|
|
2998
|
+
if (s1 !== peg$FAILED) {
|
|
2999
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3000
|
+
} else {
|
|
3001
|
+
s0 = s1;
|
|
3002
|
+
}
|
|
3003
|
+
peg$silentFails--;
|
|
3004
|
+
if (s0 === peg$FAILED) {
|
|
3005
|
+
s1 = peg$FAILED;
|
|
3006
|
+
if (peg$silentFails === 0) { peg$fail(peg$c37); }
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
return s0;
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
function peg$parsedigit() {
|
|
3013
|
+
var s0;
|
|
3014
|
+
|
|
3015
|
+
if (peg$c38.test(input.charAt(peg$currPos))) {
|
|
3016
|
+
s0 = input.charAt(peg$currPos);
|
|
3017
|
+
peg$currPos++;
|
|
3018
|
+
} else {
|
|
3019
|
+
s0 = peg$FAILED;
|
|
3020
|
+
if (peg$silentFails === 0) { peg$fail(peg$c39); }
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
return s0;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
function peg$parsehexDigit() {
|
|
3027
|
+
var s0;
|
|
3028
|
+
|
|
3029
|
+
if (peg$c40.test(input.charAt(peg$currPos))) {
|
|
3030
|
+
s0 = input.charAt(peg$currPos);
|
|
3031
|
+
peg$currPos++;
|
|
3032
|
+
} else {
|
|
3033
|
+
s0 = peg$FAILED;
|
|
3034
|
+
if (peg$silentFails === 0) { peg$fail(peg$c41); }
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
return s0;
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
function peg$parsenumber() {
|
|
3041
|
+
var s0, s1, s2, s3, s4, s5;
|
|
3042
|
+
|
|
3043
|
+
s0 = peg$currPos;
|
|
3044
|
+
if (input.charCodeAt(peg$currPos) === 48) {
|
|
3045
|
+
s1 = peg$c42;
|
|
3046
|
+
peg$currPos++;
|
|
3047
|
+
} else {
|
|
3048
|
+
s1 = peg$FAILED;
|
|
3049
|
+
if (peg$silentFails === 0) { peg$fail(peg$c43); }
|
|
3050
|
+
}
|
|
3051
|
+
if (s1 === peg$FAILED) {
|
|
3052
|
+
s1 = peg$currPos;
|
|
3053
|
+
s2 = peg$currPos;
|
|
3054
|
+
if (peg$c44.test(input.charAt(peg$currPos))) {
|
|
3055
|
+
s3 = input.charAt(peg$currPos);
|
|
3056
|
+
peg$currPos++;
|
|
3057
|
+
} else {
|
|
3058
|
+
s3 = peg$FAILED;
|
|
3059
|
+
if (peg$silentFails === 0) { peg$fail(peg$c45); }
|
|
3060
|
+
}
|
|
3061
|
+
if (s3 !== peg$FAILED) {
|
|
3062
|
+
s4 = [];
|
|
3063
|
+
s5 = peg$parsedigit();
|
|
3064
|
+
while (s5 !== peg$FAILED) {
|
|
3065
|
+
s4.push(s5);
|
|
3066
|
+
s5 = peg$parsedigit();
|
|
3067
|
+
}
|
|
3068
|
+
if (s4 !== peg$FAILED) {
|
|
3069
|
+
s3 = [s3, s4];
|
|
3070
|
+
s2 = s3;
|
|
3071
|
+
} else {
|
|
3072
|
+
peg$currPos = s2;
|
|
3073
|
+
s2 = peg$FAILED;
|
|
3074
|
+
}
|
|
3075
|
+
} else {
|
|
3076
|
+
peg$currPos = s2;
|
|
3077
|
+
s2 = peg$FAILED;
|
|
3078
|
+
}
|
|
3079
|
+
if (s2 !== peg$FAILED) {
|
|
3080
|
+
s1 = input.substring(s1, peg$currPos);
|
|
3081
|
+
} else {
|
|
3082
|
+
s1 = s2;
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
if (s1 !== peg$FAILED) {
|
|
3086
|
+
peg$savedPos = s0;
|
|
3087
|
+
s1 = peg$c46(s1);
|
|
3088
|
+
}
|
|
3089
|
+
s0 = s1;
|
|
3090
|
+
|
|
3091
|
+
return s0;
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
function peg$parsequoteEscapedChar() {
|
|
3095
|
+
var s0, s1, s2;
|
|
3096
|
+
|
|
3097
|
+
s0 = peg$currPos;
|
|
3098
|
+
s1 = peg$currPos;
|
|
3099
|
+
peg$silentFails++;
|
|
3100
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
3101
|
+
s2 = peg$c47;
|
|
3102
|
+
peg$currPos++;
|
|
3103
|
+
} else {
|
|
3104
|
+
s2 = peg$FAILED;
|
|
3105
|
+
if (peg$silentFails === 0) { peg$fail(peg$c48); }
|
|
3106
|
+
}
|
|
3107
|
+
if (s2 === peg$FAILED) {
|
|
3108
|
+
if (peg$c49.test(input.charAt(peg$currPos))) {
|
|
3109
|
+
s2 = input.charAt(peg$currPos);
|
|
3110
|
+
peg$currPos++;
|
|
3111
|
+
} else {
|
|
3112
|
+
s2 = peg$FAILED;
|
|
3113
|
+
if (peg$silentFails === 0) { peg$fail(peg$c50); }
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
peg$silentFails--;
|
|
3117
|
+
if (s2 === peg$FAILED) {
|
|
3118
|
+
s1 = void 0;
|
|
3119
|
+
} else {
|
|
3120
|
+
peg$currPos = s1;
|
|
3121
|
+
s1 = peg$FAILED;
|
|
3122
|
+
}
|
|
3123
|
+
if (s1 !== peg$FAILED) {
|
|
3124
|
+
if (input.length > peg$currPos) {
|
|
3125
|
+
s2 = input.charAt(peg$currPos);
|
|
3126
|
+
peg$currPos++;
|
|
3127
|
+
} else {
|
|
3128
|
+
s2 = peg$FAILED;
|
|
3129
|
+
if (peg$silentFails === 0) { peg$fail(peg$c51); }
|
|
3130
|
+
}
|
|
3131
|
+
if (s2 !== peg$FAILED) {
|
|
3132
|
+
peg$savedPos = s0;
|
|
3133
|
+
s1 = peg$c52(s2);
|
|
3134
|
+
s0 = s1;
|
|
3135
|
+
} else {
|
|
3136
|
+
peg$currPos = s0;
|
|
3137
|
+
s0 = peg$FAILED;
|
|
3138
|
+
}
|
|
3139
|
+
} else {
|
|
3140
|
+
peg$currPos = s0;
|
|
3141
|
+
s0 = peg$FAILED;
|
|
3142
|
+
}
|
|
3143
|
+
if (s0 === peg$FAILED) {
|
|
3144
|
+
s0 = peg$currPos;
|
|
3145
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
3146
|
+
s1 = peg$c47;
|
|
3147
|
+
peg$currPos++;
|
|
3148
|
+
} else {
|
|
3149
|
+
s1 = peg$FAILED;
|
|
3150
|
+
if (peg$silentFails === 0) { peg$fail(peg$c48); }
|
|
3151
|
+
}
|
|
3152
|
+
if (s1 !== peg$FAILED) {
|
|
3153
|
+
s2 = peg$parseescape();
|
|
3154
|
+
if (s2 !== peg$FAILED) {
|
|
3155
|
+
peg$savedPos = s0;
|
|
3156
|
+
s1 = peg$c53(s2);
|
|
3157
|
+
s0 = s1;
|
|
3158
|
+
} else {
|
|
3159
|
+
peg$currPos = s0;
|
|
3160
|
+
s0 = peg$FAILED;
|
|
3161
|
+
}
|
|
3162
|
+
} else {
|
|
3163
|
+
peg$currPos = s0;
|
|
3164
|
+
s0 = peg$FAILED;
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3168
|
+
return s0;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
function peg$parseapostrophe() {
|
|
3172
|
+
var s0;
|
|
3173
|
+
|
|
3174
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
3175
|
+
s0 = peg$c47;
|
|
3176
|
+
peg$currPos++;
|
|
3177
|
+
} else {
|
|
3178
|
+
s0 = peg$FAILED;
|
|
3179
|
+
if (peg$silentFails === 0) { peg$fail(peg$c48); }
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
return s0;
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
function peg$parseescape() {
|
|
3186
|
+
var s0;
|
|
3187
|
+
|
|
3188
|
+
if (peg$c49.test(input.charAt(peg$currPos))) {
|
|
3189
|
+
s0 = input.charAt(peg$currPos);
|
|
3190
|
+
peg$currPos++;
|
|
3191
|
+
} else {
|
|
3192
|
+
s0 = peg$FAILED;
|
|
3193
|
+
if (peg$silentFails === 0) { peg$fail(peg$c50); }
|
|
3194
|
+
}
|
|
3195
|
+
if (s0 === peg$FAILED) {
|
|
3196
|
+
s0 = peg$parseapostrophe();
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
return s0;
|
|
3200
|
+
}
|
|
3201
|
+
|
|
3202
|
+
function peg$parsechar() {
|
|
3203
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
3204
|
+
|
|
3205
|
+
s0 = peg$currPos;
|
|
3206
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
3207
|
+
s1 = peg$c47;
|
|
3208
|
+
peg$currPos++;
|
|
3209
|
+
} else {
|
|
3210
|
+
s1 = peg$FAILED;
|
|
3211
|
+
if (peg$silentFails === 0) { peg$fail(peg$c48); }
|
|
3212
|
+
}
|
|
3213
|
+
if (s1 !== peg$FAILED) {
|
|
3214
|
+
s2 = peg$parseapostrophe();
|
|
3215
|
+
if (s2 !== peg$FAILED) {
|
|
3216
|
+
peg$savedPos = s0;
|
|
3217
|
+
s1 = peg$c53(s2);
|
|
3218
|
+
s0 = s1;
|
|
3219
|
+
} else {
|
|
3220
|
+
peg$currPos = s0;
|
|
3221
|
+
s0 = peg$FAILED;
|
|
3222
|
+
}
|
|
3223
|
+
} else {
|
|
3224
|
+
peg$currPos = s0;
|
|
3225
|
+
s0 = peg$FAILED;
|
|
3226
|
+
}
|
|
3227
|
+
if (s0 === peg$FAILED) {
|
|
3228
|
+
if (peg$c54.test(input.charAt(peg$currPos))) {
|
|
3229
|
+
s0 = input.charAt(peg$currPos);
|
|
3230
|
+
peg$currPos++;
|
|
3231
|
+
} else {
|
|
3232
|
+
s0 = peg$FAILED;
|
|
3233
|
+
if (peg$silentFails === 0) { peg$fail(peg$c55); }
|
|
3234
|
+
}
|
|
3235
|
+
if (s0 === peg$FAILED) {
|
|
3236
|
+
s0 = peg$currPos;
|
|
3237
|
+
if (input.substr(peg$currPos, 2) === peg$c56) {
|
|
3238
|
+
s1 = peg$c56;
|
|
3239
|
+
peg$currPos += 2;
|
|
3240
|
+
} else {
|
|
3241
|
+
s1 = peg$FAILED;
|
|
3242
|
+
if (peg$silentFails === 0) { peg$fail(peg$c57); }
|
|
3243
|
+
}
|
|
3244
|
+
if (s1 !== peg$FAILED) {
|
|
3245
|
+
peg$savedPos = s0;
|
|
3246
|
+
s1 = peg$c58();
|
|
3247
|
+
}
|
|
3248
|
+
s0 = s1;
|
|
3249
|
+
if (s0 === peg$FAILED) {
|
|
3250
|
+
s0 = peg$currPos;
|
|
3251
|
+
if (input.substr(peg$currPos, 2) === peg$c59) {
|
|
3252
|
+
s1 = peg$c59;
|
|
3253
|
+
peg$currPos += 2;
|
|
3254
|
+
} else {
|
|
3255
|
+
s1 = peg$FAILED;
|
|
3256
|
+
if (peg$silentFails === 0) { peg$fail(peg$c60); }
|
|
3257
|
+
}
|
|
3258
|
+
if (s1 !== peg$FAILED) {
|
|
3259
|
+
peg$savedPos = s0;
|
|
3260
|
+
s1 = peg$c61();
|
|
3261
|
+
}
|
|
3262
|
+
s0 = s1;
|
|
3263
|
+
if (s0 === peg$FAILED) {
|
|
3264
|
+
s0 = peg$currPos;
|
|
3265
|
+
if (input.substr(peg$currPos, 2) === peg$c62) {
|
|
3266
|
+
s1 = peg$c62;
|
|
3267
|
+
peg$currPos += 2;
|
|
3268
|
+
} else {
|
|
3269
|
+
s1 = peg$FAILED;
|
|
3270
|
+
if (peg$silentFails === 0) { peg$fail(peg$c63); }
|
|
3271
|
+
}
|
|
3272
|
+
if (s1 !== peg$FAILED) {
|
|
3273
|
+
peg$savedPos = s0;
|
|
3274
|
+
s1 = peg$c64();
|
|
3275
|
+
}
|
|
3276
|
+
s0 = s1;
|
|
3277
|
+
if (s0 === peg$FAILED) {
|
|
3278
|
+
s0 = peg$currPos;
|
|
3279
|
+
if (input.substr(peg$currPos, 2) === peg$c65) {
|
|
3280
|
+
s1 = peg$c65;
|
|
3281
|
+
peg$currPos += 2;
|
|
3282
|
+
} else {
|
|
3283
|
+
s1 = peg$FAILED;
|
|
3284
|
+
if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
3285
|
+
}
|
|
3286
|
+
if (s1 !== peg$FAILED) {
|
|
3287
|
+
peg$savedPos = s0;
|
|
3288
|
+
s1 = peg$c67();
|
|
3289
|
+
}
|
|
3290
|
+
s0 = s1;
|
|
3291
|
+
if (s0 === peg$FAILED) {
|
|
3292
|
+
s0 = peg$currPos;
|
|
3293
|
+
if (input.substr(peg$currPos, 2) === peg$c68) {
|
|
3294
|
+
s1 = peg$c68;
|
|
3295
|
+
peg$currPos += 2;
|
|
3296
|
+
} else {
|
|
3297
|
+
s1 = peg$FAILED;
|
|
3298
|
+
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
|
3299
|
+
}
|
|
3300
|
+
if (s1 !== peg$FAILED) {
|
|
3301
|
+
s2 = peg$currPos;
|
|
3302
|
+
s3 = peg$currPos;
|
|
3303
|
+
s4 = peg$parsehexDigit();
|
|
3304
|
+
if (s4 !== peg$FAILED) {
|
|
3305
|
+
s5 = peg$parsehexDigit();
|
|
3306
|
+
if (s5 !== peg$FAILED) {
|
|
3307
|
+
s6 = peg$parsehexDigit();
|
|
3308
|
+
if (s6 !== peg$FAILED) {
|
|
3309
|
+
s7 = peg$parsehexDigit();
|
|
3310
|
+
if (s7 !== peg$FAILED) {
|
|
3311
|
+
s4 = [s4, s5, s6, s7];
|
|
3312
|
+
s3 = s4;
|
|
3313
|
+
} else {
|
|
3314
|
+
peg$currPos = s3;
|
|
3315
|
+
s3 = peg$FAILED;
|
|
3316
|
+
}
|
|
3317
|
+
} else {
|
|
3318
|
+
peg$currPos = s3;
|
|
3319
|
+
s3 = peg$FAILED;
|
|
3320
|
+
}
|
|
3321
|
+
} else {
|
|
3322
|
+
peg$currPos = s3;
|
|
3323
|
+
s3 = peg$FAILED;
|
|
3324
|
+
}
|
|
3325
|
+
} else {
|
|
3326
|
+
peg$currPos = s3;
|
|
3327
|
+
s3 = peg$FAILED;
|
|
3328
|
+
}
|
|
3329
|
+
if (s3 !== peg$FAILED) {
|
|
3330
|
+
s2 = input.substring(s2, peg$currPos);
|
|
3331
|
+
} else {
|
|
3332
|
+
s2 = s3;
|
|
3333
|
+
}
|
|
3334
|
+
if (s2 !== peg$FAILED) {
|
|
3335
|
+
peg$savedPos = s0;
|
|
3336
|
+
s1 = peg$c70(s2);
|
|
3337
|
+
s0 = s1;
|
|
3338
|
+
} else {
|
|
3339
|
+
peg$currPos = s0;
|
|
3340
|
+
s0 = peg$FAILED;
|
|
3341
|
+
}
|
|
3342
|
+
} else {
|
|
3343
|
+
peg$currPos = s0;
|
|
3344
|
+
s0 = peg$FAILED;
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
return s0;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
function peg$parsechars() {
|
|
3357
|
+
var s0, s1, s2;
|
|
3358
|
+
|
|
3359
|
+
s0 = peg$currPos;
|
|
3360
|
+
s1 = [];
|
|
3361
|
+
s2 = peg$parsechar();
|
|
3362
|
+
if (s2 !== peg$FAILED) {
|
|
3363
|
+
while (s2 !== peg$FAILED) {
|
|
3364
|
+
s1.push(s2);
|
|
3365
|
+
s2 = peg$parsechar();
|
|
3366
|
+
}
|
|
3367
|
+
} else {
|
|
3368
|
+
s1 = peg$FAILED;
|
|
3369
|
+
}
|
|
3370
|
+
if (s1 !== peg$FAILED) {
|
|
3371
|
+
peg$savedPos = s0;
|
|
3372
|
+
s1 = peg$c3(s1);
|
|
3373
|
+
}
|
|
3374
|
+
s0 = s1;
|
|
3375
|
+
|
|
3376
|
+
return s0;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
peg$result = peg$startRuleFunction();
|
|
3380
|
+
|
|
3381
|
+
if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|
3382
|
+
return peg$result;
|
|
3383
|
+
} else {
|
|
3384
|
+
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|
3385
|
+
peg$fail(peg$endExpectation());
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
throw peg$buildStructuredError(
|
|
3389
|
+
peg$maxFailExpected,
|
|
3390
|
+
peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
|
|
3391
|
+
peg$maxFailPos < input.length
|
|
3392
|
+
? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
|
|
3393
|
+
: peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
|
|
3394
|
+
);
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
return {
|
|
3399
|
+
SyntaxError: peg$SyntaxError,
|
|
3400
|
+
parse: peg$parse
|
|
3401
|
+
};
|
|
3402
|
+
})();
|
|
3403
|
+
|
|
3404
|
+
/*
|
|
3405
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
3406
|
+
Copyrights licensed under the New BSD License.
|
|
3407
|
+
See the accompanying LICENSE file for terms.
|
|
3408
|
+
*/
|
|
3409
|
+
var __extends = (function () {
|
|
3410
|
+
var extendStatics = function (d, b) {
|
|
3411
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3412
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3413
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3414
|
+
return extendStatics(d, b);
|
|
3415
|
+
};
|
|
3416
|
+
return function (d, b) {
|
|
3417
|
+
extendStatics(d, b);
|
|
3418
|
+
function __() { this.constructor = d; }
|
|
3419
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3420
|
+
};
|
|
3421
|
+
})();
|
|
3422
|
+
var Compiler = /** @class */ (function () {
|
|
3423
|
+
function Compiler(locales, formats, formatters) {
|
|
3424
|
+
this.locales = [];
|
|
3425
|
+
this.formats = {
|
|
3426
|
+
number: {},
|
|
3427
|
+
date: {},
|
|
3428
|
+
time: {}
|
|
3429
|
+
};
|
|
3430
|
+
this.pluralNumberFormat = null;
|
|
3431
|
+
this.currentPlural = null;
|
|
3432
|
+
this.pluralStack = [];
|
|
3433
|
+
this.locales = locales;
|
|
3434
|
+
this.formats = formats;
|
|
3435
|
+
this.formatters = formatters;
|
|
3436
|
+
}
|
|
3437
|
+
Compiler.prototype.compile = function (ast) {
|
|
3438
|
+
this.pluralStack = [];
|
|
3439
|
+
this.currentPlural = null;
|
|
3440
|
+
this.pluralNumberFormat = null;
|
|
3441
|
+
return this.compileMessage(ast);
|
|
3442
|
+
};
|
|
3443
|
+
Compiler.prototype.compileMessage = function (ast) {
|
|
3444
|
+
var _this = this;
|
|
3445
|
+
if (!(ast && ast.type === 'messageFormatPattern')) {
|
|
3446
|
+
throw new Error('Message AST is not of type: "messageFormatPattern"');
|
|
3447
|
+
}
|
|
3448
|
+
var elements = ast.elements;
|
|
3449
|
+
var pattern = elements
|
|
3450
|
+
.filter(function (el) {
|
|
3451
|
+
return el.type === 'messageTextElement' || el.type === 'argumentElement';
|
|
3452
|
+
})
|
|
3453
|
+
.map(function (el) {
|
|
3454
|
+
return el.type === 'messageTextElement'
|
|
3455
|
+
? _this.compileMessageText(el)
|
|
3456
|
+
: _this.compileArgument(el);
|
|
3457
|
+
});
|
|
3458
|
+
if (pattern.length !== elements.length) {
|
|
3459
|
+
throw new Error('Message element does not have a valid type');
|
|
3460
|
+
}
|
|
3461
|
+
return pattern;
|
|
3462
|
+
};
|
|
3463
|
+
Compiler.prototype.compileMessageText = function (element) {
|
|
3464
|
+
// When this `element` is part of plural sub-pattern and its value contains
|
|
3465
|
+
// an unescaped '#', use a `PluralOffsetString` helper to properly output
|
|
3466
|
+
// the number with the correct offset in the string.
|
|
3467
|
+
if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) {
|
|
3468
|
+
// Create a cache a NumberFormat instance that can be reused for any
|
|
3469
|
+
// PluralOffsetString instance in this message.
|
|
3470
|
+
if (!this.pluralNumberFormat) {
|
|
3471
|
+
this.pluralNumberFormat = new Intl.NumberFormat(this.locales);
|
|
3472
|
+
}
|
|
3473
|
+
return new PluralOffsetString(this.currentPlural.id, this.currentPlural.format.offset, this.pluralNumberFormat, element.value);
|
|
3474
|
+
}
|
|
3475
|
+
// Unescape the escaped '#'s in the message text.
|
|
3476
|
+
return element.value.replace(/\\#/g, '#');
|
|
3477
|
+
};
|
|
3478
|
+
Compiler.prototype.compileArgument = function (element) {
|
|
3479
|
+
var format = element.format, id = element.id;
|
|
3480
|
+
var formatters = this.formatters;
|
|
3481
|
+
if (!format) {
|
|
3482
|
+
return new StringFormat(id);
|
|
3483
|
+
}
|
|
3484
|
+
var _a = this, formats = _a.formats, locales = _a.locales;
|
|
3485
|
+
switch (format.type) {
|
|
3486
|
+
case 'numberFormat':
|
|
3487
|
+
return {
|
|
3488
|
+
id: id,
|
|
3489
|
+
format: formatters.getNumberFormat(locales, formats.number[format.style]).format
|
|
3490
|
+
};
|
|
3491
|
+
case 'dateFormat':
|
|
3492
|
+
return {
|
|
3493
|
+
id: id,
|
|
3494
|
+
format: formatters.getDateTimeFormat(locales, formats.date[format.style]).format
|
|
3495
|
+
};
|
|
3496
|
+
case 'timeFormat':
|
|
3497
|
+
return {
|
|
3498
|
+
id: id,
|
|
3499
|
+
format: formatters.getDateTimeFormat(locales, formats.time[format.style]).format
|
|
3500
|
+
};
|
|
3501
|
+
case 'pluralFormat':
|
|
3502
|
+
return new PluralFormat(id, format.offset, this.compileOptions(element), formatters.getPluralRules(locales, {
|
|
3503
|
+
type: format.ordinal ? 'ordinal' : 'cardinal'
|
|
3504
|
+
}));
|
|
3505
|
+
case 'selectFormat':
|
|
3506
|
+
return new SelectFormat(id, this.compileOptions(element));
|
|
3507
|
+
default:
|
|
3508
|
+
throw new Error('Message element does not have a valid format type');
|
|
3509
|
+
}
|
|
3510
|
+
};
|
|
3511
|
+
Compiler.prototype.compileOptions = function (element) {
|
|
3512
|
+
var _this = this;
|
|
3513
|
+
var format = element.format;
|
|
3514
|
+
var options = format.options;
|
|
3515
|
+
// Save the current plural element, if any, then set it to a new value when
|
|
3516
|
+
// compiling the options sub-patterns. This conforms the spec's algorithm
|
|
3517
|
+
// for handling `"#"` syntax in message text.
|
|
3518
|
+
this.pluralStack.push(this.currentPlural);
|
|
3519
|
+
this.currentPlural = format.type === 'pluralFormat' ? element : null;
|
|
3520
|
+
var optionsHash = options.reduce(function (all, option) {
|
|
3521
|
+
// Compile the sub-pattern and save it under the options's selector.
|
|
3522
|
+
all[option.selector] = _this.compileMessage(option.value);
|
|
3523
|
+
return all;
|
|
3524
|
+
}, {});
|
|
3525
|
+
// Pop the plural stack to put back the original current plural value.
|
|
3526
|
+
this.currentPlural = this.pluralStack.pop();
|
|
3527
|
+
return optionsHash;
|
|
3528
|
+
};
|
|
3529
|
+
return Compiler;
|
|
3530
|
+
}());
|
|
3531
|
+
// -- Compiler Helper Classes --------------------------------------------------
|
|
3532
|
+
var Formatter = /** @class */ (function () {
|
|
3533
|
+
function Formatter(id) {
|
|
3534
|
+
this.id = id;
|
|
3535
|
+
}
|
|
3536
|
+
return Formatter;
|
|
3537
|
+
}());
|
|
3538
|
+
var StringFormat = /** @class */ (function (_super) {
|
|
3539
|
+
__extends(StringFormat, _super);
|
|
3540
|
+
function StringFormat() {
|
|
3541
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3542
|
+
}
|
|
3543
|
+
StringFormat.prototype.format = function (value) {
|
|
3544
|
+
if (!value && typeof value !== 'number') {
|
|
3545
|
+
return '';
|
|
3546
|
+
}
|
|
3547
|
+
return typeof value === 'string' ? value : String(value);
|
|
3548
|
+
};
|
|
3549
|
+
return StringFormat;
|
|
3550
|
+
}(Formatter));
|
|
3551
|
+
var PluralFormat = /** @class */ (function () {
|
|
3552
|
+
function PluralFormat(id, offset, options, pluralRules) {
|
|
3553
|
+
this.id = id;
|
|
3554
|
+
this.offset = offset;
|
|
3555
|
+
this.options = options;
|
|
3556
|
+
this.pluralRules = pluralRules;
|
|
3557
|
+
}
|
|
3558
|
+
PluralFormat.prototype.getOption = function (value) {
|
|
3559
|
+
var options = this.options;
|
|
3560
|
+
var option = options['=' + value] ||
|
|
3561
|
+
options[this.pluralRules.select(value - this.offset)];
|
|
3562
|
+
return option || options.other;
|
|
3563
|
+
};
|
|
3564
|
+
return PluralFormat;
|
|
3565
|
+
}());
|
|
3566
|
+
var PluralOffsetString = /** @class */ (function (_super) {
|
|
3567
|
+
__extends(PluralOffsetString, _super);
|
|
3568
|
+
function PluralOffsetString(id, offset, numberFormat, string) {
|
|
3569
|
+
var _this = _super.call(this, id) || this;
|
|
3570
|
+
_this.offset = offset;
|
|
3571
|
+
_this.numberFormat = numberFormat;
|
|
3572
|
+
_this.string = string;
|
|
3573
|
+
return _this;
|
|
3574
|
+
}
|
|
3575
|
+
PluralOffsetString.prototype.format = function (value) {
|
|
3576
|
+
var number = this.numberFormat.format(value - this.offset);
|
|
3577
|
+
return this.string
|
|
3578
|
+
.replace(/(^|[^\\])#/g, '$1' + number)
|
|
3579
|
+
.replace(/\\#/g, '#');
|
|
3580
|
+
};
|
|
3581
|
+
return PluralOffsetString;
|
|
3582
|
+
}(Formatter));
|
|
3583
|
+
var SelectFormat = /** @class */ (function () {
|
|
3584
|
+
function SelectFormat(id, options) {
|
|
3585
|
+
this.id = id;
|
|
3586
|
+
this.options = options;
|
|
3587
|
+
}
|
|
3588
|
+
SelectFormat.prototype.getOption = function (value) {
|
|
3589
|
+
var options = this.options;
|
|
3590
|
+
return options[value] || options.other;
|
|
3591
|
+
};
|
|
3592
|
+
return SelectFormat;
|
|
3593
|
+
}());
|
|
3594
|
+
function isSelectOrPluralFormat(f) {
|
|
3595
|
+
return !!f.options;
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
/*
|
|
3599
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
3600
|
+
Copyrights licensed under the New BSD License.
|
|
3601
|
+
See the accompanying LICENSE file for terms.
|
|
3602
|
+
*/
|
|
3603
|
+
var __extends$1 = (function () {
|
|
3604
|
+
var extendStatics = function (d, b) {
|
|
3605
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3606
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3607
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3608
|
+
return extendStatics(d, b);
|
|
3609
|
+
};
|
|
3610
|
+
return function (d, b) {
|
|
3611
|
+
extendStatics(d, b);
|
|
3612
|
+
function __() { this.constructor = d; }
|
|
3613
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3614
|
+
};
|
|
3615
|
+
})();
|
|
3616
|
+
var __assign = function () {
|
|
3617
|
+
__assign = Object.assign || function(t) {
|
|
3618
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3619
|
+
s = arguments[i];
|
|
3620
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3621
|
+
t[p] = s[p];
|
|
3622
|
+
}
|
|
3623
|
+
return t;
|
|
3624
|
+
};
|
|
3625
|
+
return __assign.apply(this, arguments);
|
|
3626
|
+
};
|
|
3627
|
+
// -- MessageFormat --------------------------------------------------------
|
|
3628
|
+
function resolveLocale(locales) {
|
|
3629
|
+
if (typeof locales === 'string') {
|
|
3630
|
+
locales = [locales];
|
|
3631
|
+
}
|
|
3632
|
+
try {
|
|
3633
|
+
return Intl.NumberFormat.supportedLocalesOf(locales, {
|
|
3634
|
+
// IE11 localeMatcher `lookup` seems to convert `en` -> `en-US`
|
|
3635
|
+
// but not other browsers,
|
|
3636
|
+
localeMatcher: 'best fit'
|
|
3637
|
+
})[0];
|
|
3638
|
+
}
|
|
3639
|
+
catch (e) {
|
|
3640
|
+
return IntlMessageFormat.defaultLocale;
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
function formatPatterns(pattern, values) {
|
|
3644
|
+
var result = '';
|
|
3645
|
+
for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) {
|
|
3646
|
+
var part = pattern_1[_i];
|
|
3647
|
+
// Exist early for string parts.
|
|
3648
|
+
if (typeof part === 'string') {
|
|
3649
|
+
result += part;
|
|
3650
|
+
continue;
|
|
3651
|
+
}
|
|
3652
|
+
var id = part.id;
|
|
3653
|
+
// Enforce that all required values are provided by the caller.
|
|
3654
|
+
if (!(values && id in values)) {
|
|
3655
|
+
throw new FormatError("A value must be provided for: " + id, id);
|
|
3656
|
+
}
|
|
3657
|
+
var value = values[id];
|
|
3658
|
+
// Recursively format plural and select parts' option — which can be a
|
|
3659
|
+
// nested pattern structure. The choosing of the option to use is
|
|
3660
|
+
// abstracted-by and delegated-to the part helper object.
|
|
3661
|
+
if (isSelectOrPluralFormat(part)) {
|
|
3662
|
+
result += formatPatterns(part.getOption(value), values);
|
|
3663
|
+
}
|
|
3664
|
+
else {
|
|
3665
|
+
result += part.format(value);
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
return result;
|
|
3669
|
+
}
|
|
3670
|
+
function mergeConfig(c1, c2) {
|
|
3671
|
+
if (!c2) {
|
|
3672
|
+
return c1;
|
|
3673
|
+
}
|
|
3674
|
+
return __assign({}, (c1 || {}), (c2 || {}), Object.keys(c1).reduce(function (all, k) {
|
|
3675
|
+
all[k] = __assign({}, c1[k], (c2[k] || {}));
|
|
3676
|
+
return all;
|
|
3677
|
+
}, {}));
|
|
3678
|
+
}
|
|
3679
|
+
function mergeConfigs(defaultConfig, configs) {
|
|
3680
|
+
if (!configs) {
|
|
3681
|
+
return defaultConfig;
|
|
3682
|
+
}
|
|
3683
|
+
return Object.keys(defaultConfig).reduce(function (all, k) {
|
|
3684
|
+
all[k] = mergeConfig(defaultConfig[k], configs[k]);
|
|
3685
|
+
return all;
|
|
3686
|
+
}, __assign({}, defaultConfig));
|
|
3687
|
+
}
|
|
3688
|
+
var FormatError = /** @class */ (function (_super) {
|
|
3689
|
+
__extends$1(FormatError, _super);
|
|
3690
|
+
function FormatError(msg, variableId) {
|
|
3691
|
+
var _this = _super.call(this, msg) || this;
|
|
3692
|
+
_this.variableId = variableId;
|
|
3693
|
+
return _this;
|
|
3694
|
+
}
|
|
3695
|
+
return FormatError;
|
|
3696
|
+
}(Error));
|
|
3697
|
+
function createDefaultFormatters() {
|
|
3698
|
+
return {
|
|
3699
|
+
getNumberFormat: function () {
|
|
3700
|
+
var _a;
|
|
3701
|
+
var args = [];
|
|
3702
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3703
|
+
args[_i] = arguments[_i];
|
|
3704
|
+
}
|
|
3705
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, [void 0].concat(args)))();
|
|
3706
|
+
},
|
|
3707
|
+
getDateTimeFormat: function () {
|
|
3708
|
+
var _a;
|
|
3709
|
+
var args = [];
|
|
3710
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3711
|
+
args[_i] = arguments[_i];
|
|
3712
|
+
}
|
|
3713
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, [void 0].concat(args)))();
|
|
3714
|
+
},
|
|
3715
|
+
getPluralRules: function () {
|
|
3716
|
+
var _a;
|
|
3717
|
+
var args = [];
|
|
3718
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3719
|
+
args[_i] = arguments[_i];
|
|
3720
|
+
}
|
|
3721
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, [void 0].concat(args)))();
|
|
3722
|
+
}
|
|
3723
|
+
};
|
|
3724
|
+
}
|
|
3725
|
+
var IntlMessageFormat = /** @class */ (function () {
|
|
3726
|
+
function IntlMessageFormat(message, locales, overrideFormats, opts) {
|
|
3727
|
+
var _this = this;
|
|
3728
|
+
if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }
|
|
3729
|
+
this.format = function (values) {
|
|
3730
|
+
try {
|
|
3731
|
+
return formatPatterns(_this.pattern, values);
|
|
3732
|
+
}
|
|
3733
|
+
catch (e) {
|
|
3734
|
+
if (e.variableId) {
|
|
3735
|
+
throw new Error("The intl string context variable '" + e.variableId + "' was not provided to the string '" + _this.message + "'");
|
|
3736
|
+
}
|
|
3737
|
+
else {
|
|
3738
|
+
throw e;
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3742
|
+
if (typeof message === 'string') {
|
|
3743
|
+
if (!IntlMessageFormat.__parse) {
|
|
3744
|
+
throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');
|
|
3745
|
+
}
|
|
3746
|
+
// Parse string messages into an AST.
|
|
3747
|
+
this.ast = IntlMessageFormat.__parse(message);
|
|
3748
|
+
}
|
|
3749
|
+
else {
|
|
3750
|
+
this.ast = message;
|
|
3751
|
+
}
|
|
3752
|
+
this.message = message;
|
|
3753
|
+
if (!(this.ast && this.ast.type === 'messageFormatPattern')) {
|
|
3754
|
+
throw new TypeError('A message must be provided as a String or AST.');
|
|
3755
|
+
}
|
|
3756
|
+
// Creates a new object with the specified `formats` merged with the default
|
|
3757
|
+
// formats.
|
|
3758
|
+
var formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);
|
|
3759
|
+
// Defined first because it's used to build the format pattern.
|
|
3760
|
+
this.locale = resolveLocale(locales || []);
|
|
3761
|
+
var formatters = (opts && opts.formatters) || createDefaultFormatters();
|
|
3762
|
+
// Compile the `ast` to a pattern that is highly optimized for repeated
|
|
3763
|
+
// `format()` invocations. **Note:** This passes the `locales` set provided
|
|
3764
|
+
// to the constructor instead of just the resolved locale.
|
|
3765
|
+
this.pattern = new Compiler(locales, formats, formatters).compile(this.ast);
|
|
3766
|
+
// "Bind" `format()` method to `this` so it can be passed by reference like
|
|
3767
|
+
// the other `Intl` APIs.
|
|
3768
|
+
}
|
|
3769
|
+
IntlMessageFormat.prototype.resolvedOptions = function () {
|
|
3770
|
+
return { locale: this.locale };
|
|
3771
|
+
};
|
|
3772
|
+
IntlMessageFormat.prototype.getAst = function () {
|
|
3773
|
+
return this.ast;
|
|
3774
|
+
};
|
|
3775
|
+
IntlMessageFormat.defaultLocale = 'en';
|
|
3776
|
+
IntlMessageFormat.__parse = undefined;
|
|
3777
|
+
// Default format options used as the prototype of the `formats` provided to the
|
|
3778
|
+
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
3779
|
+
// and Intl.DateTimeFormat instances.
|
|
3780
|
+
IntlMessageFormat.formats = {
|
|
3781
|
+
number: {
|
|
3782
|
+
currency: {
|
|
3783
|
+
style: 'currency'
|
|
3784
|
+
},
|
|
3785
|
+
percent: {
|
|
3786
|
+
style: 'percent'
|
|
3787
|
+
}
|
|
3788
|
+
},
|
|
3789
|
+
date: {
|
|
3790
|
+
short: {
|
|
3791
|
+
month: 'numeric',
|
|
3792
|
+
day: 'numeric',
|
|
3793
|
+
year: '2-digit'
|
|
3794
|
+
},
|
|
3795
|
+
medium: {
|
|
3796
|
+
month: 'short',
|
|
3797
|
+
day: 'numeric',
|
|
3798
|
+
year: 'numeric'
|
|
3799
|
+
},
|
|
3800
|
+
long: {
|
|
3801
|
+
month: 'long',
|
|
3802
|
+
day: 'numeric',
|
|
3803
|
+
year: 'numeric'
|
|
3804
|
+
},
|
|
3805
|
+
full: {
|
|
3806
|
+
weekday: 'long',
|
|
3807
|
+
month: 'long',
|
|
3808
|
+
day: 'numeric',
|
|
3809
|
+
year: 'numeric'
|
|
3810
|
+
}
|
|
3811
|
+
},
|
|
3812
|
+
time: {
|
|
3813
|
+
short: {
|
|
3814
|
+
hour: 'numeric',
|
|
3815
|
+
minute: 'numeric'
|
|
3816
|
+
},
|
|
3817
|
+
medium: {
|
|
3818
|
+
hour: 'numeric',
|
|
3819
|
+
minute: 'numeric',
|
|
3820
|
+
second: 'numeric'
|
|
3821
|
+
},
|
|
3822
|
+
long: {
|
|
3823
|
+
hour: 'numeric',
|
|
3824
|
+
minute: 'numeric',
|
|
3825
|
+
second: 'numeric',
|
|
3826
|
+
timeZoneName: 'short'
|
|
3827
|
+
},
|
|
3828
|
+
full: {
|
|
3829
|
+
hour: 'numeric',
|
|
3830
|
+
minute: 'numeric',
|
|
3831
|
+
second: 'numeric',
|
|
3832
|
+
timeZoneName: 'short'
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
};
|
|
3836
|
+
return IntlMessageFormat;
|
|
3837
|
+
}());
|
|
3838
|
+
|
|
3839
|
+
/*
|
|
3840
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
3841
|
+
Copyrights licensed under the New BSD License.
|
|
3842
|
+
See the accompanying LICENSE file for terms.
|
|
3843
|
+
*/
|
|
3844
|
+
IntlMessageFormat.__parse = parser.parse;
|
|
3845
|
+
|
|
3846
|
+
exports.IntlMessageFormat = IntlMessageFormat;
|
|
3847
|
+
exports.createDefaultFormatters = createDefaultFormatters;
|
|
3848
|
+
exports.default = IntlMessageFormat;
|
|
3849
|
+
|
|
3850
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3851
|
+
|
|
3852
|
+
}));
|
|
3853
|
+
|
|
3854
|
+
});
|
|
3855
|
+
|
|
3856
|
+
/**
|
|
3857
|
+
* @license Copyright 2018 Google Inc. All Rights Reserved.
|
|
3858
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
3859
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
3860
|
+
*/
|
|
3861
|
+
|
|
3862
|
+
/** @fileoverview
|
|
3863
|
+
* Define the available locale list
|
|
3864
|
+
*/
|
|
3865
|
+
|
|
3866
|
+
const locales = {
|
|
3867
|
+
'en-US': {'title': 'value'}, // The 'source' strings, with descriptions
|
|
3868
|
+
'en-XL': {'title': 'value'}, // local pseudolocalization
|
|
3869
|
+
};
|
|
3870
|
+
|
|
3871
|
+
const MessageFormat = intlMessageformat.default;
|
|
3872
|
+
|
|
3873
|
+
|
|
3874
|
+
/** @typedef {import('intl-messageformat-parser').Element} MessageElement */
|
|
3875
|
+
/** @typedef {import('intl-messageformat-parser').ArgumentElement} ArgumentElement */
|
|
3876
|
+
|
|
3877
|
+
const MESSAGE_INSTANCE_ID_REGEX = /(.* \| .*) # (\d+)$/;
|
|
3878
|
+
// Above regex is very slow against large strings. Use QUICK_REGEX as a much quicker discriminator.
|
|
3879
|
+
const MESSAGE_INSTANCE_ID_QUICK_REGEX = / # \d+$/;
|
|
3880
|
+
|
|
3881
|
+
const formats = {
|
|
3882
|
+
number: {
|
|
3883
|
+
bytes: {
|
|
3884
|
+
maximumFractionDigits: 0,
|
|
3885
|
+
},
|
|
3886
|
+
milliseconds: {
|
|
3887
|
+
maximumFractionDigits: 0,
|
|
3888
|
+
},
|
|
3889
|
+
seconds: {
|
|
3890
|
+
// Force the seconds to the tenths place for limited output and ease of scanning
|
|
3891
|
+
minimumFractionDigits: 1,
|
|
3892
|
+
maximumFractionDigits: 1,
|
|
3893
|
+
},
|
|
3894
|
+
extendedPercent: {
|
|
3895
|
+
// Force allow up to two digits after decimal place in percentages. (Intl.NumberFormat options)
|
|
3896
|
+
maximumFractionDigits: 2,
|
|
3897
|
+
style: 'percent',
|
|
3898
|
+
},
|
|
3899
|
+
},
|
|
3900
|
+
};
|
|
3901
|
+
|
|
3902
|
+
/**
|
|
3903
|
+
* Look up the best available locale for the requested language through these fall backs:
|
|
3904
|
+
* - exact match
|
|
3905
|
+
* - progressively shorter prefixes (`de-CH-1996` -> `de-CH` -> `de`)
|
|
3906
|
+
* - the default locale ('en-US') if no match is found
|
|
3907
|
+
*
|
|
3908
|
+
* If `locale` isn't provided, the default is used.
|
|
3909
|
+
* @param {string=} locale
|
|
3910
|
+
* @return {LH.Locale}
|
|
3911
|
+
*/
|
|
3912
|
+
function lookupLocale(locale) {
|
|
3913
|
+
// TODO: could do more work to sniff out default locale
|
|
3914
|
+
const canonicalLocale = Intl.getCanonicalLocales(locale)[0];
|
|
3915
|
+
|
|
3916
|
+
const closestLocale = lookupClosestLocale(canonicalLocale, locales);
|
|
3917
|
+
return closestLocale || 'en-US';
|
|
3918
|
+
}
|
|
3919
|
+
|
|
3920
|
+
/**
|
|
3921
|
+
* Function to retrieve all 'argumentElement's from an ICU message. An argumentElement
|
|
3922
|
+
* is an ICU element with an argument in it, like '{varName}' or '{varName, number, bytes}'. This
|
|
3923
|
+
* differs from 'messageElement's which are just arbitrary text in a message.
|
|
3924
|
+
*
|
|
3925
|
+
* Notes:
|
|
3926
|
+
* This function will recursively inspect plural elements for nested argumentElements.
|
|
3927
|
+
*
|
|
3928
|
+
* We need to find all the elements from the plural format sections, but
|
|
3929
|
+
* they need to be deduplicated. I.e. "=1{hello {icu}} =other{hello {icu}}"
|
|
3930
|
+
* the variable "icu" would appear twice if it wasn't de duplicated. And they cannot
|
|
3931
|
+
* be stored in a set because they are not equal since their locations are different,
|
|
3932
|
+
* thus they are stored via a Map keyed on the "id" which is the ICU varName.
|
|
3933
|
+
*
|
|
3934
|
+
* @param {Array<MessageElement>} icuElements
|
|
3935
|
+
* @param {Map<string, ArgumentElement>} [seenElementsById]
|
|
3936
|
+
* @return {Map<string, ArgumentElement>}
|
|
3937
|
+
*/
|
|
3938
|
+
function collectAllCustomElementsFromICU(icuElements, seenElementsById = new Map()) {
|
|
3939
|
+
for (const el of icuElements) {
|
|
3940
|
+
// We are only interested in elements that need ICU formatting (argumentElements)
|
|
3941
|
+
if (el.type !== 'argumentElement') continue;
|
|
3942
|
+
|
|
3943
|
+
seenElementsById.set(el.id, el);
|
|
3944
|
+
|
|
3945
|
+
// Plurals need to be inspected recursively
|
|
3946
|
+
if (!el.format || el.format.type !== 'pluralFormat') continue;
|
|
3947
|
+
// Look at all options of the plural (=1{} =other{}...)
|
|
3948
|
+
for (const option of el.format.options) {
|
|
3949
|
+
// Run collections on each option's elements
|
|
3950
|
+
collectAllCustomElementsFromICU(option.value.elements, seenElementsById);
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
return seenElementsById;
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
/**
|
|
3958
|
+
* Returns a copy of the `values` object, with the values formatted based on how
|
|
3959
|
+
* they will be used in the `icuMessage`, e.g. KB or milliseconds. The original
|
|
3960
|
+
* object is unchanged.
|
|
3961
|
+
* @param {string} icuMessage
|
|
3962
|
+
* @param {MessageFormat} messageFormatter
|
|
3963
|
+
* @param {Readonly<Record<string, string | number>>} values
|
|
3964
|
+
* @return {Record<string, string | number>}
|
|
3965
|
+
*/
|
|
3966
|
+
function _preformatValues(icuMessage, messageFormatter, values) {
|
|
3967
|
+
const elementMap = collectAllCustomElementsFromICU(messageFormatter.getAst().elements);
|
|
3968
|
+
const argumentElements = [...elementMap.values()];
|
|
3969
|
+
|
|
3970
|
+
/** @type {Record<string, string | number>} */
|
|
3971
|
+
const formattedValues = {};
|
|
3972
|
+
|
|
3973
|
+
for (const {id, format} of argumentElements) {
|
|
3974
|
+
// Throw an error if a message's value isn't provided
|
|
3975
|
+
if (id && (id in values) === false) {
|
|
3976
|
+
throw new Error(`ICU Message "${icuMessage}" contains a value reference ("${id}") ` +
|
|
3977
|
+
`that wasn't provided`);
|
|
3978
|
+
}
|
|
3979
|
+
|
|
3980
|
+
const value = values[id];
|
|
3981
|
+
|
|
3982
|
+
// Direct `{id}` replacement and non-numeric values need no formatting.
|
|
3983
|
+
if (!format || format.type !== 'numberFormat') {
|
|
3984
|
+
formattedValues[id] = value;
|
|
3985
|
+
continue;
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3988
|
+
if (typeof value !== 'number') {
|
|
3989
|
+
throw new Error(`ICU Message "${icuMessage}" contains a numeric reference ("${id}") ` +
|
|
3990
|
+
'but provided value was not a number');
|
|
3991
|
+
}
|
|
3992
|
+
|
|
3993
|
+
// Format values for known styles.
|
|
3994
|
+
if (format.style === 'milliseconds') {
|
|
3995
|
+
// Round all milliseconds to the nearest 10.
|
|
3996
|
+
formattedValues[id] = Math.round(value / 10) * 10;
|
|
3997
|
+
} else if (format.style === 'seconds' && id === 'timeInMs') {
|
|
3998
|
+
// Convert all seconds to the correct unit (currently only for `timeInMs`).
|
|
3999
|
+
formattedValues[id] = Math.round(value / 100) / 10;
|
|
4000
|
+
} else if (format.style === 'bytes') {
|
|
4001
|
+
// Replace all the bytes with KB.
|
|
4002
|
+
formattedValues[id] = value / 1024;
|
|
4003
|
+
} else {
|
|
4004
|
+
// For all other number styles, the value isn't changed.
|
|
4005
|
+
formattedValues[id] = value;
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
// Throw an error if a value is provided but has no placeholder in the message.
|
|
4010
|
+
for (const valueId of Object.keys(values)) {
|
|
4011
|
+
if (valueId in formattedValues) continue;
|
|
4012
|
+
|
|
4013
|
+
// errorCode is a special case always allowed to help LHError ease-of-use.
|
|
4014
|
+
if (valueId === 'errorCode') {
|
|
4015
|
+
formattedValues.errorCode = values.errorCode;
|
|
4016
|
+
continue;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
throw new Error(`Provided value "${valueId}" does not match any placeholder in ` +
|
|
4020
|
+
`ICU message "${icuMessage}"`);
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
return formattedValues;
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4026
|
+
/**
|
|
4027
|
+
* @typedef IcuMessageInstance
|
|
4028
|
+
* @prop {string} icuMessageId
|
|
4029
|
+
* @prop {string} icuMessage
|
|
4030
|
+
* @prop {Record<string, string | number>|undefined} [values]
|
|
4031
|
+
*/
|
|
4032
|
+
|
|
4033
|
+
/** @type {Map<string, IcuMessageInstance[]>} */
|
|
4034
|
+
const _icuMessageInstanceMap = new Map();
|
|
4035
|
+
|
|
4036
|
+
const _ICUMsgNotFoundMsg = 'ICU message not found in destination locale';
|
|
4037
|
+
/**
|
|
4038
|
+
*
|
|
4039
|
+
* @param {LH.Locale} locale
|
|
4040
|
+
* @param {string} icuMessageId
|
|
4041
|
+
* @param {string=} uiStringMessage The original string given in 'UIStrings', used as a backup if no locale message can be found
|
|
4042
|
+
* @return {{localeMessage: string, formatter: MessageFormat}}
|
|
4043
|
+
*/
|
|
4044
|
+
function _getLocaleMessageAndCreateFormatter(locale, icuMessageId, uiStringMessage) {
|
|
4045
|
+
const localeMessages = locales[locale];
|
|
4046
|
+
if (!localeMessages) throw new Error(`Unsupported locale '${locale}'`);
|
|
4047
|
+
let localeMessage = localeMessages[icuMessageId] && localeMessages[icuMessageId].message;
|
|
4048
|
+
|
|
4049
|
+
// fallback to the original english message if we couldn't find a message in the specified locale
|
|
4050
|
+
// better to have an english message than no message at all, in some number cases it won't even matter
|
|
4051
|
+
if (!localeMessage && uiStringMessage) {
|
|
4052
|
+
// Try to use the original uiStringMessage
|
|
4053
|
+
localeMessage = uiStringMessage;
|
|
4054
|
+
|
|
4055
|
+
// Warn the user that the UIString message != the `en-US` message ∴ they should update the strings
|
|
4056
|
+
if (!locales['en-US'][icuMessageId] || localeMessage !== locales['en-US'][icuMessageId].message) {
|
|
4057
|
+
console.log('i18n', `Message "${icuMessageId}" does not match its 'en-US' counterpart. ` +
|
|
4058
|
+
`Run 'i18n' to update.`);
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
// At this point, there is no reasonable string to show to the user, so throw.
|
|
4062
|
+
if (!localeMessage) {
|
|
4063
|
+
throw new Error(_ICUMsgNotFoundMsg);
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
// when using accented english, force the use of a different locale for number formatting
|
|
4067
|
+
const localeForMessageFormat = (locale === 'en-XA' || locale === 'en-XL') ? 'de-DE' : locale;
|
|
4068
|
+
|
|
4069
|
+
const formatter = new MessageFormat(localeMessage, localeForMessageFormat, formats);
|
|
4070
|
+
|
|
4071
|
+
return {localeMessage, formatter};
|
|
4072
|
+
}
|
|
4073
|
+
/**
|
|
4074
|
+
*
|
|
4075
|
+
* @param {string} localeMessage
|
|
4076
|
+
* @param {MessageFormat} formatter
|
|
4077
|
+
* @param {Record<string, string | number>} [values]
|
|
4078
|
+
* @return {{formattedString: string, icuMessage: string}}
|
|
4079
|
+
*/
|
|
4080
|
+
function _formatMessage(localeMessage, formatter, values = {}) {
|
|
4081
|
+
// preformat values for the message format like KB and milliseconds
|
|
4082
|
+
const valuesForMessageFormat = _preformatValues(localeMessage, formatter, values);
|
|
4083
|
+
|
|
4084
|
+
const formattedString = formatter.format(valuesForMessageFormat);
|
|
4085
|
+
return {formattedString, icuMessage: localeMessage};
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4088
|
+
/** @param {string[]} pathInLHR */
|
|
4089
|
+
function _formatPathAsString(pathInLHR) {
|
|
4090
|
+
let pathAsString = '';
|
|
4091
|
+
for (const property of pathInLHR) {
|
|
4092
|
+
if (/^[a-z]+$/i.test(property)) {
|
|
4093
|
+
if (pathAsString.length) pathAsString += '.';
|
|
4094
|
+
pathAsString += property;
|
|
4095
|
+
} else {
|
|
4096
|
+
if (/]|"|'|\s/.test(property)) throw new Error(`Cannot handle "${property}" in i18n`);
|
|
4097
|
+
pathAsString += `[${property}]`;
|
|
4098
|
+
}
|
|
4099
|
+
}
|
|
4100
|
+
|
|
4101
|
+
return pathAsString;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
/**
|
|
4105
|
+
* @param {LH.Locale} locale
|
|
4106
|
+
* @return {LH.I18NRendererStrings}
|
|
4107
|
+
*/
|
|
4108
|
+
function getRendererFormattedStrings(locale) {
|
|
4109
|
+
const localeMessages = locales[locale];
|
|
4110
|
+
if (!localeMessages) throw new Error(`Unsupported locale '${locale}'`);
|
|
4111
|
+
|
|
4112
|
+
const icuMessageIds = Object.keys(localeMessages).filter(f => f.includes('ModuleUIStrings'));
|
|
4113
|
+
const strings = /** @type {LH.I18NRendererStrings} */ ({});
|
|
4114
|
+
for (const icuMessageId of icuMessageIds) {
|
|
4115
|
+
const [filename, varName] = icuMessageId.split(' | ');
|
|
4116
|
+
const key = /** @type {keyof LH.I18NRendererStrings} */ (varName);
|
|
4117
|
+
strings[key] = localeMessages[icuMessageId].message;
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
return strings;
|
|
4121
|
+
}
|
|
4122
|
+
|
|
4123
|
+
/**
|
|
4124
|
+
* Register a file's UIStrings with i18n, return function to
|
|
4125
|
+
* generate the string ids.
|
|
4126
|
+
*
|
|
4127
|
+
* @param {string} filename
|
|
4128
|
+
* @param {Record<string, string>} fileStrings
|
|
4129
|
+
*/
|
|
4130
|
+
function createMessageInstanceIdFn(filename, fileStrings) {
|
|
4131
|
+
/**
|
|
4132
|
+
* Convert a message string & replacement values into an
|
|
4133
|
+
* indexed id value in the form '{messageid} | # {index}'.
|
|
4134
|
+
*
|
|
4135
|
+
* @param {string} icuMessage
|
|
4136
|
+
* @param {Record<string, string | number>} [values]
|
|
4137
|
+
* */
|
|
4138
|
+
const getMessageInstanceIdFn = (icuMessage, values) => {
|
|
4139
|
+
const keyname = Object.keys(fileStrings).find(key => fileStrings[key] === icuMessage);
|
|
4140
|
+
if (!keyname) throw new idNotInMainDictionaryException(icuMessage);
|
|
4141
|
+
|
|
4142
|
+
const unixStyleFilename = filename.replace(/\\/g, '/');
|
|
4143
|
+
const icuMessageId = `${unixStyleFilename} | ${keyname}`;
|
|
4144
|
+
const icuMessageInstances = _icuMessageInstanceMap.get(icuMessageId) || [];
|
|
4145
|
+
|
|
4146
|
+
let indexOfInstance = icuMessageInstances.findIndex(inst => _package(inst.values, values));
|
|
4147
|
+
if (indexOfInstance === -1) {
|
|
4148
|
+
icuMessageInstances.push({icuMessageId, icuMessage, values});
|
|
4149
|
+
indexOfInstance = icuMessageInstances.length - 1;
|
|
4150
|
+
}
|
|
4151
|
+
|
|
4152
|
+
_icuMessageInstanceMap.set(icuMessageId, icuMessageInstances);
|
|
4153
|
+
|
|
4154
|
+
return `${icuMessageId} # ${indexOfInstance}`;
|
|
4155
|
+
};
|
|
4156
|
+
|
|
4157
|
+
return getMessageInstanceIdFn;
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
/**
|
|
4161
|
+
* Returns true if string is an ICUMessage reference.
|
|
4162
|
+
* @param {string} icuMessageIdOrRawString
|
|
4163
|
+
* @return {boolean}
|
|
4164
|
+
*/
|
|
4165
|
+
function isIcuMessage(icuMessageIdOrRawString) {
|
|
4166
|
+
return MESSAGE_INSTANCE_ID_QUICK_REGEX.test(icuMessageIdOrRawString) &&
|
|
4167
|
+
MESSAGE_INSTANCE_ID_REGEX.test(icuMessageIdOrRawString);
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
/**
|
|
4171
|
+
* @param {string} icuMessageIdOrRawString
|
|
4172
|
+
* @param {LH.Locale} locale
|
|
4173
|
+
* @return {string}
|
|
4174
|
+
*/
|
|
4175
|
+
function getFormatted(icuMessageIdOrRawString, locale) {
|
|
4176
|
+
if (isIcuMessage(icuMessageIdOrRawString)) {
|
|
4177
|
+
const {icuMessageId, icuMessageInstance} = _resolveIcuMessageInstanceId(icuMessageIdOrRawString);
|
|
4178
|
+
const {localeMessage, formatter} = _getLocaleMessageAndCreateFormatter(locale, icuMessageId, icuMessageInstance.icuMessage);
|
|
4179
|
+
const {formattedString} = _formatMessage(localeMessage, formatter, icuMessageInstance.values);
|
|
4180
|
+
return formattedString;
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
return icuMessageIdOrRawString;
|
|
4184
|
+
}
|
|
4185
|
+
|
|
4186
|
+
/**
|
|
4187
|
+
* @param {string} icuMessageIdOrRawString
|
|
4188
|
+
* @param {LH.Locale} locale
|
|
4189
|
+
* @return {MessageFormat | string}
|
|
4190
|
+
*/
|
|
4191
|
+
function getFormatter(icuMessageIdOrRawString, locale) {
|
|
4192
|
+
if (isIcuMessage(icuMessageIdOrRawString)) {
|
|
4193
|
+
const {icuMessageId, icuMessageInstance} = _resolveIcuMessageInstanceId(icuMessageIdOrRawString);
|
|
4194
|
+
const {formatter} = _getLocaleMessageAndCreateFormatter(locale, icuMessageId, icuMessageInstance.icuMessage);
|
|
4195
|
+
|
|
4196
|
+
return formatter;
|
|
4197
|
+
}
|
|
4198
|
+
|
|
4199
|
+
return icuMessageIdOrRawString;
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
/**
|
|
4203
|
+
* @param {LH.Locale} locale
|
|
4204
|
+
* @param {string} icuMessageId
|
|
4205
|
+
* @param {Record<string, string | number>} [values]
|
|
4206
|
+
* @return {string}
|
|
4207
|
+
*/
|
|
4208
|
+
function getFormattedFromIdAndValues(locale, icuMessageId, values) {
|
|
4209
|
+
const icuMessageIdRegex = /(.* \| .*)$/;
|
|
4210
|
+
if (!icuMessageIdRegex.test(icuMessageId)) throw new Error('This is not an ICU message ID');
|
|
4211
|
+
|
|
4212
|
+
const {localeMessage, formatter} = _getLocaleMessageAndCreateFormatter(locale, icuMessageId, undefined);
|
|
4213
|
+
const {formattedString} = _formatMessage(localeMessage, formatter, values);
|
|
4214
|
+
|
|
4215
|
+
return formattedString;
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
/**
|
|
4219
|
+
* @param {string} icuMessageInstanceId
|
|
4220
|
+
* @return {{icuMessageId: string, icuMessageInstance: IcuMessageInstance}}
|
|
4221
|
+
*/
|
|
4222
|
+
function _resolveIcuMessageInstanceId(icuMessageInstanceId) {
|
|
4223
|
+
const matches = icuMessageInstanceId.match(MESSAGE_INSTANCE_ID_REGEX);
|
|
4224
|
+
if (!matches) throw new Error(`${icuMessageInstanceId} is not a valid message instance ID`);
|
|
4225
|
+
|
|
4226
|
+
const [_, icuMessageId, icuMessageInstanceIndex] = matches;
|
|
4227
|
+
const icuMessageInstances = _icuMessageInstanceMap.get(icuMessageId) || [];
|
|
4228
|
+
const icuMessageInstance = icuMessageInstances[Number(icuMessageInstanceIndex)];
|
|
4229
|
+
|
|
4230
|
+
return {icuMessageId, icuMessageInstance};
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4233
|
+
/**
|
|
4234
|
+
* Recursively walk the input object, looking for property values that are
|
|
4235
|
+
* string references and replace them with their localized values. Primarily
|
|
4236
|
+
* used with the full LHR as input.
|
|
4237
|
+
* @param {*} inputObject
|
|
4238
|
+
* @param {LH.Locale} locale
|
|
4239
|
+
* @return {LH.I18NMessages}
|
|
4240
|
+
*/
|
|
4241
|
+
function replaceIcuMessageInstanceIds(inputObject, locale) {
|
|
4242
|
+
/**
|
|
4243
|
+
* @param {*} subObject
|
|
4244
|
+
* @param {LH.I18NMessages} icuMessagePaths
|
|
4245
|
+
* @param {string[]} pathInLHR
|
|
4246
|
+
*/
|
|
4247
|
+
function replaceInObject(subObject, icuMessagePaths, pathInLHR = []) {
|
|
4248
|
+
if (typeof subObject !== 'object' || !subObject) return;
|
|
4249
|
+
|
|
4250
|
+
for (const [property, value] of Object.entries(subObject)) {
|
|
4251
|
+
const currentPathInLHR = pathInLHR.concat([property]);
|
|
4252
|
+
|
|
4253
|
+
// Check to see if the value in the LHR looks like a string reference. If it is, replace it.
|
|
4254
|
+
if (typeof value === 'string' && isIcuMessage(value)) {
|
|
4255
|
+
const {icuMessageId, icuMessageInstance} = _resolveIcuMessageInstanceId(value);
|
|
4256
|
+
const {localeMessage, formatter} = _getLocaleMessageAndCreateFormatter(locale, icuMessageId, icuMessageInstance.icuMessage);
|
|
4257
|
+
const {formattedString} = _formatMessage(localeMessage, formatter, icuMessageInstance.values);
|
|
4258
|
+
|
|
4259
|
+
const messageInstancesInLHR = icuMessagePaths[icuMessageInstance.icuMessageId] || [];
|
|
4260
|
+
const currentPathAsString = _formatPathAsString(currentPathInLHR);
|
|
4261
|
+
|
|
4262
|
+
messageInstancesInLHR.push(
|
|
4263
|
+
icuMessageInstance.values ?
|
|
4264
|
+
{values: icuMessageInstance.values, path: currentPathAsString} :
|
|
4265
|
+
currentPathAsString
|
|
4266
|
+
);
|
|
4267
|
+
|
|
4268
|
+
subObject[property] = formattedString;
|
|
4269
|
+
icuMessagePaths[icuMessageInstance.icuMessageId] = messageInstancesInLHR;
|
|
4270
|
+
} else {
|
|
4271
|
+
replaceInObject(value, icuMessagePaths, currentPathInLHR);
|
|
4272
|
+
}
|
|
4273
|
+
}
|
|
4274
|
+
}
|
|
4275
|
+
|
|
4276
|
+
/** @type {LH.I18NMessages} */
|
|
4277
|
+
const icuMessagePaths = {};
|
|
4278
|
+
replaceInObject(inputObject, icuMessagePaths);
|
|
4279
|
+
return icuMessagePaths;
|
|
4280
|
+
}
|
|
4281
|
+
|
|
4282
|
+
/** @typedef {import('./locales').LhlMessages} LhlMessages */
|
|
4283
|
+
|
|
4284
|
+
/**
|
|
4285
|
+
* Populate the i18n string lookup dict with locale data
|
|
4286
|
+
* Used when the host environment selects the locale and serves lighthouse the intended locale file
|
|
4287
|
+
* @see https://docs.google.com/document/d/1jnt3BqKB-4q3AE94UWFA0Gqspx8Sd_jivlB7gQMlmfk/edit
|
|
4288
|
+
* @param {LH.Locale} locale
|
|
4289
|
+
* @param {LhlMessages} lhlMessages
|
|
4290
|
+
*/
|
|
4291
|
+
function registerLocaleData(locale, lhlMessages) {
|
|
4292
|
+
locales[locale] = lhlMessages;
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
/**
|
|
4296
|
+
* Get the closest locale from the ones available For example,
|
|
4297
|
+
* if es is supported and es-419 is not, then we return es when es-419 is requested
|
|
4298
|
+
* @param {LH.Locale} locale
|
|
4299
|
+
* @param {any} available
|
|
4300
|
+
*/
|
|
4301
|
+
function lookupClosestLocale(locale, available) {
|
|
4302
|
+
const localeParts = locale.split('-');
|
|
4303
|
+
while (localeParts.length) {
|
|
4304
|
+
let candidate = localeParts.join('-');
|
|
4305
|
+
if (available[candidate]) {
|
|
4306
|
+
return candidate;
|
|
4307
|
+
}
|
|
4308
|
+
localeParts.pop();
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
/**
|
|
4312
|
+
* Throws an error with the given icuMessage id.
|
|
4313
|
+
* @param {string} icuMessage
|
|
4314
|
+
*/
|
|
4315
|
+
function idNotInMainDictionaryException(icuMessage) {
|
|
4316
|
+
this.message = `Could not locate: ${icuMessage}`;
|
|
4317
|
+
}
|
|
4318
|
+
idNotInMainDictionaryException.prototype = new Error;
|
|
4319
|
+
|
|
4320
|
+
var i18n = {
|
|
4321
|
+
_formatPathAsString,
|
|
4322
|
+
_ICUMsgNotFoundMsg,
|
|
4323
|
+
lookupLocale,
|
|
4324
|
+
getRendererFormattedStrings,
|
|
4325
|
+
createMessageInstanceIdFn,
|
|
4326
|
+
getFormatted,
|
|
4327
|
+
getFormatter,
|
|
4328
|
+
getFormattedFromIdAndValues,
|
|
4329
|
+
replaceIcuMessageInstanceIds,
|
|
4330
|
+
isIcuMessage,
|
|
4331
|
+
collectAllCustomElementsFromICU,
|
|
4332
|
+
registerLocaleData,
|
|
4333
|
+
idNotInMainDictionaryException,
|
|
4334
|
+
};
|
|
4335
|
+
|
|
4336
|
+
export default i18n;
|