castled-js-sdk 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.env.example +8 -0
- package/.eslintignore +15 -0
- package/.eslintrc.json +41 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- package/.github/pull_request_template.md +22 -0
- package/.github/workflows/build-and-quality-checks.yml +50 -0
- package/.github/workflows/deploy-beta.yml +55 -0
- package/.github/workflows/deploy-cdn.yml +113 -0
- package/.github/workflows/deploy-npm.yml +80 -0
- package/.github/workflows/deploy-sanity-suite.yml +46 -0
- package/.github/workflows/test.yml +39 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/.prettierignore +10 -0
- package/.prettierrc +7 -0
- package/.size-limit.js +30 -0
- package/.versionrc +12 -0
- package/LICENSE +67 -0
- package/README.md +102 -22
- package/__mocks__/BraveBrowser.js +9 -0
- package/__mocks__/fixtures.js +130 -0
- package/__mocks__/msw.handlers.js +34 -0
- package/__mocks__/msw.server.js +6 -0
- package/__tests__/camelcase.test.js +29 -0
- package/__tests__/data-residency.test.js +238 -0
- package/__tests__/features/core/metrics/errorReporting/ErrorReportingService.test.js +80 -0
- package/__tests__/integrations/BingAds/__mocks__/data.js +17 -0
- package/__tests__/integrations/BingAds/browser.test.js +148 -0
- package/__tests__/integrations/BingAds/utils.test.js +138 -0
- package/__tests__/integrations/Braze/Braze.test.js +462 -0
- package/__tests__/integrations/FacebookPixel/FacebookPixel.test.js +347 -0
- package/__tests__/integrations/FacebookPixel/utils.test.js +688 -0
- package/__tests__/integrations/Fullstory/fullstory.test.js +147 -0
- package/__tests__/integrations/GA4/__mocks__/data.js +1480 -0
- package/__tests__/integrations/GA4/browser.test.js +94 -0
- package/__tests__/integrations/GA4/utils.test.js +337 -0
- package/__tests__/integrations/GoogleAds/__mocks__/data.js +235 -0
- package/__tests__/integrations/GoogleAds/browser.test.js +202 -0
- package/__tests__/integrations/GoogleAds/utils.test.js +110 -0
- package/__tests__/integrations/LaunchDarkly/__mocks__/data.js +61 -0
- package/__tests__/integrations/LaunchDarkly/browser.test.js +148 -0
- package/__tests__/integrations/LaunchDarkly/utils.test.js +36 -0
- package/__tests__/integrations/Lemnisk/lemnisk.test.js +156 -0
- package/__tests__/integrations/Mixpanel/browser.test.js +60 -0
- package/__tests__/integrations/PinterestTag/__mocks__/data.js +24 -0
- package/__tests__/integrations/PinterestTag/utils.test.js +19 -0
- package/__tests__/integrations/TikTokAds/tiktokads.test.js +231 -0
- package/__tests__/ketchConsent.test.js +49 -0
- package/__tests__/oneTrustCookieConsent.test.js +89 -0
- package/__tests__/script.test.js +167 -0
- package/__tests__/service-worker/__mocks__/fixtures.js +79 -0
- package/__tests__/service-worker/__mocks__/msw.server.js +12 -0
- package/__tests__/service-worker/index.test.js +109 -0
- package/__tests__/transformationHandler.test.js +169 -0
- package/__tests__/utils/IntegrationsData.test.js +105 -0
- package/__tests__/utils/ObjectUtils.test.js +227 -0
- package/__tests__/utils/cdnPaths.test.js +63 -0
- package/__tests__/utils/clientHint.test.js +87 -0
- package/__tests__/utils/commonUtils.test.js +271 -0
- package/__tests__/utils/errorHandler.test.js +60 -0
- package/__tests__/utils/eventProcessorUtils.test.js +266 -0
- package/__tests__/utils/navigator.test.js +38 -0
- package/__tests__/utils/preProcessQueue.test.js +78 -0
- package/__tests__/utils/screenDetails.test.js +19 -0
- package/__tests__/utils/utils.test.js +348 -0
- package/assets/integrations/AdobeAnalytics/adobe-analytics-heartbeat.js +12384 -0
- package/assets/integrations/AdobeAnalytics/adobe-analytics-js.js +5046 -0
- package/babel.config.json +34 -0
- package/commitlint.config.js +3 -0
- package/examples/SampleEventsTest.Html +133 -0
- package/examples/TC/TC_001.js +4 -0
- package/examples/TC/TC_002.js +4 -0
- package/examples/TC/TC_003.js +4 -0
- package/examples/TC/TC_004.js +4 -0
- package/examples/TC/TC_005.js +4 -0
- package/examples/chrome-extension/USAGE.md +131 -0
- package/examples/chrome-extension/background-script/LICENSE +21 -0
- package/examples/chrome-extension/background-script/README.md +101 -0
- package/examples/chrome-extension/background-script/foreground.js +7 -0
- package/examples/chrome-extension/background-script/logo/logo-128.png +0 -0
- package/examples/chrome-extension/background-script/logo/logo-16.png +0 -0
- package/examples/chrome-extension/background-script/logo/logo-48.png +0 -0
- package/examples/chrome-extension/background-script/logo/logo.svg +138 -0
- package/examples/chrome-extension/background-script/manifest.json +37 -0
- package/examples/chrome-extension/background-script/popup/popup.css +11 -0
- package/examples/chrome-extension/background-script/popup/popup.html +11 -0
- package/examples/chrome-extension/background-script/rudderAnalytics.js +5345 -0
- package/examples/chrome-extension/background-script/service-worker.js +32 -0
- package/examples/chrome-extension/background-script/settings/settings.css +8 -0
- package/examples/chrome-extension/background-script/settings/settings.html +12 -0
- package/examples/chrome-extension/background-script-websockets/LICENSE +21 -0
- package/examples/chrome-extension/background-script-websockets/README.md +101 -0
- package/examples/chrome-extension/background-script-websockets/foreground.js +7 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo-128.png +0 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo-16.png +0 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo-48.png +0 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo.svg +138 -0
- package/examples/chrome-extension/background-script-websockets/manifest.json +37 -0
- package/examples/chrome-extension/background-script-websockets/popup/popup.css +11 -0
- package/examples/chrome-extension/background-script-websockets/popup/popup.html +11 -0
- package/{service-worker/index.es.js → examples/chrome-extension/background-script-websockets/rudderAnalytics.js} +1283 -1274
- package/examples/chrome-extension/background-script-websockets/service-worker.js +60 -0
- package/examples/chrome-extension/background-script-websockets/settings/settings.css +8 -0
- package/examples/chrome-extension/background-script-websockets/settings/settings.html +12 -0
- package/examples/chrome-extension/content-script/LICENSE +21 -0
- package/examples/chrome-extension/content-script/README.md +101 -0
- package/examples/chrome-extension/content-script/foreground.js +65 -0
- package/examples/chrome-extension/content-script/logo/logo-128.png +0 -0
- package/examples/chrome-extension/content-script/logo/logo-16.png +0 -0
- package/examples/chrome-extension/content-script/logo/logo-48.png +0 -0
- package/examples/chrome-extension/content-script/logo/logo.svg +138 -0
- package/examples/chrome-extension/content-script/manifest.json +39 -0
- package/examples/chrome-extension/content-script/popup/popup.css +11 -0
- package/examples/chrome-extension/content-script/popup/popup.html +11 -0
- package/examples/chrome-extension/content-script/service-worker-utils.js +17 -0
- package/examples/chrome-extension/content-script/service-worker.js +12 -0
- package/examples/chrome-extension/content-script/settings/settings.css +8 -0
- package/examples/chrome-extension/content-script/settings/settings.html +12 -0
- package/examples/chrome-extension/websocket-server/server.mjs +19 -0
- package/examples/html/autotrack-test.html +96 -0
- package/examples/html/ecomm_test.html +358 -0
- package/examples/html/script-test.html +968 -0
- package/examples/html/segment.html +177 -0
- package/examples/html/test_poster.jpg +0 -0
- package/examples/umd/index.js +11 -0
- package/examples/umd/package.json +42 -0
- package/examples/umd/rollup.config.js +36 -0
- package/examples/umd/tests/test.html +5 -0
- package/examples/v1.1/tc1.html +139 -0
- package/examples/v1.1/tc2.1.html +140 -0
- package/examples/v1.1/tc2.2.html +139 -0
- package/examples/v1.1/tc2.3.html +143 -0
- package/examples/v1.1/tc3.1.html +139 -0
- package/examples/v1.1/tc3.2.html +142 -0
- package/examples/v1.1/tc3.3.html +142 -0
- package/examples/v1.1/tc3.4.html +144 -0
- package/examples/v1.1/tc3.5.html +142 -0
- package/examples/v1.1/tc4.html +142 -0
- package/examples/v1.1/tc5.html +150 -0
- package/github-release.config.js +5 -0
- package/jest/jest.global-setup.js +3 -0
- package/jest/jest.polyfills.js +10 -0
- package/jest/jest.setup-dom.js +49 -0
- package/jest.config.js +196 -0
- package/package.json +198 -39
- package/packages/npm/README.md +125 -0
- package/packages/npm/package.json +50 -0
- package/patches/@segment+localstorage-retry+1.3.0.patch +73 -0
- package/patches/@segment+top-domain+3.0.1.patch +34 -0
- package/public/index.html +136 -0
- package/public/list_integration_sdks.html +390 -0
- package/rollup-configs/rollup.integrations.config.js +29 -0
- package/rollup-configs/rollup.sdk.browser.js +32 -0
- package/rollup-configs/rollup.sdk.npm.js +43 -0
- package/rollup-configs/rollup.utilities.js +120 -0
- package/rollup-configs/rollup.worker.config.js +37 -0
- package/sanity-suite/.babelrc +33 -0
- package/sanity-suite/.env.example +6 -0
- package/sanity-suite/__mocks__/alias1.json +137 -0
- package/sanity-suite/__mocks__/alias2.json +97 -0
- package/sanity-suite/__mocks__/alias5.json +103 -0
- package/sanity-suite/__mocks__/alias6.json +137 -0
- package/sanity-suite/__mocks__/group1.json +120 -0
- package/sanity-suite/__mocks__/group2.json +86 -0
- package/sanity-suite/__mocks__/group4.json +101 -0
- package/sanity-suite/__mocks__/group5.json +67 -0
- package/sanity-suite/__mocks__/group6.json +66 -0
- package/sanity-suite/__mocks__/identify1.json +136 -0
- package/sanity-suite/__mocks__/identify2.json +102 -0
- package/sanity-suite/__mocks__/identify3.json +99 -0
- package/sanity-suite/__mocks__/identify4.json +65 -0
- package/sanity-suite/__mocks__/identify5.json +102 -0
- package/sanity-suite/__mocks__/identify6.json +103 -0
- package/sanity-suite/__mocks__/identify7.json +102 -0
- package/sanity-suite/__mocks__/identify8.json +103 -0
- package/sanity-suite/__mocks__/page1.json +119 -0
- package/sanity-suite/__mocks__/page2.json +86 -0
- package/sanity-suite/__mocks__/page4.json +112 -0
- package/sanity-suite/__mocks__/page5.json +79 -0
- package/sanity-suite/__mocks__/page6.json +77 -0
- package/sanity-suite/__mocks__/page7.json +77 -0
- package/sanity-suite/__mocks__/page8.json +75 -0
- package/sanity-suite/__mocks__/page9.json +155 -0
- package/sanity-suite/__mocks__/sourceConfig1.json +988 -0
- package/sanity-suite/__mocks__/track1.json +150 -0
- package/sanity-suite/__mocks__/track2.json +118 -0
- package/sanity-suite/__mocks__/track4.json +134 -0
- package/sanity-suite/__mocks__/track5.json +102 -0
- package/sanity-suite/__mocks__/track6.json +81 -0
- package/sanity-suite/__mocks__/track7.json +81 -0
- package/sanity-suite/package-lock.json +7951 -0
- package/sanity-suite/package.json +67 -0
- package/sanity-suite/public/eventFiltering/index-cdn.html +112 -0
- package/sanity-suite/public/eventFiltering/index-local.html +109 -0
- package/sanity-suite/public/eventFiltering/index-npm.html +92 -0
- package/sanity-suite/public/index-cdn.html +112 -0
- package/sanity-suite/public/index-local.html +109 -0
- package/sanity-suite/public/index-npm.html +92 -0
- package/sanity-suite/public/preloadBuffer/index-cdn.html +112 -0
- package/sanity-suite/public/preloadBuffer/index-local.html +109 -0
- package/sanity-suite/public/preloadBuffer/index-npm.html +92 -0
- package/sanity-suite/rollup.config.js +199 -0
- package/sanity-suite/src/index-npm.js +65 -0
- package/sanity-suite/src/index.js +5 -0
- package/sanity-suite/src/testBook/ResultAssertions.js +51 -0
- package/sanity-suite/src/testBook/TestBook.js +345 -0
- package/sanity-suite/src/testBook/ignoredProperties.js +150 -0
- package/sanity-suite/src/testBook/index.js +11 -0
- package/sanity-suite/src/testBookSuites/alias.js +287 -0
- package/sanity-suite/src/testBookSuites/group.js +240 -0
- package/sanity-suite/src/testBookSuites/identify.js +455 -0
- package/sanity-suite/src/testBookSuites/index.js +31 -0
- package/sanity-suite/src/testBookSuites/page.js +258 -0
- package/sanity-suite/src/testBookSuites/sourceConfig.js +84 -0
- package/sanity-suite/src/testBookSuites/track.js +451 -0
- package/scripts/integrationBuildScript.js +77 -0
- package/scripts/run_tests.sh +6 -0
- package/src/core/analytics.js +1668 -0
- package/src/features/core/cookieConsent/CookieConsentFactory.js +32 -0
- package/src/features/core/cookieConsent/OneTrust/browser.js +102 -0
- package/src/features/core/cookieConsent/OneTrust/index.js +3 -0
- package/src/features/core/cookieConsent/ketch/browser.js +114 -0
- package/src/features/core/cookieConsent/ketch/index.js +1 -0
- package/src/features/core/deviceModeTransformation/transformationHandler.js +189 -0
- package/src/features/core/deviceModeTransformation/util.js +23 -0
- package/src/features/core/metrics/errorReporting/ErrorReportingService.js +116 -0
- package/src/features/core/metrics/errorReporting/providers/Bugsnag.js +240 -0
- package/src/features/core/session/index.js +207 -0
- package/src/integrations/ActiveCampaign/browser.js +52 -0
- package/src/integrations/ActiveCampaign/constants.js +14 -0
- package/src/integrations/ActiveCampaign/index.js +3 -0
- package/src/integrations/ActiveCampaign/nativeSdkLoader.js +24 -0
- package/src/integrations/AdobeAnalytics/browser.js +276 -0
- package/src/integrations/AdobeAnalytics/constants.js +14 -0
- package/src/integrations/AdobeAnalytics/eCommHandle.js +56 -0
- package/src/integrations/AdobeAnalytics/heartbeatHandle.js +266 -0
- package/src/integrations/AdobeAnalytics/index.js +1 -0
- package/src/integrations/AdobeAnalytics/util.js +678 -0
- package/src/integrations/Adroll/browser.js +125 -0
- package/src/integrations/Adroll/constants.js +10 -0
- package/src/integrations/Adroll/index.js +1 -0
- package/src/integrations/Adroll/util.js +48 -0
- package/src/integrations/Amplitude/browser.js +352 -0
- package/src/integrations/Amplitude/constants.js +9 -0
- package/src/integrations/Amplitude/index.js +1 -0
- package/src/integrations/Amplitude/nativeSdkLoader.js +112 -0
- package/src/integrations/Amplitude/test/test_amplitude.html +157 -0
- package/src/integrations/Amplitude/utils.js +25 -0
- package/src/integrations/Appcues/browser.js +79 -0
- package/src/integrations/Appcues/constants.js +9 -0
- package/src/integrations/Appcues/index.js +1 -0
- package/src/integrations/Axeptio/browser.js +61 -0
- package/src/integrations/Axeptio/constants.js +8 -0
- package/src/integrations/Axeptio/index.js +1 -0
- package/src/integrations/Axeptio/nativeSdkLoader.js +14 -0
- package/src/integrations/Axeptio/utils.js +16 -0
- package/src/integrations/BingAds/browser.js +79 -0
- package/src/integrations/BingAds/constants.js +12 -0
- package/src/integrations/BingAds/index.js +1 -0
- package/src/integrations/BingAds/nativeSdkLoader.js +30 -0
- package/src/integrations/BingAds/utils.js +101 -0
- package/src/integrations/Braze/browser.js +284 -0
- package/src/integrations/Braze/constants.js +11 -0
- package/src/integrations/Braze/index.js +1 -0
- package/src/integrations/Braze/nativeSdkLoader.js +35 -0
- package/src/integrations/Braze/utils.js +51 -0
- package/src/integrations/Bugsnag/browser.js +60 -0
- package/src/integrations/Bugsnag/constants.js +8 -0
- package/src/integrations/Bugsnag/index.js +1 -0
- package/src/integrations/Chartbeat/browser.js +148 -0
- package/src/integrations/Chartbeat/constants.js +10 -0
- package/src/integrations/Chartbeat/index.js +1 -0
- package/src/integrations/Chartbeat/nativeSdkLoader.js +7 -0
- package/src/integrations/Clevertap/browser.js +206 -0
- package/src/integrations/Clevertap/constants.js +8 -0
- package/src/integrations/Clevertap/index.js +1 -0
- package/src/integrations/Comscore/browser.js +130 -0
- package/src/integrations/Comscore/constants.js +11 -0
- package/src/integrations/Comscore/index.js +1 -0
- package/src/integrations/Comscore/nativeSdkLoader.js +10 -0
- package/src/integrations/ConvertFlow/browser.js +59 -0
- package/src/integrations/ConvertFlow/constants.js +15 -0
- package/src/integrations/ConvertFlow/index.js +1 -0
- package/src/integrations/ConvertFlow/utils.js +107 -0
- package/src/integrations/Criteo/browser.js +155 -0
- package/src/integrations/Criteo/constants.js +11 -0
- package/src/integrations/Criteo/index.js +1 -0
- package/src/integrations/Criteo/utils.js +343 -0
- package/src/integrations/CustomerIO/browser.js +74 -0
- package/src/integrations/CustomerIO/constants.js +10 -0
- package/src/integrations/CustomerIO/index.js +1 -0
- package/src/integrations/CustomerIO/nativeSdkLoader.js +31 -0
- package/src/integrations/DCMFloodlight/browser.js +240 -0
- package/src/integrations/DCMFloodlight/constants.js +15 -0
- package/src/integrations/DCMFloodlight/index.js +1 -0
- package/src/integrations/DCMFloodlight/utils.js +336 -0
- package/src/integrations/Drip/browser.js +169 -0
- package/src/integrations/Drip/constants.js +8 -0
- package/src/integrations/Drip/index.js +1 -0
- package/src/integrations/Drip/nativeSdkLoader.js +10 -0
- package/src/integrations/Drip/utils.js +29 -0
- package/src/integrations/Engage/browser.js +124 -0
- package/src/integrations/Engage/constants.js +16 -0
- package/src/integrations/Engage/index.js +1 -0
- package/src/integrations/Engage/nativeSdkLoader.js +25 -0
- package/src/integrations/Engage/utils.js +69 -0
- package/src/integrations/FacebookPixel/browser.js +313 -0
- package/src/integrations/FacebookPixel/constants.js +77 -0
- package/src/integrations/FacebookPixel/index.js +1 -0
- package/src/integrations/FacebookPixel/utils.js +310 -0
- package/src/integrations/Fullstory/browser.js +169 -0
- package/src/integrations/Fullstory/constants.js +13 -0
- package/src/integrations/Fullstory/index.js +1 -0
- package/src/integrations/Fullstory/nativeSdkLoader.js +69 -0
- package/src/integrations/GA/browser.js +816 -0
- package/src/integrations/GA/constants.js +10 -0
- package/src/integrations/GA/index.js +1 -0
- package/src/integrations/GA/index.test.js +184 -0
- package/src/integrations/GA360/browser.js +58 -0
- package/src/integrations/GA360/constants.js +14 -0
- package/src/integrations/GA360/index.js +1 -0
- package/src/integrations/GA4/browser.js +264 -0
- package/src/integrations/GA4/config.js +296 -0
- package/src/integrations/GA4/constants.js +15 -0
- package/src/integrations/GA4/index.js +1 -0
- package/src/integrations/GA4/utils.js +329 -0
- package/src/integrations/GoogleAds/browser.js +212 -0
- package/src/integrations/GoogleAds/constants.js +11 -0
- package/src/integrations/GoogleAds/index.js +1 -0
- package/src/integrations/GoogleAds/nativeSdkLoader.js +26 -0
- package/src/integrations/GoogleAds/utils.js +117 -0
- package/src/integrations/GoogleOptimize/browser.js +79 -0
- package/src/integrations/GoogleOptimize/constants.js +13 -0
- package/src/integrations/GoogleOptimize/index.js +1 -0
- package/src/integrations/GoogleTagManager/browser.js +95 -0
- package/src/integrations/GoogleTagManager/constants.js +10 -0
- package/src/integrations/GoogleTagManager/index.js +1 -0
- package/src/integrations/GoogleTagManager/nativeSdkLoader.js +21 -0
- package/src/integrations/Heap/browser.js +67 -0
- package/src/integrations/Heap/constants.js +9 -0
- package/src/integrations/Heap/index.js +1 -0
- package/src/integrations/Heap/nativeSdkLoader.js +40 -0
- package/src/integrations/Heap/util.js +23 -0
- package/src/integrations/Hotjar/browser.js +86 -0
- package/src/integrations/Hotjar/constants.js +10 -0
- package/src/integrations/Hotjar/index.js +1 -0
- package/src/integrations/Hotjar/nativeSdkLoader.js +21 -0
- package/src/integrations/HubSpot/browser.js +96 -0
- package/src/integrations/HubSpot/constants.js +11 -0
- package/src/integrations/HubSpot/index.js +1 -0
- package/src/integrations/INTERCOM/browser.js +107 -0
- package/src/integrations/INTERCOM/constants.js +8 -0
- package/src/integrations/INTERCOM/index.js +1 -0
- package/src/integrations/INTERCOM/nativeSdkLoader.js +46 -0
- package/src/integrations/INTERCOM/utils.js +68 -0
- package/src/integrations/Iterable/browser.js +185 -0
- package/src/integrations/Iterable/constants.js +8 -0
- package/src/integrations/Iterable/index.js +1 -0
- package/src/integrations/Iterable/utils.js +111 -0
- package/src/integrations/June/browser.js +98 -0
- package/src/integrations/June/constants.js +8 -0
- package/src/integrations/June/index.js +1 -0
- package/src/integrations/Keen/browser.js +153 -0
- package/src/integrations/Keen/constants.js +10 -0
- package/src/integrations/Keen/index.js +1 -0
- package/src/integrations/Kissmetrics/browser.js +254 -0
- package/src/integrations/Kissmetrics/constants.js +8 -0
- package/src/integrations/Kissmetrics/index.js +1 -0
- package/src/integrations/Kissmetrics/nativeSdkLoader.js +23 -0
- package/src/integrations/Klaviyo/browser.js +195 -0
- package/src/integrations/Klaviyo/constants.js +8 -0
- package/src/integrations/Klaviyo/index.js +1 -0
- package/src/integrations/Klaviyo/util.js +91 -0
- package/src/integrations/LaunchDarkly/browser.js +74 -0
- package/src/integrations/LaunchDarkly/constants.js +11 -0
- package/src/integrations/LaunchDarkly/index.js +1 -0
- package/src/integrations/LaunchDarkly/utils.js +24 -0
- package/src/integrations/Lemnisk/browser.js +85 -0
- package/src/integrations/Lemnisk/constants.js +13 -0
- package/src/integrations/Lemnisk/index.js +1 -0
- package/src/integrations/Lemnisk/nativeSdkLoader.js +34 -0
- package/src/integrations/LinkedInInsightTag/browser.js +71 -0
- package/src/integrations/LinkedInInsightTag/constants.js +16 -0
- package/src/integrations/LinkedInInsightTag/index.js +1 -0
- package/src/integrations/LiveChat/browser.js +82 -0
- package/src/integrations/LiveChat/constants.js +12 -0
- package/src/integrations/LiveChat/index.js +1 -0
- package/src/integrations/LiveChat/nativeSdkLoader.js +40 -0
- package/src/integrations/LiveChat/util.js +71 -0
- package/src/integrations/Lotame/LotameStorage.js +21 -0
- package/src/integrations/Lotame/browser.js +172 -0
- package/src/integrations/Lotame/constants.js +8 -0
- package/src/integrations/Lotame/index.js +1 -0
- package/src/integrations/Lytics/browser.js +87 -0
- package/src/integrations/Lytics/constants.js +8 -0
- package/src/integrations/Lytics/index.js +1 -0
- package/src/integrations/Lytics/nativeSdkLoader.js +77 -0
- package/src/integrations/Lytics/test/script-test-lytics.html +250 -0
- package/src/integrations/Matomo/browser.js +188 -0
- package/src/integrations/Matomo/constants.js +8 -0
- package/src/integrations/Matomo/index.js +1 -0
- package/src/integrations/Matomo/nativeSdkLoader.js +20 -0
- package/src/integrations/Matomo/util.js +417 -0
- package/src/integrations/MicrosoftClarity/browser.js +70 -0
- package/src/integrations/MicrosoftClarity/constants.js +14 -0
- package/src/integrations/MicrosoftClarity/index.js +1 -0
- package/src/integrations/MicrosoftClarity/nativeSdkLoader.js +22 -0
- package/src/integrations/Mixpanel/browser.js +326 -0
- package/src/integrations/Mixpanel/constants.js +11 -0
- package/src/integrations/Mixpanel/index.js +1 -0
- package/src/integrations/Mixpanel/nativeSdkLoader.js +71 -0
- package/src/integrations/Mixpanel/util.js +178 -0
- package/src/integrations/MoEngage/browser.js +133 -0
- package/src/integrations/MoEngage/constants.js +12 -0
- package/src/integrations/MoEngage/index.js +1 -0
- package/src/integrations/MoEngage/nativeSdkLoader.js +66 -0
- package/src/integrations/MoEngage/test/script-test-moengage.html +216 -0
- package/src/integrations/Mouseflow/browser.js +98 -0
- package/src/integrations/Mouseflow/constants.js +14 -0
- package/src/integrations/Mouseflow/index.js +1 -0
- package/src/integrations/Mouseflow/utils.js +27 -0
- package/src/integrations/Olark/browser.js +94 -0
- package/src/integrations/Olark/constants.js +8 -0
- package/src/integrations/Olark/index.js +1 -0
- package/src/integrations/Olark/nativeSdkLoader.js +31 -0
- package/src/integrations/Olark/utils.js +51 -0
- package/src/integrations/Optimizely/browser.js +230 -0
- package/src/integrations/Optimizely/constants.js +8 -0
- package/src/integrations/Optimizely/index.js +1 -0
- package/src/integrations/Optimizely/utils.js +23 -0
- package/src/integrations/Pendo/browser.js +119 -0
- package/src/integrations/Pendo/constants.js +8 -0
- package/src/integrations/Pendo/index.js +1 -0
- package/src/integrations/Pendo/nativeSdkLoader.js +32 -0
- package/src/integrations/PinterestTag/browser.js +241 -0
- package/src/integrations/PinterestTag/constants.js +19 -0
- package/src/integrations/PinterestTag/index.js +1 -0
- package/src/integrations/PinterestTag/nativeSdkLoader.js +19 -0
- package/src/integrations/PinterestTag/propertyMappingConfig.js +57 -0
- package/src/integrations/PinterestTag/test/input.js +180 -0
- package/src/integrations/PinterestTag/test/output.js +129 -0
- package/src/integrations/PinterestTag/utils.js +47 -0
- package/src/integrations/Podsights/browser.js +178 -0
- package/src/integrations/Podsights/constants.js +206 -0
- package/src/integrations/Podsights/index.js +1 -0
- package/src/integrations/Podsights/utils.js +65 -0
- package/src/integrations/PostAffiliatePro/browser.js +133 -0
- package/src/integrations/PostAffiliatePro/constants.js +13 -0
- package/src/integrations/PostAffiliatePro/index.js +1 -0
- package/src/integrations/PostAffiliatePro/utils.js +40 -0
- package/src/integrations/Posthog/browser.js +154 -0
- package/src/integrations/Posthog/constants.js +12 -0
- package/src/integrations/Posthog/index.js +1 -0
- package/src/integrations/Posthog/nativeSdkLoader.js +48 -0
- package/src/integrations/Posthog/test/test_posthog.html +77 -0
- package/src/integrations/Posthog/utils.js +36 -0
- package/src/integrations/ProfitWell/browser.js +72 -0
- package/src/integrations/ProfitWell/constants.js +12 -0
- package/src/integrations/ProfitWell/index.js +1 -0
- package/src/integrations/ProfitWell/nativeSdkLoader.js +25 -0
- package/src/integrations/Qualaroo/browser.js +116 -0
- package/src/integrations/Qualaroo/constants.js +8 -0
- package/src/integrations/Qualaroo/index.js +1 -0
- package/src/integrations/Qualaroo/utils.js +83 -0
- package/src/integrations/Qualtrics/browser.js +89 -0
- package/src/integrations/Qualtrics/constants.js +8 -0
- package/src/integrations/Qualtrics/index.js +1 -0
- package/src/integrations/Qualtrics/nativeSdkLoader.js +79 -0
- package/src/integrations/QuantumMetric/browser.js +63 -0
- package/src/integrations/QuantumMetric/constants.js +13 -0
- package/src/integrations/QuantumMetric/index.js +1 -0
- package/src/integrations/QuoraPixel/browser.js +64 -0
- package/src/integrations/QuoraPixel/constants.js +15 -0
- package/src/integrations/QuoraPixel/index.js +1 -0
- package/src/integrations/QuoraPixel/nativeSdkLoader.js +21 -0
- package/src/integrations/RedditPixel/browser.js +98 -0
- package/src/integrations/RedditPixel/constants.js +13 -0
- package/src/integrations/RedditPixel/index.js +1 -0
- package/src/integrations/RedditPixel/nativeSdkLoader.js +21 -0
- package/src/integrations/Refiner/browser.js +119 -0
- package/src/integrations/Refiner/constants.js +8 -0
- package/src/integrations/Refiner/index.js +1 -0
- package/src/integrations/Refiner/nativeSdkLoader.js +20 -0
- package/src/integrations/Refiner/utils.js +44 -0
- package/src/integrations/Rockerbox/browser.js +89 -0
- package/src/integrations/Rockerbox/constants.js +12 -0
- package/src/integrations/Rockerbox/index.js +1 -0
- package/src/integrations/Rockerbox/nativeSdkLoader.js +32 -0
- package/src/integrations/RollBar/browser.js +92 -0
- package/src/integrations/RollBar/constants.js +13 -0
- package/src/integrations/RollBar/index.js +1 -0
- package/src/integrations/RollBar/nativeSdkLoader.js +383 -0
- package/src/integrations/Satismeter/browser.js +94 -0
- package/src/integrations/Satismeter/constants.js +9 -0
- package/src/integrations/Satismeter/index.js +1 -0
- package/src/integrations/Satismeter/nativeSdkLoader.js +23 -0
- package/src/integrations/Satismeter/util.js +54 -0
- package/src/integrations/Sendinblue/browser.js +111 -0
- package/src/integrations/Sendinblue/constants.js +25 -0
- package/src/integrations/Sendinblue/index.js +1 -0
- package/src/integrations/Sendinblue/nativeSdkLoader.js +36 -0
- package/src/integrations/Sendinblue/utils.js +112 -0
- package/src/integrations/Sentry/browser.js +118 -0
- package/src/integrations/Sentry/constants.js +8 -0
- package/src/integrations/Sentry/index.js +1 -0
- package/src/integrations/Sentry/utils.js +80 -0
- package/src/integrations/Shynet/browser.js +97 -0
- package/src/integrations/Shynet/constants.js +15 -0
- package/src/integrations/Shynet/index.js +1 -0
- package/src/integrations/SnapEngage/browser.js +75 -0
- package/src/integrations/SnapEngage/constants.js +12 -0
- package/src/integrations/SnapEngage/index.js +1 -0
- package/src/integrations/SnapEngage/nativeSdkLoader.js +24 -0
- package/src/integrations/SnapEngage/util.js +63 -0
- package/src/integrations/SnapPixel/browser.js +232 -0
- package/src/integrations/SnapPixel/constants.js +13 -0
- package/src/integrations/SnapPixel/index.js +1 -0
- package/src/integrations/SnapPixel/nativeSdkLoader.js +20 -0
- package/src/integrations/SnapPixel/util.js +211 -0
- package/src/integrations/TVSquared/browser.js +96 -0
- package/src/integrations/TVSquared/constants.js +14 -0
- package/src/integrations/TVSquared/index.js +1 -0
- package/src/integrations/TVSquared/utils.js +40 -0
- package/src/integrations/TiktokAds/browser.js +103 -0
- package/src/integrations/TiktokAds/constants.js +86 -0
- package/src/integrations/TiktokAds/index.js +1 -0
- package/src/integrations/TiktokAds/nativeSdkLoader.js +52 -0
- package/src/integrations/TiktokAds/util.js +71 -0
- package/src/integrations/VWO/browser.js +131 -0
- package/src/integrations/VWO/constants.js +13 -0
- package/src/integrations/VWO/index.js +1 -0
- package/src/integrations/VWO/nativeSdkLoader.js +64 -0
- package/src/integrations/Vero/browser.js +165 -0
- package/src/integrations/Vero/constants.js +8 -0
- package/src/integrations/Vero/index.js +1 -0
- package/src/integrations/Woopra/browser.js +83 -0
- package/src/integrations/Woopra/constants.js +8 -0
- package/src/integrations/Woopra/index.js +1 -0
- package/src/integrations/Woopra/nativeSdkLoader.js +43 -0
- package/src/integrations/YandexMetrica/browser.js +143 -0
- package/src/integrations/YandexMetrica/constants.js +10 -0
- package/src/integrations/YandexMetrica/index.js +1 -0
- package/src/integrations/YandexMetrica/nativeSdkLoader.js +35 -0
- package/src/integrations/YandexMetrica/utils.js +138 -0
- package/src/integrations/index.js +155 -0
- package/src/service-worker/index.js +466 -0
- package/src/utils/EventRepository.js +78 -0
- package/src/utils/HtElement.js +33 -0
- package/src/utils/HtElementBuilder.js +29 -0
- package/src/utils/IntegrationsData.js +61 -0
- package/src/utils/JSFileLoader.js +66 -0
- package/src/utils/ObjectUtils.js +68 -0
- package/src/utils/PreProcessQueue.js +66 -0
- package/src/utils/RudderApp.js +9 -0
- package/src/utils/RudderContext.js +21 -0
- package/src/utils/RudderInfo.js +41 -0
- package/src/utils/RudderMessage.js +28 -0
- package/src/utils/ScriptLoader.js +53 -0
- package/src/utils/beaconQueue.js +133 -0
- package/src/utils/camelcase.js +48 -0
- package/src/utils/cdnPaths.js +43 -0
- package/src/utils/clientHint.js +28 -0
- package/src/utils/client_server_name.js +78 -0
- package/src/utils/commonUtils.js +207 -0
- package/src/utils/config_to_integration_names.js +80 -0
- package/src/utils/constants.js +82 -0
- package/src/utils/errorHandler.js +88 -0
- package/src/utils/eventProcessorUtils.js +53 -0
- package/src/utils/integration_cname.js +156 -0
- package/src/utils/linker/base64decoder.js +31 -0
- package/src/utils/linker/crc32.js +42 -0
- package/src/utils/linker/index.js +134 -0
- package/src/utils/linker/userLib.js +20 -0
- package/src/utils/logUtil.js +51 -0
- package/src/utils/logger.js +106 -0
- package/src/utils/navigator.js +32 -0
- package/src/utils/notifyError.js +16 -0
- package/src/utils/pageProperties.js +74 -0
- package/src/utils/screenDetails.js +23 -0
- package/src/utils/storage/cookie.js +93 -0
- package/src/utils/storage/index.js +3 -0
- package/src/utils/storage/storage.js +459 -0
- package/src/utils/storage/store.js +72 -0
- package/src/utils/storage/v3DecryptionUtils.js +19 -0
- package/src/utils/utils.js +966 -0
- package/src/utils/xhrModule.js +111 -0
- package/stats/AdobeAnalytics.html +4044 -0
- package/stats/Adroll.html +4044 -0
- package/stats/Amplitude.html +4044 -0
- package/stats/Appcues.html +4044 -0
- package/stats/BingAds.html +4044 -0
- package/stats/Braze.html +4044 -0
- package/stats/Bugsnag.html +4044 -0
- package/stats/Chartbeat.html +4044 -0
- package/stats/Clevertap.html +4044 -0
- package/stats/Comscore.html +4044 -0
- package/stats/ConvertFlow.html +4044 -0
- package/stats/Criteo.html +4044 -0
- package/stats/CustomerIO.html +4044 -0
- package/stats/DCMFloodlight.html +4044 -0
- package/stats/Drip.html +4044 -0
- package/stats/Engage.html +4044 -0
- package/stats/FacebookPixel.html +4044 -0
- package/stats/Fullstory.html +4044 -0
- package/stats/GA.html +4044 -0
- package/stats/GA360.html +4044 -0
- package/stats/GA4.html +4044 -0
- package/stats/GoogleAds.html +4044 -0
- package/stats/GoogleOptimize.html +4044 -0
- package/stats/GoogleTagManager.html +4044 -0
- package/stats/Heap.html +4044 -0
- package/stats/Hotjar.html +4044 -0
- package/stats/HubSpot.html +4044 -0
- package/stats/INTERCOM.html +4044 -0
- package/stats/Iterable.html +4044 -0
- package/stats/June.html +4044 -0
- package/stats/Keen.html +4044 -0
- package/stats/Kissmetrics.html +4044 -0
- package/stats/Klaviyo.html +4044 -0
- package/stats/LaunchDarkly.html +4044 -0
- package/stats/LinkedInInsightTag.html +4044 -0
- package/stats/LiveChat.html +4044 -0
- package/stats/Lotame.html +4044 -0
- package/stats/Lytics.html +4044 -0
- package/stats/Matomo.html +4044 -0
- package/stats/Mixpanel.html +4044 -0
- package/stats/MoEngage.html +4044 -0
- package/stats/Mouseflow.html +4044 -0
- package/stats/Optimizely.html +4044 -0
- package/stats/Pendo.html +4044 -0
- package/stats/PinterestTag.html +4044 -0
- package/stats/Podsights.html +4044 -0
- package/stats/PostAffiliatePro.html +4044 -0
- package/stats/Posthog.html +4044 -0
- package/stats/ProfitWell.html +4044 -0
- package/stats/Qualaroo.html +4044 -0
- package/stats/Qualtrics.html +4044 -0
- package/stats/QuantumMetric.html +4044 -0
- package/stats/QuoraPixel.html +4044 -0
- package/stats/RedditPixel.html +4044 -0
- package/stats/Refiner.html +4044 -0
- package/stats/Rockerbox.html +4044 -0
- package/stats/RollBar.html +4044 -0
- package/stats/Sentry.html +4044 -0
- package/stats/Shynet.html +4044 -0
- package/stats/SnapEngage.html +4044 -0
- package/stats/SnapPixel.html +4044 -0
- package/stats/TVSquared.html +4044 -0
- package/stats/VWO.html +4044 -0
- package/stats/Vero.html +4044 -0
- package/stats/Woopra.html +4044 -0
- package/stats/YandexMetrica.html +4044 -0
- package/stats/rudder-analytics.html +4044 -0
- package/index.es.js +0 -1
- package/index.js +0 -1
- package/service-worker/index.js +0 -5346
- /package/{index.d.ts → packages/npm/index.d.ts} +0 -0
- /package/{service-worker → src/service-worker}/index.d.ts +0 -0
@@ -426,74 +426,74 @@ function _toPropertyKey(arg) {
|
|
426
426
|
|
427
427
|
var global$1 = (typeof global !== "undefined" ? global :
|
428
428
|
typeof self !== "undefined" ? self :
|
429
|
-
|
429
|
+
typeof window !== "undefined" ? window : {});
|
430
430
|
|
431
431
|
// shim for using process in browser
|
432
432
|
// based off https://github.com/defunctzombie/node-process/blob/master/browser.js
|
433
433
|
|
434
434
|
function defaultSetTimout() {
|
435
|
-
|
435
|
+
throw new Error('setTimeout has not been defined');
|
436
436
|
}
|
437
437
|
function defaultClearTimeout () {
|
438
|
-
|
438
|
+
throw new Error('clearTimeout has not been defined');
|
439
439
|
}
|
440
440
|
var cachedSetTimeout = defaultSetTimout;
|
441
441
|
var cachedClearTimeout = defaultClearTimeout;
|
442
442
|
if (typeof global$1.setTimeout === 'function') {
|
443
|
-
|
443
|
+
cachedSetTimeout = setTimeout;
|
444
444
|
}
|
445
445
|
if (typeof global$1.clearTimeout === 'function') {
|
446
|
-
|
446
|
+
cachedClearTimeout = clearTimeout;
|
447
447
|
}
|
448
448
|
|
449
449
|
function runTimeout(fun) {
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
450
|
+
if (cachedSetTimeout === setTimeout) {
|
451
|
+
//normal enviroments in sane situations
|
452
|
+
return setTimeout(fun, 0);
|
453
|
+
}
|
454
|
+
// if setTimeout wasn't available but was latter defined
|
455
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
456
|
+
cachedSetTimeout = setTimeout;
|
457
|
+
return setTimeout(fun, 0);
|
458
|
+
}
|
459
|
+
try {
|
460
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
461
|
+
return cachedSetTimeout(fun, 0);
|
462
|
+
} catch(e){
|
459
463
|
try {
|
460
|
-
|
461
|
-
|
464
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
465
|
+
return cachedSetTimeout.call(null, fun, 0);
|
462
466
|
} catch(e){
|
463
|
-
|
464
|
-
|
465
|
-
return cachedSetTimeout.call(null, fun, 0);
|
466
|
-
} catch(e){
|
467
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
468
|
-
return cachedSetTimeout.call(this, fun, 0);
|
469
|
-
}
|
467
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
468
|
+
return cachedSetTimeout.call(this, fun, 0);
|
470
469
|
}
|
470
|
+
}
|
471
471
|
|
472
472
|
|
473
473
|
}
|
474
474
|
function runClearTimeout(marker) {
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
475
|
+
if (cachedClearTimeout === clearTimeout) {
|
476
|
+
//normal enviroments in sane situations
|
477
|
+
return clearTimeout(marker);
|
478
|
+
}
|
479
|
+
// if clearTimeout wasn't available but was latter defined
|
480
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
481
|
+
cachedClearTimeout = clearTimeout;
|
482
|
+
return clearTimeout(marker);
|
483
|
+
}
|
484
|
+
try {
|
485
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
486
|
+
return cachedClearTimeout(marker);
|
487
|
+
} catch (e){
|
484
488
|
try {
|
485
|
-
|
486
|
-
|
489
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
490
|
+
return cachedClearTimeout.call(null, marker);
|
487
491
|
} catch (e){
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
} catch (e){
|
492
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
493
|
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
494
|
-
return cachedClearTimeout.call(this, marker);
|
495
|
-
}
|
492
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
493
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
494
|
+
return cachedClearTimeout.call(this, marker);
|
496
495
|
}
|
496
|
+
}
|
497
497
|
|
498
498
|
|
499
499
|
|
@@ -504,62 +504,62 @@ var currentQueue;
|
|
504
504
|
var queueIndex = -1;
|
505
505
|
|
506
506
|
function cleanUpNextTick() {
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
507
|
+
if (!draining || !currentQueue) {
|
508
|
+
return;
|
509
|
+
}
|
510
|
+
draining = false;
|
511
|
+
if (currentQueue.length) {
|
512
|
+
queue = currentQueue.concat(queue);
|
513
|
+
} else {
|
514
|
+
queueIndex = -1;
|
515
|
+
}
|
516
|
+
if (queue.length) {
|
517
|
+
drainQueue();
|
518
|
+
}
|
519
519
|
}
|
520
520
|
|
521
521
|
function drainQueue() {
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
}
|
537
|
-
queueIndex = -1;
|
538
|
-
len = queue.length;
|
522
|
+
if (draining) {
|
523
|
+
return;
|
524
|
+
}
|
525
|
+
var timeout = runTimeout(cleanUpNextTick);
|
526
|
+
draining = true;
|
527
|
+
|
528
|
+
var len = queue.length;
|
529
|
+
while(len) {
|
530
|
+
currentQueue = queue;
|
531
|
+
queue = [];
|
532
|
+
while (++queueIndex < len) {
|
533
|
+
if (currentQueue) {
|
534
|
+
currentQueue[queueIndex].run();
|
535
|
+
}
|
539
536
|
}
|
540
|
-
|
541
|
-
|
542
|
-
|
537
|
+
queueIndex = -1;
|
538
|
+
len = queue.length;
|
539
|
+
}
|
540
|
+
currentQueue = null;
|
541
|
+
draining = false;
|
542
|
+
runClearTimeout(timeout);
|
543
543
|
}
|
544
544
|
function nextTick(fun) {
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
}
|
550
|
-
}
|
551
|
-
queue.push(new Item(fun, args));
|
552
|
-
if (queue.length === 1 && !draining) {
|
553
|
-
runTimeout(drainQueue);
|
545
|
+
var args = new Array(arguments.length - 1);
|
546
|
+
if (arguments.length > 1) {
|
547
|
+
for (var i = 1; i < arguments.length; i++) {
|
548
|
+
args[i - 1] = arguments[i];
|
554
549
|
}
|
550
|
+
}
|
551
|
+
queue.push(new Item(fun, args));
|
552
|
+
if (queue.length === 1 && !draining) {
|
553
|
+
runTimeout(drainQueue);
|
554
|
+
}
|
555
555
|
}
|
556
556
|
// v8 likes predictible objects
|
557
557
|
function Item(fun, array) {
|
558
|
-
|
559
|
-
|
558
|
+
this.fun = fun;
|
559
|
+
this.array = array;
|
560
560
|
}
|
561
561
|
Item.prototype.run = function () {
|
562
|
-
|
562
|
+
this.fun.apply(null, this.array);
|
563
563
|
};
|
564
564
|
var title = 'browser';
|
565
565
|
var platform = 'browser';
|
@@ -582,12 +582,12 @@ var removeAllListeners = noop$1;
|
|
582
582
|
var emit = noop$1;
|
583
583
|
|
584
584
|
function binding(name) {
|
585
|
-
|
585
|
+
throw new Error('process.binding is not supported');
|
586
586
|
}
|
587
587
|
|
588
588
|
function cwd () { return '/' }
|
589
589
|
function chdir (dir) {
|
590
|
-
|
590
|
+
throw new Error('process.chdir is not supported');
|
591
591
|
}function umask() { return 0; }
|
592
592
|
|
593
593
|
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
@@ -985,7 +985,7 @@ if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
985
985
|
Buffer.prototype.__proto__ = Uint8Array.prototype;
|
986
986
|
Buffer.__proto__ = Uint8Array;
|
987
987
|
if (typeof Symbol !== 'undefined' && Symbol.species &&
|
988
|
-
|
988
|
+
Buffer[Symbol.species] === Buffer) ;
|
989
989
|
}
|
990
990
|
|
991
991
|
function assertSize (size) {
|
@@ -1122,7 +1122,7 @@ function fromObject (that, obj) {
|
|
1122
1122
|
|
1123
1123
|
if (obj) {
|
1124
1124
|
if ((typeof ArrayBuffer !== 'undefined' &&
|
1125
|
-
|
1125
|
+
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
|
1126
1126
|
if (typeof obj.length !== 'number' || isnan(obj.length)) {
|
1127
1127
|
return createBuffer(that, 0)
|
1128
1128
|
}
|
@@ -1142,7 +1142,7 @@ function checked (length) {
|
|
1142
1142
|
// length is NaN (which is otherwise coerced to zero.)
|
1143
1143
|
if (length >= kMaxLength()) {
|
1144
1144
|
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
|
1145
|
-
|
1145
|
+
'size: 0x' + kMaxLength().toString(16) + ' bytes')
|
1146
1146
|
}
|
1147
1147
|
return length | 0
|
1148
1148
|
}
|
@@ -1228,7 +1228,7 @@ function byteLength (string, encoding) {
|
|
1228
1228
|
return string.length
|
1229
1229
|
}
|
1230
1230
|
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
|
1231
|
-
|
1231
|
+
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
|
1232
1232
|
return string.byteLength
|
1233
1233
|
}
|
1234
1234
|
if (typeof string !== 'string') {
|
@@ -1520,7 +1520,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
|
|
1520
1520
|
} else if (typeof val === 'number') {
|
1521
1521
|
val = val & 0xFF; // Search for a byte value [0-255]
|
1522
1522
|
if (Buffer.TYPED_ARRAY_SUPPORT &&
|
1523
|
-
|
1523
|
+
typeof Uint8Array.prototype.indexOf === 'function') {
|
1524
1524
|
if (dir) {
|
1525
1525
|
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
|
1526
1526
|
} else {
|
@@ -1541,7 +1541,7 @@ function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
|
|
1541
1541
|
if (encoding !== undefined) {
|
1542
1542
|
encoding = String(encoding).toLowerCase();
|
1543
1543
|
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
|
1544
|
-
|
1544
|
+
encoding === 'utf16le' || encoding === 'utf-16le') {
|
1545
1545
|
if (arr.length < 2 || val.length < 2) {
|
1546
1546
|
return -1
|
1547
1547
|
}
|
@@ -1654,12 +1654,12 @@ Buffer.prototype.write = function write (string, offset, length, encoding) {
|
|
1654
1654
|
encoding = 'utf8';
|
1655
1655
|
length = this.length;
|
1656
1656
|
offset = 0;
|
1657
|
-
|
1657
|
+
// Buffer#write(string, encoding)
|
1658
1658
|
} else if (length === undefined && typeof offset === 'string') {
|
1659
1659
|
encoding = offset;
|
1660
1660
|
length = this.length;
|
1661
1661
|
offset = 0;
|
1662
|
-
|
1662
|
+
// Buffer#write(string, offset[, length][, encoding])
|
1663
1663
|
} else if (isFinite(offset)) {
|
1664
1664
|
offset = offset | 0;
|
1665
1665
|
if (isFinite(length)) {
|
@@ -1669,7 +1669,7 @@ Buffer.prototype.write = function write (string, offset, length, encoding) {
|
|
1669
1669
|
encoding = length;
|
1670
1670
|
length = undefined;
|
1671
1671
|
}
|
1672
|
-
|
1672
|
+
// legacy write(string, encoding, offset, length) - remove in v0.13
|
1673
1673
|
} else {
|
1674
1674
|
throw new Error(
|
1675
1675
|
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
|
@@ -1745,8 +1745,8 @@ function utf8Slice (buf, start, end) {
|
|
1745
1745
|
var codePoint = null;
|
1746
1746
|
var bytesPerSequence = (firstByte > 0xEF) ? 4
|
1747
1747
|
: (firstByte > 0xDF) ? 3
|
1748
|
-
|
1749
|
-
|
1748
|
+
: (firstByte > 0xBF) ? 2
|
1749
|
+
: 1;
|
1750
1750
|
|
1751
1751
|
if (i + bytesPerSequence <= end) {
|
1752
1752
|
var secondByte, thirdByte, fourthByte, tempCodePoint;
|
@@ -1969,7 +1969,7 @@ Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
|
|
1969
1969
|
return ((this[offset]) |
|
1970
1970
|
(this[offset + 1] << 8) |
|
1971
1971
|
(this[offset + 2] << 16)) +
|
1972
|
-
|
1972
|
+
(this[offset + 3] * 0x1000000)
|
1973
1973
|
};
|
1974
1974
|
|
1975
1975
|
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
|
@@ -1977,8 +1977,8 @@ Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
|
|
1977
1977
|
|
1978
1978
|
return (this[offset] * 0x1000000) +
|
1979
1979
|
((this[offset + 1] << 16) |
|
1980
|
-
|
1981
|
-
|
1980
|
+
(this[offset + 2] << 8) |
|
1981
|
+
this[offset + 3])
|
1982
1982
|
};
|
1983
1983
|
|
1984
1984
|
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
|
@@ -2628,35 +2628,35 @@ function isSlowBuffer (obj) {
|
|
2628
2628
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
2629
2629
|
|
2630
2630
|
function getDefaultExportFromCjs (x) {
|
2631
|
-
|
2631
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
2632
2632
|
}
|
2633
2633
|
|
2634
2634
|
function getAugmentedNamespace(n) {
|
2635
2635
|
if (n.__esModule) return n;
|
2636
2636
|
var f = n.default;
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2637
|
+
if (typeof f == "function") {
|
2638
|
+
var a = function a () {
|
2639
|
+
if (this instanceof a) {
|
2640
|
+
var args = [null];
|
2641
|
+
args.push.apply(args, arguments);
|
2642
|
+
var Ctor = Function.bind.apply(f, args);
|
2643
|
+
return new Ctor();
|
2644
|
+
}
|
2645
|
+
return f.apply(this, arguments);
|
2646
|
+
};
|
2647
|
+
a.prototype = f.prototype;
|
2648
2648
|
} else a = {};
|
2649
2649
|
Object.defineProperty(a, '__esModule', {value: true});
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2650
|
+
Object.keys(n).forEach(function (k) {
|
2651
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
2652
|
+
Object.defineProperty(a, k, d.get ? d : {
|
2653
|
+
enumerable: true,
|
2654
|
+
get: function () {
|
2655
|
+
return n[k];
|
2656
|
+
}
|
2657
|
+
});
|
2658
|
+
});
|
2659
|
+
return a;
|
2660
2660
|
}
|
2661
2661
|
|
2662
2662
|
var toString$1=Object.prototype.toString;/**
|
@@ -2667,7 +2667,7 @@ var toString$1=Object.prototype.toString;/**
|
|
2667
2667
|
* @api public
|
2668
2668
|
*/var componentType=function componentType(val){switch(toString$1.call(val)){case'[object Date]':return 'date';case'[object RegExp]':return 'regexp';case'[object Arguments]':return 'arguments';case'[object Array]':return 'array';case'[object Error]':return 'error';}if(val===null)return 'null';if(val===undefined)return 'undefined';if(val!==val)return 'nan';if(val&&val.nodeType===1)return 'element';if(isBuffer$1(val))return 'buffer';val=val.valueOf?val.valueOf():Object.prototype.valueOf.apply(val);return _typeof(val);};// code borrowed from https://github.com/feross/is-buffer/blob/master/index.js
|
2669
2669
|
function isBuffer$1(obj){return !!(obj!=null&&(obj._isBuffer||// For Safari 5-7 (missing Object.prototype.constructor)
|
2670
|
-
obj.constructor&&typeof obj.constructor.isBuffer==='function'&&obj.constructor.isBuffer(obj)));}
|
2670
|
+
obj.constructor&&typeof obj.constructor.isBuffer==='function'&&obj.constructor.isBuffer(obj)));}
|
2671
2671
|
|
2672
2672
|
/**
|
2673
2673
|
* Join `arr` with the trailing `str` defaulting to "and",
|
@@ -2774,7 +2774,7 @@ function stylizeWithColor(str, styleType) {
|
|
2774
2774
|
|
2775
2775
|
if (style) {
|
2776
2776
|
return '\u001b[' + inspect$1.colors[style][0] + 'm' + str +
|
2777
|
-
|
2777
|
+
'\u001b[' + inspect$1.colors[style][1] + 'm';
|
2778
2778
|
} else {
|
2779
2779
|
return str;
|
2780
2780
|
}
|
@@ -2801,14 +2801,14 @@ function formatValue(ctx, value, recurseTimes) {
|
|
2801
2801
|
// Provide a hook for user-specified inspect functions.
|
2802
2802
|
// Check that value is an object with an inspect function on it
|
2803
2803
|
if (ctx.customInspect &&
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2804
|
+
value &&
|
2805
|
+
isFunction$2(value.inspect) &&
|
2806
|
+
// Filter out the util module, it's inspect function is special
|
2807
|
+
value.inspect !== inspect$1 &&
|
2808
|
+
// Also filter out any prototype objects using the circular check.
|
2809
|
+
!(value.constructor && value.constructor.prototype === value)) {
|
2810
2810
|
var ret = value.inspect(recurseTimes, ctx);
|
2811
|
-
if (!isString$
|
2811
|
+
if (!isString$2(ret)) {
|
2812
2812
|
ret = formatValue(ctx, ret, recurseTimes);
|
2813
2813
|
}
|
2814
2814
|
return ret;
|
@@ -2831,7 +2831,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|
2831
2831
|
// IE doesn't make error fields non-enumerable
|
2832
2832
|
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
|
2833
2833
|
if (isError(value)
|
2834
|
-
|
2834
|
+
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
|
2835
2835
|
return formatError(value);
|
2836
2836
|
}
|
2837
2837
|
|
@@ -2913,10 +2913,10 @@ function formatValue(ctx, value, recurseTimes) {
|
|
2913
2913
|
function formatPrimitive(ctx, value) {
|
2914
2914
|
if (isUndefined$1(value))
|
2915
2915
|
return ctx.stylize('undefined', 'undefined');
|
2916
|
-
if (isString$
|
2916
|
+
if (isString$2(value)) {
|
2917
2917
|
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
2918
|
-
|
2919
|
-
|
2918
|
+
.replace(/'/g, "\\'")
|
2919
|
+
.replace(/\\"/g, '"') + '\'';
|
2920
2920
|
return ctx.stylize(simple, 'string');
|
2921
2921
|
}
|
2922
2922
|
if (isNumber$1(value))
|
@@ -2939,7 +2939,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
|
2939
2939
|
for (var i = 0, l = value.length; i < l; ++i) {
|
2940
2940
|
if (hasOwnProperty(value, String(i))) {
|
2941
2941
|
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
2942
|
-
|
2942
|
+
String(i), true));
|
2943
2943
|
} else {
|
2944
2944
|
output.push('');
|
2945
2945
|
}
|
@@ -2947,7 +2947,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
|
2947
2947
|
keys.forEach(function(key) {
|
2948
2948
|
if (!key.match(/^\d+$/)) {
|
2949
2949
|
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
2950
|
-
|
2950
|
+
key, true));
|
2951
2951
|
}
|
2952
2952
|
});
|
2953
2953
|
return output;
|
@@ -3003,8 +3003,8 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
|
3003
3003
|
name = ctx.stylize(name, 'name');
|
3004
3004
|
} else {
|
3005
3005
|
name = name.replace(/'/g, "\\'")
|
3006
|
-
|
3007
|
-
|
3006
|
+
.replace(/\\"/g, '"')
|
3007
|
+
.replace(/(^"|"$)/g, "'");
|
3008
3008
|
name = ctx.stylize(name, 'string');
|
3009
3009
|
}
|
3010
3010
|
}
|
@@ -3021,11 +3021,11 @@ function reduceToSingleString(output, base, braces) {
|
|
3021
3021
|
|
3022
3022
|
if (length > 60) {
|
3023
3023
|
return braces[0] +
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3024
|
+
(base === '' ? '' : base + '\n ') +
|
3025
|
+
' ' +
|
3026
|
+
output.join(',\n ') +
|
3027
|
+
' ' +
|
3028
|
+
braces[1];
|
3029
3029
|
}
|
3030
3030
|
|
3031
3031
|
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
|
@@ -3050,7 +3050,7 @@ function isNumber$1(arg) {
|
|
3050
3050
|
return typeof arg === 'number';
|
3051
3051
|
}
|
3052
3052
|
|
3053
|
-
function isString$
|
3053
|
+
function isString$2(arg) {
|
3054
3054
|
return typeof arg === 'string';
|
3055
3055
|
}
|
3056
3056
|
|
@@ -3072,7 +3072,7 @@ function isDate$1(d) {
|
|
3072
3072
|
|
3073
3073
|
function isError(e) {
|
3074
3074
|
return isObject$1(e) &&
|
3075
|
-
|
3075
|
+
(objectToString$1(e) === '[object Error]' || e instanceof Error);
|
3076
3076
|
}
|
3077
3077
|
|
3078
3078
|
function isFunction$2(arg) {
|
@@ -3081,11 +3081,11 @@ function isFunction$2(arg) {
|
|
3081
3081
|
|
3082
3082
|
function isPrimitive(arg) {
|
3083
3083
|
return arg === null ||
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
3084
|
+
typeof arg === 'boolean' ||
|
3085
|
+
typeof arg === 'number' ||
|
3086
|
+
typeof arg === 'string' ||
|
3087
|
+
typeof arg === 'symbol' || // ES6 symbol
|
3088
|
+
typeof arg === 'undefined';
|
3089
3089
|
}
|
3090
3090
|
|
3091
3091
|
function objectToString$1(o) {
|
@@ -3257,8 +3257,8 @@ function inspect(something) {
|
|
3257
3257
|
}
|
3258
3258
|
function getMessage(self) {
|
3259
3259
|
return truncate(inspect(self.actual), 128) + ' ' +
|
3260
|
-
|
3261
|
-
|
3260
|
+
self.operator + ' ' +
|
3261
|
+
truncate(inspect(self.expected), 128);
|
3262
3262
|
}
|
3263
3263
|
|
3264
3264
|
// At present only the three keys mentioned above are used and
|
@@ -3336,46 +3336,46 @@ function _deepEqual(actual, expected, strict, memos) {
|
|
3336
3336
|
} else if (isBuffer$2(actual) && isBuffer$2(expected)) {
|
3337
3337
|
return compare(actual, expected) === 0;
|
3338
3338
|
|
3339
|
-
|
3340
|
-
|
3339
|
+
// 7.2. If the expected value is a Date object, the actual value is
|
3340
|
+
// equivalent if it is also a Date object that refers to the same time.
|
3341
3341
|
} else if (isDate$1(actual) && isDate$1(expected)) {
|
3342
3342
|
return actual.getTime() === expected.getTime();
|
3343
3343
|
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3344
|
+
// 7.3 If the expected value is a RegExp object, the actual value is
|
3345
|
+
// equivalent if it is also a RegExp object with the same source and
|
3346
|
+
// properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
|
3347
3347
|
} else if (isRegExp(actual) && isRegExp(expected)) {
|
3348
3348
|
return actual.source === expected.source &&
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3349
|
+
actual.global === expected.global &&
|
3350
|
+
actual.multiline === expected.multiline &&
|
3351
|
+
actual.lastIndex === expected.lastIndex &&
|
3352
|
+
actual.ignoreCase === expected.ignoreCase;
|
3353
3353
|
|
3354
|
-
|
3355
|
-
|
3354
|
+
// 7.4. Other pairs that do not both pass typeof value == 'object',
|
3355
|
+
// equivalence is determined by ==.
|
3356
3356
|
} else if ((actual === null || typeof actual !== 'object') &&
|
3357
|
-
|
3357
|
+
(expected === null || typeof expected !== 'object')) {
|
3358
3358
|
return strict ? actual === expected : actual == expected;
|
3359
3359
|
|
3360
|
-
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3365
|
-
|
3360
|
+
// If both values are instances of typed arrays, wrap their underlying
|
3361
|
+
// ArrayBuffers in a Buffer each to increase performance
|
3362
|
+
// This optimization requires the arrays to have the same type as checked by
|
3363
|
+
// Object.prototype.toString (aka pToString). Never perform binary
|
3364
|
+
// comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
|
3365
|
+
// bit patterns are not identical.
|
3366
3366
|
} else if (isView(actual) && isView(expected) &&
|
3367
|
-
|
3368
|
-
|
3369
|
-
|
3367
|
+
pToString(actual) === pToString(expected) &&
|
3368
|
+
!(actual instanceof Float32Array ||
|
3369
|
+
actual instanceof Float64Array)) {
|
3370
3370
|
return compare(new Uint8Array(actual.buffer),
|
3371
|
-
|
3372
|
-
|
3373
|
-
|
3374
|
-
|
3375
|
-
|
3376
|
-
|
3377
|
-
|
3378
|
-
|
3371
|
+
new Uint8Array(expected.buffer)) === 0;
|
3372
|
+
|
3373
|
+
// 7.5 For all other Object pairs, including Array objects, equivalence is
|
3374
|
+
// determined by having the same number of owned properties (as verified
|
3375
|
+
// with Object.prototype.hasOwnProperty.call), the same set of keys
|
3376
|
+
// (although not necessarily the same order), equivalent values for every
|
3377
|
+
// corresponding key, and an identical 'prototype' property. Note: this
|
3378
|
+
// accounts for both named and indexed properties on Arrays.
|
3379
3379
|
} else if (isBuffer$2(actual) !== isBuffer$2(expected)) {
|
3380
3380
|
return false;
|
3381
3381
|
} else {
|
@@ -3525,7 +3525,7 @@ function _throws(shouldThrow, block, expected, message) {
|
|
3525
3525
|
actual = _tryBlock(block);
|
3526
3526
|
|
3527
3527
|
message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
|
3528
|
-
|
3528
|
+
(message ? ' ' + message : '.');
|
3529
3529
|
|
3530
3530
|
if (shouldThrow && !actual) {
|
3531
3531
|
fail(actual, expected, 'Missing expected exception' + message);
|
@@ -3538,12 +3538,12 @@ function _throws(shouldThrow, block, expected, message) {
|
|
3538
3538
|
if ((isUnwantedException &&
|
3539
3539
|
userProvidedMessage &&
|
3540
3540
|
expectedException(actual, expected)) ||
|
3541
|
-
|
3541
|
+
isUnexpectedException) {
|
3542
3542
|
fail(actual, expected, 'Got unwanted exception' + message);
|
3543
3543
|
}
|
3544
3544
|
|
3545
3545
|
if ((shouldThrow && actual && expected &&
|
3546
|
-
|
3546
|
+
!expectedException(actual, expected)) || (!shouldThrow && actual)) {
|
3547
3547
|
throw actual;
|
3548
3548
|
}
|
3549
3549
|
}
|
@@ -3608,16 +3608,26 @@ var MAX_SIZE=32<<10;var looselyValidateEvent_1=looselyValidateEvent;/**
|
|
3608
3608
|
*/var genericValidationRules={anonymousId:['string','number'],category:'string',context:'object',event:'string',groupId:['string','number'],integrations:'object',name:'string',previousId:['string','number'],timestamp:'date',userId:['string','number'],type:'string'};/**
|
3609
3609
|
* Validate an event object.
|
3610
3610
|
*/function validateGenericEvent(event){assert(type(event)==='object','You must pass a message object.');var json=JSON.stringify(event);// Strings are variable byte encoded, so json.length is not sufficient.
|
3611
|
-
assert(Buffer.byteLength(json,'utf8')<MAX_SIZE,'Your message must be < 32kb.');for(var key in genericValidationRules){var val=event[key];if(!val)continue;var rule=genericValidationRules[key];if(type(rule)!=='array'){rule=[rule];}var a=rule[0]==='object'?'an':'a';assert(rule.some(function(e){return type(val)===e;}),'"'+key+'" must be '+a+' '+join(rule,'or')+'.');}}
|
3611
|
+
assert(Buffer.byteLength(json,'utf8')<MAX_SIZE,'Your message must be < 32kb.');for(var key in genericValidationRules){var val=event[key];if(!val)continue;var rule=genericValidationRules[key];if(type(rule)!=='array'){rule=[rule];}var a=rule[0]==='object'?'an':'a';assert(rule.some(function(e){return type(val)===e;}),'"'+key+'" must be '+a+' '+join(rule,'or')+'.');}}
|
3612
3612
|
|
3613
|
-
var
|
3613
|
+
var axiosExports$1 = {};
|
3614
|
+
var axios$3 = {
|
3615
|
+
get exports(){ return axiosExports$1; },
|
3616
|
+
set exports(v){ axiosExports$1 = v; },
|
3617
|
+
};
|
3618
|
+
|
3619
|
+
var axiosExports = {};
|
3620
|
+
var axios$2 = {
|
3621
|
+
get exports(){ return axiosExports; },
|
3622
|
+
set exports(v){ axiosExports = v; },
|
3623
|
+
};
|
3614
3624
|
|
3615
3625
|
var bind$2=function bind(fn,thisArg){return function wrap(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}return fn.apply(thisArg,args);};};
|
3616
3626
|
|
3617
3627
|
var bind$1=bind$2;// utils is a library of generic helper functions non-specific to axios
|
3618
3628
|
var toString=Object.prototype.toString;// eslint-disable-next-line func-names
|
3619
3629
|
var kindOf=function(cache){// eslint-disable-next-line func-names
|
3620
|
-
return function(thing){var str=toString.call(thing);return cache[str]||(cache[str]=str.slice(8,-1).toLowerCase());};}(Object.create(null));function kindOfTest(type){type=type.toLowerCase();return function isKindOf(thing){return kindOf(thing)===type;};}/**
|
3630
|
+
return function(thing){var str=toString.call(thing);return cache[str]||(cache[str]=str.slice(8,-1).toLowerCase());};}(Object.create(null));function kindOfTest(type){type=type.toLowerCase();return function isKindOf(thing){return kindOf(thing)===type;};}/**
|
3621
3631
|
* Determine if a value is an Array
|
3622
3632
|
*
|
3623
3633
|
* @param {Object} val The value to test
|
@@ -3648,7 +3658,7 @@ return function(thing){var str=toString.call(thing);return cache[str]||(cache[st
|
|
3648
3658
|
*
|
3649
3659
|
* @param {Object} val The value to test
|
3650
3660
|
* @returns {boolean} True if value is a String, otherwise false
|
3651
|
-
*/function isString$
|
3661
|
+
*/function isString$1(val){return typeof val==='string';}/**
|
3652
3662
|
* Determine if a value is a Number
|
3653
3663
|
*
|
3654
3664
|
* @param {Object} val The value to test
|
@@ -3738,10 +3748,10 @@ return function(thing){var str=toString.call(thing);return cache[str]||(cache[st
|
|
3738
3748
|
* @param {Object|Array} obj The object to iterate
|
3739
3749
|
* @param {Function} fn The callback to invoke for each item
|
3740
3750
|
*/function forEach(obj,fn){// Don't bother if no value provided
|
3741
|
-
if(obj===null||typeof obj==='undefined'){return;}// Force an array if not already something iterable
|
3742
|
-
if(_typeof(obj)!=='object'){/*eslint no-param-reassign:0*/obj=[obj];}if(isArray$1(obj)){// Iterate over array values
|
3743
|
-
for(var i=0,l=obj.length;i<l;i++){fn.call(null,obj[i],i,obj);}}else {// Iterate over object keys
|
3744
|
-
for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key)){fn.call(null,obj[key],key,obj);}}}}/**
|
3751
|
+
if(obj===null||typeof obj==='undefined'){return;}// Force an array if not already something iterable
|
3752
|
+
if(_typeof(obj)!=='object'){/*eslint no-param-reassign:0*/obj=[obj];}if(isArray$1(obj)){// Iterate over array values
|
3753
|
+
for(var i=0,l=obj.length;i<l;i++){fn.call(null,obj[i],i,obj);}}else {// Iterate over object keys
|
3754
|
+
for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key)){fn.call(null,obj[key],key,obj);}}}}/**
|
3745
3755
|
* Accepts varargs expecting each argument to be an object, then
|
3746
3756
|
* immutably merges the properties of each object and returns result.
|
3747
3757
|
*
|
@@ -3793,7 +3803,7 @@ for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key)){fn.call(nu
|
|
3793
3803
|
* @returns {Array}
|
3794
3804
|
*/function toArray(thing){if(!thing)return null;var i=thing.length;if(isUndefined(i))return null;var arr=new Array(i);while(i-->0){arr[i]=thing[i];}return arr;}// eslint-disable-next-line func-names
|
3795
3805
|
var isTypedArray=function(TypedArray){// eslint-disable-next-line func-names
|
3796
|
-
return function(thing){return TypedArray&&thing instanceof TypedArray;};}(typeof Uint8Array!=='undefined'&&Object.getPrototypeOf(Uint8Array));var utils$9={isArray:isArray$1,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString$
|
3806
|
+
return function(thing){return TypedArray&&thing instanceof TypedArray;};}(typeof Uint8Array!=='undefined'&&Object.getPrototypeOf(Uint8Array));var utils$9={isArray:isArray$1,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString$1,isNumber:isNumber,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isFunction:isFunction$1,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,isTypedArray:isTypedArray,isFileList:isFileList};
|
3797
3807
|
|
3798
3808
|
var utils$8=utils$9;function encode(val){return encodeURIComponent(val).replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%20/g,'+').replace(/%5B/gi,'[').replace(/%5D/gi,']');}/**
|
3799
3809
|
* Build a URL by appending params to the end
|
@@ -3801,7 +3811,7 @@ var utils$8=utils$9;function encode(val){return encodeURIComponent(val).replace(
|
|
3801
3811
|
* @param {string} url The base of the url (e.g., http://www.google.com)
|
3802
3812
|
* @param {object} [params] The params to be appended
|
3803
3813
|
* @returns {string} The formatted url
|
3804
|
-
*/var buildURL$1=function buildURL(url,params,paramsSerializer){/*eslint no-param-reassign:0*/if(!params){return url;}var serializedParams;if(paramsSerializer){serializedParams=paramsSerializer(params);}else if(utils$8.isURLSearchParams(params)){serializedParams=params.toString();}else {var parts=[];utils$8.forEach(params,function serialize(val,key){if(val===null||typeof val==='undefined'){return;}if(utils$8.isArray(val)){key=key+'[]';}else {val=[val];}utils$8.forEach(val,function parseValue(v){if(utils$8.isDate(v)){v=v.toISOString();}else if(utils$8.isObject(v)){v=JSON.stringify(v);}parts.push(encode(key)+'='+encode(v));});});serializedParams=parts.join('&');}if(serializedParams){var hashmarkIndex=url.indexOf('#');if(hashmarkIndex!==-1){url=url.slice(0,hashmarkIndex);}url+=(url.indexOf('?')===-1?'?':'&')+serializedParams;}return url;};
|
3814
|
+
*/var buildURL$1=function buildURL(url,params,paramsSerializer){/*eslint no-param-reassign:0*/if(!params){return url;}var serializedParams;if(paramsSerializer){serializedParams=paramsSerializer(params);}else if(utils$8.isURLSearchParams(params)){serializedParams=params.toString();}else {var parts=[];utils$8.forEach(params,function serialize(val,key){if(val===null||typeof val==='undefined'){return;}if(utils$8.isArray(val)){key=key+'[]';}else {val=[val];}utils$8.forEach(val,function parseValue(v){if(utils$8.isDate(v)){v=v.toISOString();}else if(utils$8.isObject(v)){v=JSON.stringify(v);}parts.push(encode(key)+'='+encode(v));});});serializedParams=parts.join('&');}if(serializedParams){var hashmarkIndex=url.indexOf('#');if(hashmarkIndex!==-1){url=url.slice(0,hashmarkIndex);}url+=(url.indexOf('?')===-1?'?':'&')+serializedParams;}return url;};
|
3805
3815
|
|
3806
3816
|
var utils$7=utils$9;function InterceptorManager$1(){this.handlers=[];}/**
|
3807
3817
|
* Add a new interceptor to the stack
|
@@ -3826,33 +3836,33 @@ var utils$7=utils$9;function InterceptorManager$1(){this.handlers=[];}/**
|
|
3826
3836
|
var utils$6=utils$9;var normalizeHeaderName$1=function normalizeHeaderName(headers,normalizedName){utils$6.forEach(headers,function processHeader(value,name){if(name!==normalizedName&&name.toUpperCase()===normalizedName.toUpperCase()){headers[normalizedName]=value;delete headers[name];}});};
|
3827
3837
|
|
3828
3838
|
var AxiosError_1;var hasRequiredAxiosError;function requireAxiosError(){if(hasRequiredAxiosError)return AxiosError_1;hasRequiredAxiosError=1;var utils=utils$9;/**
|
3829
|
-
|
3830
|
-
|
3831
|
-
|
3832
|
-
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
3836
|
-
|
3837
|
-
|
3838
|
-
message:this.message,name:this.name,// Microsoft
|
3839
|
-
description:this.description,number:this.number,// Mozilla
|
3840
|
-
fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,// Axios
|
3841
|
-
config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null};}});var prototype=AxiosError.prototype;var descriptors={};['ERR_BAD_OPTION_VALUE','ERR_BAD_OPTION','ECONNABORTED','ETIMEDOUT','ERR_NETWORK','ERR_FR_TOO_MANY_REDIRECTS','ERR_DEPRECATED','ERR_BAD_RESPONSE','ERR_BAD_REQUEST','ERR_CANCELED'// eslint-disable-next-line func-names
|
3839
|
+
* Create an Error with the specified message, config, error code, request and response.
|
3840
|
+
*
|
3841
|
+
* @param {string} message The error message.
|
3842
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
3843
|
+
* @param {Object} [config] The config.
|
3844
|
+
* @param {Object} [request] The request.
|
3845
|
+
* @param {Object} [response] The response.
|
3846
|
+
* @returns {Error} The created error.
|
3847
|
+
*/function AxiosError(message,code,config,request,response){Error.call(this);this.message=message;this.name='AxiosError';code&&(this.code=code);config&&(this.config=config);request&&(this.request=request);response&&(this.response=response);}utils.inherits(AxiosError,Error,{toJSON:function toJSON(){return {// Standard
|
3848
|
+
message:this.message,name:this.name,// Microsoft
|
3849
|
+
description:this.description,number:this.number,// Mozilla
|
3850
|
+
fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,// Axios
|
3851
|
+
config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null};}});var prototype=AxiosError.prototype;var descriptors={};['ERR_BAD_OPTION_VALUE','ERR_BAD_OPTION','ECONNABORTED','ETIMEDOUT','ERR_NETWORK','ERR_FR_TOO_MANY_REDIRECTS','ERR_DEPRECATED','ERR_BAD_RESPONSE','ERR_BAD_REQUEST','ERR_CANCELED'// eslint-disable-next-line func-names
|
3842
3852
|
].forEach(function(code){descriptors[code]={value:code};});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype,'isAxiosError',{value:true});// eslint-disable-next-line func-names
|
3843
|
-
AxiosError.from=function(error,code,config,request,response,customProps){var axiosError=Object.create(prototype);utils.toFlatObject(error,axiosError,function filter(obj){return obj!==Error.prototype;});AxiosError.call(axiosError,error.message,code,config,request,response);axiosError.name=error.name;customProps&&_extends(axiosError,customProps);return axiosError;};AxiosError_1=AxiosError;return AxiosError_1;}
|
3853
|
+
AxiosError.from=function(error,code,config,request,response,customProps){var axiosError=Object.create(prototype);utils.toFlatObject(error,axiosError,function filter(obj){return obj!==Error.prototype;});AxiosError.call(axiosError,error.message,code,config,request,response);axiosError.name=error.name;customProps&&_extends(axiosError,customProps);return axiosError;};AxiosError_1=AxiosError;return AxiosError_1;}
|
3844
3854
|
|
3845
3855
|
var transitional={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};
|
3846
3856
|
|
3847
3857
|
var toFormData_1;var hasRequiredToFormData;function requireToFormData(){if(hasRequiredToFormData)return toFormData_1;hasRequiredToFormData=1;var utils=utils$9;/**
|
3848
|
-
|
3849
|
-
|
3850
|
-
|
3851
|
-
|
3852
|
-
|
3853
|
-
formData=formData||new FormData();var stack=[];function convertValue(value){if(value===null)return '';if(utils.isDate(value)){return value.toISOString();}if(utils.isArrayBuffer(value)||utils.isTypedArray(value)){return typeof Blob==='function'?new Blob([value]):Buffer.from(value);}return value;}function build(data,parentKey){if(utils.isPlainObject(data)||utils.isArray(data)){if(stack.indexOf(data)!==-1){throw Error('Circular reference detected in '+parentKey);}stack.push(data);utils.forEach(data,function each(value,key){if(utils.isUndefined(value))return;var fullKey=parentKey?parentKey+'.'+key:key;var arr;if(value&&!parentKey&&_typeof(value)==='object'){if(utils.endsWith(key,'{}')){// eslint-disable-next-line no-param-reassign
|
3854
|
-
value=JSON.stringify(value);}else if(utils.endsWith(key,'[]')&&(arr=utils.toArray(value))){// eslint-disable-next-line func-names
|
3855
|
-
arr.forEach(function(el){!utils.isUndefined(el)&&formData.append(fullKey,convertValue(el));});return;}}build(value,fullKey);});stack.pop();}else {formData.append(parentKey,convertValue(data));}}build(obj);return formData;}toFormData_1=toFormData;return toFormData_1;}
|
3858
|
+
* Convert a data object to FormData
|
3859
|
+
* @param {Object} obj
|
3860
|
+
* @param {?Object} [formData]
|
3861
|
+
* @returns {Object}
|
3862
|
+
**/function toFormData(obj,formData){// eslint-disable-next-line no-param-reassign
|
3863
|
+
formData=formData||new FormData();var stack=[];function convertValue(value){if(value===null)return '';if(utils.isDate(value)){return value.toISOString();}if(utils.isArrayBuffer(value)||utils.isTypedArray(value)){return typeof Blob==='function'?new Blob([value]):Buffer.from(value);}return value;}function build(data,parentKey){if(utils.isPlainObject(data)||utils.isArray(data)){if(stack.indexOf(data)!==-1){throw Error('Circular reference detected in '+parentKey);}stack.push(data);utils.forEach(data,function each(value,key){if(utils.isUndefined(value))return;var fullKey=parentKey?parentKey+'.'+key:key;var arr;if(value&&!parentKey&&_typeof(value)==='object'){if(utils.endsWith(key,'{}')){// eslint-disable-next-line no-param-reassign
|
3864
|
+
value=JSON.stringify(value);}else if(utils.endsWith(key,'[]')&&(arr=utils.toArray(value))){// eslint-disable-next-line func-names
|
3865
|
+
arr.forEach(function(el){!utils.isUndefined(el)&&formData.append(fullKey,convertValue(el));});return;}}build(value,fullKey);});stack.pop();}else {formData.append(parentKey,convertValue(data));}}build(obj);return formData;}toFormData_1=toFormData;return toFormData_1;}
|
3856
3866
|
|
3857
3867
|
var AxiosError$2=requireAxiosError();/**
|
3858
3868
|
* Resolve or reject a Promise based on response status.
|
@@ -3860,11 +3870,11 @@ var AxiosError$2=requireAxiosError();/**
|
|
3860
3870
|
* @param {Function} resolve A function that resolves the promise.
|
3861
3871
|
* @param {Function} reject A function that rejects the promise.
|
3862
3872
|
* @param {object} response The response.
|
3863
|
-
*/var settle=function settle(resolve,reject,response){var validateStatus=response.config.validateStatus;if(!response.status||!validateStatus||validateStatus(response.status)){resolve(response);}else {reject(new AxiosError$2('Request failed with status code '+response.status,[AxiosError$2.ERR_BAD_REQUEST,AxiosError$2.ERR_BAD_RESPONSE][Math.floor(response.status/100)-4],response.config,response.request,response));}};
|
3873
|
+
*/var settle=function settle(resolve,reject,response){var validateStatus=response.config.validateStatus;if(!response.status||!validateStatus||validateStatus(response.status)){resolve(response);}else {reject(new AxiosError$2('Request failed with status code '+response.status,[AxiosError$2.ERR_BAD_REQUEST,AxiosError$2.ERR_BAD_RESPONSE][Math.floor(response.status/100)-4],response.config,response.request,response));}};
|
3864
3874
|
|
3865
3875
|
var cookies;var hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var utils=utils$9;cookies=utils.isStandardBrowserEnv()?// Standard browser envs support document.cookie
|
3866
|
-
function standardBrowserEnv(){return {write:function write(name,value,expires,path,domain,secure){var cookie=[];cookie.push(name+'='+encodeURIComponent(value));if(utils.isNumber(expires)){cookie.push('expires='+new Date(expires).toGMTString());}if(utils.isString(path)){cookie.push('path='+path);}if(utils.isString(domain)){cookie.push('domain='+domain);}if(secure===true){cookie.push('secure');}document.cookie=cookie.join('; ');},read:function read(name){var match=document.cookie.match(new RegExp('(^|;\\s*)('+name+')=([^;]*)'));return match?decodeURIComponent(match[3]):null;},remove:function remove(name){this.write(name,'',Date.now()-86400000);}};}():// Non standard browser env (web workers, react-native) lack needed support.
|
3867
|
-
function nonStandardBrowserEnv(){return {write:function write(){},read:function read(){return null;},remove:function remove(){}};}();return cookies;}
|
3876
|
+
function standardBrowserEnv(){return {write:function write(name,value,expires,path,domain,secure){var cookie=[];cookie.push(name+'='+encodeURIComponent(value));if(utils.isNumber(expires)){cookie.push('expires='+new Date(expires).toGMTString());}if(utils.isString(path)){cookie.push('path='+path);}if(utils.isString(domain)){cookie.push('domain='+domain);}if(secure===true){cookie.push('secure');}document.cookie=cookie.join('; ');},read:function read(name){var match=document.cookie.match(new RegExp('(^|;\\s*)('+name+')=([^;]*)'));return match?decodeURIComponent(match[3]):null;},remove:function remove(name){this.write(name,'',Date.now()-86400000);}};}():// Non standard browser env (web workers, react-native) lack needed support.
|
3877
|
+
function nonStandardBrowserEnv(){return {write:function write(){},read:function read(){return null;},remove:function remove(){}};}();return cookies;}
|
3868
3878
|
|
3869
3879
|
/**
|
3870
3880
|
* Determines whether the specified URL is absolute
|
@@ -3874,7 +3884,7 @@ function nonStandardBrowserEnv(){return {write:function write(){},read:function
|
|
3874
3884
|
*/var isAbsoluteURL$1=function isAbsoluteURL(url){// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
3875
3885
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
3876
3886
|
// by any combination of letters, digits, plus, period, or hyphen.
|
3877
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);};
|
3887
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);};
|
3878
3888
|
|
3879
3889
|
/**
|
3880
3890
|
* Creates a new URL by combining the specified URLs
|
@@ -3892,94 +3902,94 @@ var isAbsoluteURL=isAbsoluteURL$1;var combineURLs=combineURLs$1;/**
|
|
3892
3902
|
* @param {string} baseURL The base URL
|
3893
3903
|
* @param {string} requestedURL Absolute or relative URL to combine
|
3894
3904
|
* @returns {string} The combined full path
|
3895
|
-
*/var buildFullPath$1=function buildFullPath(baseURL,requestedURL){if(baseURL&&!isAbsoluteURL(requestedURL)){return combineURLs(baseURL,requestedURL);}return requestedURL;};
|
3905
|
+
*/var buildFullPath$1=function buildFullPath(baseURL,requestedURL){if(baseURL&&!isAbsoluteURL(requestedURL)){return combineURLs(baseURL,requestedURL);}return requestedURL;};
|
3896
3906
|
|
3897
3907
|
var parseHeaders;var hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var utils=utils$9;// Headers whose duplicates are ignored by node
|
3898
3908
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
3899
|
-
var ignoreDuplicateOf=['age','authorization','content-length','content-type','etag','expires','from','host','if-modified-since','if-unmodified-since','last-modified','location','max-forwards','proxy-authorization','referer','retry-after','user-agent'];/**
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
3906
|
-
|
3907
|
-
|
3908
|
-
|
3909
|
-
|
3910
|
-
|
3911
|
-
|
3909
|
+
var ignoreDuplicateOf=['age','authorization','content-length','content-type','etag','expires','from','host','if-modified-since','if-unmodified-since','last-modified','location','max-forwards','proxy-authorization','referer','retry-after','user-agent'];/**
|
3910
|
+
* Parse headers into an object
|
3911
|
+
*
|
3912
|
+
* ```
|
3913
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
3914
|
+
* Content-Type: application/json
|
3915
|
+
* Connection: keep-alive
|
3916
|
+
* Transfer-Encoding: chunked
|
3917
|
+
* ```
|
3918
|
+
*
|
3919
|
+
* @param {String} headers Headers needing to be parsed
|
3920
|
+
* @returns {Object} Headers parsed into an object
|
3921
|
+
*/parseHeaders=function parseHeaders(headers){var parsed={};var key;var val;var i;if(!headers){return parsed;}utils.forEach(headers.split('\n'),function parser(line){i=line.indexOf(':');key=utils.trim(line.substr(0,i)).toLowerCase();val=utils.trim(line.substr(i+1));if(key){if(parsed[key]&&ignoreDuplicateOf.indexOf(key)>=0){return;}if(key==='set-cookie'){parsed[key]=(parsed[key]?parsed[key]:[]).concat([val]);}else {parsed[key]=parsed[key]?parsed[key]+', '+val:val;}}});return parsed;};return parseHeaders;}
|
3912
3922
|
|
3913
3923
|
var isURLSameOrigin;var hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var utils=utils$9;isURLSameOrigin=utils.isStandardBrowserEnv()?// Standard browser envs have full support of the APIs needed to test
|
3914
|
-
// whether the request URL is of the same origin as current location.
|
3915
|
-
function standardBrowserEnv(){var msie=/(msie|trident)/i.test(navigator.userAgent);var urlParsingNode=document.createElement('a');var originURL;/**
|
3916
|
-
|
3917
|
-
|
3918
|
-
|
3919
|
-
|
3920
|
-
|
3921
|
-
urlParsingNode.setAttribute('href',href);href=urlParsingNode.href;}urlParsingNode.setAttribute('href',href);// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
3922
|
-
return {href:urlParsingNode.href,protocol:urlParsingNode.protocol?urlParsingNode.protocol.replace(/:$/,''):'',host:urlParsingNode.host,search:urlParsingNode.search?urlParsingNode.search.replace(/^\?/,''):'',hash:urlParsingNode.hash?urlParsingNode.hash.replace(/^#/,''):'',hostname:urlParsingNode.hostname,port:urlParsingNode.port,pathname:urlParsingNode.pathname.charAt(0)==='/'?urlParsingNode.pathname:'/'+urlParsingNode.pathname};}originURL=resolveURL(window.location.href);/**
|
3923
|
-
|
3924
|
-
|
3925
|
-
|
3926
|
-
|
3927
|
-
|
3928
|
-
function nonStandardBrowserEnv(){return function isURLSameOrigin(){return true;};}();return isURLSameOrigin;}
|
3924
|
+
// whether the request URL is of the same origin as current location.
|
3925
|
+
function standardBrowserEnv(){var msie=/(msie|trident)/i.test(navigator.userAgent);var urlParsingNode=document.createElement('a');var originURL;/**
|
3926
|
+
* Parse a URL to discover it's components
|
3927
|
+
*
|
3928
|
+
* @param {String} url The URL to be parsed
|
3929
|
+
* @returns {Object}
|
3930
|
+
*/function resolveURL(url){var href=url;if(msie){// IE needs attribute set twice to normalize properties
|
3931
|
+
urlParsingNode.setAttribute('href',href);href=urlParsingNode.href;}urlParsingNode.setAttribute('href',href);// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
3932
|
+
return {href:urlParsingNode.href,protocol:urlParsingNode.protocol?urlParsingNode.protocol.replace(/:$/,''):'',host:urlParsingNode.host,search:urlParsingNode.search?urlParsingNode.search.replace(/^\?/,''):'',hash:urlParsingNode.hash?urlParsingNode.hash.replace(/^#/,''):'',hostname:urlParsingNode.hostname,port:urlParsingNode.port,pathname:urlParsingNode.pathname.charAt(0)==='/'?urlParsingNode.pathname:'/'+urlParsingNode.pathname};}originURL=resolveURL(window.location.href);/**
|
3933
|
+
* Determine if a URL shares the same origin as the current location
|
3934
|
+
*
|
3935
|
+
* @param {String} requestURL The URL to test
|
3936
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
3937
|
+
*/return function isURLSameOrigin(requestURL){var parsed=utils.isString(requestURL)?resolveURL(requestURL):requestURL;return parsed.protocol===originURL.protocol&&parsed.host===originURL.host;};}():// Non standard browser envs (web workers, react-native) lack needed support.
|
3938
|
+
function nonStandardBrowserEnv(){return function isURLSameOrigin(){return true;};}();return isURLSameOrigin;}
|
3929
3939
|
|
3930
3940
|
var CanceledError_1;var hasRequiredCanceledError;function requireCanceledError(){if(hasRequiredCanceledError)return CanceledError_1;hasRequiredCanceledError=1;var AxiosError=requireAxiosError();var utils=utils$9;/**
|
3931
|
-
|
3932
|
-
|
3933
|
-
|
3934
|
-
|
3935
|
-
|
3936
|
-
AxiosError.call(this,message==null?'canceled':message,AxiosError.ERR_CANCELED);this.name='CanceledError';}utils.inherits(CanceledError,AxiosError,{__CANCEL__:true});CanceledError_1=CanceledError;return CanceledError_1;}
|
3941
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
3942
|
+
*
|
3943
|
+
* @class
|
3944
|
+
* @param {string=} message The message.
|
3945
|
+
*/function CanceledError(message){// eslint-disable-next-line no-eq-null,eqeqeq
|
3946
|
+
AxiosError.call(this,message==null?'canceled':message,AxiosError.ERR_CANCELED);this.name='CanceledError';}utils.inherits(CanceledError,AxiosError,{__CANCEL__:true});CanceledError_1=CanceledError;return CanceledError_1;}
|
3937
3947
|
|
3938
3948
|
var parseProtocol;var hasRequiredParseProtocol;function requireParseProtocol(){if(hasRequiredParseProtocol)return parseProtocol;hasRequiredParseProtocol=1;parseProtocol=function parseProtocol(url){var match=/^([-+\w]{1,25})(:?\/\/|:)/.exec(url);return match&&match[1]||'';};return parseProtocol;}
|
3939
3949
|
|
3940
3950
|
var xhr;var hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var utils=utils$9;var settle$1=settle;var cookies=requireCookies();var buildURL=buildURL$1;var buildFullPath=buildFullPath$1;var parseHeaders=requireParseHeaders();var isURLSameOrigin=requireIsURLSameOrigin();var transitionalDefaults=transitional;var AxiosError=requireAxiosError();var CanceledError=requireCanceledError();var parseProtocol=requireParseProtocol();xhr=function xhrAdapter(config){return new Promise(function dispatchXhrRequest(resolve,reject){var requestData=config.data;var requestHeaders=config.headers;var responseType=config.responseType;var onCanceled;function done(){if(config.cancelToken){config.cancelToken.unsubscribe(onCanceled);}if(config.signal){config.signal.removeEventListener('abort',onCanceled);}}if(utils.isFormData(requestData)&&utils.isStandardBrowserEnv()){delete requestHeaders['Content-Type'];// Let the browser set it
|
3941
3951
|
}var request=new XMLHttpRequest();// HTTP basic authentication
|
3942
|
-
if(config.auth){var username=config.auth.username||'';var password=config.auth.password?unescape(encodeURIComponent(config.auth.password)):'';requestHeaders.Authorization='Basic '+btoa(username+':'+password);}var fullPath=buildFullPath(config.baseURL,config.url);request.open(config.method.toUpperCase(),buildURL(fullPath,config.params,config.paramsSerializer),true);// Set the request timeout in MS
|
3943
|
-
request.timeout=config.timeout;function onloadend(){if(!request){return;}// Prepare the response
|
3944
|
-
var responseHeaders='getAllResponseHeaders'in request?parseHeaders(request.getAllResponseHeaders()):null;var responseData=!responseType||responseType==='text'||responseType==='json'?request.responseText:request.response;var response={data:responseData,status:request.status,statusText:request.statusText,headers:responseHeaders,config:config,request:request};settle$1(function _resolve(value){resolve(value);done();},function _reject(err){reject(err);done();},response);// Clean up request
|
3945
|
-
request=null;}if('onloadend'in request){// Use onloadend if available
|
3946
|
-
request.onloadend=onloadend;}else {// Listen for ready state to emulate onloadend
|
3947
|
-
request.onreadystatechange=function handleLoad(){if(!request||request.readyState!==4){return;}// The request errored out and we didn't get a response, this will be
|
3952
|
+
if(config.auth){var username=config.auth.username||'';var password=config.auth.password?unescape(encodeURIComponent(config.auth.password)):'';requestHeaders.Authorization='Basic '+btoa(username+':'+password);}var fullPath=buildFullPath(config.baseURL,config.url);request.open(config.method.toUpperCase(),buildURL(fullPath,config.params,config.paramsSerializer),true);// Set the request timeout in MS
|
3953
|
+
request.timeout=config.timeout;function onloadend(){if(!request){return;}// Prepare the response
|
3954
|
+
var responseHeaders='getAllResponseHeaders'in request?parseHeaders(request.getAllResponseHeaders()):null;var responseData=!responseType||responseType==='text'||responseType==='json'?request.responseText:request.response;var response={data:responseData,status:request.status,statusText:request.statusText,headers:responseHeaders,config:config,request:request};settle$1(function _resolve(value){resolve(value);done();},function _reject(err){reject(err);done();},response);// Clean up request
|
3955
|
+
request=null;}if('onloadend'in request){// Use onloadend if available
|
3956
|
+
request.onloadend=onloadend;}else {// Listen for ready state to emulate onloadend
|
3957
|
+
request.onreadystatechange=function handleLoad(){if(!request||request.readyState!==4){return;}// The request errored out and we didn't get a response, this will be
|
3948
3958
|
// handled by onerror instead
|
3949
3959
|
// With one exception: request that using file: protocol, most browsers
|
3950
3960
|
// will return status as 0 even though it's a successful request
|
3951
|
-
if(request.status===0&&!(request.responseURL&&request.responseURL.indexOf('file:')===0)){return;}// readystate handler is calling before onerror or ontimeout handlers,
|
3961
|
+
if(request.status===0&&!(request.responseURL&&request.responseURL.indexOf('file:')===0)){return;}// readystate handler is calling before onerror or ontimeout handlers,
|
3952
3962
|
// so we should call onloadend on the next 'tick'
|
3953
|
-
setTimeout(onloadend);};}// Handle browser request cancellation (as opposed to a manual cancellation)
|
3954
|
-
request.onabort=function handleAbort(){if(!request){return;}reject(new AxiosError('Request aborted',AxiosError.ECONNABORTED,config,request));// Clean up request
|
3955
|
-
request=null;};// Handle low level network errors
|
3956
|
-
request.onerror=function handleError(){// Real errors are hidden from us by the browser
|
3963
|
+
setTimeout(onloadend);};}// Handle browser request cancellation (as opposed to a manual cancellation)
|
3964
|
+
request.onabort=function handleAbort(){if(!request){return;}reject(new AxiosError('Request aborted',AxiosError.ECONNABORTED,config,request));// Clean up request
|
3965
|
+
request=null;};// Handle low level network errors
|
3966
|
+
request.onerror=function handleError(){// Real errors are hidden from us by the browser
|
3957
3967
|
// onerror should only fire if it's a network error
|
3958
|
-
reject(new AxiosError('Network Error',AxiosError.ERR_NETWORK,config,request,request));// Clean up request
|
3959
|
-
request=null;};// Handle timeout
|
3960
|
-
request.ontimeout=function handleTimeout(){var timeoutErrorMessage=config.timeout?'timeout of '+config.timeout+'ms exceeded':'timeout exceeded';var transitional=config.transitional||transitionalDefaults;if(config.timeoutErrorMessage){timeoutErrorMessage=config.timeoutErrorMessage;}reject(new AxiosError(timeoutErrorMessage,transitional.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,config,request));// Clean up request
|
3961
|
-
request=null;};// Add xsrf header
|
3968
|
+
reject(new AxiosError('Network Error',AxiosError.ERR_NETWORK,config,request,request));// Clean up request
|
3969
|
+
request=null;};// Handle timeout
|
3970
|
+
request.ontimeout=function handleTimeout(){var timeoutErrorMessage=config.timeout?'timeout of '+config.timeout+'ms exceeded':'timeout exceeded';var transitional=config.transitional||transitionalDefaults;if(config.timeoutErrorMessage){timeoutErrorMessage=config.timeoutErrorMessage;}reject(new AxiosError(timeoutErrorMessage,transitional.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,config,request));// Clean up request
|
3971
|
+
request=null;};// Add xsrf header
|
3962
3972
|
// This is only done if running in a standard browser environment.
|
3963
3973
|
// Specifically not if we're in a web worker, or react-native.
|
3964
|
-
if(utils.isStandardBrowserEnv()){// Add xsrf header
|
3965
|
-
var xsrfValue=(config.withCredentials||isURLSameOrigin(fullPath))&&config.xsrfCookieName?cookies.read(config.xsrfCookieName):undefined;if(xsrfValue){requestHeaders[config.xsrfHeaderName]=xsrfValue;}}// Add headers to the request
|
3966
|
-
if('setRequestHeader'in request){utils.forEach(requestHeaders,function setRequestHeader(val,key){if(typeof requestData==='undefined'&&key.toLowerCase()==='content-type'){// Remove Content-Type if data is undefined
|
3967
|
-
delete requestHeaders[key];}else {// Otherwise add header to the request
|
3968
|
-
request.setRequestHeader(key,val);}});}// Add withCredentials to request if needed
|
3969
|
-
if(!utils.isUndefined(config.withCredentials)){request.withCredentials=!!config.withCredentials;}// Add responseType to request if needed
|
3970
|
-
if(responseType&&responseType!=='json'){request.responseType=config.responseType;}// Handle progress if needed
|
3971
|
-
if(typeof config.onDownloadProgress==='function'){request.addEventListener('progress',config.onDownloadProgress);}// Not all browsers support upload events
|
3972
|
-
if(typeof config.onUploadProgress==='function'&&request.upload){request.upload.addEventListener('progress',config.onUploadProgress);}if(config.cancelToken||config.signal){// Handle cancellation
|
3974
|
+
if(utils.isStandardBrowserEnv()){// Add xsrf header
|
3975
|
+
var xsrfValue=(config.withCredentials||isURLSameOrigin(fullPath))&&config.xsrfCookieName?cookies.read(config.xsrfCookieName):undefined;if(xsrfValue){requestHeaders[config.xsrfHeaderName]=xsrfValue;}}// Add headers to the request
|
3976
|
+
if('setRequestHeader'in request){utils.forEach(requestHeaders,function setRequestHeader(val,key){if(typeof requestData==='undefined'&&key.toLowerCase()==='content-type'){// Remove Content-Type if data is undefined
|
3977
|
+
delete requestHeaders[key];}else {// Otherwise add header to the request
|
3978
|
+
request.setRequestHeader(key,val);}});}// Add withCredentials to request if needed
|
3979
|
+
if(!utils.isUndefined(config.withCredentials)){request.withCredentials=!!config.withCredentials;}// Add responseType to request if needed
|
3980
|
+
if(responseType&&responseType!=='json'){request.responseType=config.responseType;}// Handle progress if needed
|
3981
|
+
if(typeof config.onDownloadProgress==='function'){request.addEventListener('progress',config.onDownloadProgress);}// Not all browsers support upload events
|
3982
|
+
if(typeof config.onUploadProgress==='function'&&request.upload){request.upload.addEventListener('progress',config.onUploadProgress);}if(config.cancelToken||config.signal){// Handle cancellation
|
3973
3983
|
// eslint-disable-next-line func-names
|
3974
|
-
onCanceled=function onCanceled(cancel){if(!request){return;}reject(!cancel||cancel&&cancel.type?new CanceledError():cancel);request.abort();request=null;};config.cancelToken&&config.cancelToken.subscribe(onCanceled);if(config.signal){config.signal.aborted?onCanceled():config.signal.addEventListener('abort',onCanceled);}}if(!requestData){requestData=null;}var protocol=parseProtocol(fullPath);if(protocol&&['http','https','file'].indexOf(protocol)===-1){reject(new AxiosError('Unsupported protocol '+protocol+':',AxiosError.ERR_BAD_REQUEST,config));return;}// Send the request
|
3975
|
-
request.send(requestData);});};return xhr;}
|
3984
|
+
onCanceled=function onCanceled(cancel){if(!request){return;}reject(!cancel||cancel&&cancel.type?new CanceledError():cancel);request.abort();request=null;};config.cancelToken&&config.cancelToken.subscribe(onCanceled);if(config.signal){config.signal.aborted?onCanceled():config.signal.addEventListener('abort',onCanceled);}}if(!requestData){requestData=null;}var protocol=parseProtocol(fullPath);if(protocol&&['http','https','file'].indexOf(protocol)===-1){reject(new AxiosError('Unsupported protocol '+protocol+':',AxiosError.ERR_BAD_REQUEST,config));return;}// Send the request
|
3985
|
+
request.send(requestData);});};return xhr;}
|
3976
3986
|
|
3977
3987
|
var _null;var hasRequired_null;function require_null(){if(hasRequired_null)return _null;hasRequired_null=1;// eslint-disable-next-line strict
|
3978
|
-
_null=null;return _null;}
|
3988
|
+
_null=null;return _null;}
|
3979
3989
|
|
3980
3990
|
var utils$5=utils$9;var normalizeHeaderName=normalizeHeaderName$1;var AxiosError$1=requireAxiosError();var transitionalDefaults=transitional;var toFormData=requireToFormData();var DEFAULT_CONTENT_TYPE={'Content-Type':'application/x-www-form-urlencoded'};function setContentTypeIfUnset(headers,value){if(!utils$5.isUndefined(headers)&&utils$5.isUndefined(headers['Content-Type'])){headers['Content-Type']=value;}}function getDefaultAdapter(){var adapter;if(typeof XMLHttpRequest!=='undefined'){// For browsers use XHR adapter
|
3981
|
-
adapter=requireXhr();}else if(typeof browser$1!=='undefined'&&Object.prototype.toString.call(browser$1)==='[object process]'){// For node use HTTP adapter
|
3982
|
-
adapter=requireXhr();}return adapter;}function stringifySafely(rawValue,parser,encoder){if(utils$5.isString(rawValue)){try{(parser||JSON.parse)(rawValue);return utils$5.trim(rawValue);}catch(e){if(e.name!=='SyntaxError'){throw e;}}}return (encoder||JSON.stringify)(rawValue);}var defaults$3={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function transformRequest(data,headers){normalizeHeaderName(headers,'Accept');normalizeHeaderName(headers,'Content-Type');if(utils$5.isFormData(data)||utils$5.isArrayBuffer(data)||utils$5.isBuffer(data)||utils$5.isStream(data)||utils$5.isFile(data)||utils$5.isBlob(data)){return data;}if(utils$5.isArrayBufferView(data)){return data.buffer;}if(utils$5.isURLSearchParams(data)){setContentTypeIfUnset(headers,'application/x-www-form-urlencoded;charset=utf-8');return data.toString();}var isObjectPayload=utils$5.isObject(data);var contentType=headers&&headers['Content-Type'];var isFileList;if((isFileList=utils$5.isFileList(data))||isObjectPayload&&contentType==='multipart/form-data'){var _FormData=this.env&&this.env.FormData;return toFormData(isFileList?{'files[]':data}:data,_FormData&&new _FormData());}else if(isObjectPayload||contentType==='application/json'){setContentTypeIfUnset(headers,'application/json');return stringifySafely(data);}return data;}],transformResponse:[function transformResponse(data){var transitional=this.transitional||defaults$3.transitional;var silentJSONParsing=transitional&&transitional.silentJSONParsing;var forcedJSONParsing=transitional&&transitional.forcedJSONParsing;var strictJSONParsing=!silentJSONParsing&&this.responseType==='json';if(strictJSONParsing||forcedJSONParsing&&utils$5.isString(data)&&data.length){try{return JSON.parse(data);}catch(e){if(strictJSONParsing){if(e.name==='SyntaxError'){throw AxiosError$1.from(e,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response);}throw e;}}}return data;}],/**
|
3991
|
+
adapter=requireXhr();}else if(typeof browser$1!=='undefined'&&Object.prototype.toString.call(browser$1)==='[object process]'){// For node use HTTP adapter
|
3992
|
+
adapter=requireXhr();}return adapter;}function stringifySafely(rawValue,parser,encoder){if(utils$5.isString(rawValue)){try{(parser||JSON.parse)(rawValue);return utils$5.trim(rawValue);}catch(e){if(e.name!=='SyntaxError'){throw e;}}}return (encoder||JSON.stringify)(rawValue);}var defaults$3={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function transformRequest(data,headers){normalizeHeaderName(headers,'Accept');normalizeHeaderName(headers,'Content-Type');if(utils$5.isFormData(data)||utils$5.isArrayBuffer(data)||utils$5.isBuffer(data)||utils$5.isStream(data)||utils$5.isFile(data)||utils$5.isBlob(data)){return data;}if(utils$5.isArrayBufferView(data)){return data.buffer;}if(utils$5.isURLSearchParams(data)){setContentTypeIfUnset(headers,'application/x-www-form-urlencoded;charset=utf-8');return data.toString();}var isObjectPayload=utils$5.isObject(data);var contentType=headers&&headers['Content-Type'];var isFileList;if((isFileList=utils$5.isFileList(data))||isObjectPayload&&contentType==='multipart/form-data'){var _FormData=this.env&&this.env.FormData;return toFormData(isFileList?{'files[]':data}:data,_FormData&&new _FormData());}else if(isObjectPayload||contentType==='application/json'){setContentTypeIfUnset(headers,'application/json');return stringifySafely(data);}return data;}],transformResponse:[function transformResponse(data){var transitional=this.transitional||defaults$3.transitional;var silentJSONParsing=transitional&&transitional.silentJSONParsing;var forcedJSONParsing=transitional&&transitional.forcedJSONParsing;var strictJSONParsing=!silentJSONParsing&&this.responseType==='json';if(strictJSONParsing||forcedJSONParsing&&utils$5.isString(data)&&data.length){try{return JSON.parse(data);}catch(e){if(strictJSONParsing){if(e.name==='SyntaxError'){throw AxiosError$1.from(e,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response);}throw e;}}}return data;}],/**
|
3983
3993
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
3984
3994
|
* timeout is not created.
|
3985
3995
|
*/timeout:0,xsrfCookieName:'XSRF-TOKEN',xsrfHeaderName:'X-XSRF-TOKEN',maxContentLength:-1,maxBodyLength:-1,env:{FormData:require_null()},validateStatus:function validateStatus(status){return status>=200&&status<300;},headers:{common:{'Accept':'application/json, text/plain, */*'}}};utils$5.forEach(['delete','get','head'],function forEachMethodNoData(method){defaults$3.headers[method]={};});utils$5.forEach(['post','put','patch'],function forEachMethodWithData(method){defaults$3.headers[method]=utils$5.merge(DEFAULT_CONTENT_TYPE);});var defaults_1=defaults$3;
|
@@ -4003,11 +4013,11 @@ var utils$3=utils$9;var transformData=transformData$1;var isCancel=requireIsCanc
|
|
4003
4013
|
* @param {object} config The config that is to be used for the request
|
4004
4014
|
* @returns {Promise} The Promise to be fulfilled
|
4005
4015
|
*/var dispatchRequest$1=function dispatchRequest(config){throwIfCancellationRequested(config);// Ensure headers exist
|
4006
|
-
config.headers=config.headers||{};// Transform request data
|
4007
|
-
config.data=transformData.call(config,config.data,config.headers,config.transformRequest);// Flatten headers
|
4008
|
-
config.headers=utils$3.merge(config.headers.common||{},config.headers[config.method]||{},config.headers);utils$3.forEach(['delete','get','head','post','put','patch','common'],function cleanHeaderConfig(method){delete config.headers[method];});var adapter=config.adapter||defaults$1.adapter;return adapter(config).then(function onAdapterResolution(response){throwIfCancellationRequested(config);// Transform response data
|
4009
|
-
response.data=transformData.call(config,response.data,response.headers,config.transformResponse);return response;},function onAdapterRejection(reason){if(!isCancel(reason)){throwIfCancellationRequested(config);// Transform response data
|
4010
|
-
if(reason&&reason.response){reason.response.data=transformData.call(config,reason.response.data,reason.response.headers,config.transformResponse);}}return Promise.reject(reason);});};
|
4016
|
+
config.headers=config.headers||{};// Transform request data
|
4017
|
+
config.data=transformData.call(config,config.data,config.headers,config.transformRequest);// Flatten headers
|
4018
|
+
config.headers=utils$3.merge(config.headers.common||{},config.headers[config.method]||{},config.headers);utils$3.forEach(['delete','get','head','post','put','patch','common'],function cleanHeaderConfig(method){delete config.headers[method];});var adapter=config.adapter||defaults$1.adapter;return adapter(config).then(function onAdapterResolution(response){throwIfCancellationRequested(config);// Transform response data
|
4019
|
+
response.data=transformData.call(config,response.data,response.headers,config.transformResponse);return response;},function onAdapterRejection(reason){if(!isCancel(reason)){throwIfCancellationRequested(config);// Transform response data
|
4020
|
+
if(reason&&reason.response){reason.response.data=transformData.call(config,reason.response.data,reason.response.headers,config.transformResponse);}}return Promise.reject(reason);});};
|
4011
4021
|
|
4012
4022
|
var utils$2=utils$9;/**
|
4013
4023
|
* Config-specific merge-function which creates a new config-object
|
@@ -4017,11 +4027,11 @@ var utils$2=utils$9;/**
|
|
4017
4027
|
* @param {Object} config2
|
4018
4028
|
* @returns {Object} New object resulting from merging config2 to config1
|
4019
4029
|
*/var mergeConfig$2=function mergeConfig(config1,config2){// eslint-disable-next-line no-param-reassign
|
4020
|
-
config2=config2||{};var config={};function getMergedValue(target,source){if(utils$2.isPlainObject(target)&&utils$2.isPlainObject(source)){return utils$2.merge(target,source);}else if(utils$2.isPlainObject(source)){return utils$2.merge({},source);}else if(utils$2.isArray(source)){return source.slice();}return source;}// eslint-disable-next-line consistent-return
|
4021
|
-
function mergeDeepProperties(prop){if(!utils$2.isUndefined(config2[prop])){return getMergedValue(config1[prop],config2[prop]);}else if(!utils$2.isUndefined(config1[prop])){return getMergedValue(undefined,config1[prop]);}}// eslint-disable-next-line consistent-return
|
4022
|
-
function valueFromConfig2(prop){if(!utils$2.isUndefined(config2[prop])){return getMergedValue(undefined,config2[prop]);}}// eslint-disable-next-line consistent-return
|
4023
|
-
function defaultToConfig2(prop){if(!utils$2.isUndefined(config2[prop])){return getMergedValue(undefined,config2[prop]);}else if(!utils$2.isUndefined(config1[prop])){return getMergedValue(undefined,config1[prop]);}}// eslint-disable-next-line consistent-return
|
4024
|
-
function mergeDirectKeys(prop){if(prop in config2){return getMergedValue(config1[prop],config2[prop]);}else if(prop in config1){return getMergedValue(undefined,config1[prop]);}}var mergeMap={'url':valueFromConfig2,'method':valueFromConfig2,'data':valueFromConfig2,'baseURL':defaultToConfig2,'transformRequest':defaultToConfig2,'transformResponse':defaultToConfig2,'paramsSerializer':defaultToConfig2,'timeout':defaultToConfig2,'timeoutMessage':defaultToConfig2,'withCredentials':defaultToConfig2,'adapter':defaultToConfig2,'responseType':defaultToConfig2,'xsrfCookieName':defaultToConfig2,'xsrfHeaderName':defaultToConfig2,'onUploadProgress':defaultToConfig2,'onDownloadProgress':defaultToConfig2,'decompress':defaultToConfig2,'maxContentLength':defaultToConfig2,'maxBodyLength':defaultToConfig2,'beforeRedirect':defaultToConfig2,'transport':defaultToConfig2,'httpAgent':defaultToConfig2,'httpsAgent':defaultToConfig2,'cancelToken':defaultToConfig2,'socketPath':defaultToConfig2,'responseEncoding':defaultToConfig2,'validateStatus':mergeDirectKeys};utils$2.forEach(Object.keys(config1).concat(Object.keys(config2)),function computeConfigValue(prop){var merge=mergeMap[prop]||mergeDeepProperties;var configValue=merge(prop);utils$2.isUndefined(configValue)&&merge!==mergeDirectKeys||(config[prop]=configValue);});return config;};
|
4030
|
+
config2=config2||{};var config={};function getMergedValue(target,source){if(utils$2.isPlainObject(target)&&utils$2.isPlainObject(source)){return utils$2.merge(target,source);}else if(utils$2.isPlainObject(source)){return utils$2.merge({},source);}else if(utils$2.isArray(source)){return source.slice();}return source;}// eslint-disable-next-line consistent-return
|
4031
|
+
function mergeDeepProperties(prop){if(!utils$2.isUndefined(config2[prop])){return getMergedValue(config1[prop],config2[prop]);}else if(!utils$2.isUndefined(config1[prop])){return getMergedValue(undefined,config1[prop]);}}// eslint-disable-next-line consistent-return
|
4032
|
+
function valueFromConfig2(prop){if(!utils$2.isUndefined(config2[prop])){return getMergedValue(undefined,config2[prop]);}}// eslint-disable-next-line consistent-return
|
4033
|
+
function defaultToConfig2(prop){if(!utils$2.isUndefined(config2[prop])){return getMergedValue(undefined,config2[prop]);}else if(!utils$2.isUndefined(config1[prop])){return getMergedValue(undefined,config1[prop]);}}// eslint-disable-next-line consistent-return
|
4034
|
+
function mergeDirectKeys(prop){if(prop in config2){return getMergedValue(config1[prop],config2[prop]);}else if(prop in config1){return getMergedValue(undefined,config1[prop]);}}var mergeMap={'url':valueFromConfig2,'method':valueFromConfig2,'data':valueFromConfig2,'baseURL':defaultToConfig2,'transformRequest':defaultToConfig2,'transformResponse':defaultToConfig2,'paramsSerializer':defaultToConfig2,'timeout':defaultToConfig2,'timeoutMessage':defaultToConfig2,'withCredentials':defaultToConfig2,'adapter':defaultToConfig2,'responseType':defaultToConfig2,'xsrfCookieName':defaultToConfig2,'xsrfHeaderName':defaultToConfig2,'onUploadProgress':defaultToConfig2,'onDownloadProgress':defaultToConfig2,'decompress':defaultToConfig2,'maxContentLength':defaultToConfig2,'maxBodyLength':defaultToConfig2,'beforeRedirect':defaultToConfig2,'transport':defaultToConfig2,'httpAgent':defaultToConfig2,'httpsAgent':defaultToConfig2,'cancelToken':defaultToConfig2,'socketPath':defaultToConfig2,'responseEncoding':defaultToConfig2,'validateStatus':mergeDirectKeys};utils$2.forEach(Object.keys(config1).concat(Object.keys(config2)),function computeConfigValue(prop){var merge=mergeMap[prop]||mergeDeepProperties;var configValue=merge(prop);utils$2.isUndefined(configValue)&&merge!==mergeDirectKeys||(config[prop]=configValue);});return config;};
|
4025
4035
|
|
4026
4036
|
var data;var hasRequiredData;function requireData(){if(hasRequiredData)return data;hasRequiredData=1;data={"version":"0.27.2"};return data;}
|
4027
4037
|
|
@@ -4033,8 +4043,8 @@ var VERSION=requireData().version;var AxiosError=requireAxiosError();var validat
|
|
4033
4043
|
* @param {string?} message - some message with additional info
|
4034
4044
|
* @returns {function}
|
4035
4045
|
*/validators$1.transitional=function transitional(validator,version,message){function formatMessage(opt,desc){return '[Axios v'+VERSION+'] Transitional option \''+opt+'\''+desc+(message?'. '+message:'');}// eslint-disable-next-line func-names
|
4036
|
-
return function(value,opt,opts){if(validator===false){throw new AxiosError(formatMessage(opt,' has been removed'+(version?' in '+version:'')),AxiosError.ERR_DEPRECATED);}if(version&&!deprecatedWarnings[opt]){deprecatedWarnings[opt]=true;// eslint-disable-next-line no-console
|
4037
|
-
console.warn(formatMessage(opt,' has been deprecated since v'+version+' and will be removed in the near future'));}return validator?validator(value,opt,opts):true;};};/**
|
4046
|
+
return function(value,opt,opts){if(validator===false){throw new AxiosError(formatMessage(opt,' has been removed'+(version?' in '+version:'')),AxiosError.ERR_DEPRECATED);}if(version&&!deprecatedWarnings[opt]){deprecatedWarnings[opt]=true;// eslint-disable-next-line no-console
|
4047
|
+
console.warn(formatMessage(opt,' has been deprecated since v'+version+' and will be removed in the near future'));}return validator?validator(value,opt,opts):true;};};/**
|
4038
4048
|
* Assert object's properties type
|
4039
4049
|
* @param {object} options
|
4040
4050
|
* @param {object} schema
|
@@ -4050,58 +4060,58 @@ var utils$1=utils$9;var buildURL=buildURL$1;var InterceptorManager=InterceptorMa
|
|
4050
4060
|
*
|
4051
4061
|
* @param {Object} config The config specific for this request (merged with this.defaults)
|
4052
4062
|
*/Axios$1.prototype.request=function request(configOrUrl,config){/*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API
|
4053
|
-
if(typeof configOrUrl==='string'){config=config||{};config.url=configOrUrl;}else {config=configOrUrl||{};}config=mergeConfig$1(this.defaults,config);// Set config.method
|
4054
|
-
if(config.method){config.method=config.method.toLowerCase();}else if(this.defaults.method){config.method=this.defaults.method.toLowerCase();}else {config.method='get';}var transitional=config.transitional;if(transitional!==undefined){validator.assertOptions(transitional,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false);}// filter out skipped interceptors
|
4055
|
-
var requestInterceptorChain=[];var synchronousRequestInterceptors=true;this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor){if(typeof interceptor.runWhen==='function'&&interceptor.runWhen(config)===false){return;}synchronousRequestInterceptors=synchronousRequestInterceptors&&interceptor.synchronous;requestInterceptorChain.unshift(interceptor.fulfilled,interceptor.rejected);});var responseInterceptorChain=[];this.interceptors.response.forEach(function pushResponseInterceptors(interceptor){responseInterceptorChain.push(interceptor.fulfilled,interceptor.rejected);});var promise;if(!synchronousRequestInterceptors){var chain=[dispatchRequest,undefined];Array.prototype.unshift.apply(chain,requestInterceptorChain);chain=chain.concat(responseInterceptorChain);promise=Promise.resolve(config);while(chain.length){promise=promise.then(chain.shift(),chain.shift());}return promise;}var newConfig=config;while(requestInterceptorChain.length){var onFulfilled=requestInterceptorChain.shift();var onRejected=requestInterceptorChain.shift();try{newConfig=onFulfilled(newConfig);}catch(error){onRejected(error);break;}}try{promise=dispatchRequest(newConfig);}catch(error){return Promise.reject(error);}while(responseInterceptorChain.length){promise=promise.then(responseInterceptorChain.shift(),responseInterceptorChain.shift());}return promise;};Axios$1.prototype.getUri=function getUri(config){config=mergeConfig$1(this.defaults,config);var fullPath=buildFullPath(config.baseURL,config.url);return buildURL(fullPath,config.params,config.paramsSerializer);};// Provide aliases for supported request methods
|
4063
|
+
if(typeof configOrUrl==='string'){config=config||{};config.url=configOrUrl;}else {config=configOrUrl||{};}config=mergeConfig$1(this.defaults,config);// Set config.method
|
4064
|
+
if(config.method){config.method=config.method.toLowerCase();}else if(this.defaults.method){config.method=this.defaults.method.toLowerCase();}else {config.method='get';}var transitional=config.transitional;if(transitional!==undefined){validator.assertOptions(transitional,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false);}// filter out skipped interceptors
|
4065
|
+
var requestInterceptorChain=[];var synchronousRequestInterceptors=true;this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor){if(typeof interceptor.runWhen==='function'&&interceptor.runWhen(config)===false){return;}synchronousRequestInterceptors=synchronousRequestInterceptors&&interceptor.synchronous;requestInterceptorChain.unshift(interceptor.fulfilled,interceptor.rejected);});var responseInterceptorChain=[];this.interceptors.response.forEach(function pushResponseInterceptors(interceptor){responseInterceptorChain.push(interceptor.fulfilled,interceptor.rejected);});var promise;if(!synchronousRequestInterceptors){var chain=[dispatchRequest,undefined];Array.prototype.unshift.apply(chain,requestInterceptorChain);chain=chain.concat(responseInterceptorChain);promise=Promise.resolve(config);while(chain.length){promise=promise.then(chain.shift(),chain.shift());}return promise;}var newConfig=config;while(requestInterceptorChain.length){var onFulfilled=requestInterceptorChain.shift();var onRejected=requestInterceptorChain.shift();try{newConfig=onFulfilled(newConfig);}catch(error){onRejected(error);break;}}try{promise=dispatchRequest(newConfig);}catch(error){return Promise.reject(error);}while(responseInterceptorChain.length){promise=promise.then(responseInterceptorChain.shift(),responseInterceptorChain.shift());}return promise;};Axios$1.prototype.getUri=function getUri(config){config=mergeConfig$1(this.defaults,config);var fullPath=buildFullPath(config.baseURL,config.url);return buildURL(fullPath,config.params,config.paramsSerializer);};// Provide aliases for supported request methods
|
4056
4066
|
utils$1.forEach(['delete','get','head','options'],function forEachMethodNoData(method){/*eslint func-names:0*/Axios$1.prototype[method]=function(url,config){return this.request(mergeConfig$1(config||{},{method:method,url:url,data:(config||{}).data}));};});utils$1.forEach(['post','put','patch'],function forEachMethodWithData(method){/*eslint func-names:0*/function generateHTTPMethod(isForm){return function httpMethod(url,data,config){return this.request(mergeConfig$1(config||{},{method:method,headers:isForm?{'Content-Type':'multipart/form-data'}:{},url:url,data:data}));};}Axios$1.prototype[method]=generateHTTPMethod();Axios$1.prototype[method+'Form']=generateHTTPMethod(true);});var Axios_1=Axios$1;
|
4057
4067
|
|
4058
4068
|
var CancelToken_1;var hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var CanceledError=requireCanceledError();/**
|
4059
|
-
|
4060
|
-
|
4061
|
-
|
4062
|
-
|
4063
|
-
|
4064
|
-
this.promise.then(function(cancel){if(!token._listeners)return;var i;var l=token._listeners.length;for(i=0;i<l;i++){token._listeners[i](cancel);}token._listeners=null;});// eslint-disable-next-line func-names
|
4065
|
-
this.promise.then=function(onfulfilled){var _resolve;// eslint-disable-next-line func-names
|
4066
|
-
var promise=new Promise(function(resolve){token.subscribe(resolve);_resolve=resolve;}).then(onfulfilled);promise.cancel=function reject(){token.unsubscribe(_resolve);};return promise;};executor(function cancel(message){if(token.reason){// Cancellation has already been requested
|
4067
|
-
return;}token.reason=new CanceledError(message);resolvePromise(token.reason);});}/**
|
4068
|
-
|
4069
|
-
|
4070
|
-
|
4071
|
-
|
4072
|
-
|
4073
|
-
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4069
|
+
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
4070
|
+
*
|
4071
|
+
* @class
|
4072
|
+
* @param {Function} executor The executor function.
|
4073
|
+
*/function CancelToken(executor){if(typeof executor!=='function'){throw new TypeError('executor must be a function.');}var resolvePromise;this.promise=new Promise(function promiseExecutor(resolve){resolvePromise=resolve;});var token=this;// eslint-disable-next-line func-names
|
4074
|
+
this.promise.then(function(cancel){if(!token._listeners)return;var i;var l=token._listeners.length;for(i=0;i<l;i++){token._listeners[i](cancel);}token._listeners=null;});// eslint-disable-next-line func-names
|
4075
|
+
this.promise.then=function(onfulfilled){var _resolve;// eslint-disable-next-line func-names
|
4076
|
+
var promise=new Promise(function(resolve){token.subscribe(resolve);_resolve=resolve;}).then(onfulfilled);promise.cancel=function reject(){token.unsubscribe(_resolve);};return promise;};executor(function cancel(message){if(token.reason){// Cancellation has already been requested
|
4077
|
+
return;}token.reason=new CanceledError(message);resolvePromise(token.reason);});}/**
|
4078
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
4079
|
+
*/CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason){throw this.reason;}};/**
|
4080
|
+
* Subscribe to the cancel signal
|
4081
|
+
*/CancelToken.prototype.subscribe=function subscribe(listener){if(this.reason){listener(this.reason);return;}if(this._listeners){this._listeners.push(listener);}else {this._listeners=[listener];}};/**
|
4082
|
+
* Unsubscribe from the cancel signal
|
4083
|
+
*/CancelToken.prototype.unsubscribe=function unsubscribe(listener){if(!this._listeners){return;}var index=this._listeners.indexOf(listener);if(index!==-1){this._listeners.splice(index,1);}};/**
|
4084
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
4085
|
+
* cancels the `CancelToken`.
|
4086
|
+
*/CancelToken.source=function source(){var cancel;var token=new CancelToken(function executor(c){cancel=c;});return {token:token,cancel:cancel};};CancelToken_1=CancelToken;return CancelToken_1;}
|
4077
4087
|
|
4078
4088
|
var spread;var hasRequiredSpread;function requireSpread(){if(hasRequiredSpread)return spread;hasRequiredSpread=1;/**
|
4079
|
-
|
4080
|
-
|
4081
|
-
|
4082
|
-
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4095
|
-
|
4096
|
-
|
4097
|
-
|
4089
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
4090
|
+
*
|
4091
|
+
* Common use case would be to use `Function.prototype.apply`.
|
4092
|
+
*
|
4093
|
+
* ```js
|
4094
|
+
* function f(x, y, z) {}
|
4095
|
+
* var args = [1, 2, 3];
|
4096
|
+
* f.apply(null, args);
|
4097
|
+
* ```
|
4098
|
+
*
|
4099
|
+
* With `spread` this example can be re-written.
|
4100
|
+
*
|
4101
|
+
* ```js
|
4102
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
4103
|
+
* ```
|
4104
|
+
*
|
4105
|
+
* @param {Function} callback
|
4106
|
+
* @returns {Function}
|
4107
|
+
*/spread=function spread(callback){return function wrap(arr){return callback.apply(null,arr);};};return spread;}
|
4098
4108
|
|
4099
4109
|
var isAxiosError;var hasRequiredIsAxiosError;function requireIsAxiosError(){if(hasRequiredIsAxiosError)return isAxiosError;hasRequiredIsAxiosError=1;var utils=utils$9;/**
|
4100
|
-
|
4101
|
-
|
4102
|
-
|
4103
|
-
|
4104
|
-
|
4110
|
+
* Determines whether the payload is an error thrown by Axios
|
4111
|
+
*
|
4112
|
+
* @param {*} payload The value to test
|
4113
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
4114
|
+
*/isAxiosError=function isAxiosError(payload){return utils.isObject(payload)&&payload.isAxiosError===true;};return isAxiosError;}
|
4105
4115
|
|
4106
4116
|
var utils=utils$9;var bind=bind$2;var Axios=Axios_1;var mergeConfig=mergeConfig$2;var defaults=defaults_1;/**
|
4107
4117
|
* Create an instance of Axios
|
@@ -4109,30 +4119,30 @@ var utils=utils$9;var bind=bind$2;var Axios=Axios_1;var mergeConfig=mergeConfig$
|
|
4109
4119
|
* @param {Object} defaultConfig The default config for the instance
|
4110
4120
|
* @return {Axios} A new instance of Axios
|
4111
4121
|
*/function createInstance(defaultConfig){var context=new Axios(defaultConfig);var instance=bind(Axios.prototype.request,context);// Copy axios.prototype to instance
|
4112
|
-
utils.extend(instance,Axios.prototype,context);// Copy context to instance
|
4113
|
-
utils.extend(instance,context);// Factory for creating new instances
|
4114
|
-
instance.create=function create(instanceConfig){return createInstance(mergeConfig(defaultConfig,instanceConfig));};return instance;}// Create the default instance to be exported
|
4115
|
-
var axios$
|
4116
|
-
axios$
|
4117
|
-
axios$
|
4118
|
-
axios$
|
4119
|
-
axios$
|
4120
|
-
axios$
|
4121
|
-
axios$
|
4122
|
-
|
4123
|
-
|
4124
|
-
|
4122
|
+
utils.extend(instance,Axios.prototype,context);// Copy context to instance
|
4123
|
+
utils.extend(instance,context);// Factory for creating new instances
|
4124
|
+
instance.create=function create(instanceConfig){return createInstance(mergeConfig(defaultConfig,instanceConfig));};return instance;}// Create the default instance to be exported
|
4125
|
+
var axios$1=createInstance(defaults);// Expose Axios class to allow class inheritance
|
4126
|
+
axios$1.Axios=Axios;// Expose Cancel & CancelToken
|
4127
|
+
axios$1.CanceledError=requireCanceledError();axios$1.CancelToken=requireCancelToken();axios$1.isCancel=requireIsCancel();axios$1.VERSION=requireData().version;axios$1.toFormData=requireToFormData();// Expose AxiosError class
|
4128
|
+
axios$1.AxiosError=requireAxiosError();// alias for CanceledError for backward compatibility
|
4129
|
+
axios$1.Cancel=axios$1.CanceledError;// Expose all/spread
|
4130
|
+
axios$1.all=function all(promises){return Promise.all(promises);};axios$1.spread=requireSpread();// Expose isAxiosError
|
4131
|
+
axios$1.isAxiosError=requireIsAxiosError();axios$2.exports=axios$1;// Allow use of default import syntax in TypeScript
|
4132
|
+
axiosExports.default=axios$1;
|
4133
|
+
|
4134
|
+
(function(module){module.exports=axiosExports;})(axios$3);var axios = /*@__PURE__*/getDefaultExportFromCjs(axiosExports$1);
|
4125
4135
|
|
4126
4136
|
var denyList=new Set(['ENOTFOUND','ENETUNREACH',// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
|
4127
|
-
'UNABLE_TO_GET_ISSUER_CERT','UNABLE_TO_GET_CRL','UNABLE_TO_DECRYPT_CERT_SIGNATURE','UNABLE_TO_DECRYPT_CRL_SIGNATURE','UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY','CERT_SIGNATURE_FAILURE','CRL_SIGNATURE_FAILURE','CERT_NOT_YET_VALID','CERT_HAS_EXPIRED','CRL_NOT_YET_VALID','CRL_HAS_EXPIRED','ERROR_IN_CERT_NOT_BEFORE_FIELD','ERROR_IN_CERT_NOT_AFTER_FIELD','ERROR_IN_CRL_LAST_UPDATE_FIELD','ERROR_IN_CRL_NEXT_UPDATE_FIELD','OUT_OF_MEM','DEPTH_ZERO_SELF_SIGNED_CERT','SELF_SIGNED_CERT_IN_CHAIN','UNABLE_TO_GET_ISSUER_CERT_LOCALLY','UNABLE_TO_VERIFY_LEAF_SIGNATURE','CERT_CHAIN_TOO_LONG','CERT_REVOKED','INVALID_CA','PATH_LENGTH_EXCEEDED','INVALID_PURPOSE','CERT_UNTRUSTED','CERT_REJECTED','HOSTNAME_MISMATCH']);// TODO: Use `error?.code` when targeting Node.js 14
|
4128
|
-
var isRetryAllowed=function isRetryAllowed(error){return !denyList.has(error&&error.code);};
|
4137
|
+
'UNABLE_TO_GET_ISSUER_CERT','UNABLE_TO_GET_CRL','UNABLE_TO_DECRYPT_CERT_SIGNATURE','UNABLE_TO_DECRYPT_CRL_SIGNATURE','UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY','CERT_SIGNATURE_FAILURE','CRL_SIGNATURE_FAILURE','CERT_NOT_YET_VALID','CERT_HAS_EXPIRED','CRL_NOT_YET_VALID','CRL_HAS_EXPIRED','ERROR_IN_CERT_NOT_BEFORE_FIELD','ERROR_IN_CERT_NOT_AFTER_FIELD','ERROR_IN_CRL_LAST_UPDATE_FIELD','ERROR_IN_CRL_NEXT_UPDATE_FIELD','OUT_OF_MEM','DEPTH_ZERO_SELF_SIGNED_CERT','SELF_SIGNED_CERT_IN_CHAIN','UNABLE_TO_GET_ISSUER_CERT_LOCALLY','UNABLE_TO_VERIFY_LEAF_SIGNATURE','CERT_CHAIN_TOO_LONG','CERT_REVOKED','INVALID_CA','PATH_LENGTH_EXCEEDED','INVALID_PURPOSE','CERT_UNTRUSTED','CERT_REJECTED','HOSTNAME_MISMATCH']);// TODO: Use `error?.code` when targeting Node.js 14
|
4138
|
+
var isRetryAllowed=function isRetryAllowed(error){return !denyList.has(error&&error.code);};
|
4129
4139
|
|
4130
4140
|
function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else {Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});}keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else {ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key]=value;}return obj;}var namespace='axios-retry';/**
|
4131
4141
|
* @param {Error} error
|
4132
4142
|
* @return {boolean}
|
4133
4143
|
*/function isNetworkError(error){return !error.response&&Boolean(error.code)&&// Prevents retrying cancelled requests
|
4134
|
-
error.code!=='ECONNABORTED'&&// Prevents retrying timed out requests
|
4135
|
-
isRetryAllowed
|
4144
|
+
error.code!=='ECONNABORTED'&&// Prevents retrying timed out requests
|
4145
|
+
isRetryAllowed(error);// Prevents retrying unsafe errors
|
4136
4146
|
}var SAFE_HTTP_METHODS=['get','head','options'];var IDEMPOTENT_HTTP_METHODS=SAFE_HTTP_METHODS.concat(['put','delete']);/**
|
4137
4147
|
* @param {Error} error
|
4138
4148
|
* @return {boolean}
|
@@ -4140,24 +4150,20 @@ isRetryAllowed$1(error);// Prevents retrying unsafe errors
|
|
4140
4150
|
* @param {Error} error
|
4141
4151
|
* @return {boolean}
|
4142
4152
|
*/function isSafeRequestError(error){if(!error.config){// Cannot determine if the request can be retried
|
4143
|
-
return false;}return isRetryableError(error)&&SAFE_HTTP_METHODS.indexOf(error.config.method)!==-1;}/**
|
4153
|
+
return false;}return isRetryableError(error)&&SAFE_HTTP_METHODS.indexOf(error.config.method)!==-1;}/**
|
4144
4154
|
* @param {Error} error
|
4145
4155
|
* @return {boolean}
|
4146
4156
|
*/function isIdempotentRequestError(error){if(!error.config){// Cannot determine if the request can be retried
|
4147
|
-
return false;}return isRetryableError(error)&&IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method)!==-1;}/**
|
4157
|
+
return false;}return isRetryableError(error)&&IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method)!==-1;}/**
|
4148
4158
|
* @param {Error} error
|
4149
4159
|
* @return {boolean}
|
4150
4160
|
*/function isNetworkOrIdempotentRequestError(error){return isNetworkError(error)||isIdempotentRequestError(error);}/**
|
4151
4161
|
* @return {number} - delay in milliseconds, always 0
|
4152
4162
|
*/function noDelay(){return 0;}/**
|
4153
|
-
* Set delayFactor 1000 for an exponential delay to occur on the order
|
4154
|
-
* of seconds
|
4155
4163
|
* @param {number} [retryNumber=0]
|
4156
|
-
* @param {Error} error - unused; for existing API of retryDelay callback
|
4157
|
-
* @param {number} [delayFactor=100] milliseconds
|
4158
4164
|
* @return {number} - delay in milliseconds
|
4159
|
-
*/function exponentialDelay(){var retryNumber=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var
|
4160
|
-
return delay+randomSum;}/**
|
4165
|
+
*/function exponentialDelay(){var retryNumber=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var delay=Math.pow(2,retryNumber)*100;var randomSum=delay*0.2*Math.random();// 0-20% of the delay
|
4166
|
+
return delay+randomSum;}/**
|
4161
4167
|
* Initializes and returns the retry state for the given request/config
|
4162
4168
|
* @param {AxiosRequestConfig} config
|
4163
4169
|
* @return {Object}
|
@@ -4230,10 +4236,10 @@ return delay+randomSum;}/**
|
|
4230
4236
|
* @param {Function} [defaultOptions.onRetry=()=>{}]
|
4231
4237
|
* A function to get notified when a retry occurs
|
4232
4238
|
*/function _shouldRetry(){_shouldRetry=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(retries,retryCondition,currentState,error){var shouldRetryOrPromise,shouldRetryPromiseResult;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:shouldRetryOrPromise=currentState.retryCount<retries&&retryCondition(error);// This could be a promise
|
4233
|
-
if(!(_typeof(shouldRetryOrPromise)==='object')){_context.next=12;break;}_context.prev=2;_context.next=5;return shouldRetryOrPromise;case 5:shouldRetryPromiseResult=_context.sent;return _context.abrupt("return",shouldRetryPromiseResult!==false);case 9:_context.prev=9;_context.t0=_context["catch"](2);return _context.abrupt("return",false);case 12:return _context.abrupt("return",shouldRetryOrPromise);case 13:case"end":return _context.stop();}},_callee,null,[[2,9]]);}));return _shouldRetry.apply(this,arguments);}function axiosRetry(axios,defaultOptions){axios.interceptors.request.use(function(config){var currentState=getCurrentState(config);currentState.lastRequestTime=Date.now();return config;});axios.interceptors.response.use(null,/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(error){var config,_getRequestOptions,_getRequestOptions$re,retries,_getRequestOptions$re2,retryCondition,_getRequestOptions$re3,retryDelay,_getRequestOptions$sh,shouldResetTimeout,_getRequestOptions$on,onRetry,currentState,delay,lastRequestDuration,timeout;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:config=error.config;// If we have no information to retry the request
|
4234
|
-
if(config){_context2.next=3;break;}return _context2.abrupt("return",Promise.reject(error));case 3:_getRequestOptions=getRequestOptions(config,defaultOptions),_getRequestOptions$re=_getRequestOptions.retries,retries=_getRequestOptions$re===void 0?3:_getRequestOptions$re,_getRequestOptions$re2=_getRequestOptions.retryCondition,retryCondition=_getRequestOptions$re2===void 0?isNetworkOrIdempotentRequestError:_getRequestOptions$re2,_getRequestOptions$re3=_getRequestOptions.retryDelay,retryDelay=_getRequestOptions$re3===void 0?noDelay:_getRequestOptions$re3,_getRequestOptions$sh=_getRequestOptions.shouldResetTimeout,shouldResetTimeout=_getRequestOptions$sh===void 0?false:_getRequestOptions$sh,_getRequestOptions$on=_getRequestOptions.onRetry,onRetry=_getRequestOptions$on===void 0?function(){}:_getRequestOptions$on;currentState=getCurrentState(config);_context2.next=7;return shouldRetry(retries,retryCondition,currentState,error);case 7:if(!_context2.sent){_context2.next=20;break;}currentState.retryCount+=1;delay=retryDelay(currentState.retryCount,error);// Axios fails merging this configuration to the default configuration because it has an issue
|
4239
|
+
if(!(_typeof(shouldRetryOrPromise)==='object')){_context.next=12;break;}_context.prev=2;_context.next=5;return shouldRetryOrPromise;case 5:shouldRetryPromiseResult=_context.sent;return _context.abrupt("return",shouldRetryPromiseResult!==false);case 9:_context.prev=9;_context.t0=_context["catch"](2);return _context.abrupt("return",false);case 12:return _context.abrupt("return",shouldRetryOrPromise);case 13:case"end":return _context.stop();}},_callee,null,[[2,9]]);}));return _shouldRetry.apply(this,arguments);}function axiosRetry(axios,defaultOptions){axios.interceptors.request.use(function(config){var currentState=getCurrentState(config);currentState.lastRequestTime=Date.now();return config;});axios.interceptors.response.use(null,/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(error){var config,_getRequestOptions,_getRequestOptions$re,retries,_getRequestOptions$re2,retryCondition,_getRequestOptions$re3,retryDelay,_getRequestOptions$sh,shouldResetTimeout,_getRequestOptions$on,onRetry,currentState,delay,lastRequestDuration,timeout;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:config=error.config;// If we have no information to retry the request
|
4240
|
+
if(config){_context2.next=3;break;}return _context2.abrupt("return",Promise.reject(error));case 3:_getRequestOptions=getRequestOptions(config,defaultOptions),_getRequestOptions$re=_getRequestOptions.retries,retries=_getRequestOptions$re===void 0?3:_getRequestOptions$re,_getRequestOptions$re2=_getRequestOptions.retryCondition,retryCondition=_getRequestOptions$re2===void 0?isNetworkOrIdempotentRequestError:_getRequestOptions$re2,_getRequestOptions$re3=_getRequestOptions.retryDelay,retryDelay=_getRequestOptions$re3===void 0?noDelay:_getRequestOptions$re3,_getRequestOptions$sh=_getRequestOptions.shouldResetTimeout,shouldResetTimeout=_getRequestOptions$sh===void 0?false:_getRequestOptions$sh,_getRequestOptions$on=_getRequestOptions.onRetry,onRetry=_getRequestOptions$on===void 0?function(){}:_getRequestOptions$on;currentState=getCurrentState(config);_context2.next=7;return shouldRetry(retries,retryCondition,currentState,error);case 7:if(!_context2.sent){_context2.next=20;break;}currentState.retryCount+=1;delay=retryDelay(currentState.retryCount,error);// Axios fails merging this configuration to the default configuration because it has an issue
|
4235
4241
|
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
4236
|
-
fixConfig(axios,config);if(!(!shouldResetTimeout&&config.timeout&¤tState.lastRequestTime)){_context2.next=17;break;}lastRequestDuration=Date.now()-currentState.lastRequestTime;timeout=config.timeout-lastRequestDuration-delay;if(!(timeout<=0)){_context2.next=16;break;}return _context2.abrupt("return",Promise.reject(error));case 16:config.timeout=timeout;case 17:config.transformRequest=[function(data){return data;}];onRetry(currentState.retryCount,error,config);return _context2.abrupt("return",new Promise(function(resolve){return setTimeout(function(){return resolve(axios(config));},delay);}));case 20:return _context2.abrupt("return",Promise.reject(error));case 21:case"end":return _context2.stop();}},_callee2);}));return function(_x5){return _ref.apply(this,arguments);};}());}// Compatibility with CommonJS
|
4242
|
+
fixConfig(axios,config);if(!(!shouldResetTimeout&&config.timeout&¤tState.lastRequestTime)){_context2.next=17;break;}lastRequestDuration=Date.now()-currentState.lastRequestTime;timeout=config.timeout-lastRequestDuration-delay;if(!(timeout<=0)){_context2.next=16;break;}return _context2.abrupt("return",Promise.reject(error));case 16:config.timeout=timeout;case 17:config.transformRequest=[function(data){return data;}];onRetry(currentState.retryCount,error,config);return _context2.abrupt("return",new Promise(function(resolve){return setTimeout(function(){return resolve(axios(config));},delay);}));case 20:return _context2.abrupt("return",Promise.reject(error));case 21:case"end":return _context2.stop();}},_callee2);}));return function(_x5){return _ref.apply(this,arguments);};}());}// Compatibility with CommonJS
|
4237
4243
|
axiosRetry.isNetworkError=isNetworkError;axiosRetry.isSafeRequestError=isSafeRequestError;axiosRetry.isIdempotentRequestError=isIdempotentRequestError;axiosRetry.isNetworkOrIdempotentRequestError=isNetworkOrIdempotentRequestError;axiosRetry.exponentialDelay=exponentialDelay;axiosRetry.isRetryableError=isRetryableError;
|
4238
4244
|
|
4239
4245
|
var s=1000;var m=s*60;var h=m*60;var d=h*24;var w=d*7;var y=d*365.25;/**
|
@@ -4268,7 +4274,7 @@ var s=1000;var m=s*60;var h=m*60;var d=h*24;var w=d*7;var y=d*365.25;/**
|
|
4268
4274
|
* @api private
|
4269
4275
|
*/function fmtLong(ms){var msAbs=Math.abs(ms);if(msAbs>=d){return plural(ms,msAbs,d,'day');}if(msAbs>=h){return plural(ms,msAbs,h,'hour');}if(msAbs>=m){return plural(ms,msAbs,m,'minute');}if(msAbs>=s){return plural(ms,msAbs,s,'second');}return ms+' ms';}/**
|
4270
4276
|
* Pluralization helper.
|
4271
|
-
*/function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+' '+name+(isPlural?'s':'');}
|
4277
|
+
*/function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+' '+name+(isPlural?'s':'');}
|
4272
4278
|
|
4273
4279
|
var IDX=256,HEX=[],BUFFER;while(IDX--)HEX[IDX]=(IDX+256).toString(16).substring(1);function v4(){var i=0,num,out='';if(!BUFFER||IDX+16>256){BUFFER=Array(i=256);while(i--)BUFFER[i]=256*Math.random()|0;i=IDX=0;}for(;i<16;i++){num=BUFFER[IDX+i];if(i==6)out+=HEX[num&15|64];else if(i==8)out+=HEX[num&63|128];else out+=HEX[num];if(i&1&&i>1&&i<11)out+='-';}IDX++;return out;}
|
4274
4280
|
|
@@ -4334,906 +4340,909 @@ var IDX=256,HEX=[],BUFFER;while(IDX--)HEX[IDX]=(IDX+256).toString(16).substring(
|
|
4334
4340
|
*
|
4335
4341
|
* _.isString(1);
|
4336
4342
|
* // => false
|
4337
|
-
*/function isString(value){return typeof value=='string'||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag;}var lodash_isstring=isString;
|
4338
|
-
|
4339
|
-
var
|
4340
|
-
|
4341
|
-
|
4342
|
-
|
4343
|
-
|
4344
|
-
|
4345
|
-
|
4346
|
-
|
4347
|
-
|
4348
|
-
|
4349
|
-
|
4350
|
-
|
4351
|
-
|
4352
|
-
map
|
4353
|
-
|
4354
|
-
|
4355
|
-
|
4356
|
-
|
4357
|
-
|
4358
|
-
|
4359
|
-
|
4360
|
-
set
|
4361
|
-
|
4362
|
-
|
4363
|
-
|
4364
|
-
|
4365
|
-
|
4366
|
-
|
4367
|
-
|
4368
|
-
|
4369
|
-
|
4370
|
-
|
4371
|
-
|
4372
|
-
|
4373
|
-
|
4374
|
-
|
4375
|
-
|
4376
|
-
|
4377
|
-
|
4378
|
-
|
4379
|
-
|
4380
|
-
|
4381
|
-
|
4382
|
-
|
4383
|
-
|
4384
|
-
|
4385
|
-
|
4386
|
-
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
|
4391
|
-
|
4392
|
-
|
4393
|
-
|
4394
|
-
|
4395
|
-
|
4396
|
-
|
4397
|
-
|
4398
|
-
|
4399
|
-
|
4400
|
-
|
4401
|
-
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4407
|
-
|
4343
|
+
*/function isString(value){return typeof value=='string'||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag;}var lodash_isstring=isString;
|
4344
|
+
|
4345
|
+
var lodash_clonedeepExports = {};
|
4346
|
+
var lodash_clonedeep = {
|
4347
|
+
get exports(){ return lodash_clonedeepExports; },
|
4348
|
+
set exports(v){ lodash_clonedeepExports = v; },
|
4349
|
+
};
|
4350
|
+
|
4351
|
+
(function(module,exports){/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED='__lodash_hash_undefined__';/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER=9007199254740991;/** `Object#toString` result references. */var argsTag='[object Arguments]',arrayTag='[object Array]',boolTag='[object Boolean]',dateTag='[object Date]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',objectTag='[object Object]',promiseTag='[object Promise]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',symbolTag='[object Symbol]',weakMapTag='[object WeakMap]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';/**
|
4352
|
+
* Used to match `RegExp`
|
4353
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
4354
|
+
*/var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;/** Used to match `RegExp` flags from their coerced string values. */var reFlags=/\w*$/;/** Used to detect host constructors (Safari). */var reIsHostCtor=/^\[object .+?Constructor\]$/;/** Used to detect unsigned integer values. */var reIsUint=/^(?:0|[1-9]\d*)$/;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=false;/** Detect free variable `global` from Node.js. */var freeGlobal=_typeof(commonjsGlobal)=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;/** Detect free variable `self`. */var freeSelf=(typeof self==="undefined"?"undefined":_typeof(self))=='object'&&self&&self.Object===Object&&self;/** Used as a reference to the global object. */var root=freeGlobal||freeSelf||Function('return this')();/** Detect free variable `exports`. */var freeExports=exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&'object'=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/**
|
4355
|
+
* Adds the key-value `pair` to `map`.
|
4356
|
+
*
|
4357
|
+
* @private
|
4358
|
+
* @param {Object} map The map to modify.
|
4359
|
+
* @param {Array} pair The key-value pair to add.
|
4360
|
+
* @returns {Object} Returns `map`.
|
4361
|
+
*/function addMapEntry(map,pair){// Don't return `map.set` because it's not chainable in IE 11.
|
4362
|
+
map.set(pair[0],pair[1]);return map;}/**
|
4363
|
+
* Adds `value` to `set`.
|
4364
|
+
*
|
4365
|
+
* @private
|
4366
|
+
* @param {Object} set The set to modify.
|
4367
|
+
* @param {*} value The value to add.
|
4368
|
+
* @returns {Object} Returns `set`.
|
4369
|
+
*/function addSetEntry(set,value){// Don't return `set.add` because it's not chainable in IE 11.
|
4370
|
+
set.add(value);return set;}/**
|
4371
|
+
* A specialized version of `_.forEach` for arrays without support for
|
4372
|
+
* iteratee shorthands.
|
4373
|
+
*
|
4374
|
+
* @private
|
4375
|
+
* @param {Array} [array] The array to iterate over.
|
4376
|
+
* @param {Function} iteratee The function invoked per iteration.
|
4377
|
+
* @returns {Array} Returns `array`.
|
4378
|
+
*/function arrayEach(array,iteratee){var index=-1,length=array?array.length:0;while(++index<length){if(iteratee(array[index],index,array)===false){break;}}return array;}/**
|
4379
|
+
* Appends the elements of `values` to `array`.
|
4380
|
+
*
|
4381
|
+
* @private
|
4382
|
+
* @param {Array} array The array to modify.
|
4383
|
+
* @param {Array} values The values to append.
|
4384
|
+
* @returns {Array} Returns `array`.
|
4385
|
+
*/function arrayPush(array,values){var index=-1,length=values.length,offset=array.length;while(++index<length){array[offset+index]=values[index];}return array;}/**
|
4386
|
+
* A specialized version of `_.reduce` for arrays without support for
|
4387
|
+
* iteratee shorthands.
|
4388
|
+
*
|
4389
|
+
* @private
|
4390
|
+
* @param {Array} [array] The array to iterate over.
|
4391
|
+
* @param {Function} iteratee The function invoked per iteration.
|
4392
|
+
* @param {*} [accumulator] The initial value.
|
4393
|
+
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
4394
|
+
* the initial value.
|
4395
|
+
* @returns {*} Returns the accumulated value.
|
4396
|
+
*/function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array?array.length:0;if(initAccum&&length){accumulator=array[++index];}while(++index<length){accumulator=iteratee(accumulator,array[index],index,array);}return accumulator;}/**
|
4397
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
4398
|
+
* or max array length checks.
|
4399
|
+
*
|
4400
|
+
* @private
|
4401
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
4402
|
+
* @param {Function} iteratee The function invoked per iteration.
|
4403
|
+
* @returns {Array} Returns the array of results.
|
4404
|
+
*/function baseTimes(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}/**
|
4405
|
+
* Gets the value at `key` of `object`.
|
4406
|
+
*
|
4407
|
+
* @private
|
4408
|
+
* @param {Object} [object] The object to query.
|
4409
|
+
* @param {string} key The key of the property to get.
|
4410
|
+
* @returns {*} Returns the property value.
|
4411
|
+
*/function getValue(object,key){return object==null?undefined:object[key];}/**
|
4412
|
+
* Checks if `value` is a host object in IE < 9.
|
4413
|
+
*
|
4414
|
+
* @private
|
4415
|
+
* @param {*} value The value to check.
|
4416
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
4417
|
+
*/function isHostObject(value){// Many host objects are `Object` objects that can coerce to strings
|
4408
4418
|
// despite having improperly defined `toString` methods.
|
4409
|
-
var result=false;if(value!=null&&typeof value.toString!='function'){try{result=!!(value+'');}catch(e){}}return result;}/**
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
|
4414
|
-
|
4415
|
-
|
4416
|
-
|
4417
|
-
|
4418
|
-
|
4419
|
-
|
4420
|
-
|
4421
|
-
|
4422
|
-
|
4423
|
-
|
4424
|
-
|
4425
|
-
|
4426
|
-
|
4427
|
-
|
4428
|
-
|
4429
|
-
|
4430
|
-
|
4431
|
-
|
4432
|
-
|
4433
|
-
|
4434
|
-
|
4435
|
-
|
4436
|
-
|
4437
|
-
|
4438
|
-
|
4439
|
-
|
4440
|
-
|
4441
|
-
|
4442
|
-
|
4443
|
-
|
4444
|
-
|
4445
|
-
|
4446
|
-
|
4447
|
-
|
4448
|
-
|
4449
|
-
|
4450
|
-
|
4451
|
-
|
4452
|
-
|
4453
|
-
|
4454
|
-
|
4455
|
-
|
4456
|
-
|
4457
|
-
|
4458
|
-
|
4459
|
-
|
4460
|
-
|
4461
|
-
|
4462
|
-
|
4463
|
-
|
4464
|
-
|
4465
|
-
|
4466
|
-
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
|
4478
|
-
|
4479
|
-
Hash.prototype.clear=hashClear;Hash.prototype['delete']=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;/**
|
4480
|
-
|
4481
|
-
|
4482
|
-
|
4483
|
-
|
4484
|
-
|
4485
|
-
|
4486
|
-
|
4487
|
-
|
4488
|
-
|
4489
|
-
|
4490
|
-
|
4491
|
-
|
4492
|
-
|
4493
|
-
|
4494
|
-
|
4495
|
-
|
4496
|
-
|
4497
|
-
|
4498
|
-
|
4499
|
-
|
4500
|
-
|
4501
|
-
|
4502
|
-
|
4503
|
-
|
4504
|
-
|
4505
|
-
|
4506
|
-
|
4507
|
-
|
4508
|
-
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
4514
|
-
|
4515
|
-
|
4516
|
-
|
4517
|
-
|
4518
|
-
|
4519
|
-
|
4520
|
-
|
4521
|
-
|
4522
|
-
|
4523
|
-
|
4524
|
-
|
4525
|
-
ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;/**
|
4526
|
-
|
4527
|
-
|
4528
|
-
|
4529
|
-
|
4530
|
-
|
4531
|
-
|
4532
|
-
|
4533
|
-
|
4534
|
-
|
4535
|
-
|
4536
|
-
|
4537
|
-
|
4538
|
-
|
4539
|
-
|
4540
|
-
|
4541
|
-
|
4542
|
-
|
4543
|
-
|
4544
|
-
|
4545
|
-
|
4546
|
-
|
4547
|
-
|
4548
|
-
|
4549
|
-
|
4550
|
-
|
4551
|
-
|
4552
|
-
|
4553
|
-
|
4554
|
-
|
4555
|
-
|
4556
|
-
|
4557
|
-
|
4558
|
-
|
4559
|
-
|
4560
|
-
|
4561
|
-
|
4562
|
-
|
4563
|
-
|
4564
|
-
|
4565
|
-
|
4566
|
-
|
4567
|
-
|
4568
|
-
|
4569
|
-
|
4570
|
-
|
4571
|
-
MapCache.prototype.clear=mapCacheClear;MapCache.prototype['delete']=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;/**
|
4572
|
-
|
4573
|
-
|
4574
|
-
|
4575
|
-
|
4576
|
-
|
4577
|
-
|
4578
|
-
|
4579
|
-
|
4580
|
-
|
4581
|
-
|
4582
|
-
|
4583
|
-
|
4584
|
-
|
4585
|
-
|
4586
|
-
|
4587
|
-
|
4588
|
-
|
4589
|
-
|
4590
|
-
|
4591
|
-
|
4592
|
-
|
4593
|
-
|
4594
|
-
|
4595
|
-
|
4596
|
-
|
4597
|
-
|
4598
|
-
|
4599
|
-
|
4600
|
-
|
4601
|
-
|
4602
|
-
|
4603
|
-
|
4604
|
-
|
4605
|
-
|
4606
|
-
|
4607
|
-
|
4608
|
-
|
4609
|
-
|
4610
|
-
|
4611
|
-
|
4612
|
-
|
4613
|
-
|
4614
|
-
|
4615
|
-
|
4616
|
-
|
4617
|
-
Stack.prototype.clear=stackClear;Stack.prototype['delete']=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;/**
|
4618
|
-
|
4619
|
-
|
4620
|
-
|
4621
|
-
|
4622
|
-
|
4623
|
-
|
4624
|
-
|
4419
|
+
var result=false;if(value!=null&&typeof value.toString!='function'){try{result=!!(value+'');}catch(e){}}return result;}/**
|
4420
|
+
* Converts `map` to its key-value pairs.
|
4421
|
+
*
|
4422
|
+
* @private
|
4423
|
+
* @param {Object} map The map to convert.
|
4424
|
+
* @returns {Array} Returns the key-value pairs.
|
4425
|
+
*/function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}/**
|
4426
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
4427
|
+
*
|
4428
|
+
* @private
|
4429
|
+
* @param {Function} func The function to wrap.
|
4430
|
+
* @param {Function} transform The argument transform.
|
4431
|
+
* @returns {Function} Returns the new function.
|
4432
|
+
*/function overArg(func,transform){return function(arg){return func(transform(arg));};}/**
|
4433
|
+
* Converts `set` to an array of its values.
|
4434
|
+
*
|
4435
|
+
* @private
|
4436
|
+
* @param {Object} set The set to convert.
|
4437
|
+
* @returns {Array} Returns the values.
|
4438
|
+
*/function setToArray(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value;});return result;}/** Used for built-in method references. */var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype;/** Used to detect overreaching core-js shims. */var coreJsData=root['__core-js_shared__'];/** Used to detect methods masquerading as native. */var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||'');return uid?'Symbol(src)_1.'+uid:'';}();/** Used to resolve the decompiled source of functions. */var funcToString=funcProto.toString;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/**
|
4439
|
+
* Used to resolve the
|
4440
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
4441
|
+
* of values.
|
4442
|
+
*/var objectToString=objectProto.toString;/** Used to detect if a method is native. */var reIsNative=RegExp('^'+funcToString.call(hasOwnProperty).replace(reRegExpChar,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');/** Built-in value references. */var Buffer=moduleExports?root.Buffer:undefined,_Symbol=root.Symbol,Uint8Array=root.Uint8Array,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeKeys=overArg(Object.keys,Object);/* Built-in method references that are verified to be native. */var DataView=getNative(root,'DataView'),Map=getNative(root,'Map'),Promise=getNative(root,'Promise'),Set=getNative(root,'Set'),WeakMap=getNative(root,'WeakMap'),nativeCreate=getNative(Object,'create');/** Used to detect maps, sets, and weakmaps. */var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);/** Used to convert symbols to primitives and strings. */var symbolProto=_Symbol?_Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined;/**
|
4443
|
+
* Creates a hash object.
|
4444
|
+
*
|
4445
|
+
* @private
|
4446
|
+
* @constructor
|
4447
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
4448
|
+
*/function Hash(entries){var index=-1,length=entries?entries.length:0;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/**
|
4449
|
+
* Removes all key-value entries from the hash.
|
4450
|
+
*
|
4451
|
+
* @private
|
4452
|
+
* @name clear
|
4453
|
+
* @memberOf Hash
|
4454
|
+
*/function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};}/**
|
4455
|
+
* Removes `key` and its value from the hash.
|
4456
|
+
*
|
4457
|
+
* @private
|
4458
|
+
* @name delete
|
4459
|
+
* @memberOf Hash
|
4460
|
+
* @param {Object} hash The hash to modify.
|
4461
|
+
* @param {string} key The key of the value to remove.
|
4462
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
4463
|
+
*/function hashDelete(key){return this.has(key)&&delete this.__data__[key];}/**
|
4464
|
+
* Gets the hash value for `key`.
|
4465
|
+
*
|
4466
|
+
* @private
|
4467
|
+
* @name get
|
4468
|
+
* @memberOf Hash
|
4469
|
+
* @param {string} key The key of the value to get.
|
4470
|
+
* @returns {*} Returns the entry value.
|
4471
|
+
*/function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result;}return hasOwnProperty.call(data,key)?data[key]:undefined;}/**
|
4472
|
+
* Checks if a hash value for `key` exists.
|
4473
|
+
*
|
4474
|
+
* @private
|
4475
|
+
* @name has
|
4476
|
+
* @memberOf Hash
|
4477
|
+
* @param {string} key The key of the entry to check.
|
4478
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
4479
|
+
*/function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key);}/**
|
4480
|
+
* Sets the hash `key` to `value`.
|
4481
|
+
*
|
4482
|
+
* @private
|
4483
|
+
* @name set
|
4484
|
+
* @memberOf Hash
|
4485
|
+
* @param {string} key The key of the value to set.
|
4486
|
+
* @param {*} value The value to set.
|
4487
|
+
* @returns {Object} Returns the hash instance.
|
4488
|
+
*/function hashSet(key,value){var data=this.__data__;data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value;return this;}// Add methods to `Hash`.
|
4489
|
+
Hash.prototype.clear=hashClear;Hash.prototype['delete']=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;/**
|
4490
|
+
* Creates an list cache object.
|
4491
|
+
*
|
4492
|
+
* @private
|
4493
|
+
* @constructor
|
4494
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
4495
|
+
*/function ListCache(entries){var index=-1,length=entries?entries.length:0;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/**
|
4496
|
+
* Removes all key-value entries from the list cache.
|
4497
|
+
*
|
4498
|
+
* @private
|
4499
|
+
* @name clear
|
4500
|
+
* @memberOf ListCache
|
4501
|
+
*/function listCacheClear(){this.__data__=[];}/**
|
4502
|
+
* Removes `key` and its value from the list cache.
|
4503
|
+
*
|
4504
|
+
* @private
|
4505
|
+
* @name delete
|
4506
|
+
* @memberOf ListCache
|
4507
|
+
* @param {string} key The key of the value to remove.
|
4508
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
4509
|
+
*/function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else {splice.call(data,index,1);}return true;}/**
|
4510
|
+
* Gets the list cache value for `key`.
|
4511
|
+
*
|
4512
|
+
* @private
|
4513
|
+
* @name get
|
4514
|
+
* @memberOf ListCache
|
4515
|
+
* @param {string} key The key of the value to get.
|
4516
|
+
* @returns {*} Returns the entry value.
|
4517
|
+
*/function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1];}/**
|
4518
|
+
* Checks if a list cache value for `key` exists.
|
4519
|
+
*
|
4520
|
+
* @private
|
4521
|
+
* @name has
|
4522
|
+
* @memberOf ListCache
|
4523
|
+
* @param {string} key The key of the entry to check.
|
4524
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
4525
|
+
*/function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1;}/**
|
4526
|
+
* Sets the list cache `key` to `value`.
|
4527
|
+
*
|
4528
|
+
* @private
|
4529
|
+
* @name set
|
4530
|
+
* @memberOf ListCache
|
4531
|
+
* @param {string} key The key of the value to set.
|
4532
|
+
* @param {*} value The value to set.
|
4533
|
+
* @returns {Object} Returns the list cache instance.
|
4534
|
+
*/function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){data.push([key,value]);}else {data[index][1]=value;}return this;}// Add methods to `ListCache`.
|
4535
|
+
ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;/**
|
4536
|
+
* Creates a map cache object to store key-value pairs.
|
4537
|
+
*
|
4538
|
+
* @private
|
4539
|
+
* @constructor
|
4540
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
4541
|
+
*/function MapCache(entries){var index=-1,length=entries?entries.length:0;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/**
|
4542
|
+
* Removes all key-value entries from the map.
|
4543
|
+
*
|
4544
|
+
* @private
|
4545
|
+
* @name clear
|
4546
|
+
* @memberOf MapCache
|
4547
|
+
*/function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}/**
|
4548
|
+
* Removes `key` and its value from the map.
|
4549
|
+
*
|
4550
|
+
* @private
|
4551
|
+
* @name delete
|
4552
|
+
* @memberOf MapCache
|
4553
|
+
* @param {string} key The key of the value to remove.
|
4554
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
4555
|
+
*/function mapCacheDelete(key){return getMapData(this,key)['delete'](key);}/**
|
4556
|
+
* Gets the map value for `key`.
|
4557
|
+
*
|
4558
|
+
* @private
|
4559
|
+
* @name get
|
4560
|
+
* @memberOf MapCache
|
4561
|
+
* @param {string} key The key of the value to get.
|
4562
|
+
* @returns {*} Returns the entry value.
|
4563
|
+
*/function mapCacheGet(key){return getMapData(this,key).get(key);}/**
|
4564
|
+
* Checks if a map value for `key` exists.
|
4565
|
+
*
|
4566
|
+
* @private
|
4567
|
+
* @name has
|
4568
|
+
* @memberOf MapCache
|
4569
|
+
* @param {string} key The key of the entry to check.
|
4570
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
4571
|
+
*/function mapCacheHas(key){return getMapData(this,key).has(key);}/**
|
4572
|
+
* Sets the map `key` to `value`.
|
4573
|
+
*
|
4574
|
+
* @private
|
4575
|
+
* @name set
|
4576
|
+
* @memberOf MapCache
|
4577
|
+
* @param {string} key The key of the value to set.
|
4578
|
+
* @param {*} value The value to set.
|
4579
|
+
* @returns {Object} Returns the map cache instance.
|
4580
|
+
*/function mapCacheSet(key,value){getMapData(this,key).set(key,value);return this;}// Add methods to `MapCache`.
|
4581
|
+
MapCache.prototype.clear=mapCacheClear;MapCache.prototype['delete']=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;/**
|
4582
|
+
* Creates a stack cache object to store key-value pairs.
|
4583
|
+
*
|
4584
|
+
* @private
|
4585
|
+
* @constructor
|
4586
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
4587
|
+
*/function Stack(entries){this.__data__=new ListCache(entries);}/**
|
4588
|
+
* Removes all key-value entries from the stack.
|
4589
|
+
*
|
4590
|
+
* @private
|
4591
|
+
* @name clear
|
4592
|
+
* @memberOf Stack
|
4593
|
+
*/function stackClear(){this.__data__=new ListCache();}/**
|
4594
|
+
* Removes `key` and its value from the stack.
|
4595
|
+
*
|
4596
|
+
* @private
|
4597
|
+
* @name delete
|
4598
|
+
* @memberOf Stack
|
4599
|
+
* @param {string} key The key of the value to remove.
|
4600
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
4601
|
+
*/function stackDelete(key){return this.__data__['delete'](key);}/**
|
4602
|
+
* Gets the stack value for `key`.
|
4603
|
+
*
|
4604
|
+
* @private
|
4605
|
+
* @name get
|
4606
|
+
* @memberOf Stack
|
4607
|
+
* @param {string} key The key of the value to get.
|
4608
|
+
* @returns {*} Returns the entry value.
|
4609
|
+
*/function stackGet(key){return this.__data__.get(key);}/**
|
4610
|
+
* Checks if a stack value for `key` exists.
|
4611
|
+
*
|
4612
|
+
* @private
|
4613
|
+
* @name has
|
4614
|
+
* @memberOf Stack
|
4615
|
+
* @param {string} key The key of the entry to check.
|
4616
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
4617
|
+
*/function stackHas(key){return this.__data__.has(key);}/**
|
4618
|
+
* Sets the stack `key` to `value`.
|
4619
|
+
*
|
4620
|
+
* @private
|
4621
|
+
* @name set
|
4622
|
+
* @memberOf Stack
|
4623
|
+
* @param {string} key The key of the value to set.
|
4624
|
+
* @param {*} value The value to set.
|
4625
|
+
* @returns {Object} Returns the stack cache instance.
|
4626
|
+
*/function stackSet(key,value){var cache=this.__data__;if(cache instanceof ListCache){var pairs=cache.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);return this;}cache=this.__data__=new MapCache(pairs);}cache.set(key,value);return this;}// Add methods to `Stack`.
|
4627
|
+
Stack.prototype.clear=stackClear;Stack.prototype['delete']=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;/**
|
4628
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
4629
|
+
*
|
4630
|
+
* @private
|
4631
|
+
* @param {*} value The value to query.
|
4632
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
4633
|
+
* @returns {Array} Returns the array of property names.
|
4634
|
+
*/function arrayLikeKeys(value,inherited){// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
4625
4635
|
// Safari 9 makes `arguments.length` enumerable in strict mode.
|
4626
|
-
var result=isArray(value)||isArguments(value)?baseTimes(value.length,String):[];var length=result.length,skipIndexes=!!length;for(var key in value){if((inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&(key=='length'||isIndex(key,length)))){result.push(key);}}return result;}/**
|
4627
|
-
|
4628
|
-
|
4629
|
-
|
4630
|
-
|
4631
|
-
|
4632
|
-
|
4633
|
-
|
4634
|
-
|
4635
|
-
|
4636
|
-
|
4637
|
-
|
4638
|
-
|
4639
|
-
|
4640
|
-
|
4641
|
-
|
4642
|
-
|
4643
|
-
|
4644
|
-
|
4645
|
-
|
4646
|
-
|
4647
|
-
|
4648
|
-
|
4649
|
-
|
4650
|
-
|
4651
|
-
|
4652
|
-
|
4653
|
-
|
4654
|
-
|
4655
|
-
|
4656
|
-
|
4657
|
-
|
4658
|
-
|
4659
|
-
|
4660
|
-
|
4661
|
-
|
4662
|
-
|
4663
|
-
|
4664
|
-
stack||(stack=new Stack());var stacked=stack.get(value);if(stacked){return stacked;}stack.set(value,result);if(!isArr){var props=isFull?getAllKeys(value):keys(value);}arrayEach(props||value,function(subValue,key){if(props){key=subValue;subValue=value[key];}// Recursively populate clone (susceptible to call stack limits).
|
4665
|
-
assignValue(result,key,baseClone(subValue,isDeep,isFull,customizer,key,value,stack));});return result;}/**
|
4666
|
-
|
4667
|
-
|
4668
|
-
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4675
|
-
|
4676
|
-
|
4677
|
-
|
4678
|
-
|
4679
|
-
|
4680
|
-
|
4681
|
-
|
4682
|
-
|
4683
|
-
|
4684
|
-
|
4685
|
-
|
4686
|
-
|
4687
|
-
|
4688
|
-
|
4689
|
-
|
4690
|
-
|
4691
|
-
|
4692
|
-
|
4693
|
-
|
4694
|
-
|
4695
|
-
|
4696
|
-
|
4697
|
-
|
4698
|
-
|
4699
|
-
|
4700
|
-
|
4701
|
-
|
4702
|
-
|
4703
|
-
|
4704
|
-
|
4705
|
-
|
4706
|
-
|
4707
|
-
|
4708
|
-
|
4709
|
-
|
4710
|
-
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4715
|
-
|
4716
|
-
|
4717
|
-
|
4718
|
-
|
4719
|
-
|
4720
|
-
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
|
4737
|
-
|
4738
|
-
|
4739
|
-
|
4740
|
-
|
4741
|
-
|
4742
|
-
|
4743
|
-
|
4744
|
-
|
4745
|
-
|
4746
|
-
|
4747
|
-
|
4748
|
-
|
4749
|
-
|
4750
|
-
|
4751
|
-
|
4752
|
-
|
4753
|
-
|
4754
|
-
|
4755
|
-
|
4756
|
-
|
4757
|
-
|
4758
|
-
|
4759
|
-
|
4760
|
-
|
4761
|
-
|
4762
|
-
|
4763
|
-
|
4764
|
-
|
4765
|
-
|
4766
|
-
|
4767
|
-
|
4768
|
-
|
4769
|
-
|
4770
|
-
|
4771
|
-
|
4772
|
-
|
4773
|
-
|
4774
|
-
|
4775
|
-
|
4776
|
-
|
4777
|
-
|
4778
|
-
|
4779
|
-
|
4780
|
-
|
4781
|
-
|
4782
|
-
|
4783
|
-
|
4784
|
-
|
4785
|
-
|
4786
|
-
|
4787
|
-
|
4788
|
-
|
4789
|
-
|
4790
|
-
|
4791
|
-
|
4792
|
-
|
4793
|
-
|
4794
|
-
|
4795
|
-
|
4796
|
-
|
4797
|
-
|
4798
|
-
|
4799
|
-
|
4800
|
-
|
4801
|
-
|
4802
|
-
|
4803
|
-
|
4804
|
-
|
4805
|
-
|
4806
|
-
|
4807
|
-
|
4808
|
-
|
4809
|
-
|
4810
|
-
|
4811
|
-
|
4636
|
+
var result=isArray(value)||isArguments(value)?baseTimes(value.length,String):[];var length=result.length,skipIndexes=!!length;for(var key in value){if((inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&(key=='length'||isIndex(key,length)))){result.push(key);}}return result;}/**
|
4637
|
+
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
4638
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
4639
|
+
* for equality comparisons.
|
4640
|
+
*
|
4641
|
+
* @private
|
4642
|
+
* @param {Object} object The object to modify.
|
4643
|
+
* @param {string} key The key of the property to assign.
|
4644
|
+
* @param {*} value The value to assign.
|
4645
|
+
*/function assignValue(object,key,value){var objValue=object[key];if(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===undefined&&!(key in object)){object[key]=value;}}/**
|
4646
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
4647
|
+
*
|
4648
|
+
* @private
|
4649
|
+
* @param {Array} array The array to inspect.
|
4650
|
+
* @param {*} key The key to search for.
|
4651
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
4652
|
+
*/function assocIndexOf(array,key){var length=array.length;while(length--){if(eq(array[length][0],key)){return length;}}return -1;}/**
|
4653
|
+
* The base implementation of `_.assign` without support for multiple sources
|
4654
|
+
* or `customizer` functions.
|
4655
|
+
*
|
4656
|
+
* @private
|
4657
|
+
* @param {Object} object The destination object.
|
4658
|
+
* @param {Object} source The source object.
|
4659
|
+
* @returns {Object} Returns `object`.
|
4660
|
+
*/function baseAssign(object,source){return object&©Object(source,keys(source),object);}/**
|
4661
|
+
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
|
4662
|
+
* traversed objects.
|
4663
|
+
*
|
4664
|
+
* @private
|
4665
|
+
* @param {*} value The value to clone.
|
4666
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4667
|
+
* @param {boolean} [isFull] Specify a clone including symbols.
|
4668
|
+
* @param {Function} [customizer] The function to customize cloning.
|
4669
|
+
* @param {string} [key] The key of `value`.
|
4670
|
+
* @param {Object} [object] The parent object of `value`.
|
4671
|
+
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
|
4672
|
+
* @returns {*} Returns the cloned value.
|
4673
|
+
*/function baseClone(value,isDeep,isFull,customizer,key,object,stack){var result;if(customizer){result=object?customizer(value,key,object,stack):customizer(value);}if(result!==undefined){return result;}if(!isObject(value)){return value;}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return copyArray(value,result);}}else {var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value)){return cloneBuffer(value,isDeep);}if(tag==objectTag||tag==argsTag||isFunc&&!object){if(isHostObject(value)){return object?value:{};}result=initCloneObject(isFunc?{}:value);if(!isDeep){return copySymbols(value,baseAssign(result,value));}}else {if(!cloneableTags[tag]){return object?value:{};}result=initCloneByTag(value,tag,baseClone,isDeep);}}// Check for circular references and return its corresponding clone.
|
4674
|
+
stack||(stack=new Stack());var stacked=stack.get(value);if(stacked){return stacked;}stack.set(value,result);if(!isArr){var props=isFull?getAllKeys(value):keys(value);}arrayEach(props||value,function(subValue,key){if(props){key=subValue;subValue=value[key];}// Recursively populate clone (susceptible to call stack limits).
|
4675
|
+
assignValue(result,key,baseClone(subValue,isDeep,isFull,customizer,key,value,stack));});return result;}/**
|
4676
|
+
* The base implementation of `_.create` without support for assigning
|
4677
|
+
* properties to the created object.
|
4678
|
+
*
|
4679
|
+
* @private
|
4680
|
+
* @param {Object} prototype The object to inherit from.
|
4681
|
+
* @returns {Object} Returns the new object.
|
4682
|
+
*/function baseCreate(proto){return isObject(proto)?objectCreate(proto):{};}/**
|
4683
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
4684
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
4685
|
+
* symbols of `object`.
|
4686
|
+
*
|
4687
|
+
* @private
|
4688
|
+
* @param {Object} object The object to query.
|
4689
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
4690
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
4691
|
+
* @returns {Array} Returns the array of property names and symbols.
|
4692
|
+
*/function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object));}/**
|
4693
|
+
* The base implementation of `getTag`.
|
4694
|
+
*
|
4695
|
+
* @private
|
4696
|
+
* @param {*} value The value to query.
|
4697
|
+
* @returns {string} Returns the `toStringTag`.
|
4698
|
+
*/function baseGetTag(value){return objectToString.call(value);}/**
|
4699
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
4700
|
+
*
|
4701
|
+
* @private
|
4702
|
+
* @param {*} value The value to check.
|
4703
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
4704
|
+
* else `false`.
|
4705
|
+
*/function baseIsNative(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value));}/**
|
4706
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
4707
|
+
*
|
4708
|
+
* @private
|
4709
|
+
* @param {Object} object The object to query.
|
4710
|
+
* @returns {Array} Returns the array of property names.
|
4711
|
+
*/function baseKeys(object){if(!isPrototype(object)){return nativeKeys(object);}var result=[];for(var key in Object(object)){if(hasOwnProperty.call(object,key)&&key!='constructor'){result.push(key);}}return result;}/**
|
4712
|
+
* Creates a clone of `buffer`.
|
4713
|
+
*
|
4714
|
+
* @private
|
4715
|
+
* @param {Buffer} buffer The buffer to clone.
|
4716
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4717
|
+
* @returns {Buffer} Returns the cloned buffer.
|
4718
|
+
*/function cloneBuffer(buffer,isDeep){if(isDeep){return buffer.slice();}var result=new buffer.constructor(buffer.length);buffer.copy(result);return result;}/**
|
4719
|
+
* Creates a clone of `arrayBuffer`.
|
4720
|
+
*
|
4721
|
+
* @private
|
4722
|
+
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
4723
|
+
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
4724
|
+
*/function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}/**
|
4725
|
+
* Creates a clone of `dataView`.
|
4726
|
+
*
|
4727
|
+
* @private
|
4728
|
+
* @param {Object} dataView The data view to clone.
|
4729
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4730
|
+
* @returns {Object} Returns the cloned data view.
|
4731
|
+
*/function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength);}/**
|
4732
|
+
* Creates a clone of `map`.
|
4733
|
+
*
|
4734
|
+
* @private
|
4735
|
+
* @param {Object} map The map to clone.
|
4736
|
+
* @param {Function} cloneFunc The function to clone values.
|
4737
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4738
|
+
* @returns {Object} Returns the cloned map.
|
4739
|
+
*/function cloneMap(map,isDeep,cloneFunc){var array=isDeep?cloneFunc(mapToArray(map),true):mapToArray(map);return arrayReduce(array,addMapEntry,new map.constructor());}/**
|
4740
|
+
* Creates a clone of `regexp`.
|
4741
|
+
*
|
4742
|
+
* @private
|
4743
|
+
* @param {Object} regexp The regexp to clone.
|
4744
|
+
* @returns {Object} Returns the cloned regexp.
|
4745
|
+
*/function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));result.lastIndex=regexp.lastIndex;return result;}/**
|
4746
|
+
* Creates a clone of `set`.
|
4747
|
+
*
|
4748
|
+
* @private
|
4749
|
+
* @param {Object} set The set to clone.
|
4750
|
+
* @param {Function} cloneFunc The function to clone values.
|
4751
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4752
|
+
* @returns {Object} Returns the cloned set.
|
4753
|
+
*/function cloneSet(set,isDeep,cloneFunc){var array=isDeep?cloneFunc(setToArray(set),true):setToArray(set);return arrayReduce(array,addSetEntry,new set.constructor());}/**
|
4754
|
+
* Creates a clone of the `symbol` object.
|
4755
|
+
*
|
4756
|
+
* @private
|
4757
|
+
* @param {Object} symbol The symbol object to clone.
|
4758
|
+
* @returns {Object} Returns the cloned symbol object.
|
4759
|
+
*/function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{};}/**
|
4760
|
+
* Creates a clone of `typedArray`.
|
4761
|
+
*
|
4762
|
+
* @private
|
4763
|
+
* @param {Object} typedArray The typed array to clone.
|
4764
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4765
|
+
* @returns {Object} Returns the cloned typed array.
|
4766
|
+
*/function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}/**
|
4767
|
+
* Copies the values of `source` to `array`.
|
4768
|
+
*
|
4769
|
+
* @private
|
4770
|
+
* @param {Array} source The array to copy values from.
|
4771
|
+
* @param {Array} [array=[]] The array to copy values to.
|
4772
|
+
* @returns {Array} Returns `array`.
|
4773
|
+
*/function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index];}return array;}/**
|
4774
|
+
* Copies properties of `source` to `object`.
|
4775
|
+
*
|
4776
|
+
* @private
|
4777
|
+
* @param {Object} source The object to copy properties from.
|
4778
|
+
* @param {Array} props The property identifiers to copy.
|
4779
|
+
* @param {Object} [object={}] The object to copy properties to.
|
4780
|
+
* @param {Function} [customizer] The function to customize copied values.
|
4781
|
+
* @returns {Object} Returns `object`.
|
4782
|
+
*/function copyObject(source,props,object,customizer){object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];var newValue=customizer?customizer(object[key],source[key],key,object,source):undefined;assignValue(object,key,newValue===undefined?source[key]:newValue);}return object;}/**
|
4783
|
+
* Copies own symbol properties of `source` to `object`.
|
4784
|
+
*
|
4785
|
+
* @private
|
4786
|
+
* @param {Object} source The object to copy symbols from.
|
4787
|
+
* @param {Object} [object={}] The object to copy symbols to.
|
4788
|
+
* @returns {Object} Returns `object`.
|
4789
|
+
*/function copySymbols(source,object){return copyObject(source,getSymbols(source),object);}/**
|
4790
|
+
* Creates an array of own enumerable property names and symbols of `object`.
|
4791
|
+
*
|
4792
|
+
* @private
|
4793
|
+
* @param {Object} object The object to query.
|
4794
|
+
* @returns {Array} Returns the array of property names and symbols.
|
4795
|
+
*/function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols);}/**
|
4796
|
+
* Gets the data for `map`.
|
4797
|
+
*
|
4798
|
+
* @private
|
4799
|
+
* @param {Object} map The map to query.
|
4800
|
+
* @param {string} key The reference key.
|
4801
|
+
* @returns {*} Returns the map data.
|
4802
|
+
*/function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=='string'?'string':'hash']:data.map;}/**
|
4803
|
+
* Gets the native function at `key` of `object`.
|
4804
|
+
*
|
4805
|
+
* @private
|
4806
|
+
* @param {Object} object The object to query.
|
4807
|
+
* @param {string} key The key of the method to get.
|
4808
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
4809
|
+
*/function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined;}/**
|
4810
|
+
* Creates an array of the own enumerable symbol properties of `object`.
|
4811
|
+
*
|
4812
|
+
* @private
|
4813
|
+
* @param {Object} object The object to query.
|
4814
|
+
* @returns {Array} Returns the array of symbols.
|
4815
|
+
*/var getSymbols=nativeGetSymbols?overArg(nativeGetSymbols,Object):stubArray;/**
|
4816
|
+
* Gets the `toStringTag` of `value`.
|
4817
|
+
*
|
4818
|
+
* @private
|
4819
|
+
* @param {*} value The value to query.
|
4820
|
+
* @returns {string} Returns the `toStringTag`.
|
4821
|
+
*/var getTag=baseGetTag;// Fallback for data views, maps, sets, and weak maps in IE 11,
|
4812
4822
|
// for data views in Edge < 14, and promises in Node.js.
|
4813
|
-
if(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map())!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set())!=setTag||WeakMap&&getTag(new WeakMap())!=weakMapTag){getTag=function getTag(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):undefined;if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}/**
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4817
|
-
|
4818
|
-
|
4819
|
-
|
4820
|
-
if(length&&typeof array[0]=='string'&&hasOwnProperty.call(array,'index')){result.index=array.index;result.input=array.input;}return result;}/**
|
4821
|
-
|
4822
|
-
|
4823
|
-
|
4824
|
-
|
4825
|
-
|
4826
|
-
|
4827
|
-
|
4828
|
-
|
4829
|
-
|
4830
|
-
|
4831
|
-
|
4832
|
-
|
4833
|
-
|
4834
|
-
|
4835
|
-
|
4836
|
-
|
4837
|
-
|
4838
|
-
|
4839
|
-
|
4840
|
-
|
4841
|
-
|
4842
|
-
|
4843
|
-
|
4844
|
-
|
4845
|
-
|
4846
|
-
|
4847
|
-
|
4848
|
-
|
4849
|
-
|
4850
|
-
|
4851
|
-
|
4852
|
-
|
4853
|
-
|
4854
|
-
|
4855
|
-
|
4856
|
-
|
4857
|
-
|
4858
|
-
|
4859
|
-
|
4860
|
-
|
4861
|
-
|
4862
|
-
|
4863
|
-
|
4864
|
-
|
4865
|
-
|
4866
|
-
|
4867
|
-
|
4868
|
-
|
4869
|
-
|
4870
|
-
|
4871
|
-
|
4872
|
-
|
4873
|
-
|
4874
|
-
|
4875
|
-
|
4876
|
-
|
4877
|
-
|
4878
|
-
|
4879
|
-
|
4880
|
-
|
4881
|
-
|
4882
|
-
|
4883
|
-
|
4884
|
-
|
4885
|
-
|
4886
|
-
|
4887
|
-
|
4888
|
-
|
4889
|
-
|
4890
|
-
|
4891
|
-
|
4892
|
-
|
4893
|
-
|
4894
|
-
|
4895
|
-
|
4896
|
-
|
4897
|
-
|
4898
|
-
|
4899
|
-
|
4900
|
-
|
4901
|
-
|
4902
|
-
|
4903
|
-
|
4904
|
-
|
4905
|
-
|
4906
|
-
|
4907
|
-
|
4908
|
-
|
4909
|
-
|
4910
|
-
|
4911
|
-
|
4912
|
-
|
4913
|
-
|
4914
|
-
|
4915
|
-
|
4916
|
-
|
4917
|
-
|
4918
|
-
|
4919
|
-
|
4920
|
-
|
4921
|
-
|
4922
|
-
|
4923
|
-
|
4924
|
-
|
4925
|
-
|
4926
|
-
|
4927
|
-
|
4928
|
-
|
4929
|
-
|
4930
|
-
|
4931
|
-
|
4932
|
-
|
4933
|
-
|
4934
|
-
|
4935
|
-
return isArrayLikeObject(value)&&hasOwnProperty.call(value,'callee')&&(!propertyIsEnumerable.call(value,'callee')||objectToString.call(value)==argsTag);}/**
|
4936
|
-
|
4937
|
-
|
4938
|
-
|
4939
|
-
|
4940
|
-
|
4941
|
-
|
4942
|
-
|
4943
|
-
|
4944
|
-
|
4945
|
-
|
4946
|
-
|
4947
|
-
|
4948
|
-
|
4949
|
-
|
4950
|
-
|
4951
|
-
|
4952
|
-
|
4953
|
-
|
4954
|
-
|
4955
|
-
|
4956
|
-
|
4957
|
-
|
4958
|
-
|
4959
|
-
|
4960
|
-
|
4961
|
-
|
4962
|
-
|
4963
|
-
|
4964
|
-
|
4965
|
-
|
4966
|
-
|
4967
|
-
|
4968
|
-
|
4969
|
-
|
4970
|
-
|
4971
|
-
|
4972
|
-
|
4973
|
-
|
4974
|
-
|
4975
|
-
|
4976
|
-
|
4977
|
-
|
4978
|
-
|
4979
|
-
|
4980
|
-
|
4981
|
-
|
4982
|
-
|
4983
|
-
|
4984
|
-
|
4985
|
-
|
4986
|
-
|
4987
|
-
|
4988
|
-
|
4989
|
-
|
4990
|
-
|
4991
|
-
|
4992
|
-
|
4993
|
-
|
4994
|
-
|
4995
|
-
|
4996
|
-
|
4997
|
-
|
4998
|
-
|
4999
|
-
|
5000
|
-
|
5001
|
-
|
5002
|
-
|
5003
|
-
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
5025
|
-
|
5026
|
-
|
5027
|
-
|
5028
|
-
|
5029
|
-
|
5030
|
-
|
5031
|
-
|
5032
|
-
|
5033
|
-
|
5034
|
-
|
5035
|
-
|
5036
|
-
|
5037
|
-
|
4823
|
+
if(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map())!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set())!=setTag||WeakMap&&getTag(new WeakMap())!=weakMapTag){getTag=function getTag(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):undefined;if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}/**
|
4824
|
+
* Initializes an array clone.
|
4825
|
+
*
|
4826
|
+
* @private
|
4827
|
+
* @param {Array} array The array to clone.
|
4828
|
+
* @returns {Array} Returns the initialized clone.
|
4829
|
+
*/function initCloneArray(array){var length=array.length,result=array.constructor(length);// Add properties assigned by `RegExp#exec`.
|
4830
|
+
if(length&&typeof array[0]=='string'&&hasOwnProperty.call(array,'index')){result.index=array.index;result.input=array.input;}return result;}/**
|
4831
|
+
* Initializes an object clone.
|
4832
|
+
*
|
4833
|
+
* @private
|
4834
|
+
* @param {Object} object The object to clone.
|
4835
|
+
* @returns {Object} Returns the initialized clone.
|
4836
|
+
*/function initCloneObject(object){return typeof object.constructor=='function'&&!isPrototype(object)?baseCreate(getPrototype(object)):{};}/**
|
4837
|
+
* Initializes an object clone based on its `toStringTag`.
|
4838
|
+
*
|
4839
|
+
* **Note:** This function only supports cloning values with tags of
|
4840
|
+
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
4841
|
+
*
|
4842
|
+
* @private
|
4843
|
+
* @param {Object} object The object to clone.
|
4844
|
+
* @param {string} tag The `toStringTag` of the object to clone.
|
4845
|
+
* @param {Function} cloneFunc The function to clone values.
|
4846
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
4847
|
+
* @returns {Object} Returns the initialized clone.
|
4848
|
+
*/function initCloneByTag(object,tag,cloneFunc,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return cloneMap(object,isDeep,cloneFunc);case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return cloneSet(object,isDeep,cloneFunc);case symbolTag:return cloneSymbol(object);}}/**
|
4849
|
+
* Checks if `value` is a valid array-like index.
|
4850
|
+
*
|
4851
|
+
* @private
|
4852
|
+
* @param {*} value The value to check.
|
4853
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
4854
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
4855
|
+
*/function isIndex(value,length){length=length==null?MAX_SAFE_INTEGER:length;return !!length&&(typeof value=='number'||reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}/**
|
4856
|
+
* Checks if `value` is suitable for use as unique object key.
|
4857
|
+
*
|
4858
|
+
* @private
|
4859
|
+
* @param {*} value The value to check.
|
4860
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
4861
|
+
*/function isKeyable(value){var type=_typeof(value);return type=='string'||type=='number'||type=='symbol'||type=='boolean'?value!=='__proto__':value===null;}/**
|
4862
|
+
* Checks if `func` has its source masked.
|
4863
|
+
*
|
4864
|
+
* @private
|
4865
|
+
* @param {Function} func The function to check.
|
4866
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
4867
|
+
*/function isMasked(func){return !!maskSrcKey&&maskSrcKey in func;}/**
|
4868
|
+
* Checks if `value` is likely a prototype object.
|
4869
|
+
*
|
4870
|
+
* @private
|
4871
|
+
* @param {*} value The value to check.
|
4872
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
4873
|
+
*/function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=='function'&&Ctor.prototype||objectProto;return value===proto;}/**
|
4874
|
+
* Converts `func` to its source code.
|
4875
|
+
*
|
4876
|
+
* @private
|
4877
|
+
* @param {Function} func The function to process.
|
4878
|
+
* @returns {string} Returns the source code.
|
4879
|
+
*/function toSource(func){if(func!=null){try{return funcToString.call(func);}catch(e){}try{return func+'';}catch(e){}}return '';}/**
|
4880
|
+
* This method is like `_.clone` except that it recursively clones `value`.
|
4881
|
+
*
|
4882
|
+
* @static
|
4883
|
+
* @memberOf _
|
4884
|
+
* @since 1.0.0
|
4885
|
+
* @category Lang
|
4886
|
+
* @param {*} value The value to recursively clone.
|
4887
|
+
* @returns {*} Returns the deep cloned value.
|
4888
|
+
* @see _.clone
|
4889
|
+
* @example
|
4890
|
+
*
|
4891
|
+
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
4892
|
+
*
|
4893
|
+
* var deep = _.cloneDeep(objects);
|
4894
|
+
* console.log(deep[0] === objects[0]);
|
4895
|
+
* // => false
|
4896
|
+
*/function cloneDeep(value){return baseClone(value,true,true);}/**
|
4897
|
+
* Performs a
|
4898
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
4899
|
+
* comparison between two values to determine if they are equivalent.
|
4900
|
+
*
|
4901
|
+
* @static
|
4902
|
+
* @memberOf _
|
4903
|
+
* @since 4.0.0
|
4904
|
+
* @category Lang
|
4905
|
+
* @param {*} value The value to compare.
|
4906
|
+
* @param {*} other The other value to compare.
|
4907
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
4908
|
+
* @example
|
4909
|
+
*
|
4910
|
+
* var object = { 'a': 1 };
|
4911
|
+
* var other = { 'a': 1 };
|
4912
|
+
*
|
4913
|
+
* _.eq(object, object);
|
4914
|
+
* // => true
|
4915
|
+
*
|
4916
|
+
* _.eq(object, other);
|
4917
|
+
* // => false
|
4918
|
+
*
|
4919
|
+
* _.eq('a', 'a');
|
4920
|
+
* // => true
|
4921
|
+
*
|
4922
|
+
* _.eq('a', Object('a'));
|
4923
|
+
* // => false
|
4924
|
+
*
|
4925
|
+
* _.eq(NaN, NaN);
|
4926
|
+
* // => true
|
4927
|
+
*/function eq(value,other){return value===other||value!==value&&other!==other;}/**
|
4928
|
+
* Checks if `value` is likely an `arguments` object.
|
4929
|
+
*
|
4930
|
+
* @static
|
4931
|
+
* @memberOf _
|
4932
|
+
* @since 0.1.0
|
4933
|
+
* @category Lang
|
4934
|
+
* @param {*} value The value to check.
|
4935
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
4936
|
+
* else `false`.
|
4937
|
+
* @example
|
4938
|
+
*
|
4939
|
+
* _.isArguments(function() { return arguments; }());
|
4940
|
+
* // => true
|
4941
|
+
*
|
4942
|
+
* _.isArguments([1, 2, 3]);
|
4943
|
+
* // => false
|
4944
|
+
*/function isArguments(value){// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
4945
|
+
return isArrayLikeObject(value)&&hasOwnProperty.call(value,'callee')&&(!propertyIsEnumerable.call(value,'callee')||objectToString.call(value)==argsTag);}/**
|
4946
|
+
* Checks if `value` is classified as an `Array` object.
|
4947
|
+
*
|
4948
|
+
* @static
|
4949
|
+
* @memberOf _
|
4950
|
+
* @since 0.1.0
|
4951
|
+
* @category Lang
|
4952
|
+
* @param {*} value The value to check.
|
4953
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
4954
|
+
* @example
|
4955
|
+
*
|
4956
|
+
* _.isArray([1, 2, 3]);
|
4957
|
+
* // => true
|
4958
|
+
*
|
4959
|
+
* _.isArray(document.body.children);
|
4960
|
+
* // => false
|
4961
|
+
*
|
4962
|
+
* _.isArray('abc');
|
4963
|
+
* // => false
|
4964
|
+
*
|
4965
|
+
* _.isArray(_.noop);
|
4966
|
+
* // => false
|
4967
|
+
*/var isArray=Array.isArray;/**
|
4968
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
4969
|
+
* not a function and has a `value.length` that's an integer greater than or
|
4970
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
4971
|
+
*
|
4972
|
+
* @static
|
4973
|
+
* @memberOf _
|
4974
|
+
* @since 4.0.0
|
4975
|
+
* @category Lang
|
4976
|
+
* @param {*} value The value to check.
|
4977
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
4978
|
+
* @example
|
4979
|
+
*
|
4980
|
+
* _.isArrayLike([1, 2, 3]);
|
4981
|
+
* // => true
|
4982
|
+
*
|
4983
|
+
* _.isArrayLike(document.body.children);
|
4984
|
+
* // => true
|
4985
|
+
*
|
4986
|
+
* _.isArrayLike('abc');
|
4987
|
+
* // => true
|
4988
|
+
*
|
4989
|
+
* _.isArrayLike(_.noop);
|
4990
|
+
* // => false
|
4991
|
+
*/function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}/**
|
4992
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
4993
|
+
* is an object.
|
4994
|
+
*
|
4995
|
+
* @static
|
4996
|
+
* @memberOf _
|
4997
|
+
* @since 4.0.0
|
4998
|
+
* @category Lang
|
4999
|
+
* @param {*} value The value to check.
|
5000
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
5001
|
+
* else `false`.
|
5002
|
+
* @example
|
5003
|
+
*
|
5004
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
5005
|
+
* // => true
|
5006
|
+
*
|
5007
|
+
* _.isArrayLikeObject(document.body.children);
|
5008
|
+
* // => true
|
5009
|
+
*
|
5010
|
+
* _.isArrayLikeObject('abc');
|
5011
|
+
* // => false
|
5012
|
+
*
|
5013
|
+
* _.isArrayLikeObject(_.noop);
|
5014
|
+
* // => false
|
5015
|
+
*/function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}/**
|
5016
|
+
* Checks if `value` is a buffer.
|
5017
|
+
*
|
5018
|
+
* @static
|
5019
|
+
* @memberOf _
|
5020
|
+
* @since 4.3.0
|
5021
|
+
* @category Lang
|
5022
|
+
* @param {*} value The value to check.
|
5023
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
5024
|
+
* @example
|
5025
|
+
*
|
5026
|
+
* _.isBuffer(new Buffer(2));
|
5027
|
+
* // => true
|
5028
|
+
*
|
5029
|
+
* _.isBuffer(new Uint8Array(2));
|
5030
|
+
* // => false
|
5031
|
+
*/var isBuffer=nativeIsBuffer||stubFalse;/**
|
5032
|
+
* Checks if `value` is classified as a `Function` object.
|
5033
|
+
*
|
5034
|
+
* @static
|
5035
|
+
* @memberOf _
|
5036
|
+
* @since 0.1.0
|
5037
|
+
* @category Lang
|
5038
|
+
* @param {*} value The value to check.
|
5039
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
5040
|
+
* @example
|
5041
|
+
*
|
5042
|
+
* _.isFunction(_);
|
5043
|
+
* // => true
|
5044
|
+
*
|
5045
|
+
* _.isFunction(/abc/);
|
5046
|
+
* // => false
|
5047
|
+
*/function isFunction(value){// The use of `Object#toString` avoids issues with the `typeof` operator
|
5038
5048
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
5039
|
-
var tag=isObject(value)?objectToString.call(value):'';return tag==funcTag||tag==genTag;}/**
|
5040
|
-
|
5041
|
-
|
5042
|
-
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5047
|
-
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
|
5054
|
-
|
5055
|
-
|
5056
|
-
|
5057
|
-
|
5058
|
-
|
5059
|
-
|
5060
|
-
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
|
5069
|
-
|
5070
|
-
|
5071
|
-
|
5072
|
-
|
5073
|
-
|
5074
|
-
|
5075
|
-
|
5076
|
-
|
5077
|
-
|
5078
|
-
|
5079
|
-
|
5080
|
-
|
5081
|
-
|
5082
|
-
|
5083
|
-
|
5084
|
-
|
5085
|
-
|
5086
|
-
|
5087
|
-
|
5088
|
-
|
5089
|
-
|
5090
|
-
|
5091
|
-
|
5092
|
-
|
5093
|
-
|
5094
|
-
|
5095
|
-
|
5096
|
-
|
5097
|
-
|
5098
|
-
|
5099
|
-
|
5100
|
-
|
5101
|
-
|
5102
|
-
|
5103
|
-
|
5104
|
-
|
5105
|
-
|
5106
|
-
|
5107
|
-
|
5108
|
-
|
5109
|
-
|
5110
|
-
|
5111
|
-
|
5112
|
-
|
5113
|
-
|
5114
|
-
|
5115
|
-
|
5116
|
-
|
5117
|
-
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5125
|
-
|
5126
|
-
|
5127
|
-
|
5128
|
-
|
5129
|
-
|
5130
|
-
|
5131
|
-
|
5132
|
-
|
5133
|
-
|
5134
|
-
|
5135
|
-
|
5136
|
-
|
5137
|
-
|
5138
|
-
|
5139
|
-
|
5140
|
-
|
5141
|
-
|
5142
|
-
|
5143
|
-
|
5144
|
-
|
5145
|
-
|
5146
|
-
|
5147
|
-
|
5148
|
-
|
5149
|
-
|
5150
|
-
|
5151
|
-
|
5152
|
-
|
5153
|
-
|
5154
|
-
|
5155
|
-
|
5156
|
-
|
5157
|
-
|
5158
|
-
|
5159
|
-
|
5160
|
-
|
5161
|
-
|
5162
|
-
|
5163
|
-
|
5164
|
-
|
5165
|
-
|
5166
|
-
|
5167
|
-
|
5168
|
-
|
5169
|
-
/**
|
5170
|
-
* - Create a request object
|
5171
|
-
* - Get response body
|
5172
|
-
* - Check if timeout
|
5173
|
-
*/function fetchAdapter(_x){return _fetchAdapter.apply(this,arguments);}/**
|
5174
|
-
* Fetch API stage two is to get response body. This funtion tries to retrieve
|
5175
|
-
* response body based on response's type
|
5176
|
-
*/function _fetchAdapter(){_fetchAdapter=_asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(config){var request,promiseChain,data;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:request=createRequest(config);promiseChain=[getResponse(request,config)];if(config.timeout&&config.timeout>0){promiseChain.push(new Promise(function(res){setTimeout(function(){var message=config.timeoutErrorMessage?config.timeoutErrorMessage:'timeout of '+config.timeout+'ms exceeded';res(createError(message,config,'ECONNABORTED',request));},config.timeout);}));}_context.next=5;return Promise.race(promiseChain);case 5:data=_context.sent;return _context.abrupt("return",new Promise(function(resolve,reject){if(data instanceof Error){reject(data);}else {Object.prototype.toString.call(config.settle)==='[object Function]'?config.settle(resolve,reject,data):settle
|
5177
|
-
* This function will create a Request object based on configuration's axios
|
5049
|
+
var tag=isObject(value)?objectToString.call(value):'';return tag==funcTag||tag==genTag;}/**
|
5050
|
+
* Checks if `value` is a valid array-like length.
|
5051
|
+
*
|
5052
|
+
* **Note:** This method is loosely based on
|
5053
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
5054
|
+
*
|
5055
|
+
* @static
|
5056
|
+
* @memberOf _
|
5057
|
+
* @since 4.0.0
|
5058
|
+
* @category Lang
|
5059
|
+
* @param {*} value The value to check.
|
5060
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
5061
|
+
* @example
|
5062
|
+
*
|
5063
|
+
* _.isLength(3);
|
5064
|
+
* // => true
|
5065
|
+
*
|
5066
|
+
* _.isLength(Number.MIN_VALUE);
|
5067
|
+
* // => false
|
5068
|
+
*
|
5069
|
+
* _.isLength(Infinity);
|
5070
|
+
* // => false
|
5071
|
+
*
|
5072
|
+
* _.isLength('3');
|
5073
|
+
* // => false
|
5074
|
+
*/function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}/**
|
5075
|
+
* Checks if `value` is the
|
5076
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
5077
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
5078
|
+
*
|
5079
|
+
* @static
|
5080
|
+
* @memberOf _
|
5081
|
+
* @since 0.1.0
|
5082
|
+
* @category Lang
|
5083
|
+
* @param {*} value The value to check.
|
5084
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
5085
|
+
* @example
|
5086
|
+
*
|
5087
|
+
* _.isObject({});
|
5088
|
+
* // => true
|
5089
|
+
*
|
5090
|
+
* _.isObject([1, 2, 3]);
|
5091
|
+
* // => true
|
5092
|
+
*
|
5093
|
+
* _.isObject(_.noop);
|
5094
|
+
* // => true
|
5095
|
+
*
|
5096
|
+
* _.isObject(null);
|
5097
|
+
* // => false
|
5098
|
+
*/function isObject(value){var type=_typeof(value);return !!value&&(type=='object'||type=='function');}/**
|
5099
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
5100
|
+
* and has a `typeof` result of "object".
|
5101
|
+
*
|
5102
|
+
* @static
|
5103
|
+
* @memberOf _
|
5104
|
+
* @since 4.0.0
|
5105
|
+
* @category Lang
|
5106
|
+
* @param {*} value The value to check.
|
5107
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
5108
|
+
* @example
|
5109
|
+
*
|
5110
|
+
* _.isObjectLike({});
|
5111
|
+
* // => true
|
5112
|
+
*
|
5113
|
+
* _.isObjectLike([1, 2, 3]);
|
5114
|
+
* // => true
|
5115
|
+
*
|
5116
|
+
* _.isObjectLike(_.noop);
|
5117
|
+
* // => false
|
5118
|
+
*
|
5119
|
+
* _.isObjectLike(null);
|
5120
|
+
* // => false
|
5121
|
+
*/function isObjectLike(value){return !!value&&_typeof(value)=='object';}/**
|
5122
|
+
* Creates an array of the own enumerable property names of `object`.
|
5123
|
+
*
|
5124
|
+
* **Note:** Non-object values are coerced to objects. See the
|
5125
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
5126
|
+
* for more details.
|
5127
|
+
*
|
5128
|
+
* @static
|
5129
|
+
* @since 0.1.0
|
5130
|
+
* @memberOf _
|
5131
|
+
* @category Object
|
5132
|
+
* @param {Object} object The object to query.
|
5133
|
+
* @returns {Array} Returns the array of property names.
|
5134
|
+
* @example
|
5135
|
+
*
|
5136
|
+
* function Foo() {
|
5137
|
+
* this.a = 1;
|
5138
|
+
* this.b = 2;
|
5139
|
+
* }
|
5140
|
+
*
|
5141
|
+
* Foo.prototype.c = 3;
|
5142
|
+
*
|
5143
|
+
* _.keys(new Foo);
|
5144
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
5145
|
+
*
|
5146
|
+
* _.keys('hi');
|
5147
|
+
* // => ['0', '1']
|
5148
|
+
*/function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}/**
|
5149
|
+
* This method returns a new empty array.
|
5150
|
+
*
|
5151
|
+
* @static
|
5152
|
+
* @memberOf _
|
5153
|
+
* @since 4.13.0
|
5154
|
+
* @category Util
|
5155
|
+
* @returns {Array} Returns the new empty array.
|
5156
|
+
* @example
|
5157
|
+
*
|
5158
|
+
* var arrays = _.times(2, _.stubArray);
|
5159
|
+
*
|
5160
|
+
* console.log(arrays);
|
5161
|
+
* // => [[], []]
|
5162
|
+
*
|
5163
|
+
* console.log(arrays[0] === arrays[1]);
|
5164
|
+
* // => false
|
5165
|
+
*/function stubArray(){return [];}/**
|
5166
|
+
* This method returns `false`.
|
5167
|
+
*
|
5168
|
+
* @static
|
5169
|
+
* @memberOf _
|
5170
|
+
* @since 4.13.0
|
5171
|
+
* @category Util
|
5172
|
+
* @returns {boolean} Returns `false`.
|
5173
|
+
* @example
|
5174
|
+
*
|
5175
|
+
* _.times(2, _.stubFalse);
|
5176
|
+
* // => [false, false]
|
5177
|
+
*/function stubFalse(){return false;}module.exports=cloneDeep;})(lodash_clonedeep,lodash_clonedeepExports);var cloneDeep = lodash_clonedeepExports;
|
5178
|
+
|
5179
|
+
/**
|
5180
|
+
* - Create a request object
|
5181
|
+
* - Get response body
|
5182
|
+
* - Check if timeout
|
5183
|
+
*/function fetchAdapter(_x){return _fetchAdapter.apply(this,arguments);}/**
|
5184
|
+
* Fetch API stage two is to get response body. This funtion tries to retrieve
|
5185
|
+
* response body based on response's type
|
5186
|
+
*/function _fetchAdapter(){_fetchAdapter=_asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(config){var request,promiseChain,data;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:request=createRequest(config);promiseChain=[getResponse(request,config)];if(config.timeout&&config.timeout>0){promiseChain.push(new Promise(function(res){setTimeout(function(){var message=config.timeoutErrorMessage?config.timeoutErrorMessage:'timeout of '+config.timeout+'ms exceeded';res(createError(message,config,'ECONNABORTED',request));},config.timeout);}));}_context.next=5;return Promise.race(promiseChain);case 5:data=_context.sent;return _context.abrupt("return",new Promise(function(resolve,reject){if(data instanceof Error){reject(data);}else {Object.prototype.toString.call(config.settle)==='[object Function]'?config.settle(resolve,reject,data):settle(resolve,reject,data);}}));case 7:case"end":return _context.stop();}},_callee);}));return _fetchAdapter.apply(this,arguments);}function getResponse(_x2,_x3){return _getResponse.apply(this,arguments);}/**
|
5187
|
+
* This function will create a Request object based on configuration's axios
|
5178
5188
|
*/function _getResponse(){_getResponse=_asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request,config){var stageOne,response;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return fetch(request);case 3:stageOne=_context2.sent;_context2.next=9;break;case 6:_context2.prev=6;_context2.t0=_context2["catch"](0);return _context2.abrupt("return",createError('Network Error',config,'ERR_NETWORK',request));case 9:response={ok:stageOne.ok,status:stageOne.status,statusText:stageOne.statusText,headers:new Headers(stageOne.headers),// Make a copy of headers
|
5179
|
-
config:config,request:request};if(!(stageOne.status>=200&&stageOne.status!==204)){_context2.next=34;break;}_context2.t1=config.responseType;_context2.next=_context2.t1==='arraybuffer'?14:_context2.t1==='blob'?18:_context2.t1==='json'?22:_context2.t1==='formData'?26:30;break;case 14:_context2.next=16;return stageOne.arrayBuffer();case 16:response.data=_context2.sent;return _context2.abrupt("break",34);case 18:_context2.next=20;return stageOne.blob();case 20:response.data=_context2.sent;return _context2.abrupt("break",34);case 22:_context2.next=24;return stageOne.json();case 24:response.data=_context2.sent;return _context2.abrupt("break",34);case 26:_context2.next=28;return stageOne.formData();case 28:response.data=_context2.sent;return _context2.abrupt("break",34);case 30:_context2.next=32;return stageOne.text();case 32:response.data=_context2.sent;return _context2.abrupt("break",34);case 34:return _context2.abrupt("return",response);case 35:case"end":return _context2.stop();}},_callee2,null,[[0,6]]);}));return _getResponse.apply(this,arguments);}function createRequest(config){var headers=new Headers(config.headers);// HTTP basic authentication
|
5180
|
-
if(config.auth){var username=config.auth.username||'';var password=config.auth.password?decodeURI(encodeURIComponent(config.auth.password)):'';headers.set('Authorization',"Basic ".concat(btoa(username+':'+password)));}var method=config.method.toUpperCase();var options={headers:headers,method:method};if(method!=='GET'&&method!=='HEAD'){options.body=config.data;// In these cases the browser will automatically set the correct Content-Type,
|
5189
|
+
config:config,request:request};if(!(stageOne.status>=200&&stageOne.status!==204)){_context2.next=34;break;}_context2.t1=config.responseType;_context2.next=_context2.t1==='arraybuffer'?14:_context2.t1==='blob'?18:_context2.t1==='json'?22:_context2.t1==='formData'?26:30;break;case 14:_context2.next=16;return stageOne.arrayBuffer();case 16:response.data=_context2.sent;return _context2.abrupt("break",34);case 18:_context2.next=20;return stageOne.blob();case 20:response.data=_context2.sent;return _context2.abrupt("break",34);case 22:_context2.next=24;return stageOne.json();case 24:response.data=_context2.sent;return _context2.abrupt("break",34);case 26:_context2.next=28;return stageOne.formData();case 28:response.data=_context2.sent;return _context2.abrupt("break",34);case 30:_context2.next=32;return stageOne.text();case 32:response.data=_context2.sent;return _context2.abrupt("break",34);case 34:return _context2.abrupt("return",response);case 35:case"end":return _context2.stop();}},_callee2,null,[[0,6]]);}));return _getResponse.apply(this,arguments);}function createRequest(config){var headers=new Headers(config.headers);// HTTP basic authentication
|
5190
|
+
if(config.auth){var username=config.auth.username||'';var password=config.auth.password?decodeURI(encodeURIComponent(config.auth.password)):'';headers.set('Authorization',"Basic ".concat(btoa(username+':'+password)));}var method=config.method.toUpperCase();var options={headers:headers,method:method};if(method!=='GET'&&method!=='HEAD'){options.body=config.data;// In these cases the browser will automatically set the correct Content-Type,
|
5181
5191
|
// but only if that header hasn't been set yet. So that's why we're deleting it.
|
5182
|
-
if(utils$9.isFormData(options.body)&&utils$9.isStandardBrowserEnv()){headers.delete('Content-Type');}}if(config.mode){options.mode=config.mode;}if(config.cache){options.cache=config.cache;}if(config.integrity){options.integrity=config.integrity;}if(config.redirect){options.redirect=config.redirect;}if(config.referrer){options.referrer=config.referrer;}// This config is similar to XHR’s withCredentials flag, but with three available values instead of two.
|
5192
|
+
if(utils$9.isFormData(options.body)&&utils$9.isStandardBrowserEnv()){headers.delete('Content-Type');}}if(config.mode){options.mode=config.mode;}if(config.cache){options.cache=config.cache;}if(config.integrity){options.integrity=config.integrity;}if(config.redirect){options.redirect=config.redirect;}if(config.referrer){options.referrer=config.referrer;}// This config is similar to XHR’s withCredentials flag, but with three available values instead of two.
|
5183
5193
|
// So if withCredentials is not set, default value 'same-origin' will be used
|
5184
|
-
if(!utils$9.isUndefined(config.withCredentials)){options.credentials=config.withCredentials?'include':'omit';}var fullPath=buildFullPath$
|
5185
|
-
return new Request(url,options);}/**
|
5186
|
-
* Note:
|
5187
|
-
*
|
5188
|
-
* From version >= 0.27.0, createError function is replaced by AxiosError class.
|
5189
|
-
* So I copy the old createError function here for backward compatible.
|
5190
|
-
*
|
5191
|
-
*
|
5192
|
-
*
|
5193
|
-
* Create an Error with the specified message, config, error code, request and response.
|
5194
|
-
*
|
5195
|
-
* @param {string} message The error message.
|
5196
|
-
* @param {Object} config The config.
|
5197
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
5198
|
-
* @param {Object} [request] The request.
|
5199
|
-
* @param {Object} [response] The response.
|
5200
|
-
* @returns {Error} The created error.
|
5201
|
-
*/function createError(message,config,code,request,response){if(axios
|
5202
|
-
*
|
5203
|
-
* Note:
|
5204
|
-
*
|
5205
|
-
* This function is for backward compatible.
|
5206
|
-
*
|
5207
|
-
*
|
5208
|
-
* Update an Error with the specified config, error code, and response.
|
5209
|
-
*
|
5210
|
-
* @param {Error} error The error to update.
|
5211
|
-
* @param {Object} config The config.
|
5212
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
5213
|
-
* @param {Object} [request] The request.
|
5214
|
-
* @param {Object} [response] The response.
|
5215
|
-
* @returns {Error} The error.
|
5194
|
+
if(!utils$9.isUndefined(config.withCredentials)){options.credentials=config.withCredentials?'include':'omit';}var fullPath=buildFullPath$1(config.baseURL,config.url);var url=buildURL$1(fullPath,config.params,config.paramsSerializer);// Expected browser to throw error if there is any wrong configuration value
|
5195
|
+
return new Request(url,options);}/**
|
5196
|
+
* Note:
|
5197
|
+
*
|
5198
|
+
* From version >= 0.27.0, createError function is replaced by AxiosError class.
|
5199
|
+
* So I copy the old createError function here for backward compatible.
|
5200
|
+
*
|
5201
|
+
*
|
5202
|
+
*
|
5203
|
+
* Create an Error with the specified message, config, error code, request and response.
|
5204
|
+
*
|
5205
|
+
* @param {string} message The error message.
|
5206
|
+
* @param {Object} config The config.
|
5207
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
5208
|
+
* @param {Object} [request] The request.
|
5209
|
+
* @param {Object} [response] The response.
|
5210
|
+
* @returns {Error} The created error.
|
5211
|
+
*/function createError(message,config,code,request,response){if(axios.AxiosError&&typeof axios.AxiosError==='function'){return new axios.AxiosError(message,axios.AxiosError[code],config,request,response);}var error=new Error(message);return enhanceError(error,config,code,request,response);}/**
|
5212
|
+
*
|
5213
|
+
* Note:
|
5214
|
+
*
|
5215
|
+
* This function is for backward compatible.
|
5216
|
+
*
|
5217
|
+
*
|
5218
|
+
* Update an Error with the specified config, error code, and response.
|
5219
|
+
*
|
5220
|
+
* @param {Error} error The error to update.
|
5221
|
+
* @param {Object} config The config.
|
5222
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
5223
|
+
* @param {Object} [request] The request.
|
5224
|
+
* @param {Object} [response] The response.
|
5225
|
+
* @returns {Error} The error.
|
5216
5226
|
*/function enhanceError(error,config,code,request,response){error.config=config;if(code){error.code=code;}error.request=request;error.response=response;error.isAxiosError=true;error.toJSON=function toJSON(){return {// Standard
|
5217
|
-
message:this.message,name:this.name,// Microsoft
|
5218
|
-
description:this.description,number:this.number,// Mozilla
|
5219
|
-
fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,// Axios
|
5220
|
-
config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null};};return error;}
|
5221
|
-
|
5222
|
-
var version='
|
5223
|
-
|
5224
|
-
|
5225
|
-
|
5226
|
-
|
5227
|
-
|
5228
|
-
|
5229
|
-
|
5230
|
-
|
5231
|
-
|
5232
|
-
|
5233
|
-
|
5234
|
-
|
5235
|
-
|
5236
|
-
*/function Analytics(writeKey,dataPlaneURL,options){_classCallCheck(this,Analytics);options=options||{};if(!writeKey){throw new Error('You must pass your project\'s write key.');}if(!dataPlaneURL){throw new Error('You must pass our data plane url.');}this.queue=[];this.writeKey=writeKey;this.host=removeTrailingSlashes(dataPlaneURL);this.timeout=options.timeout||false;this.flushAt=Math.max(options.flushAt,1)||20;this.flushInterval=options.flushInterval||20000;this.maxInternalQueueSize=options.maxInternalQueueSize||20000;this.logLevel=options.logLevel||'info';this.flushOverride=options.flushOverride&&isFunction(options.flushOverride)?options.flushOverride:undefined;this.flushed=false;this.axiosInstance=axios$1.create({adapter:fetchAdapter});Object.defineProperty(this,'enable',{configurable:false,writable:false,enumerable:true,value:typeof options.enable==='boolean'?options.enable:true});this.logger={error:function error(message){if(this.logLevel!=='off'){var _console;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}(_console=console).error.apply(_console,["".concat(new Date().toISOString()," [\"Rudder\"] error: ").concat(message)].concat(args));}},info:function info(message){if(['silly','debug','info'].includes(this.logLevel)){var _console2;for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}(_console2=console).log.apply(_console2,["".concat(new Date().toISOString()," [\"Rudder\"] info: ").concat(message)].concat(args));}},debug:function debug(message){if(['silly','debug'].includes(this.logLevel)){var _console3;for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];}(_console3=console).debug.apply(_console3,["".concat(new Date().toISOString()," [\"Rudder\"] debug: ").concat(message)].concat(args));}},silly:function silly(message){if(['silly'].includes(this.logLevel)){var _console4;for(var _len4=arguments.length,args=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++){args[_key4-1]=arguments[_key4];}(_console4=console).info.apply(_console4,["".concat(new Date().toISOString()," [\"Rudder\"] silly: ").concat(message)].concat(args));}}};axiosRetry(this.axiosInstance,{retries:0});}_createClass(Analytics,[{key:"_validate",value:function _validate(message,type){try{looselyValidate(message,type);}catch(e){if(e.message==='Your message must be < 32kb.'){this.logger.info('Your message must be < 32kb. This is currently surfaced as a warning. Please update your code',message);return;}throw e;}}/**
|
5227
|
+
message:this.message,name:this.name,// Microsoft
|
5228
|
+
description:this.description,number:this.number,// Mozilla
|
5229
|
+
fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,// Axios
|
5230
|
+
config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null};};return error;}
|
5231
|
+
|
5232
|
+
var version='2.32.0';var removeTrailingSlashes=function removeTrailingSlashes(inURL){return inURL&&inURL.endsWith('/')?inURL.replace(/\/+$/,''):inURL;};var isFunction=function isFunction(value){return typeof value==='function'&&Boolean(value.constructor&&value.call&&value.apply);};var setImmediate=browser$1.nextTick.bind(browser$1);var noop=function noop(){};var Analytics=/*#__PURE__*/function(){/**
|
5233
|
+
* Initialize a new `Analytics` with your RudderStack source's `writeKey` and an
|
5234
|
+
* optional dictionary of `options`.
|
5235
|
+
*
|
5236
|
+
* @param {String} writeKey
|
5237
|
+
* @param {String} dataPlaneURL
|
5238
|
+
* @param {Object=} options (optional)
|
5239
|
+
* @param {Number=20} options.flushAt (default: 20)
|
5240
|
+
* @param {Number=20000} options.flushInterval (default: 20000)
|
5241
|
+
* @param {Boolean=true} options.enable (default: true)
|
5242
|
+
* @param {Number=20000} options.maxInternalQueueSize (default: 20000)
|
5243
|
+
* @param {Number} options.timeout (default: false)
|
5244
|
+
* @param {String=info} options.logLevel (default: info)
|
5245
|
+
*/function Analytics(writeKey,dataPlaneURL,options){_classCallCheck(this,Analytics);options=options||{};if(!writeKey){throw new Error('You must pass your project\'s write key.');}if(!dataPlaneURL){throw new Error('You must pass our data plane url.');}this.queue=[];this.writeKey=writeKey;this.host=removeTrailingSlashes(dataPlaneURL);this.timeout=options.timeout||false;this.flushAt=Math.max(options.flushAt,1)||20;this.flushInterval=options.flushInterval||20000;this.maxInternalQueueSize=options.maxInternalQueueSize||20000;this.logLevel=options.logLevel||'info';this.flushOverride=options.flushOverride&&isFunction(options.flushOverride)?options.flushOverride:undefined;this.flushed=false;this.axiosInstance=axios.create({adapter:fetchAdapter});Object.defineProperty(this,'enable',{configurable:false,writable:false,enumerable:true,value:typeof options.enable==='boolean'?options.enable:true});this.logger={error:function error(message){if(this.logLevel!=='off'){var _console;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}(_console=console).error.apply(_console,["".concat(new Date().toISOString()," [\"Rudder\"] error: ").concat(message)].concat(args));}},info:function info(message){if(['silly','debug','info'].includes(this.logLevel)){var _console2;for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}(_console2=console).log.apply(_console2,["".concat(new Date().toISOString()," [\"Rudder\"] info: ").concat(message)].concat(args));}},debug:function debug(message){if(['silly','debug'].includes(this.logLevel)){var _console3;for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];}(_console3=console).debug.apply(_console3,["".concat(new Date().toISOString()," [\"Rudder\"] debug: ").concat(message)].concat(args));}},silly:function silly(message){if(['silly'].includes(this.logLevel)){var _console4;for(var _len4=arguments.length,args=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++){args[_key4-1]=arguments[_key4];}(_console4=console).info.apply(_console4,["".concat(new Date().toISOString()," [\"Rudder\"] silly: ").concat(message)].concat(args));}}};axiosRetry(this.axiosInstance,{retries:0});}_createClass(Analytics,[{key:"_validate",value:function _validate(message,type){try{looselyValidateEvent_1(message,type);}catch(e){if(e.message==='Your message must be < 32kb.'){this.logger.info('Your message must be < 32kb. This is currently surfaced as a warning. Please update your code',message);return;}throw e;}}/**
|
5237
5246
|
* Send an identify `message`.
|
5238
5247
|
*
|
5239
5248
|
* @param {Object} message
|
@@ -5313,24 +5322,24 @@ var version='0.0.1';var removeTrailingSlashes=function removeTrailingSlashes(inU
|
|
5313
5322
|
* @api private
|
5314
5323
|
*/},{key:"enqueue",value:function enqueue(type,message,callback){if(this.queue.length>=this.maxInternalQueueSize){this.logger.error("not adding events for processing as queue size ".concat(this.queue.length," >= than max configuration ").concat(this.maxInternalQueueSize));return;}// Clone the incoming message object
|
5315
5324
|
// before altering the data
|
5316
|
-
var lMessage=cloneDeep(message);callback=callback||noop;if(!this.enable){return setImmediate(callback);}if(type=='identify'){if(lMessage.traits){if(!lMessage.context){lMessage.context={};}lMessage.context.traits=lMessage.traits;}}lMessage=_objectSpread2({},lMessage);lMessage.type=type;lMessage.context=_objectSpread2({library:{name:'analytics-service-worker',version:version}},lMessage.context);lMessage.channel='service-worker';lMessage._metadata=_objectSpread2({serviceWorkerVersion:version},lMessage._metadata);if(!lMessage.originalTimestamp){lMessage.originalTimestamp=new Date();}if(!lMessage.messageId){lMessage.messageId=v4();}// Historically this library has accepted strings and numbers as IDs.
|
5325
|
+
var lMessage=cloneDeep(message);callback=callback||noop;if(!this.enable){return setImmediate(callback);}if(type=='identify'){if(lMessage.traits){if(!lMessage.context){lMessage.context={};}lMessage.context.traits=lMessage.traits;}}lMessage=_objectSpread2({},lMessage);lMessage.type=type;lMessage.context=_objectSpread2({library:{name:'analytics-service-worker',version:version}},lMessage.context);lMessage.channel='service-worker';lMessage._metadata=_objectSpread2({serviceWorkerVersion:version},lMessage._metadata);if(!lMessage.originalTimestamp){lMessage.originalTimestamp=new Date();}if(!lMessage.messageId){lMessage.messageId=v4();}// Historically this library has accepted strings and numbers as IDs.
|
5317
5326
|
// However, our spec only allows strings. To avoid breaking compatibility,
|
5318
5327
|
// we'll coerce these to strings if they aren't already.
|
5319
|
-
if(lMessage.anonymousId&&!
|
5328
|
+
if(lMessage.anonymousId&&!lodash_isstring(lMessage.anonymousId)){lMessage.anonymousId=JSON.stringify(lMessage.anonymousId);}if(lMessage.userId&&!lodash_isstring(lMessage.userId)){lMessage.userId=JSON.stringify(lMessage.userId);}this.queue.push({message:lMessage,callback:callback});if(!this.flushed){this.flushed=true;this.flush();return;}if(this.queue.length>=this.flushAt){this.logger.debug('flushAt reached, trying flush...');this.flush();}if(this.flushInterval&&!this.flushTimer){this.logger.debug('no existing flush timer, creating new one');this.flushTimer=setTimeout(this.flush.bind(this),this.flushInterval);}}/**
|
5320
5329
|
* Flush the current queue
|
5321
5330
|
*
|
5322
5331
|
* @param {Function} [callback] (optional)
|
5323
5332
|
* @return {Analytics}
|
5324
5333
|
*/},{key:"flush",value:function flush(callback){var _this=this;// check if earlier flush was pushed to queue
|
5325
|
-
this.logger.debug('in flush');callback=callback||noop;if(!this.enable){return setImmediate(callback);}if(this.timer){this.logger.debug('cancelling existing timer...');clearTimeout(this.timer);this.timer=null;}if(this.flushTimer){this.logger.debug('cancelling existing flushTimer...');clearTimeout(this.flushTimer);this.flushTimer=null;}if(!this.queue.length){this.logger.debug('queue is empty, nothing to flush');return setImmediate(callback);}var items=this.queue.splice(0,this.flushAt);var callbacks=items.map(function(item){return item.callback;});var messages=items.map(function(item){// if someone mangles directly with queue
|
5326
|
-
if(_typeof(item.message)==='object'){item.message.sentAt=new Date();}return item.message;});var data={batch:messages,sentAt:new Date()};this.logger.debug("batch size is ".concat(items.length));this.logger.silly('===data===',data);var done=function done(err){callbacks.forEach(function(callback_){callback_(err);});callback(err,data);};// Don't set the user agent if we're not on a browser. The latest spec allows
|
5334
|
+
this.logger.debug('in flush');callback=callback||noop;if(!this.enable){return setImmediate(callback);}if(this.timer){this.logger.debug('cancelling existing timer...');clearTimeout(this.timer);this.timer=null;}if(this.flushTimer){this.logger.debug('cancelling existing flushTimer...');clearTimeout(this.flushTimer);this.flushTimer=null;}if(!this.queue.length){this.logger.debug('queue is empty, nothing to flush');return setImmediate(callback);}var items=this.queue.splice(0,this.flushAt);var callbacks=items.map(function(item){return item.callback;});var messages=items.map(function(item){// if someone mangles directly with queue
|
5335
|
+
if(_typeof(item.message)==='object'){item.message.sentAt=new Date();}return item.message;});var data={batch:messages,sentAt:new Date()};this.logger.debug("batch size is ".concat(items.length));this.logger.silly('===data===',data);var done=function done(err){callbacks.forEach(function(callback_){callback_(err);});callback(err,data);};// Don't set the user agent if we're not on a browser. The latest spec allows
|
5327
5336
|
// the User-Agent header (see https://fetch.spec.whatwg.org/#terminology-headers
|
5328
5337
|
// and https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader),
|
5329
5338
|
// but browsers such as Chrome and Safari have not caught up.
|
5330
|
-
var headers={};if(typeof window==='undefined'){headers['user-agent']="analytics-service-worker/".concat(version);headers['Content-Type']="application/json";}var reqTimeout=typeof this.timeout==='string'?ms
|
5331
|
-
if(axiosRetry.isNetworkError(error)){return true;}if(!error.response){// Cannot determine if the request can be retried
|
5332
|
-
return false;}this.logger.error("error status: ".concat(error.response.status));// Retry Server Errors (5xx).
|
5333
|
-
if(error.response.status>=500&&error.response.status<=599){return true;}// Retry if rate limited.
|
5334
|
-
if(error.response.status===429){return true;}return false;}}]);return Analytics;}();
|
5339
|
+
var headers={};if(typeof window==='undefined'){headers['user-agent']="analytics-service-worker/".concat(version);headers['Content-Type']="application/json";}var reqTimeout=typeof this.timeout==='string'?ms(this.timeout):this.timeout;if(this.flushOverride){this.flushOverride({host:"".concat(this.host),writeKey:this.writeKey,data:data,headers:headers,reqTimeout:reqTimeout,flush:this.flush.bind(this),done:done,isErrorRetryable:this._isErrorRetryable});}else {var req={method:'POST',url:"".concat(this.host),auth:{username:this.writeKey},data:data,headers:headers};if(reqTimeout){req.timeout=reqTimeout;}this.axiosInstance(_objectSpread2(_objectSpread2({},req),{},{'axios-retry':{retries:3,retryCondition:this._isErrorRetryable.bind(this),retryDelay:axiosRetry.exponentialDelay}})).then(function(response){_this.timer=setTimeout(_this.flush.bind(_this),_this.flushInterval);done();}).catch(function(err){console.log(err);_this.logger.error("got error while attempting send for 3 times, dropping ".concat(items.length," events"));_this.timer=setTimeout(_this.flush.bind(_this),_this.flushInterval);if(err.response){var error=new Error(err.response.statusText);return done(error);}done(err);});}}},{key:"_isErrorRetryable",value:function _isErrorRetryable(error){// Retry Network Errors.
|
5340
|
+
if(axiosRetry.isNetworkError(error)){return true;}if(!error.response){// Cannot determine if the request can be retried
|
5341
|
+
return false;}this.logger.error("error status: ".concat(error.response.status));// Retry Server Errors (5xx).
|
5342
|
+
if(error.response.status>=500&&error.response.status<=599){return true;}// Retry if rate limited.
|
5343
|
+
if(error.response.status===429){return true;}return false;}}]);return Analytics;}();
|
5335
5344
|
|
5336
5345
|
export { Analytics };
|